google_cloud_datastream_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate location;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// Request message for 'discover' ConnectionProfile request.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct DiscoverConnectionProfileRequest {
44 /// Required. The parent resource of the connection profile type. Must be in
45 /// the format `projects/*/locations/*`.
46 pub parent: std::string::String,
47
48 /// The connection profile on which to run discover.
49 pub target: std::option::Option<crate::model::discover_connection_profile_request::Target>,
50
51 /// The depth of the retrieved hierarchy of data objects.
52 pub hierarchy:
53 std::option::Option<crate::model::discover_connection_profile_request::Hierarchy>,
54
55 /// The data object to populate with child data objects and metadata.
56 pub data_object:
57 std::option::Option<crate::model::discover_connection_profile_request::DataObject>,
58
59 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
60}
61
62impl DiscoverConnectionProfileRequest {
63 pub fn new() -> Self {
64 std::default::Default::default()
65 }
66
67 /// Sets the value of [parent][crate::model::DiscoverConnectionProfileRequest::parent].
68 ///
69 /// # Example
70 /// ```ignore,no_run
71 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
72 /// let x = DiscoverConnectionProfileRequest::new().set_parent("example");
73 /// ```
74 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
75 self.parent = v.into();
76 self
77 }
78
79 /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target].
80 ///
81 /// Note that all the setters affecting `target` are mutually
82 /// exclusive.
83 ///
84 /// # Example
85 /// ```ignore,no_run
86 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
87 /// use google_cloud_datastream_v1::model::discover_connection_profile_request::Target;
88 /// let x = DiscoverConnectionProfileRequest::new().set_target(Some(Target::ConnectionProfileName("example".to_string())));
89 /// ```
90 pub fn set_target<
91 T: std::convert::Into<
92 std::option::Option<crate::model::discover_connection_profile_request::Target>,
93 >,
94 >(
95 mut self,
96 v: T,
97 ) -> Self {
98 self.target = v.into();
99 self
100 }
101
102 /// The value of [target][crate::model::DiscoverConnectionProfileRequest::target]
103 /// if it holds a `ConnectionProfile`, `None` if the field is not set or
104 /// holds a different branch.
105 pub fn connection_profile(
106 &self,
107 ) -> std::option::Option<&std::boxed::Box<crate::model::ConnectionProfile>> {
108 #[allow(unreachable_patterns)]
109 self.target.as_ref().and_then(|v| match v {
110 crate::model::discover_connection_profile_request::Target::ConnectionProfile(v) => {
111 std::option::Option::Some(v)
112 }
113 _ => std::option::Option::None,
114 })
115 }
116
117 /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
118 /// to hold a `ConnectionProfile`.
119 ///
120 /// Note that all the setters affecting `target` are
121 /// mutually exclusive.
122 ///
123 /// # Example
124 /// ```ignore,no_run
125 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
126 /// use google_cloud_datastream_v1::model::ConnectionProfile;
127 /// let x = DiscoverConnectionProfileRequest::new().set_connection_profile(ConnectionProfile::default()/* use setters */);
128 /// assert!(x.connection_profile().is_some());
129 /// assert!(x.connection_profile_name().is_none());
130 /// ```
131 pub fn set_connection_profile<
132 T: std::convert::Into<std::boxed::Box<crate::model::ConnectionProfile>>,
133 >(
134 mut self,
135 v: T,
136 ) -> Self {
137 self.target = std::option::Option::Some(
138 crate::model::discover_connection_profile_request::Target::ConnectionProfile(v.into()),
139 );
140 self
141 }
142
143 /// The value of [target][crate::model::DiscoverConnectionProfileRequest::target]
144 /// if it holds a `ConnectionProfileName`, `None` if the field is not set or
145 /// holds a different branch.
146 pub fn connection_profile_name(&self) -> std::option::Option<&std::string::String> {
147 #[allow(unreachable_patterns)]
148 self.target.as_ref().and_then(|v| match v {
149 crate::model::discover_connection_profile_request::Target::ConnectionProfileName(v) => {
150 std::option::Option::Some(v)
151 }
152 _ => std::option::Option::None,
153 })
154 }
155
156 /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
157 /// to hold a `ConnectionProfileName`.
158 ///
159 /// Note that all the setters affecting `target` are
160 /// mutually exclusive.
161 ///
162 /// # Example
163 /// ```ignore,no_run
164 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
165 /// let x = DiscoverConnectionProfileRequest::new().set_connection_profile_name("example");
166 /// assert!(x.connection_profile_name().is_some());
167 /// assert!(x.connection_profile().is_none());
168 /// ```
169 pub fn set_connection_profile_name<T: std::convert::Into<std::string::String>>(
170 mut self,
171 v: T,
172 ) -> Self {
173 self.target = std::option::Option::Some(
174 crate::model::discover_connection_profile_request::Target::ConnectionProfileName(
175 v.into(),
176 ),
177 );
178 self
179 }
180
181 /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy].
182 ///
183 /// Note that all the setters affecting `hierarchy` are mutually
184 /// exclusive.
185 ///
186 /// # Example
187 /// ```ignore,no_run
188 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
189 /// use google_cloud_datastream_v1::model::discover_connection_profile_request::Hierarchy;
190 /// let x = DiscoverConnectionProfileRequest::new().set_hierarchy(Some(Hierarchy::FullHierarchy(true)));
191 /// ```
192 pub fn set_hierarchy<
193 T: std::convert::Into<
194 std::option::Option<crate::model::discover_connection_profile_request::Hierarchy>,
195 >,
196 >(
197 mut self,
198 v: T,
199 ) -> Self {
200 self.hierarchy = v.into();
201 self
202 }
203
204 /// The value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
205 /// if it holds a `FullHierarchy`, `None` if the field is not set or
206 /// holds a different branch.
207 pub fn full_hierarchy(&self) -> std::option::Option<&bool> {
208 #[allow(unreachable_patterns)]
209 self.hierarchy.as_ref().and_then(|v| match v {
210 crate::model::discover_connection_profile_request::Hierarchy::FullHierarchy(v) => {
211 std::option::Option::Some(v)
212 }
213 _ => std::option::Option::None,
214 })
215 }
216
217 /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
218 /// to hold a `FullHierarchy`.
219 ///
220 /// Note that all the setters affecting `hierarchy` are
221 /// mutually exclusive.
222 ///
223 /// # Example
224 /// ```ignore,no_run
225 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
226 /// let x = DiscoverConnectionProfileRequest::new().set_full_hierarchy(true);
227 /// assert!(x.full_hierarchy().is_some());
228 /// assert!(x.hierarchy_depth().is_none());
229 /// ```
230 pub fn set_full_hierarchy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
231 self.hierarchy = std::option::Option::Some(
232 crate::model::discover_connection_profile_request::Hierarchy::FullHierarchy(v.into()),
233 );
234 self
235 }
236
237 /// The value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
238 /// if it holds a `HierarchyDepth`, `None` if the field is not set or
239 /// holds a different branch.
240 pub fn hierarchy_depth(&self) -> std::option::Option<&i32> {
241 #[allow(unreachable_patterns)]
242 self.hierarchy.as_ref().and_then(|v| match v {
243 crate::model::discover_connection_profile_request::Hierarchy::HierarchyDepth(v) => {
244 std::option::Option::Some(v)
245 }
246 _ => std::option::Option::None,
247 })
248 }
249
250 /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
251 /// to hold a `HierarchyDepth`.
252 ///
253 /// Note that all the setters affecting `hierarchy` are
254 /// mutually exclusive.
255 ///
256 /// # Example
257 /// ```ignore,no_run
258 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
259 /// let x = DiscoverConnectionProfileRequest::new().set_hierarchy_depth(42);
260 /// assert!(x.hierarchy_depth().is_some());
261 /// assert!(x.full_hierarchy().is_none());
262 /// ```
263 pub fn set_hierarchy_depth<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
264 self.hierarchy = std::option::Option::Some(
265 crate::model::discover_connection_profile_request::Hierarchy::HierarchyDepth(v.into()),
266 );
267 self
268 }
269
270 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object].
271 ///
272 /// Note that all the setters affecting `data_object` are mutually
273 /// exclusive.
274 ///
275 /// # Example
276 /// ```ignore,no_run
277 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
278 /// use google_cloud_datastream_v1::model::OracleRdbms;
279 /// let x = DiscoverConnectionProfileRequest::new().set_data_object(Some(
280 /// google_cloud_datastream_v1::model::discover_connection_profile_request::DataObject::OracleRdbms(OracleRdbms::default().into())));
281 /// ```
282 pub fn set_data_object<
283 T: std::convert::Into<
284 std::option::Option<crate::model::discover_connection_profile_request::DataObject>,
285 >,
286 >(
287 mut self,
288 v: T,
289 ) -> Self {
290 self.data_object = v.into();
291 self
292 }
293
294 /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
295 /// if it holds a `OracleRdbms`, `None` if the field is not set or
296 /// holds a different branch.
297 pub fn oracle_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
298 #[allow(unreachable_patterns)]
299 self.data_object.as_ref().and_then(|v| match v {
300 crate::model::discover_connection_profile_request::DataObject::OracleRdbms(v) => {
301 std::option::Option::Some(v)
302 }
303 _ => std::option::Option::None,
304 })
305 }
306
307 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
308 /// to hold a `OracleRdbms`.
309 ///
310 /// Note that all the setters affecting `data_object` are
311 /// mutually exclusive.
312 ///
313 /// # Example
314 /// ```ignore,no_run
315 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
316 /// use google_cloud_datastream_v1::model::OracleRdbms;
317 /// let x = DiscoverConnectionProfileRequest::new().set_oracle_rdbms(OracleRdbms::default()/* use setters */);
318 /// assert!(x.oracle_rdbms().is_some());
319 /// assert!(x.mysql_rdbms().is_none());
320 /// assert!(x.postgresql_rdbms().is_none());
321 /// assert!(x.sql_server_rdbms().is_none());
322 /// assert!(x.salesforce_org().is_none());
323 /// assert!(x.mongodb_cluster().is_none());
324 /// ```
325 pub fn set_oracle_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>>(
326 mut self,
327 v: T,
328 ) -> Self {
329 self.data_object = std::option::Option::Some(
330 crate::model::discover_connection_profile_request::DataObject::OracleRdbms(v.into()),
331 );
332 self
333 }
334
335 /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
336 /// if it holds a `MysqlRdbms`, `None` if the field is not set or
337 /// holds a different branch.
338 pub fn mysql_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
339 #[allow(unreachable_patterns)]
340 self.data_object.as_ref().and_then(|v| match v {
341 crate::model::discover_connection_profile_request::DataObject::MysqlRdbms(v) => {
342 std::option::Option::Some(v)
343 }
344 _ => std::option::Option::None,
345 })
346 }
347
348 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
349 /// to hold a `MysqlRdbms`.
350 ///
351 /// Note that all the setters affecting `data_object` are
352 /// mutually exclusive.
353 ///
354 /// # Example
355 /// ```ignore,no_run
356 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
357 /// use google_cloud_datastream_v1::model::MysqlRdbms;
358 /// let x = DiscoverConnectionProfileRequest::new().set_mysql_rdbms(MysqlRdbms::default()/* use setters */);
359 /// assert!(x.mysql_rdbms().is_some());
360 /// assert!(x.oracle_rdbms().is_none());
361 /// assert!(x.postgresql_rdbms().is_none());
362 /// assert!(x.sql_server_rdbms().is_none());
363 /// assert!(x.salesforce_org().is_none());
364 /// assert!(x.mongodb_cluster().is_none());
365 /// ```
366 pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
367 mut self,
368 v: T,
369 ) -> Self {
370 self.data_object = std::option::Option::Some(
371 crate::model::discover_connection_profile_request::DataObject::MysqlRdbms(v.into()),
372 );
373 self
374 }
375
376 /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
377 /// if it holds a `PostgresqlRdbms`, `None` if the field is not set or
378 /// holds a different branch.
379 pub fn postgresql_rdbms(
380 &self,
381 ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
382 #[allow(unreachable_patterns)]
383 self.data_object.as_ref().and_then(|v| match v {
384 crate::model::discover_connection_profile_request::DataObject::PostgresqlRdbms(v) => {
385 std::option::Option::Some(v)
386 }
387 _ => std::option::Option::None,
388 })
389 }
390
391 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
392 /// to hold a `PostgresqlRdbms`.
393 ///
394 /// Note that all the setters affecting `data_object` are
395 /// mutually exclusive.
396 ///
397 /// # Example
398 /// ```ignore,no_run
399 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
400 /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
401 /// let x = DiscoverConnectionProfileRequest::new().set_postgresql_rdbms(PostgresqlRdbms::default()/* use setters */);
402 /// assert!(x.postgresql_rdbms().is_some());
403 /// assert!(x.oracle_rdbms().is_none());
404 /// assert!(x.mysql_rdbms().is_none());
405 /// assert!(x.sql_server_rdbms().is_none());
406 /// assert!(x.salesforce_org().is_none());
407 /// assert!(x.mongodb_cluster().is_none());
408 /// ```
409 pub fn set_postgresql_rdbms<
410 T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
411 >(
412 mut self,
413 v: T,
414 ) -> Self {
415 self.data_object = std::option::Option::Some(
416 crate::model::discover_connection_profile_request::DataObject::PostgresqlRdbms(
417 v.into(),
418 ),
419 );
420 self
421 }
422
423 /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
424 /// if it holds a `SqlServerRdbms`, `None` if the field is not set or
425 /// holds a different branch.
426 pub fn sql_server_rdbms(
427 &self,
428 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
429 #[allow(unreachable_patterns)]
430 self.data_object.as_ref().and_then(|v| match v {
431 crate::model::discover_connection_profile_request::DataObject::SqlServerRdbms(v) => {
432 std::option::Option::Some(v)
433 }
434 _ => std::option::Option::None,
435 })
436 }
437
438 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
439 /// to hold a `SqlServerRdbms`.
440 ///
441 /// Note that all the setters affecting `data_object` are
442 /// mutually exclusive.
443 ///
444 /// # Example
445 /// ```ignore,no_run
446 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
447 /// use google_cloud_datastream_v1::model::SqlServerRdbms;
448 /// let x = DiscoverConnectionProfileRequest::new().set_sql_server_rdbms(SqlServerRdbms::default()/* use setters */);
449 /// assert!(x.sql_server_rdbms().is_some());
450 /// assert!(x.oracle_rdbms().is_none());
451 /// assert!(x.mysql_rdbms().is_none());
452 /// assert!(x.postgresql_rdbms().is_none());
453 /// assert!(x.salesforce_org().is_none());
454 /// assert!(x.mongodb_cluster().is_none());
455 /// ```
456 pub fn set_sql_server_rdbms<
457 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
458 >(
459 mut self,
460 v: T,
461 ) -> Self {
462 self.data_object = std::option::Option::Some(
463 crate::model::discover_connection_profile_request::DataObject::SqlServerRdbms(v.into()),
464 );
465 self
466 }
467
468 /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
469 /// if it holds a `SalesforceOrg`, `None` if the field is not set or
470 /// holds a different branch.
471 pub fn salesforce_org(
472 &self,
473 ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
474 #[allow(unreachable_patterns)]
475 self.data_object.as_ref().and_then(|v| match v {
476 crate::model::discover_connection_profile_request::DataObject::SalesforceOrg(v) => {
477 std::option::Option::Some(v)
478 }
479 _ => std::option::Option::None,
480 })
481 }
482
483 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
484 /// to hold a `SalesforceOrg`.
485 ///
486 /// Note that all the setters affecting `data_object` are
487 /// mutually exclusive.
488 ///
489 /// # Example
490 /// ```ignore,no_run
491 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
492 /// use google_cloud_datastream_v1::model::SalesforceOrg;
493 /// let x = DiscoverConnectionProfileRequest::new().set_salesforce_org(SalesforceOrg::default()/* use setters */);
494 /// assert!(x.salesforce_org().is_some());
495 /// assert!(x.oracle_rdbms().is_none());
496 /// assert!(x.mysql_rdbms().is_none());
497 /// assert!(x.postgresql_rdbms().is_none());
498 /// assert!(x.sql_server_rdbms().is_none());
499 /// assert!(x.mongodb_cluster().is_none());
500 /// ```
501 pub fn set_salesforce_org<
502 T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
503 >(
504 mut self,
505 v: T,
506 ) -> Self {
507 self.data_object = std::option::Option::Some(
508 crate::model::discover_connection_profile_request::DataObject::SalesforceOrg(v.into()),
509 );
510 self
511 }
512
513 /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
514 /// if it holds a `MongodbCluster`, `None` if the field is not set or
515 /// holds a different branch.
516 pub fn mongodb_cluster(
517 &self,
518 ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
519 #[allow(unreachable_patterns)]
520 self.data_object.as_ref().and_then(|v| match v {
521 crate::model::discover_connection_profile_request::DataObject::MongodbCluster(v) => {
522 std::option::Option::Some(v)
523 }
524 _ => std::option::Option::None,
525 })
526 }
527
528 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
529 /// to hold a `MongodbCluster`.
530 ///
531 /// Note that all the setters affecting `data_object` are
532 /// mutually exclusive.
533 ///
534 /// # Example
535 /// ```ignore,no_run
536 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
537 /// use google_cloud_datastream_v1::model::MongodbCluster;
538 /// let x = DiscoverConnectionProfileRequest::new().set_mongodb_cluster(MongodbCluster::default()/* use setters */);
539 /// assert!(x.mongodb_cluster().is_some());
540 /// assert!(x.oracle_rdbms().is_none());
541 /// assert!(x.mysql_rdbms().is_none());
542 /// assert!(x.postgresql_rdbms().is_none());
543 /// assert!(x.sql_server_rdbms().is_none());
544 /// assert!(x.salesforce_org().is_none());
545 /// ```
546 pub fn set_mongodb_cluster<
547 T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
548 >(
549 mut self,
550 v: T,
551 ) -> Self {
552 self.data_object = std::option::Option::Some(
553 crate::model::discover_connection_profile_request::DataObject::MongodbCluster(v.into()),
554 );
555 self
556 }
557}
558
559impl wkt::message::Message for DiscoverConnectionProfileRequest {
560 fn typename() -> &'static str {
561 "type.googleapis.com/google.cloud.datastream.v1.DiscoverConnectionProfileRequest"
562 }
563}
564
565/// Defines additional types related to [DiscoverConnectionProfileRequest].
566pub mod discover_connection_profile_request {
567 #[allow(unused_imports)]
568 use super::*;
569
570 /// The connection profile on which to run discover.
571 #[derive(Clone, Debug, PartialEq)]
572 #[non_exhaustive]
573 pub enum Target {
574 /// An ad-hoc connection profile configuration.
575 ConnectionProfile(std::boxed::Box<crate::model::ConnectionProfile>),
576 /// A reference to an existing connection profile.
577 ConnectionProfileName(std::string::String),
578 }
579
580 /// The depth of the retrieved hierarchy of data objects.
581 #[derive(Clone, Debug, PartialEq)]
582 #[non_exhaustive]
583 pub enum Hierarchy {
584 /// Whether to retrieve the full hierarchy of data objects (TRUE) or only the
585 /// current level (FALSE).
586 FullHierarchy(bool),
587 /// The number of hierarchy levels below the current level to be retrieved.
588 HierarchyDepth(i32),
589 }
590
591 /// The data object to populate with child data objects and metadata.
592 #[derive(Clone, Debug, PartialEq)]
593 #[non_exhaustive]
594 pub enum DataObject {
595 /// Oracle RDBMS to enrich with child data objects and metadata.
596 OracleRdbms(std::boxed::Box<crate::model::OracleRdbms>),
597 /// MySQL RDBMS to enrich with child data objects and metadata.
598 MysqlRdbms(std::boxed::Box<crate::model::MysqlRdbms>),
599 /// PostgreSQL RDBMS to enrich with child data objects and metadata.
600 PostgresqlRdbms(std::boxed::Box<crate::model::PostgresqlRdbms>),
601 /// SQLServer RDBMS to enrich with child data objects and metadata.
602 SqlServerRdbms(std::boxed::Box<crate::model::SqlServerRdbms>),
603 /// Salesforce organization to enrich with child data objects and metadata.
604 SalesforceOrg(std::boxed::Box<crate::model::SalesforceOrg>),
605 /// MongoDB cluster to enrich with child data objects and metadata.
606 MongodbCluster(std::boxed::Box<crate::model::MongodbCluster>),
607 }
608}
609
610/// Response from a discover request.
611#[derive(Clone, Default, PartialEq)]
612#[non_exhaustive]
613pub struct DiscoverConnectionProfileResponse {
614 /// The data object that has been enriched by the discover API call.
615 pub data_object:
616 std::option::Option<crate::model::discover_connection_profile_response::DataObject>,
617
618 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
619}
620
621impl DiscoverConnectionProfileResponse {
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 pub fn new() -> Self {
969 std::default::Default::default()
970 }
971
972 /// Sets the value of [name][crate::model::FetchStaticIpsRequest::name].
973 ///
974 /// # Example
975 /// ```ignore,no_run
976 /// # use google_cloud_datastream_v1::model::FetchStaticIpsRequest;
977 /// let x = FetchStaticIpsRequest::new().set_name("example");
978 /// ```
979 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
980 self.name = v.into();
981 self
982 }
983
984 /// Sets the value of [page_size][crate::model::FetchStaticIpsRequest::page_size].
985 ///
986 /// # Example
987 /// ```ignore,no_run
988 /// # use google_cloud_datastream_v1::model::FetchStaticIpsRequest;
989 /// let x = FetchStaticIpsRequest::new().set_page_size(42);
990 /// ```
991 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
992 self.page_size = v.into();
993 self
994 }
995
996 /// Sets the value of [page_token][crate::model::FetchStaticIpsRequest::page_token].
997 ///
998 /// # Example
999 /// ```ignore,no_run
1000 /// # use google_cloud_datastream_v1::model::FetchStaticIpsRequest;
1001 /// let x = FetchStaticIpsRequest::new().set_page_token("example");
1002 /// ```
1003 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1004 self.page_token = v.into();
1005 self
1006 }
1007}
1008
1009impl wkt::message::Message for FetchStaticIpsRequest {
1010 fn typename() -> &'static str {
1011 "type.googleapis.com/google.cloud.datastream.v1.FetchStaticIpsRequest"
1012 }
1013}
1014
1015/// Response message for a 'FetchStaticIps' response.
1016#[derive(Clone, Default, PartialEq)]
1017#[non_exhaustive]
1018pub struct FetchStaticIpsResponse {
1019 /// list of static ips by account
1020 pub static_ips: std::vec::Vec<std::string::String>,
1021
1022 /// A token that can be sent as `page_token` to retrieve the next page.
1023 /// If this field is omitted, there are no subsequent pages.
1024 pub next_page_token: std::string::String,
1025
1026 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1027}
1028
1029impl FetchStaticIpsResponse {
1030 pub fn new() -> Self {
1031 std::default::Default::default()
1032 }
1033
1034 /// Sets the value of [static_ips][crate::model::FetchStaticIpsResponse::static_ips].
1035 ///
1036 /// # Example
1037 /// ```ignore,no_run
1038 /// # use google_cloud_datastream_v1::model::FetchStaticIpsResponse;
1039 /// let x = FetchStaticIpsResponse::new().set_static_ips(["a", "b", "c"]);
1040 /// ```
1041 pub fn set_static_ips<T, V>(mut self, v: T) -> Self
1042 where
1043 T: std::iter::IntoIterator<Item = V>,
1044 V: std::convert::Into<std::string::String>,
1045 {
1046 use std::iter::Iterator;
1047 self.static_ips = v.into_iter().map(|i| i.into()).collect();
1048 self
1049 }
1050
1051 /// Sets the value of [next_page_token][crate::model::FetchStaticIpsResponse::next_page_token].
1052 ///
1053 /// # Example
1054 /// ```ignore,no_run
1055 /// # use google_cloud_datastream_v1::model::FetchStaticIpsResponse;
1056 /// let x = FetchStaticIpsResponse::new().set_next_page_token("example");
1057 /// ```
1058 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1059 self.next_page_token = v.into();
1060 self
1061 }
1062}
1063
1064impl wkt::message::Message for FetchStaticIpsResponse {
1065 fn typename() -> &'static str {
1066 "type.googleapis.com/google.cloud.datastream.v1.FetchStaticIpsResponse"
1067 }
1068}
1069
1070/// Request message for listing connection profiles.
1071#[derive(Clone, Default, PartialEq)]
1072#[non_exhaustive]
1073pub struct ListConnectionProfilesRequest {
1074 /// Required. The parent that owns the collection of connection profiles.
1075 pub parent: std::string::String,
1076
1077 /// Maximum number of connection profiles to return.
1078 /// If unspecified, at most 50 connection profiles will be returned.
1079 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
1080 pub page_size: i32,
1081
1082 /// Page token received from a previous `ListConnectionProfiles` call.
1083 /// Provide this to retrieve the subsequent page.
1084 ///
1085 /// When paginating, all other parameters provided to `ListConnectionProfiles`
1086 /// must match the call that provided the page token.
1087 pub page_token: std::string::String,
1088
1089 /// Filter request.
1090 pub filter: std::string::String,
1091
1092 /// Order by fields for the result.
1093 pub order_by: std::string::String,
1094
1095 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1096}
1097
1098impl ListConnectionProfilesRequest {
1099 pub fn new() -> Self {
1100 std::default::Default::default()
1101 }
1102
1103 /// Sets the value of [parent][crate::model::ListConnectionProfilesRequest::parent].
1104 ///
1105 /// # Example
1106 /// ```ignore,no_run
1107 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1108 /// let x = ListConnectionProfilesRequest::new().set_parent("example");
1109 /// ```
1110 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1111 self.parent = v.into();
1112 self
1113 }
1114
1115 /// Sets the value of [page_size][crate::model::ListConnectionProfilesRequest::page_size].
1116 ///
1117 /// # Example
1118 /// ```ignore,no_run
1119 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1120 /// let x = ListConnectionProfilesRequest::new().set_page_size(42);
1121 /// ```
1122 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1123 self.page_size = v.into();
1124 self
1125 }
1126
1127 /// Sets the value of [page_token][crate::model::ListConnectionProfilesRequest::page_token].
1128 ///
1129 /// # Example
1130 /// ```ignore,no_run
1131 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1132 /// let x = ListConnectionProfilesRequest::new().set_page_token("example");
1133 /// ```
1134 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1135 self.page_token = v.into();
1136 self
1137 }
1138
1139 /// Sets the value of [filter][crate::model::ListConnectionProfilesRequest::filter].
1140 ///
1141 /// # Example
1142 /// ```ignore,no_run
1143 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1144 /// let x = ListConnectionProfilesRequest::new().set_filter("example");
1145 /// ```
1146 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1147 self.filter = v.into();
1148 self
1149 }
1150
1151 /// Sets the value of [order_by][crate::model::ListConnectionProfilesRequest::order_by].
1152 ///
1153 /// # Example
1154 /// ```ignore,no_run
1155 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1156 /// let x = ListConnectionProfilesRequest::new().set_order_by("example");
1157 /// ```
1158 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1159 self.order_by = v.into();
1160 self
1161 }
1162}
1163
1164impl wkt::message::Message for ListConnectionProfilesRequest {
1165 fn typename() -> &'static str {
1166 "type.googleapis.com/google.cloud.datastream.v1.ListConnectionProfilesRequest"
1167 }
1168}
1169
1170/// Response message for listing connection profiles.
1171#[derive(Clone, Default, PartialEq)]
1172#[non_exhaustive]
1173pub struct ListConnectionProfilesResponse {
1174 /// List of connection profiles.
1175 pub connection_profiles: std::vec::Vec<crate::model::ConnectionProfile>,
1176
1177 /// A token, which can be sent as `page_token` to retrieve the next page.
1178 /// If this field is omitted, there are no subsequent pages.
1179 pub next_page_token: std::string::String,
1180
1181 /// Locations that could not be reached.
1182 pub unreachable: std::vec::Vec<std::string::String>,
1183
1184 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1185}
1186
1187impl ListConnectionProfilesResponse {
1188 pub fn new() -> Self {
1189 std::default::Default::default()
1190 }
1191
1192 /// Sets the value of [connection_profiles][crate::model::ListConnectionProfilesResponse::connection_profiles].
1193 ///
1194 /// # Example
1195 /// ```ignore,no_run
1196 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesResponse;
1197 /// use google_cloud_datastream_v1::model::ConnectionProfile;
1198 /// let x = ListConnectionProfilesResponse::new()
1199 /// .set_connection_profiles([
1200 /// ConnectionProfile::default()/* use setters */,
1201 /// ConnectionProfile::default()/* use (different) setters */,
1202 /// ]);
1203 /// ```
1204 pub fn set_connection_profiles<T, V>(mut self, v: T) -> Self
1205 where
1206 T: std::iter::IntoIterator<Item = V>,
1207 V: std::convert::Into<crate::model::ConnectionProfile>,
1208 {
1209 use std::iter::Iterator;
1210 self.connection_profiles = v.into_iter().map(|i| i.into()).collect();
1211 self
1212 }
1213
1214 /// Sets the value of [next_page_token][crate::model::ListConnectionProfilesResponse::next_page_token].
1215 ///
1216 /// # Example
1217 /// ```ignore,no_run
1218 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesResponse;
1219 /// let x = ListConnectionProfilesResponse::new().set_next_page_token("example");
1220 /// ```
1221 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1222 self.next_page_token = v.into();
1223 self
1224 }
1225
1226 /// Sets the value of [unreachable][crate::model::ListConnectionProfilesResponse::unreachable].
1227 ///
1228 /// # Example
1229 /// ```ignore,no_run
1230 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesResponse;
1231 /// let x = ListConnectionProfilesResponse::new().set_unreachable(["a", "b", "c"]);
1232 /// ```
1233 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1234 where
1235 T: std::iter::IntoIterator<Item = V>,
1236 V: std::convert::Into<std::string::String>,
1237 {
1238 use std::iter::Iterator;
1239 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1240 self
1241 }
1242}
1243
1244impl wkt::message::Message for ListConnectionProfilesResponse {
1245 fn typename() -> &'static str {
1246 "type.googleapis.com/google.cloud.datastream.v1.ListConnectionProfilesResponse"
1247 }
1248}
1249
1250#[doc(hidden)]
1251impl gax::paginator::internal::PageableResponse for ListConnectionProfilesResponse {
1252 type PageItem = crate::model::ConnectionProfile;
1253
1254 fn items(self) -> std::vec::Vec<Self::PageItem> {
1255 self.connection_profiles
1256 }
1257
1258 fn next_page_token(&self) -> std::string::String {
1259 use std::clone::Clone;
1260 self.next_page_token.clone()
1261 }
1262}
1263
1264/// Request message for getting a connection profile.
1265#[derive(Clone, Default, PartialEq)]
1266#[non_exhaustive]
1267pub struct GetConnectionProfileRequest {
1268 /// Required. The name of the connection profile resource to get.
1269 pub name: std::string::String,
1270
1271 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1272}
1273
1274impl GetConnectionProfileRequest {
1275 pub fn new() -> Self {
1276 std::default::Default::default()
1277 }
1278
1279 /// Sets the value of [name][crate::model::GetConnectionProfileRequest::name].
1280 ///
1281 /// # Example
1282 /// ```ignore,no_run
1283 /// # use google_cloud_datastream_v1::model::GetConnectionProfileRequest;
1284 /// let x = GetConnectionProfileRequest::new().set_name("example");
1285 /// ```
1286 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1287 self.name = v.into();
1288 self
1289 }
1290}
1291
1292impl wkt::message::Message for GetConnectionProfileRequest {
1293 fn typename() -> &'static str {
1294 "type.googleapis.com/google.cloud.datastream.v1.GetConnectionProfileRequest"
1295 }
1296}
1297
1298/// Request message for creating a connection profile.
1299#[derive(Clone, Default, PartialEq)]
1300#[non_exhaustive]
1301pub struct CreateConnectionProfileRequest {
1302 /// Required. The parent that owns the collection of ConnectionProfiles.
1303 pub parent: std::string::String,
1304
1305 /// Required. The connection profile identifier.
1306 pub connection_profile_id: std::string::String,
1307
1308 /// Required. The connection profile resource to create.
1309 pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
1310
1311 /// Optional. A request ID to identify requests. Specify a unique request ID
1312 /// so that if you must retry your request, the server will know to ignore
1313 /// the request if it has already been completed. The server will guarantee
1314 /// that for at least 60 minutes since the first request.
1315 ///
1316 /// For example, consider a situation where you make an initial request and the
1317 /// request times out. If you make the request again with the same request ID,
1318 /// the server can check if original operation with the same request ID was
1319 /// received, and if so, will ignore the second request. This prevents clients
1320 /// from accidentally creating duplicate commitments.
1321 ///
1322 /// The request ID must be a valid UUID with the exception that zero UUID is
1323 /// not supported (00000000-0000-0000-0000-000000000000).
1324 pub request_id: std::string::String,
1325
1326 /// Optional. Only validate the connection profile, but don't create any
1327 /// resources. The default is false.
1328 pub validate_only: bool,
1329
1330 /// Optional. Create the connection profile without validating it.
1331 pub force: bool,
1332
1333 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1334}
1335
1336impl CreateConnectionProfileRequest {
1337 pub fn new() -> Self {
1338 std::default::Default::default()
1339 }
1340
1341 /// Sets the value of [parent][crate::model::CreateConnectionProfileRequest::parent].
1342 ///
1343 /// # Example
1344 /// ```ignore,no_run
1345 /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1346 /// let x = CreateConnectionProfileRequest::new().set_parent("example");
1347 /// ```
1348 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1349 self.parent = v.into();
1350 self
1351 }
1352
1353 /// Sets the value of [connection_profile_id][crate::model::CreateConnectionProfileRequest::connection_profile_id].
1354 ///
1355 /// # Example
1356 /// ```ignore,no_run
1357 /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1358 /// let x = CreateConnectionProfileRequest::new().set_connection_profile_id("example");
1359 /// ```
1360 pub fn set_connection_profile_id<T: std::convert::Into<std::string::String>>(
1361 mut self,
1362 v: T,
1363 ) -> Self {
1364 self.connection_profile_id = v.into();
1365 self
1366 }
1367
1368 /// Sets the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
1369 ///
1370 /// # Example
1371 /// ```ignore,no_run
1372 /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1373 /// use google_cloud_datastream_v1::model::ConnectionProfile;
1374 /// let x = CreateConnectionProfileRequest::new().set_connection_profile(ConnectionProfile::default()/* use setters */);
1375 /// ```
1376 pub fn set_connection_profile<T>(mut self, v: T) -> Self
1377 where
1378 T: std::convert::Into<crate::model::ConnectionProfile>,
1379 {
1380 self.connection_profile = std::option::Option::Some(v.into());
1381 self
1382 }
1383
1384 /// Sets or clears the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
1385 ///
1386 /// # Example
1387 /// ```ignore,no_run
1388 /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1389 /// use google_cloud_datastream_v1::model::ConnectionProfile;
1390 /// let x = CreateConnectionProfileRequest::new().set_or_clear_connection_profile(Some(ConnectionProfile::default()/* use setters */));
1391 /// let x = CreateConnectionProfileRequest::new().set_or_clear_connection_profile(None::<ConnectionProfile>);
1392 /// ```
1393 pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
1394 where
1395 T: std::convert::Into<crate::model::ConnectionProfile>,
1396 {
1397 self.connection_profile = v.map(|x| x.into());
1398 self
1399 }
1400
1401 /// Sets the value of [request_id][crate::model::CreateConnectionProfileRequest::request_id].
1402 ///
1403 /// # Example
1404 /// ```ignore,no_run
1405 /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1406 /// let x = CreateConnectionProfileRequest::new().set_request_id("example");
1407 /// ```
1408 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1409 self.request_id = v.into();
1410 self
1411 }
1412
1413 /// Sets the value of [validate_only][crate::model::CreateConnectionProfileRequest::validate_only].
1414 ///
1415 /// # Example
1416 /// ```ignore,no_run
1417 /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1418 /// let x = CreateConnectionProfileRequest::new().set_validate_only(true);
1419 /// ```
1420 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1421 self.validate_only = v.into();
1422 self
1423 }
1424
1425 /// Sets the value of [force][crate::model::CreateConnectionProfileRequest::force].
1426 ///
1427 /// # Example
1428 /// ```ignore,no_run
1429 /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1430 /// let x = CreateConnectionProfileRequest::new().set_force(true);
1431 /// ```
1432 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1433 self.force = v.into();
1434 self
1435 }
1436}
1437
1438impl wkt::message::Message for CreateConnectionProfileRequest {
1439 fn typename() -> &'static str {
1440 "type.googleapis.com/google.cloud.datastream.v1.CreateConnectionProfileRequest"
1441 }
1442}
1443
1444/// Connection profile update message.
1445#[derive(Clone, Default, PartialEq)]
1446#[non_exhaustive]
1447pub struct UpdateConnectionProfileRequest {
1448 /// Optional. Field mask is used to specify the fields to be overwritten in the
1449 /// ConnectionProfile resource by the update.
1450 /// The fields specified in the update_mask are relative to the resource, not
1451 /// the full request. A field will be overwritten if it is in the mask. If the
1452 /// user does not provide a mask then all fields will be overwritten.
1453 pub update_mask: std::option::Option<wkt::FieldMask>,
1454
1455 /// Required. The connection profile to update.
1456 pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
1457
1458 /// Optional. A request ID to identify requests. Specify a unique request ID
1459 /// so that if you must retry your request, the server will know to ignore
1460 /// the request if it has already been completed. The server will guarantee
1461 /// that for at least 60 minutes since the first request.
1462 ///
1463 /// For example, consider a situation where you make an initial request and the
1464 /// request times out. If you make the request again with the same request ID,
1465 /// the server can check if original operation with the same request ID was
1466 /// received, and if so, will ignore the second request. This prevents clients
1467 /// from accidentally creating duplicate commitments.
1468 ///
1469 /// The request ID must be a valid UUID with the exception that zero UUID is
1470 /// not supported (00000000-0000-0000-0000-000000000000).
1471 pub request_id: std::string::String,
1472
1473 /// Optional. Only validate the connection profile, but don't update any
1474 /// resources. The default is false.
1475 pub validate_only: bool,
1476
1477 /// Optional. Update the connection profile without validating it.
1478 pub force: bool,
1479
1480 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1481}
1482
1483impl UpdateConnectionProfileRequest {
1484 pub fn new() -> Self {
1485 std::default::Default::default()
1486 }
1487
1488 /// Sets the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
1489 ///
1490 /// # Example
1491 /// ```ignore,no_run
1492 /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1493 /// use wkt::FieldMask;
1494 /// let x = UpdateConnectionProfileRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1495 /// ```
1496 pub fn set_update_mask<T>(mut self, v: T) -> Self
1497 where
1498 T: std::convert::Into<wkt::FieldMask>,
1499 {
1500 self.update_mask = std::option::Option::Some(v.into());
1501 self
1502 }
1503
1504 /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
1505 ///
1506 /// # Example
1507 /// ```ignore,no_run
1508 /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1509 /// use wkt::FieldMask;
1510 /// let x = UpdateConnectionProfileRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1511 /// let x = UpdateConnectionProfileRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1512 /// ```
1513 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1514 where
1515 T: std::convert::Into<wkt::FieldMask>,
1516 {
1517 self.update_mask = v.map(|x| x.into());
1518 self
1519 }
1520
1521 /// Sets the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
1522 ///
1523 /// # Example
1524 /// ```ignore,no_run
1525 /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1526 /// use google_cloud_datastream_v1::model::ConnectionProfile;
1527 /// let x = UpdateConnectionProfileRequest::new().set_connection_profile(ConnectionProfile::default()/* use setters */);
1528 /// ```
1529 pub fn set_connection_profile<T>(mut self, v: T) -> Self
1530 where
1531 T: std::convert::Into<crate::model::ConnectionProfile>,
1532 {
1533 self.connection_profile = std::option::Option::Some(v.into());
1534 self
1535 }
1536
1537 /// Sets or clears the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
1538 ///
1539 /// # Example
1540 /// ```ignore,no_run
1541 /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1542 /// use google_cloud_datastream_v1::model::ConnectionProfile;
1543 /// let x = UpdateConnectionProfileRequest::new().set_or_clear_connection_profile(Some(ConnectionProfile::default()/* use setters */));
1544 /// let x = UpdateConnectionProfileRequest::new().set_or_clear_connection_profile(None::<ConnectionProfile>);
1545 /// ```
1546 pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
1547 where
1548 T: std::convert::Into<crate::model::ConnectionProfile>,
1549 {
1550 self.connection_profile = v.map(|x| x.into());
1551 self
1552 }
1553
1554 /// Sets the value of [request_id][crate::model::UpdateConnectionProfileRequest::request_id].
1555 ///
1556 /// # Example
1557 /// ```ignore,no_run
1558 /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1559 /// let x = UpdateConnectionProfileRequest::new().set_request_id("example");
1560 /// ```
1561 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1562 self.request_id = v.into();
1563 self
1564 }
1565
1566 /// Sets the value of [validate_only][crate::model::UpdateConnectionProfileRequest::validate_only].
1567 ///
1568 /// # Example
1569 /// ```ignore,no_run
1570 /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1571 /// let x = UpdateConnectionProfileRequest::new().set_validate_only(true);
1572 /// ```
1573 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1574 self.validate_only = v.into();
1575 self
1576 }
1577
1578 /// Sets the value of [force][crate::model::UpdateConnectionProfileRequest::force].
1579 ///
1580 /// # Example
1581 /// ```ignore,no_run
1582 /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1583 /// let x = UpdateConnectionProfileRequest::new().set_force(true);
1584 /// ```
1585 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1586 self.force = v.into();
1587 self
1588 }
1589}
1590
1591impl wkt::message::Message for UpdateConnectionProfileRequest {
1592 fn typename() -> &'static str {
1593 "type.googleapis.com/google.cloud.datastream.v1.UpdateConnectionProfileRequest"
1594 }
1595}
1596
1597/// Request message for deleting a connection profile.
1598#[derive(Clone, Default, PartialEq)]
1599#[non_exhaustive]
1600pub struct DeleteConnectionProfileRequest {
1601 /// Required. The name of the connection profile resource to delete.
1602 pub name: std::string::String,
1603
1604 /// Optional. A request ID to identify requests. Specify a unique request ID
1605 /// so that if you must retry your request, the server will know to ignore
1606 /// the request if it has already been completed. The server will guarantee
1607 /// that for at least 60 minutes after the first request.
1608 ///
1609 /// For example, consider a situation where you make an initial request and the
1610 /// request times out. If you make the request again with the same request ID,
1611 /// the server can check if original operation with the same request ID was
1612 /// received, and if so, will ignore the second request. This prevents clients
1613 /// from accidentally creating duplicate commitments.
1614 ///
1615 /// The request ID must be a valid UUID with the exception that zero UUID is
1616 /// not supported (00000000-0000-0000-0000-000000000000).
1617 pub request_id: std::string::String,
1618
1619 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1620}
1621
1622impl DeleteConnectionProfileRequest {
1623 pub fn new() -> Self {
1624 std::default::Default::default()
1625 }
1626
1627 /// Sets the value of [name][crate::model::DeleteConnectionProfileRequest::name].
1628 ///
1629 /// # Example
1630 /// ```ignore,no_run
1631 /// # use google_cloud_datastream_v1::model::DeleteConnectionProfileRequest;
1632 /// let x = DeleteConnectionProfileRequest::new().set_name("example");
1633 /// ```
1634 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1635 self.name = v.into();
1636 self
1637 }
1638
1639 /// Sets the value of [request_id][crate::model::DeleteConnectionProfileRequest::request_id].
1640 ///
1641 /// # Example
1642 /// ```ignore,no_run
1643 /// # use google_cloud_datastream_v1::model::DeleteConnectionProfileRequest;
1644 /// let x = DeleteConnectionProfileRequest::new().set_request_id("example");
1645 /// ```
1646 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1647 self.request_id = v.into();
1648 self
1649 }
1650}
1651
1652impl wkt::message::Message for DeleteConnectionProfileRequest {
1653 fn typename() -> &'static str {
1654 "type.googleapis.com/google.cloud.datastream.v1.DeleteConnectionProfileRequest"
1655 }
1656}
1657
1658/// Request message for listing streams.
1659#[derive(Clone, Default, PartialEq)]
1660#[non_exhaustive]
1661pub struct ListStreamsRequest {
1662 /// Required. The parent that owns the collection of streams.
1663 pub parent: std::string::String,
1664
1665 /// Maximum number of streams to return.
1666 /// If unspecified, at most 50 streams will be returned. The maximum
1667 /// value is 1000; values above 1000 will be coerced to 1000.
1668 pub page_size: i32,
1669
1670 /// Page token received from a previous `ListStreams` call.
1671 /// Provide this to retrieve the subsequent page.
1672 ///
1673 /// When paginating, all other parameters provided to `ListStreams`
1674 /// must match the call that provided the page token.
1675 pub page_token: std::string::String,
1676
1677 /// Filter request.
1678 pub filter: std::string::String,
1679
1680 /// Order by fields for the result.
1681 pub order_by: std::string::String,
1682
1683 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1684}
1685
1686impl ListStreamsRequest {
1687 pub fn new() -> Self {
1688 std::default::Default::default()
1689 }
1690
1691 /// Sets the value of [parent][crate::model::ListStreamsRequest::parent].
1692 ///
1693 /// # Example
1694 /// ```ignore,no_run
1695 /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1696 /// let x = ListStreamsRequest::new().set_parent("example");
1697 /// ```
1698 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1699 self.parent = v.into();
1700 self
1701 }
1702
1703 /// Sets the value of [page_size][crate::model::ListStreamsRequest::page_size].
1704 ///
1705 /// # Example
1706 /// ```ignore,no_run
1707 /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1708 /// let x = ListStreamsRequest::new().set_page_size(42);
1709 /// ```
1710 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1711 self.page_size = v.into();
1712 self
1713 }
1714
1715 /// Sets the value of [page_token][crate::model::ListStreamsRequest::page_token].
1716 ///
1717 /// # Example
1718 /// ```ignore,no_run
1719 /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1720 /// let x = ListStreamsRequest::new().set_page_token("example");
1721 /// ```
1722 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1723 self.page_token = v.into();
1724 self
1725 }
1726
1727 /// Sets the value of [filter][crate::model::ListStreamsRequest::filter].
1728 ///
1729 /// # Example
1730 /// ```ignore,no_run
1731 /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1732 /// let x = ListStreamsRequest::new().set_filter("example");
1733 /// ```
1734 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1735 self.filter = v.into();
1736 self
1737 }
1738
1739 /// Sets the value of [order_by][crate::model::ListStreamsRequest::order_by].
1740 ///
1741 /// # Example
1742 /// ```ignore,no_run
1743 /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1744 /// let x = ListStreamsRequest::new().set_order_by("example");
1745 /// ```
1746 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1747 self.order_by = v.into();
1748 self
1749 }
1750}
1751
1752impl wkt::message::Message for ListStreamsRequest {
1753 fn typename() -> &'static str {
1754 "type.googleapis.com/google.cloud.datastream.v1.ListStreamsRequest"
1755 }
1756}
1757
1758/// Response message for listing streams.
1759#[derive(Clone, Default, PartialEq)]
1760#[non_exhaustive]
1761pub struct ListStreamsResponse {
1762 /// List of streams
1763 pub streams: std::vec::Vec<crate::model::Stream>,
1764
1765 /// A token, which can be sent as `page_token` to retrieve the next page.
1766 /// If this field is omitted, there are no subsequent pages.
1767 pub next_page_token: std::string::String,
1768
1769 /// Locations that could not be reached.
1770 pub unreachable: std::vec::Vec<std::string::String>,
1771
1772 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1773}
1774
1775impl ListStreamsResponse {
1776 pub fn new() -> Self {
1777 std::default::Default::default()
1778 }
1779
1780 /// Sets the value of [streams][crate::model::ListStreamsResponse::streams].
1781 ///
1782 /// # Example
1783 /// ```ignore,no_run
1784 /// # use google_cloud_datastream_v1::model::ListStreamsResponse;
1785 /// use google_cloud_datastream_v1::model::Stream;
1786 /// let x = ListStreamsResponse::new()
1787 /// .set_streams([
1788 /// Stream::default()/* use setters */,
1789 /// Stream::default()/* use (different) setters */,
1790 /// ]);
1791 /// ```
1792 pub fn set_streams<T, V>(mut self, v: T) -> Self
1793 where
1794 T: std::iter::IntoIterator<Item = V>,
1795 V: std::convert::Into<crate::model::Stream>,
1796 {
1797 use std::iter::Iterator;
1798 self.streams = v.into_iter().map(|i| i.into()).collect();
1799 self
1800 }
1801
1802 /// Sets the value of [next_page_token][crate::model::ListStreamsResponse::next_page_token].
1803 ///
1804 /// # Example
1805 /// ```ignore,no_run
1806 /// # use google_cloud_datastream_v1::model::ListStreamsResponse;
1807 /// let x = ListStreamsResponse::new().set_next_page_token("example");
1808 /// ```
1809 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1810 self.next_page_token = v.into();
1811 self
1812 }
1813
1814 /// Sets the value of [unreachable][crate::model::ListStreamsResponse::unreachable].
1815 ///
1816 /// # Example
1817 /// ```ignore,no_run
1818 /// # use google_cloud_datastream_v1::model::ListStreamsResponse;
1819 /// let x = ListStreamsResponse::new().set_unreachable(["a", "b", "c"]);
1820 /// ```
1821 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1822 where
1823 T: std::iter::IntoIterator<Item = V>,
1824 V: std::convert::Into<std::string::String>,
1825 {
1826 use std::iter::Iterator;
1827 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1828 self
1829 }
1830}
1831
1832impl wkt::message::Message for ListStreamsResponse {
1833 fn typename() -> &'static str {
1834 "type.googleapis.com/google.cloud.datastream.v1.ListStreamsResponse"
1835 }
1836}
1837
1838#[doc(hidden)]
1839impl gax::paginator::internal::PageableResponse for ListStreamsResponse {
1840 type PageItem = crate::model::Stream;
1841
1842 fn items(self) -> std::vec::Vec<Self::PageItem> {
1843 self.streams
1844 }
1845
1846 fn next_page_token(&self) -> std::string::String {
1847 use std::clone::Clone;
1848 self.next_page_token.clone()
1849 }
1850}
1851
1852/// Request message for getting a stream.
1853#[derive(Clone, Default, PartialEq)]
1854#[non_exhaustive]
1855pub struct GetStreamRequest {
1856 /// Required. The name of the stream resource to get.
1857 pub name: std::string::String,
1858
1859 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1860}
1861
1862impl GetStreamRequest {
1863 pub fn new() -> Self {
1864 std::default::Default::default()
1865 }
1866
1867 /// Sets the value of [name][crate::model::GetStreamRequest::name].
1868 ///
1869 /// # Example
1870 /// ```ignore,no_run
1871 /// # use google_cloud_datastream_v1::model::GetStreamRequest;
1872 /// let x = GetStreamRequest::new().set_name("example");
1873 /// ```
1874 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1875 self.name = v.into();
1876 self
1877 }
1878}
1879
1880impl wkt::message::Message for GetStreamRequest {
1881 fn typename() -> &'static str {
1882 "type.googleapis.com/google.cloud.datastream.v1.GetStreamRequest"
1883 }
1884}
1885
1886/// Request message for creating a stream.
1887#[derive(Clone, Default, PartialEq)]
1888#[non_exhaustive]
1889pub struct CreateStreamRequest {
1890 /// Required. The parent that owns the collection of streams.
1891 pub parent: std::string::String,
1892
1893 /// Required. The stream identifier.
1894 pub stream_id: std::string::String,
1895
1896 /// Required. The stream resource to create.
1897 pub stream: std::option::Option<crate::model::Stream>,
1898
1899 /// Optional. A request ID to identify requests. Specify a unique request ID
1900 /// so that if you must retry your request, the server will know to ignore
1901 /// the request if it has already been completed. The server will guarantee
1902 /// that for at least 60 minutes since the first request.
1903 ///
1904 /// For example, consider a situation where you make an initial request and the
1905 /// request times out. If you make the request again with the same request ID,
1906 /// the server can check if original operation with the same request ID was
1907 /// received, and if so, will ignore the second request. This prevents clients
1908 /// from accidentally creating duplicate commitments.
1909 ///
1910 /// The request ID must be a valid UUID with the exception that zero UUID is
1911 /// not supported (00000000-0000-0000-0000-000000000000).
1912 pub request_id: std::string::String,
1913
1914 /// Optional. Only validate the stream, but don't create any resources.
1915 /// The default is false.
1916 pub validate_only: bool,
1917
1918 /// Optional. Create the stream without validating it.
1919 pub force: bool,
1920
1921 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1922}
1923
1924impl CreateStreamRequest {
1925 pub fn new() -> Self {
1926 std::default::Default::default()
1927 }
1928
1929 /// Sets the value of [parent][crate::model::CreateStreamRequest::parent].
1930 ///
1931 /// # Example
1932 /// ```ignore,no_run
1933 /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1934 /// let x = CreateStreamRequest::new().set_parent("example");
1935 /// ```
1936 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1937 self.parent = v.into();
1938 self
1939 }
1940
1941 /// Sets the value of [stream_id][crate::model::CreateStreamRequest::stream_id].
1942 ///
1943 /// # Example
1944 /// ```ignore,no_run
1945 /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1946 /// let x = CreateStreamRequest::new().set_stream_id("example");
1947 /// ```
1948 pub fn set_stream_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1949 self.stream_id = v.into();
1950 self
1951 }
1952
1953 /// Sets the value of [stream][crate::model::CreateStreamRequest::stream].
1954 ///
1955 /// # Example
1956 /// ```ignore,no_run
1957 /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1958 /// use google_cloud_datastream_v1::model::Stream;
1959 /// let x = CreateStreamRequest::new().set_stream(Stream::default()/* use setters */);
1960 /// ```
1961 pub fn set_stream<T>(mut self, v: T) -> Self
1962 where
1963 T: std::convert::Into<crate::model::Stream>,
1964 {
1965 self.stream = std::option::Option::Some(v.into());
1966 self
1967 }
1968
1969 /// Sets or clears the value of [stream][crate::model::CreateStreamRequest::stream].
1970 ///
1971 /// # Example
1972 /// ```ignore,no_run
1973 /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1974 /// use google_cloud_datastream_v1::model::Stream;
1975 /// let x = CreateStreamRequest::new().set_or_clear_stream(Some(Stream::default()/* use setters */));
1976 /// let x = CreateStreamRequest::new().set_or_clear_stream(None::<Stream>);
1977 /// ```
1978 pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
1979 where
1980 T: std::convert::Into<crate::model::Stream>,
1981 {
1982 self.stream = v.map(|x| x.into());
1983 self
1984 }
1985
1986 /// Sets the value of [request_id][crate::model::CreateStreamRequest::request_id].
1987 ///
1988 /// # Example
1989 /// ```ignore,no_run
1990 /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1991 /// let x = CreateStreamRequest::new().set_request_id("example");
1992 /// ```
1993 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1994 self.request_id = v.into();
1995 self
1996 }
1997
1998 /// Sets the value of [validate_only][crate::model::CreateStreamRequest::validate_only].
1999 ///
2000 /// # Example
2001 /// ```ignore,no_run
2002 /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
2003 /// let x = CreateStreamRequest::new().set_validate_only(true);
2004 /// ```
2005 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2006 self.validate_only = v.into();
2007 self
2008 }
2009
2010 /// Sets the value of [force][crate::model::CreateStreamRequest::force].
2011 ///
2012 /// # Example
2013 /// ```ignore,no_run
2014 /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
2015 /// let x = CreateStreamRequest::new().set_force(true);
2016 /// ```
2017 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2018 self.force = v.into();
2019 self
2020 }
2021}
2022
2023impl wkt::message::Message for CreateStreamRequest {
2024 fn typename() -> &'static str {
2025 "type.googleapis.com/google.cloud.datastream.v1.CreateStreamRequest"
2026 }
2027}
2028
2029/// Request message for updating a stream.
2030#[derive(Clone, Default, PartialEq)]
2031#[non_exhaustive]
2032pub struct UpdateStreamRequest {
2033 /// Optional. Field mask is used to specify the fields to be overwritten in the
2034 /// stream resource by the update.
2035 /// The fields specified in the update_mask are relative to the resource, not
2036 /// the full request. A field will be overwritten if it is in the mask. If the
2037 /// user does not provide a mask then all fields will be overwritten.
2038 pub update_mask: std::option::Option<wkt::FieldMask>,
2039
2040 /// Required. The stream resource to update.
2041 pub stream: std::option::Option<crate::model::Stream>,
2042
2043 /// Optional. A request ID to identify requests. Specify a unique request ID
2044 /// so that if you must retry your request, the server will know to ignore
2045 /// the request if it has already been completed. The server will guarantee
2046 /// that for at least 60 minutes since the first request.
2047 ///
2048 /// For example, consider a situation where you make an initial request and the
2049 /// request times out. If you make the request again with the same request ID,
2050 /// the server can check if original operation with the same request ID was
2051 /// received, and if so, will ignore the second request. This prevents clients
2052 /// from accidentally creating duplicate commitments.
2053 ///
2054 /// The request ID must be a valid UUID with the exception that zero UUID is
2055 /// not supported (00000000-0000-0000-0000-000000000000).
2056 pub request_id: std::string::String,
2057
2058 /// Optional. Only validate the stream with the changes, without actually
2059 /// updating it. The default is false.
2060 pub validate_only: bool,
2061
2062 /// Optional. Update the stream without validating it.
2063 pub force: bool,
2064
2065 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2066}
2067
2068impl UpdateStreamRequest {
2069 pub fn new() -> Self {
2070 std::default::Default::default()
2071 }
2072
2073 /// Sets the value of [update_mask][crate::model::UpdateStreamRequest::update_mask].
2074 ///
2075 /// # Example
2076 /// ```ignore,no_run
2077 /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2078 /// use wkt::FieldMask;
2079 /// let x = UpdateStreamRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2080 /// ```
2081 pub fn set_update_mask<T>(mut self, v: T) -> Self
2082 where
2083 T: std::convert::Into<wkt::FieldMask>,
2084 {
2085 self.update_mask = std::option::Option::Some(v.into());
2086 self
2087 }
2088
2089 /// Sets or clears the value of [update_mask][crate::model::UpdateStreamRequest::update_mask].
2090 ///
2091 /// # Example
2092 /// ```ignore,no_run
2093 /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2094 /// use wkt::FieldMask;
2095 /// let x = UpdateStreamRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2096 /// let x = UpdateStreamRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2097 /// ```
2098 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2099 where
2100 T: std::convert::Into<wkt::FieldMask>,
2101 {
2102 self.update_mask = v.map(|x| x.into());
2103 self
2104 }
2105
2106 /// Sets the value of [stream][crate::model::UpdateStreamRequest::stream].
2107 ///
2108 /// # Example
2109 /// ```ignore,no_run
2110 /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2111 /// use google_cloud_datastream_v1::model::Stream;
2112 /// let x = UpdateStreamRequest::new().set_stream(Stream::default()/* use setters */);
2113 /// ```
2114 pub fn set_stream<T>(mut self, v: T) -> Self
2115 where
2116 T: std::convert::Into<crate::model::Stream>,
2117 {
2118 self.stream = std::option::Option::Some(v.into());
2119 self
2120 }
2121
2122 /// Sets or clears the value of [stream][crate::model::UpdateStreamRequest::stream].
2123 ///
2124 /// # Example
2125 /// ```ignore,no_run
2126 /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2127 /// use google_cloud_datastream_v1::model::Stream;
2128 /// let x = UpdateStreamRequest::new().set_or_clear_stream(Some(Stream::default()/* use setters */));
2129 /// let x = UpdateStreamRequest::new().set_or_clear_stream(None::<Stream>);
2130 /// ```
2131 pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
2132 where
2133 T: std::convert::Into<crate::model::Stream>,
2134 {
2135 self.stream = v.map(|x| x.into());
2136 self
2137 }
2138
2139 /// Sets the value of [request_id][crate::model::UpdateStreamRequest::request_id].
2140 ///
2141 /// # Example
2142 /// ```ignore,no_run
2143 /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2144 /// let x = UpdateStreamRequest::new().set_request_id("example");
2145 /// ```
2146 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2147 self.request_id = v.into();
2148 self
2149 }
2150
2151 /// Sets the value of [validate_only][crate::model::UpdateStreamRequest::validate_only].
2152 ///
2153 /// # Example
2154 /// ```ignore,no_run
2155 /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2156 /// let x = UpdateStreamRequest::new().set_validate_only(true);
2157 /// ```
2158 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2159 self.validate_only = v.into();
2160 self
2161 }
2162
2163 /// Sets the value of [force][crate::model::UpdateStreamRequest::force].
2164 ///
2165 /// # Example
2166 /// ```ignore,no_run
2167 /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2168 /// let x = UpdateStreamRequest::new().set_force(true);
2169 /// ```
2170 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2171 self.force = v.into();
2172 self
2173 }
2174}
2175
2176impl wkt::message::Message for UpdateStreamRequest {
2177 fn typename() -> &'static str {
2178 "type.googleapis.com/google.cloud.datastream.v1.UpdateStreamRequest"
2179 }
2180}
2181
2182/// Request message for deleting a stream.
2183#[derive(Clone, Default, PartialEq)]
2184#[non_exhaustive]
2185pub struct DeleteStreamRequest {
2186 /// Required. The name of the stream resource to delete.
2187 pub name: std::string::String,
2188
2189 /// Optional. A request ID to identify requests. Specify a unique request ID
2190 /// so that if you must retry your request, the server will know to ignore
2191 /// the request if it has already been completed. The server will guarantee
2192 /// that for at least 60 minutes after the first request.
2193 ///
2194 /// For example, consider a situation where you make an initial request and the
2195 /// request times out. If you make the request again with the same request ID,
2196 /// the server can check if original operation with the same request ID was
2197 /// received, and if so, will ignore the second request. This prevents clients
2198 /// from accidentally creating duplicate commitments.
2199 ///
2200 /// The request ID must be a valid UUID with the exception that zero UUID is
2201 /// not supported (00000000-0000-0000-0000-000000000000).
2202 pub request_id: std::string::String,
2203
2204 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2205}
2206
2207impl DeleteStreamRequest {
2208 pub fn new() -> Self {
2209 std::default::Default::default()
2210 }
2211
2212 /// Sets the value of [name][crate::model::DeleteStreamRequest::name].
2213 ///
2214 /// # Example
2215 /// ```ignore,no_run
2216 /// # use google_cloud_datastream_v1::model::DeleteStreamRequest;
2217 /// let x = DeleteStreamRequest::new().set_name("example");
2218 /// ```
2219 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2220 self.name = v.into();
2221 self
2222 }
2223
2224 /// Sets the value of [request_id][crate::model::DeleteStreamRequest::request_id].
2225 ///
2226 /// # Example
2227 /// ```ignore,no_run
2228 /// # use google_cloud_datastream_v1::model::DeleteStreamRequest;
2229 /// let x = DeleteStreamRequest::new().set_request_id("example");
2230 /// ```
2231 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2232 self.request_id = v.into();
2233 self
2234 }
2235}
2236
2237impl wkt::message::Message for DeleteStreamRequest {
2238 fn typename() -> &'static str {
2239 "type.googleapis.com/google.cloud.datastream.v1.DeleteStreamRequest"
2240 }
2241}
2242
2243/// Request message for running a stream.
2244#[derive(Clone, Default, PartialEq)]
2245#[non_exhaustive]
2246pub struct RunStreamRequest {
2247 /// Required. Name of the stream resource to start, in the format:
2248 /// projects/{project_id}/locations/{location}/streams/{stream_name}
2249 pub name: std::string::String,
2250
2251 /// Optional. The CDC strategy of the stream. If not set, the system's default
2252 /// value will be used.
2253 pub cdc_strategy: std::option::Option<crate::model::CdcStrategy>,
2254
2255 /// Optional. Update the stream without validating it.
2256 pub force: bool,
2257
2258 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2259}
2260
2261impl RunStreamRequest {
2262 pub fn new() -> Self {
2263 std::default::Default::default()
2264 }
2265
2266 /// Sets the value of [name][crate::model::RunStreamRequest::name].
2267 ///
2268 /// # Example
2269 /// ```ignore,no_run
2270 /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2271 /// let x = RunStreamRequest::new().set_name("example");
2272 /// ```
2273 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2274 self.name = v.into();
2275 self
2276 }
2277
2278 /// Sets the value of [cdc_strategy][crate::model::RunStreamRequest::cdc_strategy].
2279 ///
2280 /// # Example
2281 /// ```ignore,no_run
2282 /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2283 /// use google_cloud_datastream_v1::model::CdcStrategy;
2284 /// let x = RunStreamRequest::new().set_cdc_strategy(CdcStrategy::default()/* use setters */);
2285 /// ```
2286 pub fn set_cdc_strategy<T>(mut self, v: T) -> Self
2287 where
2288 T: std::convert::Into<crate::model::CdcStrategy>,
2289 {
2290 self.cdc_strategy = std::option::Option::Some(v.into());
2291 self
2292 }
2293
2294 /// Sets or clears the value of [cdc_strategy][crate::model::RunStreamRequest::cdc_strategy].
2295 ///
2296 /// # Example
2297 /// ```ignore,no_run
2298 /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2299 /// use google_cloud_datastream_v1::model::CdcStrategy;
2300 /// let x = RunStreamRequest::new().set_or_clear_cdc_strategy(Some(CdcStrategy::default()/* use setters */));
2301 /// let x = RunStreamRequest::new().set_or_clear_cdc_strategy(None::<CdcStrategy>);
2302 /// ```
2303 pub fn set_or_clear_cdc_strategy<T>(mut self, v: std::option::Option<T>) -> Self
2304 where
2305 T: std::convert::Into<crate::model::CdcStrategy>,
2306 {
2307 self.cdc_strategy = v.map(|x| x.into());
2308 self
2309 }
2310
2311 /// Sets the value of [force][crate::model::RunStreamRequest::force].
2312 ///
2313 /// # Example
2314 /// ```ignore,no_run
2315 /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2316 /// let x = RunStreamRequest::new().set_force(true);
2317 /// ```
2318 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2319 self.force = v.into();
2320 self
2321 }
2322}
2323
2324impl wkt::message::Message for RunStreamRequest {
2325 fn typename() -> &'static str {
2326 "type.googleapis.com/google.cloud.datastream.v1.RunStreamRequest"
2327 }
2328}
2329
2330/// Request for fetching a specific stream object.
2331#[derive(Clone, Default, PartialEq)]
2332#[non_exhaustive]
2333pub struct GetStreamObjectRequest {
2334 /// Required. The name of the stream object resource to get.
2335 pub name: std::string::String,
2336
2337 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2338}
2339
2340impl GetStreamObjectRequest {
2341 pub fn new() -> Self {
2342 std::default::Default::default()
2343 }
2344
2345 /// Sets the value of [name][crate::model::GetStreamObjectRequest::name].
2346 ///
2347 /// # Example
2348 /// ```ignore,no_run
2349 /// # use google_cloud_datastream_v1::model::GetStreamObjectRequest;
2350 /// let x = GetStreamObjectRequest::new().set_name("example");
2351 /// ```
2352 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2353 self.name = v.into();
2354 self
2355 }
2356}
2357
2358impl wkt::message::Message for GetStreamObjectRequest {
2359 fn typename() -> &'static str {
2360 "type.googleapis.com/google.cloud.datastream.v1.GetStreamObjectRequest"
2361 }
2362}
2363
2364/// Request for looking up a specific stream object by its source object
2365/// identifier.
2366#[derive(Clone, Default, PartialEq)]
2367#[non_exhaustive]
2368pub struct LookupStreamObjectRequest {
2369 /// Required. The parent stream that owns the collection of objects.
2370 pub parent: std::string::String,
2371
2372 /// Required. The source object identifier which maps to the stream object.
2373 pub source_object_identifier: std::option::Option<crate::model::SourceObjectIdentifier>,
2374
2375 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2376}
2377
2378impl LookupStreamObjectRequest {
2379 pub fn new() -> Self {
2380 std::default::Default::default()
2381 }
2382
2383 /// Sets the value of [parent][crate::model::LookupStreamObjectRequest::parent].
2384 ///
2385 /// # Example
2386 /// ```ignore,no_run
2387 /// # use google_cloud_datastream_v1::model::LookupStreamObjectRequest;
2388 /// let x = LookupStreamObjectRequest::new().set_parent("example");
2389 /// ```
2390 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2391 self.parent = v.into();
2392 self
2393 }
2394
2395 /// Sets the value of [source_object_identifier][crate::model::LookupStreamObjectRequest::source_object_identifier].
2396 ///
2397 /// # Example
2398 /// ```ignore,no_run
2399 /// # use google_cloud_datastream_v1::model::LookupStreamObjectRequest;
2400 /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
2401 /// let x = LookupStreamObjectRequest::new().set_source_object_identifier(SourceObjectIdentifier::default()/* use setters */);
2402 /// ```
2403 pub fn set_source_object_identifier<T>(mut self, v: T) -> Self
2404 where
2405 T: std::convert::Into<crate::model::SourceObjectIdentifier>,
2406 {
2407 self.source_object_identifier = std::option::Option::Some(v.into());
2408 self
2409 }
2410
2411 /// Sets or clears the value of [source_object_identifier][crate::model::LookupStreamObjectRequest::source_object_identifier].
2412 ///
2413 /// # Example
2414 /// ```ignore,no_run
2415 /// # use google_cloud_datastream_v1::model::LookupStreamObjectRequest;
2416 /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
2417 /// let x = LookupStreamObjectRequest::new().set_or_clear_source_object_identifier(Some(SourceObjectIdentifier::default()/* use setters */));
2418 /// let x = LookupStreamObjectRequest::new().set_or_clear_source_object_identifier(None::<SourceObjectIdentifier>);
2419 /// ```
2420 pub fn set_or_clear_source_object_identifier<T>(mut self, v: std::option::Option<T>) -> Self
2421 where
2422 T: std::convert::Into<crate::model::SourceObjectIdentifier>,
2423 {
2424 self.source_object_identifier = v.map(|x| x.into());
2425 self
2426 }
2427}
2428
2429impl wkt::message::Message for LookupStreamObjectRequest {
2430 fn typename() -> &'static str {
2431 "type.googleapis.com/google.cloud.datastream.v1.LookupStreamObjectRequest"
2432 }
2433}
2434
2435/// Request for manually initiating a backfill job for a specific stream object.
2436#[derive(Clone, Default, PartialEq)]
2437#[non_exhaustive]
2438pub struct StartBackfillJobRequest {
2439 /// Required. The name of the stream object resource to start a backfill job
2440 /// for.
2441 pub object: std::string::String,
2442
2443 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2444}
2445
2446impl StartBackfillJobRequest {
2447 pub fn new() -> Self {
2448 std::default::Default::default()
2449 }
2450
2451 /// Sets the value of [object][crate::model::StartBackfillJobRequest::object].
2452 ///
2453 /// # Example
2454 /// ```ignore,no_run
2455 /// # use google_cloud_datastream_v1::model::StartBackfillJobRequest;
2456 /// let x = StartBackfillJobRequest::new().set_object("example");
2457 /// ```
2458 pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2459 self.object = v.into();
2460 self
2461 }
2462}
2463
2464impl wkt::message::Message for StartBackfillJobRequest {
2465 fn typename() -> &'static str {
2466 "type.googleapis.com/google.cloud.datastream.v1.StartBackfillJobRequest"
2467 }
2468}
2469
2470/// Response for manually initiating a backfill job for a specific stream object.
2471#[derive(Clone, Default, PartialEq)]
2472#[non_exhaustive]
2473pub struct StartBackfillJobResponse {
2474 /// The stream object resource a backfill job was started for.
2475 pub object: std::option::Option<crate::model::StreamObject>,
2476
2477 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2478}
2479
2480impl StartBackfillJobResponse {
2481 pub fn new() -> Self {
2482 std::default::Default::default()
2483 }
2484
2485 /// Sets the value of [object][crate::model::StartBackfillJobResponse::object].
2486 ///
2487 /// # Example
2488 /// ```ignore,no_run
2489 /// # use google_cloud_datastream_v1::model::StartBackfillJobResponse;
2490 /// use google_cloud_datastream_v1::model::StreamObject;
2491 /// let x = StartBackfillJobResponse::new().set_object(StreamObject::default()/* use setters */);
2492 /// ```
2493 pub fn set_object<T>(mut self, v: T) -> Self
2494 where
2495 T: std::convert::Into<crate::model::StreamObject>,
2496 {
2497 self.object = std::option::Option::Some(v.into());
2498 self
2499 }
2500
2501 /// Sets or clears the value of [object][crate::model::StartBackfillJobResponse::object].
2502 ///
2503 /// # Example
2504 /// ```ignore,no_run
2505 /// # use google_cloud_datastream_v1::model::StartBackfillJobResponse;
2506 /// use google_cloud_datastream_v1::model::StreamObject;
2507 /// let x = StartBackfillJobResponse::new().set_or_clear_object(Some(StreamObject::default()/* use setters */));
2508 /// let x = StartBackfillJobResponse::new().set_or_clear_object(None::<StreamObject>);
2509 /// ```
2510 pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
2511 where
2512 T: std::convert::Into<crate::model::StreamObject>,
2513 {
2514 self.object = v.map(|x| x.into());
2515 self
2516 }
2517}
2518
2519impl wkt::message::Message for StartBackfillJobResponse {
2520 fn typename() -> &'static str {
2521 "type.googleapis.com/google.cloud.datastream.v1.StartBackfillJobResponse"
2522 }
2523}
2524
2525/// Request for manually stopping a running backfill job for a specific stream
2526/// object.
2527#[derive(Clone, Default, PartialEq)]
2528#[non_exhaustive]
2529pub struct StopBackfillJobRequest {
2530 /// Required. The name of the stream object resource to stop the backfill job
2531 /// for.
2532 pub object: std::string::String,
2533
2534 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2535}
2536
2537impl StopBackfillJobRequest {
2538 pub fn new() -> Self {
2539 std::default::Default::default()
2540 }
2541
2542 /// Sets the value of [object][crate::model::StopBackfillJobRequest::object].
2543 ///
2544 /// # Example
2545 /// ```ignore,no_run
2546 /// # use google_cloud_datastream_v1::model::StopBackfillJobRequest;
2547 /// let x = StopBackfillJobRequest::new().set_object("example");
2548 /// ```
2549 pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2550 self.object = v.into();
2551 self
2552 }
2553}
2554
2555impl wkt::message::Message for StopBackfillJobRequest {
2556 fn typename() -> &'static str {
2557 "type.googleapis.com/google.cloud.datastream.v1.StopBackfillJobRequest"
2558 }
2559}
2560
2561/// Response for manually stop a backfill job for a specific stream object.
2562#[derive(Clone, Default, PartialEq)]
2563#[non_exhaustive]
2564pub struct StopBackfillJobResponse {
2565 /// The stream object resource the backfill job was stopped for.
2566 pub object: std::option::Option<crate::model::StreamObject>,
2567
2568 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2569}
2570
2571impl StopBackfillJobResponse {
2572 pub fn new() -> Self {
2573 std::default::Default::default()
2574 }
2575
2576 /// Sets the value of [object][crate::model::StopBackfillJobResponse::object].
2577 ///
2578 /// # Example
2579 /// ```ignore,no_run
2580 /// # use google_cloud_datastream_v1::model::StopBackfillJobResponse;
2581 /// use google_cloud_datastream_v1::model::StreamObject;
2582 /// let x = StopBackfillJobResponse::new().set_object(StreamObject::default()/* use setters */);
2583 /// ```
2584 pub fn set_object<T>(mut self, v: T) -> Self
2585 where
2586 T: std::convert::Into<crate::model::StreamObject>,
2587 {
2588 self.object = std::option::Option::Some(v.into());
2589 self
2590 }
2591
2592 /// Sets or clears the value of [object][crate::model::StopBackfillJobResponse::object].
2593 ///
2594 /// # Example
2595 /// ```ignore,no_run
2596 /// # use google_cloud_datastream_v1::model::StopBackfillJobResponse;
2597 /// use google_cloud_datastream_v1::model::StreamObject;
2598 /// let x = StopBackfillJobResponse::new().set_or_clear_object(Some(StreamObject::default()/* use setters */));
2599 /// let x = StopBackfillJobResponse::new().set_or_clear_object(None::<StreamObject>);
2600 /// ```
2601 pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
2602 where
2603 T: std::convert::Into<crate::model::StreamObject>,
2604 {
2605 self.object = v.map(|x| x.into());
2606 self
2607 }
2608}
2609
2610impl wkt::message::Message for StopBackfillJobResponse {
2611 fn typename() -> &'static str {
2612 "type.googleapis.com/google.cloud.datastream.v1.StopBackfillJobResponse"
2613 }
2614}
2615
2616/// Request for listing all objects for a specific stream.
2617#[derive(Clone, Default, PartialEq)]
2618#[non_exhaustive]
2619pub struct ListStreamObjectsRequest {
2620 /// Required. The parent stream that owns the collection of objects.
2621 pub parent: std::string::String,
2622
2623 /// Maximum number of objects to return. Default is 50.
2624 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
2625 pub page_size: i32,
2626
2627 /// Page token received from a previous `ListStreamObjectsRequest` call.
2628 /// Provide this to retrieve the subsequent page.
2629 ///
2630 /// When paginating, all other parameters provided to
2631 /// `ListStreamObjectsRequest` must match the call that provided the page
2632 /// token.
2633 pub page_token: std::string::String,
2634
2635 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2636}
2637
2638impl ListStreamObjectsRequest {
2639 pub fn new() -> Self {
2640 std::default::Default::default()
2641 }
2642
2643 /// Sets the value of [parent][crate::model::ListStreamObjectsRequest::parent].
2644 ///
2645 /// # Example
2646 /// ```ignore,no_run
2647 /// # use google_cloud_datastream_v1::model::ListStreamObjectsRequest;
2648 /// let x = ListStreamObjectsRequest::new().set_parent("example");
2649 /// ```
2650 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2651 self.parent = v.into();
2652 self
2653 }
2654
2655 /// Sets the value of [page_size][crate::model::ListStreamObjectsRequest::page_size].
2656 ///
2657 /// # Example
2658 /// ```ignore,no_run
2659 /// # use google_cloud_datastream_v1::model::ListStreamObjectsRequest;
2660 /// let x = ListStreamObjectsRequest::new().set_page_size(42);
2661 /// ```
2662 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2663 self.page_size = v.into();
2664 self
2665 }
2666
2667 /// Sets the value of [page_token][crate::model::ListStreamObjectsRequest::page_token].
2668 ///
2669 /// # Example
2670 /// ```ignore,no_run
2671 /// # use google_cloud_datastream_v1::model::ListStreamObjectsRequest;
2672 /// let x = ListStreamObjectsRequest::new().set_page_token("example");
2673 /// ```
2674 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2675 self.page_token = v.into();
2676 self
2677 }
2678}
2679
2680impl wkt::message::Message for ListStreamObjectsRequest {
2681 fn typename() -> &'static str {
2682 "type.googleapis.com/google.cloud.datastream.v1.ListStreamObjectsRequest"
2683 }
2684}
2685
2686/// Response containing the objects for a stream.
2687#[derive(Clone, Default, PartialEq)]
2688#[non_exhaustive]
2689pub struct ListStreamObjectsResponse {
2690 /// List of stream objects.
2691 pub stream_objects: std::vec::Vec<crate::model::StreamObject>,
2692
2693 /// A token, which can be sent as `page_token` to retrieve the next page.
2694 pub next_page_token: std::string::String,
2695
2696 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2697}
2698
2699impl ListStreamObjectsResponse {
2700 pub fn new() -> Self {
2701 std::default::Default::default()
2702 }
2703
2704 /// Sets the value of [stream_objects][crate::model::ListStreamObjectsResponse::stream_objects].
2705 ///
2706 /// # Example
2707 /// ```ignore,no_run
2708 /// # use google_cloud_datastream_v1::model::ListStreamObjectsResponse;
2709 /// use google_cloud_datastream_v1::model::StreamObject;
2710 /// let x = ListStreamObjectsResponse::new()
2711 /// .set_stream_objects([
2712 /// StreamObject::default()/* use setters */,
2713 /// StreamObject::default()/* use (different) setters */,
2714 /// ]);
2715 /// ```
2716 pub fn set_stream_objects<T, V>(mut self, v: T) -> Self
2717 where
2718 T: std::iter::IntoIterator<Item = V>,
2719 V: std::convert::Into<crate::model::StreamObject>,
2720 {
2721 use std::iter::Iterator;
2722 self.stream_objects = v.into_iter().map(|i| i.into()).collect();
2723 self
2724 }
2725
2726 /// Sets the value of [next_page_token][crate::model::ListStreamObjectsResponse::next_page_token].
2727 ///
2728 /// # Example
2729 /// ```ignore,no_run
2730 /// # use google_cloud_datastream_v1::model::ListStreamObjectsResponse;
2731 /// let x = ListStreamObjectsResponse::new().set_next_page_token("example");
2732 /// ```
2733 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2734 self.next_page_token = v.into();
2735 self
2736 }
2737}
2738
2739impl wkt::message::Message for ListStreamObjectsResponse {
2740 fn typename() -> &'static str {
2741 "type.googleapis.com/google.cloud.datastream.v1.ListStreamObjectsResponse"
2742 }
2743}
2744
2745#[doc(hidden)]
2746impl gax::paginator::internal::PageableResponse for ListStreamObjectsResponse {
2747 type PageItem = crate::model::StreamObject;
2748
2749 fn items(self) -> std::vec::Vec<Self::PageItem> {
2750 self.stream_objects
2751 }
2752
2753 fn next_page_token(&self) -> std::string::String {
2754 use std::clone::Clone;
2755 self.next_page_token.clone()
2756 }
2757}
2758
2759/// Represents the metadata of the long-running operation.
2760#[derive(Clone, Default, PartialEq)]
2761#[non_exhaustive]
2762pub struct OperationMetadata {
2763 /// Output only. The time the operation was created.
2764 pub create_time: std::option::Option<wkt::Timestamp>,
2765
2766 /// Output only. The time the operation finished running.
2767 pub end_time: std::option::Option<wkt::Timestamp>,
2768
2769 /// Output only. Server-defined resource path for the target of the operation.
2770 pub target: std::string::String,
2771
2772 /// Output only. Name of the verb executed by the operation.
2773 pub verb: std::string::String,
2774
2775 /// Output only. Human-readable status of the operation, if any.
2776 pub status_message: std::string::String,
2777
2778 /// Output only. Identifies whether the user has requested cancellation
2779 /// of the operation. Operations that have successfully been cancelled
2780 /// have
2781 /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
2782 /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
2783 /// corresponding to `Code.CANCELLED`.
2784 ///
2785 /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
2786 /// [google.rpc.Status.code]: rpc::model::Status::code
2787 pub requested_cancellation: bool,
2788
2789 /// Output only. API version used to start the operation.
2790 pub api_version: std::string::String,
2791
2792 /// Output only. Results of executed validations if there are any.
2793 pub validation_result: std::option::Option<crate::model::ValidationResult>,
2794
2795 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2796}
2797
2798impl OperationMetadata {
2799 pub fn new() -> Self {
2800 std::default::Default::default()
2801 }
2802
2803 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
2804 ///
2805 /// # Example
2806 /// ```ignore,no_run
2807 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2808 /// use wkt::Timestamp;
2809 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
2810 /// ```
2811 pub fn set_create_time<T>(mut self, v: T) -> Self
2812 where
2813 T: std::convert::Into<wkt::Timestamp>,
2814 {
2815 self.create_time = std::option::Option::Some(v.into());
2816 self
2817 }
2818
2819 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
2820 ///
2821 /// # Example
2822 /// ```ignore,no_run
2823 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2824 /// use wkt::Timestamp;
2825 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2826 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
2827 /// ```
2828 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2829 where
2830 T: std::convert::Into<wkt::Timestamp>,
2831 {
2832 self.create_time = v.map(|x| x.into());
2833 self
2834 }
2835
2836 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
2837 ///
2838 /// # Example
2839 /// ```ignore,no_run
2840 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2841 /// use wkt::Timestamp;
2842 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
2843 /// ```
2844 pub fn set_end_time<T>(mut self, v: T) -> Self
2845 where
2846 T: std::convert::Into<wkt::Timestamp>,
2847 {
2848 self.end_time = std::option::Option::Some(v.into());
2849 self
2850 }
2851
2852 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
2853 ///
2854 /// # Example
2855 /// ```ignore,no_run
2856 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2857 /// use wkt::Timestamp;
2858 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2859 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
2860 /// ```
2861 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2862 where
2863 T: std::convert::Into<wkt::Timestamp>,
2864 {
2865 self.end_time = v.map(|x| x.into());
2866 self
2867 }
2868
2869 /// Sets the value of [target][crate::model::OperationMetadata::target].
2870 ///
2871 /// # Example
2872 /// ```ignore,no_run
2873 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2874 /// let x = OperationMetadata::new().set_target("example");
2875 /// ```
2876 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2877 self.target = v.into();
2878 self
2879 }
2880
2881 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
2882 ///
2883 /// # Example
2884 /// ```ignore,no_run
2885 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2886 /// let x = OperationMetadata::new().set_verb("example");
2887 /// ```
2888 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2889 self.verb = v.into();
2890 self
2891 }
2892
2893 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
2894 ///
2895 /// # Example
2896 /// ```ignore,no_run
2897 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2898 /// let x = OperationMetadata::new().set_status_message("example");
2899 /// ```
2900 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2901 self.status_message = v.into();
2902 self
2903 }
2904
2905 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
2906 ///
2907 /// # Example
2908 /// ```ignore,no_run
2909 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2910 /// let x = OperationMetadata::new().set_requested_cancellation(true);
2911 /// ```
2912 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2913 self.requested_cancellation = v.into();
2914 self
2915 }
2916
2917 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
2918 ///
2919 /// # Example
2920 /// ```ignore,no_run
2921 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2922 /// let x = OperationMetadata::new().set_api_version("example");
2923 /// ```
2924 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2925 self.api_version = v.into();
2926 self
2927 }
2928
2929 /// Sets the value of [validation_result][crate::model::OperationMetadata::validation_result].
2930 ///
2931 /// # Example
2932 /// ```ignore,no_run
2933 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2934 /// use google_cloud_datastream_v1::model::ValidationResult;
2935 /// let x = OperationMetadata::new().set_validation_result(ValidationResult::default()/* use setters */);
2936 /// ```
2937 pub fn set_validation_result<T>(mut self, v: T) -> Self
2938 where
2939 T: std::convert::Into<crate::model::ValidationResult>,
2940 {
2941 self.validation_result = std::option::Option::Some(v.into());
2942 self
2943 }
2944
2945 /// Sets or clears the value of [validation_result][crate::model::OperationMetadata::validation_result].
2946 ///
2947 /// # Example
2948 /// ```ignore,no_run
2949 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2950 /// use google_cloud_datastream_v1::model::ValidationResult;
2951 /// let x = OperationMetadata::new().set_or_clear_validation_result(Some(ValidationResult::default()/* use setters */));
2952 /// let x = OperationMetadata::new().set_or_clear_validation_result(None::<ValidationResult>);
2953 /// ```
2954 pub fn set_or_clear_validation_result<T>(mut self, v: std::option::Option<T>) -> Self
2955 where
2956 T: std::convert::Into<crate::model::ValidationResult>,
2957 {
2958 self.validation_result = v.map(|x| x.into());
2959 self
2960 }
2961}
2962
2963impl wkt::message::Message for OperationMetadata {
2964 fn typename() -> &'static str {
2965 "type.googleapis.com/google.cloud.datastream.v1.OperationMetadata"
2966 }
2967}
2968
2969/// Request for creating a private connection.
2970#[derive(Clone, Default, PartialEq)]
2971#[non_exhaustive]
2972pub struct CreatePrivateConnectionRequest {
2973 /// Required. The parent that owns the collection of PrivateConnections.
2974 pub parent: std::string::String,
2975
2976 /// Required. The private connectivity identifier.
2977 pub private_connection_id: std::string::String,
2978
2979 /// Required. The Private Connectivity resource to create.
2980 pub private_connection: std::option::Option<crate::model::PrivateConnection>,
2981
2982 /// Optional. A request ID to identify requests. Specify a unique request ID
2983 /// so that if you must retry your request, the server will know to ignore
2984 /// the request if it has already been completed. The server will guarantee
2985 /// that for at least 60 minutes since the first request.
2986 ///
2987 /// For example, consider a situation where you make an initial request and the
2988 /// request times out. If you make the request again with the same request ID,
2989 /// the server can check if original operation with the same request ID was
2990 /// received, and if so, will ignore the second request. This prevents clients
2991 /// from accidentally creating duplicate commitments.
2992 ///
2993 /// The request ID must be a valid UUID with the exception that zero UUID is
2994 /// not supported (00000000-0000-0000-0000-000000000000).
2995 pub request_id: std::string::String,
2996
2997 /// Optional. If set to true, will skip validations.
2998 pub force: bool,
2999
3000 /// Optional. When supplied with PSC Interface config, will get/create the
3001 /// tenant project required for the customer to allow list and won't actually
3002 /// create the private connection.
3003 pub validate_only: bool,
3004
3005 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3006}
3007
3008impl CreatePrivateConnectionRequest {
3009 pub fn new() -> Self {
3010 std::default::Default::default()
3011 }
3012
3013 /// Sets the value of [parent][crate::model::CreatePrivateConnectionRequest::parent].
3014 ///
3015 /// # Example
3016 /// ```ignore,no_run
3017 /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3018 /// let x = CreatePrivateConnectionRequest::new().set_parent("example");
3019 /// ```
3020 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3021 self.parent = v.into();
3022 self
3023 }
3024
3025 /// Sets the value of [private_connection_id][crate::model::CreatePrivateConnectionRequest::private_connection_id].
3026 ///
3027 /// # Example
3028 /// ```ignore,no_run
3029 /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3030 /// let x = CreatePrivateConnectionRequest::new().set_private_connection_id("example");
3031 /// ```
3032 pub fn set_private_connection_id<T: std::convert::Into<std::string::String>>(
3033 mut self,
3034 v: T,
3035 ) -> Self {
3036 self.private_connection_id = v.into();
3037 self
3038 }
3039
3040 /// Sets the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
3041 ///
3042 /// # Example
3043 /// ```ignore,no_run
3044 /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3045 /// use google_cloud_datastream_v1::model::PrivateConnection;
3046 /// let x = CreatePrivateConnectionRequest::new().set_private_connection(PrivateConnection::default()/* use setters */);
3047 /// ```
3048 pub fn set_private_connection<T>(mut self, v: T) -> Self
3049 where
3050 T: std::convert::Into<crate::model::PrivateConnection>,
3051 {
3052 self.private_connection = std::option::Option::Some(v.into());
3053 self
3054 }
3055
3056 /// Sets or clears the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
3057 ///
3058 /// # Example
3059 /// ```ignore,no_run
3060 /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3061 /// use google_cloud_datastream_v1::model::PrivateConnection;
3062 /// let x = CreatePrivateConnectionRequest::new().set_or_clear_private_connection(Some(PrivateConnection::default()/* use setters */));
3063 /// let x = CreatePrivateConnectionRequest::new().set_or_clear_private_connection(None::<PrivateConnection>);
3064 /// ```
3065 pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
3066 where
3067 T: std::convert::Into<crate::model::PrivateConnection>,
3068 {
3069 self.private_connection = v.map(|x| x.into());
3070 self
3071 }
3072
3073 /// Sets the value of [request_id][crate::model::CreatePrivateConnectionRequest::request_id].
3074 ///
3075 /// # Example
3076 /// ```ignore,no_run
3077 /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3078 /// let x = CreatePrivateConnectionRequest::new().set_request_id("example");
3079 /// ```
3080 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3081 self.request_id = v.into();
3082 self
3083 }
3084
3085 /// Sets the value of [force][crate::model::CreatePrivateConnectionRequest::force].
3086 ///
3087 /// # Example
3088 /// ```ignore,no_run
3089 /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3090 /// let x = CreatePrivateConnectionRequest::new().set_force(true);
3091 /// ```
3092 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3093 self.force = v.into();
3094 self
3095 }
3096
3097 /// Sets the value of [validate_only][crate::model::CreatePrivateConnectionRequest::validate_only].
3098 ///
3099 /// # Example
3100 /// ```ignore,no_run
3101 /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3102 /// let x = CreatePrivateConnectionRequest::new().set_validate_only(true);
3103 /// ```
3104 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3105 self.validate_only = v.into();
3106 self
3107 }
3108}
3109
3110impl wkt::message::Message for CreatePrivateConnectionRequest {
3111 fn typename() -> &'static str {
3112 "type.googleapis.com/google.cloud.datastream.v1.CreatePrivateConnectionRequest"
3113 }
3114}
3115
3116/// Request for listing private connections.
3117#[derive(Clone, Default, PartialEq)]
3118#[non_exhaustive]
3119pub struct ListPrivateConnectionsRequest {
3120 /// Required. The parent that owns the collection of private connectivity
3121 /// configurations.
3122 pub parent: std::string::String,
3123
3124 /// Maximum number of private connectivity configurations to return.
3125 /// If unspecified, at most 50 private connectivity configurations that will be
3126 /// returned. The maximum value is 1000; values above 1000 will be coerced to
3127 /// 1000.
3128 pub page_size: i32,
3129
3130 /// Page token received from a previous `ListPrivateConnections` call.
3131 /// Provide this to retrieve the subsequent page.
3132 ///
3133 /// When paginating, all other parameters provided to
3134 /// `ListPrivateConnections` must match the call that provided the page
3135 /// token.
3136 pub page_token: std::string::String,
3137
3138 /// Filter request.
3139 pub filter: std::string::String,
3140
3141 /// Order by fields for the result.
3142 pub order_by: std::string::String,
3143
3144 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3145}
3146
3147impl ListPrivateConnectionsRequest {
3148 pub fn new() -> Self {
3149 std::default::Default::default()
3150 }
3151
3152 /// Sets the value of [parent][crate::model::ListPrivateConnectionsRequest::parent].
3153 ///
3154 /// # Example
3155 /// ```ignore,no_run
3156 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3157 /// let x = ListPrivateConnectionsRequest::new().set_parent("example");
3158 /// ```
3159 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3160 self.parent = v.into();
3161 self
3162 }
3163
3164 /// Sets the value of [page_size][crate::model::ListPrivateConnectionsRequest::page_size].
3165 ///
3166 /// # Example
3167 /// ```ignore,no_run
3168 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3169 /// let x = ListPrivateConnectionsRequest::new().set_page_size(42);
3170 /// ```
3171 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3172 self.page_size = v.into();
3173 self
3174 }
3175
3176 /// Sets the value of [page_token][crate::model::ListPrivateConnectionsRequest::page_token].
3177 ///
3178 /// # Example
3179 /// ```ignore,no_run
3180 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3181 /// let x = ListPrivateConnectionsRequest::new().set_page_token("example");
3182 /// ```
3183 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3184 self.page_token = v.into();
3185 self
3186 }
3187
3188 /// Sets the value of [filter][crate::model::ListPrivateConnectionsRequest::filter].
3189 ///
3190 /// # Example
3191 /// ```ignore,no_run
3192 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3193 /// let x = ListPrivateConnectionsRequest::new().set_filter("example");
3194 /// ```
3195 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3196 self.filter = v.into();
3197 self
3198 }
3199
3200 /// Sets the value of [order_by][crate::model::ListPrivateConnectionsRequest::order_by].
3201 ///
3202 /// # Example
3203 /// ```ignore,no_run
3204 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3205 /// let x = ListPrivateConnectionsRequest::new().set_order_by("example");
3206 /// ```
3207 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3208 self.order_by = v.into();
3209 self
3210 }
3211}
3212
3213impl wkt::message::Message for ListPrivateConnectionsRequest {
3214 fn typename() -> &'static str {
3215 "type.googleapis.com/google.cloud.datastream.v1.ListPrivateConnectionsRequest"
3216 }
3217}
3218
3219/// Response containing a list of private connection configurations.
3220#[derive(Clone, Default, PartialEq)]
3221#[non_exhaustive]
3222pub struct ListPrivateConnectionsResponse {
3223 /// List of private connectivity configurations.
3224 pub private_connections: std::vec::Vec<crate::model::PrivateConnection>,
3225
3226 /// A token, which can be sent as `page_token` to retrieve the next page.
3227 /// If this field is omitted, there are no subsequent pages.
3228 pub next_page_token: std::string::String,
3229
3230 /// Locations that could not be reached.
3231 pub unreachable: std::vec::Vec<std::string::String>,
3232
3233 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3234}
3235
3236impl ListPrivateConnectionsResponse {
3237 pub fn new() -> Self {
3238 std::default::Default::default()
3239 }
3240
3241 /// Sets the value of [private_connections][crate::model::ListPrivateConnectionsResponse::private_connections].
3242 ///
3243 /// # Example
3244 /// ```ignore,no_run
3245 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsResponse;
3246 /// use google_cloud_datastream_v1::model::PrivateConnection;
3247 /// let x = ListPrivateConnectionsResponse::new()
3248 /// .set_private_connections([
3249 /// PrivateConnection::default()/* use setters */,
3250 /// PrivateConnection::default()/* use (different) setters */,
3251 /// ]);
3252 /// ```
3253 pub fn set_private_connections<T, V>(mut self, v: T) -> Self
3254 where
3255 T: std::iter::IntoIterator<Item = V>,
3256 V: std::convert::Into<crate::model::PrivateConnection>,
3257 {
3258 use std::iter::Iterator;
3259 self.private_connections = v.into_iter().map(|i| i.into()).collect();
3260 self
3261 }
3262
3263 /// Sets the value of [next_page_token][crate::model::ListPrivateConnectionsResponse::next_page_token].
3264 ///
3265 /// # Example
3266 /// ```ignore,no_run
3267 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsResponse;
3268 /// let x = ListPrivateConnectionsResponse::new().set_next_page_token("example");
3269 /// ```
3270 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3271 self.next_page_token = v.into();
3272 self
3273 }
3274
3275 /// Sets the value of [unreachable][crate::model::ListPrivateConnectionsResponse::unreachable].
3276 ///
3277 /// # Example
3278 /// ```ignore,no_run
3279 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsResponse;
3280 /// let x = ListPrivateConnectionsResponse::new().set_unreachable(["a", "b", "c"]);
3281 /// ```
3282 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3283 where
3284 T: std::iter::IntoIterator<Item = V>,
3285 V: std::convert::Into<std::string::String>,
3286 {
3287 use std::iter::Iterator;
3288 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3289 self
3290 }
3291}
3292
3293impl wkt::message::Message for ListPrivateConnectionsResponse {
3294 fn typename() -> &'static str {
3295 "type.googleapis.com/google.cloud.datastream.v1.ListPrivateConnectionsResponse"
3296 }
3297}
3298
3299#[doc(hidden)]
3300impl gax::paginator::internal::PageableResponse for ListPrivateConnectionsResponse {
3301 type PageItem = crate::model::PrivateConnection;
3302
3303 fn items(self) -> std::vec::Vec<Self::PageItem> {
3304 self.private_connections
3305 }
3306
3307 fn next_page_token(&self) -> std::string::String {
3308 use std::clone::Clone;
3309 self.next_page_token.clone()
3310 }
3311}
3312
3313/// Request to delete a private connection.
3314#[derive(Clone, Default, PartialEq)]
3315#[non_exhaustive]
3316pub struct DeletePrivateConnectionRequest {
3317 /// Required. The name of the private connectivity configuration to delete.
3318 pub name: std::string::String,
3319
3320 /// Optional. A request ID to identify requests. Specify a unique request ID
3321 /// so that if you must retry your request, the server will know to ignore
3322 /// the request if it has already been completed. The server will guarantee
3323 /// that for at least 60 minutes after the first request.
3324 ///
3325 /// For example, consider a situation where you make an initial request and the
3326 /// request times out. If you make the request again with the same request ID,
3327 /// the server can check if original operation with the same request ID was
3328 /// received, and if so, will ignore the second request. This prevents clients
3329 /// from accidentally creating duplicate commitments.
3330 ///
3331 /// The request ID must be a valid UUID with the exception that zero UUID is
3332 /// not supported (00000000-0000-0000-0000-000000000000).
3333 pub request_id: std::string::String,
3334
3335 /// Optional. If set to true, any child routes that belong to this
3336 /// PrivateConnection will also be deleted.
3337 pub force: bool,
3338
3339 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3340}
3341
3342impl DeletePrivateConnectionRequest {
3343 pub fn new() -> Self {
3344 std::default::Default::default()
3345 }
3346
3347 /// Sets the value of [name][crate::model::DeletePrivateConnectionRequest::name].
3348 ///
3349 /// # Example
3350 /// ```ignore,no_run
3351 /// # use google_cloud_datastream_v1::model::DeletePrivateConnectionRequest;
3352 /// let x = DeletePrivateConnectionRequest::new().set_name("example");
3353 /// ```
3354 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3355 self.name = v.into();
3356 self
3357 }
3358
3359 /// Sets the value of [request_id][crate::model::DeletePrivateConnectionRequest::request_id].
3360 ///
3361 /// # Example
3362 /// ```ignore,no_run
3363 /// # use google_cloud_datastream_v1::model::DeletePrivateConnectionRequest;
3364 /// let x = DeletePrivateConnectionRequest::new().set_request_id("example");
3365 /// ```
3366 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3367 self.request_id = v.into();
3368 self
3369 }
3370
3371 /// Sets the value of [force][crate::model::DeletePrivateConnectionRequest::force].
3372 ///
3373 /// # Example
3374 /// ```ignore,no_run
3375 /// # use google_cloud_datastream_v1::model::DeletePrivateConnectionRequest;
3376 /// let x = DeletePrivateConnectionRequest::new().set_force(true);
3377 /// ```
3378 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3379 self.force = v.into();
3380 self
3381 }
3382}
3383
3384impl wkt::message::Message for DeletePrivateConnectionRequest {
3385 fn typename() -> &'static str {
3386 "type.googleapis.com/google.cloud.datastream.v1.DeletePrivateConnectionRequest"
3387 }
3388}
3389
3390/// Request to get a private connection configuration.
3391#[derive(Clone, Default, PartialEq)]
3392#[non_exhaustive]
3393pub struct GetPrivateConnectionRequest {
3394 /// Required. The name of the private connectivity configuration to get.
3395 pub name: std::string::String,
3396
3397 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3398}
3399
3400impl GetPrivateConnectionRequest {
3401 pub fn new() -> Self {
3402 std::default::Default::default()
3403 }
3404
3405 /// Sets the value of [name][crate::model::GetPrivateConnectionRequest::name].
3406 ///
3407 /// # Example
3408 /// ```ignore,no_run
3409 /// # use google_cloud_datastream_v1::model::GetPrivateConnectionRequest;
3410 /// let x = GetPrivateConnectionRequest::new().set_name("example");
3411 /// ```
3412 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3413 self.name = v.into();
3414 self
3415 }
3416}
3417
3418impl wkt::message::Message for GetPrivateConnectionRequest {
3419 fn typename() -> &'static str {
3420 "type.googleapis.com/google.cloud.datastream.v1.GetPrivateConnectionRequest"
3421 }
3422}
3423
3424/// Route creation request.
3425#[derive(Clone, Default, PartialEq)]
3426#[non_exhaustive]
3427pub struct CreateRouteRequest {
3428 /// Required. The parent that owns the collection of Routes.
3429 pub parent: std::string::String,
3430
3431 /// Required. The Route identifier.
3432 pub route_id: std::string::String,
3433
3434 /// Required. The Route resource to create.
3435 pub route: std::option::Option<crate::model::Route>,
3436
3437 /// Optional. A request ID to identify requests. Specify a unique request ID
3438 /// so that if you must retry your request, the server will know to ignore
3439 /// the request if it has already been completed. The server will guarantee
3440 /// that for at least 60 minutes since the first request.
3441 ///
3442 /// For example, consider a situation where you make an initial request and the
3443 /// request times out. If you make the request again with the same request ID,
3444 /// the server can check if original operation with the same request ID was
3445 /// received, and if so, will ignore the second request. This prevents clients
3446 /// from accidentally creating duplicate commitments.
3447 ///
3448 /// The request ID must be a valid UUID with the exception that zero UUID is
3449 /// not supported (00000000-0000-0000-0000-000000000000).
3450 pub request_id: std::string::String,
3451
3452 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3453}
3454
3455impl CreateRouteRequest {
3456 pub fn new() -> Self {
3457 std::default::Default::default()
3458 }
3459
3460 /// Sets the value of [parent][crate::model::CreateRouteRequest::parent].
3461 ///
3462 /// # Example
3463 /// ```ignore,no_run
3464 /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3465 /// let x = CreateRouteRequest::new().set_parent("example");
3466 /// ```
3467 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3468 self.parent = v.into();
3469 self
3470 }
3471
3472 /// Sets the value of [route_id][crate::model::CreateRouteRequest::route_id].
3473 ///
3474 /// # Example
3475 /// ```ignore,no_run
3476 /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3477 /// let x = CreateRouteRequest::new().set_route_id("example");
3478 /// ```
3479 pub fn set_route_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3480 self.route_id = v.into();
3481 self
3482 }
3483
3484 /// Sets the value of [route][crate::model::CreateRouteRequest::route].
3485 ///
3486 /// # Example
3487 /// ```ignore,no_run
3488 /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3489 /// use google_cloud_datastream_v1::model::Route;
3490 /// let x = CreateRouteRequest::new().set_route(Route::default()/* use setters */);
3491 /// ```
3492 pub fn set_route<T>(mut self, v: T) -> Self
3493 where
3494 T: std::convert::Into<crate::model::Route>,
3495 {
3496 self.route = std::option::Option::Some(v.into());
3497 self
3498 }
3499
3500 /// Sets or clears the value of [route][crate::model::CreateRouteRequest::route].
3501 ///
3502 /// # Example
3503 /// ```ignore,no_run
3504 /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3505 /// use google_cloud_datastream_v1::model::Route;
3506 /// let x = CreateRouteRequest::new().set_or_clear_route(Some(Route::default()/* use setters */));
3507 /// let x = CreateRouteRequest::new().set_or_clear_route(None::<Route>);
3508 /// ```
3509 pub fn set_or_clear_route<T>(mut self, v: std::option::Option<T>) -> Self
3510 where
3511 T: std::convert::Into<crate::model::Route>,
3512 {
3513 self.route = v.map(|x| x.into());
3514 self
3515 }
3516
3517 /// Sets the value of [request_id][crate::model::CreateRouteRequest::request_id].
3518 ///
3519 /// # Example
3520 /// ```ignore,no_run
3521 /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3522 /// let x = CreateRouteRequest::new().set_request_id("example");
3523 /// ```
3524 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3525 self.request_id = v.into();
3526 self
3527 }
3528}
3529
3530impl wkt::message::Message for CreateRouteRequest {
3531 fn typename() -> &'static str {
3532 "type.googleapis.com/google.cloud.datastream.v1.CreateRouteRequest"
3533 }
3534}
3535
3536/// Route list request.
3537#[derive(Clone, Default, PartialEq)]
3538#[non_exhaustive]
3539pub struct ListRoutesRequest {
3540 /// Required. The parent that owns the collection of Routess.
3541 pub parent: std::string::String,
3542
3543 /// Maximum number of Routes to return. The service may return
3544 /// fewer than this value. If unspecified, at most 50 Routes
3545 /// will be returned. The maximum value is 1000; values above 1000 will be
3546 /// coerced to 1000.
3547 pub page_size: i32,
3548
3549 /// Page token received from a previous `ListRoutes` call.
3550 /// Provide this to retrieve the subsequent page.
3551 ///
3552 /// When paginating, all other parameters provided to
3553 /// `ListRoutes` must match the call that provided the page
3554 /// token.
3555 pub page_token: std::string::String,
3556
3557 /// Filter request.
3558 pub filter: std::string::String,
3559
3560 /// Order by fields for the result.
3561 pub order_by: std::string::String,
3562
3563 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3564}
3565
3566impl ListRoutesRequest {
3567 pub fn new() -> Self {
3568 std::default::Default::default()
3569 }
3570
3571 /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
3572 ///
3573 /// # Example
3574 /// ```ignore,no_run
3575 /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3576 /// let x = ListRoutesRequest::new().set_parent("example");
3577 /// ```
3578 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3579 self.parent = v.into();
3580 self
3581 }
3582
3583 /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
3584 ///
3585 /// # Example
3586 /// ```ignore,no_run
3587 /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3588 /// let x = ListRoutesRequest::new().set_page_size(42);
3589 /// ```
3590 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3591 self.page_size = v.into();
3592 self
3593 }
3594
3595 /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
3596 ///
3597 /// # Example
3598 /// ```ignore,no_run
3599 /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3600 /// let x = ListRoutesRequest::new().set_page_token("example");
3601 /// ```
3602 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3603 self.page_token = v.into();
3604 self
3605 }
3606
3607 /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
3608 ///
3609 /// # Example
3610 /// ```ignore,no_run
3611 /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3612 /// let x = ListRoutesRequest::new().set_filter("example");
3613 /// ```
3614 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3615 self.filter = v.into();
3616 self
3617 }
3618
3619 /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
3620 ///
3621 /// # Example
3622 /// ```ignore,no_run
3623 /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3624 /// let x = ListRoutesRequest::new().set_order_by("example");
3625 /// ```
3626 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3627 self.order_by = v.into();
3628 self
3629 }
3630}
3631
3632impl wkt::message::Message for ListRoutesRequest {
3633 fn typename() -> &'static str {
3634 "type.googleapis.com/google.cloud.datastream.v1.ListRoutesRequest"
3635 }
3636}
3637
3638/// Route list response.
3639#[derive(Clone, Default, PartialEq)]
3640#[non_exhaustive]
3641pub struct ListRoutesResponse {
3642 /// List of Routes.
3643 pub routes: std::vec::Vec<crate::model::Route>,
3644
3645 /// A token, which can be sent as `page_token` to retrieve the next page.
3646 /// If this field is omitted, there are no subsequent pages.
3647 pub next_page_token: std::string::String,
3648
3649 /// Locations that could not be reached.
3650 pub unreachable: std::vec::Vec<std::string::String>,
3651
3652 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3653}
3654
3655impl ListRoutesResponse {
3656 pub fn new() -> Self {
3657 std::default::Default::default()
3658 }
3659
3660 /// Sets the value of [routes][crate::model::ListRoutesResponse::routes].
3661 ///
3662 /// # Example
3663 /// ```ignore,no_run
3664 /// # use google_cloud_datastream_v1::model::ListRoutesResponse;
3665 /// use google_cloud_datastream_v1::model::Route;
3666 /// let x = ListRoutesResponse::new()
3667 /// .set_routes([
3668 /// Route::default()/* use setters */,
3669 /// Route::default()/* use (different) setters */,
3670 /// ]);
3671 /// ```
3672 pub fn set_routes<T, V>(mut self, v: T) -> Self
3673 where
3674 T: std::iter::IntoIterator<Item = V>,
3675 V: std::convert::Into<crate::model::Route>,
3676 {
3677 use std::iter::Iterator;
3678 self.routes = v.into_iter().map(|i| i.into()).collect();
3679 self
3680 }
3681
3682 /// Sets the value of [next_page_token][crate::model::ListRoutesResponse::next_page_token].
3683 ///
3684 /// # Example
3685 /// ```ignore,no_run
3686 /// # use google_cloud_datastream_v1::model::ListRoutesResponse;
3687 /// let x = ListRoutesResponse::new().set_next_page_token("example");
3688 /// ```
3689 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3690 self.next_page_token = v.into();
3691 self
3692 }
3693
3694 /// Sets the value of [unreachable][crate::model::ListRoutesResponse::unreachable].
3695 ///
3696 /// # Example
3697 /// ```ignore,no_run
3698 /// # use google_cloud_datastream_v1::model::ListRoutesResponse;
3699 /// let x = ListRoutesResponse::new().set_unreachable(["a", "b", "c"]);
3700 /// ```
3701 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3702 where
3703 T: std::iter::IntoIterator<Item = V>,
3704 V: std::convert::Into<std::string::String>,
3705 {
3706 use std::iter::Iterator;
3707 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3708 self
3709 }
3710}
3711
3712impl wkt::message::Message for ListRoutesResponse {
3713 fn typename() -> &'static str {
3714 "type.googleapis.com/google.cloud.datastream.v1.ListRoutesResponse"
3715 }
3716}
3717
3718#[doc(hidden)]
3719impl gax::paginator::internal::PageableResponse for ListRoutesResponse {
3720 type PageItem = crate::model::Route;
3721
3722 fn items(self) -> std::vec::Vec<Self::PageItem> {
3723 self.routes
3724 }
3725
3726 fn next_page_token(&self) -> std::string::String {
3727 use std::clone::Clone;
3728 self.next_page_token.clone()
3729 }
3730}
3731
3732/// Route deletion request.
3733#[derive(Clone, Default, PartialEq)]
3734#[non_exhaustive]
3735pub struct DeleteRouteRequest {
3736 /// Required. The name of the Route resource to delete.
3737 pub name: std::string::String,
3738
3739 /// Optional. A request ID to identify requests. Specify a unique request ID
3740 /// so that if you must retry your request, the server will know to ignore
3741 /// the request if it has already been completed. The server will guarantee
3742 /// that for at least 60 minutes after the first request.
3743 ///
3744 /// For example, consider a situation where you make an initial request and the
3745 /// request times out. If you make the request again with the same request ID,
3746 /// the server can check if original operation with the same request ID was
3747 /// received, and if so, will ignore the second request. This prevents clients
3748 /// from accidentally creating duplicate commitments.
3749 ///
3750 /// The request ID must be a valid UUID with the exception that zero UUID is
3751 /// not supported (00000000-0000-0000-0000-000000000000).
3752 pub request_id: std::string::String,
3753
3754 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3755}
3756
3757impl DeleteRouteRequest {
3758 pub fn new() -> Self {
3759 std::default::Default::default()
3760 }
3761
3762 /// Sets the value of [name][crate::model::DeleteRouteRequest::name].
3763 ///
3764 /// # Example
3765 /// ```ignore,no_run
3766 /// # use google_cloud_datastream_v1::model::DeleteRouteRequest;
3767 /// let x = DeleteRouteRequest::new().set_name("example");
3768 /// ```
3769 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3770 self.name = v.into();
3771 self
3772 }
3773
3774 /// Sets the value of [request_id][crate::model::DeleteRouteRequest::request_id].
3775 ///
3776 /// # Example
3777 /// ```ignore,no_run
3778 /// # use google_cloud_datastream_v1::model::DeleteRouteRequest;
3779 /// let x = DeleteRouteRequest::new().set_request_id("example");
3780 /// ```
3781 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3782 self.request_id = v.into();
3783 self
3784 }
3785}
3786
3787impl wkt::message::Message for DeleteRouteRequest {
3788 fn typename() -> &'static str {
3789 "type.googleapis.com/google.cloud.datastream.v1.DeleteRouteRequest"
3790 }
3791}
3792
3793/// Route get request.
3794#[derive(Clone, Default, PartialEq)]
3795#[non_exhaustive]
3796pub struct GetRouteRequest {
3797 /// Required. The name of the Route resource to get.
3798 pub name: std::string::String,
3799
3800 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3801}
3802
3803impl GetRouteRequest {
3804 pub fn new() -> Self {
3805 std::default::Default::default()
3806 }
3807
3808 /// Sets the value of [name][crate::model::GetRouteRequest::name].
3809 ///
3810 /// # Example
3811 /// ```ignore,no_run
3812 /// # use google_cloud_datastream_v1::model::GetRouteRequest;
3813 /// let x = GetRouteRequest::new().set_name("example");
3814 /// ```
3815 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3816 self.name = v.into();
3817 self
3818 }
3819}
3820
3821impl wkt::message::Message for GetRouteRequest {
3822 fn typename() -> &'static str {
3823 "type.googleapis.com/google.cloud.datastream.v1.GetRouteRequest"
3824 }
3825}
3826
3827/// Oracle database profile.
3828#[derive(Clone, Default, PartialEq)]
3829#[non_exhaustive]
3830pub struct OracleProfile {
3831 /// Required. Hostname for the Oracle connection.
3832 pub hostname: std::string::String,
3833
3834 /// Port for the Oracle connection, default value is 1521.
3835 pub port: i32,
3836
3837 /// Required. Username for the Oracle connection.
3838 pub username: std::string::String,
3839
3840 /// Optional. Password for the Oracle connection. Mutually exclusive with the
3841 /// `secret_manager_stored_password` field.
3842 pub password: std::string::String,
3843
3844 /// Required. Database for the Oracle connection.
3845 pub database_service: std::string::String,
3846
3847 /// Connection string attributes
3848 pub connection_attributes: std::collections::HashMap<std::string::String, std::string::String>,
3849
3850 /// Optional. SSL configuration for the Oracle connection.
3851 pub oracle_ssl_config: std::option::Option<crate::model::OracleSslConfig>,
3852
3853 /// Optional. Configuration for Oracle ASM connection.
3854 pub oracle_asm_config: std::option::Option<crate::model::OracleAsmConfig>,
3855
3856 /// Optional. A reference to a Secret Manager resource name storing the Oracle
3857 /// connection password. Mutually exclusive with the `password` field.
3858 pub secret_manager_stored_password: std::string::String,
3859
3860 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3861}
3862
3863impl OracleProfile {
3864 pub fn new() -> Self {
3865 std::default::Default::default()
3866 }
3867
3868 /// Sets the value of [hostname][crate::model::OracleProfile::hostname].
3869 ///
3870 /// # Example
3871 /// ```ignore,no_run
3872 /// # use google_cloud_datastream_v1::model::OracleProfile;
3873 /// let x = OracleProfile::new().set_hostname("example");
3874 /// ```
3875 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3876 self.hostname = v.into();
3877 self
3878 }
3879
3880 /// Sets the value of [port][crate::model::OracleProfile::port].
3881 ///
3882 /// # Example
3883 /// ```ignore,no_run
3884 /// # use google_cloud_datastream_v1::model::OracleProfile;
3885 /// let x = OracleProfile::new().set_port(42);
3886 /// ```
3887 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3888 self.port = v.into();
3889 self
3890 }
3891
3892 /// Sets the value of [username][crate::model::OracleProfile::username].
3893 ///
3894 /// # Example
3895 /// ```ignore,no_run
3896 /// # use google_cloud_datastream_v1::model::OracleProfile;
3897 /// let x = OracleProfile::new().set_username("example");
3898 /// ```
3899 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3900 self.username = v.into();
3901 self
3902 }
3903
3904 /// Sets the value of [password][crate::model::OracleProfile::password].
3905 ///
3906 /// # Example
3907 /// ```ignore,no_run
3908 /// # use google_cloud_datastream_v1::model::OracleProfile;
3909 /// let x = OracleProfile::new().set_password("example");
3910 /// ```
3911 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3912 self.password = v.into();
3913 self
3914 }
3915
3916 /// Sets the value of [database_service][crate::model::OracleProfile::database_service].
3917 ///
3918 /// # Example
3919 /// ```ignore,no_run
3920 /// # use google_cloud_datastream_v1::model::OracleProfile;
3921 /// let x = OracleProfile::new().set_database_service("example");
3922 /// ```
3923 pub fn set_database_service<T: std::convert::Into<std::string::String>>(
3924 mut self,
3925 v: T,
3926 ) -> Self {
3927 self.database_service = v.into();
3928 self
3929 }
3930
3931 /// Sets the value of [connection_attributes][crate::model::OracleProfile::connection_attributes].
3932 ///
3933 /// # Example
3934 /// ```ignore,no_run
3935 /// # use google_cloud_datastream_v1::model::OracleProfile;
3936 /// let x = OracleProfile::new().set_connection_attributes([
3937 /// ("key0", "abc"),
3938 /// ("key1", "xyz"),
3939 /// ]);
3940 /// ```
3941 pub fn set_connection_attributes<T, K, V>(mut self, v: T) -> Self
3942 where
3943 T: std::iter::IntoIterator<Item = (K, V)>,
3944 K: std::convert::Into<std::string::String>,
3945 V: std::convert::Into<std::string::String>,
3946 {
3947 use std::iter::Iterator;
3948 self.connection_attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3949 self
3950 }
3951
3952 /// Sets the value of [oracle_ssl_config][crate::model::OracleProfile::oracle_ssl_config].
3953 ///
3954 /// # Example
3955 /// ```ignore,no_run
3956 /// # use google_cloud_datastream_v1::model::OracleProfile;
3957 /// use google_cloud_datastream_v1::model::OracleSslConfig;
3958 /// let x = OracleProfile::new().set_oracle_ssl_config(OracleSslConfig::default()/* use setters */);
3959 /// ```
3960 pub fn set_oracle_ssl_config<T>(mut self, v: T) -> Self
3961 where
3962 T: std::convert::Into<crate::model::OracleSslConfig>,
3963 {
3964 self.oracle_ssl_config = std::option::Option::Some(v.into());
3965 self
3966 }
3967
3968 /// Sets or clears the value of [oracle_ssl_config][crate::model::OracleProfile::oracle_ssl_config].
3969 ///
3970 /// # Example
3971 /// ```ignore,no_run
3972 /// # use google_cloud_datastream_v1::model::OracleProfile;
3973 /// use google_cloud_datastream_v1::model::OracleSslConfig;
3974 /// let x = OracleProfile::new().set_or_clear_oracle_ssl_config(Some(OracleSslConfig::default()/* use setters */));
3975 /// let x = OracleProfile::new().set_or_clear_oracle_ssl_config(None::<OracleSslConfig>);
3976 /// ```
3977 pub fn set_or_clear_oracle_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
3978 where
3979 T: std::convert::Into<crate::model::OracleSslConfig>,
3980 {
3981 self.oracle_ssl_config = v.map(|x| x.into());
3982 self
3983 }
3984
3985 /// Sets the value of [oracle_asm_config][crate::model::OracleProfile::oracle_asm_config].
3986 ///
3987 /// # Example
3988 /// ```ignore,no_run
3989 /// # use google_cloud_datastream_v1::model::OracleProfile;
3990 /// use google_cloud_datastream_v1::model::OracleAsmConfig;
3991 /// let x = OracleProfile::new().set_oracle_asm_config(OracleAsmConfig::default()/* use setters */);
3992 /// ```
3993 pub fn set_oracle_asm_config<T>(mut self, v: T) -> Self
3994 where
3995 T: std::convert::Into<crate::model::OracleAsmConfig>,
3996 {
3997 self.oracle_asm_config = std::option::Option::Some(v.into());
3998 self
3999 }
4000
4001 /// Sets or clears the value of [oracle_asm_config][crate::model::OracleProfile::oracle_asm_config].
4002 ///
4003 /// # Example
4004 /// ```ignore,no_run
4005 /// # use google_cloud_datastream_v1::model::OracleProfile;
4006 /// use google_cloud_datastream_v1::model::OracleAsmConfig;
4007 /// let x = OracleProfile::new().set_or_clear_oracle_asm_config(Some(OracleAsmConfig::default()/* use setters */));
4008 /// let x = OracleProfile::new().set_or_clear_oracle_asm_config(None::<OracleAsmConfig>);
4009 /// ```
4010 pub fn set_or_clear_oracle_asm_config<T>(mut self, v: std::option::Option<T>) -> Self
4011 where
4012 T: std::convert::Into<crate::model::OracleAsmConfig>,
4013 {
4014 self.oracle_asm_config = v.map(|x| x.into());
4015 self
4016 }
4017
4018 /// Sets the value of [secret_manager_stored_password][crate::model::OracleProfile::secret_manager_stored_password].
4019 ///
4020 /// # Example
4021 /// ```ignore,no_run
4022 /// # use google_cloud_datastream_v1::model::OracleProfile;
4023 /// let x = OracleProfile::new().set_secret_manager_stored_password("example");
4024 /// ```
4025 pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4026 mut self,
4027 v: T,
4028 ) -> Self {
4029 self.secret_manager_stored_password = v.into();
4030 self
4031 }
4032}
4033
4034impl wkt::message::Message for OracleProfile {
4035 fn typename() -> &'static str {
4036 "type.googleapis.com/google.cloud.datastream.v1.OracleProfile"
4037 }
4038}
4039
4040/// Configuration for Oracle Automatic Storage Management (ASM) connection.
4041#[derive(Clone, Default, PartialEq)]
4042#[non_exhaustive]
4043pub struct OracleAsmConfig {
4044 /// Required. Hostname for the Oracle ASM connection.
4045 pub hostname: std::string::String,
4046
4047 /// Required. Port for the Oracle ASM connection.
4048 pub port: i32,
4049
4050 /// Required. Username for the Oracle ASM connection.
4051 pub username: std::string::String,
4052
4053 /// Optional. Password for the Oracle ASM connection. Mutually exclusive with
4054 /// the `secret_manager_stored_password` field.
4055 pub password: std::string::String,
4056
4057 /// Required. ASM service name for the Oracle ASM connection.
4058 pub asm_service: std::string::String,
4059
4060 /// Optional. Connection string attributes
4061 pub connection_attributes: std::collections::HashMap<std::string::String, std::string::String>,
4062
4063 /// Optional. SSL configuration for the Oracle connection.
4064 pub oracle_ssl_config: std::option::Option<crate::model::OracleSslConfig>,
4065
4066 /// Optional. A reference to a Secret Manager resource name storing the Oracle
4067 /// ASM connection password. Mutually exclusive with the `password` field.
4068 pub secret_manager_stored_password: std::string::String,
4069
4070 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4071}
4072
4073impl OracleAsmConfig {
4074 pub fn new() -> Self {
4075 std::default::Default::default()
4076 }
4077
4078 /// Sets the value of [hostname][crate::model::OracleAsmConfig::hostname].
4079 ///
4080 /// # Example
4081 /// ```ignore,no_run
4082 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4083 /// let x = OracleAsmConfig::new().set_hostname("example");
4084 /// ```
4085 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4086 self.hostname = v.into();
4087 self
4088 }
4089
4090 /// Sets the value of [port][crate::model::OracleAsmConfig::port].
4091 ///
4092 /// # Example
4093 /// ```ignore,no_run
4094 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4095 /// let x = OracleAsmConfig::new().set_port(42);
4096 /// ```
4097 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4098 self.port = v.into();
4099 self
4100 }
4101
4102 /// Sets the value of [username][crate::model::OracleAsmConfig::username].
4103 ///
4104 /// # Example
4105 /// ```ignore,no_run
4106 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4107 /// let x = OracleAsmConfig::new().set_username("example");
4108 /// ```
4109 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4110 self.username = v.into();
4111 self
4112 }
4113
4114 /// Sets the value of [password][crate::model::OracleAsmConfig::password].
4115 ///
4116 /// # Example
4117 /// ```ignore,no_run
4118 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4119 /// let x = OracleAsmConfig::new().set_password("example");
4120 /// ```
4121 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4122 self.password = v.into();
4123 self
4124 }
4125
4126 /// Sets the value of [asm_service][crate::model::OracleAsmConfig::asm_service].
4127 ///
4128 /// # Example
4129 /// ```ignore,no_run
4130 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4131 /// let x = OracleAsmConfig::new().set_asm_service("example");
4132 /// ```
4133 pub fn set_asm_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4134 self.asm_service = v.into();
4135 self
4136 }
4137
4138 /// Sets the value of [connection_attributes][crate::model::OracleAsmConfig::connection_attributes].
4139 ///
4140 /// # Example
4141 /// ```ignore,no_run
4142 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4143 /// let x = OracleAsmConfig::new().set_connection_attributes([
4144 /// ("key0", "abc"),
4145 /// ("key1", "xyz"),
4146 /// ]);
4147 /// ```
4148 pub fn set_connection_attributes<T, K, V>(mut self, v: T) -> Self
4149 where
4150 T: std::iter::IntoIterator<Item = (K, V)>,
4151 K: std::convert::Into<std::string::String>,
4152 V: std::convert::Into<std::string::String>,
4153 {
4154 use std::iter::Iterator;
4155 self.connection_attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4156 self
4157 }
4158
4159 /// Sets the value of [oracle_ssl_config][crate::model::OracleAsmConfig::oracle_ssl_config].
4160 ///
4161 /// # Example
4162 /// ```ignore,no_run
4163 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4164 /// use google_cloud_datastream_v1::model::OracleSslConfig;
4165 /// let x = OracleAsmConfig::new().set_oracle_ssl_config(OracleSslConfig::default()/* use setters */);
4166 /// ```
4167 pub fn set_oracle_ssl_config<T>(mut self, v: T) -> Self
4168 where
4169 T: std::convert::Into<crate::model::OracleSslConfig>,
4170 {
4171 self.oracle_ssl_config = std::option::Option::Some(v.into());
4172 self
4173 }
4174
4175 /// Sets or clears the value of [oracle_ssl_config][crate::model::OracleAsmConfig::oracle_ssl_config].
4176 ///
4177 /// # Example
4178 /// ```ignore,no_run
4179 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4180 /// use google_cloud_datastream_v1::model::OracleSslConfig;
4181 /// let x = OracleAsmConfig::new().set_or_clear_oracle_ssl_config(Some(OracleSslConfig::default()/* use setters */));
4182 /// let x = OracleAsmConfig::new().set_or_clear_oracle_ssl_config(None::<OracleSslConfig>);
4183 /// ```
4184 pub fn set_or_clear_oracle_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
4185 where
4186 T: std::convert::Into<crate::model::OracleSslConfig>,
4187 {
4188 self.oracle_ssl_config = v.map(|x| x.into());
4189 self
4190 }
4191
4192 /// Sets the value of [secret_manager_stored_password][crate::model::OracleAsmConfig::secret_manager_stored_password].
4193 ///
4194 /// # Example
4195 /// ```ignore,no_run
4196 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4197 /// let x = OracleAsmConfig::new().set_secret_manager_stored_password("example");
4198 /// ```
4199 pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4200 mut self,
4201 v: T,
4202 ) -> Self {
4203 self.secret_manager_stored_password = v.into();
4204 self
4205 }
4206}
4207
4208impl wkt::message::Message for OracleAsmConfig {
4209 fn typename() -> &'static str {
4210 "type.googleapis.com/google.cloud.datastream.v1.OracleAsmConfig"
4211 }
4212}
4213
4214/// MySQL database profile.
4215#[derive(Clone, Default, PartialEq)]
4216#[non_exhaustive]
4217pub struct MysqlProfile {
4218 /// Required. Hostname for the MySQL connection.
4219 pub hostname: std::string::String,
4220
4221 /// Port for the MySQL connection, default value is 3306.
4222 pub port: i32,
4223
4224 /// Required. Username for the MySQL connection.
4225 pub username: std::string::String,
4226
4227 /// Optional. Input only. Password for the MySQL connection. Mutually exclusive
4228 /// with the `secret_manager_stored_password` field.
4229 pub password: std::string::String,
4230
4231 /// SSL configuration for the MySQL connection.
4232 pub ssl_config: std::option::Option<crate::model::MysqlSslConfig>,
4233
4234 /// Optional. A reference to a Secret Manager resource name storing the MySQL
4235 /// connection password. Mutually exclusive with the `password` field.
4236 pub secret_manager_stored_password: std::string::String,
4237
4238 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4239}
4240
4241impl MysqlProfile {
4242 pub fn new() -> Self {
4243 std::default::Default::default()
4244 }
4245
4246 /// Sets the value of [hostname][crate::model::MysqlProfile::hostname].
4247 ///
4248 /// # Example
4249 /// ```ignore,no_run
4250 /// # use google_cloud_datastream_v1::model::MysqlProfile;
4251 /// let x = MysqlProfile::new().set_hostname("example");
4252 /// ```
4253 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4254 self.hostname = v.into();
4255 self
4256 }
4257
4258 /// Sets the value of [port][crate::model::MysqlProfile::port].
4259 ///
4260 /// # Example
4261 /// ```ignore,no_run
4262 /// # use google_cloud_datastream_v1::model::MysqlProfile;
4263 /// let x = MysqlProfile::new().set_port(42);
4264 /// ```
4265 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4266 self.port = v.into();
4267 self
4268 }
4269
4270 /// Sets the value of [username][crate::model::MysqlProfile::username].
4271 ///
4272 /// # Example
4273 /// ```ignore,no_run
4274 /// # use google_cloud_datastream_v1::model::MysqlProfile;
4275 /// let x = MysqlProfile::new().set_username("example");
4276 /// ```
4277 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4278 self.username = v.into();
4279 self
4280 }
4281
4282 /// Sets the value of [password][crate::model::MysqlProfile::password].
4283 ///
4284 /// # Example
4285 /// ```ignore,no_run
4286 /// # use google_cloud_datastream_v1::model::MysqlProfile;
4287 /// let x = MysqlProfile::new().set_password("example");
4288 /// ```
4289 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4290 self.password = v.into();
4291 self
4292 }
4293
4294 /// Sets the value of [ssl_config][crate::model::MysqlProfile::ssl_config].
4295 ///
4296 /// # Example
4297 /// ```ignore,no_run
4298 /// # use google_cloud_datastream_v1::model::MysqlProfile;
4299 /// use google_cloud_datastream_v1::model::MysqlSslConfig;
4300 /// let x = MysqlProfile::new().set_ssl_config(MysqlSslConfig::default()/* use setters */);
4301 /// ```
4302 pub fn set_ssl_config<T>(mut self, v: T) -> Self
4303 where
4304 T: std::convert::Into<crate::model::MysqlSslConfig>,
4305 {
4306 self.ssl_config = std::option::Option::Some(v.into());
4307 self
4308 }
4309
4310 /// Sets or clears the value of [ssl_config][crate::model::MysqlProfile::ssl_config].
4311 ///
4312 /// # Example
4313 /// ```ignore,no_run
4314 /// # use google_cloud_datastream_v1::model::MysqlProfile;
4315 /// use google_cloud_datastream_v1::model::MysqlSslConfig;
4316 /// let x = MysqlProfile::new().set_or_clear_ssl_config(Some(MysqlSslConfig::default()/* use setters */));
4317 /// let x = MysqlProfile::new().set_or_clear_ssl_config(None::<MysqlSslConfig>);
4318 /// ```
4319 pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
4320 where
4321 T: std::convert::Into<crate::model::MysqlSslConfig>,
4322 {
4323 self.ssl_config = v.map(|x| x.into());
4324 self
4325 }
4326
4327 /// Sets the value of [secret_manager_stored_password][crate::model::MysqlProfile::secret_manager_stored_password].
4328 ///
4329 /// # Example
4330 /// ```ignore,no_run
4331 /// # use google_cloud_datastream_v1::model::MysqlProfile;
4332 /// let x = MysqlProfile::new().set_secret_manager_stored_password("example");
4333 /// ```
4334 pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4335 mut self,
4336 v: T,
4337 ) -> Self {
4338 self.secret_manager_stored_password = v.into();
4339 self
4340 }
4341}
4342
4343impl wkt::message::Message for MysqlProfile {
4344 fn typename() -> &'static str {
4345 "type.googleapis.com/google.cloud.datastream.v1.MysqlProfile"
4346 }
4347}
4348
4349/// PostgreSQL database profile.
4350#[derive(Clone, Default, PartialEq)]
4351#[non_exhaustive]
4352pub struct PostgresqlProfile {
4353 /// Required. Hostname for the PostgreSQL connection.
4354 pub hostname: std::string::String,
4355
4356 /// Port for the PostgreSQL connection, default value is 5432.
4357 pub port: i32,
4358
4359 /// Required. Username for the PostgreSQL connection.
4360 pub username: std::string::String,
4361
4362 /// Optional. Password for the PostgreSQL connection. Mutually exclusive with
4363 /// the `secret_manager_stored_password` field.
4364 pub password: std::string::String,
4365
4366 /// Required. Database for the PostgreSQL connection.
4367 pub database: std::string::String,
4368
4369 /// Optional. A reference to a Secret Manager resource name storing the
4370 /// PostgreSQL connection password. Mutually exclusive with the `password`
4371 /// field.
4372 pub secret_manager_stored_password: std::string::String,
4373
4374 /// Optional. SSL configuration for the PostgreSQL connection.
4375 /// In case PostgresqlSslConfig is not set, the connection will use the default
4376 /// SSL mode, which is `prefer` (i.e. this mode will only use encryption if
4377 /// enabled from database side, otherwise will use unencrypted communication)
4378 pub ssl_config: std::option::Option<crate::model::PostgresqlSslConfig>,
4379
4380 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4381}
4382
4383impl PostgresqlProfile {
4384 pub fn new() -> Self {
4385 std::default::Default::default()
4386 }
4387
4388 /// Sets the value of [hostname][crate::model::PostgresqlProfile::hostname].
4389 ///
4390 /// # Example
4391 /// ```ignore,no_run
4392 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4393 /// let x = PostgresqlProfile::new().set_hostname("example");
4394 /// ```
4395 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4396 self.hostname = v.into();
4397 self
4398 }
4399
4400 /// Sets the value of [port][crate::model::PostgresqlProfile::port].
4401 ///
4402 /// # Example
4403 /// ```ignore,no_run
4404 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4405 /// let x = PostgresqlProfile::new().set_port(42);
4406 /// ```
4407 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4408 self.port = v.into();
4409 self
4410 }
4411
4412 /// Sets the value of [username][crate::model::PostgresqlProfile::username].
4413 ///
4414 /// # Example
4415 /// ```ignore,no_run
4416 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4417 /// let x = PostgresqlProfile::new().set_username("example");
4418 /// ```
4419 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4420 self.username = v.into();
4421 self
4422 }
4423
4424 /// Sets the value of [password][crate::model::PostgresqlProfile::password].
4425 ///
4426 /// # Example
4427 /// ```ignore,no_run
4428 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4429 /// let x = PostgresqlProfile::new().set_password("example");
4430 /// ```
4431 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4432 self.password = v.into();
4433 self
4434 }
4435
4436 /// Sets the value of [database][crate::model::PostgresqlProfile::database].
4437 ///
4438 /// # Example
4439 /// ```ignore,no_run
4440 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4441 /// let x = PostgresqlProfile::new().set_database("example");
4442 /// ```
4443 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4444 self.database = v.into();
4445 self
4446 }
4447
4448 /// Sets the value of [secret_manager_stored_password][crate::model::PostgresqlProfile::secret_manager_stored_password].
4449 ///
4450 /// # Example
4451 /// ```ignore,no_run
4452 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4453 /// let x = PostgresqlProfile::new().set_secret_manager_stored_password("example");
4454 /// ```
4455 pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4456 mut self,
4457 v: T,
4458 ) -> Self {
4459 self.secret_manager_stored_password = v.into();
4460 self
4461 }
4462
4463 /// Sets the value of [ssl_config][crate::model::PostgresqlProfile::ssl_config].
4464 ///
4465 /// # Example
4466 /// ```ignore,no_run
4467 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4468 /// use google_cloud_datastream_v1::model::PostgresqlSslConfig;
4469 /// let x = PostgresqlProfile::new().set_ssl_config(PostgresqlSslConfig::default()/* use setters */);
4470 /// ```
4471 pub fn set_ssl_config<T>(mut self, v: T) -> Self
4472 where
4473 T: std::convert::Into<crate::model::PostgresqlSslConfig>,
4474 {
4475 self.ssl_config = std::option::Option::Some(v.into());
4476 self
4477 }
4478
4479 /// Sets or clears the value of [ssl_config][crate::model::PostgresqlProfile::ssl_config].
4480 ///
4481 /// # Example
4482 /// ```ignore,no_run
4483 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4484 /// use google_cloud_datastream_v1::model::PostgresqlSslConfig;
4485 /// let x = PostgresqlProfile::new().set_or_clear_ssl_config(Some(PostgresqlSslConfig::default()/* use setters */));
4486 /// let x = PostgresqlProfile::new().set_or_clear_ssl_config(None::<PostgresqlSslConfig>);
4487 /// ```
4488 pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
4489 where
4490 T: std::convert::Into<crate::model::PostgresqlSslConfig>,
4491 {
4492 self.ssl_config = v.map(|x| x.into());
4493 self
4494 }
4495}
4496
4497impl wkt::message::Message for PostgresqlProfile {
4498 fn typename() -> &'static str {
4499 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlProfile"
4500 }
4501}
4502
4503/// SQLServer database profile.
4504#[derive(Clone, Default, PartialEq)]
4505#[non_exhaustive]
4506pub struct SqlServerProfile {
4507 /// Required. Hostname for the SQLServer connection.
4508 pub hostname: std::string::String,
4509
4510 /// Port for the SQLServer connection, default value is 1433.
4511 pub port: i32,
4512
4513 /// Required. Username for the SQLServer connection.
4514 pub username: std::string::String,
4515
4516 /// Optional. Password for the SQLServer connection. Mutually exclusive with
4517 /// the `secret_manager_stored_password` field.
4518 pub password: std::string::String,
4519
4520 /// Required. Database for the SQLServer connection.
4521 pub database: std::string::String,
4522
4523 /// Optional. A reference to a Secret Manager resource name storing the
4524 /// SQLServer connection password. Mutually exclusive with the `password`
4525 /// field.
4526 pub secret_manager_stored_password: std::string::String,
4527
4528 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4529}
4530
4531impl SqlServerProfile {
4532 pub fn new() -> Self {
4533 std::default::Default::default()
4534 }
4535
4536 /// Sets the value of [hostname][crate::model::SqlServerProfile::hostname].
4537 ///
4538 /// # Example
4539 /// ```ignore,no_run
4540 /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4541 /// let x = SqlServerProfile::new().set_hostname("example");
4542 /// ```
4543 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4544 self.hostname = v.into();
4545 self
4546 }
4547
4548 /// Sets the value of [port][crate::model::SqlServerProfile::port].
4549 ///
4550 /// # Example
4551 /// ```ignore,no_run
4552 /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4553 /// let x = SqlServerProfile::new().set_port(42);
4554 /// ```
4555 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4556 self.port = v.into();
4557 self
4558 }
4559
4560 /// Sets the value of [username][crate::model::SqlServerProfile::username].
4561 ///
4562 /// # Example
4563 /// ```ignore,no_run
4564 /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4565 /// let x = SqlServerProfile::new().set_username("example");
4566 /// ```
4567 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4568 self.username = v.into();
4569 self
4570 }
4571
4572 /// Sets the value of [password][crate::model::SqlServerProfile::password].
4573 ///
4574 /// # Example
4575 /// ```ignore,no_run
4576 /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4577 /// let x = SqlServerProfile::new().set_password("example");
4578 /// ```
4579 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4580 self.password = v.into();
4581 self
4582 }
4583
4584 /// Sets the value of [database][crate::model::SqlServerProfile::database].
4585 ///
4586 /// # Example
4587 /// ```ignore,no_run
4588 /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4589 /// let x = SqlServerProfile::new().set_database("example");
4590 /// ```
4591 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4592 self.database = v.into();
4593 self
4594 }
4595
4596 /// Sets the value of [secret_manager_stored_password][crate::model::SqlServerProfile::secret_manager_stored_password].
4597 ///
4598 /// # Example
4599 /// ```ignore,no_run
4600 /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4601 /// let x = SqlServerProfile::new().set_secret_manager_stored_password("example");
4602 /// ```
4603 pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4604 mut self,
4605 v: T,
4606 ) -> Self {
4607 self.secret_manager_stored_password = v.into();
4608 self
4609 }
4610}
4611
4612impl wkt::message::Message for SqlServerProfile {
4613 fn typename() -> &'static str {
4614 "type.googleapis.com/google.cloud.datastream.v1.SqlServerProfile"
4615 }
4616}
4617
4618/// Salesforce profile
4619#[derive(Clone, Default, PartialEq)]
4620#[non_exhaustive]
4621pub struct SalesforceProfile {
4622 /// Required. Domain endpoint for the Salesforce connection.
4623 pub domain: std::string::String,
4624
4625 /// Credentials for Salesforce connection.
4626 pub credentials: std::option::Option<crate::model::salesforce_profile::Credentials>,
4627
4628 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4629}
4630
4631impl SalesforceProfile {
4632 pub fn new() -> Self {
4633 std::default::Default::default()
4634 }
4635
4636 /// Sets the value of [domain][crate::model::SalesforceProfile::domain].
4637 ///
4638 /// # Example
4639 /// ```ignore,no_run
4640 /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4641 /// let x = SalesforceProfile::new().set_domain("example");
4642 /// ```
4643 pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4644 self.domain = v.into();
4645 self
4646 }
4647
4648 /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials].
4649 ///
4650 /// Note that all the setters affecting `credentials` are mutually
4651 /// exclusive.
4652 ///
4653 /// # Example
4654 /// ```ignore,no_run
4655 /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4656 /// use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4657 /// let x = SalesforceProfile::new().set_credentials(Some(
4658 /// google_cloud_datastream_v1::model::salesforce_profile::Credentials::UserCredentials(UserCredentials::default().into())));
4659 /// ```
4660 pub fn set_credentials<
4661 T: std::convert::Into<std::option::Option<crate::model::salesforce_profile::Credentials>>,
4662 >(
4663 mut self,
4664 v: T,
4665 ) -> Self {
4666 self.credentials = v.into();
4667 self
4668 }
4669
4670 /// The value of [credentials][crate::model::SalesforceProfile::credentials]
4671 /// if it holds a `UserCredentials`, `None` if the field is not set or
4672 /// holds a different branch.
4673 pub fn user_credentials(
4674 &self,
4675 ) -> std::option::Option<&std::boxed::Box<crate::model::salesforce_profile::UserCredentials>>
4676 {
4677 #[allow(unreachable_patterns)]
4678 self.credentials.as_ref().and_then(|v| match v {
4679 crate::model::salesforce_profile::Credentials::UserCredentials(v) => {
4680 std::option::Option::Some(v)
4681 }
4682 _ => std::option::Option::None,
4683 })
4684 }
4685
4686 /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials]
4687 /// to hold a `UserCredentials`.
4688 ///
4689 /// Note that all the setters affecting `credentials` are
4690 /// mutually exclusive.
4691 ///
4692 /// # Example
4693 /// ```ignore,no_run
4694 /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4695 /// use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4696 /// let x = SalesforceProfile::new().set_user_credentials(UserCredentials::default()/* use setters */);
4697 /// assert!(x.user_credentials().is_some());
4698 /// assert!(x.oauth2_client_credentials().is_none());
4699 /// ```
4700 pub fn set_user_credentials<
4701 T: std::convert::Into<std::boxed::Box<crate::model::salesforce_profile::UserCredentials>>,
4702 >(
4703 mut self,
4704 v: T,
4705 ) -> Self {
4706 self.credentials = std::option::Option::Some(
4707 crate::model::salesforce_profile::Credentials::UserCredentials(v.into()),
4708 );
4709 self
4710 }
4711
4712 /// The value of [credentials][crate::model::SalesforceProfile::credentials]
4713 /// if it holds a `Oauth2ClientCredentials`, `None` if the field is not set or
4714 /// holds a different branch.
4715 pub fn oauth2_client_credentials(
4716 &self,
4717 ) -> std::option::Option<
4718 &std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
4719 > {
4720 #[allow(unreachable_patterns)]
4721 self.credentials.as_ref().and_then(|v| match v {
4722 crate::model::salesforce_profile::Credentials::Oauth2ClientCredentials(v) => {
4723 std::option::Option::Some(v)
4724 }
4725 _ => std::option::Option::None,
4726 })
4727 }
4728
4729 /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials]
4730 /// to hold a `Oauth2ClientCredentials`.
4731 ///
4732 /// Note that all the setters affecting `credentials` are
4733 /// mutually exclusive.
4734 ///
4735 /// # Example
4736 /// ```ignore,no_run
4737 /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4738 /// use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
4739 /// let x = SalesforceProfile::new().set_oauth2_client_credentials(Oauth2ClientCredentials::default()/* use setters */);
4740 /// assert!(x.oauth2_client_credentials().is_some());
4741 /// assert!(x.user_credentials().is_none());
4742 /// ```
4743 pub fn set_oauth2_client_credentials<
4744 T: std::convert::Into<
4745 std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
4746 >,
4747 >(
4748 mut self,
4749 v: T,
4750 ) -> Self {
4751 self.credentials = std::option::Option::Some(
4752 crate::model::salesforce_profile::Credentials::Oauth2ClientCredentials(v.into()),
4753 );
4754 self
4755 }
4756}
4757
4758impl wkt::message::Message for SalesforceProfile {
4759 fn typename() -> &'static str {
4760 "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile"
4761 }
4762}
4763
4764/// Defines additional types related to [SalesforceProfile].
4765pub mod salesforce_profile {
4766 #[allow(unused_imports)]
4767 use super::*;
4768
4769 /// Username-password credentials.
4770 #[derive(Clone, Default, PartialEq)]
4771 #[non_exhaustive]
4772 pub struct UserCredentials {
4773 /// Required. Username for the Salesforce connection.
4774 pub username: std::string::String,
4775
4776 /// Optional. Password for the Salesforce connection.
4777 /// Mutually exclusive with the `secret_manager_stored_password` field.
4778 pub password: std::string::String,
4779
4780 /// Optional. Security token for the Salesforce connection.
4781 /// Mutually exclusive with the `secret_manager_stored_security_token` field.
4782 pub security_token: std::string::String,
4783
4784 /// Optional. A reference to a Secret Manager resource name storing the
4785 /// Salesforce connection's password. Mutually exclusive with the `password`
4786 /// field.
4787 pub secret_manager_stored_password: std::string::String,
4788
4789 /// Optional. A reference to a Secret Manager resource name storing the
4790 /// Salesforce connection's security token. Mutually exclusive with the
4791 /// `security_token` field.
4792 pub secret_manager_stored_security_token: std::string::String,
4793
4794 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4795 }
4796
4797 impl UserCredentials {
4798 pub fn new() -> Self {
4799 std::default::Default::default()
4800 }
4801
4802 /// Sets the value of [username][crate::model::salesforce_profile::UserCredentials::username].
4803 ///
4804 /// # Example
4805 /// ```ignore,no_run
4806 /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4807 /// let x = UserCredentials::new().set_username("example");
4808 /// ```
4809 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4810 self.username = v.into();
4811 self
4812 }
4813
4814 /// Sets the value of [password][crate::model::salesforce_profile::UserCredentials::password].
4815 ///
4816 /// # Example
4817 /// ```ignore,no_run
4818 /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4819 /// let x = UserCredentials::new().set_password("example");
4820 /// ```
4821 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4822 self.password = v.into();
4823 self
4824 }
4825
4826 /// Sets the value of [security_token][crate::model::salesforce_profile::UserCredentials::security_token].
4827 ///
4828 /// # Example
4829 /// ```ignore,no_run
4830 /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4831 /// let x = UserCredentials::new().set_security_token("example");
4832 /// ```
4833 pub fn set_security_token<T: std::convert::Into<std::string::String>>(
4834 mut self,
4835 v: T,
4836 ) -> Self {
4837 self.security_token = v.into();
4838 self
4839 }
4840
4841 /// Sets the value of [secret_manager_stored_password][crate::model::salesforce_profile::UserCredentials::secret_manager_stored_password].
4842 ///
4843 /// # Example
4844 /// ```ignore,no_run
4845 /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4846 /// let x = UserCredentials::new().set_secret_manager_stored_password("example");
4847 /// ```
4848 pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4849 mut self,
4850 v: T,
4851 ) -> Self {
4852 self.secret_manager_stored_password = v.into();
4853 self
4854 }
4855
4856 /// Sets the value of [secret_manager_stored_security_token][crate::model::salesforce_profile::UserCredentials::secret_manager_stored_security_token].
4857 ///
4858 /// # Example
4859 /// ```ignore,no_run
4860 /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4861 /// let x = UserCredentials::new().set_secret_manager_stored_security_token("example");
4862 /// ```
4863 pub fn set_secret_manager_stored_security_token<
4864 T: std::convert::Into<std::string::String>,
4865 >(
4866 mut self,
4867 v: T,
4868 ) -> Self {
4869 self.secret_manager_stored_security_token = v.into();
4870 self
4871 }
4872 }
4873
4874 impl wkt::message::Message for UserCredentials {
4875 fn typename() -> &'static str {
4876 "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile.UserCredentials"
4877 }
4878 }
4879
4880 /// OAuth2 Client Credentials.
4881 #[derive(Clone, Default, PartialEq)]
4882 #[non_exhaustive]
4883 pub struct Oauth2ClientCredentials {
4884 /// Required. Client ID for Salesforce OAuth2 Client Credentials.
4885 pub client_id: std::string::String,
4886
4887 /// Optional. Client secret for Salesforce OAuth2 Client Credentials.
4888 /// Mutually exclusive with the `secret_manager_stored_client_secret` field.
4889 pub client_secret: std::string::String,
4890
4891 /// Optional. A reference to a Secret Manager resource name storing the
4892 /// Salesforce OAuth2 client_secret. Mutually exclusive with the
4893 /// `client_secret` field.
4894 pub secret_manager_stored_client_secret: std::string::String,
4895
4896 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4897 }
4898
4899 impl Oauth2ClientCredentials {
4900 pub fn new() -> Self {
4901 std::default::Default::default()
4902 }
4903
4904 /// Sets the value of [client_id][crate::model::salesforce_profile::Oauth2ClientCredentials::client_id].
4905 ///
4906 /// # Example
4907 /// ```ignore,no_run
4908 /// # use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
4909 /// let x = Oauth2ClientCredentials::new().set_client_id("example");
4910 /// ```
4911 pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4912 self.client_id = v.into();
4913 self
4914 }
4915
4916 /// Sets the value of [client_secret][crate::model::salesforce_profile::Oauth2ClientCredentials::client_secret].
4917 ///
4918 /// # Example
4919 /// ```ignore,no_run
4920 /// # use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
4921 /// let x = Oauth2ClientCredentials::new().set_client_secret("example");
4922 /// ```
4923 pub fn set_client_secret<T: std::convert::Into<std::string::String>>(
4924 mut self,
4925 v: T,
4926 ) -> Self {
4927 self.client_secret = v.into();
4928 self
4929 }
4930
4931 /// Sets the value of [secret_manager_stored_client_secret][crate::model::salesforce_profile::Oauth2ClientCredentials::secret_manager_stored_client_secret].
4932 ///
4933 /// # Example
4934 /// ```ignore,no_run
4935 /// # use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
4936 /// let x = Oauth2ClientCredentials::new().set_secret_manager_stored_client_secret("example");
4937 /// ```
4938 pub fn set_secret_manager_stored_client_secret<
4939 T: std::convert::Into<std::string::String>,
4940 >(
4941 mut self,
4942 v: T,
4943 ) -> Self {
4944 self.secret_manager_stored_client_secret = v.into();
4945 self
4946 }
4947 }
4948
4949 impl wkt::message::Message for Oauth2ClientCredentials {
4950 fn typename() -> &'static str {
4951 "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile.Oauth2ClientCredentials"
4952 }
4953 }
4954
4955 /// Credentials for Salesforce connection.
4956 #[derive(Clone, Debug, PartialEq)]
4957 #[non_exhaustive]
4958 pub enum Credentials {
4959 /// User-password authentication.
4960 UserCredentials(std::boxed::Box<crate::model::salesforce_profile::UserCredentials>),
4961 /// Connected app authentication.
4962 Oauth2ClientCredentials(
4963 std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
4964 ),
4965 }
4966}
4967
4968/// MongoDB profile.
4969#[derive(Clone, Default, PartialEq)]
4970#[non_exhaustive]
4971pub struct MongodbProfile {
4972 /// Required. List of host addresses for a MongoDB cluster.
4973 /// For SRV connection format, this list must contain exactly one DNS host
4974 /// without a port. For Standard connection format, this list must contain all
4975 /// the required hosts in the cluster with their respective ports.
4976 pub host_addresses: std::vec::Vec<crate::model::HostAddress>,
4977
4978 /// Optional. Name of the replica set. Only needed for self hosted replica set
4979 /// type MongoDB cluster. For SRV connection format, this field must be empty.
4980 /// For Standard connection format, this field must be specified.
4981 pub replica_set: std::string::String,
4982
4983 /// Required. Username for the MongoDB connection.
4984 pub username: std::string::String,
4985
4986 /// Optional. Password for the MongoDB connection. Mutually exclusive with the
4987 /// `secret_manager_stored_password` field.
4988 pub password: std::string::String,
4989
4990 /// Optional. A reference to a Secret Manager resource name storing the
4991 /// SQLServer connection password. Mutually exclusive with the `password`
4992 /// field.
4993 pub secret_manager_stored_password: std::string::String,
4994
4995 /// Optional. SSL configuration for the MongoDB connection.
4996 pub ssl_config: std::option::Option<crate::model::MongodbSslConfig>,
4997
4998 /// MongoDB connection format.
4999 /// Must specify either srv_connection_format or standard_connection_format.
5000 pub mongodb_connection_format:
5001 std::option::Option<crate::model::mongodb_profile::MongodbConnectionFormat>,
5002
5003 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5004}
5005
5006impl MongodbProfile {
5007 pub fn new() -> Self {
5008 std::default::Default::default()
5009 }
5010
5011 /// Sets the value of [host_addresses][crate::model::MongodbProfile::host_addresses].
5012 ///
5013 /// # Example
5014 /// ```ignore,no_run
5015 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5016 /// use google_cloud_datastream_v1::model::HostAddress;
5017 /// let x = MongodbProfile::new()
5018 /// .set_host_addresses([
5019 /// HostAddress::default()/* use setters */,
5020 /// HostAddress::default()/* use (different) setters */,
5021 /// ]);
5022 /// ```
5023 pub fn set_host_addresses<T, V>(mut self, v: T) -> Self
5024 where
5025 T: std::iter::IntoIterator<Item = V>,
5026 V: std::convert::Into<crate::model::HostAddress>,
5027 {
5028 use std::iter::Iterator;
5029 self.host_addresses = v.into_iter().map(|i| i.into()).collect();
5030 self
5031 }
5032
5033 /// Sets the value of [replica_set][crate::model::MongodbProfile::replica_set].
5034 ///
5035 /// # Example
5036 /// ```ignore,no_run
5037 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5038 /// let x = MongodbProfile::new().set_replica_set("example");
5039 /// ```
5040 pub fn set_replica_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5041 self.replica_set = v.into();
5042 self
5043 }
5044
5045 /// Sets the value of [username][crate::model::MongodbProfile::username].
5046 ///
5047 /// # Example
5048 /// ```ignore,no_run
5049 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5050 /// let x = MongodbProfile::new().set_username("example");
5051 /// ```
5052 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5053 self.username = v.into();
5054 self
5055 }
5056
5057 /// Sets the value of [password][crate::model::MongodbProfile::password].
5058 ///
5059 /// # Example
5060 /// ```ignore,no_run
5061 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5062 /// let x = MongodbProfile::new().set_password("example");
5063 /// ```
5064 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5065 self.password = v.into();
5066 self
5067 }
5068
5069 /// Sets the value of [secret_manager_stored_password][crate::model::MongodbProfile::secret_manager_stored_password].
5070 ///
5071 /// # Example
5072 /// ```ignore,no_run
5073 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5074 /// let x = MongodbProfile::new().set_secret_manager_stored_password("example");
5075 /// ```
5076 pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
5077 mut self,
5078 v: T,
5079 ) -> Self {
5080 self.secret_manager_stored_password = v.into();
5081 self
5082 }
5083
5084 /// Sets the value of [ssl_config][crate::model::MongodbProfile::ssl_config].
5085 ///
5086 /// # Example
5087 /// ```ignore,no_run
5088 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5089 /// use google_cloud_datastream_v1::model::MongodbSslConfig;
5090 /// let x = MongodbProfile::new().set_ssl_config(MongodbSslConfig::default()/* use setters */);
5091 /// ```
5092 pub fn set_ssl_config<T>(mut self, v: T) -> Self
5093 where
5094 T: std::convert::Into<crate::model::MongodbSslConfig>,
5095 {
5096 self.ssl_config = std::option::Option::Some(v.into());
5097 self
5098 }
5099
5100 /// Sets or clears the value of [ssl_config][crate::model::MongodbProfile::ssl_config].
5101 ///
5102 /// # Example
5103 /// ```ignore,no_run
5104 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5105 /// use google_cloud_datastream_v1::model::MongodbSslConfig;
5106 /// let x = MongodbProfile::new().set_or_clear_ssl_config(Some(MongodbSslConfig::default()/* use setters */));
5107 /// let x = MongodbProfile::new().set_or_clear_ssl_config(None::<MongodbSslConfig>);
5108 /// ```
5109 pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
5110 where
5111 T: std::convert::Into<crate::model::MongodbSslConfig>,
5112 {
5113 self.ssl_config = v.map(|x| x.into());
5114 self
5115 }
5116
5117 /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format].
5118 ///
5119 /// Note that all the setters affecting `mongodb_connection_format` are mutually
5120 /// exclusive.
5121 ///
5122 /// # Example
5123 /// ```ignore,no_run
5124 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5125 /// use google_cloud_datastream_v1::model::SrvConnectionFormat;
5126 /// let x = MongodbProfile::new().set_mongodb_connection_format(Some(
5127 /// google_cloud_datastream_v1::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(SrvConnectionFormat::default().into())));
5128 /// ```
5129 pub fn set_mongodb_connection_format<
5130 T: std::convert::Into<
5131 std::option::Option<crate::model::mongodb_profile::MongodbConnectionFormat>,
5132 >,
5133 >(
5134 mut self,
5135 v: T,
5136 ) -> Self {
5137 self.mongodb_connection_format = v.into();
5138 self
5139 }
5140
5141 /// The value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5142 /// if it holds a `SrvConnectionFormat`, `None` if the field is not set or
5143 /// holds a different branch.
5144 pub fn srv_connection_format(
5145 &self,
5146 ) -> std::option::Option<&std::boxed::Box<crate::model::SrvConnectionFormat>> {
5147 #[allow(unreachable_patterns)]
5148 self.mongodb_connection_format
5149 .as_ref()
5150 .and_then(|v| match v {
5151 crate::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(v) => {
5152 std::option::Option::Some(v)
5153 }
5154 _ => std::option::Option::None,
5155 })
5156 }
5157
5158 /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5159 /// to hold a `SrvConnectionFormat`.
5160 ///
5161 /// Note that all the setters affecting `mongodb_connection_format` are
5162 /// mutually exclusive.
5163 ///
5164 /// # Example
5165 /// ```ignore,no_run
5166 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5167 /// use google_cloud_datastream_v1::model::SrvConnectionFormat;
5168 /// let x = MongodbProfile::new().set_srv_connection_format(SrvConnectionFormat::default()/* use setters */);
5169 /// assert!(x.srv_connection_format().is_some());
5170 /// assert!(x.standard_connection_format().is_none());
5171 /// ```
5172 pub fn set_srv_connection_format<
5173 T: std::convert::Into<std::boxed::Box<crate::model::SrvConnectionFormat>>,
5174 >(
5175 mut self,
5176 v: T,
5177 ) -> Self {
5178 self.mongodb_connection_format = std::option::Option::Some(
5179 crate::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(v.into()),
5180 );
5181 self
5182 }
5183
5184 /// The value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5185 /// if it holds a `StandardConnectionFormat`, `None` if the field is not set or
5186 /// holds a different branch.
5187 pub fn standard_connection_format(
5188 &self,
5189 ) -> std::option::Option<&std::boxed::Box<crate::model::StandardConnectionFormat>> {
5190 #[allow(unreachable_patterns)]
5191 self.mongodb_connection_format.as_ref().and_then(|v| match v {
5192 crate::model::mongodb_profile::MongodbConnectionFormat::StandardConnectionFormat(v) => std::option::Option::Some(v),
5193 _ => std::option::Option::None,
5194 })
5195 }
5196
5197 /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5198 /// to hold a `StandardConnectionFormat`.
5199 ///
5200 /// Note that all the setters affecting `mongodb_connection_format` are
5201 /// mutually exclusive.
5202 ///
5203 /// # Example
5204 /// ```ignore,no_run
5205 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5206 /// use google_cloud_datastream_v1::model::StandardConnectionFormat;
5207 /// let x = MongodbProfile::new().set_standard_connection_format(StandardConnectionFormat::default()/* use setters */);
5208 /// assert!(x.standard_connection_format().is_some());
5209 /// assert!(x.srv_connection_format().is_none());
5210 /// ```
5211 pub fn set_standard_connection_format<
5212 T: std::convert::Into<std::boxed::Box<crate::model::StandardConnectionFormat>>,
5213 >(
5214 mut self,
5215 v: T,
5216 ) -> Self {
5217 self.mongodb_connection_format = std::option::Option::Some(
5218 crate::model::mongodb_profile::MongodbConnectionFormat::StandardConnectionFormat(
5219 v.into(),
5220 ),
5221 );
5222 self
5223 }
5224}
5225
5226impl wkt::message::Message for MongodbProfile {
5227 fn typename() -> &'static str {
5228 "type.googleapis.com/google.cloud.datastream.v1.MongodbProfile"
5229 }
5230}
5231
5232/// Defines additional types related to [MongodbProfile].
5233pub mod mongodb_profile {
5234 #[allow(unused_imports)]
5235 use super::*;
5236
5237 /// MongoDB connection format.
5238 /// Must specify either srv_connection_format or standard_connection_format.
5239 #[derive(Clone, Debug, PartialEq)]
5240 #[non_exhaustive]
5241 pub enum MongodbConnectionFormat {
5242 /// Srv connection format.
5243 SrvConnectionFormat(std::boxed::Box<crate::model::SrvConnectionFormat>),
5244 /// Standard connection format.
5245 StandardConnectionFormat(std::boxed::Box<crate::model::StandardConnectionFormat>),
5246 }
5247}
5248
5249/// A HostAddress represents a transport end point, which is the combination
5250/// of an IP address or hostname and a port number.
5251#[derive(Clone, Default, PartialEq)]
5252#[non_exhaustive]
5253pub struct HostAddress {
5254 /// Required. Hostname for the connection.
5255 pub hostname: std::string::String,
5256
5257 /// Optional. Port for the connection.
5258 pub port: i32,
5259
5260 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5261}
5262
5263impl HostAddress {
5264 pub fn new() -> Self {
5265 std::default::Default::default()
5266 }
5267
5268 /// Sets the value of [hostname][crate::model::HostAddress::hostname].
5269 ///
5270 /// # Example
5271 /// ```ignore,no_run
5272 /// # use google_cloud_datastream_v1::model::HostAddress;
5273 /// let x = HostAddress::new().set_hostname("example");
5274 /// ```
5275 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5276 self.hostname = v.into();
5277 self
5278 }
5279
5280 /// Sets the value of [port][crate::model::HostAddress::port].
5281 ///
5282 /// # Example
5283 /// ```ignore,no_run
5284 /// # use google_cloud_datastream_v1::model::HostAddress;
5285 /// let x = HostAddress::new().set_port(42);
5286 /// ```
5287 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5288 self.port = v.into();
5289 self
5290 }
5291}
5292
5293impl wkt::message::Message for HostAddress {
5294 fn typename() -> &'static str {
5295 "type.googleapis.com/google.cloud.datastream.v1.HostAddress"
5296 }
5297}
5298
5299/// Srv connection format.
5300#[derive(Clone, Default, PartialEq)]
5301#[non_exhaustive]
5302pub struct SrvConnectionFormat {
5303 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5304}
5305
5306impl SrvConnectionFormat {
5307 pub fn new() -> Self {
5308 std::default::Default::default()
5309 }
5310}
5311
5312impl wkt::message::Message for SrvConnectionFormat {
5313 fn typename() -> &'static str {
5314 "type.googleapis.com/google.cloud.datastream.v1.SrvConnectionFormat"
5315 }
5316}
5317
5318/// Standard connection format.
5319#[derive(Clone, Default, PartialEq)]
5320#[non_exhaustive]
5321pub struct StandardConnectionFormat {
5322 /// Optional. Specifies whether the client connects directly to the host[:port]
5323 /// in the connection URI.
5324 pub direct_connection: bool,
5325
5326 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5327}
5328
5329impl StandardConnectionFormat {
5330 pub fn new() -> Self {
5331 std::default::Default::default()
5332 }
5333
5334 /// Sets the value of [direct_connection][crate::model::StandardConnectionFormat::direct_connection].
5335 ///
5336 /// # Example
5337 /// ```ignore,no_run
5338 /// # use google_cloud_datastream_v1::model::StandardConnectionFormat;
5339 /// let x = StandardConnectionFormat::new().set_direct_connection(true);
5340 /// ```
5341 pub fn set_direct_connection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5342 self.direct_connection = v.into();
5343 self
5344 }
5345}
5346
5347impl wkt::message::Message for StandardConnectionFormat {
5348 fn typename() -> &'static str {
5349 "type.googleapis.com/google.cloud.datastream.v1.StandardConnectionFormat"
5350 }
5351}
5352
5353/// Cloud Storage bucket profile.
5354#[derive(Clone, Default, PartialEq)]
5355#[non_exhaustive]
5356pub struct GcsProfile {
5357 /// Required. The Cloud Storage bucket name.
5358 pub bucket: std::string::String,
5359
5360 /// The root path inside the Cloud Storage bucket.
5361 pub root_path: std::string::String,
5362
5363 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5364}
5365
5366impl GcsProfile {
5367 pub fn new() -> Self {
5368 std::default::Default::default()
5369 }
5370
5371 /// Sets the value of [bucket][crate::model::GcsProfile::bucket].
5372 ///
5373 /// # Example
5374 /// ```ignore,no_run
5375 /// # use google_cloud_datastream_v1::model::GcsProfile;
5376 /// let x = GcsProfile::new().set_bucket("example");
5377 /// ```
5378 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5379 self.bucket = v.into();
5380 self
5381 }
5382
5383 /// Sets the value of [root_path][crate::model::GcsProfile::root_path].
5384 ///
5385 /// # Example
5386 /// ```ignore,no_run
5387 /// # use google_cloud_datastream_v1::model::GcsProfile;
5388 /// let x = GcsProfile::new().set_root_path("example");
5389 /// ```
5390 pub fn set_root_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5391 self.root_path = v.into();
5392 self
5393 }
5394}
5395
5396impl wkt::message::Message for GcsProfile {
5397 fn typename() -> &'static str {
5398 "type.googleapis.com/google.cloud.datastream.v1.GcsProfile"
5399 }
5400}
5401
5402/// BigQuery warehouse profile.
5403#[derive(Clone, Default, PartialEq)]
5404#[non_exhaustive]
5405pub struct BigQueryProfile {
5406 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5407}
5408
5409impl BigQueryProfile {
5410 pub fn new() -> Self {
5411 std::default::Default::default()
5412 }
5413}
5414
5415impl wkt::message::Message for BigQueryProfile {
5416 fn typename() -> &'static str {
5417 "type.googleapis.com/google.cloud.datastream.v1.BigQueryProfile"
5418 }
5419}
5420
5421/// Static IP address connectivity. Used when the source database is configured
5422/// to allow incoming connections from the Datastream public IP addresses
5423/// for the region specified in the connection profile.
5424#[derive(Clone, Default, PartialEq)]
5425#[non_exhaustive]
5426pub struct StaticServiceIpConnectivity {
5427 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5428}
5429
5430impl StaticServiceIpConnectivity {
5431 pub fn new() -> Self {
5432 std::default::Default::default()
5433 }
5434}
5435
5436impl wkt::message::Message for StaticServiceIpConnectivity {
5437 fn typename() -> &'static str {
5438 "type.googleapis.com/google.cloud.datastream.v1.StaticServiceIpConnectivity"
5439 }
5440}
5441
5442/// Forward SSH Tunnel connectivity.
5443#[derive(Clone, Default, PartialEq)]
5444#[non_exhaustive]
5445pub struct ForwardSshTunnelConnectivity {
5446 /// Required. Hostname for the SSH tunnel.
5447 pub hostname: std::string::String,
5448
5449 /// Required. Username for the SSH tunnel.
5450 pub username: std::string::String,
5451
5452 /// Port for the SSH tunnel, default value is 22.
5453 pub port: i32,
5454
5455 pub authentication_method:
5456 std::option::Option<crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod>,
5457
5458 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5459}
5460
5461impl ForwardSshTunnelConnectivity {
5462 pub fn new() -> Self {
5463 std::default::Default::default()
5464 }
5465
5466 /// Sets the value of [hostname][crate::model::ForwardSshTunnelConnectivity::hostname].
5467 ///
5468 /// # Example
5469 /// ```ignore,no_run
5470 /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5471 /// let x = ForwardSshTunnelConnectivity::new().set_hostname("example");
5472 /// ```
5473 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5474 self.hostname = v.into();
5475 self
5476 }
5477
5478 /// Sets the value of [username][crate::model::ForwardSshTunnelConnectivity::username].
5479 ///
5480 /// # Example
5481 /// ```ignore,no_run
5482 /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5483 /// let x = ForwardSshTunnelConnectivity::new().set_username("example");
5484 /// ```
5485 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5486 self.username = v.into();
5487 self
5488 }
5489
5490 /// Sets the value of [port][crate::model::ForwardSshTunnelConnectivity::port].
5491 ///
5492 /// # Example
5493 /// ```ignore,no_run
5494 /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5495 /// let x = ForwardSshTunnelConnectivity::new().set_port(42);
5496 /// ```
5497 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5498 self.port = v.into();
5499 self
5500 }
5501
5502 /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method].
5503 ///
5504 /// Note that all the setters affecting `authentication_method` are mutually
5505 /// exclusive.
5506 ///
5507 /// # Example
5508 /// ```ignore,no_run
5509 /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5510 /// use google_cloud_datastream_v1::model::forward_ssh_tunnel_connectivity::AuthenticationMethod;
5511 /// let x = ForwardSshTunnelConnectivity::new().set_authentication_method(Some(AuthenticationMethod::Password("example".to_string())));
5512 /// ```
5513 pub fn set_authentication_method<
5514 T: std::convert::Into<
5515 std::option::Option<
5516 crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod,
5517 >,
5518 >,
5519 >(
5520 mut self,
5521 v: T,
5522 ) -> Self {
5523 self.authentication_method = v.into();
5524 self
5525 }
5526
5527 /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5528 /// if it holds a `Password`, `None` if the field is not set or
5529 /// holds a different branch.
5530 pub fn password(&self) -> std::option::Option<&std::string::String> {
5531 #[allow(unreachable_patterns)]
5532 self.authentication_method.as_ref().and_then(|v| match v {
5533 crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v) => {
5534 std::option::Option::Some(v)
5535 }
5536 _ => std::option::Option::None,
5537 })
5538 }
5539
5540 /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5541 /// to hold a `Password`.
5542 ///
5543 /// Note that all the setters affecting `authentication_method` are
5544 /// mutually exclusive.
5545 ///
5546 /// # Example
5547 /// ```ignore,no_run
5548 /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5549 /// let x = ForwardSshTunnelConnectivity::new().set_password("example");
5550 /// assert!(x.password().is_some());
5551 /// assert!(x.private_key().is_none());
5552 /// ```
5553 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5554 self.authentication_method = std::option::Option::Some(
5555 crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v.into()),
5556 );
5557 self
5558 }
5559
5560 /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5561 /// if it holds a `PrivateKey`, `None` if the field is not set or
5562 /// holds a different branch.
5563 pub fn private_key(&self) -> std::option::Option<&std::string::String> {
5564 #[allow(unreachable_patterns)]
5565 self.authentication_method.as_ref().and_then(|v| match v {
5566 crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(v) => {
5567 std::option::Option::Some(v)
5568 }
5569 _ => std::option::Option::None,
5570 })
5571 }
5572
5573 /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5574 /// to hold a `PrivateKey`.
5575 ///
5576 /// Note that all the setters affecting `authentication_method` are
5577 /// mutually exclusive.
5578 ///
5579 /// # Example
5580 /// ```ignore,no_run
5581 /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5582 /// let x = ForwardSshTunnelConnectivity::new().set_private_key("example");
5583 /// assert!(x.private_key().is_some());
5584 /// assert!(x.password().is_none());
5585 /// ```
5586 pub fn set_private_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5587 self.authentication_method = std::option::Option::Some(
5588 crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(
5589 v.into(),
5590 ),
5591 );
5592 self
5593 }
5594}
5595
5596impl wkt::message::Message for ForwardSshTunnelConnectivity {
5597 fn typename() -> &'static str {
5598 "type.googleapis.com/google.cloud.datastream.v1.ForwardSshTunnelConnectivity"
5599 }
5600}
5601
5602/// Defines additional types related to [ForwardSshTunnelConnectivity].
5603pub mod forward_ssh_tunnel_connectivity {
5604 #[allow(unused_imports)]
5605 use super::*;
5606
5607 #[derive(Clone, Debug, PartialEq)]
5608 #[non_exhaustive]
5609 pub enum AuthenticationMethod {
5610 /// Input only. SSH password.
5611 Password(std::string::String),
5612 /// Input only. SSH private key.
5613 PrivateKey(std::string::String),
5614 }
5615}
5616
5617/// The VPC Peering configuration is used to create VPC peering between
5618/// Datastream and the consumer's VPC.
5619#[derive(Clone, Default, PartialEq)]
5620#[non_exhaustive]
5621pub struct VpcPeeringConfig {
5622 /// Required. Fully qualified name of the VPC that Datastream will peer to.
5623 /// Format: `projects/{project}/global/{networks}/{name}`
5624 pub vpc: std::string::String,
5625
5626 /// Required. A free subnet for peering. (CIDR of /29)
5627 pub subnet: std::string::String,
5628
5629 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5630}
5631
5632impl VpcPeeringConfig {
5633 pub fn new() -> Self {
5634 std::default::Default::default()
5635 }
5636
5637 /// Sets the value of [vpc][crate::model::VpcPeeringConfig::vpc].
5638 ///
5639 /// # Example
5640 /// ```ignore,no_run
5641 /// # use google_cloud_datastream_v1::model::VpcPeeringConfig;
5642 /// let x = VpcPeeringConfig::new().set_vpc("example");
5643 /// ```
5644 pub fn set_vpc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5645 self.vpc = v.into();
5646 self
5647 }
5648
5649 /// Sets the value of [subnet][crate::model::VpcPeeringConfig::subnet].
5650 ///
5651 /// # Example
5652 /// ```ignore,no_run
5653 /// # use google_cloud_datastream_v1::model::VpcPeeringConfig;
5654 /// let x = VpcPeeringConfig::new().set_subnet("example");
5655 /// ```
5656 pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5657 self.subnet = v.into();
5658 self
5659 }
5660}
5661
5662impl wkt::message::Message for VpcPeeringConfig {
5663 fn typename() -> &'static str {
5664 "type.googleapis.com/google.cloud.datastream.v1.VpcPeeringConfig"
5665 }
5666}
5667
5668/// The PSC Interface configuration is used to create PSC Interface between
5669/// Datastream and the consumer's PSC.
5670#[derive(Clone, Default, PartialEq)]
5671#[non_exhaustive]
5672pub struct PscInterfaceConfig {
5673 /// Required. Fully qualified name of the Network Attachment that Datastream
5674 /// will connect to. Format:
5675 /// `projects/{project}/regions/{region}/networkAttachments/{name}`
5676 pub network_attachment: std::string::String,
5677
5678 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5679}
5680
5681impl PscInterfaceConfig {
5682 pub fn new() -> Self {
5683 std::default::Default::default()
5684 }
5685
5686 /// Sets the value of [network_attachment][crate::model::PscInterfaceConfig::network_attachment].
5687 ///
5688 /// # Example
5689 /// ```ignore,no_run
5690 /// # use google_cloud_datastream_v1::model::PscInterfaceConfig;
5691 /// let x = PscInterfaceConfig::new().set_network_attachment("example");
5692 /// ```
5693 pub fn set_network_attachment<T: std::convert::Into<std::string::String>>(
5694 mut self,
5695 v: T,
5696 ) -> Self {
5697 self.network_attachment = v.into();
5698 self
5699 }
5700}
5701
5702impl wkt::message::Message for PscInterfaceConfig {
5703 fn typename() -> &'static str {
5704 "type.googleapis.com/google.cloud.datastream.v1.PscInterfaceConfig"
5705 }
5706}
5707
5708/// The PrivateConnection resource is used to establish private connectivity
5709/// between Datastream and a customer's network.
5710#[derive(Clone, Default, PartialEq)]
5711#[non_exhaustive]
5712pub struct PrivateConnection {
5713 /// Output only. Identifier. The resource's name.
5714 pub name: std::string::String,
5715
5716 /// Output only. The create time of the resource.
5717 pub create_time: std::option::Option<wkt::Timestamp>,
5718
5719 /// Output only. The update time of the resource.
5720 pub update_time: std::option::Option<wkt::Timestamp>,
5721
5722 /// Labels.
5723 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5724
5725 /// Required. Display name.
5726 pub display_name: std::string::String,
5727
5728 /// Output only. The state of the Private Connection.
5729 pub state: crate::model::private_connection::State,
5730
5731 /// Output only. In case of error, the details of the error in a user-friendly
5732 /// format.
5733 pub error: std::option::Option<crate::model::Error>,
5734
5735 /// Output only. Reserved for future use.
5736 pub satisfies_pzs: std::option::Option<bool>,
5737
5738 /// Output only. Reserved for future use.
5739 pub satisfies_pzi: std::option::Option<bool>,
5740
5741 /// VPC Peering Config.
5742 pub vpc_peering_config: std::option::Option<crate::model::VpcPeeringConfig>,
5743
5744 /// PSC Interface Config.
5745 pub psc_interface_config: std::option::Option<crate::model::PscInterfaceConfig>,
5746
5747 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5748}
5749
5750impl PrivateConnection {
5751 pub fn new() -> Self {
5752 std::default::Default::default()
5753 }
5754
5755 /// Sets the value of [name][crate::model::PrivateConnection::name].
5756 ///
5757 /// # Example
5758 /// ```ignore,no_run
5759 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5760 /// let x = PrivateConnection::new().set_name("example");
5761 /// ```
5762 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5763 self.name = v.into();
5764 self
5765 }
5766
5767 /// Sets the value of [create_time][crate::model::PrivateConnection::create_time].
5768 ///
5769 /// # Example
5770 /// ```ignore,no_run
5771 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5772 /// use wkt::Timestamp;
5773 /// let x = PrivateConnection::new().set_create_time(Timestamp::default()/* use setters */);
5774 /// ```
5775 pub fn set_create_time<T>(mut self, v: T) -> Self
5776 where
5777 T: std::convert::Into<wkt::Timestamp>,
5778 {
5779 self.create_time = std::option::Option::Some(v.into());
5780 self
5781 }
5782
5783 /// Sets or clears the value of [create_time][crate::model::PrivateConnection::create_time].
5784 ///
5785 /// # Example
5786 /// ```ignore,no_run
5787 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5788 /// use wkt::Timestamp;
5789 /// let x = PrivateConnection::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5790 /// let x = PrivateConnection::new().set_or_clear_create_time(None::<Timestamp>);
5791 /// ```
5792 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5793 where
5794 T: std::convert::Into<wkt::Timestamp>,
5795 {
5796 self.create_time = v.map(|x| x.into());
5797 self
5798 }
5799
5800 /// Sets the value of [update_time][crate::model::PrivateConnection::update_time].
5801 ///
5802 /// # Example
5803 /// ```ignore,no_run
5804 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5805 /// use wkt::Timestamp;
5806 /// let x = PrivateConnection::new().set_update_time(Timestamp::default()/* use setters */);
5807 /// ```
5808 pub fn set_update_time<T>(mut self, v: T) -> Self
5809 where
5810 T: std::convert::Into<wkt::Timestamp>,
5811 {
5812 self.update_time = std::option::Option::Some(v.into());
5813 self
5814 }
5815
5816 /// Sets or clears the value of [update_time][crate::model::PrivateConnection::update_time].
5817 ///
5818 /// # Example
5819 /// ```ignore,no_run
5820 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5821 /// use wkt::Timestamp;
5822 /// let x = PrivateConnection::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5823 /// let x = PrivateConnection::new().set_or_clear_update_time(None::<Timestamp>);
5824 /// ```
5825 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5826 where
5827 T: std::convert::Into<wkt::Timestamp>,
5828 {
5829 self.update_time = v.map(|x| x.into());
5830 self
5831 }
5832
5833 /// Sets the value of [labels][crate::model::PrivateConnection::labels].
5834 ///
5835 /// # Example
5836 /// ```ignore,no_run
5837 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5838 /// let x = PrivateConnection::new().set_labels([
5839 /// ("key0", "abc"),
5840 /// ("key1", "xyz"),
5841 /// ]);
5842 /// ```
5843 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5844 where
5845 T: std::iter::IntoIterator<Item = (K, V)>,
5846 K: std::convert::Into<std::string::String>,
5847 V: std::convert::Into<std::string::String>,
5848 {
5849 use std::iter::Iterator;
5850 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5851 self
5852 }
5853
5854 /// Sets the value of [display_name][crate::model::PrivateConnection::display_name].
5855 ///
5856 /// # Example
5857 /// ```ignore,no_run
5858 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5859 /// let x = PrivateConnection::new().set_display_name("example");
5860 /// ```
5861 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5862 self.display_name = v.into();
5863 self
5864 }
5865
5866 /// Sets the value of [state][crate::model::PrivateConnection::state].
5867 ///
5868 /// # Example
5869 /// ```ignore,no_run
5870 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5871 /// use google_cloud_datastream_v1::model::private_connection::State;
5872 /// let x0 = PrivateConnection::new().set_state(State::Creating);
5873 /// let x1 = PrivateConnection::new().set_state(State::Created);
5874 /// let x2 = PrivateConnection::new().set_state(State::Failed);
5875 /// ```
5876 pub fn set_state<T: std::convert::Into<crate::model::private_connection::State>>(
5877 mut self,
5878 v: T,
5879 ) -> Self {
5880 self.state = v.into();
5881 self
5882 }
5883
5884 /// Sets the value of [error][crate::model::PrivateConnection::error].
5885 ///
5886 /// # Example
5887 /// ```ignore,no_run
5888 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5889 /// use google_cloud_datastream_v1::model::Error;
5890 /// let x = PrivateConnection::new().set_error(Error::default()/* use setters */);
5891 /// ```
5892 pub fn set_error<T>(mut self, v: T) -> Self
5893 where
5894 T: std::convert::Into<crate::model::Error>,
5895 {
5896 self.error = std::option::Option::Some(v.into());
5897 self
5898 }
5899
5900 /// Sets or clears the value of [error][crate::model::PrivateConnection::error].
5901 ///
5902 /// # Example
5903 /// ```ignore,no_run
5904 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5905 /// use google_cloud_datastream_v1::model::Error;
5906 /// let x = PrivateConnection::new().set_or_clear_error(Some(Error::default()/* use setters */));
5907 /// let x = PrivateConnection::new().set_or_clear_error(None::<Error>);
5908 /// ```
5909 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
5910 where
5911 T: std::convert::Into<crate::model::Error>,
5912 {
5913 self.error = v.map(|x| x.into());
5914 self
5915 }
5916
5917 /// Sets the value of [satisfies_pzs][crate::model::PrivateConnection::satisfies_pzs].
5918 ///
5919 /// # Example
5920 /// ```ignore,no_run
5921 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5922 /// let x = PrivateConnection::new().set_satisfies_pzs(true);
5923 /// ```
5924 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
5925 where
5926 T: std::convert::Into<bool>,
5927 {
5928 self.satisfies_pzs = std::option::Option::Some(v.into());
5929 self
5930 }
5931
5932 /// Sets or clears the value of [satisfies_pzs][crate::model::PrivateConnection::satisfies_pzs].
5933 ///
5934 /// # Example
5935 /// ```ignore,no_run
5936 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5937 /// let x = PrivateConnection::new().set_or_clear_satisfies_pzs(Some(false));
5938 /// let x = PrivateConnection::new().set_or_clear_satisfies_pzs(None::<bool>);
5939 /// ```
5940 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
5941 where
5942 T: std::convert::Into<bool>,
5943 {
5944 self.satisfies_pzs = v.map(|x| x.into());
5945 self
5946 }
5947
5948 /// Sets the value of [satisfies_pzi][crate::model::PrivateConnection::satisfies_pzi].
5949 ///
5950 /// # Example
5951 /// ```ignore,no_run
5952 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5953 /// let x = PrivateConnection::new().set_satisfies_pzi(true);
5954 /// ```
5955 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
5956 where
5957 T: std::convert::Into<bool>,
5958 {
5959 self.satisfies_pzi = std::option::Option::Some(v.into());
5960 self
5961 }
5962
5963 /// Sets or clears the value of [satisfies_pzi][crate::model::PrivateConnection::satisfies_pzi].
5964 ///
5965 /// # Example
5966 /// ```ignore,no_run
5967 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5968 /// let x = PrivateConnection::new().set_or_clear_satisfies_pzi(Some(false));
5969 /// let x = PrivateConnection::new().set_or_clear_satisfies_pzi(None::<bool>);
5970 /// ```
5971 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
5972 where
5973 T: std::convert::Into<bool>,
5974 {
5975 self.satisfies_pzi = v.map(|x| x.into());
5976 self
5977 }
5978
5979 /// Sets the value of [vpc_peering_config][crate::model::PrivateConnection::vpc_peering_config].
5980 ///
5981 /// # Example
5982 /// ```ignore,no_run
5983 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5984 /// use google_cloud_datastream_v1::model::VpcPeeringConfig;
5985 /// let x = PrivateConnection::new().set_vpc_peering_config(VpcPeeringConfig::default()/* use setters */);
5986 /// ```
5987 pub fn set_vpc_peering_config<T>(mut self, v: T) -> Self
5988 where
5989 T: std::convert::Into<crate::model::VpcPeeringConfig>,
5990 {
5991 self.vpc_peering_config = std::option::Option::Some(v.into());
5992 self
5993 }
5994
5995 /// Sets or clears the value of [vpc_peering_config][crate::model::PrivateConnection::vpc_peering_config].
5996 ///
5997 /// # Example
5998 /// ```ignore,no_run
5999 /// # use google_cloud_datastream_v1::model::PrivateConnection;
6000 /// use google_cloud_datastream_v1::model::VpcPeeringConfig;
6001 /// let x = PrivateConnection::new().set_or_clear_vpc_peering_config(Some(VpcPeeringConfig::default()/* use setters */));
6002 /// let x = PrivateConnection::new().set_or_clear_vpc_peering_config(None::<VpcPeeringConfig>);
6003 /// ```
6004 pub fn set_or_clear_vpc_peering_config<T>(mut self, v: std::option::Option<T>) -> Self
6005 where
6006 T: std::convert::Into<crate::model::VpcPeeringConfig>,
6007 {
6008 self.vpc_peering_config = v.map(|x| x.into());
6009 self
6010 }
6011
6012 /// Sets the value of [psc_interface_config][crate::model::PrivateConnection::psc_interface_config].
6013 ///
6014 /// # Example
6015 /// ```ignore,no_run
6016 /// # use google_cloud_datastream_v1::model::PrivateConnection;
6017 /// use google_cloud_datastream_v1::model::PscInterfaceConfig;
6018 /// let x = PrivateConnection::new().set_psc_interface_config(PscInterfaceConfig::default()/* use setters */);
6019 /// ```
6020 pub fn set_psc_interface_config<T>(mut self, v: T) -> Self
6021 where
6022 T: std::convert::Into<crate::model::PscInterfaceConfig>,
6023 {
6024 self.psc_interface_config = std::option::Option::Some(v.into());
6025 self
6026 }
6027
6028 /// Sets or clears the value of [psc_interface_config][crate::model::PrivateConnection::psc_interface_config].
6029 ///
6030 /// # Example
6031 /// ```ignore,no_run
6032 /// # use google_cloud_datastream_v1::model::PrivateConnection;
6033 /// use google_cloud_datastream_v1::model::PscInterfaceConfig;
6034 /// let x = PrivateConnection::new().set_or_clear_psc_interface_config(Some(PscInterfaceConfig::default()/* use setters */));
6035 /// let x = PrivateConnection::new().set_or_clear_psc_interface_config(None::<PscInterfaceConfig>);
6036 /// ```
6037 pub fn set_or_clear_psc_interface_config<T>(mut self, v: std::option::Option<T>) -> Self
6038 where
6039 T: std::convert::Into<crate::model::PscInterfaceConfig>,
6040 {
6041 self.psc_interface_config = v.map(|x| x.into());
6042 self
6043 }
6044}
6045
6046impl wkt::message::Message for PrivateConnection {
6047 fn typename() -> &'static str {
6048 "type.googleapis.com/google.cloud.datastream.v1.PrivateConnection"
6049 }
6050}
6051
6052/// Defines additional types related to [PrivateConnection].
6053pub mod private_connection {
6054 #[allow(unused_imports)]
6055 use super::*;
6056
6057 /// Private Connection state.
6058 ///
6059 /// # Working with unknown values
6060 ///
6061 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6062 /// additional enum variants at any time. Adding new variants is not considered
6063 /// a breaking change. Applications should write their code in anticipation of:
6064 ///
6065 /// - New values appearing in future releases of the client library, **and**
6066 /// - New values received dynamically, without application changes.
6067 ///
6068 /// Please consult the [Working with enums] section in the user guide for some
6069 /// guidelines.
6070 ///
6071 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6072 #[derive(Clone, Debug, PartialEq)]
6073 #[non_exhaustive]
6074 pub enum State {
6075 /// Unspecified state.
6076 Unspecified,
6077 /// The private connection is in creation state - creating resources.
6078 Creating,
6079 /// The private connection has been created with all of its resources.
6080 Created,
6081 /// The private connection creation has failed.
6082 Failed,
6083 /// The private connection is being deleted.
6084 Deleting,
6085 /// Delete request has failed, resource is in invalid state.
6086 FailedToDelete,
6087 /// If set, the enum was initialized with an unknown value.
6088 ///
6089 /// Applications can examine the value using [State::value] or
6090 /// [State::name].
6091 UnknownValue(state::UnknownValue),
6092 }
6093
6094 #[doc(hidden)]
6095 pub mod state {
6096 #[allow(unused_imports)]
6097 use super::*;
6098 #[derive(Clone, Debug, PartialEq)]
6099 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6100 }
6101
6102 impl State {
6103 /// Gets the enum value.
6104 ///
6105 /// Returns `None` if the enum contains an unknown value deserialized from
6106 /// the string representation of enums.
6107 pub fn value(&self) -> std::option::Option<i32> {
6108 match self {
6109 Self::Unspecified => std::option::Option::Some(0),
6110 Self::Creating => std::option::Option::Some(1),
6111 Self::Created => std::option::Option::Some(2),
6112 Self::Failed => std::option::Option::Some(3),
6113 Self::Deleting => std::option::Option::Some(4),
6114 Self::FailedToDelete => std::option::Option::Some(5),
6115 Self::UnknownValue(u) => u.0.value(),
6116 }
6117 }
6118
6119 /// Gets the enum value as a string.
6120 ///
6121 /// Returns `None` if the enum contains an unknown value deserialized from
6122 /// the integer representation of enums.
6123 pub fn name(&self) -> std::option::Option<&str> {
6124 match self {
6125 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6126 Self::Creating => std::option::Option::Some("CREATING"),
6127 Self::Created => std::option::Option::Some("CREATED"),
6128 Self::Failed => std::option::Option::Some("FAILED"),
6129 Self::Deleting => std::option::Option::Some("DELETING"),
6130 Self::FailedToDelete => std::option::Option::Some("FAILED_TO_DELETE"),
6131 Self::UnknownValue(u) => u.0.name(),
6132 }
6133 }
6134 }
6135
6136 impl std::default::Default for State {
6137 fn default() -> Self {
6138 use std::convert::From;
6139 Self::from(0)
6140 }
6141 }
6142
6143 impl std::fmt::Display for State {
6144 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6145 wkt::internal::display_enum(f, self.name(), self.value())
6146 }
6147 }
6148
6149 impl std::convert::From<i32> for State {
6150 fn from(value: i32) -> Self {
6151 match value {
6152 0 => Self::Unspecified,
6153 1 => Self::Creating,
6154 2 => Self::Created,
6155 3 => Self::Failed,
6156 4 => Self::Deleting,
6157 5 => Self::FailedToDelete,
6158 _ => Self::UnknownValue(state::UnknownValue(
6159 wkt::internal::UnknownEnumValue::Integer(value),
6160 )),
6161 }
6162 }
6163 }
6164
6165 impl std::convert::From<&str> for State {
6166 fn from(value: &str) -> Self {
6167 use std::string::ToString;
6168 match value {
6169 "STATE_UNSPECIFIED" => Self::Unspecified,
6170 "CREATING" => Self::Creating,
6171 "CREATED" => Self::Created,
6172 "FAILED" => Self::Failed,
6173 "DELETING" => Self::Deleting,
6174 "FAILED_TO_DELETE" => Self::FailedToDelete,
6175 _ => Self::UnknownValue(state::UnknownValue(
6176 wkt::internal::UnknownEnumValue::String(value.to_string()),
6177 )),
6178 }
6179 }
6180 }
6181
6182 impl serde::ser::Serialize for State {
6183 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6184 where
6185 S: serde::Serializer,
6186 {
6187 match self {
6188 Self::Unspecified => serializer.serialize_i32(0),
6189 Self::Creating => serializer.serialize_i32(1),
6190 Self::Created => serializer.serialize_i32(2),
6191 Self::Failed => serializer.serialize_i32(3),
6192 Self::Deleting => serializer.serialize_i32(4),
6193 Self::FailedToDelete => serializer.serialize_i32(5),
6194 Self::UnknownValue(u) => u.0.serialize(serializer),
6195 }
6196 }
6197 }
6198
6199 impl<'de> serde::de::Deserialize<'de> for State {
6200 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6201 where
6202 D: serde::Deserializer<'de>,
6203 {
6204 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6205 ".google.cloud.datastream.v1.PrivateConnection.State",
6206 ))
6207 }
6208 }
6209}
6210
6211/// Private Connectivity
6212#[derive(Clone, Default, PartialEq)]
6213#[non_exhaustive]
6214pub struct PrivateConnectivity {
6215 /// Required. A reference to a private connection resource.
6216 /// Format: `projects/{project}/locations/{location}/privateConnections/{name}`
6217 pub private_connection: std::string::String,
6218
6219 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6220}
6221
6222impl PrivateConnectivity {
6223 pub fn new() -> Self {
6224 std::default::Default::default()
6225 }
6226
6227 /// Sets the value of [private_connection][crate::model::PrivateConnectivity::private_connection].
6228 ///
6229 /// # Example
6230 /// ```ignore,no_run
6231 /// # use google_cloud_datastream_v1::model::PrivateConnectivity;
6232 /// let x = PrivateConnectivity::new().set_private_connection("example");
6233 /// ```
6234 pub fn set_private_connection<T: std::convert::Into<std::string::String>>(
6235 mut self,
6236 v: T,
6237 ) -> Self {
6238 self.private_connection = v.into();
6239 self
6240 }
6241}
6242
6243impl wkt::message::Message for PrivateConnectivity {
6244 fn typename() -> &'static str {
6245 "type.googleapis.com/google.cloud.datastream.v1.PrivateConnectivity"
6246 }
6247}
6248
6249/// The route resource is the child of the private connection resource,
6250/// used for defining a route for a private connection.
6251#[derive(Clone, Default, PartialEq)]
6252#[non_exhaustive]
6253pub struct Route {
6254 /// Output only. Identifier. The resource's name.
6255 pub name: std::string::String,
6256
6257 /// Output only. The create time of the resource.
6258 pub create_time: std::option::Option<wkt::Timestamp>,
6259
6260 /// Output only. The update time of the resource.
6261 pub update_time: std::option::Option<wkt::Timestamp>,
6262
6263 /// Labels.
6264 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6265
6266 /// Required. Display name.
6267 pub display_name: std::string::String,
6268
6269 /// Required. Destination address for connection
6270 pub destination_address: std::string::String,
6271
6272 /// Destination port for connection
6273 pub destination_port: i32,
6274
6275 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6276}
6277
6278impl Route {
6279 pub fn new() -> Self {
6280 std::default::Default::default()
6281 }
6282
6283 /// Sets the value of [name][crate::model::Route::name].
6284 ///
6285 /// # Example
6286 /// ```ignore,no_run
6287 /// # use google_cloud_datastream_v1::model::Route;
6288 /// let x = Route::new().set_name("example");
6289 /// ```
6290 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6291 self.name = v.into();
6292 self
6293 }
6294
6295 /// Sets the value of [create_time][crate::model::Route::create_time].
6296 ///
6297 /// # Example
6298 /// ```ignore,no_run
6299 /// # use google_cloud_datastream_v1::model::Route;
6300 /// use wkt::Timestamp;
6301 /// let x = Route::new().set_create_time(Timestamp::default()/* use setters */);
6302 /// ```
6303 pub fn set_create_time<T>(mut self, v: T) -> Self
6304 where
6305 T: std::convert::Into<wkt::Timestamp>,
6306 {
6307 self.create_time = std::option::Option::Some(v.into());
6308 self
6309 }
6310
6311 /// Sets or clears the value of [create_time][crate::model::Route::create_time].
6312 ///
6313 /// # Example
6314 /// ```ignore,no_run
6315 /// # use google_cloud_datastream_v1::model::Route;
6316 /// use wkt::Timestamp;
6317 /// let x = Route::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6318 /// let x = Route::new().set_or_clear_create_time(None::<Timestamp>);
6319 /// ```
6320 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6321 where
6322 T: std::convert::Into<wkt::Timestamp>,
6323 {
6324 self.create_time = v.map(|x| x.into());
6325 self
6326 }
6327
6328 /// Sets the value of [update_time][crate::model::Route::update_time].
6329 ///
6330 /// # Example
6331 /// ```ignore,no_run
6332 /// # use google_cloud_datastream_v1::model::Route;
6333 /// use wkt::Timestamp;
6334 /// let x = Route::new().set_update_time(Timestamp::default()/* use setters */);
6335 /// ```
6336 pub fn set_update_time<T>(mut self, v: T) -> Self
6337 where
6338 T: std::convert::Into<wkt::Timestamp>,
6339 {
6340 self.update_time = std::option::Option::Some(v.into());
6341 self
6342 }
6343
6344 /// Sets or clears the value of [update_time][crate::model::Route::update_time].
6345 ///
6346 /// # Example
6347 /// ```ignore,no_run
6348 /// # use google_cloud_datastream_v1::model::Route;
6349 /// use wkt::Timestamp;
6350 /// let x = Route::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6351 /// let x = Route::new().set_or_clear_update_time(None::<Timestamp>);
6352 /// ```
6353 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6354 where
6355 T: std::convert::Into<wkt::Timestamp>,
6356 {
6357 self.update_time = v.map(|x| x.into());
6358 self
6359 }
6360
6361 /// Sets the value of [labels][crate::model::Route::labels].
6362 ///
6363 /// # Example
6364 /// ```ignore,no_run
6365 /// # use google_cloud_datastream_v1::model::Route;
6366 /// let x = Route::new().set_labels([
6367 /// ("key0", "abc"),
6368 /// ("key1", "xyz"),
6369 /// ]);
6370 /// ```
6371 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6372 where
6373 T: std::iter::IntoIterator<Item = (K, V)>,
6374 K: std::convert::Into<std::string::String>,
6375 V: std::convert::Into<std::string::String>,
6376 {
6377 use std::iter::Iterator;
6378 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6379 self
6380 }
6381
6382 /// Sets the value of [display_name][crate::model::Route::display_name].
6383 ///
6384 /// # Example
6385 /// ```ignore,no_run
6386 /// # use google_cloud_datastream_v1::model::Route;
6387 /// let x = Route::new().set_display_name("example");
6388 /// ```
6389 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6390 self.display_name = v.into();
6391 self
6392 }
6393
6394 /// Sets the value of [destination_address][crate::model::Route::destination_address].
6395 ///
6396 /// # Example
6397 /// ```ignore,no_run
6398 /// # use google_cloud_datastream_v1::model::Route;
6399 /// let x = Route::new().set_destination_address("example");
6400 /// ```
6401 pub fn set_destination_address<T: std::convert::Into<std::string::String>>(
6402 mut self,
6403 v: T,
6404 ) -> Self {
6405 self.destination_address = v.into();
6406 self
6407 }
6408
6409 /// Sets the value of [destination_port][crate::model::Route::destination_port].
6410 ///
6411 /// # Example
6412 /// ```ignore,no_run
6413 /// # use google_cloud_datastream_v1::model::Route;
6414 /// let x = Route::new().set_destination_port(42);
6415 /// ```
6416 pub fn set_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6417 self.destination_port = v.into();
6418 self
6419 }
6420}
6421
6422impl wkt::message::Message for Route {
6423 fn typename() -> &'static str {
6424 "type.googleapis.com/google.cloud.datastream.v1.Route"
6425 }
6426}
6427
6428/// MongoDB SSL configuration information.
6429#[derive(Clone, Default, PartialEq)]
6430#[non_exhaustive]
6431pub struct MongodbSslConfig {
6432 /// Optional. Input only. PEM-encoded private key associated with the Client
6433 /// Certificate. If this field is used then the 'client_certificate' and the
6434 /// 'ca_certificate' fields are mandatory.
6435 pub client_key: std::string::String,
6436
6437 /// Output only. Indicates whether the client_key field is set.
6438 pub client_key_set: bool,
6439
6440 /// Optional. Input only. PEM-encoded certificate that will be used by the
6441 /// replica to authenticate against the source database server. If this field
6442 /// is used then the 'client_key' and the 'ca_certificate' fields are
6443 /// mandatory.
6444 pub client_certificate: std::string::String,
6445
6446 /// Output only. Indicates whether the client_certificate field is set.
6447 pub client_certificate_set: bool,
6448
6449 /// Optional. Input only. PEM-encoded certificate of the CA that signed the
6450 /// source database server's certificate.
6451 pub ca_certificate: std::string::String,
6452
6453 /// Output only. Indicates whether the ca_certificate field is set.
6454 pub ca_certificate_set: bool,
6455
6456 /// Optional. Input only. A reference to a Secret Manager resource name storing
6457 /// the PEM-encoded private key associated with the Client Certificate. If this
6458 /// field is used then the 'client_certificate' and the 'ca_certificate' fields
6459 /// are mandatory. Mutually exclusive with the `client_key` field.
6460 pub secret_manager_stored_client_key: std::string::String,
6461
6462 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6463}
6464
6465impl MongodbSslConfig {
6466 pub fn new() -> Self {
6467 std::default::Default::default()
6468 }
6469
6470 /// Sets the value of [client_key][crate::model::MongodbSslConfig::client_key].
6471 ///
6472 /// # Example
6473 /// ```ignore,no_run
6474 /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6475 /// let x = MongodbSslConfig::new().set_client_key("example");
6476 /// ```
6477 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6478 self.client_key = v.into();
6479 self
6480 }
6481
6482 /// Sets the value of [client_key_set][crate::model::MongodbSslConfig::client_key_set].
6483 ///
6484 /// # Example
6485 /// ```ignore,no_run
6486 /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6487 /// let x = MongodbSslConfig::new().set_client_key_set(true);
6488 /// ```
6489 pub fn set_client_key_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6490 self.client_key_set = v.into();
6491 self
6492 }
6493
6494 /// Sets the value of [client_certificate][crate::model::MongodbSslConfig::client_certificate].
6495 ///
6496 /// # Example
6497 /// ```ignore,no_run
6498 /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6499 /// let x = MongodbSslConfig::new().set_client_certificate("example");
6500 /// ```
6501 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
6502 mut self,
6503 v: T,
6504 ) -> Self {
6505 self.client_certificate = v.into();
6506 self
6507 }
6508
6509 /// Sets the value of [client_certificate_set][crate::model::MongodbSslConfig::client_certificate_set].
6510 ///
6511 /// # Example
6512 /// ```ignore,no_run
6513 /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6514 /// let x = MongodbSslConfig::new().set_client_certificate_set(true);
6515 /// ```
6516 pub fn set_client_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6517 self.client_certificate_set = v.into();
6518 self
6519 }
6520
6521 /// Sets the value of [ca_certificate][crate::model::MongodbSslConfig::ca_certificate].
6522 ///
6523 /// # Example
6524 /// ```ignore,no_run
6525 /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6526 /// let x = MongodbSslConfig::new().set_ca_certificate("example");
6527 /// ```
6528 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6529 self.ca_certificate = v.into();
6530 self
6531 }
6532
6533 /// Sets the value of [ca_certificate_set][crate::model::MongodbSslConfig::ca_certificate_set].
6534 ///
6535 /// # Example
6536 /// ```ignore,no_run
6537 /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6538 /// let x = MongodbSslConfig::new().set_ca_certificate_set(true);
6539 /// ```
6540 pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6541 self.ca_certificate_set = v.into();
6542 self
6543 }
6544
6545 /// Sets the value of [secret_manager_stored_client_key][crate::model::MongodbSslConfig::secret_manager_stored_client_key].
6546 ///
6547 /// # Example
6548 /// ```ignore,no_run
6549 /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6550 /// let x = MongodbSslConfig::new().set_secret_manager_stored_client_key("example");
6551 /// ```
6552 pub fn set_secret_manager_stored_client_key<T: std::convert::Into<std::string::String>>(
6553 mut self,
6554 v: T,
6555 ) -> Self {
6556 self.secret_manager_stored_client_key = v.into();
6557 self
6558 }
6559}
6560
6561impl wkt::message::Message for MongodbSslConfig {
6562 fn typename() -> &'static str {
6563 "type.googleapis.com/google.cloud.datastream.v1.MongodbSslConfig"
6564 }
6565}
6566
6567/// MySQL SSL configuration information.
6568#[derive(Clone, Default, PartialEq)]
6569#[non_exhaustive]
6570pub struct MysqlSslConfig {
6571 /// Optional. Input only. PEM-encoded private key associated with the Client
6572 /// Certificate. If this field is used then the 'client_certificate' and the
6573 /// 'ca_certificate' fields are mandatory.
6574 pub client_key: std::string::String,
6575
6576 /// Output only. Indicates whether the client_key field is set.
6577 pub client_key_set: bool,
6578
6579 /// Optional. Input only. PEM-encoded certificate that will be used by the
6580 /// replica to authenticate against the source database server. If this field
6581 /// is used then the 'client_key' and the 'ca_certificate' fields are
6582 /// mandatory.
6583 pub client_certificate: std::string::String,
6584
6585 /// Output only. Indicates whether the client_certificate field is set.
6586 pub client_certificate_set: bool,
6587
6588 /// Input only. PEM-encoded certificate of the CA that signed the source
6589 /// database server's certificate.
6590 pub ca_certificate: std::string::String,
6591
6592 /// Output only. Indicates whether the ca_certificate field is set.
6593 pub ca_certificate_set: bool,
6594
6595 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6596}
6597
6598impl MysqlSslConfig {
6599 pub fn new() -> Self {
6600 std::default::Default::default()
6601 }
6602
6603 /// Sets the value of [client_key][crate::model::MysqlSslConfig::client_key].
6604 ///
6605 /// # Example
6606 /// ```ignore,no_run
6607 /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6608 /// let x = MysqlSslConfig::new().set_client_key("example");
6609 /// ```
6610 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6611 self.client_key = v.into();
6612 self
6613 }
6614
6615 /// Sets the value of [client_key_set][crate::model::MysqlSslConfig::client_key_set].
6616 ///
6617 /// # Example
6618 /// ```ignore,no_run
6619 /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6620 /// let x = MysqlSslConfig::new().set_client_key_set(true);
6621 /// ```
6622 pub fn set_client_key_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6623 self.client_key_set = v.into();
6624 self
6625 }
6626
6627 /// Sets the value of [client_certificate][crate::model::MysqlSslConfig::client_certificate].
6628 ///
6629 /// # Example
6630 /// ```ignore,no_run
6631 /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6632 /// let x = MysqlSslConfig::new().set_client_certificate("example");
6633 /// ```
6634 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
6635 mut self,
6636 v: T,
6637 ) -> Self {
6638 self.client_certificate = v.into();
6639 self
6640 }
6641
6642 /// Sets the value of [client_certificate_set][crate::model::MysqlSslConfig::client_certificate_set].
6643 ///
6644 /// # Example
6645 /// ```ignore,no_run
6646 /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6647 /// let x = MysqlSslConfig::new().set_client_certificate_set(true);
6648 /// ```
6649 pub fn set_client_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6650 self.client_certificate_set = v.into();
6651 self
6652 }
6653
6654 /// Sets the value of [ca_certificate][crate::model::MysqlSslConfig::ca_certificate].
6655 ///
6656 /// # Example
6657 /// ```ignore,no_run
6658 /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6659 /// let x = MysqlSslConfig::new().set_ca_certificate("example");
6660 /// ```
6661 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6662 self.ca_certificate = v.into();
6663 self
6664 }
6665
6666 /// Sets the value of [ca_certificate_set][crate::model::MysqlSslConfig::ca_certificate_set].
6667 ///
6668 /// # Example
6669 /// ```ignore,no_run
6670 /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6671 /// let x = MysqlSslConfig::new().set_ca_certificate_set(true);
6672 /// ```
6673 pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6674 self.ca_certificate_set = v.into();
6675 self
6676 }
6677}
6678
6679impl wkt::message::Message for MysqlSslConfig {
6680 fn typename() -> &'static str {
6681 "type.googleapis.com/google.cloud.datastream.v1.MysqlSslConfig"
6682 }
6683}
6684
6685/// Oracle SSL configuration information.
6686#[derive(Clone, Default, PartialEq)]
6687#[non_exhaustive]
6688pub struct OracleSslConfig {
6689 /// Input only. PEM-encoded certificate of the CA that signed the source
6690 /// database server's certificate.
6691 pub ca_certificate: std::string::String,
6692
6693 /// Output only. Indicates whether the ca_certificate field has been set for
6694 /// this Connection-Profile.
6695 pub ca_certificate_set: bool,
6696
6697 /// Optional. The distinguished name (DN) mentioned in the server
6698 /// certificate. This corresponds to SSL_SERVER_CERT_DN sqlnet parameter.
6699 /// Refer
6700 /// <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>
6701 /// If this field is not provided, the DN matching is not enforced.
6702 pub server_certificate_distinguished_name: std::string::String,
6703
6704 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6705}
6706
6707impl OracleSslConfig {
6708 pub fn new() -> Self {
6709 std::default::Default::default()
6710 }
6711
6712 /// Sets the value of [ca_certificate][crate::model::OracleSslConfig::ca_certificate].
6713 ///
6714 /// # Example
6715 /// ```ignore,no_run
6716 /// # use google_cloud_datastream_v1::model::OracleSslConfig;
6717 /// let x = OracleSslConfig::new().set_ca_certificate("example");
6718 /// ```
6719 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6720 self.ca_certificate = v.into();
6721 self
6722 }
6723
6724 /// Sets the value of [ca_certificate_set][crate::model::OracleSslConfig::ca_certificate_set].
6725 ///
6726 /// # Example
6727 /// ```ignore,no_run
6728 /// # use google_cloud_datastream_v1::model::OracleSslConfig;
6729 /// let x = OracleSslConfig::new().set_ca_certificate_set(true);
6730 /// ```
6731 pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6732 self.ca_certificate_set = v.into();
6733 self
6734 }
6735
6736 /// Sets the value of [server_certificate_distinguished_name][crate::model::OracleSslConfig::server_certificate_distinguished_name].
6737 ///
6738 /// # Example
6739 /// ```ignore,no_run
6740 /// # use google_cloud_datastream_v1::model::OracleSslConfig;
6741 /// let x = OracleSslConfig::new().set_server_certificate_distinguished_name("example");
6742 /// ```
6743 pub fn set_server_certificate_distinguished_name<T: std::convert::Into<std::string::String>>(
6744 mut self,
6745 v: T,
6746 ) -> Self {
6747 self.server_certificate_distinguished_name = v.into();
6748 self
6749 }
6750}
6751
6752impl wkt::message::Message for OracleSslConfig {
6753 fn typename() -> &'static str {
6754 "type.googleapis.com/google.cloud.datastream.v1.OracleSslConfig"
6755 }
6756}
6757
6758/// PostgreSQL SSL configuration information.
6759#[derive(Clone, Default, PartialEq)]
6760#[non_exhaustive]
6761pub struct PostgresqlSslConfig {
6762 /// The encryption settings available for PostgreSQL connection profiles.
6763 /// This captures various SSL mode supported by PostgreSQL, which includes
6764 /// TLS encryption with server verification, TLS encryption with both server
6765 /// and client verification and no TLS encryption.
6766 pub encryption_setting:
6767 std::option::Option<crate::model::postgresql_ssl_config::EncryptionSetting>,
6768
6769 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6770}
6771
6772impl PostgresqlSslConfig {
6773 pub fn new() -> Self {
6774 std::default::Default::default()
6775 }
6776
6777 /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting].
6778 ///
6779 /// Note that all the setters affecting `encryption_setting` are mutually
6780 /// exclusive.
6781 ///
6782 /// # Example
6783 /// ```ignore,no_run
6784 /// # use google_cloud_datastream_v1::model::PostgresqlSslConfig;
6785 /// use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
6786 /// let x = PostgresqlSslConfig::new().set_encryption_setting(Some(
6787 /// google_cloud_datastream_v1::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(ServerVerification::default().into())));
6788 /// ```
6789 pub fn set_encryption_setting<
6790 T: std::convert::Into<
6791 std::option::Option<crate::model::postgresql_ssl_config::EncryptionSetting>,
6792 >,
6793 >(
6794 mut self,
6795 v: T,
6796 ) -> Self {
6797 self.encryption_setting = v.into();
6798 self
6799 }
6800
6801 /// The value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
6802 /// if it holds a `ServerVerification`, `None` if the field is not set or
6803 /// holds a different branch.
6804 pub fn server_verification(
6805 &self,
6806 ) -> std::option::Option<
6807 &std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
6808 > {
6809 #[allow(unreachable_patterns)]
6810 self.encryption_setting.as_ref().and_then(|v| match v {
6811 crate::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(v) => {
6812 std::option::Option::Some(v)
6813 }
6814 _ => std::option::Option::None,
6815 })
6816 }
6817
6818 /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
6819 /// to hold a `ServerVerification`.
6820 ///
6821 /// Note that all the setters affecting `encryption_setting` are
6822 /// mutually exclusive.
6823 ///
6824 /// # Example
6825 /// ```ignore,no_run
6826 /// # use google_cloud_datastream_v1::model::PostgresqlSslConfig;
6827 /// use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
6828 /// let x = PostgresqlSslConfig::new().set_server_verification(ServerVerification::default()/* use setters */);
6829 /// assert!(x.server_verification().is_some());
6830 /// assert!(x.server_and_client_verification().is_none());
6831 /// ```
6832 pub fn set_server_verification<
6833 T: std::convert::Into<
6834 std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
6835 >,
6836 >(
6837 mut self,
6838 v: T,
6839 ) -> Self {
6840 self.encryption_setting = std::option::Option::Some(
6841 crate::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(v.into()),
6842 );
6843 self
6844 }
6845
6846 /// The value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
6847 /// if it holds a `ServerAndClientVerification`, `None` if the field is not set or
6848 /// holds a different branch.
6849 pub fn server_and_client_verification(
6850 &self,
6851 ) -> std::option::Option<
6852 &std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
6853 > {
6854 #[allow(unreachable_patterns)]
6855 self.encryption_setting.as_ref().and_then(|v| match v {
6856 crate::model::postgresql_ssl_config::EncryptionSetting::ServerAndClientVerification(
6857 v,
6858 ) => std::option::Option::Some(v),
6859 _ => std::option::Option::None,
6860 })
6861 }
6862
6863 /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
6864 /// to hold a `ServerAndClientVerification`.
6865 ///
6866 /// Note that all the setters affecting `encryption_setting` are
6867 /// mutually exclusive.
6868 ///
6869 /// # Example
6870 /// ```ignore,no_run
6871 /// # use google_cloud_datastream_v1::model::PostgresqlSslConfig;
6872 /// use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
6873 /// let x = PostgresqlSslConfig::new().set_server_and_client_verification(ServerAndClientVerification::default()/* use setters */);
6874 /// assert!(x.server_and_client_verification().is_some());
6875 /// assert!(x.server_verification().is_none());
6876 /// ```
6877 pub fn set_server_and_client_verification<
6878 T: std::convert::Into<
6879 std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
6880 >,
6881 >(
6882 mut self,
6883 v: T,
6884 ) -> Self {
6885 self.encryption_setting = std::option::Option::Some(
6886 crate::model::postgresql_ssl_config::EncryptionSetting::ServerAndClientVerification(
6887 v.into(),
6888 ),
6889 );
6890 self
6891 }
6892}
6893
6894impl wkt::message::Message for PostgresqlSslConfig {
6895 fn typename() -> &'static str {
6896 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig"
6897 }
6898}
6899
6900/// Defines additional types related to [PostgresqlSslConfig].
6901pub mod postgresql_ssl_config {
6902 #[allow(unused_imports)]
6903 use super::*;
6904
6905 /// Message represents the option where Datastream will enforce the encryption
6906 /// and authenticate the server identity. ca_certificate must be set if user
6907 /// selects this option.
6908 #[derive(Clone, Default, PartialEq)]
6909 #[non_exhaustive]
6910 pub struct ServerVerification {
6911 /// Required. Input only. PEM-encoded server root CA certificate.
6912 pub ca_certificate: std::string::String,
6913
6914 /// Optional. The hostname mentioned in the Subject or SAN extension of the
6915 /// server certificate. If this field is not provided, the hostname in the
6916 /// server certificate is not validated.
6917 pub server_certificate_hostname: std::string::String,
6918
6919 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6920 }
6921
6922 impl ServerVerification {
6923 pub fn new() -> Self {
6924 std::default::Default::default()
6925 }
6926
6927 /// Sets the value of [ca_certificate][crate::model::postgresql_ssl_config::ServerVerification::ca_certificate].
6928 ///
6929 /// # Example
6930 /// ```ignore,no_run
6931 /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
6932 /// let x = ServerVerification::new().set_ca_certificate("example");
6933 /// ```
6934 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(
6935 mut self,
6936 v: T,
6937 ) -> Self {
6938 self.ca_certificate = v.into();
6939 self
6940 }
6941
6942 /// Sets the value of [server_certificate_hostname][crate::model::postgresql_ssl_config::ServerVerification::server_certificate_hostname].
6943 ///
6944 /// # Example
6945 /// ```ignore,no_run
6946 /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
6947 /// let x = ServerVerification::new().set_server_certificate_hostname("example");
6948 /// ```
6949 pub fn set_server_certificate_hostname<T: std::convert::Into<std::string::String>>(
6950 mut self,
6951 v: T,
6952 ) -> Self {
6953 self.server_certificate_hostname = v.into();
6954 self
6955 }
6956 }
6957
6958 impl wkt::message::Message for ServerVerification {
6959 fn typename() -> &'static str {
6960 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig.ServerVerification"
6961 }
6962 }
6963
6964 /// Message represents the option where Datastream will enforce the encryption
6965 /// and authenticate the server identity as well as the client identity.
6966 /// ca_certificate, client_certificate and client_key must be set if user
6967 /// selects this option.
6968 #[derive(Clone, Default, PartialEq)]
6969 #[non_exhaustive]
6970 pub struct ServerAndClientVerification {
6971 /// Required. Input only. PEM-encoded certificate used by the source database
6972 /// to authenticate the client identity (i.e., the Datastream's identity).
6973 /// This certificate is signed by either a root certificate trusted by the
6974 /// server or one or more intermediate certificates (which is stored with the
6975 /// leaf certificate) to link the this certificate to the trusted root
6976 /// certificate.
6977 pub client_certificate: std::string::String,
6978
6979 /// Optional. Input only. PEM-encoded private key associated with the client
6980 /// certificate. This value will be used during the SSL/TLS handshake,
6981 /// allowing the PostgreSQL server to authenticate the client's identity,
6982 /// i.e. identity of the Datastream.
6983 pub client_key: std::string::String,
6984
6985 /// Required. Input only. PEM-encoded server root CA certificate.
6986 pub ca_certificate: std::string::String,
6987
6988 /// Optional. The hostname mentioned in the Subject or SAN extension of the
6989 /// server certificate. If this field is not provided, the hostname in the
6990 /// server certificate is not validated.
6991 pub server_certificate_hostname: std::string::String,
6992
6993 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6994 }
6995
6996 impl ServerAndClientVerification {
6997 pub fn new() -> Self {
6998 std::default::Default::default()
6999 }
7000
7001 /// Sets the value of [client_certificate][crate::model::postgresql_ssl_config::ServerAndClientVerification::client_certificate].
7002 ///
7003 /// # Example
7004 /// ```ignore,no_run
7005 /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7006 /// let x = ServerAndClientVerification::new().set_client_certificate("example");
7007 /// ```
7008 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
7009 mut self,
7010 v: T,
7011 ) -> Self {
7012 self.client_certificate = v.into();
7013 self
7014 }
7015
7016 /// Sets the value of [client_key][crate::model::postgresql_ssl_config::ServerAndClientVerification::client_key].
7017 ///
7018 /// # Example
7019 /// ```ignore,no_run
7020 /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7021 /// let x = ServerAndClientVerification::new().set_client_key("example");
7022 /// ```
7023 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7024 self.client_key = v.into();
7025 self
7026 }
7027
7028 /// Sets the value of [ca_certificate][crate::model::postgresql_ssl_config::ServerAndClientVerification::ca_certificate].
7029 ///
7030 /// # Example
7031 /// ```ignore,no_run
7032 /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7033 /// let x = ServerAndClientVerification::new().set_ca_certificate("example");
7034 /// ```
7035 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(
7036 mut self,
7037 v: T,
7038 ) -> Self {
7039 self.ca_certificate = v.into();
7040 self
7041 }
7042
7043 /// Sets the value of [server_certificate_hostname][crate::model::postgresql_ssl_config::ServerAndClientVerification::server_certificate_hostname].
7044 ///
7045 /// # Example
7046 /// ```ignore,no_run
7047 /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7048 /// let x = ServerAndClientVerification::new().set_server_certificate_hostname("example");
7049 /// ```
7050 pub fn set_server_certificate_hostname<T: std::convert::Into<std::string::String>>(
7051 mut self,
7052 v: T,
7053 ) -> Self {
7054 self.server_certificate_hostname = v.into();
7055 self
7056 }
7057 }
7058
7059 impl wkt::message::Message for ServerAndClientVerification {
7060 fn typename() -> &'static str {
7061 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig.ServerAndClientVerification"
7062 }
7063 }
7064
7065 /// The encryption settings available for PostgreSQL connection profiles.
7066 /// This captures various SSL mode supported by PostgreSQL, which includes
7067 /// TLS encryption with server verification, TLS encryption with both server
7068 /// and client verification and no TLS encryption.
7069 #[derive(Clone, Debug, PartialEq)]
7070 #[non_exhaustive]
7071 pub enum EncryptionSetting {
7072 /// Â If this field is set, the communication will be encrypted with TLS
7073 /// encryption and the server identity will be authenticated.
7074 ServerVerification(
7075 std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
7076 ),
7077 /// If this field is set, the communication will be encrypted with TLS
7078 /// encryption and both the server identity and the client identity will be
7079 /// authenticated.
7080 ServerAndClientVerification(
7081 std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
7082 ),
7083 }
7084}
7085
7086/// A set of reusable connection configurations to be used as a source or
7087/// destination for a stream.
7088#[derive(Clone, Default, PartialEq)]
7089#[non_exhaustive]
7090pub struct ConnectionProfile {
7091 /// Output only. Identifier. The resource's name.
7092 pub name: std::string::String,
7093
7094 /// Output only. The create time of the resource.
7095 pub create_time: std::option::Option<wkt::Timestamp>,
7096
7097 /// Output only. The update time of the resource.
7098 pub update_time: std::option::Option<wkt::Timestamp>,
7099
7100 /// Labels.
7101 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7102
7103 /// Required. Display name.
7104 pub display_name: std::string::String,
7105
7106 /// Output only. Reserved for future use.
7107 pub satisfies_pzs: std::option::Option<bool>,
7108
7109 /// Output only. Reserved for future use.
7110 pub satisfies_pzi: std::option::Option<bool>,
7111
7112 /// Connection configuration for the ConnectionProfile.
7113 pub profile: std::option::Option<crate::model::connection_profile::Profile>,
7114
7115 /// Connectivity options used to establish a connection to the profile.
7116 pub connectivity: std::option::Option<crate::model::connection_profile::Connectivity>,
7117
7118 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7119}
7120
7121impl ConnectionProfile {
7122 pub fn new() -> Self {
7123 std::default::Default::default()
7124 }
7125
7126 /// Sets the value of [name][crate::model::ConnectionProfile::name].
7127 ///
7128 /// # Example
7129 /// ```ignore,no_run
7130 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7131 /// let x = ConnectionProfile::new().set_name("example");
7132 /// ```
7133 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7134 self.name = v.into();
7135 self
7136 }
7137
7138 /// Sets the value of [create_time][crate::model::ConnectionProfile::create_time].
7139 ///
7140 /// # Example
7141 /// ```ignore,no_run
7142 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7143 /// use wkt::Timestamp;
7144 /// let x = ConnectionProfile::new().set_create_time(Timestamp::default()/* use setters */);
7145 /// ```
7146 pub fn set_create_time<T>(mut self, v: T) -> Self
7147 where
7148 T: std::convert::Into<wkt::Timestamp>,
7149 {
7150 self.create_time = std::option::Option::Some(v.into());
7151 self
7152 }
7153
7154 /// Sets or clears the value of [create_time][crate::model::ConnectionProfile::create_time].
7155 ///
7156 /// # Example
7157 /// ```ignore,no_run
7158 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7159 /// use wkt::Timestamp;
7160 /// let x = ConnectionProfile::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7161 /// let x = ConnectionProfile::new().set_or_clear_create_time(None::<Timestamp>);
7162 /// ```
7163 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7164 where
7165 T: std::convert::Into<wkt::Timestamp>,
7166 {
7167 self.create_time = v.map(|x| x.into());
7168 self
7169 }
7170
7171 /// Sets the value of [update_time][crate::model::ConnectionProfile::update_time].
7172 ///
7173 /// # Example
7174 /// ```ignore,no_run
7175 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7176 /// use wkt::Timestamp;
7177 /// let x = ConnectionProfile::new().set_update_time(Timestamp::default()/* use setters */);
7178 /// ```
7179 pub fn set_update_time<T>(mut self, v: T) -> Self
7180 where
7181 T: std::convert::Into<wkt::Timestamp>,
7182 {
7183 self.update_time = std::option::Option::Some(v.into());
7184 self
7185 }
7186
7187 /// Sets or clears the value of [update_time][crate::model::ConnectionProfile::update_time].
7188 ///
7189 /// # Example
7190 /// ```ignore,no_run
7191 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7192 /// use wkt::Timestamp;
7193 /// let x = ConnectionProfile::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7194 /// let x = ConnectionProfile::new().set_or_clear_update_time(None::<Timestamp>);
7195 /// ```
7196 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7197 where
7198 T: std::convert::Into<wkt::Timestamp>,
7199 {
7200 self.update_time = v.map(|x| x.into());
7201 self
7202 }
7203
7204 /// Sets the value of [labels][crate::model::ConnectionProfile::labels].
7205 ///
7206 /// # Example
7207 /// ```ignore,no_run
7208 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7209 /// let x = ConnectionProfile::new().set_labels([
7210 /// ("key0", "abc"),
7211 /// ("key1", "xyz"),
7212 /// ]);
7213 /// ```
7214 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7215 where
7216 T: std::iter::IntoIterator<Item = (K, V)>,
7217 K: std::convert::Into<std::string::String>,
7218 V: std::convert::Into<std::string::String>,
7219 {
7220 use std::iter::Iterator;
7221 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7222 self
7223 }
7224
7225 /// Sets the value of [display_name][crate::model::ConnectionProfile::display_name].
7226 ///
7227 /// # Example
7228 /// ```ignore,no_run
7229 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7230 /// let x = ConnectionProfile::new().set_display_name("example");
7231 /// ```
7232 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7233 self.display_name = v.into();
7234 self
7235 }
7236
7237 /// Sets the value of [satisfies_pzs][crate::model::ConnectionProfile::satisfies_pzs].
7238 ///
7239 /// # Example
7240 /// ```ignore,no_run
7241 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7242 /// let x = ConnectionProfile::new().set_satisfies_pzs(true);
7243 /// ```
7244 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
7245 where
7246 T: std::convert::Into<bool>,
7247 {
7248 self.satisfies_pzs = std::option::Option::Some(v.into());
7249 self
7250 }
7251
7252 /// Sets or clears the value of [satisfies_pzs][crate::model::ConnectionProfile::satisfies_pzs].
7253 ///
7254 /// # Example
7255 /// ```ignore,no_run
7256 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7257 /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzs(Some(false));
7258 /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzs(None::<bool>);
7259 /// ```
7260 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
7261 where
7262 T: std::convert::Into<bool>,
7263 {
7264 self.satisfies_pzs = v.map(|x| x.into());
7265 self
7266 }
7267
7268 /// Sets the value of [satisfies_pzi][crate::model::ConnectionProfile::satisfies_pzi].
7269 ///
7270 /// # Example
7271 /// ```ignore,no_run
7272 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7273 /// let x = ConnectionProfile::new().set_satisfies_pzi(true);
7274 /// ```
7275 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
7276 where
7277 T: std::convert::Into<bool>,
7278 {
7279 self.satisfies_pzi = std::option::Option::Some(v.into());
7280 self
7281 }
7282
7283 /// Sets or clears the value of [satisfies_pzi][crate::model::ConnectionProfile::satisfies_pzi].
7284 ///
7285 /// # Example
7286 /// ```ignore,no_run
7287 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7288 /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzi(Some(false));
7289 /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzi(None::<bool>);
7290 /// ```
7291 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
7292 where
7293 T: std::convert::Into<bool>,
7294 {
7295 self.satisfies_pzi = v.map(|x| x.into());
7296 self
7297 }
7298
7299 /// Sets the value of [profile][crate::model::ConnectionProfile::profile].
7300 ///
7301 /// Note that all the setters affecting `profile` are mutually
7302 /// exclusive.
7303 ///
7304 /// # Example
7305 /// ```ignore,no_run
7306 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7307 /// use google_cloud_datastream_v1::model::OracleProfile;
7308 /// let x = ConnectionProfile::new().set_profile(Some(
7309 /// google_cloud_datastream_v1::model::connection_profile::Profile::OracleProfile(OracleProfile::default().into())));
7310 /// ```
7311 pub fn set_profile<
7312 T: std::convert::Into<std::option::Option<crate::model::connection_profile::Profile>>,
7313 >(
7314 mut self,
7315 v: T,
7316 ) -> Self {
7317 self.profile = v.into();
7318 self
7319 }
7320
7321 /// The value of [profile][crate::model::ConnectionProfile::profile]
7322 /// if it holds a `OracleProfile`, `None` if the field is not set or
7323 /// holds a different branch.
7324 pub fn oracle_profile(
7325 &self,
7326 ) -> std::option::Option<&std::boxed::Box<crate::model::OracleProfile>> {
7327 #[allow(unreachable_patterns)]
7328 self.profile.as_ref().and_then(|v| match v {
7329 crate::model::connection_profile::Profile::OracleProfile(v) => {
7330 std::option::Option::Some(v)
7331 }
7332 _ => std::option::Option::None,
7333 })
7334 }
7335
7336 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7337 /// to hold a `OracleProfile`.
7338 ///
7339 /// Note that all the setters affecting `profile` are
7340 /// mutually exclusive.
7341 ///
7342 /// # Example
7343 /// ```ignore,no_run
7344 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7345 /// use google_cloud_datastream_v1::model::OracleProfile;
7346 /// let x = ConnectionProfile::new().set_oracle_profile(OracleProfile::default()/* use setters */);
7347 /// assert!(x.oracle_profile().is_some());
7348 /// assert!(x.gcs_profile().is_none());
7349 /// assert!(x.mysql_profile().is_none());
7350 /// assert!(x.bigquery_profile().is_none());
7351 /// assert!(x.postgresql_profile().is_none());
7352 /// assert!(x.sql_server_profile().is_none());
7353 /// assert!(x.salesforce_profile().is_none());
7354 /// assert!(x.mongodb_profile().is_none());
7355 /// ```
7356 pub fn set_oracle_profile<
7357 T: std::convert::Into<std::boxed::Box<crate::model::OracleProfile>>,
7358 >(
7359 mut self,
7360 v: T,
7361 ) -> Self {
7362 self.profile = std::option::Option::Some(
7363 crate::model::connection_profile::Profile::OracleProfile(v.into()),
7364 );
7365 self
7366 }
7367
7368 /// The value of [profile][crate::model::ConnectionProfile::profile]
7369 /// if it holds a `GcsProfile`, `None` if the field is not set or
7370 /// holds a different branch.
7371 pub fn gcs_profile(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcsProfile>> {
7372 #[allow(unreachable_patterns)]
7373 self.profile.as_ref().and_then(|v| match v {
7374 crate::model::connection_profile::Profile::GcsProfile(v) => {
7375 std::option::Option::Some(v)
7376 }
7377 _ => std::option::Option::None,
7378 })
7379 }
7380
7381 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7382 /// to hold a `GcsProfile`.
7383 ///
7384 /// Note that all the setters affecting `profile` are
7385 /// mutually exclusive.
7386 ///
7387 /// # Example
7388 /// ```ignore,no_run
7389 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7390 /// use google_cloud_datastream_v1::model::GcsProfile;
7391 /// let x = ConnectionProfile::new().set_gcs_profile(GcsProfile::default()/* use setters */);
7392 /// assert!(x.gcs_profile().is_some());
7393 /// assert!(x.oracle_profile().is_none());
7394 /// assert!(x.mysql_profile().is_none());
7395 /// assert!(x.bigquery_profile().is_none());
7396 /// assert!(x.postgresql_profile().is_none());
7397 /// assert!(x.sql_server_profile().is_none());
7398 /// assert!(x.salesforce_profile().is_none());
7399 /// assert!(x.mongodb_profile().is_none());
7400 /// ```
7401 pub fn set_gcs_profile<T: std::convert::Into<std::boxed::Box<crate::model::GcsProfile>>>(
7402 mut self,
7403 v: T,
7404 ) -> Self {
7405 self.profile = std::option::Option::Some(
7406 crate::model::connection_profile::Profile::GcsProfile(v.into()),
7407 );
7408 self
7409 }
7410
7411 /// The value of [profile][crate::model::ConnectionProfile::profile]
7412 /// if it holds a `MysqlProfile`, `None` if the field is not set or
7413 /// holds a different branch.
7414 pub fn mysql_profile(
7415 &self,
7416 ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlProfile>> {
7417 #[allow(unreachable_patterns)]
7418 self.profile.as_ref().and_then(|v| match v {
7419 crate::model::connection_profile::Profile::MysqlProfile(v) => {
7420 std::option::Option::Some(v)
7421 }
7422 _ => std::option::Option::None,
7423 })
7424 }
7425
7426 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7427 /// to hold a `MysqlProfile`.
7428 ///
7429 /// Note that all the setters affecting `profile` are
7430 /// mutually exclusive.
7431 ///
7432 /// # Example
7433 /// ```ignore,no_run
7434 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7435 /// use google_cloud_datastream_v1::model::MysqlProfile;
7436 /// let x = ConnectionProfile::new().set_mysql_profile(MysqlProfile::default()/* use setters */);
7437 /// assert!(x.mysql_profile().is_some());
7438 /// assert!(x.oracle_profile().is_none());
7439 /// assert!(x.gcs_profile().is_none());
7440 /// assert!(x.bigquery_profile().is_none());
7441 /// assert!(x.postgresql_profile().is_none());
7442 /// assert!(x.sql_server_profile().is_none());
7443 /// assert!(x.salesforce_profile().is_none());
7444 /// assert!(x.mongodb_profile().is_none());
7445 /// ```
7446 pub fn set_mysql_profile<T: std::convert::Into<std::boxed::Box<crate::model::MysqlProfile>>>(
7447 mut self,
7448 v: T,
7449 ) -> Self {
7450 self.profile = std::option::Option::Some(
7451 crate::model::connection_profile::Profile::MysqlProfile(v.into()),
7452 );
7453 self
7454 }
7455
7456 /// The value of [profile][crate::model::ConnectionProfile::profile]
7457 /// if it holds a `BigqueryProfile`, `None` if the field is not set or
7458 /// holds a different branch.
7459 pub fn bigquery_profile(
7460 &self,
7461 ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryProfile>> {
7462 #[allow(unreachable_patterns)]
7463 self.profile.as_ref().and_then(|v| match v {
7464 crate::model::connection_profile::Profile::BigqueryProfile(v) => {
7465 std::option::Option::Some(v)
7466 }
7467 _ => std::option::Option::None,
7468 })
7469 }
7470
7471 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7472 /// to hold a `BigqueryProfile`.
7473 ///
7474 /// Note that all the setters affecting `profile` are
7475 /// mutually exclusive.
7476 ///
7477 /// # Example
7478 /// ```ignore,no_run
7479 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7480 /// use google_cloud_datastream_v1::model::BigQueryProfile;
7481 /// let x = ConnectionProfile::new().set_bigquery_profile(BigQueryProfile::default()/* use setters */);
7482 /// assert!(x.bigquery_profile().is_some());
7483 /// assert!(x.oracle_profile().is_none());
7484 /// assert!(x.gcs_profile().is_none());
7485 /// assert!(x.mysql_profile().is_none());
7486 /// assert!(x.postgresql_profile().is_none());
7487 /// assert!(x.sql_server_profile().is_none());
7488 /// assert!(x.salesforce_profile().is_none());
7489 /// assert!(x.mongodb_profile().is_none());
7490 /// ```
7491 pub fn set_bigquery_profile<
7492 T: std::convert::Into<std::boxed::Box<crate::model::BigQueryProfile>>,
7493 >(
7494 mut self,
7495 v: T,
7496 ) -> Self {
7497 self.profile = std::option::Option::Some(
7498 crate::model::connection_profile::Profile::BigqueryProfile(v.into()),
7499 );
7500 self
7501 }
7502
7503 /// The value of [profile][crate::model::ConnectionProfile::profile]
7504 /// if it holds a `PostgresqlProfile`, `None` if the field is not set or
7505 /// holds a different branch.
7506 pub fn postgresql_profile(
7507 &self,
7508 ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlProfile>> {
7509 #[allow(unreachable_patterns)]
7510 self.profile.as_ref().and_then(|v| match v {
7511 crate::model::connection_profile::Profile::PostgresqlProfile(v) => {
7512 std::option::Option::Some(v)
7513 }
7514 _ => std::option::Option::None,
7515 })
7516 }
7517
7518 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7519 /// to hold a `PostgresqlProfile`.
7520 ///
7521 /// Note that all the setters affecting `profile` are
7522 /// mutually exclusive.
7523 ///
7524 /// # Example
7525 /// ```ignore,no_run
7526 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7527 /// use google_cloud_datastream_v1::model::PostgresqlProfile;
7528 /// let x = ConnectionProfile::new().set_postgresql_profile(PostgresqlProfile::default()/* use setters */);
7529 /// assert!(x.postgresql_profile().is_some());
7530 /// assert!(x.oracle_profile().is_none());
7531 /// assert!(x.gcs_profile().is_none());
7532 /// assert!(x.mysql_profile().is_none());
7533 /// assert!(x.bigquery_profile().is_none());
7534 /// assert!(x.sql_server_profile().is_none());
7535 /// assert!(x.salesforce_profile().is_none());
7536 /// assert!(x.mongodb_profile().is_none());
7537 /// ```
7538 pub fn set_postgresql_profile<
7539 T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlProfile>>,
7540 >(
7541 mut self,
7542 v: T,
7543 ) -> Self {
7544 self.profile = std::option::Option::Some(
7545 crate::model::connection_profile::Profile::PostgresqlProfile(v.into()),
7546 );
7547 self
7548 }
7549
7550 /// The value of [profile][crate::model::ConnectionProfile::profile]
7551 /// if it holds a `SqlServerProfile`, `None` if the field is not set or
7552 /// holds a different branch.
7553 pub fn sql_server_profile(
7554 &self,
7555 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerProfile>> {
7556 #[allow(unreachable_patterns)]
7557 self.profile.as_ref().and_then(|v| match v {
7558 crate::model::connection_profile::Profile::SqlServerProfile(v) => {
7559 std::option::Option::Some(v)
7560 }
7561 _ => std::option::Option::None,
7562 })
7563 }
7564
7565 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7566 /// to hold a `SqlServerProfile`.
7567 ///
7568 /// Note that all the setters affecting `profile` are
7569 /// mutually exclusive.
7570 ///
7571 /// # Example
7572 /// ```ignore,no_run
7573 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7574 /// use google_cloud_datastream_v1::model::SqlServerProfile;
7575 /// let x = ConnectionProfile::new().set_sql_server_profile(SqlServerProfile::default()/* use setters */);
7576 /// assert!(x.sql_server_profile().is_some());
7577 /// assert!(x.oracle_profile().is_none());
7578 /// assert!(x.gcs_profile().is_none());
7579 /// assert!(x.mysql_profile().is_none());
7580 /// assert!(x.bigquery_profile().is_none());
7581 /// assert!(x.postgresql_profile().is_none());
7582 /// assert!(x.salesforce_profile().is_none());
7583 /// assert!(x.mongodb_profile().is_none());
7584 /// ```
7585 pub fn set_sql_server_profile<
7586 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerProfile>>,
7587 >(
7588 mut self,
7589 v: T,
7590 ) -> Self {
7591 self.profile = std::option::Option::Some(
7592 crate::model::connection_profile::Profile::SqlServerProfile(v.into()),
7593 );
7594 self
7595 }
7596
7597 /// The value of [profile][crate::model::ConnectionProfile::profile]
7598 /// if it holds a `SalesforceProfile`, `None` if the field is not set or
7599 /// holds a different branch.
7600 pub fn salesforce_profile(
7601 &self,
7602 ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceProfile>> {
7603 #[allow(unreachable_patterns)]
7604 self.profile.as_ref().and_then(|v| match v {
7605 crate::model::connection_profile::Profile::SalesforceProfile(v) => {
7606 std::option::Option::Some(v)
7607 }
7608 _ => std::option::Option::None,
7609 })
7610 }
7611
7612 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7613 /// to hold a `SalesforceProfile`.
7614 ///
7615 /// Note that all the setters affecting `profile` are
7616 /// mutually exclusive.
7617 ///
7618 /// # Example
7619 /// ```ignore,no_run
7620 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7621 /// use google_cloud_datastream_v1::model::SalesforceProfile;
7622 /// let x = ConnectionProfile::new().set_salesforce_profile(SalesforceProfile::default()/* use setters */);
7623 /// assert!(x.salesforce_profile().is_some());
7624 /// assert!(x.oracle_profile().is_none());
7625 /// assert!(x.gcs_profile().is_none());
7626 /// assert!(x.mysql_profile().is_none());
7627 /// assert!(x.bigquery_profile().is_none());
7628 /// assert!(x.postgresql_profile().is_none());
7629 /// assert!(x.sql_server_profile().is_none());
7630 /// assert!(x.mongodb_profile().is_none());
7631 /// ```
7632 pub fn set_salesforce_profile<
7633 T: std::convert::Into<std::boxed::Box<crate::model::SalesforceProfile>>,
7634 >(
7635 mut self,
7636 v: T,
7637 ) -> Self {
7638 self.profile = std::option::Option::Some(
7639 crate::model::connection_profile::Profile::SalesforceProfile(v.into()),
7640 );
7641 self
7642 }
7643
7644 /// The value of [profile][crate::model::ConnectionProfile::profile]
7645 /// if it holds a `MongodbProfile`, `None` if the field is not set or
7646 /// holds a different branch.
7647 pub fn mongodb_profile(
7648 &self,
7649 ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbProfile>> {
7650 #[allow(unreachable_patterns)]
7651 self.profile.as_ref().and_then(|v| match v {
7652 crate::model::connection_profile::Profile::MongodbProfile(v) => {
7653 std::option::Option::Some(v)
7654 }
7655 _ => std::option::Option::None,
7656 })
7657 }
7658
7659 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7660 /// to hold a `MongodbProfile`.
7661 ///
7662 /// Note that all the setters affecting `profile` are
7663 /// mutually exclusive.
7664 ///
7665 /// # Example
7666 /// ```ignore,no_run
7667 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7668 /// use google_cloud_datastream_v1::model::MongodbProfile;
7669 /// let x = ConnectionProfile::new().set_mongodb_profile(MongodbProfile::default()/* use setters */);
7670 /// assert!(x.mongodb_profile().is_some());
7671 /// assert!(x.oracle_profile().is_none());
7672 /// assert!(x.gcs_profile().is_none());
7673 /// assert!(x.mysql_profile().is_none());
7674 /// assert!(x.bigquery_profile().is_none());
7675 /// assert!(x.postgresql_profile().is_none());
7676 /// assert!(x.sql_server_profile().is_none());
7677 /// assert!(x.salesforce_profile().is_none());
7678 /// ```
7679 pub fn set_mongodb_profile<
7680 T: std::convert::Into<std::boxed::Box<crate::model::MongodbProfile>>,
7681 >(
7682 mut self,
7683 v: T,
7684 ) -> Self {
7685 self.profile = std::option::Option::Some(
7686 crate::model::connection_profile::Profile::MongodbProfile(v.into()),
7687 );
7688 self
7689 }
7690
7691 /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity].
7692 ///
7693 /// Note that all the setters affecting `connectivity` are mutually
7694 /// exclusive.
7695 ///
7696 /// # Example
7697 /// ```ignore,no_run
7698 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7699 /// use google_cloud_datastream_v1::model::StaticServiceIpConnectivity;
7700 /// let x = ConnectionProfile::new().set_connectivity(Some(
7701 /// google_cloud_datastream_v1::model::connection_profile::Connectivity::StaticServiceIpConnectivity(StaticServiceIpConnectivity::default().into())));
7702 /// ```
7703 pub fn set_connectivity<
7704 T: std::convert::Into<std::option::Option<crate::model::connection_profile::Connectivity>>,
7705 >(
7706 mut self,
7707 v: T,
7708 ) -> Self {
7709 self.connectivity = v.into();
7710 self
7711 }
7712
7713 /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
7714 /// if it holds a `StaticServiceIpConnectivity`, `None` if the field is not set or
7715 /// holds a different branch.
7716 pub fn static_service_ip_connectivity(
7717 &self,
7718 ) -> std::option::Option<&std::boxed::Box<crate::model::StaticServiceIpConnectivity>> {
7719 #[allow(unreachable_patterns)]
7720 self.connectivity.as_ref().and_then(|v| match v {
7721 crate::model::connection_profile::Connectivity::StaticServiceIpConnectivity(v) => {
7722 std::option::Option::Some(v)
7723 }
7724 _ => std::option::Option::None,
7725 })
7726 }
7727
7728 /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
7729 /// to hold a `StaticServiceIpConnectivity`.
7730 ///
7731 /// Note that all the setters affecting `connectivity` are
7732 /// mutually exclusive.
7733 ///
7734 /// # Example
7735 /// ```ignore,no_run
7736 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7737 /// use google_cloud_datastream_v1::model::StaticServiceIpConnectivity;
7738 /// let x = ConnectionProfile::new().set_static_service_ip_connectivity(StaticServiceIpConnectivity::default()/* use setters */);
7739 /// assert!(x.static_service_ip_connectivity().is_some());
7740 /// assert!(x.forward_ssh_connectivity().is_none());
7741 /// assert!(x.private_connectivity().is_none());
7742 /// ```
7743 pub fn set_static_service_ip_connectivity<
7744 T: std::convert::Into<std::boxed::Box<crate::model::StaticServiceIpConnectivity>>,
7745 >(
7746 mut self,
7747 v: T,
7748 ) -> Self {
7749 self.connectivity = std::option::Option::Some(
7750 crate::model::connection_profile::Connectivity::StaticServiceIpConnectivity(v.into()),
7751 );
7752 self
7753 }
7754
7755 /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
7756 /// if it holds a `ForwardSshConnectivity`, `None` if the field is not set or
7757 /// holds a different branch.
7758 pub fn forward_ssh_connectivity(
7759 &self,
7760 ) -> std::option::Option<&std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>> {
7761 #[allow(unreachable_patterns)]
7762 self.connectivity.as_ref().and_then(|v| match v {
7763 crate::model::connection_profile::Connectivity::ForwardSshConnectivity(v) => {
7764 std::option::Option::Some(v)
7765 }
7766 _ => std::option::Option::None,
7767 })
7768 }
7769
7770 /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
7771 /// to hold a `ForwardSshConnectivity`.
7772 ///
7773 /// Note that all the setters affecting `connectivity` are
7774 /// mutually exclusive.
7775 ///
7776 /// # Example
7777 /// ```ignore,no_run
7778 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7779 /// use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
7780 /// let x = ConnectionProfile::new().set_forward_ssh_connectivity(ForwardSshTunnelConnectivity::default()/* use setters */);
7781 /// assert!(x.forward_ssh_connectivity().is_some());
7782 /// assert!(x.static_service_ip_connectivity().is_none());
7783 /// assert!(x.private_connectivity().is_none());
7784 /// ```
7785 pub fn set_forward_ssh_connectivity<
7786 T: std::convert::Into<std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>>,
7787 >(
7788 mut self,
7789 v: T,
7790 ) -> Self {
7791 self.connectivity = std::option::Option::Some(
7792 crate::model::connection_profile::Connectivity::ForwardSshConnectivity(v.into()),
7793 );
7794 self
7795 }
7796
7797 /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
7798 /// if it holds a `PrivateConnectivity`, `None` if the field is not set or
7799 /// holds a different branch.
7800 pub fn private_connectivity(
7801 &self,
7802 ) -> std::option::Option<&std::boxed::Box<crate::model::PrivateConnectivity>> {
7803 #[allow(unreachable_patterns)]
7804 self.connectivity.as_ref().and_then(|v| match v {
7805 crate::model::connection_profile::Connectivity::PrivateConnectivity(v) => {
7806 std::option::Option::Some(v)
7807 }
7808 _ => std::option::Option::None,
7809 })
7810 }
7811
7812 /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
7813 /// to hold a `PrivateConnectivity`.
7814 ///
7815 /// Note that all the setters affecting `connectivity` are
7816 /// mutually exclusive.
7817 ///
7818 /// # Example
7819 /// ```ignore,no_run
7820 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7821 /// use google_cloud_datastream_v1::model::PrivateConnectivity;
7822 /// let x = ConnectionProfile::new().set_private_connectivity(PrivateConnectivity::default()/* use setters */);
7823 /// assert!(x.private_connectivity().is_some());
7824 /// assert!(x.static_service_ip_connectivity().is_none());
7825 /// assert!(x.forward_ssh_connectivity().is_none());
7826 /// ```
7827 pub fn set_private_connectivity<
7828 T: std::convert::Into<std::boxed::Box<crate::model::PrivateConnectivity>>,
7829 >(
7830 mut self,
7831 v: T,
7832 ) -> Self {
7833 self.connectivity = std::option::Option::Some(
7834 crate::model::connection_profile::Connectivity::PrivateConnectivity(v.into()),
7835 );
7836 self
7837 }
7838}
7839
7840impl wkt::message::Message for ConnectionProfile {
7841 fn typename() -> &'static str {
7842 "type.googleapis.com/google.cloud.datastream.v1.ConnectionProfile"
7843 }
7844}
7845
7846/// Defines additional types related to [ConnectionProfile].
7847pub mod connection_profile {
7848 #[allow(unused_imports)]
7849 use super::*;
7850
7851 /// Connection configuration for the ConnectionProfile.
7852 #[derive(Clone, Debug, PartialEq)]
7853 #[non_exhaustive]
7854 pub enum Profile {
7855 /// Oracle ConnectionProfile configuration.
7856 OracleProfile(std::boxed::Box<crate::model::OracleProfile>),
7857 /// Cloud Storage ConnectionProfile configuration.
7858 GcsProfile(std::boxed::Box<crate::model::GcsProfile>),
7859 /// MySQL ConnectionProfile configuration.
7860 MysqlProfile(std::boxed::Box<crate::model::MysqlProfile>),
7861 /// BigQuery Connection Profile configuration.
7862 BigqueryProfile(std::boxed::Box<crate::model::BigQueryProfile>),
7863 /// PostgreSQL Connection Profile configuration.
7864 PostgresqlProfile(std::boxed::Box<crate::model::PostgresqlProfile>),
7865 /// SQLServer Connection Profile configuration.
7866 SqlServerProfile(std::boxed::Box<crate::model::SqlServerProfile>),
7867 /// Salesforce Connection Profile configuration.
7868 SalesforceProfile(std::boxed::Box<crate::model::SalesforceProfile>),
7869 /// MongoDB Connection Profile configuration.
7870 MongodbProfile(std::boxed::Box<crate::model::MongodbProfile>),
7871 }
7872
7873 /// Connectivity options used to establish a connection to the profile.
7874 #[derive(Clone, Debug, PartialEq)]
7875 #[non_exhaustive]
7876 pub enum Connectivity {
7877 /// Static Service IP connectivity.
7878 StaticServiceIpConnectivity(std::boxed::Box<crate::model::StaticServiceIpConnectivity>),
7879 /// Forward SSH tunnel connectivity.
7880 ForwardSshConnectivity(std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>),
7881 /// Private connectivity.
7882 PrivateConnectivity(std::boxed::Box<crate::model::PrivateConnectivity>),
7883 }
7884}
7885
7886/// Oracle Column.
7887#[derive(Clone, Default, PartialEq)]
7888#[non_exhaustive]
7889pub struct OracleColumn {
7890 /// Column name.
7891 pub column: std::string::String,
7892
7893 /// The Oracle data type.
7894 pub data_type: std::string::String,
7895
7896 /// Column length.
7897 pub length: i32,
7898
7899 /// Column precision.
7900 pub precision: i32,
7901
7902 /// Column scale.
7903 pub scale: i32,
7904
7905 /// Column encoding.
7906 pub encoding: std::string::String,
7907
7908 /// Whether or not the column represents a primary key.
7909 pub primary_key: bool,
7910
7911 /// Whether or not the column can accept a null value.
7912 pub nullable: bool,
7913
7914 /// The ordinal position of the column in the table.
7915 pub ordinal_position: i32,
7916
7917 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7918}
7919
7920impl OracleColumn {
7921 pub fn new() -> Self {
7922 std::default::Default::default()
7923 }
7924
7925 /// Sets the value of [column][crate::model::OracleColumn::column].
7926 ///
7927 /// # Example
7928 /// ```ignore,no_run
7929 /// # use google_cloud_datastream_v1::model::OracleColumn;
7930 /// let x = OracleColumn::new().set_column("example");
7931 /// ```
7932 pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7933 self.column = v.into();
7934 self
7935 }
7936
7937 /// Sets the value of [data_type][crate::model::OracleColumn::data_type].
7938 ///
7939 /// # Example
7940 /// ```ignore,no_run
7941 /// # use google_cloud_datastream_v1::model::OracleColumn;
7942 /// let x = OracleColumn::new().set_data_type("example");
7943 /// ```
7944 pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7945 self.data_type = v.into();
7946 self
7947 }
7948
7949 /// Sets the value of [length][crate::model::OracleColumn::length].
7950 ///
7951 /// # Example
7952 /// ```ignore,no_run
7953 /// # use google_cloud_datastream_v1::model::OracleColumn;
7954 /// let x = OracleColumn::new().set_length(42);
7955 /// ```
7956 pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7957 self.length = v.into();
7958 self
7959 }
7960
7961 /// Sets the value of [precision][crate::model::OracleColumn::precision].
7962 ///
7963 /// # Example
7964 /// ```ignore,no_run
7965 /// # use google_cloud_datastream_v1::model::OracleColumn;
7966 /// let x = OracleColumn::new().set_precision(42);
7967 /// ```
7968 pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7969 self.precision = v.into();
7970 self
7971 }
7972
7973 /// Sets the value of [scale][crate::model::OracleColumn::scale].
7974 ///
7975 /// # Example
7976 /// ```ignore,no_run
7977 /// # use google_cloud_datastream_v1::model::OracleColumn;
7978 /// let x = OracleColumn::new().set_scale(42);
7979 /// ```
7980 pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7981 self.scale = v.into();
7982 self
7983 }
7984
7985 /// Sets the value of [encoding][crate::model::OracleColumn::encoding].
7986 ///
7987 /// # Example
7988 /// ```ignore,no_run
7989 /// # use google_cloud_datastream_v1::model::OracleColumn;
7990 /// let x = OracleColumn::new().set_encoding("example");
7991 /// ```
7992 pub fn set_encoding<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7993 self.encoding = v.into();
7994 self
7995 }
7996
7997 /// Sets the value of [primary_key][crate::model::OracleColumn::primary_key].
7998 ///
7999 /// # Example
8000 /// ```ignore,no_run
8001 /// # use google_cloud_datastream_v1::model::OracleColumn;
8002 /// let x = OracleColumn::new().set_primary_key(true);
8003 /// ```
8004 pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8005 self.primary_key = v.into();
8006 self
8007 }
8008
8009 /// Sets the value of [nullable][crate::model::OracleColumn::nullable].
8010 ///
8011 /// # Example
8012 /// ```ignore,no_run
8013 /// # use google_cloud_datastream_v1::model::OracleColumn;
8014 /// let x = OracleColumn::new().set_nullable(true);
8015 /// ```
8016 pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8017 self.nullable = v.into();
8018 self
8019 }
8020
8021 /// Sets the value of [ordinal_position][crate::model::OracleColumn::ordinal_position].
8022 ///
8023 /// # Example
8024 /// ```ignore,no_run
8025 /// # use google_cloud_datastream_v1::model::OracleColumn;
8026 /// let x = OracleColumn::new().set_ordinal_position(42);
8027 /// ```
8028 pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8029 self.ordinal_position = v.into();
8030 self
8031 }
8032}
8033
8034impl wkt::message::Message for OracleColumn {
8035 fn typename() -> &'static str {
8036 "type.googleapis.com/google.cloud.datastream.v1.OracleColumn"
8037 }
8038}
8039
8040/// Oracle table.
8041#[derive(Clone, Default, PartialEq)]
8042#[non_exhaustive]
8043pub struct OracleTable {
8044 /// Table name.
8045 pub table: std::string::String,
8046
8047 /// Oracle columns in the schema.
8048 /// When unspecified as part of include/exclude objects, includes/excludes
8049 /// everything.
8050 pub oracle_columns: std::vec::Vec<crate::model::OracleColumn>,
8051
8052 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8053}
8054
8055impl OracleTable {
8056 pub fn new() -> Self {
8057 std::default::Default::default()
8058 }
8059
8060 /// Sets the value of [table][crate::model::OracleTable::table].
8061 ///
8062 /// # Example
8063 /// ```ignore,no_run
8064 /// # use google_cloud_datastream_v1::model::OracleTable;
8065 /// let x = OracleTable::new().set_table("example");
8066 /// ```
8067 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8068 self.table = v.into();
8069 self
8070 }
8071
8072 /// Sets the value of [oracle_columns][crate::model::OracleTable::oracle_columns].
8073 ///
8074 /// # Example
8075 /// ```ignore,no_run
8076 /// # use google_cloud_datastream_v1::model::OracleTable;
8077 /// use google_cloud_datastream_v1::model::OracleColumn;
8078 /// let x = OracleTable::new()
8079 /// .set_oracle_columns([
8080 /// OracleColumn::default()/* use setters */,
8081 /// OracleColumn::default()/* use (different) setters */,
8082 /// ]);
8083 /// ```
8084 pub fn set_oracle_columns<T, V>(mut self, v: T) -> Self
8085 where
8086 T: std::iter::IntoIterator<Item = V>,
8087 V: std::convert::Into<crate::model::OracleColumn>,
8088 {
8089 use std::iter::Iterator;
8090 self.oracle_columns = v.into_iter().map(|i| i.into()).collect();
8091 self
8092 }
8093}
8094
8095impl wkt::message::Message for OracleTable {
8096 fn typename() -> &'static str {
8097 "type.googleapis.com/google.cloud.datastream.v1.OracleTable"
8098 }
8099}
8100
8101/// Oracle schema.
8102#[derive(Clone, Default, PartialEq)]
8103#[non_exhaustive]
8104pub struct OracleSchema {
8105 /// Schema name.
8106 pub schema: std::string::String,
8107
8108 /// Tables in the schema.
8109 pub oracle_tables: std::vec::Vec<crate::model::OracleTable>,
8110
8111 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8112}
8113
8114impl OracleSchema {
8115 pub fn new() -> Self {
8116 std::default::Default::default()
8117 }
8118
8119 /// Sets the value of [schema][crate::model::OracleSchema::schema].
8120 ///
8121 /// # Example
8122 /// ```ignore,no_run
8123 /// # use google_cloud_datastream_v1::model::OracleSchema;
8124 /// let x = OracleSchema::new().set_schema("example");
8125 /// ```
8126 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8127 self.schema = v.into();
8128 self
8129 }
8130
8131 /// Sets the value of [oracle_tables][crate::model::OracleSchema::oracle_tables].
8132 ///
8133 /// # Example
8134 /// ```ignore,no_run
8135 /// # use google_cloud_datastream_v1::model::OracleSchema;
8136 /// use google_cloud_datastream_v1::model::OracleTable;
8137 /// let x = OracleSchema::new()
8138 /// .set_oracle_tables([
8139 /// OracleTable::default()/* use setters */,
8140 /// OracleTable::default()/* use (different) setters */,
8141 /// ]);
8142 /// ```
8143 pub fn set_oracle_tables<T, V>(mut self, v: T) -> Self
8144 where
8145 T: std::iter::IntoIterator<Item = V>,
8146 V: std::convert::Into<crate::model::OracleTable>,
8147 {
8148 use std::iter::Iterator;
8149 self.oracle_tables = v.into_iter().map(|i| i.into()).collect();
8150 self
8151 }
8152}
8153
8154impl wkt::message::Message for OracleSchema {
8155 fn typename() -> &'static str {
8156 "type.googleapis.com/google.cloud.datastream.v1.OracleSchema"
8157 }
8158}
8159
8160/// Oracle database structure.
8161#[derive(Clone, Default, PartialEq)]
8162#[non_exhaustive]
8163pub struct OracleRdbms {
8164 /// Oracle schemas/databases in the database server.
8165 pub oracle_schemas: std::vec::Vec<crate::model::OracleSchema>,
8166
8167 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8168}
8169
8170impl OracleRdbms {
8171 pub fn new() -> Self {
8172 std::default::Default::default()
8173 }
8174
8175 /// Sets the value of [oracle_schemas][crate::model::OracleRdbms::oracle_schemas].
8176 ///
8177 /// # Example
8178 /// ```ignore,no_run
8179 /// # use google_cloud_datastream_v1::model::OracleRdbms;
8180 /// use google_cloud_datastream_v1::model::OracleSchema;
8181 /// let x = OracleRdbms::new()
8182 /// .set_oracle_schemas([
8183 /// OracleSchema::default()/* use setters */,
8184 /// OracleSchema::default()/* use (different) setters */,
8185 /// ]);
8186 /// ```
8187 pub fn set_oracle_schemas<T, V>(mut self, v: T) -> Self
8188 where
8189 T: std::iter::IntoIterator<Item = V>,
8190 V: std::convert::Into<crate::model::OracleSchema>,
8191 {
8192 use std::iter::Iterator;
8193 self.oracle_schemas = v.into_iter().map(|i| i.into()).collect();
8194 self
8195 }
8196}
8197
8198impl wkt::message::Message for OracleRdbms {
8199 fn typename() -> &'static str {
8200 "type.googleapis.com/google.cloud.datastream.v1.OracleRdbms"
8201 }
8202}
8203
8204/// Oracle data source configuration
8205#[derive(Clone, Default, PartialEq)]
8206#[non_exhaustive]
8207pub struct OracleSourceConfig {
8208 /// Oracle objects to include in the stream.
8209 pub include_objects: std::option::Option<crate::model::OracleRdbms>,
8210
8211 /// Oracle objects to exclude from the stream.
8212 pub exclude_objects: std::option::Option<crate::model::OracleRdbms>,
8213
8214 /// Maximum number of concurrent CDC tasks. The number should be non-negative.
8215 /// If not set (or set to 0), the system's default value is used.
8216 pub max_concurrent_cdc_tasks: i32,
8217
8218 /// Maximum number of concurrent backfill tasks. The number should be
8219 /// non-negative. If not set (or set to 0), the system's default value is used.
8220 pub max_concurrent_backfill_tasks: i32,
8221
8222 /// The configuration for handle Oracle large objects.
8223 pub large_objects_handling:
8224 std::option::Option<crate::model::oracle_source_config::LargeObjectsHandling>,
8225
8226 /// Configuration to select the CDC method.
8227 pub cdc_method: std::option::Option<crate::model::oracle_source_config::CdcMethod>,
8228
8229 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8230}
8231
8232impl OracleSourceConfig {
8233 pub fn new() -> Self {
8234 std::default::Default::default()
8235 }
8236
8237 /// Sets the value of [include_objects][crate::model::OracleSourceConfig::include_objects].
8238 ///
8239 /// # Example
8240 /// ```ignore,no_run
8241 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8242 /// use google_cloud_datastream_v1::model::OracleRdbms;
8243 /// let x = OracleSourceConfig::new().set_include_objects(OracleRdbms::default()/* use setters */);
8244 /// ```
8245 pub fn set_include_objects<T>(mut self, v: T) -> Self
8246 where
8247 T: std::convert::Into<crate::model::OracleRdbms>,
8248 {
8249 self.include_objects = std::option::Option::Some(v.into());
8250 self
8251 }
8252
8253 /// Sets or clears the value of [include_objects][crate::model::OracleSourceConfig::include_objects].
8254 ///
8255 /// # Example
8256 /// ```ignore,no_run
8257 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8258 /// use google_cloud_datastream_v1::model::OracleRdbms;
8259 /// let x = OracleSourceConfig::new().set_or_clear_include_objects(Some(OracleRdbms::default()/* use setters */));
8260 /// let x = OracleSourceConfig::new().set_or_clear_include_objects(None::<OracleRdbms>);
8261 /// ```
8262 pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
8263 where
8264 T: std::convert::Into<crate::model::OracleRdbms>,
8265 {
8266 self.include_objects = v.map(|x| x.into());
8267 self
8268 }
8269
8270 /// Sets the value of [exclude_objects][crate::model::OracleSourceConfig::exclude_objects].
8271 ///
8272 /// # Example
8273 /// ```ignore,no_run
8274 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8275 /// use google_cloud_datastream_v1::model::OracleRdbms;
8276 /// let x = OracleSourceConfig::new().set_exclude_objects(OracleRdbms::default()/* use setters */);
8277 /// ```
8278 pub fn set_exclude_objects<T>(mut self, v: T) -> Self
8279 where
8280 T: std::convert::Into<crate::model::OracleRdbms>,
8281 {
8282 self.exclude_objects = std::option::Option::Some(v.into());
8283 self
8284 }
8285
8286 /// Sets or clears the value of [exclude_objects][crate::model::OracleSourceConfig::exclude_objects].
8287 ///
8288 /// # Example
8289 /// ```ignore,no_run
8290 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8291 /// use google_cloud_datastream_v1::model::OracleRdbms;
8292 /// let x = OracleSourceConfig::new().set_or_clear_exclude_objects(Some(OracleRdbms::default()/* use setters */));
8293 /// let x = OracleSourceConfig::new().set_or_clear_exclude_objects(None::<OracleRdbms>);
8294 /// ```
8295 pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
8296 where
8297 T: std::convert::Into<crate::model::OracleRdbms>,
8298 {
8299 self.exclude_objects = v.map(|x| x.into());
8300 self
8301 }
8302
8303 /// Sets the value of [max_concurrent_cdc_tasks][crate::model::OracleSourceConfig::max_concurrent_cdc_tasks].
8304 ///
8305 /// # Example
8306 /// ```ignore,no_run
8307 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8308 /// let x = OracleSourceConfig::new().set_max_concurrent_cdc_tasks(42);
8309 /// ```
8310 pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8311 self.max_concurrent_cdc_tasks = v.into();
8312 self
8313 }
8314
8315 /// Sets the value of [max_concurrent_backfill_tasks][crate::model::OracleSourceConfig::max_concurrent_backfill_tasks].
8316 ///
8317 /// # Example
8318 /// ```ignore,no_run
8319 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8320 /// let x = OracleSourceConfig::new().set_max_concurrent_backfill_tasks(42);
8321 /// ```
8322 pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8323 self.max_concurrent_backfill_tasks = v.into();
8324 self
8325 }
8326
8327 /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling].
8328 ///
8329 /// Note that all the setters affecting `large_objects_handling` are mutually
8330 /// exclusive.
8331 ///
8332 /// # Example
8333 /// ```ignore,no_run
8334 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8335 /// use google_cloud_datastream_v1::model::oracle_source_config::DropLargeObjects;
8336 /// let x = OracleSourceConfig::new().set_large_objects_handling(Some(
8337 /// google_cloud_datastream_v1::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(DropLargeObjects::default().into())));
8338 /// ```
8339 pub fn set_large_objects_handling<
8340 T: std::convert::Into<
8341 std::option::Option<crate::model::oracle_source_config::LargeObjectsHandling>,
8342 >,
8343 >(
8344 mut self,
8345 v: T,
8346 ) -> Self {
8347 self.large_objects_handling = v.into();
8348 self
8349 }
8350
8351 /// The value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8352 /// if it holds a `DropLargeObjects`, `None` if the field is not set or
8353 /// holds a different branch.
8354 pub fn drop_large_objects(
8355 &self,
8356 ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>>
8357 {
8358 #[allow(unreachable_patterns)]
8359 self.large_objects_handling.as_ref().and_then(|v| match v {
8360 crate::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(v) => {
8361 std::option::Option::Some(v)
8362 }
8363 _ => std::option::Option::None,
8364 })
8365 }
8366
8367 /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8368 /// to hold a `DropLargeObjects`.
8369 ///
8370 /// Note that all the setters affecting `large_objects_handling` are
8371 /// mutually exclusive.
8372 ///
8373 /// # Example
8374 /// ```ignore,no_run
8375 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8376 /// use google_cloud_datastream_v1::model::oracle_source_config::DropLargeObjects;
8377 /// let x = OracleSourceConfig::new().set_drop_large_objects(DropLargeObjects::default()/* use setters */);
8378 /// assert!(x.drop_large_objects().is_some());
8379 /// assert!(x.stream_large_objects().is_none());
8380 /// ```
8381 pub fn set_drop_large_objects<
8382 T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>>,
8383 >(
8384 mut self,
8385 v: T,
8386 ) -> Self {
8387 self.large_objects_handling = std::option::Option::Some(
8388 crate::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(v.into()),
8389 );
8390 self
8391 }
8392
8393 /// The value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8394 /// if it holds a `StreamLargeObjects`, `None` if the field is not set or
8395 /// holds a different branch.
8396 pub fn stream_large_objects(
8397 &self,
8398 ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>>
8399 {
8400 #[allow(unreachable_patterns)]
8401 self.large_objects_handling.as_ref().and_then(|v| match v {
8402 crate::model::oracle_source_config::LargeObjectsHandling::StreamLargeObjects(v) => {
8403 std::option::Option::Some(v)
8404 }
8405 _ => std::option::Option::None,
8406 })
8407 }
8408
8409 /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8410 /// to hold a `StreamLargeObjects`.
8411 ///
8412 /// Note that all the setters affecting `large_objects_handling` are
8413 /// mutually exclusive.
8414 ///
8415 /// # Example
8416 /// ```ignore,no_run
8417 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8418 /// use google_cloud_datastream_v1::model::oracle_source_config::StreamLargeObjects;
8419 /// let x = OracleSourceConfig::new().set_stream_large_objects(StreamLargeObjects::default()/* use setters */);
8420 /// assert!(x.stream_large_objects().is_some());
8421 /// assert!(x.drop_large_objects().is_none());
8422 /// ```
8423 pub fn set_stream_large_objects<
8424 T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>>,
8425 >(
8426 mut self,
8427 v: T,
8428 ) -> Self {
8429 self.large_objects_handling = std::option::Option::Some(
8430 crate::model::oracle_source_config::LargeObjectsHandling::StreamLargeObjects(v.into()),
8431 );
8432 self
8433 }
8434
8435 /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method].
8436 ///
8437 /// Note that all the setters affecting `cdc_method` are mutually
8438 /// exclusive.
8439 ///
8440 /// # Example
8441 /// ```ignore,no_run
8442 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8443 /// use google_cloud_datastream_v1::model::oracle_source_config::LogMiner;
8444 /// let x = OracleSourceConfig::new().set_cdc_method(Some(
8445 /// google_cloud_datastream_v1::model::oracle_source_config::CdcMethod::LogMiner(LogMiner::default().into())));
8446 /// ```
8447 pub fn set_cdc_method<
8448 T: std::convert::Into<std::option::Option<crate::model::oracle_source_config::CdcMethod>>,
8449 >(
8450 mut self,
8451 v: T,
8452 ) -> Self {
8453 self.cdc_method = v.into();
8454 self
8455 }
8456
8457 /// The value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8458 /// if it holds a `LogMiner`, `None` if the field is not set or
8459 /// holds a different branch.
8460 pub fn log_miner(
8461 &self,
8462 ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::LogMiner>> {
8463 #[allow(unreachable_patterns)]
8464 self.cdc_method.as_ref().and_then(|v| match v {
8465 crate::model::oracle_source_config::CdcMethod::LogMiner(v) => {
8466 std::option::Option::Some(v)
8467 }
8468 _ => std::option::Option::None,
8469 })
8470 }
8471
8472 /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8473 /// to hold a `LogMiner`.
8474 ///
8475 /// Note that all the setters affecting `cdc_method` are
8476 /// mutually exclusive.
8477 ///
8478 /// # Example
8479 /// ```ignore,no_run
8480 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8481 /// use google_cloud_datastream_v1::model::oracle_source_config::LogMiner;
8482 /// let x = OracleSourceConfig::new().set_log_miner(LogMiner::default()/* use setters */);
8483 /// assert!(x.log_miner().is_some());
8484 /// assert!(x.binary_log_parser().is_none());
8485 /// ```
8486 pub fn set_log_miner<
8487 T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::LogMiner>>,
8488 >(
8489 mut self,
8490 v: T,
8491 ) -> Self {
8492 self.cdc_method = std::option::Option::Some(
8493 crate::model::oracle_source_config::CdcMethod::LogMiner(v.into()),
8494 );
8495 self
8496 }
8497
8498 /// The value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8499 /// if it holds a `BinaryLogParser`, `None` if the field is not set or
8500 /// holds a different branch.
8501 pub fn binary_log_parser(
8502 &self,
8503 ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>>
8504 {
8505 #[allow(unreachable_patterns)]
8506 self.cdc_method.as_ref().and_then(|v| match v {
8507 crate::model::oracle_source_config::CdcMethod::BinaryLogParser(v) => {
8508 std::option::Option::Some(v)
8509 }
8510 _ => std::option::Option::None,
8511 })
8512 }
8513
8514 /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8515 /// to hold a `BinaryLogParser`.
8516 ///
8517 /// Note that all the setters affecting `cdc_method` are
8518 /// mutually exclusive.
8519 ///
8520 /// # Example
8521 /// ```ignore,no_run
8522 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8523 /// use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8524 /// let x = OracleSourceConfig::new().set_binary_log_parser(BinaryLogParser::default()/* use setters */);
8525 /// assert!(x.binary_log_parser().is_some());
8526 /// assert!(x.log_miner().is_none());
8527 /// ```
8528 pub fn set_binary_log_parser<
8529 T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>>,
8530 >(
8531 mut self,
8532 v: T,
8533 ) -> Self {
8534 self.cdc_method = std::option::Option::Some(
8535 crate::model::oracle_source_config::CdcMethod::BinaryLogParser(v.into()),
8536 );
8537 self
8538 }
8539}
8540
8541impl wkt::message::Message for OracleSourceConfig {
8542 fn typename() -> &'static str {
8543 "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig"
8544 }
8545}
8546
8547/// Defines additional types related to [OracleSourceConfig].
8548pub mod oracle_source_config {
8549 #[allow(unused_imports)]
8550 use super::*;
8551
8552 /// Configuration to drop large object values.
8553 #[derive(Clone, Default, PartialEq)]
8554 #[non_exhaustive]
8555 pub struct DropLargeObjects {
8556 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8557 }
8558
8559 impl DropLargeObjects {
8560 pub fn new() -> Self {
8561 std::default::Default::default()
8562 }
8563 }
8564
8565 impl wkt::message::Message for DropLargeObjects {
8566 fn typename() -> &'static str {
8567 "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.DropLargeObjects"
8568 }
8569 }
8570
8571 /// Configuration to stream large object values.
8572 #[derive(Clone, Default, PartialEq)]
8573 #[non_exhaustive]
8574 pub struct StreamLargeObjects {
8575 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8576 }
8577
8578 impl StreamLargeObjects {
8579 pub fn new() -> Self {
8580 std::default::Default::default()
8581 }
8582 }
8583
8584 impl wkt::message::Message for StreamLargeObjects {
8585 fn typename() -> &'static str {
8586 "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.StreamLargeObjects"
8587 }
8588 }
8589
8590 /// Configuration to use LogMiner CDC method.
8591 #[derive(Clone, Default, PartialEq)]
8592 #[non_exhaustive]
8593 pub struct LogMiner {
8594 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8595 }
8596
8597 impl LogMiner {
8598 pub fn new() -> Self {
8599 std::default::Default::default()
8600 }
8601 }
8602
8603 impl wkt::message::Message for LogMiner {
8604 fn typename() -> &'static str {
8605 "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.LogMiner"
8606 }
8607 }
8608
8609 /// Configuration to use Binary Log Parser CDC technique.
8610 #[derive(Clone, Default, PartialEq)]
8611 #[non_exhaustive]
8612 pub struct BinaryLogParser {
8613 /// Configuration to specify how the log file should be accessed.
8614 pub log_file_access: std::option::Option<
8615 crate::model::oracle_source_config::binary_log_parser::LogFileAccess,
8616 >,
8617
8618 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8619 }
8620
8621 impl BinaryLogParser {
8622 pub fn new() -> Self {
8623 std::default::Default::default()
8624 }
8625
8626 /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access].
8627 ///
8628 /// Note that all the setters affecting `log_file_access` are mutually
8629 /// exclusive.
8630 ///
8631 /// # Example
8632 /// ```ignore,no_run
8633 /// # use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8634 /// use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess;
8635 /// let x = BinaryLogParser::new().set_log_file_access(Some(
8636 /// google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(OracleAsmLogFileAccess::default().into())));
8637 /// ```
8638 pub fn set_log_file_access<
8639 T: std::convert::Into<
8640 std::option::Option<
8641 crate::model::oracle_source_config::binary_log_parser::LogFileAccess,
8642 >,
8643 >,
8644 >(
8645 mut self,
8646 v: T,
8647 ) -> Self {
8648 self.log_file_access = v.into();
8649 self
8650 }
8651
8652 /// The value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8653 /// if it holds a `OracleAsmLogFileAccess`, `None` if the field is not set or
8654 /// holds a different branch.
8655 pub fn oracle_asm_log_file_access(
8656 &self,
8657 ) -> std::option::Option<
8658 &std::boxed::Box<
8659 crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess,
8660 >,
8661 > {
8662 #[allow(unreachable_patterns)]
8663 self.log_file_access.as_ref().and_then(|v| match v {
8664 crate::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(v) => std::option::Option::Some(v),
8665 _ => std::option::Option::None,
8666 })
8667 }
8668
8669 /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8670 /// to hold a `OracleAsmLogFileAccess`.
8671 ///
8672 /// Note that all the setters affecting `log_file_access` are
8673 /// mutually exclusive.
8674 ///
8675 /// # Example
8676 /// ```ignore,no_run
8677 /// # use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8678 /// use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess;
8679 /// let x = BinaryLogParser::new().set_oracle_asm_log_file_access(OracleAsmLogFileAccess::default()/* use setters */);
8680 /// assert!(x.oracle_asm_log_file_access().is_some());
8681 /// assert!(x.log_file_directories().is_none());
8682 /// ```
8683 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{
8684 self.log_file_access = std::option::Option::Some(
8685 crate::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(
8686 v.into()
8687 )
8688 );
8689 self
8690 }
8691
8692 /// The value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8693 /// if it holds a `LogFileDirectories`, `None` if the field is not set or
8694 /// holds a different branch.
8695 pub fn log_file_directories(
8696 &self,
8697 ) -> std::option::Option<
8698 &std::boxed::Box<
8699 crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
8700 >,
8701 > {
8702 #[allow(unreachable_patterns)]
8703 self.log_file_access.as_ref().and_then(|v| match v {
8704 crate::model::oracle_source_config::binary_log_parser::LogFileAccess::LogFileDirectories(v) => std::option::Option::Some(v),
8705 _ => std::option::Option::None,
8706 })
8707 }
8708
8709 /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8710 /// to hold a `LogFileDirectories`.
8711 ///
8712 /// Note that all the setters affecting `log_file_access` are
8713 /// mutually exclusive.
8714 ///
8715 /// # Example
8716 /// ```ignore,no_run
8717 /// # use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8718 /// use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileDirectories;
8719 /// let x = BinaryLogParser::new().set_log_file_directories(LogFileDirectories::default()/* use setters */);
8720 /// assert!(x.log_file_directories().is_some());
8721 /// assert!(x.oracle_asm_log_file_access().is_none());
8722 /// ```
8723 pub fn set_log_file_directories<
8724 T: std::convert::Into<
8725 std::boxed::Box<
8726 crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
8727 >,
8728 >,
8729 >(
8730 mut self,
8731 v: T,
8732 ) -> Self {
8733 self.log_file_access = std::option::Option::Some(
8734 crate::model::oracle_source_config::binary_log_parser::LogFileAccess::LogFileDirectories(
8735 v.into()
8736 )
8737 );
8738 self
8739 }
8740 }
8741
8742 impl wkt::message::Message for BinaryLogParser {
8743 fn typename() -> &'static str {
8744 "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser"
8745 }
8746 }
8747
8748 /// Defines additional types related to [BinaryLogParser].
8749 pub mod binary_log_parser {
8750 #[allow(unused_imports)]
8751 use super::*;
8752
8753 /// Configuration to use Oracle ASM to access the log files.
8754 #[derive(Clone, Default, PartialEq)]
8755 #[non_exhaustive]
8756 pub struct OracleAsmLogFileAccess {
8757 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8758 }
8759
8760 impl OracleAsmLogFileAccess {
8761 pub fn new() -> Self {
8762 std::default::Default::default()
8763 }
8764 }
8765
8766 impl wkt::message::Message for OracleAsmLogFileAccess {
8767 fn typename() -> &'static str {
8768 "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser.OracleAsmLogFileAccess"
8769 }
8770 }
8771
8772 /// Configuration to specify the Oracle directories to access the log files.
8773 #[derive(Clone, Default, PartialEq)]
8774 #[non_exhaustive]
8775 pub struct LogFileDirectories {
8776 /// Required. Oracle directory for online logs.
8777 pub online_log_directory: std::string::String,
8778
8779 /// Required. Oracle directory for archived logs.
8780 pub archived_log_directory: std::string::String,
8781
8782 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8783 }
8784
8785 impl LogFileDirectories {
8786 pub fn new() -> Self {
8787 std::default::Default::default()
8788 }
8789
8790 /// Sets the value of [online_log_directory][crate::model::oracle_source_config::binary_log_parser::LogFileDirectories::online_log_directory].
8791 ///
8792 /// # Example
8793 /// ```ignore,no_run
8794 /// # use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileDirectories;
8795 /// let x = LogFileDirectories::new().set_online_log_directory("example");
8796 /// ```
8797 pub fn set_online_log_directory<T: std::convert::Into<std::string::String>>(
8798 mut self,
8799 v: T,
8800 ) -> Self {
8801 self.online_log_directory = v.into();
8802 self
8803 }
8804
8805 /// Sets the value of [archived_log_directory][crate::model::oracle_source_config::binary_log_parser::LogFileDirectories::archived_log_directory].
8806 ///
8807 /// # Example
8808 /// ```ignore,no_run
8809 /// # use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileDirectories;
8810 /// let x = LogFileDirectories::new().set_archived_log_directory("example");
8811 /// ```
8812 pub fn set_archived_log_directory<T: std::convert::Into<std::string::String>>(
8813 mut self,
8814 v: T,
8815 ) -> Self {
8816 self.archived_log_directory = v.into();
8817 self
8818 }
8819 }
8820
8821 impl wkt::message::Message for LogFileDirectories {
8822 fn typename() -> &'static str {
8823 "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser.LogFileDirectories"
8824 }
8825 }
8826
8827 /// Configuration to specify how the log file should be accessed.
8828 #[derive(Clone, Debug, PartialEq)]
8829 #[non_exhaustive]
8830 pub enum LogFileAccess {
8831 /// Use Oracle ASM.
8832 OracleAsmLogFileAccess(
8833 std::boxed::Box<
8834 crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess,
8835 >,
8836 ),
8837 /// Use Oracle directories.
8838 LogFileDirectories(
8839 std::boxed::Box<
8840 crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
8841 >,
8842 ),
8843 }
8844 }
8845
8846 /// The configuration for handle Oracle large objects.
8847 #[derive(Clone, Debug, PartialEq)]
8848 #[non_exhaustive]
8849 pub enum LargeObjectsHandling {
8850 /// Drop large object values.
8851 DropLargeObjects(std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>),
8852 /// Stream large object values.
8853 StreamLargeObjects(std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>),
8854 }
8855
8856 /// Configuration to select the CDC method.
8857 #[derive(Clone, Debug, PartialEq)]
8858 #[non_exhaustive]
8859 pub enum CdcMethod {
8860 /// Use LogMiner.
8861 LogMiner(std::boxed::Box<crate::model::oracle_source_config::LogMiner>),
8862 /// Use Binary Log Parser.
8863 BinaryLogParser(std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>),
8864 }
8865}
8866
8867/// PostgreSQL Column.
8868#[derive(Clone, Default, PartialEq)]
8869#[non_exhaustive]
8870pub struct PostgresqlColumn {
8871 /// Column name.
8872 pub column: std::string::String,
8873
8874 /// The PostgreSQL data type.
8875 pub data_type: std::string::String,
8876
8877 /// Column length.
8878 pub length: i32,
8879
8880 /// Column precision.
8881 pub precision: i32,
8882
8883 /// Column scale.
8884 pub scale: i32,
8885
8886 /// Whether or not the column represents a primary key.
8887 pub primary_key: bool,
8888
8889 /// Whether or not the column can accept a null value.
8890 pub nullable: bool,
8891
8892 /// The ordinal position of the column in the table.
8893 pub ordinal_position: i32,
8894
8895 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8896}
8897
8898impl PostgresqlColumn {
8899 pub fn new() -> Self {
8900 std::default::Default::default()
8901 }
8902
8903 /// Sets the value of [column][crate::model::PostgresqlColumn::column].
8904 ///
8905 /// # Example
8906 /// ```ignore,no_run
8907 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8908 /// let x = PostgresqlColumn::new().set_column("example");
8909 /// ```
8910 pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8911 self.column = v.into();
8912 self
8913 }
8914
8915 /// Sets the value of [data_type][crate::model::PostgresqlColumn::data_type].
8916 ///
8917 /// # Example
8918 /// ```ignore,no_run
8919 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8920 /// let x = PostgresqlColumn::new().set_data_type("example");
8921 /// ```
8922 pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8923 self.data_type = v.into();
8924 self
8925 }
8926
8927 /// Sets the value of [length][crate::model::PostgresqlColumn::length].
8928 ///
8929 /// # Example
8930 /// ```ignore,no_run
8931 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8932 /// let x = PostgresqlColumn::new().set_length(42);
8933 /// ```
8934 pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8935 self.length = v.into();
8936 self
8937 }
8938
8939 /// Sets the value of [precision][crate::model::PostgresqlColumn::precision].
8940 ///
8941 /// # Example
8942 /// ```ignore,no_run
8943 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8944 /// let x = PostgresqlColumn::new().set_precision(42);
8945 /// ```
8946 pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8947 self.precision = v.into();
8948 self
8949 }
8950
8951 /// Sets the value of [scale][crate::model::PostgresqlColumn::scale].
8952 ///
8953 /// # Example
8954 /// ```ignore,no_run
8955 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8956 /// let x = PostgresqlColumn::new().set_scale(42);
8957 /// ```
8958 pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8959 self.scale = v.into();
8960 self
8961 }
8962
8963 /// Sets the value of [primary_key][crate::model::PostgresqlColumn::primary_key].
8964 ///
8965 /// # Example
8966 /// ```ignore,no_run
8967 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8968 /// let x = PostgresqlColumn::new().set_primary_key(true);
8969 /// ```
8970 pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8971 self.primary_key = v.into();
8972 self
8973 }
8974
8975 /// Sets the value of [nullable][crate::model::PostgresqlColumn::nullable].
8976 ///
8977 /// # Example
8978 /// ```ignore,no_run
8979 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8980 /// let x = PostgresqlColumn::new().set_nullable(true);
8981 /// ```
8982 pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8983 self.nullable = v.into();
8984 self
8985 }
8986
8987 /// Sets the value of [ordinal_position][crate::model::PostgresqlColumn::ordinal_position].
8988 ///
8989 /// # Example
8990 /// ```ignore,no_run
8991 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
8992 /// let x = PostgresqlColumn::new().set_ordinal_position(42);
8993 /// ```
8994 pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8995 self.ordinal_position = v.into();
8996 self
8997 }
8998}
8999
9000impl wkt::message::Message for PostgresqlColumn {
9001 fn typename() -> &'static str {
9002 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlColumn"
9003 }
9004}
9005
9006/// PostgreSQL table.
9007#[derive(Clone, Default, PartialEq)]
9008#[non_exhaustive]
9009pub struct PostgresqlTable {
9010 /// Table name.
9011 pub table: std::string::String,
9012
9013 /// PostgreSQL columns in the schema.
9014 /// When unspecified as part of include/exclude objects,
9015 /// includes/excludes everything.
9016 pub postgresql_columns: std::vec::Vec<crate::model::PostgresqlColumn>,
9017
9018 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9019}
9020
9021impl PostgresqlTable {
9022 pub fn new() -> Self {
9023 std::default::Default::default()
9024 }
9025
9026 /// Sets the value of [table][crate::model::PostgresqlTable::table].
9027 ///
9028 /// # Example
9029 /// ```ignore,no_run
9030 /// # use google_cloud_datastream_v1::model::PostgresqlTable;
9031 /// let x = PostgresqlTable::new().set_table("example");
9032 /// ```
9033 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9034 self.table = v.into();
9035 self
9036 }
9037
9038 /// Sets the value of [postgresql_columns][crate::model::PostgresqlTable::postgresql_columns].
9039 ///
9040 /// # Example
9041 /// ```ignore,no_run
9042 /// # use google_cloud_datastream_v1::model::PostgresqlTable;
9043 /// use google_cloud_datastream_v1::model::PostgresqlColumn;
9044 /// let x = PostgresqlTable::new()
9045 /// .set_postgresql_columns([
9046 /// PostgresqlColumn::default()/* use setters */,
9047 /// PostgresqlColumn::default()/* use (different) setters */,
9048 /// ]);
9049 /// ```
9050 pub fn set_postgresql_columns<T, V>(mut self, v: T) -> Self
9051 where
9052 T: std::iter::IntoIterator<Item = V>,
9053 V: std::convert::Into<crate::model::PostgresqlColumn>,
9054 {
9055 use std::iter::Iterator;
9056 self.postgresql_columns = v.into_iter().map(|i| i.into()).collect();
9057 self
9058 }
9059}
9060
9061impl wkt::message::Message for PostgresqlTable {
9062 fn typename() -> &'static str {
9063 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlTable"
9064 }
9065}
9066
9067/// PostgreSQL schema.
9068#[derive(Clone, Default, PartialEq)]
9069#[non_exhaustive]
9070pub struct PostgresqlSchema {
9071 /// Schema name.
9072 pub schema: std::string::String,
9073
9074 /// Tables in the schema.
9075 pub postgresql_tables: std::vec::Vec<crate::model::PostgresqlTable>,
9076
9077 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9078}
9079
9080impl PostgresqlSchema {
9081 pub fn new() -> Self {
9082 std::default::Default::default()
9083 }
9084
9085 /// Sets the value of [schema][crate::model::PostgresqlSchema::schema].
9086 ///
9087 /// # Example
9088 /// ```ignore,no_run
9089 /// # use google_cloud_datastream_v1::model::PostgresqlSchema;
9090 /// let x = PostgresqlSchema::new().set_schema("example");
9091 /// ```
9092 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9093 self.schema = v.into();
9094 self
9095 }
9096
9097 /// Sets the value of [postgresql_tables][crate::model::PostgresqlSchema::postgresql_tables].
9098 ///
9099 /// # Example
9100 /// ```ignore,no_run
9101 /// # use google_cloud_datastream_v1::model::PostgresqlSchema;
9102 /// use google_cloud_datastream_v1::model::PostgresqlTable;
9103 /// let x = PostgresqlSchema::new()
9104 /// .set_postgresql_tables([
9105 /// PostgresqlTable::default()/* use setters */,
9106 /// PostgresqlTable::default()/* use (different) setters */,
9107 /// ]);
9108 /// ```
9109 pub fn set_postgresql_tables<T, V>(mut self, v: T) -> Self
9110 where
9111 T: std::iter::IntoIterator<Item = V>,
9112 V: std::convert::Into<crate::model::PostgresqlTable>,
9113 {
9114 use std::iter::Iterator;
9115 self.postgresql_tables = v.into_iter().map(|i| i.into()).collect();
9116 self
9117 }
9118}
9119
9120impl wkt::message::Message for PostgresqlSchema {
9121 fn typename() -> &'static str {
9122 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSchema"
9123 }
9124}
9125
9126/// PostgreSQL database structure.
9127#[derive(Clone, Default, PartialEq)]
9128#[non_exhaustive]
9129pub struct PostgresqlRdbms {
9130 /// PostgreSQL schemas in the database server.
9131 pub postgresql_schemas: std::vec::Vec<crate::model::PostgresqlSchema>,
9132
9133 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9134}
9135
9136impl PostgresqlRdbms {
9137 pub fn new() -> Self {
9138 std::default::Default::default()
9139 }
9140
9141 /// Sets the value of [postgresql_schemas][crate::model::PostgresqlRdbms::postgresql_schemas].
9142 ///
9143 /// # Example
9144 /// ```ignore,no_run
9145 /// # use google_cloud_datastream_v1::model::PostgresqlRdbms;
9146 /// use google_cloud_datastream_v1::model::PostgresqlSchema;
9147 /// let x = PostgresqlRdbms::new()
9148 /// .set_postgresql_schemas([
9149 /// PostgresqlSchema::default()/* use setters */,
9150 /// PostgresqlSchema::default()/* use (different) setters */,
9151 /// ]);
9152 /// ```
9153 pub fn set_postgresql_schemas<T, V>(mut self, v: T) -> Self
9154 where
9155 T: std::iter::IntoIterator<Item = V>,
9156 V: std::convert::Into<crate::model::PostgresqlSchema>,
9157 {
9158 use std::iter::Iterator;
9159 self.postgresql_schemas = v.into_iter().map(|i| i.into()).collect();
9160 self
9161 }
9162}
9163
9164impl wkt::message::Message for PostgresqlRdbms {
9165 fn typename() -> &'static str {
9166 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlRdbms"
9167 }
9168}
9169
9170/// PostgreSQL data source configuration
9171#[derive(Clone, Default, PartialEq)]
9172#[non_exhaustive]
9173pub struct PostgresqlSourceConfig {
9174 /// PostgreSQL objects to include in the stream.
9175 pub include_objects: std::option::Option<crate::model::PostgresqlRdbms>,
9176
9177 /// PostgreSQL objects to exclude from the stream.
9178 pub exclude_objects: std::option::Option<crate::model::PostgresqlRdbms>,
9179
9180 /// Required. Immutable. The name of the logical replication slot that's
9181 /// configured with the pgoutput plugin.
9182 pub replication_slot: std::string::String,
9183
9184 /// Required. The name of the publication that includes the set of all tables
9185 /// that are defined in the stream's include_objects.
9186 pub publication: std::string::String,
9187
9188 /// Maximum number of concurrent backfill tasks. The number should be non
9189 /// negative. If not set (or set to 0), the system's default value will be
9190 /// used.
9191 pub max_concurrent_backfill_tasks: i32,
9192
9193 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9194}
9195
9196impl PostgresqlSourceConfig {
9197 pub fn new() -> Self {
9198 std::default::Default::default()
9199 }
9200
9201 /// Sets the value of [include_objects][crate::model::PostgresqlSourceConfig::include_objects].
9202 ///
9203 /// # Example
9204 /// ```ignore,no_run
9205 /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9206 /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9207 /// let x = PostgresqlSourceConfig::new().set_include_objects(PostgresqlRdbms::default()/* use setters */);
9208 /// ```
9209 pub fn set_include_objects<T>(mut self, v: T) -> Self
9210 where
9211 T: std::convert::Into<crate::model::PostgresqlRdbms>,
9212 {
9213 self.include_objects = std::option::Option::Some(v.into());
9214 self
9215 }
9216
9217 /// Sets or clears the value of [include_objects][crate::model::PostgresqlSourceConfig::include_objects].
9218 ///
9219 /// # Example
9220 /// ```ignore,no_run
9221 /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9222 /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9223 /// let x = PostgresqlSourceConfig::new().set_or_clear_include_objects(Some(PostgresqlRdbms::default()/* use setters */));
9224 /// let x = PostgresqlSourceConfig::new().set_or_clear_include_objects(None::<PostgresqlRdbms>);
9225 /// ```
9226 pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
9227 where
9228 T: std::convert::Into<crate::model::PostgresqlRdbms>,
9229 {
9230 self.include_objects = v.map(|x| x.into());
9231 self
9232 }
9233
9234 /// Sets the value of [exclude_objects][crate::model::PostgresqlSourceConfig::exclude_objects].
9235 ///
9236 /// # Example
9237 /// ```ignore,no_run
9238 /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9239 /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9240 /// let x = PostgresqlSourceConfig::new().set_exclude_objects(PostgresqlRdbms::default()/* use setters */);
9241 /// ```
9242 pub fn set_exclude_objects<T>(mut self, v: T) -> Self
9243 where
9244 T: std::convert::Into<crate::model::PostgresqlRdbms>,
9245 {
9246 self.exclude_objects = std::option::Option::Some(v.into());
9247 self
9248 }
9249
9250 /// Sets or clears the value of [exclude_objects][crate::model::PostgresqlSourceConfig::exclude_objects].
9251 ///
9252 /// # Example
9253 /// ```ignore,no_run
9254 /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9255 /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9256 /// let x = PostgresqlSourceConfig::new().set_or_clear_exclude_objects(Some(PostgresqlRdbms::default()/* use setters */));
9257 /// let x = PostgresqlSourceConfig::new().set_or_clear_exclude_objects(None::<PostgresqlRdbms>);
9258 /// ```
9259 pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
9260 where
9261 T: std::convert::Into<crate::model::PostgresqlRdbms>,
9262 {
9263 self.exclude_objects = v.map(|x| x.into());
9264 self
9265 }
9266
9267 /// Sets the value of [replication_slot][crate::model::PostgresqlSourceConfig::replication_slot].
9268 ///
9269 /// # Example
9270 /// ```ignore,no_run
9271 /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9272 /// let x = PostgresqlSourceConfig::new().set_replication_slot("example");
9273 /// ```
9274 pub fn set_replication_slot<T: std::convert::Into<std::string::String>>(
9275 mut self,
9276 v: T,
9277 ) -> Self {
9278 self.replication_slot = v.into();
9279 self
9280 }
9281
9282 /// Sets the value of [publication][crate::model::PostgresqlSourceConfig::publication].
9283 ///
9284 /// # Example
9285 /// ```ignore,no_run
9286 /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9287 /// let x = PostgresqlSourceConfig::new().set_publication("example");
9288 /// ```
9289 pub fn set_publication<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9290 self.publication = v.into();
9291 self
9292 }
9293
9294 /// Sets the value of [max_concurrent_backfill_tasks][crate::model::PostgresqlSourceConfig::max_concurrent_backfill_tasks].
9295 ///
9296 /// # Example
9297 /// ```ignore,no_run
9298 /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9299 /// let x = PostgresqlSourceConfig::new().set_max_concurrent_backfill_tasks(42);
9300 /// ```
9301 pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9302 self.max_concurrent_backfill_tasks = v.into();
9303 self
9304 }
9305}
9306
9307impl wkt::message::Message for PostgresqlSourceConfig {
9308 fn typename() -> &'static str {
9309 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSourceConfig"
9310 }
9311}
9312
9313/// SQLServer Column.
9314#[derive(Clone, Default, PartialEq)]
9315#[non_exhaustive]
9316pub struct SqlServerColumn {
9317 /// Column name.
9318 pub column: std::string::String,
9319
9320 /// The SQLServer data type.
9321 pub data_type: std::string::String,
9322
9323 /// Column length.
9324 pub length: i32,
9325
9326 /// Column precision.
9327 pub precision: i32,
9328
9329 /// Column scale.
9330 pub scale: i32,
9331
9332 /// Whether or not the column represents a primary key.
9333 pub primary_key: bool,
9334
9335 /// Whether or not the column can accept a null value.
9336 pub nullable: bool,
9337
9338 /// The ordinal position of the column in the table.
9339 pub ordinal_position: i32,
9340
9341 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9342}
9343
9344impl SqlServerColumn {
9345 pub fn new() -> Self {
9346 std::default::Default::default()
9347 }
9348
9349 /// Sets the value of [column][crate::model::SqlServerColumn::column].
9350 ///
9351 /// # Example
9352 /// ```ignore,no_run
9353 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9354 /// let x = SqlServerColumn::new().set_column("example");
9355 /// ```
9356 pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9357 self.column = v.into();
9358 self
9359 }
9360
9361 /// Sets the value of [data_type][crate::model::SqlServerColumn::data_type].
9362 ///
9363 /// # Example
9364 /// ```ignore,no_run
9365 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9366 /// let x = SqlServerColumn::new().set_data_type("example");
9367 /// ```
9368 pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9369 self.data_type = v.into();
9370 self
9371 }
9372
9373 /// Sets the value of [length][crate::model::SqlServerColumn::length].
9374 ///
9375 /// # Example
9376 /// ```ignore,no_run
9377 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9378 /// let x = SqlServerColumn::new().set_length(42);
9379 /// ```
9380 pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9381 self.length = v.into();
9382 self
9383 }
9384
9385 /// Sets the value of [precision][crate::model::SqlServerColumn::precision].
9386 ///
9387 /// # Example
9388 /// ```ignore,no_run
9389 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9390 /// let x = SqlServerColumn::new().set_precision(42);
9391 /// ```
9392 pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9393 self.precision = v.into();
9394 self
9395 }
9396
9397 /// Sets the value of [scale][crate::model::SqlServerColumn::scale].
9398 ///
9399 /// # Example
9400 /// ```ignore,no_run
9401 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9402 /// let x = SqlServerColumn::new().set_scale(42);
9403 /// ```
9404 pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9405 self.scale = v.into();
9406 self
9407 }
9408
9409 /// Sets the value of [primary_key][crate::model::SqlServerColumn::primary_key].
9410 ///
9411 /// # Example
9412 /// ```ignore,no_run
9413 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9414 /// let x = SqlServerColumn::new().set_primary_key(true);
9415 /// ```
9416 pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9417 self.primary_key = v.into();
9418 self
9419 }
9420
9421 /// Sets the value of [nullable][crate::model::SqlServerColumn::nullable].
9422 ///
9423 /// # Example
9424 /// ```ignore,no_run
9425 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9426 /// let x = SqlServerColumn::new().set_nullable(true);
9427 /// ```
9428 pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9429 self.nullable = v.into();
9430 self
9431 }
9432
9433 /// Sets the value of [ordinal_position][crate::model::SqlServerColumn::ordinal_position].
9434 ///
9435 /// # Example
9436 /// ```ignore,no_run
9437 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9438 /// let x = SqlServerColumn::new().set_ordinal_position(42);
9439 /// ```
9440 pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9441 self.ordinal_position = v.into();
9442 self
9443 }
9444}
9445
9446impl wkt::message::Message for SqlServerColumn {
9447 fn typename() -> &'static str {
9448 "type.googleapis.com/google.cloud.datastream.v1.SqlServerColumn"
9449 }
9450}
9451
9452/// SQLServer table.
9453#[derive(Clone, Default, PartialEq)]
9454#[non_exhaustive]
9455pub struct SqlServerTable {
9456 /// Table name.
9457 pub table: std::string::String,
9458
9459 /// SQLServer columns in the schema.
9460 /// When unspecified as part of include/exclude objects,
9461 /// includes/excludes everything.
9462 pub columns: std::vec::Vec<crate::model::SqlServerColumn>,
9463
9464 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9465}
9466
9467impl SqlServerTable {
9468 pub fn new() -> Self {
9469 std::default::Default::default()
9470 }
9471
9472 /// Sets the value of [table][crate::model::SqlServerTable::table].
9473 ///
9474 /// # Example
9475 /// ```ignore,no_run
9476 /// # use google_cloud_datastream_v1::model::SqlServerTable;
9477 /// let x = SqlServerTable::new().set_table("example");
9478 /// ```
9479 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9480 self.table = v.into();
9481 self
9482 }
9483
9484 /// Sets the value of [columns][crate::model::SqlServerTable::columns].
9485 ///
9486 /// # Example
9487 /// ```ignore,no_run
9488 /// # use google_cloud_datastream_v1::model::SqlServerTable;
9489 /// use google_cloud_datastream_v1::model::SqlServerColumn;
9490 /// let x = SqlServerTable::new()
9491 /// .set_columns([
9492 /// SqlServerColumn::default()/* use setters */,
9493 /// SqlServerColumn::default()/* use (different) setters */,
9494 /// ]);
9495 /// ```
9496 pub fn set_columns<T, V>(mut self, v: T) -> Self
9497 where
9498 T: std::iter::IntoIterator<Item = V>,
9499 V: std::convert::Into<crate::model::SqlServerColumn>,
9500 {
9501 use std::iter::Iterator;
9502 self.columns = v.into_iter().map(|i| i.into()).collect();
9503 self
9504 }
9505}
9506
9507impl wkt::message::Message for SqlServerTable {
9508 fn typename() -> &'static str {
9509 "type.googleapis.com/google.cloud.datastream.v1.SqlServerTable"
9510 }
9511}
9512
9513/// SQLServer schema.
9514#[derive(Clone, Default, PartialEq)]
9515#[non_exhaustive]
9516pub struct SqlServerSchema {
9517 /// Schema name.
9518 pub schema: std::string::String,
9519
9520 /// Tables in the schema.
9521 pub tables: std::vec::Vec<crate::model::SqlServerTable>,
9522
9523 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9524}
9525
9526impl SqlServerSchema {
9527 pub fn new() -> Self {
9528 std::default::Default::default()
9529 }
9530
9531 /// Sets the value of [schema][crate::model::SqlServerSchema::schema].
9532 ///
9533 /// # Example
9534 /// ```ignore,no_run
9535 /// # use google_cloud_datastream_v1::model::SqlServerSchema;
9536 /// let x = SqlServerSchema::new().set_schema("example");
9537 /// ```
9538 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9539 self.schema = v.into();
9540 self
9541 }
9542
9543 /// Sets the value of [tables][crate::model::SqlServerSchema::tables].
9544 ///
9545 /// # Example
9546 /// ```ignore,no_run
9547 /// # use google_cloud_datastream_v1::model::SqlServerSchema;
9548 /// use google_cloud_datastream_v1::model::SqlServerTable;
9549 /// let x = SqlServerSchema::new()
9550 /// .set_tables([
9551 /// SqlServerTable::default()/* use setters */,
9552 /// SqlServerTable::default()/* use (different) setters */,
9553 /// ]);
9554 /// ```
9555 pub fn set_tables<T, V>(mut self, v: T) -> Self
9556 where
9557 T: std::iter::IntoIterator<Item = V>,
9558 V: std::convert::Into<crate::model::SqlServerTable>,
9559 {
9560 use std::iter::Iterator;
9561 self.tables = v.into_iter().map(|i| i.into()).collect();
9562 self
9563 }
9564}
9565
9566impl wkt::message::Message for SqlServerSchema {
9567 fn typename() -> &'static str {
9568 "type.googleapis.com/google.cloud.datastream.v1.SqlServerSchema"
9569 }
9570}
9571
9572/// SQLServer database structure.
9573#[derive(Clone, Default, PartialEq)]
9574#[non_exhaustive]
9575pub struct SqlServerRdbms {
9576 /// SQLServer schemas in the database server.
9577 pub schemas: std::vec::Vec<crate::model::SqlServerSchema>,
9578
9579 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9580}
9581
9582impl SqlServerRdbms {
9583 pub fn new() -> Self {
9584 std::default::Default::default()
9585 }
9586
9587 /// Sets the value of [schemas][crate::model::SqlServerRdbms::schemas].
9588 ///
9589 /// # Example
9590 /// ```ignore,no_run
9591 /// # use google_cloud_datastream_v1::model::SqlServerRdbms;
9592 /// use google_cloud_datastream_v1::model::SqlServerSchema;
9593 /// let x = SqlServerRdbms::new()
9594 /// .set_schemas([
9595 /// SqlServerSchema::default()/* use setters */,
9596 /// SqlServerSchema::default()/* use (different) setters */,
9597 /// ]);
9598 /// ```
9599 pub fn set_schemas<T, V>(mut self, v: T) -> Self
9600 where
9601 T: std::iter::IntoIterator<Item = V>,
9602 V: std::convert::Into<crate::model::SqlServerSchema>,
9603 {
9604 use std::iter::Iterator;
9605 self.schemas = v.into_iter().map(|i| i.into()).collect();
9606 self
9607 }
9608}
9609
9610impl wkt::message::Message for SqlServerRdbms {
9611 fn typename() -> &'static str {
9612 "type.googleapis.com/google.cloud.datastream.v1.SqlServerRdbms"
9613 }
9614}
9615
9616/// SQLServer data source configuration
9617#[derive(Clone, Default, PartialEq)]
9618#[non_exhaustive]
9619pub struct SqlServerSourceConfig {
9620 /// SQLServer objects to include in the stream.
9621 pub include_objects: std::option::Option<crate::model::SqlServerRdbms>,
9622
9623 /// SQLServer objects to exclude from the stream.
9624 pub exclude_objects: std::option::Option<crate::model::SqlServerRdbms>,
9625
9626 /// Max concurrent CDC tasks.
9627 pub max_concurrent_cdc_tasks: i32,
9628
9629 /// Max concurrent backfill tasks.
9630 pub max_concurrent_backfill_tasks: i32,
9631
9632 /// Configuration to select the CDC read method for the stream.
9633 pub cdc_method: std::option::Option<crate::model::sql_server_source_config::CdcMethod>,
9634
9635 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9636}
9637
9638impl SqlServerSourceConfig {
9639 pub fn new() -> Self {
9640 std::default::Default::default()
9641 }
9642
9643 /// Sets the value of [include_objects][crate::model::SqlServerSourceConfig::include_objects].
9644 ///
9645 /// # Example
9646 /// ```ignore,no_run
9647 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9648 /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9649 /// let x = SqlServerSourceConfig::new().set_include_objects(SqlServerRdbms::default()/* use setters */);
9650 /// ```
9651 pub fn set_include_objects<T>(mut self, v: T) -> Self
9652 where
9653 T: std::convert::Into<crate::model::SqlServerRdbms>,
9654 {
9655 self.include_objects = std::option::Option::Some(v.into());
9656 self
9657 }
9658
9659 /// Sets or clears the value of [include_objects][crate::model::SqlServerSourceConfig::include_objects].
9660 ///
9661 /// # Example
9662 /// ```ignore,no_run
9663 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9664 /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9665 /// let x = SqlServerSourceConfig::new().set_or_clear_include_objects(Some(SqlServerRdbms::default()/* use setters */));
9666 /// let x = SqlServerSourceConfig::new().set_or_clear_include_objects(None::<SqlServerRdbms>);
9667 /// ```
9668 pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
9669 where
9670 T: std::convert::Into<crate::model::SqlServerRdbms>,
9671 {
9672 self.include_objects = v.map(|x| x.into());
9673 self
9674 }
9675
9676 /// Sets the value of [exclude_objects][crate::model::SqlServerSourceConfig::exclude_objects].
9677 ///
9678 /// # Example
9679 /// ```ignore,no_run
9680 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9681 /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9682 /// let x = SqlServerSourceConfig::new().set_exclude_objects(SqlServerRdbms::default()/* use setters */);
9683 /// ```
9684 pub fn set_exclude_objects<T>(mut self, v: T) -> Self
9685 where
9686 T: std::convert::Into<crate::model::SqlServerRdbms>,
9687 {
9688 self.exclude_objects = std::option::Option::Some(v.into());
9689 self
9690 }
9691
9692 /// Sets or clears the value of [exclude_objects][crate::model::SqlServerSourceConfig::exclude_objects].
9693 ///
9694 /// # Example
9695 /// ```ignore,no_run
9696 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9697 /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9698 /// let x = SqlServerSourceConfig::new().set_or_clear_exclude_objects(Some(SqlServerRdbms::default()/* use setters */));
9699 /// let x = SqlServerSourceConfig::new().set_or_clear_exclude_objects(None::<SqlServerRdbms>);
9700 /// ```
9701 pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
9702 where
9703 T: std::convert::Into<crate::model::SqlServerRdbms>,
9704 {
9705 self.exclude_objects = v.map(|x| x.into());
9706 self
9707 }
9708
9709 /// Sets the value of [max_concurrent_cdc_tasks][crate::model::SqlServerSourceConfig::max_concurrent_cdc_tasks].
9710 ///
9711 /// # Example
9712 /// ```ignore,no_run
9713 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9714 /// let x = SqlServerSourceConfig::new().set_max_concurrent_cdc_tasks(42);
9715 /// ```
9716 pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9717 self.max_concurrent_cdc_tasks = v.into();
9718 self
9719 }
9720
9721 /// Sets the value of [max_concurrent_backfill_tasks][crate::model::SqlServerSourceConfig::max_concurrent_backfill_tasks].
9722 ///
9723 /// # Example
9724 /// ```ignore,no_run
9725 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9726 /// let x = SqlServerSourceConfig::new().set_max_concurrent_backfill_tasks(42);
9727 /// ```
9728 pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9729 self.max_concurrent_backfill_tasks = v.into();
9730 self
9731 }
9732
9733 /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method].
9734 ///
9735 /// Note that all the setters affecting `cdc_method` are mutually
9736 /// exclusive.
9737 ///
9738 /// # Example
9739 /// ```ignore,no_run
9740 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9741 /// use google_cloud_datastream_v1::model::SqlServerTransactionLogs;
9742 /// let x = SqlServerSourceConfig::new().set_cdc_method(Some(
9743 /// google_cloud_datastream_v1::model::sql_server_source_config::CdcMethod::TransactionLogs(SqlServerTransactionLogs::default().into())));
9744 /// ```
9745 pub fn set_cdc_method<
9746 T: std::convert::Into<std::option::Option<crate::model::sql_server_source_config::CdcMethod>>,
9747 >(
9748 mut self,
9749 v: T,
9750 ) -> Self {
9751 self.cdc_method = v.into();
9752 self
9753 }
9754
9755 /// The value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9756 /// if it holds a `TransactionLogs`, `None` if the field is not set or
9757 /// holds a different branch.
9758 pub fn transaction_logs(
9759 &self,
9760 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerTransactionLogs>> {
9761 #[allow(unreachable_patterns)]
9762 self.cdc_method.as_ref().and_then(|v| match v {
9763 crate::model::sql_server_source_config::CdcMethod::TransactionLogs(v) => {
9764 std::option::Option::Some(v)
9765 }
9766 _ => std::option::Option::None,
9767 })
9768 }
9769
9770 /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9771 /// to hold a `TransactionLogs`.
9772 ///
9773 /// Note that all the setters affecting `cdc_method` are
9774 /// mutually exclusive.
9775 ///
9776 /// # Example
9777 /// ```ignore,no_run
9778 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9779 /// use google_cloud_datastream_v1::model::SqlServerTransactionLogs;
9780 /// let x = SqlServerSourceConfig::new().set_transaction_logs(SqlServerTransactionLogs::default()/* use setters */);
9781 /// assert!(x.transaction_logs().is_some());
9782 /// assert!(x.change_tables().is_none());
9783 /// ```
9784 pub fn set_transaction_logs<
9785 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerTransactionLogs>>,
9786 >(
9787 mut self,
9788 v: T,
9789 ) -> Self {
9790 self.cdc_method = std::option::Option::Some(
9791 crate::model::sql_server_source_config::CdcMethod::TransactionLogs(v.into()),
9792 );
9793 self
9794 }
9795
9796 /// The value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9797 /// if it holds a `ChangeTables`, `None` if the field is not set or
9798 /// holds a different branch.
9799 pub fn change_tables(
9800 &self,
9801 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerChangeTables>> {
9802 #[allow(unreachable_patterns)]
9803 self.cdc_method.as_ref().and_then(|v| match v {
9804 crate::model::sql_server_source_config::CdcMethod::ChangeTables(v) => {
9805 std::option::Option::Some(v)
9806 }
9807 _ => std::option::Option::None,
9808 })
9809 }
9810
9811 /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9812 /// to hold a `ChangeTables`.
9813 ///
9814 /// Note that all the setters affecting `cdc_method` are
9815 /// mutually exclusive.
9816 ///
9817 /// # Example
9818 /// ```ignore,no_run
9819 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9820 /// use google_cloud_datastream_v1::model::SqlServerChangeTables;
9821 /// let x = SqlServerSourceConfig::new().set_change_tables(SqlServerChangeTables::default()/* use setters */);
9822 /// assert!(x.change_tables().is_some());
9823 /// assert!(x.transaction_logs().is_none());
9824 /// ```
9825 pub fn set_change_tables<
9826 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerChangeTables>>,
9827 >(
9828 mut self,
9829 v: T,
9830 ) -> Self {
9831 self.cdc_method = std::option::Option::Some(
9832 crate::model::sql_server_source_config::CdcMethod::ChangeTables(v.into()),
9833 );
9834 self
9835 }
9836}
9837
9838impl wkt::message::Message for SqlServerSourceConfig {
9839 fn typename() -> &'static str {
9840 "type.googleapis.com/google.cloud.datastream.v1.SqlServerSourceConfig"
9841 }
9842}
9843
9844/// Defines additional types related to [SqlServerSourceConfig].
9845pub mod sql_server_source_config {
9846 #[allow(unused_imports)]
9847 use super::*;
9848
9849 /// Configuration to select the CDC read method for the stream.
9850 #[derive(Clone, Debug, PartialEq)]
9851 #[non_exhaustive]
9852 pub enum CdcMethod {
9853 /// CDC reader reads from transaction logs.
9854 TransactionLogs(std::boxed::Box<crate::model::SqlServerTransactionLogs>),
9855 /// CDC reader reads from change tables.
9856 ChangeTables(std::boxed::Box<crate::model::SqlServerChangeTables>),
9857 }
9858}
9859
9860/// Configuration to use Transaction Logs CDC read method.
9861#[derive(Clone, Default, PartialEq)]
9862#[non_exhaustive]
9863pub struct SqlServerTransactionLogs {
9864 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9865}
9866
9867impl SqlServerTransactionLogs {
9868 pub fn new() -> Self {
9869 std::default::Default::default()
9870 }
9871}
9872
9873impl wkt::message::Message for SqlServerTransactionLogs {
9874 fn typename() -> &'static str {
9875 "type.googleapis.com/google.cloud.datastream.v1.SqlServerTransactionLogs"
9876 }
9877}
9878
9879/// Configuration to use Change Tables CDC read method.
9880#[derive(Clone, Default, PartialEq)]
9881#[non_exhaustive]
9882pub struct SqlServerChangeTables {
9883 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9884}
9885
9886impl SqlServerChangeTables {
9887 pub fn new() -> Self {
9888 std::default::Default::default()
9889 }
9890}
9891
9892impl wkt::message::Message for SqlServerChangeTables {
9893 fn typename() -> &'static str {
9894 "type.googleapis.com/google.cloud.datastream.v1.SqlServerChangeTables"
9895 }
9896}
9897
9898/// MySQL Column.
9899#[derive(Clone, Default, PartialEq)]
9900#[non_exhaustive]
9901pub struct MysqlColumn {
9902 /// Column name.
9903 pub column: std::string::String,
9904
9905 /// The MySQL data type. Full data types list can be found here:
9906 /// <https://dev.mysql.com/doc/refman/8.0/en/data-types.html>
9907 pub data_type: std::string::String,
9908
9909 /// Column length.
9910 pub length: i32,
9911
9912 /// Column collation.
9913 pub collation: std::string::String,
9914
9915 /// Whether or not the column represents a primary key.
9916 pub primary_key: bool,
9917
9918 /// Whether or not the column can accept a null value.
9919 pub nullable: bool,
9920
9921 /// The ordinal position of the column in the table.
9922 pub ordinal_position: i32,
9923
9924 /// Column precision.
9925 pub precision: i32,
9926
9927 /// Column scale.
9928 pub scale: i32,
9929
9930 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9931}
9932
9933impl MysqlColumn {
9934 pub fn new() -> Self {
9935 std::default::Default::default()
9936 }
9937
9938 /// Sets the value of [column][crate::model::MysqlColumn::column].
9939 ///
9940 /// # Example
9941 /// ```ignore,no_run
9942 /// # use google_cloud_datastream_v1::model::MysqlColumn;
9943 /// let x = MysqlColumn::new().set_column("example");
9944 /// ```
9945 pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9946 self.column = v.into();
9947 self
9948 }
9949
9950 /// Sets the value of [data_type][crate::model::MysqlColumn::data_type].
9951 ///
9952 /// # Example
9953 /// ```ignore,no_run
9954 /// # use google_cloud_datastream_v1::model::MysqlColumn;
9955 /// let x = MysqlColumn::new().set_data_type("example");
9956 /// ```
9957 pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9958 self.data_type = v.into();
9959 self
9960 }
9961
9962 /// Sets the value of [length][crate::model::MysqlColumn::length].
9963 ///
9964 /// # Example
9965 /// ```ignore,no_run
9966 /// # use google_cloud_datastream_v1::model::MysqlColumn;
9967 /// let x = MysqlColumn::new().set_length(42);
9968 /// ```
9969 pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9970 self.length = v.into();
9971 self
9972 }
9973
9974 /// Sets the value of [collation][crate::model::MysqlColumn::collation].
9975 ///
9976 /// # Example
9977 /// ```ignore,no_run
9978 /// # use google_cloud_datastream_v1::model::MysqlColumn;
9979 /// let x = MysqlColumn::new().set_collation("example");
9980 /// ```
9981 pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9982 self.collation = v.into();
9983 self
9984 }
9985
9986 /// Sets the value of [primary_key][crate::model::MysqlColumn::primary_key].
9987 ///
9988 /// # Example
9989 /// ```ignore,no_run
9990 /// # use google_cloud_datastream_v1::model::MysqlColumn;
9991 /// let x = MysqlColumn::new().set_primary_key(true);
9992 /// ```
9993 pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9994 self.primary_key = v.into();
9995 self
9996 }
9997
9998 /// Sets the value of [nullable][crate::model::MysqlColumn::nullable].
9999 ///
10000 /// # Example
10001 /// ```ignore,no_run
10002 /// # use google_cloud_datastream_v1::model::MysqlColumn;
10003 /// let x = MysqlColumn::new().set_nullable(true);
10004 /// ```
10005 pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10006 self.nullable = v.into();
10007 self
10008 }
10009
10010 /// Sets the value of [ordinal_position][crate::model::MysqlColumn::ordinal_position].
10011 ///
10012 /// # Example
10013 /// ```ignore,no_run
10014 /// # use google_cloud_datastream_v1::model::MysqlColumn;
10015 /// let x = MysqlColumn::new().set_ordinal_position(42);
10016 /// ```
10017 pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10018 self.ordinal_position = v.into();
10019 self
10020 }
10021
10022 /// Sets the value of [precision][crate::model::MysqlColumn::precision].
10023 ///
10024 /// # Example
10025 /// ```ignore,no_run
10026 /// # use google_cloud_datastream_v1::model::MysqlColumn;
10027 /// let x = MysqlColumn::new().set_precision(42);
10028 /// ```
10029 pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10030 self.precision = v.into();
10031 self
10032 }
10033
10034 /// Sets the value of [scale][crate::model::MysqlColumn::scale].
10035 ///
10036 /// # Example
10037 /// ```ignore,no_run
10038 /// # use google_cloud_datastream_v1::model::MysqlColumn;
10039 /// let x = MysqlColumn::new().set_scale(42);
10040 /// ```
10041 pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10042 self.scale = v.into();
10043 self
10044 }
10045}
10046
10047impl wkt::message::Message for MysqlColumn {
10048 fn typename() -> &'static str {
10049 "type.googleapis.com/google.cloud.datastream.v1.MysqlColumn"
10050 }
10051}
10052
10053/// MySQL table.
10054#[derive(Clone, Default, PartialEq)]
10055#[non_exhaustive]
10056pub struct MysqlTable {
10057 /// Table name.
10058 pub table: std::string::String,
10059
10060 /// MySQL columns in the database.
10061 /// When unspecified as part of include/exclude objects, includes/excludes
10062 /// everything.
10063 pub mysql_columns: std::vec::Vec<crate::model::MysqlColumn>,
10064
10065 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10066}
10067
10068impl MysqlTable {
10069 pub fn new() -> Self {
10070 std::default::Default::default()
10071 }
10072
10073 /// Sets the value of [table][crate::model::MysqlTable::table].
10074 ///
10075 /// # Example
10076 /// ```ignore,no_run
10077 /// # use google_cloud_datastream_v1::model::MysqlTable;
10078 /// let x = MysqlTable::new().set_table("example");
10079 /// ```
10080 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10081 self.table = v.into();
10082 self
10083 }
10084
10085 /// Sets the value of [mysql_columns][crate::model::MysqlTable::mysql_columns].
10086 ///
10087 /// # Example
10088 /// ```ignore,no_run
10089 /// # use google_cloud_datastream_v1::model::MysqlTable;
10090 /// use google_cloud_datastream_v1::model::MysqlColumn;
10091 /// let x = MysqlTable::new()
10092 /// .set_mysql_columns([
10093 /// MysqlColumn::default()/* use setters */,
10094 /// MysqlColumn::default()/* use (different) setters */,
10095 /// ]);
10096 /// ```
10097 pub fn set_mysql_columns<T, V>(mut self, v: T) -> Self
10098 where
10099 T: std::iter::IntoIterator<Item = V>,
10100 V: std::convert::Into<crate::model::MysqlColumn>,
10101 {
10102 use std::iter::Iterator;
10103 self.mysql_columns = v.into_iter().map(|i| i.into()).collect();
10104 self
10105 }
10106}
10107
10108impl wkt::message::Message for MysqlTable {
10109 fn typename() -> &'static str {
10110 "type.googleapis.com/google.cloud.datastream.v1.MysqlTable"
10111 }
10112}
10113
10114/// MySQL database.
10115#[derive(Clone, Default, PartialEq)]
10116#[non_exhaustive]
10117pub struct MysqlDatabase {
10118 /// Database name.
10119 pub database: std::string::String,
10120
10121 /// Tables in the database.
10122 pub mysql_tables: std::vec::Vec<crate::model::MysqlTable>,
10123
10124 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10125}
10126
10127impl MysqlDatabase {
10128 pub fn new() -> Self {
10129 std::default::Default::default()
10130 }
10131
10132 /// Sets the value of [database][crate::model::MysqlDatabase::database].
10133 ///
10134 /// # Example
10135 /// ```ignore,no_run
10136 /// # use google_cloud_datastream_v1::model::MysqlDatabase;
10137 /// let x = MysqlDatabase::new().set_database("example");
10138 /// ```
10139 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10140 self.database = v.into();
10141 self
10142 }
10143
10144 /// Sets the value of [mysql_tables][crate::model::MysqlDatabase::mysql_tables].
10145 ///
10146 /// # Example
10147 /// ```ignore,no_run
10148 /// # use google_cloud_datastream_v1::model::MysqlDatabase;
10149 /// use google_cloud_datastream_v1::model::MysqlTable;
10150 /// let x = MysqlDatabase::new()
10151 /// .set_mysql_tables([
10152 /// MysqlTable::default()/* use setters */,
10153 /// MysqlTable::default()/* use (different) setters */,
10154 /// ]);
10155 /// ```
10156 pub fn set_mysql_tables<T, V>(mut self, v: T) -> Self
10157 where
10158 T: std::iter::IntoIterator<Item = V>,
10159 V: std::convert::Into<crate::model::MysqlTable>,
10160 {
10161 use std::iter::Iterator;
10162 self.mysql_tables = v.into_iter().map(|i| i.into()).collect();
10163 self
10164 }
10165}
10166
10167impl wkt::message::Message for MysqlDatabase {
10168 fn typename() -> &'static str {
10169 "type.googleapis.com/google.cloud.datastream.v1.MysqlDatabase"
10170 }
10171}
10172
10173/// MySQL database structure
10174#[derive(Clone, Default, PartialEq)]
10175#[non_exhaustive]
10176pub struct MysqlRdbms {
10177 /// Mysql databases on the server
10178 pub mysql_databases: std::vec::Vec<crate::model::MysqlDatabase>,
10179
10180 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10181}
10182
10183impl MysqlRdbms {
10184 pub fn new() -> Self {
10185 std::default::Default::default()
10186 }
10187
10188 /// Sets the value of [mysql_databases][crate::model::MysqlRdbms::mysql_databases].
10189 ///
10190 /// # Example
10191 /// ```ignore,no_run
10192 /// # use google_cloud_datastream_v1::model::MysqlRdbms;
10193 /// use google_cloud_datastream_v1::model::MysqlDatabase;
10194 /// let x = MysqlRdbms::new()
10195 /// .set_mysql_databases([
10196 /// MysqlDatabase::default()/* use setters */,
10197 /// MysqlDatabase::default()/* use (different) setters */,
10198 /// ]);
10199 /// ```
10200 pub fn set_mysql_databases<T, V>(mut self, v: T) -> Self
10201 where
10202 T: std::iter::IntoIterator<Item = V>,
10203 V: std::convert::Into<crate::model::MysqlDatabase>,
10204 {
10205 use std::iter::Iterator;
10206 self.mysql_databases = v.into_iter().map(|i| i.into()).collect();
10207 self
10208 }
10209}
10210
10211impl wkt::message::Message for MysqlRdbms {
10212 fn typename() -> &'static str {
10213 "type.googleapis.com/google.cloud.datastream.v1.MysqlRdbms"
10214 }
10215}
10216
10217/// MySQL source configuration
10218#[derive(Clone, Default, PartialEq)]
10219#[non_exhaustive]
10220pub struct MysqlSourceConfig {
10221 /// MySQL objects to retrieve from the source.
10222 pub include_objects: std::option::Option<crate::model::MysqlRdbms>,
10223
10224 /// MySQL objects to exclude from the stream.
10225 pub exclude_objects: std::option::Option<crate::model::MysqlRdbms>,
10226
10227 /// Maximum number of concurrent CDC tasks. The number should be non negative.
10228 /// If not set (or set to 0), the system's default value will be used.
10229 pub max_concurrent_cdc_tasks: i32,
10230
10231 /// Maximum number of concurrent backfill tasks. The number should be non
10232 /// negative. If not set (or set to 0), the system's default value will be
10233 /// used.
10234 pub max_concurrent_backfill_tasks: i32,
10235
10236 /// The CDC method to use for the stream.
10237 pub cdc_method: std::option::Option<crate::model::mysql_source_config::CdcMethod>,
10238
10239 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10240}
10241
10242impl MysqlSourceConfig {
10243 pub fn new() -> Self {
10244 std::default::Default::default()
10245 }
10246
10247 /// Sets the value of [include_objects][crate::model::MysqlSourceConfig::include_objects].
10248 ///
10249 /// # Example
10250 /// ```ignore,no_run
10251 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10252 /// use google_cloud_datastream_v1::model::MysqlRdbms;
10253 /// let x = MysqlSourceConfig::new().set_include_objects(MysqlRdbms::default()/* use setters */);
10254 /// ```
10255 pub fn set_include_objects<T>(mut self, v: T) -> Self
10256 where
10257 T: std::convert::Into<crate::model::MysqlRdbms>,
10258 {
10259 self.include_objects = std::option::Option::Some(v.into());
10260 self
10261 }
10262
10263 /// Sets or clears the value of [include_objects][crate::model::MysqlSourceConfig::include_objects].
10264 ///
10265 /// # Example
10266 /// ```ignore,no_run
10267 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10268 /// use google_cloud_datastream_v1::model::MysqlRdbms;
10269 /// let x = MysqlSourceConfig::new().set_or_clear_include_objects(Some(MysqlRdbms::default()/* use setters */));
10270 /// let x = MysqlSourceConfig::new().set_or_clear_include_objects(None::<MysqlRdbms>);
10271 /// ```
10272 pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
10273 where
10274 T: std::convert::Into<crate::model::MysqlRdbms>,
10275 {
10276 self.include_objects = v.map(|x| x.into());
10277 self
10278 }
10279
10280 /// Sets the value of [exclude_objects][crate::model::MysqlSourceConfig::exclude_objects].
10281 ///
10282 /// # Example
10283 /// ```ignore,no_run
10284 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10285 /// use google_cloud_datastream_v1::model::MysqlRdbms;
10286 /// let x = MysqlSourceConfig::new().set_exclude_objects(MysqlRdbms::default()/* use setters */);
10287 /// ```
10288 pub fn set_exclude_objects<T>(mut self, v: T) -> Self
10289 where
10290 T: std::convert::Into<crate::model::MysqlRdbms>,
10291 {
10292 self.exclude_objects = std::option::Option::Some(v.into());
10293 self
10294 }
10295
10296 /// Sets or clears the value of [exclude_objects][crate::model::MysqlSourceConfig::exclude_objects].
10297 ///
10298 /// # Example
10299 /// ```ignore,no_run
10300 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10301 /// use google_cloud_datastream_v1::model::MysqlRdbms;
10302 /// let x = MysqlSourceConfig::new().set_or_clear_exclude_objects(Some(MysqlRdbms::default()/* use setters */));
10303 /// let x = MysqlSourceConfig::new().set_or_clear_exclude_objects(None::<MysqlRdbms>);
10304 /// ```
10305 pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
10306 where
10307 T: std::convert::Into<crate::model::MysqlRdbms>,
10308 {
10309 self.exclude_objects = v.map(|x| x.into());
10310 self
10311 }
10312
10313 /// Sets the value of [max_concurrent_cdc_tasks][crate::model::MysqlSourceConfig::max_concurrent_cdc_tasks].
10314 ///
10315 /// # Example
10316 /// ```ignore,no_run
10317 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10318 /// let x = MysqlSourceConfig::new().set_max_concurrent_cdc_tasks(42);
10319 /// ```
10320 pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10321 self.max_concurrent_cdc_tasks = v.into();
10322 self
10323 }
10324
10325 /// Sets the value of [max_concurrent_backfill_tasks][crate::model::MysqlSourceConfig::max_concurrent_backfill_tasks].
10326 ///
10327 /// # Example
10328 /// ```ignore,no_run
10329 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10330 /// let x = MysqlSourceConfig::new().set_max_concurrent_backfill_tasks(42);
10331 /// ```
10332 pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10333 self.max_concurrent_backfill_tasks = v.into();
10334 self
10335 }
10336
10337 /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method].
10338 ///
10339 /// Note that all the setters affecting `cdc_method` are mutually
10340 /// exclusive.
10341 ///
10342 /// # Example
10343 /// ```ignore,no_run
10344 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10345 /// use google_cloud_datastream_v1::model::mysql_source_config::BinaryLogPosition;
10346 /// let x = MysqlSourceConfig::new().set_cdc_method(Some(
10347 /// google_cloud_datastream_v1::model::mysql_source_config::CdcMethod::BinaryLogPosition(BinaryLogPosition::default().into())));
10348 /// ```
10349 pub fn set_cdc_method<
10350 T: std::convert::Into<std::option::Option<crate::model::mysql_source_config::CdcMethod>>,
10351 >(
10352 mut self,
10353 v: T,
10354 ) -> Self {
10355 self.cdc_method = v.into();
10356 self
10357 }
10358
10359 /// The value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10360 /// if it holds a `BinaryLogPosition`, `None` if the field is not set or
10361 /// holds a different branch.
10362 pub fn binary_log_position(
10363 &self,
10364 ) -> std::option::Option<&std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>>
10365 {
10366 #[allow(unreachable_patterns)]
10367 self.cdc_method.as_ref().and_then(|v| match v {
10368 crate::model::mysql_source_config::CdcMethod::BinaryLogPosition(v) => {
10369 std::option::Option::Some(v)
10370 }
10371 _ => std::option::Option::None,
10372 })
10373 }
10374
10375 /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10376 /// to hold a `BinaryLogPosition`.
10377 ///
10378 /// Note that all the setters affecting `cdc_method` are
10379 /// mutually exclusive.
10380 ///
10381 /// # Example
10382 /// ```ignore,no_run
10383 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10384 /// use google_cloud_datastream_v1::model::mysql_source_config::BinaryLogPosition;
10385 /// let x = MysqlSourceConfig::new().set_binary_log_position(BinaryLogPosition::default()/* use setters */);
10386 /// assert!(x.binary_log_position().is_some());
10387 /// assert!(x.gtid().is_none());
10388 /// ```
10389 pub fn set_binary_log_position<
10390 T: std::convert::Into<std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>>,
10391 >(
10392 mut self,
10393 v: T,
10394 ) -> Self {
10395 self.cdc_method = std::option::Option::Some(
10396 crate::model::mysql_source_config::CdcMethod::BinaryLogPosition(v.into()),
10397 );
10398 self
10399 }
10400
10401 /// The value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10402 /// if it holds a `Gtid`, `None` if the field is not set or
10403 /// holds a different branch.
10404 pub fn gtid(
10405 &self,
10406 ) -> std::option::Option<&std::boxed::Box<crate::model::mysql_source_config::Gtid>> {
10407 #[allow(unreachable_patterns)]
10408 self.cdc_method.as_ref().and_then(|v| match v {
10409 crate::model::mysql_source_config::CdcMethod::Gtid(v) => std::option::Option::Some(v),
10410 _ => std::option::Option::None,
10411 })
10412 }
10413
10414 /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10415 /// to hold a `Gtid`.
10416 ///
10417 /// Note that all the setters affecting `cdc_method` are
10418 /// mutually exclusive.
10419 ///
10420 /// # Example
10421 /// ```ignore,no_run
10422 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10423 /// use google_cloud_datastream_v1::model::mysql_source_config::Gtid;
10424 /// let x = MysqlSourceConfig::new().set_gtid(Gtid::default()/* use setters */);
10425 /// assert!(x.gtid().is_some());
10426 /// assert!(x.binary_log_position().is_none());
10427 /// ```
10428 pub fn set_gtid<
10429 T: std::convert::Into<std::boxed::Box<crate::model::mysql_source_config::Gtid>>,
10430 >(
10431 mut self,
10432 v: T,
10433 ) -> Self {
10434 self.cdc_method =
10435 std::option::Option::Some(crate::model::mysql_source_config::CdcMethod::Gtid(v.into()));
10436 self
10437 }
10438}
10439
10440impl wkt::message::Message for MysqlSourceConfig {
10441 fn typename() -> &'static str {
10442 "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig"
10443 }
10444}
10445
10446/// Defines additional types related to [MysqlSourceConfig].
10447pub mod mysql_source_config {
10448 #[allow(unused_imports)]
10449 use super::*;
10450
10451 /// Use Binary log position based replication.
10452 #[derive(Clone, Default, PartialEq)]
10453 #[non_exhaustive]
10454 pub struct BinaryLogPosition {
10455 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10456 }
10457
10458 impl BinaryLogPosition {
10459 pub fn new() -> Self {
10460 std::default::Default::default()
10461 }
10462 }
10463
10464 impl wkt::message::Message for BinaryLogPosition {
10465 fn typename() -> &'static str {
10466 "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig.BinaryLogPosition"
10467 }
10468 }
10469
10470 /// Use GTID based replication.
10471 #[derive(Clone, Default, PartialEq)]
10472 #[non_exhaustive]
10473 pub struct Gtid {
10474 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10475 }
10476
10477 impl Gtid {
10478 pub fn new() -> Self {
10479 std::default::Default::default()
10480 }
10481 }
10482
10483 impl wkt::message::Message for Gtid {
10484 fn typename() -> &'static str {
10485 "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig.Gtid"
10486 }
10487 }
10488
10489 /// The CDC method to use for the stream.
10490 #[derive(Clone, Debug, PartialEq)]
10491 #[non_exhaustive]
10492 pub enum CdcMethod {
10493 /// Use Binary log position based replication.
10494 BinaryLogPosition(std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>),
10495 /// Use GTID based replication.
10496 Gtid(std::boxed::Box<crate::model::mysql_source_config::Gtid>),
10497 }
10498}
10499
10500/// Salesforce source configuration
10501#[derive(Clone, Default, PartialEq)]
10502#[non_exhaustive]
10503pub struct SalesforceSourceConfig {
10504 /// Salesforce objects to retrieve from the source.
10505 pub include_objects: std::option::Option<crate::model::SalesforceOrg>,
10506
10507 /// Salesforce objects to exclude from the stream.
10508 pub exclude_objects: std::option::Option<crate::model::SalesforceOrg>,
10509
10510 /// Required. Salesforce objects polling interval. The interval at which new
10511 /// changes will be polled for each object. The duration must be between 5
10512 /// minutes and 24 hours.
10513 pub polling_interval: std::option::Option<wkt::Duration>,
10514
10515 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10516}
10517
10518impl SalesforceSourceConfig {
10519 pub fn new() -> Self {
10520 std::default::Default::default()
10521 }
10522
10523 /// Sets the value of [include_objects][crate::model::SalesforceSourceConfig::include_objects].
10524 ///
10525 /// # Example
10526 /// ```ignore,no_run
10527 /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10528 /// use google_cloud_datastream_v1::model::SalesforceOrg;
10529 /// let x = SalesforceSourceConfig::new().set_include_objects(SalesforceOrg::default()/* use setters */);
10530 /// ```
10531 pub fn set_include_objects<T>(mut self, v: T) -> Self
10532 where
10533 T: std::convert::Into<crate::model::SalesforceOrg>,
10534 {
10535 self.include_objects = std::option::Option::Some(v.into());
10536 self
10537 }
10538
10539 /// Sets or clears the value of [include_objects][crate::model::SalesforceSourceConfig::include_objects].
10540 ///
10541 /// # Example
10542 /// ```ignore,no_run
10543 /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10544 /// use google_cloud_datastream_v1::model::SalesforceOrg;
10545 /// let x = SalesforceSourceConfig::new().set_or_clear_include_objects(Some(SalesforceOrg::default()/* use setters */));
10546 /// let x = SalesforceSourceConfig::new().set_or_clear_include_objects(None::<SalesforceOrg>);
10547 /// ```
10548 pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
10549 where
10550 T: std::convert::Into<crate::model::SalesforceOrg>,
10551 {
10552 self.include_objects = v.map(|x| x.into());
10553 self
10554 }
10555
10556 /// Sets the value of [exclude_objects][crate::model::SalesforceSourceConfig::exclude_objects].
10557 ///
10558 /// # Example
10559 /// ```ignore,no_run
10560 /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10561 /// use google_cloud_datastream_v1::model::SalesforceOrg;
10562 /// let x = SalesforceSourceConfig::new().set_exclude_objects(SalesforceOrg::default()/* use setters */);
10563 /// ```
10564 pub fn set_exclude_objects<T>(mut self, v: T) -> Self
10565 where
10566 T: std::convert::Into<crate::model::SalesforceOrg>,
10567 {
10568 self.exclude_objects = std::option::Option::Some(v.into());
10569 self
10570 }
10571
10572 /// Sets or clears the value of [exclude_objects][crate::model::SalesforceSourceConfig::exclude_objects].
10573 ///
10574 /// # Example
10575 /// ```ignore,no_run
10576 /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10577 /// use google_cloud_datastream_v1::model::SalesforceOrg;
10578 /// let x = SalesforceSourceConfig::new().set_or_clear_exclude_objects(Some(SalesforceOrg::default()/* use setters */));
10579 /// let x = SalesforceSourceConfig::new().set_or_clear_exclude_objects(None::<SalesforceOrg>);
10580 /// ```
10581 pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
10582 where
10583 T: std::convert::Into<crate::model::SalesforceOrg>,
10584 {
10585 self.exclude_objects = v.map(|x| x.into());
10586 self
10587 }
10588
10589 /// Sets the value of [polling_interval][crate::model::SalesforceSourceConfig::polling_interval].
10590 ///
10591 /// # Example
10592 /// ```ignore,no_run
10593 /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10594 /// use wkt::Duration;
10595 /// let x = SalesforceSourceConfig::new().set_polling_interval(Duration::default()/* use setters */);
10596 /// ```
10597 pub fn set_polling_interval<T>(mut self, v: T) -> Self
10598 where
10599 T: std::convert::Into<wkt::Duration>,
10600 {
10601 self.polling_interval = std::option::Option::Some(v.into());
10602 self
10603 }
10604
10605 /// Sets or clears the value of [polling_interval][crate::model::SalesforceSourceConfig::polling_interval].
10606 ///
10607 /// # Example
10608 /// ```ignore,no_run
10609 /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10610 /// use wkt::Duration;
10611 /// let x = SalesforceSourceConfig::new().set_or_clear_polling_interval(Some(Duration::default()/* use setters */));
10612 /// let x = SalesforceSourceConfig::new().set_or_clear_polling_interval(None::<Duration>);
10613 /// ```
10614 pub fn set_or_clear_polling_interval<T>(mut self, v: std::option::Option<T>) -> Self
10615 where
10616 T: std::convert::Into<wkt::Duration>,
10617 {
10618 self.polling_interval = v.map(|x| x.into());
10619 self
10620 }
10621}
10622
10623impl wkt::message::Message for SalesforceSourceConfig {
10624 fn typename() -> &'static str {
10625 "type.googleapis.com/google.cloud.datastream.v1.SalesforceSourceConfig"
10626 }
10627}
10628
10629/// Salesforce organization structure.
10630#[derive(Clone, Default, PartialEq)]
10631#[non_exhaustive]
10632pub struct SalesforceOrg {
10633 /// Salesforce objects in the database server.
10634 pub objects: std::vec::Vec<crate::model::SalesforceObject>,
10635
10636 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10637}
10638
10639impl SalesforceOrg {
10640 pub fn new() -> Self {
10641 std::default::Default::default()
10642 }
10643
10644 /// Sets the value of [objects][crate::model::SalesforceOrg::objects].
10645 ///
10646 /// # Example
10647 /// ```ignore,no_run
10648 /// # use google_cloud_datastream_v1::model::SalesforceOrg;
10649 /// use google_cloud_datastream_v1::model::SalesforceObject;
10650 /// let x = SalesforceOrg::new()
10651 /// .set_objects([
10652 /// SalesforceObject::default()/* use setters */,
10653 /// SalesforceObject::default()/* use (different) setters */,
10654 /// ]);
10655 /// ```
10656 pub fn set_objects<T, V>(mut self, v: T) -> Self
10657 where
10658 T: std::iter::IntoIterator<Item = V>,
10659 V: std::convert::Into<crate::model::SalesforceObject>,
10660 {
10661 use std::iter::Iterator;
10662 self.objects = v.into_iter().map(|i| i.into()).collect();
10663 self
10664 }
10665}
10666
10667impl wkt::message::Message for SalesforceOrg {
10668 fn typename() -> &'static str {
10669 "type.googleapis.com/google.cloud.datastream.v1.SalesforceOrg"
10670 }
10671}
10672
10673/// Salesforce object.
10674#[derive(Clone, Default, PartialEq)]
10675#[non_exhaustive]
10676pub struct SalesforceObject {
10677 /// Object name.
10678 pub object_name: std::string::String,
10679
10680 /// Salesforce fields.
10681 /// When unspecified as part of include objects,
10682 /// includes everything, when unspecified as part of exclude objects,
10683 /// excludes nothing.
10684 pub fields: std::vec::Vec<crate::model::SalesforceField>,
10685
10686 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10687}
10688
10689impl SalesforceObject {
10690 pub fn new() -> Self {
10691 std::default::Default::default()
10692 }
10693
10694 /// Sets the value of [object_name][crate::model::SalesforceObject::object_name].
10695 ///
10696 /// # Example
10697 /// ```ignore,no_run
10698 /// # use google_cloud_datastream_v1::model::SalesforceObject;
10699 /// let x = SalesforceObject::new().set_object_name("example");
10700 /// ```
10701 pub fn set_object_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10702 self.object_name = v.into();
10703 self
10704 }
10705
10706 /// Sets the value of [fields][crate::model::SalesforceObject::fields].
10707 ///
10708 /// # Example
10709 /// ```ignore,no_run
10710 /// # use google_cloud_datastream_v1::model::SalesforceObject;
10711 /// use google_cloud_datastream_v1::model::SalesforceField;
10712 /// let x = SalesforceObject::new()
10713 /// .set_fields([
10714 /// SalesforceField::default()/* use setters */,
10715 /// SalesforceField::default()/* use (different) setters */,
10716 /// ]);
10717 /// ```
10718 pub fn set_fields<T, V>(mut self, v: T) -> Self
10719 where
10720 T: std::iter::IntoIterator<Item = V>,
10721 V: std::convert::Into<crate::model::SalesforceField>,
10722 {
10723 use std::iter::Iterator;
10724 self.fields = v.into_iter().map(|i| i.into()).collect();
10725 self
10726 }
10727}
10728
10729impl wkt::message::Message for SalesforceObject {
10730 fn typename() -> &'static str {
10731 "type.googleapis.com/google.cloud.datastream.v1.SalesforceObject"
10732 }
10733}
10734
10735/// Salesforce field.
10736#[derive(Clone, Default, PartialEq)]
10737#[non_exhaustive]
10738pub struct SalesforceField {
10739 /// Field name.
10740 pub name: std::string::String,
10741
10742 /// The data type.
10743 pub data_type: std::string::String,
10744
10745 /// Indicates whether the field can accept nil values.
10746 pub nillable: bool,
10747
10748 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10749}
10750
10751impl SalesforceField {
10752 pub fn new() -> Self {
10753 std::default::Default::default()
10754 }
10755
10756 /// Sets the value of [name][crate::model::SalesforceField::name].
10757 ///
10758 /// # Example
10759 /// ```ignore,no_run
10760 /// # use google_cloud_datastream_v1::model::SalesforceField;
10761 /// let x = SalesforceField::new().set_name("example");
10762 /// ```
10763 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10764 self.name = v.into();
10765 self
10766 }
10767
10768 /// Sets the value of [data_type][crate::model::SalesforceField::data_type].
10769 ///
10770 /// # Example
10771 /// ```ignore,no_run
10772 /// # use google_cloud_datastream_v1::model::SalesforceField;
10773 /// let x = SalesforceField::new().set_data_type("example");
10774 /// ```
10775 pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10776 self.data_type = v.into();
10777 self
10778 }
10779
10780 /// Sets the value of [nillable][crate::model::SalesforceField::nillable].
10781 ///
10782 /// # Example
10783 /// ```ignore,no_run
10784 /// # use google_cloud_datastream_v1::model::SalesforceField;
10785 /// let x = SalesforceField::new().set_nillable(true);
10786 /// ```
10787 pub fn set_nillable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10788 self.nillable = v.into();
10789 self
10790 }
10791}
10792
10793impl wkt::message::Message for SalesforceField {
10794 fn typename() -> &'static str {
10795 "type.googleapis.com/google.cloud.datastream.v1.SalesforceField"
10796 }
10797}
10798
10799/// MongoDB source configuration.
10800#[derive(Clone, Default, PartialEq)]
10801#[non_exhaustive]
10802pub struct MongodbSourceConfig {
10803 /// MongoDB collections to include in the stream.
10804 pub include_objects: std::option::Option<crate::model::MongodbCluster>,
10805
10806 /// MongoDB collections to exclude from the stream.
10807 pub exclude_objects: std::option::Option<crate::model::MongodbCluster>,
10808
10809 /// Optional. Maximum number of concurrent backfill tasks. The number should be
10810 /// non-negative and less than or equal to 50. If not set (or set to 0), the
10811 /// system's default value is used
10812 pub max_concurrent_backfill_tasks: i32,
10813
10814 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10815}
10816
10817impl MongodbSourceConfig {
10818 pub fn new() -> Self {
10819 std::default::Default::default()
10820 }
10821
10822 /// Sets the value of [include_objects][crate::model::MongodbSourceConfig::include_objects].
10823 ///
10824 /// # Example
10825 /// ```ignore,no_run
10826 /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
10827 /// use google_cloud_datastream_v1::model::MongodbCluster;
10828 /// let x = MongodbSourceConfig::new().set_include_objects(MongodbCluster::default()/* use setters */);
10829 /// ```
10830 pub fn set_include_objects<T>(mut self, v: T) -> Self
10831 where
10832 T: std::convert::Into<crate::model::MongodbCluster>,
10833 {
10834 self.include_objects = std::option::Option::Some(v.into());
10835 self
10836 }
10837
10838 /// Sets or clears the value of [include_objects][crate::model::MongodbSourceConfig::include_objects].
10839 ///
10840 /// # Example
10841 /// ```ignore,no_run
10842 /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
10843 /// use google_cloud_datastream_v1::model::MongodbCluster;
10844 /// let x = MongodbSourceConfig::new().set_or_clear_include_objects(Some(MongodbCluster::default()/* use setters */));
10845 /// let x = MongodbSourceConfig::new().set_or_clear_include_objects(None::<MongodbCluster>);
10846 /// ```
10847 pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
10848 where
10849 T: std::convert::Into<crate::model::MongodbCluster>,
10850 {
10851 self.include_objects = v.map(|x| x.into());
10852 self
10853 }
10854
10855 /// Sets the value of [exclude_objects][crate::model::MongodbSourceConfig::exclude_objects].
10856 ///
10857 /// # Example
10858 /// ```ignore,no_run
10859 /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
10860 /// use google_cloud_datastream_v1::model::MongodbCluster;
10861 /// let x = MongodbSourceConfig::new().set_exclude_objects(MongodbCluster::default()/* use setters */);
10862 /// ```
10863 pub fn set_exclude_objects<T>(mut self, v: T) -> Self
10864 where
10865 T: std::convert::Into<crate::model::MongodbCluster>,
10866 {
10867 self.exclude_objects = std::option::Option::Some(v.into());
10868 self
10869 }
10870
10871 /// Sets or clears the value of [exclude_objects][crate::model::MongodbSourceConfig::exclude_objects].
10872 ///
10873 /// # Example
10874 /// ```ignore,no_run
10875 /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
10876 /// use google_cloud_datastream_v1::model::MongodbCluster;
10877 /// let x = MongodbSourceConfig::new().set_or_clear_exclude_objects(Some(MongodbCluster::default()/* use setters */));
10878 /// let x = MongodbSourceConfig::new().set_or_clear_exclude_objects(None::<MongodbCluster>);
10879 /// ```
10880 pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
10881 where
10882 T: std::convert::Into<crate::model::MongodbCluster>,
10883 {
10884 self.exclude_objects = v.map(|x| x.into());
10885 self
10886 }
10887
10888 /// Sets the value of [max_concurrent_backfill_tasks][crate::model::MongodbSourceConfig::max_concurrent_backfill_tasks].
10889 ///
10890 /// # Example
10891 /// ```ignore,no_run
10892 /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
10893 /// let x = MongodbSourceConfig::new().set_max_concurrent_backfill_tasks(42);
10894 /// ```
10895 pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10896 self.max_concurrent_backfill_tasks = v.into();
10897 self
10898 }
10899}
10900
10901impl wkt::message::Message for MongodbSourceConfig {
10902 fn typename() -> &'static str {
10903 "type.googleapis.com/google.cloud.datastream.v1.MongodbSourceConfig"
10904 }
10905}
10906
10907/// MongoDB Cluster structure.
10908#[derive(Clone, Default, PartialEq)]
10909#[non_exhaustive]
10910pub struct MongodbCluster {
10911 /// MongoDB databases in the cluster.
10912 pub databases: std::vec::Vec<crate::model::MongodbDatabase>,
10913
10914 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10915}
10916
10917impl MongodbCluster {
10918 pub fn new() -> Self {
10919 std::default::Default::default()
10920 }
10921
10922 /// Sets the value of [databases][crate::model::MongodbCluster::databases].
10923 ///
10924 /// # Example
10925 /// ```ignore,no_run
10926 /// # use google_cloud_datastream_v1::model::MongodbCluster;
10927 /// use google_cloud_datastream_v1::model::MongodbDatabase;
10928 /// let x = MongodbCluster::new()
10929 /// .set_databases([
10930 /// MongodbDatabase::default()/* use setters */,
10931 /// MongodbDatabase::default()/* use (different) setters */,
10932 /// ]);
10933 /// ```
10934 pub fn set_databases<T, V>(mut self, v: T) -> Self
10935 where
10936 T: std::iter::IntoIterator<Item = V>,
10937 V: std::convert::Into<crate::model::MongodbDatabase>,
10938 {
10939 use std::iter::Iterator;
10940 self.databases = v.into_iter().map(|i| i.into()).collect();
10941 self
10942 }
10943}
10944
10945impl wkt::message::Message for MongodbCluster {
10946 fn typename() -> &'static str {
10947 "type.googleapis.com/google.cloud.datastream.v1.MongodbCluster"
10948 }
10949}
10950
10951/// MongoDB Database.
10952#[derive(Clone, Default, PartialEq)]
10953#[non_exhaustive]
10954pub struct MongodbDatabase {
10955 /// Database name.
10956 pub database: std::string::String,
10957
10958 /// Collections in the database.
10959 pub collections: std::vec::Vec<crate::model::MongodbCollection>,
10960
10961 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10962}
10963
10964impl MongodbDatabase {
10965 pub fn new() -> Self {
10966 std::default::Default::default()
10967 }
10968
10969 /// Sets the value of [database][crate::model::MongodbDatabase::database].
10970 ///
10971 /// # Example
10972 /// ```ignore,no_run
10973 /// # use google_cloud_datastream_v1::model::MongodbDatabase;
10974 /// let x = MongodbDatabase::new().set_database("example");
10975 /// ```
10976 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10977 self.database = v.into();
10978 self
10979 }
10980
10981 /// Sets the value of [collections][crate::model::MongodbDatabase::collections].
10982 ///
10983 /// # Example
10984 /// ```ignore,no_run
10985 /// # use google_cloud_datastream_v1::model::MongodbDatabase;
10986 /// use google_cloud_datastream_v1::model::MongodbCollection;
10987 /// let x = MongodbDatabase::new()
10988 /// .set_collections([
10989 /// MongodbCollection::default()/* use setters */,
10990 /// MongodbCollection::default()/* use (different) setters */,
10991 /// ]);
10992 /// ```
10993 pub fn set_collections<T, V>(mut self, v: T) -> Self
10994 where
10995 T: std::iter::IntoIterator<Item = V>,
10996 V: std::convert::Into<crate::model::MongodbCollection>,
10997 {
10998 use std::iter::Iterator;
10999 self.collections = v.into_iter().map(|i| i.into()).collect();
11000 self
11001 }
11002}
11003
11004impl wkt::message::Message for MongodbDatabase {
11005 fn typename() -> &'static str {
11006 "type.googleapis.com/google.cloud.datastream.v1.MongodbDatabase"
11007 }
11008}
11009
11010/// MongoDB Collection.
11011#[derive(Clone, Default, PartialEq)]
11012#[non_exhaustive]
11013pub struct MongodbCollection {
11014 /// Collection name.
11015 pub collection: std::string::String,
11016
11017 /// Fields in the collection.
11018 pub fields: std::vec::Vec<crate::model::MongodbField>,
11019
11020 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11021}
11022
11023impl MongodbCollection {
11024 pub fn new() -> Self {
11025 std::default::Default::default()
11026 }
11027
11028 /// Sets the value of [collection][crate::model::MongodbCollection::collection].
11029 ///
11030 /// # Example
11031 /// ```ignore,no_run
11032 /// # use google_cloud_datastream_v1::model::MongodbCollection;
11033 /// let x = MongodbCollection::new().set_collection("example");
11034 /// ```
11035 pub fn set_collection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11036 self.collection = v.into();
11037 self
11038 }
11039
11040 /// Sets the value of [fields][crate::model::MongodbCollection::fields].
11041 ///
11042 /// # Example
11043 /// ```ignore,no_run
11044 /// # use google_cloud_datastream_v1::model::MongodbCollection;
11045 /// use google_cloud_datastream_v1::model::MongodbField;
11046 /// let x = MongodbCollection::new()
11047 /// .set_fields([
11048 /// MongodbField::default()/* use setters */,
11049 /// MongodbField::default()/* use (different) setters */,
11050 /// ]);
11051 /// ```
11052 pub fn set_fields<T, V>(mut self, v: T) -> Self
11053 where
11054 T: std::iter::IntoIterator<Item = V>,
11055 V: std::convert::Into<crate::model::MongodbField>,
11056 {
11057 use std::iter::Iterator;
11058 self.fields = v.into_iter().map(|i| i.into()).collect();
11059 self
11060 }
11061}
11062
11063impl wkt::message::Message for MongodbCollection {
11064 fn typename() -> &'static str {
11065 "type.googleapis.com/google.cloud.datastream.v1.MongodbCollection"
11066 }
11067}
11068
11069/// MongoDB Field.
11070#[derive(Clone, Default, PartialEq)]
11071#[non_exhaustive]
11072pub struct MongodbField {
11073 /// Field name.
11074 pub field: std::string::String,
11075
11076 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11077}
11078
11079impl MongodbField {
11080 pub fn new() -> Self {
11081 std::default::Default::default()
11082 }
11083
11084 /// Sets the value of [field][crate::model::MongodbField::field].
11085 ///
11086 /// # Example
11087 /// ```ignore,no_run
11088 /// # use google_cloud_datastream_v1::model::MongodbField;
11089 /// let x = MongodbField::new().set_field("example");
11090 /// ```
11091 pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11092 self.field = v.into();
11093 self
11094 }
11095}
11096
11097impl wkt::message::Message for MongodbField {
11098 fn typename() -> &'static str {
11099 "type.googleapis.com/google.cloud.datastream.v1.MongodbField"
11100 }
11101}
11102
11103/// The configuration of the stream source.
11104#[derive(Clone, Default, PartialEq)]
11105#[non_exhaustive]
11106pub struct SourceConfig {
11107 /// Required. Source connection profile resource.
11108 /// Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
11109 pub source_connection_profile: std::string::String,
11110
11111 /// Stream configuration that is specific to the data source type.
11112 pub source_stream_config: std::option::Option<crate::model::source_config::SourceStreamConfig>,
11113
11114 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11115}
11116
11117impl SourceConfig {
11118 pub fn new() -> Self {
11119 std::default::Default::default()
11120 }
11121
11122 /// Sets the value of [source_connection_profile][crate::model::SourceConfig::source_connection_profile].
11123 ///
11124 /// # Example
11125 /// ```ignore,no_run
11126 /// # use google_cloud_datastream_v1::model::SourceConfig;
11127 /// let x = SourceConfig::new().set_source_connection_profile("example");
11128 /// ```
11129 pub fn set_source_connection_profile<T: std::convert::Into<std::string::String>>(
11130 mut self,
11131 v: T,
11132 ) -> Self {
11133 self.source_connection_profile = v.into();
11134 self
11135 }
11136
11137 /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config].
11138 ///
11139 /// Note that all the setters affecting `source_stream_config` are mutually
11140 /// exclusive.
11141 ///
11142 /// # Example
11143 /// ```ignore,no_run
11144 /// # use google_cloud_datastream_v1::model::SourceConfig;
11145 /// use google_cloud_datastream_v1::model::OracleSourceConfig;
11146 /// let x = SourceConfig::new().set_source_stream_config(Some(
11147 /// google_cloud_datastream_v1::model::source_config::SourceStreamConfig::OracleSourceConfig(OracleSourceConfig::default().into())));
11148 /// ```
11149 pub fn set_source_stream_config<
11150 T: std::convert::Into<std::option::Option<crate::model::source_config::SourceStreamConfig>>,
11151 >(
11152 mut self,
11153 v: T,
11154 ) -> Self {
11155 self.source_stream_config = v.into();
11156 self
11157 }
11158
11159 /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11160 /// if it holds a `OracleSourceConfig`, `None` if the field is not set or
11161 /// holds a different branch.
11162 pub fn oracle_source_config(
11163 &self,
11164 ) -> std::option::Option<&std::boxed::Box<crate::model::OracleSourceConfig>> {
11165 #[allow(unreachable_patterns)]
11166 self.source_stream_config.as_ref().and_then(|v| match v {
11167 crate::model::source_config::SourceStreamConfig::OracleSourceConfig(v) => {
11168 std::option::Option::Some(v)
11169 }
11170 _ => std::option::Option::None,
11171 })
11172 }
11173
11174 /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11175 /// to hold a `OracleSourceConfig`.
11176 ///
11177 /// Note that all the setters affecting `source_stream_config` are
11178 /// mutually exclusive.
11179 ///
11180 /// # Example
11181 /// ```ignore,no_run
11182 /// # use google_cloud_datastream_v1::model::SourceConfig;
11183 /// use google_cloud_datastream_v1::model::OracleSourceConfig;
11184 /// let x = SourceConfig::new().set_oracle_source_config(OracleSourceConfig::default()/* use setters */);
11185 /// assert!(x.oracle_source_config().is_some());
11186 /// assert!(x.mysql_source_config().is_none());
11187 /// assert!(x.postgresql_source_config().is_none());
11188 /// assert!(x.sql_server_source_config().is_none());
11189 /// assert!(x.salesforce_source_config().is_none());
11190 /// assert!(x.mongodb_source_config().is_none());
11191 /// ```
11192 pub fn set_oracle_source_config<
11193 T: std::convert::Into<std::boxed::Box<crate::model::OracleSourceConfig>>,
11194 >(
11195 mut self,
11196 v: T,
11197 ) -> Self {
11198 self.source_stream_config = std::option::Option::Some(
11199 crate::model::source_config::SourceStreamConfig::OracleSourceConfig(v.into()),
11200 );
11201 self
11202 }
11203
11204 /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11205 /// if it holds a `MysqlSourceConfig`, `None` if the field is not set or
11206 /// holds a different branch.
11207 pub fn mysql_source_config(
11208 &self,
11209 ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlSourceConfig>> {
11210 #[allow(unreachable_patterns)]
11211 self.source_stream_config.as_ref().and_then(|v| match v {
11212 crate::model::source_config::SourceStreamConfig::MysqlSourceConfig(v) => {
11213 std::option::Option::Some(v)
11214 }
11215 _ => std::option::Option::None,
11216 })
11217 }
11218
11219 /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11220 /// to hold a `MysqlSourceConfig`.
11221 ///
11222 /// Note that all the setters affecting `source_stream_config` are
11223 /// mutually exclusive.
11224 ///
11225 /// # Example
11226 /// ```ignore,no_run
11227 /// # use google_cloud_datastream_v1::model::SourceConfig;
11228 /// use google_cloud_datastream_v1::model::MysqlSourceConfig;
11229 /// let x = SourceConfig::new().set_mysql_source_config(MysqlSourceConfig::default()/* use setters */);
11230 /// assert!(x.mysql_source_config().is_some());
11231 /// assert!(x.oracle_source_config().is_none());
11232 /// assert!(x.postgresql_source_config().is_none());
11233 /// assert!(x.sql_server_source_config().is_none());
11234 /// assert!(x.salesforce_source_config().is_none());
11235 /// assert!(x.mongodb_source_config().is_none());
11236 /// ```
11237 pub fn set_mysql_source_config<
11238 T: std::convert::Into<std::boxed::Box<crate::model::MysqlSourceConfig>>,
11239 >(
11240 mut self,
11241 v: T,
11242 ) -> Self {
11243 self.source_stream_config = std::option::Option::Some(
11244 crate::model::source_config::SourceStreamConfig::MysqlSourceConfig(v.into()),
11245 );
11246 self
11247 }
11248
11249 /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11250 /// if it holds a `PostgresqlSourceConfig`, `None` if the field is not set or
11251 /// holds a different branch.
11252 pub fn postgresql_source_config(
11253 &self,
11254 ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlSourceConfig>> {
11255 #[allow(unreachable_patterns)]
11256 self.source_stream_config.as_ref().and_then(|v| match v {
11257 crate::model::source_config::SourceStreamConfig::PostgresqlSourceConfig(v) => {
11258 std::option::Option::Some(v)
11259 }
11260 _ => std::option::Option::None,
11261 })
11262 }
11263
11264 /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11265 /// to hold a `PostgresqlSourceConfig`.
11266 ///
11267 /// Note that all the setters affecting `source_stream_config` are
11268 /// mutually exclusive.
11269 ///
11270 /// # Example
11271 /// ```ignore,no_run
11272 /// # use google_cloud_datastream_v1::model::SourceConfig;
11273 /// use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
11274 /// let x = SourceConfig::new().set_postgresql_source_config(PostgresqlSourceConfig::default()/* use setters */);
11275 /// assert!(x.postgresql_source_config().is_some());
11276 /// assert!(x.oracle_source_config().is_none());
11277 /// assert!(x.mysql_source_config().is_none());
11278 /// assert!(x.sql_server_source_config().is_none());
11279 /// assert!(x.salesforce_source_config().is_none());
11280 /// assert!(x.mongodb_source_config().is_none());
11281 /// ```
11282 pub fn set_postgresql_source_config<
11283 T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlSourceConfig>>,
11284 >(
11285 mut self,
11286 v: T,
11287 ) -> Self {
11288 self.source_stream_config = std::option::Option::Some(
11289 crate::model::source_config::SourceStreamConfig::PostgresqlSourceConfig(v.into()),
11290 );
11291 self
11292 }
11293
11294 /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11295 /// if it holds a `SqlServerSourceConfig`, `None` if the field is not set or
11296 /// holds a different branch.
11297 pub fn sql_server_source_config(
11298 &self,
11299 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerSourceConfig>> {
11300 #[allow(unreachable_patterns)]
11301 self.source_stream_config.as_ref().and_then(|v| match v {
11302 crate::model::source_config::SourceStreamConfig::SqlServerSourceConfig(v) => {
11303 std::option::Option::Some(v)
11304 }
11305 _ => std::option::Option::None,
11306 })
11307 }
11308
11309 /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11310 /// to hold a `SqlServerSourceConfig`.
11311 ///
11312 /// Note that all the setters affecting `source_stream_config` are
11313 /// mutually exclusive.
11314 ///
11315 /// # Example
11316 /// ```ignore,no_run
11317 /// # use google_cloud_datastream_v1::model::SourceConfig;
11318 /// use google_cloud_datastream_v1::model::SqlServerSourceConfig;
11319 /// let x = SourceConfig::new().set_sql_server_source_config(SqlServerSourceConfig::default()/* use setters */);
11320 /// assert!(x.sql_server_source_config().is_some());
11321 /// assert!(x.oracle_source_config().is_none());
11322 /// assert!(x.mysql_source_config().is_none());
11323 /// assert!(x.postgresql_source_config().is_none());
11324 /// assert!(x.salesforce_source_config().is_none());
11325 /// assert!(x.mongodb_source_config().is_none());
11326 /// ```
11327 pub fn set_sql_server_source_config<
11328 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerSourceConfig>>,
11329 >(
11330 mut self,
11331 v: T,
11332 ) -> Self {
11333 self.source_stream_config = std::option::Option::Some(
11334 crate::model::source_config::SourceStreamConfig::SqlServerSourceConfig(v.into()),
11335 );
11336 self
11337 }
11338
11339 /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11340 /// if it holds a `SalesforceSourceConfig`, `None` if the field is not set or
11341 /// holds a different branch.
11342 pub fn salesforce_source_config(
11343 &self,
11344 ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceSourceConfig>> {
11345 #[allow(unreachable_patterns)]
11346 self.source_stream_config.as_ref().and_then(|v| match v {
11347 crate::model::source_config::SourceStreamConfig::SalesforceSourceConfig(v) => {
11348 std::option::Option::Some(v)
11349 }
11350 _ => std::option::Option::None,
11351 })
11352 }
11353
11354 /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11355 /// to hold a `SalesforceSourceConfig`.
11356 ///
11357 /// Note that all the setters affecting `source_stream_config` are
11358 /// mutually exclusive.
11359 ///
11360 /// # Example
11361 /// ```ignore,no_run
11362 /// # use google_cloud_datastream_v1::model::SourceConfig;
11363 /// use google_cloud_datastream_v1::model::SalesforceSourceConfig;
11364 /// let x = SourceConfig::new().set_salesforce_source_config(SalesforceSourceConfig::default()/* use setters */);
11365 /// assert!(x.salesforce_source_config().is_some());
11366 /// assert!(x.oracle_source_config().is_none());
11367 /// assert!(x.mysql_source_config().is_none());
11368 /// assert!(x.postgresql_source_config().is_none());
11369 /// assert!(x.sql_server_source_config().is_none());
11370 /// assert!(x.mongodb_source_config().is_none());
11371 /// ```
11372 pub fn set_salesforce_source_config<
11373 T: std::convert::Into<std::boxed::Box<crate::model::SalesforceSourceConfig>>,
11374 >(
11375 mut self,
11376 v: T,
11377 ) -> Self {
11378 self.source_stream_config = std::option::Option::Some(
11379 crate::model::source_config::SourceStreamConfig::SalesforceSourceConfig(v.into()),
11380 );
11381 self
11382 }
11383
11384 /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11385 /// if it holds a `MongodbSourceConfig`, `None` if the field is not set or
11386 /// holds a different branch.
11387 pub fn mongodb_source_config(
11388 &self,
11389 ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbSourceConfig>> {
11390 #[allow(unreachable_patterns)]
11391 self.source_stream_config.as_ref().and_then(|v| match v {
11392 crate::model::source_config::SourceStreamConfig::MongodbSourceConfig(v) => {
11393 std::option::Option::Some(v)
11394 }
11395 _ => std::option::Option::None,
11396 })
11397 }
11398
11399 /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11400 /// to hold a `MongodbSourceConfig`.
11401 ///
11402 /// Note that all the setters affecting `source_stream_config` are
11403 /// mutually exclusive.
11404 ///
11405 /// # Example
11406 /// ```ignore,no_run
11407 /// # use google_cloud_datastream_v1::model::SourceConfig;
11408 /// use google_cloud_datastream_v1::model::MongodbSourceConfig;
11409 /// let x = SourceConfig::new().set_mongodb_source_config(MongodbSourceConfig::default()/* use setters */);
11410 /// assert!(x.mongodb_source_config().is_some());
11411 /// assert!(x.oracle_source_config().is_none());
11412 /// assert!(x.mysql_source_config().is_none());
11413 /// assert!(x.postgresql_source_config().is_none());
11414 /// assert!(x.sql_server_source_config().is_none());
11415 /// assert!(x.salesforce_source_config().is_none());
11416 /// ```
11417 pub fn set_mongodb_source_config<
11418 T: std::convert::Into<std::boxed::Box<crate::model::MongodbSourceConfig>>,
11419 >(
11420 mut self,
11421 v: T,
11422 ) -> Self {
11423 self.source_stream_config = std::option::Option::Some(
11424 crate::model::source_config::SourceStreamConfig::MongodbSourceConfig(v.into()),
11425 );
11426 self
11427 }
11428}
11429
11430impl wkt::message::Message for SourceConfig {
11431 fn typename() -> &'static str {
11432 "type.googleapis.com/google.cloud.datastream.v1.SourceConfig"
11433 }
11434}
11435
11436/// Defines additional types related to [SourceConfig].
11437pub mod source_config {
11438 #[allow(unused_imports)]
11439 use super::*;
11440
11441 /// Stream configuration that is specific to the data source type.
11442 #[derive(Clone, Debug, PartialEq)]
11443 #[non_exhaustive]
11444 pub enum SourceStreamConfig {
11445 /// Oracle data source configuration.
11446 OracleSourceConfig(std::boxed::Box<crate::model::OracleSourceConfig>),
11447 /// MySQL data source configuration.
11448 MysqlSourceConfig(std::boxed::Box<crate::model::MysqlSourceConfig>),
11449 /// PostgreSQL data source configuration.
11450 PostgresqlSourceConfig(std::boxed::Box<crate::model::PostgresqlSourceConfig>),
11451 /// SQLServer data source configuration.
11452 SqlServerSourceConfig(std::boxed::Box<crate::model::SqlServerSourceConfig>),
11453 /// Salesforce data source configuration.
11454 SalesforceSourceConfig(std::boxed::Box<crate::model::SalesforceSourceConfig>),
11455 /// MongoDB data source configuration.
11456 MongodbSourceConfig(std::boxed::Box<crate::model::MongodbSourceConfig>),
11457 }
11458}
11459
11460/// AVRO file format configuration.
11461#[derive(Clone, Default, PartialEq)]
11462#[non_exhaustive]
11463pub struct AvroFileFormat {
11464 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11465}
11466
11467impl AvroFileFormat {
11468 pub fn new() -> Self {
11469 std::default::Default::default()
11470 }
11471}
11472
11473impl wkt::message::Message for AvroFileFormat {
11474 fn typename() -> &'static str {
11475 "type.googleapis.com/google.cloud.datastream.v1.AvroFileFormat"
11476 }
11477}
11478
11479/// JSON file format configuration.
11480#[derive(Clone, Default, PartialEq)]
11481#[non_exhaustive]
11482pub struct JsonFileFormat {
11483 /// The schema file format along JSON data files.
11484 pub schema_file_format: crate::model::json_file_format::SchemaFileFormat,
11485
11486 /// Compression of the loaded JSON file.
11487 pub compression: crate::model::json_file_format::JsonCompression,
11488
11489 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11490}
11491
11492impl JsonFileFormat {
11493 pub fn new() -> Self {
11494 std::default::Default::default()
11495 }
11496
11497 /// Sets the value of [schema_file_format][crate::model::JsonFileFormat::schema_file_format].
11498 ///
11499 /// # Example
11500 /// ```ignore,no_run
11501 /// # use google_cloud_datastream_v1::model::JsonFileFormat;
11502 /// use google_cloud_datastream_v1::model::json_file_format::SchemaFileFormat;
11503 /// let x0 = JsonFileFormat::new().set_schema_file_format(SchemaFileFormat::NoSchemaFile);
11504 /// let x1 = JsonFileFormat::new().set_schema_file_format(SchemaFileFormat::AvroSchemaFile);
11505 /// ```
11506 pub fn set_schema_file_format<
11507 T: std::convert::Into<crate::model::json_file_format::SchemaFileFormat>,
11508 >(
11509 mut self,
11510 v: T,
11511 ) -> Self {
11512 self.schema_file_format = v.into();
11513 self
11514 }
11515
11516 /// Sets the value of [compression][crate::model::JsonFileFormat::compression].
11517 ///
11518 /// # Example
11519 /// ```ignore,no_run
11520 /// # use google_cloud_datastream_v1::model::JsonFileFormat;
11521 /// use google_cloud_datastream_v1::model::json_file_format::JsonCompression;
11522 /// let x0 = JsonFileFormat::new().set_compression(JsonCompression::NoCompression);
11523 /// let x1 = JsonFileFormat::new().set_compression(JsonCompression::Gzip);
11524 /// ```
11525 pub fn set_compression<
11526 T: std::convert::Into<crate::model::json_file_format::JsonCompression>,
11527 >(
11528 mut self,
11529 v: T,
11530 ) -> Self {
11531 self.compression = v.into();
11532 self
11533 }
11534}
11535
11536impl wkt::message::Message for JsonFileFormat {
11537 fn typename() -> &'static str {
11538 "type.googleapis.com/google.cloud.datastream.v1.JsonFileFormat"
11539 }
11540}
11541
11542/// Defines additional types related to [JsonFileFormat].
11543pub mod json_file_format {
11544 #[allow(unused_imports)]
11545 use super::*;
11546
11547 /// Schema file format.
11548 ///
11549 /// # Working with unknown values
11550 ///
11551 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11552 /// additional enum variants at any time. Adding new variants is not considered
11553 /// a breaking change. Applications should write their code in anticipation of:
11554 ///
11555 /// - New values appearing in future releases of the client library, **and**
11556 /// - New values received dynamically, without application changes.
11557 ///
11558 /// Please consult the [Working with enums] section in the user guide for some
11559 /// guidelines.
11560 ///
11561 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11562 #[derive(Clone, Debug, PartialEq)]
11563 #[non_exhaustive]
11564 pub enum SchemaFileFormat {
11565 /// Unspecified schema file format.
11566 Unspecified,
11567 /// Do not attach schema file.
11568 NoSchemaFile,
11569 /// Avro schema format.
11570 AvroSchemaFile,
11571 /// If set, the enum was initialized with an unknown value.
11572 ///
11573 /// Applications can examine the value using [SchemaFileFormat::value] or
11574 /// [SchemaFileFormat::name].
11575 UnknownValue(schema_file_format::UnknownValue),
11576 }
11577
11578 #[doc(hidden)]
11579 pub mod schema_file_format {
11580 #[allow(unused_imports)]
11581 use super::*;
11582 #[derive(Clone, Debug, PartialEq)]
11583 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11584 }
11585
11586 impl SchemaFileFormat {
11587 /// Gets the enum value.
11588 ///
11589 /// Returns `None` if the enum contains an unknown value deserialized from
11590 /// the string representation of enums.
11591 pub fn value(&self) -> std::option::Option<i32> {
11592 match self {
11593 Self::Unspecified => std::option::Option::Some(0),
11594 Self::NoSchemaFile => std::option::Option::Some(1),
11595 Self::AvroSchemaFile => std::option::Option::Some(2),
11596 Self::UnknownValue(u) => u.0.value(),
11597 }
11598 }
11599
11600 /// Gets the enum value as a string.
11601 ///
11602 /// Returns `None` if the enum contains an unknown value deserialized from
11603 /// the integer representation of enums.
11604 pub fn name(&self) -> std::option::Option<&str> {
11605 match self {
11606 Self::Unspecified => std::option::Option::Some("SCHEMA_FILE_FORMAT_UNSPECIFIED"),
11607 Self::NoSchemaFile => std::option::Option::Some("NO_SCHEMA_FILE"),
11608 Self::AvroSchemaFile => std::option::Option::Some("AVRO_SCHEMA_FILE"),
11609 Self::UnknownValue(u) => u.0.name(),
11610 }
11611 }
11612 }
11613
11614 impl std::default::Default for SchemaFileFormat {
11615 fn default() -> Self {
11616 use std::convert::From;
11617 Self::from(0)
11618 }
11619 }
11620
11621 impl std::fmt::Display for SchemaFileFormat {
11622 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11623 wkt::internal::display_enum(f, self.name(), self.value())
11624 }
11625 }
11626
11627 impl std::convert::From<i32> for SchemaFileFormat {
11628 fn from(value: i32) -> Self {
11629 match value {
11630 0 => Self::Unspecified,
11631 1 => Self::NoSchemaFile,
11632 2 => Self::AvroSchemaFile,
11633 _ => Self::UnknownValue(schema_file_format::UnknownValue(
11634 wkt::internal::UnknownEnumValue::Integer(value),
11635 )),
11636 }
11637 }
11638 }
11639
11640 impl std::convert::From<&str> for SchemaFileFormat {
11641 fn from(value: &str) -> Self {
11642 use std::string::ToString;
11643 match value {
11644 "SCHEMA_FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
11645 "NO_SCHEMA_FILE" => Self::NoSchemaFile,
11646 "AVRO_SCHEMA_FILE" => Self::AvroSchemaFile,
11647 _ => Self::UnknownValue(schema_file_format::UnknownValue(
11648 wkt::internal::UnknownEnumValue::String(value.to_string()),
11649 )),
11650 }
11651 }
11652 }
11653
11654 impl serde::ser::Serialize for SchemaFileFormat {
11655 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11656 where
11657 S: serde::Serializer,
11658 {
11659 match self {
11660 Self::Unspecified => serializer.serialize_i32(0),
11661 Self::NoSchemaFile => serializer.serialize_i32(1),
11662 Self::AvroSchemaFile => serializer.serialize_i32(2),
11663 Self::UnknownValue(u) => u.0.serialize(serializer),
11664 }
11665 }
11666 }
11667
11668 impl<'de> serde::de::Deserialize<'de> for SchemaFileFormat {
11669 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11670 where
11671 D: serde::Deserializer<'de>,
11672 {
11673 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SchemaFileFormat>::new(
11674 ".google.cloud.datastream.v1.JsonFileFormat.SchemaFileFormat",
11675 ))
11676 }
11677 }
11678
11679 /// Json file compression.
11680 ///
11681 /// # Working with unknown values
11682 ///
11683 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11684 /// additional enum variants at any time. Adding new variants is not considered
11685 /// a breaking change. Applications should write their code in anticipation of:
11686 ///
11687 /// - New values appearing in future releases of the client library, **and**
11688 /// - New values received dynamically, without application changes.
11689 ///
11690 /// Please consult the [Working with enums] section in the user guide for some
11691 /// guidelines.
11692 ///
11693 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
11694 #[derive(Clone, Debug, PartialEq)]
11695 #[non_exhaustive]
11696 pub enum JsonCompression {
11697 /// Unspecified json file compression.
11698 Unspecified,
11699 /// Do not compress JSON file.
11700 NoCompression,
11701 /// Gzip compression.
11702 Gzip,
11703 /// If set, the enum was initialized with an unknown value.
11704 ///
11705 /// Applications can examine the value using [JsonCompression::value] or
11706 /// [JsonCompression::name].
11707 UnknownValue(json_compression::UnknownValue),
11708 }
11709
11710 #[doc(hidden)]
11711 pub mod json_compression {
11712 #[allow(unused_imports)]
11713 use super::*;
11714 #[derive(Clone, Debug, PartialEq)]
11715 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11716 }
11717
11718 impl JsonCompression {
11719 /// Gets the enum value.
11720 ///
11721 /// Returns `None` if the enum contains an unknown value deserialized from
11722 /// the string representation of enums.
11723 pub fn value(&self) -> std::option::Option<i32> {
11724 match self {
11725 Self::Unspecified => std::option::Option::Some(0),
11726 Self::NoCompression => std::option::Option::Some(1),
11727 Self::Gzip => std::option::Option::Some(2),
11728 Self::UnknownValue(u) => u.0.value(),
11729 }
11730 }
11731
11732 /// Gets the enum value as a string.
11733 ///
11734 /// Returns `None` if the enum contains an unknown value deserialized from
11735 /// the integer representation of enums.
11736 pub fn name(&self) -> std::option::Option<&str> {
11737 match self {
11738 Self::Unspecified => std::option::Option::Some("JSON_COMPRESSION_UNSPECIFIED"),
11739 Self::NoCompression => std::option::Option::Some("NO_COMPRESSION"),
11740 Self::Gzip => std::option::Option::Some("GZIP"),
11741 Self::UnknownValue(u) => u.0.name(),
11742 }
11743 }
11744 }
11745
11746 impl std::default::Default for JsonCompression {
11747 fn default() -> Self {
11748 use std::convert::From;
11749 Self::from(0)
11750 }
11751 }
11752
11753 impl std::fmt::Display for JsonCompression {
11754 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11755 wkt::internal::display_enum(f, self.name(), self.value())
11756 }
11757 }
11758
11759 impl std::convert::From<i32> for JsonCompression {
11760 fn from(value: i32) -> Self {
11761 match value {
11762 0 => Self::Unspecified,
11763 1 => Self::NoCompression,
11764 2 => Self::Gzip,
11765 _ => Self::UnknownValue(json_compression::UnknownValue(
11766 wkt::internal::UnknownEnumValue::Integer(value),
11767 )),
11768 }
11769 }
11770 }
11771
11772 impl std::convert::From<&str> for JsonCompression {
11773 fn from(value: &str) -> Self {
11774 use std::string::ToString;
11775 match value {
11776 "JSON_COMPRESSION_UNSPECIFIED" => Self::Unspecified,
11777 "NO_COMPRESSION" => Self::NoCompression,
11778 "GZIP" => Self::Gzip,
11779 _ => Self::UnknownValue(json_compression::UnknownValue(
11780 wkt::internal::UnknownEnumValue::String(value.to_string()),
11781 )),
11782 }
11783 }
11784 }
11785
11786 impl serde::ser::Serialize for JsonCompression {
11787 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11788 where
11789 S: serde::Serializer,
11790 {
11791 match self {
11792 Self::Unspecified => serializer.serialize_i32(0),
11793 Self::NoCompression => serializer.serialize_i32(1),
11794 Self::Gzip => serializer.serialize_i32(2),
11795 Self::UnknownValue(u) => u.0.serialize(serializer),
11796 }
11797 }
11798 }
11799
11800 impl<'de> serde::de::Deserialize<'de> for JsonCompression {
11801 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11802 where
11803 D: serde::Deserializer<'de>,
11804 {
11805 deserializer.deserialize_any(wkt::internal::EnumVisitor::<JsonCompression>::new(
11806 ".google.cloud.datastream.v1.JsonFileFormat.JsonCompression",
11807 ))
11808 }
11809 }
11810}
11811
11812/// Google Cloud Storage destination configuration
11813#[derive(Clone, Default, PartialEq)]
11814#[non_exhaustive]
11815pub struct GcsDestinationConfig {
11816 /// Path inside the Cloud Storage bucket to write data to.
11817 pub path: std::string::String,
11818
11819 /// The maximum file size to be saved in the bucket.
11820 pub file_rotation_mb: i32,
11821
11822 /// The maximum duration for which new events are added before a file is
11823 /// closed and a new file is created. Values within the range of 15-60 seconds
11824 /// are allowed.
11825 pub file_rotation_interval: std::option::Option<wkt::Duration>,
11826
11827 /// File Format that the data should be written in.
11828 pub file_format: std::option::Option<crate::model::gcs_destination_config::FileFormat>,
11829
11830 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11831}
11832
11833impl GcsDestinationConfig {
11834 pub fn new() -> Self {
11835 std::default::Default::default()
11836 }
11837
11838 /// Sets the value of [path][crate::model::GcsDestinationConfig::path].
11839 ///
11840 /// # Example
11841 /// ```ignore,no_run
11842 /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11843 /// let x = GcsDestinationConfig::new().set_path("example");
11844 /// ```
11845 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11846 self.path = v.into();
11847 self
11848 }
11849
11850 /// Sets the value of [file_rotation_mb][crate::model::GcsDestinationConfig::file_rotation_mb].
11851 ///
11852 /// # Example
11853 /// ```ignore,no_run
11854 /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11855 /// let x = GcsDestinationConfig::new().set_file_rotation_mb(42);
11856 /// ```
11857 pub fn set_file_rotation_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11858 self.file_rotation_mb = v.into();
11859 self
11860 }
11861
11862 /// Sets the value of [file_rotation_interval][crate::model::GcsDestinationConfig::file_rotation_interval].
11863 ///
11864 /// # Example
11865 /// ```ignore,no_run
11866 /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11867 /// use wkt::Duration;
11868 /// let x = GcsDestinationConfig::new().set_file_rotation_interval(Duration::default()/* use setters */);
11869 /// ```
11870 pub fn set_file_rotation_interval<T>(mut self, v: T) -> Self
11871 where
11872 T: std::convert::Into<wkt::Duration>,
11873 {
11874 self.file_rotation_interval = std::option::Option::Some(v.into());
11875 self
11876 }
11877
11878 /// Sets or clears the value of [file_rotation_interval][crate::model::GcsDestinationConfig::file_rotation_interval].
11879 ///
11880 /// # Example
11881 /// ```ignore,no_run
11882 /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11883 /// use wkt::Duration;
11884 /// let x = GcsDestinationConfig::new().set_or_clear_file_rotation_interval(Some(Duration::default()/* use setters */));
11885 /// let x = GcsDestinationConfig::new().set_or_clear_file_rotation_interval(None::<Duration>);
11886 /// ```
11887 pub fn set_or_clear_file_rotation_interval<T>(mut self, v: std::option::Option<T>) -> Self
11888 where
11889 T: std::convert::Into<wkt::Duration>,
11890 {
11891 self.file_rotation_interval = v.map(|x| x.into());
11892 self
11893 }
11894
11895 /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format].
11896 ///
11897 /// Note that all the setters affecting `file_format` are mutually
11898 /// exclusive.
11899 ///
11900 /// # Example
11901 /// ```ignore,no_run
11902 /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11903 /// use google_cloud_datastream_v1::model::AvroFileFormat;
11904 /// let x = GcsDestinationConfig::new().set_file_format(Some(
11905 /// google_cloud_datastream_v1::model::gcs_destination_config::FileFormat::AvroFileFormat(AvroFileFormat::default().into())));
11906 /// ```
11907 pub fn set_file_format<
11908 T: std::convert::Into<std::option::Option<crate::model::gcs_destination_config::FileFormat>>,
11909 >(
11910 mut self,
11911 v: T,
11912 ) -> Self {
11913 self.file_format = v.into();
11914 self
11915 }
11916
11917 /// The value of [file_format][crate::model::GcsDestinationConfig::file_format]
11918 /// if it holds a `AvroFileFormat`, `None` if the field is not set or
11919 /// holds a different branch.
11920 pub fn avro_file_format(
11921 &self,
11922 ) -> std::option::Option<&std::boxed::Box<crate::model::AvroFileFormat>> {
11923 #[allow(unreachable_patterns)]
11924 self.file_format.as_ref().and_then(|v| match v {
11925 crate::model::gcs_destination_config::FileFormat::AvroFileFormat(v) => {
11926 std::option::Option::Some(v)
11927 }
11928 _ => std::option::Option::None,
11929 })
11930 }
11931
11932 /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format]
11933 /// to hold a `AvroFileFormat`.
11934 ///
11935 /// Note that all the setters affecting `file_format` are
11936 /// mutually exclusive.
11937 ///
11938 /// # Example
11939 /// ```ignore,no_run
11940 /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11941 /// use google_cloud_datastream_v1::model::AvroFileFormat;
11942 /// let x = GcsDestinationConfig::new().set_avro_file_format(AvroFileFormat::default()/* use setters */);
11943 /// assert!(x.avro_file_format().is_some());
11944 /// assert!(x.json_file_format().is_none());
11945 /// ```
11946 pub fn set_avro_file_format<
11947 T: std::convert::Into<std::boxed::Box<crate::model::AvroFileFormat>>,
11948 >(
11949 mut self,
11950 v: T,
11951 ) -> Self {
11952 self.file_format = std::option::Option::Some(
11953 crate::model::gcs_destination_config::FileFormat::AvroFileFormat(v.into()),
11954 );
11955 self
11956 }
11957
11958 /// The value of [file_format][crate::model::GcsDestinationConfig::file_format]
11959 /// if it holds a `JsonFileFormat`, `None` if the field is not set or
11960 /// holds a different branch.
11961 pub fn json_file_format(
11962 &self,
11963 ) -> std::option::Option<&std::boxed::Box<crate::model::JsonFileFormat>> {
11964 #[allow(unreachable_patterns)]
11965 self.file_format.as_ref().and_then(|v| match v {
11966 crate::model::gcs_destination_config::FileFormat::JsonFileFormat(v) => {
11967 std::option::Option::Some(v)
11968 }
11969 _ => std::option::Option::None,
11970 })
11971 }
11972
11973 /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format]
11974 /// to hold a `JsonFileFormat`.
11975 ///
11976 /// Note that all the setters affecting `file_format` are
11977 /// mutually exclusive.
11978 ///
11979 /// # Example
11980 /// ```ignore,no_run
11981 /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
11982 /// use google_cloud_datastream_v1::model::JsonFileFormat;
11983 /// let x = GcsDestinationConfig::new().set_json_file_format(JsonFileFormat::default()/* use setters */);
11984 /// assert!(x.json_file_format().is_some());
11985 /// assert!(x.avro_file_format().is_none());
11986 /// ```
11987 pub fn set_json_file_format<
11988 T: std::convert::Into<std::boxed::Box<crate::model::JsonFileFormat>>,
11989 >(
11990 mut self,
11991 v: T,
11992 ) -> Self {
11993 self.file_format = std::option::Option::Some(
11994 crate::model::gcs_destination_config::FileFormat::JsonFileFormat(v.into()),
11995 );
11996 self
11997 }
11998}
11999
12000impl wkt::message::Message for GcsDestinationConfig {
12001 fn typename() -> &'static str {
12002 "type.googleapis.com/google.cloud.datastream.v1.GcsDestinationConfig"
12003 }
12004}
12005
12006/// Defines additional types related to [GcsDestinationConfig].
12007pub mod gcs_destination_config {
12008 #[allow(unused_imports)]
12009 use super::*;
12010
12011 /// File Format that the data should be written in.
12012 #[derive(Clone, Debug, PartialEq)]
12013 #[non_exhaustive]
12014 pub enum FileFormat {
12015 /// AVRO file format configuration.
12016 AvroFileFormat(std::boxed::Box<crate::model::AvroFileFormat>),
12017 /// JSON file format configuration.
12018 JsonFileFormat(std::boxed::Box<crate::model::JsonFileFormat>),
12019 }
12020}
12021
12022/// BigQuery destination configuration
12023#[derive(Clone, Default, PartialEq)]
12024#[non_exhaustive]
12025pub struct BigQueryDestinationConfig {
12026 /// The guaranteed data freshness (in seconds) when querying tables created by
12027 /// the stream. Editing this field will only affect new tables created in the
12028 /// future, but existing tables will not be impacted. Lower values mean that
12029 /// queries will return fresher data, but may result in higher cost.
12030 pub data_freshness: std::option::Option<wkt::Duration>,
12031
12032 /// Optional. Big Lake Managed Tables (BLMT) configuration.
12033 pub blmt_config: std::option::Option<crate::model::big_query_destination_config::BlmtConfig>,
12034
12035 /// Target dataset(s) configuration.
12036 pub dataset_config:
12037 std::option::Option<crate::model::big_query_destination_config::DatasetConfig>,
12038
12039 pub write_mode: std::option::Option<crate::model::big_query_destination_config::WriteMode>,
12040
12041 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12042}
12043
12044impl BigQueryDestinationConfig {
12045 pub fn new() -> Self {
12046 std::default::Default::default()
12047 }
12048
12049 /// Sets the value of [data_freshness][crate::model::BigQueryDestinationConfig::data_freshness].
12050 ///
12051 /// # Example
12052 /// ```ignore,no_run
12053 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12054 /// use wkt::Duration;
12055 /// let x = BigQueryDestinationConfig::new().set_data_freshness(Duration::default()/* use setters */);
12056 /// ```
12057 pub fn set_data_freshness<T>(mut self, v: T) -> Self
12058 where
12059 T: std::convert::Into<wkt::Duration>,
12060 {
12061 self.data_freshness = std::option::Option::Some(v.into());
12062 self
12063 }
12064
12065 /// Sets or clears the value of [data_freshness][crate::model::BigQueryDestinationConfig::data_freshness].
12066 ///
12067 /// # Example
12068 /// ```ignore,no_run
12069 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12070 /// use wkt::Duration;
12071 /// let x = BigQueryDestinationConfig::new().set_or_clear_data_freshness(Some(Duration::default()/* use setters */));
12072 /// let x = BigQueryDestinationConfig::new().set_or_clear_data_freshness(None::<Duration>);
12073 /// ```
12074 pub fn set_or_clear_data_freshness<T>(mut self, v: std::option::Option<T>) -> Self
12075 where
12076 T: std::convert::Into<wkt::Duration>,
12077 {
12078 self.data_freshness = v.map(|x| x.into());
12079 self
12080 }
12081
12082 /// Sets the value of [blmt_config][crate::model::BigQueryDestinationConfig::blmt_config].
12083 ///
12084 /// # Example
12085 /// ```ignore,no_run
12086 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12087 /// use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12088 /// let x = BigQueryDestinationConfig::new().set_blmt_config(BlmtConfig::default()/* use setters */);
12089 /// ```
12090 pub fn set_blmt_config<T>(mut self, v: T) -> Self
12091 where
12092 T: std::convert::Into<crate::model::big_query_destination_config::BlmtConfig>,
12093 {
12094 self.blmt_config = std::option::Option::Some(v.into());
12095 self
12096 }
12097
12098 /// Sets or clears the value of [blmt_config][crate::model::BigQueryDestinationConfig::blmt_config].
12099 ///
12100 /// # Example
12101 /// ```ignore,no_run
12102 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12103 /// use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12104 /// let x = BigQueryDestinationConfig::new().set_or_clear_blmt_config(Some(BlmtConfig::default()/* use setters */));
12105 /// let x = BigQueryDestinationConfig::new().set_or_clear_blmt_config(None::<BlmtConfig>);
12106 /// ```
12107 pub fn set_or_clear_blmt_config<T>(mut self, v: std::option::Option<T>) -> Self
12108 where
12109 T: std::convert::Into<crate::model::big_query_destination_config::BlmtConfig>,
12110 {
12111 self.blmt_config = v.map(|x| x.into());
12112 self
12113 }
12114
12115 /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config].
12116 ///
12117 /// Note that all the setters affecting `dataset_config` are mutually
12118 /// exclusive.
12119 ///
12120 /// # Example
12121 /// ```ignore,no_run
12122 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12123 /// use google_cloud_datastream_v1::model::big_query_destination_config::SingleTargetDataset;
12124 /// let x = BigQueryDestinationConfig::new().set_dataset_config(Some(
12125 /// google_cloud_datastream_v1::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(SingleTargetDataset::default().into())));
12126 /// ```
12127 pub fn set_dataset_config<
12128 T: std::convert::Into<
12129 std::option::Option<crate::model::big_query_destination_config::DatasetConfig>,
12130 >,
12131 >(
12132 mut self,
12133 v: T,
12134 ) -> Self {
12135 self.dataset_config = v.into();
12136 self
12137 }
12138
12139 /// The value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12140 /// if it holds a `SingleTargetDataset`, `None` if the field is not set or
12141 /// holds a different branch.
12142 pub fn single_target_dataset(
12143 &self,
12144 ) -> std::option::Option<
12145 &std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
12146 > {
12147 #[allow(unreachable_patterns)]
12148 self.dataset_config.as_ref().and_then(|v| match v {
12149 crate::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(v) => {
12150 std::option::Option::Some(v)
12151 }
12152 _ => std::option::Option::None,
12153 })
12154 }
12155
12156 /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12157 /// to hold a `SingleTargetDataset`.
12158 ///
12159 /// Note that all the setters affecting `dataset_config` are
12160 /// mutually exclusive.
12161 ///
12162 /// # Example
12163 /// ```ignore,no_run
12164 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12165 /// use google_cloud_datastream_v1::model::big_query_destination_config::SingleTargetDataset;
12166 /// let x = BigQueryDestinationConfig::new().set_single_target_dataset(SingleTargetDataset::default()/* use setters */);
12167 /// assert!(x.single_target_dataset().is_some());
12168 /// assert!(x.source_hierarchy_datasets().is_none());
12169 /// ```
12170 pub fn set_single_target_dataset<
12171 T: std::convert::Into<
12172 std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
12173 >,
12174 >(
12175 mut self,
12176 v: T,
12177 ) -> Self {
12178 self.dataset_config = std::option::Option::Some(
12179 crate::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(
12180 v.into(),
12181 ),
12182 );
12183 self
12184 }
12185
12186 /// The value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12187 /// if it holds a `SourceHierarchyDatasets`, `None` if the field is not set or
12188 /// holds a different branch.
12189 pub fn source_hierarchy_datasets(
12190 &self,
12191 ) -> std::option::Option<
12192 &std::boxed::Box<crate::model::big_query_destination_config::SourceHierarchyDatasets>,
12193 > {
12194 #[allow(unreachable_patterns)]
12195 self.dataset_config.as_ref().and_then(|v| match v {
12196 crate::model::big_query_destination_config::DatasetConfig::SourceHierarchyDatasets(
12197 v,
12198 ) => std::option::Option::Some(v),
12199 _ => std::option::Option::None,
12200 })
12201 }
12202
12203 /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12204 /// to hold a `SourceHierarchyDatasets`.
12205 ///
12206 /// Note that all the setters affecting `dataset_config` are
12207 /// mutually exclusive.
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::SourceHierarchyDatasets;
12213 /// let x = BigQueryDestinationConfig::new().set_source_hierarchy_datasets(SourceHierarchyDatasets::default()/* use setters */);
12214 /// assert!(x.source_hierarchy_datasets().is_some());
12215 /// assert!(x.single_target_dataset().is_none());
12216 /// ```
12217 pub fn set_source_hierarchy_datasets<
12218 T: std::convert::Into<
12219 std::boxed::Box<
12220 crate::model::big_query_destination_config::SourceHierarchyDatasets,
12221 >,
12222 >,
12223 >(
12224 mut self,
12225 v: T,
12226 ) -> Self {
12227 self.dataset_config = std::option::Option::Some(
12228 crate::model::big_query_destination_config::DatasetConfig::SourceHierarchyDatasets(
12229 v.into(),
12230 ),
12231 );
12232 self
12233 }
12234
12235 /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode].
12236 ///
12237 /// Note that all the setters affecting `write_mode` are mutually
12238 /// exclusive.
12239 ///
12240 /// # Example
12241 /// ```ignore,no_run
12242 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12243 /// use google_cloud_datastream_v1::model::big_query_destination_config::Merge;
12244 /// let x = BigQueryDestinationConfig::new().set_write_mode(Some(
12245 /// google_cloud_datastream_v1::model::big_query_destination_config::WriteMode::Merge(Merge::default().into())));
12246 /// ```
12247 pub fn set_write_mode<
12248 T: std::convert::Into<
12249 std::option::Option<crate::model::big_query_destination_config::WriteMode>,
12250 >,
12251 >(
12252 mut self,
12253 v: T,
12254 ) -> Self {
12255 self.write_mode = v.into();
12256 self
12257 }
12258
12259 /// The value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12260 /// if it holds a `Merge`, `None` if the field is not set or
12261 /// holds a different branch.
12262 pub fn merge(
12263 &self,
12264 ) -> std::option::Option<&std::boxed::Box<crate::model::big_query_destination_config::Merge>>
12265 {
12266 #[allow(unreachable_patterns)]
12267 self.write_mode.as_ref().and_then(|v| match v {
12268 crate::model::big_query_destination_config::WriteMode::Merge(v) => {
12269 std::option::Option::Some(v)
12270 }
12271 _ => std::option::Option::None,
12272 })
12273 }
12274
12275 /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12276 /// to hold a `Merge`.
12277 ///
12278 /// Note that all the setters affecting `write_mode` are
12279 /// mutually exclusive.
12280 ///
12281 /// # Example
12282 /// ```ignore,no_run
12283 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12284 /// use google_cloud_datastream_v1::model::big_query_destination_config::Merge;
12285 /// let x = BigQueryDestinationConfig::new().set_merge(Merge::default()/* use setters */);
12286 /// assert!(x.merge().is_some());
12287 /// assert!(x.append_only().is_none());
12288 /// ```
12289 pub fn set_merge<
12290 T: std::convert::Into<std::boxed::Box<crate::model::big_query_destination_config::Merge>>,
12291 >(
12292 mut self,
12293 v: T,
12294 ) -> Self {
12295 self.write_mode = std::option::Option::Some(
12296 crate::model::big_query_destination_config::WriteMode::Merge(v.into()),
12297 );
12298 self
12299 }
12300
12301 /// The value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12302 /// if it holds a `AppendOnly`, `None` if the field is not set or
12303 /// holds a different branch.
12304 pub fn append_only(
12305 &self,
12306 ) -> std::option::Option<&std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>>
12307 {
12308 #[allow(unreachable_patterns)]
12309 self.write_mode.as_ref().and_then(|v| match v {
12310 crate::model::big_query_destination_config::WriteMode::AppendOnly(v) => {
12311 std::option::Option::Some(v)
12312 }
12313 _ => std::option::Option::None,
12314 })
12315 }
12316
12317 /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12318 /// to hold a `AppendOnly`.
12319 ///
12320 /// Note that all the setters affecting `write_mode` are
12321 /// mutually exclusive.
12322 ///
12323 /// # Example
12324 /// ```ignore,no_run
12325 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12326 /// use google_cloud_datastream_v1::model::big_query_destination_config::AppendOnly;
12327 /// let x = BigQueryDestinationConfig::new().set_append_only(AppendOnly::default()/* use setters */);
12328 /// assert!(x.append_only().is_some());
12329 /// assert!(x.merge().is_none());
12330 /// ```
12331 pub fn set_append_only<
12332 T: std::convert::Into<std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>>,
12333 >(
12334 mut self,
12335 v: T,
12336 ) -> Self {
12337 self.write_mode = std::option::Option::Some(
12338 crate::model::big_query_destination_config::WriteMode::AppendOnly(v.into()),
12339 );
12340 self
12341 }
12342}
12343
12344impl wkt::message::Message for BigQueryDestinationConfig {
12345 fn typename() -> &'static str {
12346 "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig"
12347 }
12348}
12349
12350/// Defines additional types related to [BigQueryDestinationConfig].
12351pub mod big_query_destination_config {
12352 #[allow(unused_imports)]
12353 use super::*;
12354
12355 /// A single target dataset to which all data will be streamed.
12356 #[derive(Clone, Default, PartialEq)]
12357 #[non_exhaustive]
12358 pub struct SingleTargetDataset {
12359 /// The dataset ID of the target dataset.
12360 /// DatasetIds allowed characters:
12361 /// <https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets#datasetreference>.
12362 pub dataset_id: std::string::String,
12363
12364 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12365 }
12366
12367 impl SingleTargetDataset {
12368 pub fn new() -> Self {
12369 std::default::Default::default()
12370 }
12371
12372 /// Sets the value of [dataset_id][crate::model::big_query_destination_config::SingleTargetDataset::dataset_id].
12373 ///
12374 /// # Example
12375 /// ```ignore,no_run
12376 /// # use google_cloud_datastream_v1::model::big_query_destination_config::SingleTargetDataset;
12377 /// let x = SingleTargetDataset::new().set_dataset_id("example");
12378 /// ```
12379 pub fn set_dataset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12380 self.dataset_id = v.into();
12381 self
12382 }
12383 }
12384
12385 impl wkt::message::Message for SingleTargetDataset {
12386 fn typename() -> &'static str {
12387 "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SingleTargetDataset"
12388 }
12389 }
12390
12391 /// Destination datasets are created so that hierarchy of the destination data
12392 /// objects matches the source hierarchy.
12393 #[derive(Clone, Default, PartialEq)]
12394 #[non_exhaustive]
12395 pub struct SourceHierarchyDatasets {
12396 /// The dataset template to use for dynamic dataset creation.
12397 pub dataset_template: std::option::Option<
12398 crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate,
12399 >,
12400
12401 /// Optional. The project id of the BigQuery dataset. If not specified, the
12402 /// project will be inferred from the stream resource.
12403 pub project_id: std::option::Option<std::string::String>,
12404
12405 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12406 }
12407
12408 impl SourceHierarchyDatasets {
12409 pub fn new() -> Self {
12410 std::default::Default::default()
12411 }
12412
12413 /// Sets the value of [dataset_template][crate::model::big_query_destination_config::SourceHierarchyDatasets::dataset_template].
12414 ///
12415 /// # Example
12416 /// ```ignore,no_run
12417 /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12418 /// use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12419 /// let x = SourceHierarchyDatasets::new().set_dataset_template(DatasetTemplate::default()/* use setters */);
12420 /// ```
12421 pub fn set_dataset_template<T>(mut self, v: T) -> Self
12422 where T: std::convert::Into<crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate>
12423 {
12424 self.dataset_template = std::option::Option::Some(v.into());
12425 self
12426 }
12427
12428 /// Sets or clears the value of [dataset_template][crate::model::big_query_destination_config::SourceHierarchyDatasets::dataset_template].
12429 ///
12430 /// # Example
12431 /// ```ignore,no_run
12432 /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12433 /// use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12434 /// let x = SourceHierarchyDatasets::new().set_or_clear_dataset_template(Some(DatasetTemplate::default()/* use setters */));
12435 /// let x = SourceHierarchyDatasets::new().set_or_clear_dataset_template(None::<DatasetTemplate>);
12436 /// ```
12437 pub fn set_or_clear_dataset_template<T>(mut self, v: std::option::Option<T>) -> Self
12438 where T: std::convert::Into<crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate>
12439 {
12440 self.dataset_template = v.map(|x| x.into());
12441 self
12442 }
12443
12444 /// Sets the value of [project_id][crate::model::big_query_destination_config::SourceHierarchyDatasets::project_id].
12445 ///
12446 /// # Example
12447 /// ```ignore,no_run
12448 /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12449 /// let x = SourceHierarchyDatasets::new().set_project_id("example");
12450 /// ```
12451 pub fn set_project_id<T>(mut self, v: T) -> Self
12452 where
12453 T: std::convert::Into<std::string::String>,
12454 {
12455 self.project_id = std::option::Option::Some(v.into());
12456 self
12457 }
12458
12459 /// Sets or clears the value of [project_id][crate::model::big_query_destination_config::SourceHierarchyDatasets::project_id].
12460 ///
12461 /// # Example
12462 /// ```ignore,no_run
12463 /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12464 /// let x = SourceHierarchyDatasets::new().set_or_clear_project_id(Some("example"));
12465 /// let x = SourceHierarchyDatasets::new().set_or_clear_project_id(None::<String>);
12466 /// ```
12467 pub fn set_or_clear_project_id<T>(mut self, v: std::option::Option<T>) -> Self
12468 where
12469 T: std::convert::Into<std::string::String>,
12470 {
12471 self.project_id = v.map(|x| x.into());
12472 self
12473 }
12474 }
12475
12476 impl wkt::message::Message for SourceHierarchyDatasets {
12477 fn typename() -> &'static str {
12478 "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SourceHierarchyDatasets"
12479 }
12480 }
12481
12482 /// Defines additional types related to [SourceHierarchyDatasets].
12483 pub mod source_hierarchy_datasets {
12484 #[allow(unused_imports)]
12485 use super::*;
12486
12487 /// Dataset template used for dynamic dataset creation.
12488 #[derive(Clone, Default, PartialEq)]
12489 #[non_exhaustive]
12490 pub struct DatasetTemplate {
12491 /// Required. The geographic location where the dataset should reside. See
12492 /// <https://cloud.google.com/bigquery/docs/locations> for supported
12493 /// locations.
12494 pub location: std::string::String,
12495
12496 /// If supplied, every created dataset will have its name prefixed by the
12497 /// provided value. The prefix and name will be separated by an underscore.
12498 /// i.e. \<prefix\>_<dataset_name>.
12499 pub dataset_id_prefix: std::string::String,
12500
12501 /// Describes the Cloud KMS encryption key that will be used to
12502 /// protect destination BigQuery table. The BigQuery Service Account
12503 /// associated with your project requires access to this encryption key.
12504 /// i.e.
12505 /// projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{cryptoKey}.
12506 /// See <https://cloud.google.com/bigquery/docs/customer-managed-encryption>
12507 /// for more information.
12508 pub kms_key_name: std::string::String,
12509
12510 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12511 }
12512
12513 impl DatasetTemplate {
12514 pub fn new() -> Self {
12515 std::default::Default::default()
12516 }
12517
12518 /// Sets the value of [location][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::location].
12519 ///
12520 /// # Example
12521 /// ```ignore,no_run
12522 /// # use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12523 /// let x = DatasetTemplate::new().set_location("example");
12524 /// ```
12525 pub fn set_location<T: std::convert::Into<std::string::String>>(
12526 mut self,
12527 v: T,
12528 ) -> Self {
12529 self.location = v.into();
12530 self
12531 }
12532
12533 /// Sets the value of [dataset_id_prefix][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::dataset_id_prefix].
12534 ///
12535 /// # Example
12536 /// ```ignore,no_run
12537 /// # use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12538 /// let x = DatasetTemplate::new().set_dataset_id_prefix("example");
12539 /// ```
12540 pub fn set_dataset_id_prefix<T: std::convert::Into<std::string::String>>(
12541 mut self,
12542 v: T,
12543 ) -> Self {
12544 self.dataset_id_prefix = v.into();
12545 self
12546 }
12547
12548 /// Sets the value of [kms_key_name][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::kms_key_name].
12549 ///
12550 /// # Example
12551 /// ```ignore,no_run
12552 /// # use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12553 /// let x = DatasetTemplate::new().set_kms_key_name("example");
12554 /// ```
12555 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(
12556 mut self,
12557 v: T,
12558 ) -> Self {
12559 self.kms_key_name = v.into();
12560 self
12561 }
12562 }
12563
12564 impl wkt::message::Message for DatasetTemplate {
12565 fn typename() -> &'static str {
12566 "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SourceHierarchyDatasets.DatasetTemplate"
12567 }
12568 }
12569 }
12570
12571 /// The configuration for BLMT.
12572 #[derive(Clone, Default, PartialEq)]
12573 #[non_exhaustive]
12574 pub struct BlmtConfig {
12575 /// Required. The Cloud Storage bucket name.
12576 pub bucket: std::string::String,
12577
12578 /// The root path inside the Cloud Storage bucket.
12579 pub root_path: std::string::String,
12580
12581 /// Required. The bigquery connection.
12582 /// Format: `{project}.{location}.{name}`
12583 pub connection_name: std::string::String,
12584
12585 /// Required. The file format.
12586 pub file_format: crate::model::big_query_destination_config::blmt_config::FileFormat,
12587
12588 /// Required. The table format.
12589 pub table_format: crate::model::big_query_destination_config::blmt_config::TableFormat,
12590
12591 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12592 }
12593
12594 impl BlmtConfig {
12595 pub fn new() -> Self {
12596 std::default::Default::default()
12597 }
12598
12599 /// Sets the value of [bucket][crate::model::big_query_destination_config::BlmtConfig::bucket].
12600 ///
12601 /// # Example
12602 /// ```ignore,no_run
12603 /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12604 /// let x = BlmtConfig::new().set_bucket("example");
12605 /// ```
12606 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12607 self.bucket = v.into();
12608 self
12609 }
12610
12611 /// Sets the value of [root_path][crate::model::big_query_destination_config::BlmtConfig::root_path].
12612 ///
12613 /// # Example
12614 /// ```ignore,no_run
12615 /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12616 /// let x = BlmtConfig::new().set_root_path("example");
12617 /// ```
12618 pub fn set_root_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12619 self.root_path = v.into();
12620 self
12621 }
12622
12623 /// Sets the value of [connection_name][crate::model::big_query_destination_config::BlmtConfig::connection_name].
12624 ///
12625 /// # Example
12626 /// ```ignore,no_run
12627 /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12628 /// let x = BlmtConfig::new().set_connection_name("example");
12629 /// ```
12630 pub fn set_connection_name<T: std::convert::Into<std::string::String>>(
12631 mut self,
12632 v: T,
12633 ) -> Self {
12634 self.connection_name = v.into();
12635 self
12636 }
12637
12638 /// Sets the value of [file_format][crate::model::big_query_destination_config::BlmtConfig::file_format].
12639 ///
12640 /// # Example
12641 /// ```ignore,no_run
12642 /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12643 /// use google_cloud_datastream_v1::model::big_query_destination_config::blmt_config::FileFormat;
12644 /// let x0 = BlmtConfig::new().set_file_format(FileFormat::Parquet);
12645 /// ```
12646 pub fn set_file_format<
12647 T: std::convert::Into<crate::model::big_query_destination_config::blmt_config::FileFormat>,
12648 >(
12649 mut self,
12650 v: T,
12651 ) -> Self {
12652 self.file_format = v.into();
12653 self
12654 }
12655
12656 /// Sets the value of [table_format][crate::model::big_query_destination_config::BlmtConfig::table_format].
12657 ///
12658 /// # Example
12659 /// ```ignore,no_run
12660 /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12661 /// use google_cloud_datastream_v1::model::big_query_destination_config::blmt_config::TableFormat;
12662 /// let x0 = BlmtConfig::new().set_table_format(TableFormat::Iceberg);
12663 /// ```
12664 pub fn set_table_format<
12665 T: std::convert::Into<
12666 crate::model::big_query_destination_config::blmt_config::TableFormat,
12667 >,
12668 >(
12669 mut self,
12670 v: T,
12671 ) -> Self {
12672 self.table_format = v.into();
12673 self
12674 }
12675 }
12676
12677 impl wkt::message::Message for BlmtConfig {
12678 fn typename() -> &'static str {
12679 "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig"
12680 }
12681 }
12682
12683 /// Defines additional types related to [BlmtConfig].
12684 pub mod blmt_config {
12685 #[allow(unused_imports)]
12686 use super::*;
12687
12688 /// Supported file formats for BigLake managed tables.
12689 ///
12690 /// # Working with unknown values
12691 ///
12692 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12693 /// additional enum variants at any time. Adding new variants is not considered
12694 /// a breaking change. Applications should write their code in anticipation of:
12695 ///
12696 /// - New values appearing in future releases of the client library, **and**
12697 /// - New values received dynamically, without application changes.
12698 ///
12699 /// Please consult the [Working with enums] section in the user guide for some
12700 /// guidelines.
12701 ///
12702 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12703 #[derive(Clone, Debug, PartialEq)]
12704 #[non_exhaustive]
12705 pub enum FileFormat {
12706 /// Default value.
12707 Unspecified,
12708 /// Parquet file format.
12709 Parquet,
12710 /// If set, the enum was initialized with an unknown value.
12711 ///
12712 /// Applications can examine the value using [FileFormat::value] or
12713 /// [FileFormat::name].
12714 UnknownValue(file_format::UnknownValue),
12715 }
12716
12717 #[doc(hidden)]
12718 pub mod file_format {
12719 #[allow(unused_imports)]
12720 use super::*;
12721 #[derive(Clone, Debug, PartialEq)]
12722 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12723 }
12724
12725 impl FileFormat {
12726 /// Gets the enum value.
12727 ///
12728 /// Returns `None` if the enum contains an unknown value deserialized from
12729 /// the string representation of enums.
12730 pub fn value(&self) -> std::option::Option<i32> {
12731 match self {
12732 Self::Unspecified => std::option::Option::Some(0),
12733 Self::Parquet => std::option::Option::Some(1),
12734 Self::UnknownValue(u) => u.0.value(),
12735 }
12736 }
12737
12738 /// Gets the enum value as a string.
12739 ///
12740 /// Returns `None` if the enum contains an unknown value deserialized from
12741 /// the integer representation of enums.
12742 pub fn name(&self) -> std::option::Option<&str> {
12743 match self {
12744 Self::Unspecified => std::option::Option::Some("FILE_FORMAT_UNSPECIFIED"),
12745 Self::Parquet => std::option::Option::Some("PARQUET"),
12746 Self::UnknownValue(u) => u.0.name(),
12747 }
12748 }
12749 }
12750
12751 impl std::default::Default for FileFormat {
12752 fn default() -> Self {
12753 use std::convert::From;
12754 Self::from(0)
12755 }
12756 }
12757
12758 impl std::fmt::Display for FileFormat {
12759 fn fmt(
12760 &self,
12761 f: &mut std::fmt::Formatter<'_>,
12762 ) -> std::result::Result<(), std::fmt::Error> {
12763 wkt::internal::display_enum(f, self.name(), self.value())
12764 }
12765 }
12766
12767 impl std::convert::From<i32> for FileFormat {
12768 fn from(value: i32) -> Self {
12769 match value {
12770 0 => Self::Unspecified,
12771 1 => Self::Parquet,
12772 _ => Self::UnknownValue(file_format::UnknownValue(
12773 wkt::internal::UnknownEnumValue::Integer(value),
12774 )),
12775 }
12776 }
12777 }
12778
12779 impl std::convert::From<&str> for FileFormat {
12780 fn from(value: &str) -> Self {
12781 use std::string::ToString;
12782 match value {
12783 "FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
12784 "PARQUET" => Self::Parquet,
12785 _ => Self::UnknownValue(file_format::UnknownValue(
12786 wkt::internal::UnknownEnumValue::String(value.to_string()),
12787 )),
12788 }
12789 }
12790 }
12791
12792 impl serde::ser::Serialize for FileFormat {
12793 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12794 where
12795 S: serde::Serializer,
12796 {
12797 match self {
12798 Self::Unspecified => serializer.serialize_i32(0),
12799 Self::Parquet => serializer.serialize_i32(1),
12800 Self::UnknownValue(u) => u.0.serialize(serializer),
12801 }
12802 }
12803 }
12804
12805 impl<'de> serde::de::Deserialize<'de> for FileFormat {
12806 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12807 where
12808 D: serde::Deserializer<'de>,
12809 {
12810 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FileFormat>::new(
12811 ".google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig.FileFormat",
12812 ))
12813 }
12814 }
12815
12816 /// Supported table formats for BigLake managed tables.
12817 ///
12818 /// # Working with unknown values
12819 ///
12820 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12821 /// additional enum variants at any time. Adding new variants is not considered
12822 /// a breaking change. Applications should write their code in anticipation of:
12823 ///
12824 /// - New values appearing in future releases of the client library, **and**
12825 /// - New values received dynamically, without application changes.
12826 ///
12827 /// Please consult the [Working with enums] section in the user guide for some
12828 /// guidelines.
12829 ///
12830 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12831 #[derive(Clone, Debug, PartialEq)]
12832 #[non_exhaustive]
12833 pub enum TableFormat {
12834 /// Default value.
12835 Unspecified,
12836 /// Iceberg table format.
12837 Iceberg,
12838 /// If set, the enum was initialized with an unknown value.
12839 ///
12840 /// Applications can examine the value using [TableFormat::value] or
12841 /// [TableFormat::name].
12842 UnknownValue(table_format::UnknownValue),
12843 }
12844
12845 #[doc(hidden)]
12846 pub mod table_format {
12847 #[allow(unused_imports)]
12848 use super::*;
12849 #[derive(Clone, Debug, PartialEq)]
12850 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12851 }
12852
12853 impl TableFormat {
12854 /// Gets the enum value.
12855 ///
12856 /// Returns `None` if the enum contains an unknown value deserialized from
12857 /// the string representation of enums.
12858 pub fn value(&self) -> std::option::Option<i32> {
12859 match self {
12860 Self::Unspecified => std::option::Option::Some(0),
12861 Self::Iceberg => std::option::Option::Some(1),
12862 Self::UnknownValue(u) => u.0.value(),
12863 }
12864 }
12865
12866 /// Gets the enum value as a string.
12867 ///
12868 /// Returns `None` if the enum contains an unknown value deserialized from
12869 /// the integer representation of enums.
12870 pub fn name(&self) -> std::option::Option<&str> {
12871 match self {
12872 Self::Unspecified => std::option::Option::Some("TABLE_FORMAT_UNSPECIFIED"),
12873 Self::Iceberg => std::option::Option::Some("ICEBERG"),
12874 Self::UnknownValue(u) => u.0.name(),
12875 }
12876 }
12877 }
12878
12879 impl std::default::Default for TableFormat {
12880 fn default() -> Self {
12881 use std::convert::From;
12882 Self::from(0)
12883 }
12884 }
12885
12886 impl std::fmt::Display for TableFormat {
12887 fn fmt(
12888 &self,
12889 f: &mut std::fmt::Formatter<'_>,
12890 ) -> std::result::Result<(), std::fmt::Error> {
12891 wkt::internal::display_enum(f, self.name(), self.value())
12892 }
12893 }
12894
12895 impl std::convert::From<i32> for TableFormat {
12896 fn from(value: i32) -> Self {
12897 match value {
12898 0 => Self::Unspecified,
12899 1 => Self::Iceberg,
12900 _ => Self::UnknownValue(table_format::UnknownValue(
12901 wkt::internal::UnknownEnumValue::Integer(value),
12902 )),
12903 }
12904 }
12905 }
12906
12907 impl std::convert::From<&str> for TableFormat {
12908 fn from(value: &str) -> Self {
12909 use std::string::ToString;
12910 match value {
12911 "TABLE_FORMAT_UNSPECIFIED" => Self::Unspecified,
12912 "ICEBERG" => Self::Iceberg,
12913 _ => Self::UnknownValue(table_format::UnknownValue(
12914 wkt::internal::UnknownEnumValue::String(value.to_string()),
12915 )),
12916 }
12917 }
12918 }
12919
12920 impl serde::ser::Serialize for TableFormat {
12921 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12922 where
12923 S: serde::Serializer,
12924 {
12925 match self {
12926 Self::Unspecified => serializer.serialize_i32(0),
12927 Self::Iceberg => serializer.serialize_i32(1),
12928 Self::UnknownValue(u) => u.0.serialize(serializer),
12929 }
12930 }
12931 }
12932
12933 impl<'de> serde::de::Deserialize<'de> for TableFormat {
12934 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12935 where
12936 D: serde::Deserializer<'de>,
12937 {
12938 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TableFormat>::new(
12939 ".google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig.TableFormat",
12940 ))
12941 }
12942 }
12943 }
12944
12945 /// AppendOnly mode defines that all changes to a table will be written to the
12946 /// destination table.
12947 #[derive(Clone, Default, PartialEq)]
12948 #[non_exhaustive]
12949 pub struct AppendOnly {
12950 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12951 }
12952
12953 impl AppendOnly {
12954 pub fn new() -> Self {
12955 std::default::Default::default()
12956 }
12957 }
12958
12959 impl wkt::message::Message for AppendOnly {
12960 fn typename() -> &'static str {
12961 "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.AppendOnly"
12962 }
12963 }
12964
12965 /// Merge mode defines that all changes to a table will be merged at the
12966 /// destination table.
12967 #[derive(Clone, Default, PartialEq)]
12968 #[non_exhaustive]
12969 pub struct Merge {
12970 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12971 }
12972
12973 impl Merge {
12974 pub fn new() -> Self {
12975 std::default::Default::default()
12976 }
12977 }
12978
12979 impl wkt::message::Message for Merge {
12980 fn typename() -> &'static str {
12981 "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.Merge"
12982 }
12983 }
12984
12985 /// Target dataset(s) configuration.
12986 #[derive(Clone, Debug, PartialEq)]
12987 #[non_exhaustive]
12988 pub enum DatasetConfig {
12989 /// Single destination dataset.
12990 SingleTargetDataset(
12991 std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
12992 ),
12993 /// Source hierarchy datasets.
12994 SourceHierarchyDatasets(
12995 std::boxed::Box<crate::model::big_query_destination_config::SourceHierarchyDatasets>,
12996 ),
12997 }
12998
12999 #[derive(Clone, Debug, PartialEq)]
13000 #[non_exhaustive]
13001 pub enum WriteMode {
13002 /// The standard mode
13003 Merge(std::boxed::Box<crate::model::big_query_destination_config::Merge>),
13004 /// Append only mode
13005 AppendOnly(std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>),
13006 }
13007}
13008
13009/// The configuration of the stream destination.
13010#[derive(Clone, Default, PartialEq)]
13011#[non_exhaustive]
13012pub struct DestinationConfig {
13013 /// Required. Destination connection profile resource.
13014 /// Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
13015 pub destination_connection_profile: std::string::String,
13016
13017 /// Stream configuration that is specific to the data destination type.
13018 pub destination_stream_config:
13019 std::option::Option<crate::model::destination_config::DestinationStreamConfig>,
13020
13021 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13022}
13023
13024impl DestinationConfig {
13025 pub fn new() -> Self {
13026 std::default::Default::default()
13027 }
13028
13029 /// Sets the value of [destination_connection_profile][crate::model::DestinationConfig::destination_connection_profile].
13030 ///
13031 /// # Example
13032 /// ```ignore,no_run
13033 /// # use google_cloud_datastream_v1::model::DestinationConfig;
13034 /// let x = DestinationConfig::new().set_destination_connection_profile("example");
13035 /// ```
13036 pub fn set_destination_connection_profile<T: std::convert::Into<std::string::String>>(
13037 mut self,
13038 v: T,
13039 ) -> Self {
13040 self.destination_connection_profile = v.into();
13041 self
13042 }
13043
13044 /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config].
13045 ///
13046 /// Note that all the setters affecting `destination_stream_config` are mutually
13047 /// exclusive.
13048 ///
13049 /// # Example
13050 /// ```ignore,no_run
13051 /// # use google_cloud_datastream_v1::model::DestinationConfig;
13052 /// use google_cloud_datastream_v1::model::GcsDestinationConfig;
13053 /// let x = DestinationConfig::new().set_destination_stream_config(Some(
13054 /// google_cloud_datastream_v1::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(GcsDestinationConfig::default().into())));
13055 /// ```
13056 pub fn set_destination_stream_config<
13057 T: std::convert::Into<
13058 std::option::Option<crate::model::destination_config::DestinationStreamConfig>,
13059 >,
13060 >(
13061 mut self,
13062 v: T,
13063 ) -> Self {
13064 self.destination_stream_config = v.into();
13065 self
13066 }
13067
13068 /// The value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13069 /// if it holds a `GcsDestinationConfig`, `None` if the field is not set or
13070 /// holds a different branch.
13071 pub fn gcs_destination_config(
13072 &self,
13073 ) -> std::option::Option<&std::boxed::Box<crate::model::GcsDestinationConfig>> {
13074 #[allow(unreachable_patterns)]
13075 self.destination_stream_config
13076 .as_ref()
13077 .and_then(|v| match v {
13078 crate::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(
13079 v,
13080 ) => std::option::Option::Some(v),
13081 _ => std::option::Option::None,
13082 })
13083 }
13084
13085 /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13086 /// to hold a `GcsDestinationConfig`.
13087 ///
13088 /// Note that all the setters affecting `destination_stream_config` are
13089 /// mutually exclusive.
13090 ///
13091 /// # Example
13092 /// ```ignore,no_run
13093 /// # use google_cloud_datastream_v1::model::DestinationConfig;
13094 /// use google_cloud_datastream_v1::model::GcsDestinationConfig;
13095 /// let x = DestinationConfig::new().set_gcs_destination_config(GcsDestinationConfig::default()/* use setters */);
13096 /// assert!(x.gcs_destination_config().is_some());
13097 /// assert!(x.bigquery_destination_config().is_none());
13098 /// ```
13099 pub fn set_gcs_destination_config<
13100 T: std::convert::Into<std::boxed::Box<crate::model::GcsDestinationConfig>>,
13101 >(
13102 mut self,
13103 v: T,
13104 ) -> Self {
13105 self.destination_stream_config = std::option::Option::Some(
13106 crate::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(
13107 v.into(),
13108 ),
13109 );
13110 self
13111 }
13112
13113 /// The value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13114 /// if it holds a `BigqueryDestinationConfig`, `None` if the field is not set or
13115 /// holds a different branch.
13116 pub fn bigquery_destination_config(
13117 &self,
13118 ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryDestinationConfig>> {
13119 #[allow(unreachable_patterns)]
13120 self.destination_stream_config.as_ref().and_then(|v| match v {
13121 crate::model::destination_config::DestinationStreamConfig::BigqueryDestinationConfig(v) => std::option::Option::Some(v),
13122 _ => std::option::Option::None,
13123 })
13124 }
13125
13126 /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13127 /// to hold a `BigqueryDestinationConfig`.
13128 ///
13129 /// Note that all the setters affecting `destination_stream_config` are
13130 /// mutually exclusive.
13131 ///
13132 /// # Example
13133 /// ```ignore,no_run
13134 /// # use google_cloud_datastream_v1::model::DestinationConfig;
13135 /// use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
13136 /// let x = DestinationConfig::new().set_bigquery_destination_config(BigQueryDestinationConfig::default()/* use setters */);
13137 /// assert!(x.bigquery_destination_config().is_some());
13138 /// assert!(x.gcs_destination_config().is_none());
13139 /// ```
13140 pub fn set_bigquery_destination_config<
13141 T: std::convert::Into<std::boxed::Box<crate::model::BigQueryDestinationConfig>>,
13142 >(
13143 mut self,
13144 v: T,
13145 ) -> Self {
13146 self.destination_stream_config = std::option::Option::Some(
13147 crate::model::destination_config::DestinationStreamConfig::BigqueryDestinationConfig(
13148 v.into(),
13149 ),
13150 );
13151 self
13152 }
13153}
13154
13155impl wkt::message::Message for DestinationConfig {
13156 fn typename() -> &'static str {
13157 "type.googleapis.com/google.cloud.datastream.v1.DestinationConfig"
13158 }
13159}
13160
13161/// Defines additional types related to [DestinationConfig].
13162pub mod destination_config {
13163 #[allow(unused_imports)]
13164 use super::*;
13165
13166 /// Stream configuration that is specific to the data destination type.
13167 #[derive(Clone, Debug, PartialEq)]
13168 #[non_exhaustive]
13169 pub enum DestinationStreamConfig {
13170 /// A configuration for how data should be loaded to Cloud Storage.
13171 GcsDestinationConfig(std::boxed::Box<crate::model::GcsDestinationConfig>),
13172 /// BigQuery destination configuration.
13173 BigqueryDestinationConfig(std::boxed::Box<crate::model::BigQueryDestinationConfig>),
13174 }
13175}
13176
13177/// A resource representing streaming data from a source to a destination.
13178#[derive(Clone, Default, PartialEq)]
13179#[non_exhaustive]
13180pub struct Stream {
13181 /// Output only. Identifier. The stream's name.
13182 pub name: std::string::String,
13183
13184 /// Output only. The creation time of the stream.
13185 pub create_time: std::option::Option<wkt::Timestamp>,
13186
13187 /// Output only. The last update time of the stream.
13188 pub update_time: std::option::Option<wkt::Timestamp>,
13189
13190 /// Labels.
13191 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
13192
13193 /// Required. Display name.
13194 pub display_name: std::string::String,
13195
13196 /// Required. Source connection profile configuration.
13197 pub source_config: std::option::Option<crate::model::SourceConfig>,
13198
13199 /// Required. Destination connection profile configuration.
13200 pub destination_config: std::option::Option<crate::model::DestinationConfig>,
13201
13202 /// The state of the stream.
13203 pub state: crate::model::stream::State,
13204
13205 /// Output only. Errors on the Stream.
13206 pub errors: std::vec::Vec<crate::model::Error>,
13207
13208 /// Immutable. A reference to a KMS encryption key.
13209 /// If provided, it will be used to encrypt the data.
13210 /// If left blank, data will be encrypted using an internal Stream-specific
13211 /// encryption key provisioned through KMS.
13212 pub customer_managed_encryption_key: std::option::Option<std::string::String>,
13213
13214 /// Output only. If the stream was recovered, the time of the last recovery.
13215 /// Note: This field is currently experimental.
13216 pub last_recovery_time: std::option::Option<wkt::Timestamp>,
13217
13218 /// Output only. Reserved for future use.
13219 pub satisfies_pzs: std::option::Option<bool>,
13220
13221 /// Output only. Reserved for future use.
13222 pub satisfies_pzi: std::option::Option<bool>,
13223
13224 /// Stream backfill strategy.
13225 pub backfill_strategy: std::option::Option<crate::model::stream::BackfillStrategy>,
13226
13227 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13228}
13229
13230impl Stream {
13231 pub fn new() -> Self {
13232 std::default::Default::default()
13233 }
13234
13235 /// Sets the value of [name][crate::model::Stream::name].
13236 ///
13237 /// # Example
13238 /// ```ignore,no_run
13239 /// # use google_cloud_datastream_v1::model::Stream;
13240 /// let x = Stream::new().set_name("example");
13241 /// ```
13242 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13243 self.name = v.into();
13244 self
13245 }
13246
13247 /// Sets the value of [create_time][crate::model::Stream::create_time].
13248 ///
13249 /// # Example
13250 /// ```ignore,no_run
13251 /// # use google_cloud_datastream_v1::model::Stream;
13252 /// use wkt::Timestamp;
13253 /// let x = Stream::new().set_create_time(Timestamp::default()/* use setters */);
13254 /// ```
13255 pub fn set_create_time<T>(mut self, v: T) -> Self
13256 where
13257 T: std::convert::Into<wkt::Timestamp>,
13258 {
13259 self.create_time = std::option::Option::Some(v.into());
13260 self
13261 }
13262
13263 /// Sets or clears the value of [create_time][crate::model::Stream::create_time].
13264 ///
13265 /// # Example
13266 /// ```ignore,no_run
13267 /// # use google_cloud_datastream_v1::model::Stream;
13268 /// use wkt::Timestamp;
13269 /// let x = Stream::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13270 /// let x = Stream::new().set_or_clear_create_time(None::<Timestamp>);
13271 /// ```
13272 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13273 where
13274 T: std::convert::Into<wkt::Timestamp>,
13275 {
13276 self.create_time = v.map(|x| x.into());
13277 self
13278 }
13279
13280 /// Sets the value of [update_time][crate::model::Stream::update_time].
13281 ///
13282 /// # Example
13283 /// ```ignore,no_run
13284 /// # use google_cloud_datastream_v1::model::Stream;
13285 /// use wkt::Timestamp;
13286 /// let x = Stream::new().set_update_time(Timestamp::default()/* use setters */);
13287 /// ```
13288 pub fn set_update_time<T>(mut self, v: T) -> Self
13289 where
13290 T: std::convert::Into<wkt::Timestamp>,
13291 {
13292 self.update_time = std::option::Option::Some(v.into());
13293 self
13294 }
13295
13296 /// Sets or clears the value of [update_time][crate::model::Stream::update_time].
13297 ///
13298 /// # Example
13299 /// ```ignore,no_run
13300 /// # use google_cloud_datastream_v1::model::Stream;
13301 /// use wkt::Timestamp;
13302 /// let x = Stream::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
13303 /// let x = Stream::new().set_or_clear_update_time(None::<Timestamp>);
13304 /// ```
13305 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13306 where
13307 T: std::convert::Into<wkt::Timestamp>,
13308 {
13309 self.update_time = v.map(|x| x.into());
13310 self
13311 }
13312
13313 /// Sets the value of [labels][crate::model::Stream::labels].
13314 ///
13315 /// # Example
13316 /// ```ignore,no_run
13317 /// # use google_cloud_datastream_v1::model::Stream;
13318 /// let x = Stream::new().set_labels([
13319 /// ("key0", "abc"),
13320 /// ("key1", "xyz"),
13321 /// ]);
13322 /// ```
13323 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
13324 where
13325 T: std::iter::IntoIterator<Item = (K, V)>,
13326 K: std::convert::Into<std::string::String>,
13327 V: std::convert::Into<std::string::String>,
13328 {
13329 use std::iter::Iterator;
13330 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13331 self
13332 }
13333
13334 /// Sets the value of [display_name][crate::model::Stream::display_name].
13335 ///
13336 /// # Example
13337 /// ```ignore,no_run
13338 /// # use google_cloud_datastream_v1::model::Stream;
13339 /// let x = Stream::new().set_display_name("example");
13340 /// ```
13341 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13342 self.display_name = v.into();
13343 self
13344 }
13345
13346 /// Sets the value of [source_config][crate::model::Stream::source_config].
13347 ///
13348 /// # Example
13349 /// ```ignore,no_run
13350 /// # use google_cloud_datastream_v1::model::Stream;
13351 /// use google_cloud_datastream_v1::model::SourceConfig;
13352 /// let x = Stream::new().set_source_config(SourceConfig::default()/* use setters */);
13353 /// ```
13354 pub fn set_source_config<T>(mut self, v: T) -> Self
13355 where
13356 T: std::convert::Into<crate::model::SourceConfig>,
13357 {
13358 self.source_config = std::option::Option::Some(v.into());
13359 self
13360 }
13361
13362 /// Sets or clears the value of [source_config][crate::model::Stream::source_config].
13363 ///
13364 /// # Example
13365 /// ```ignore,no_run
13366 /// # use google_cloud_datastream_v1::model::Stream;
13367 /// use google_cloud_datastream_v1::model::SourceConfig;
13368 /// let x = Stream::new().set_or_clear_source_config(Some(SourceConfig::default()/* use setters */));
13369 /// let x = Stream::new().set_or_clear_source_config(None::<SourceConfig>);
13370 /// ```
13371 pub fn set_or_clear_source_config<T>(mut self, v: std::option::Option<T>) -> Self
13372 where
13373 T: std::convert::Into<crate::model::SourceConfig>,
13374 {
13375 self.source_config = v.map(|x| x.into());
13376 self
13377 }
13378
13379 /// Sets the value of [destination_config][crate::model::Stream::destination_config].
13380 ///
13381 /// # Example
13382 /// ```ignore,no_run
13383 /// # use google_cloud_datastream_v1::model::Stream;
13384 /// use google_cloud_datastream_v1::model::DestinationConfig;
13385 /// let x = Stream::new().set_destination_config(DestinationConfig::default()/* use setters */);
13386 /// ```
13387 pub fn set_destination_config<T>(mut self, v: T) -> Self
13388 where
13389 T: std::convert::Into<crate::model::DestinationConfig>,
13390 {
13391 self.destination_config = std::option::Option::Some(v.into());
13392 self
13393 }
13394
13395 /// Sets or clears the value of [destination_config][crate::model::Stream::destination_config].
13396 ///
13397 /// # Example
13398 /// ```ignore,no_run
13399 /// # use google_cloud_datastream_v1::model::Stream;
13400 /// use google_cloud_datastream_v1::model::DestinationConfig;
13401 /// let x = Stream::new().set_or_clear_destination_config(Some(DestinationConfig::default()/* use setters */));
13402 /// let x = Stream::new().set_or_clear_destination_config(None::<DestinationConfig>);
13403 /// ```
13404 pub fn set_or_clear_destination_config<T>(mut self, v: std::option::Option<T>) -> Self
13405 where
13406 T: std::convert::Into<crate::model::DestinationConfig>,
13407 {
13408 self.destination_config = v.map(|x| x.into());
13409 self
13410 }
13411
13412 /// Sets the value of [state][crate::model::Stream::state].
13413 ///
13414 /// # Example
13415 /// ```ignore,no_run
13416 /// # use google_cloud_datastream_v1::model::Stream;
13417 /// use google_cloud_datastream_v1::model::stream::State;
13418 /// let x0 = Stream::new().set_state(State::NotStarted);
13419 /// let x1 = Stream::new().set_state(State::Running);
13420 /// let x2 = Stream::new().set_state(State::Paused);
13421 /// ```
13422 pub fn set_state<T: std::convert::Into<crate::model::stream::State>>(mut self, v: T) -> Self {
13423 self.state = v.into();
13424 self
13425 }
13426
13427 /// Sets the value of [errors][crate::model::Stream::errors].
13428 ///
13429 /// # Example
13430 /// ```ignore,no_run
13431 /// # use google_cloud_datastream_v1::model::Stream;
13432 /// use google_cloud_datastream_v1::model::Error;
13433 /// let x = Stream::new()
13434 /// .set_errors([
13435 /// Error::default()/* use setters */,
13436 /// Error::default()/* use (different) setters */,
13437 /// ]);
13438 /// ```
13439 pub fn set_errors<T, V>(mut self, v: T) -> Self
13440 where
13441 T: std::iter::IntoIterator<Item = V>,
13442 V: std::convert::Into<crate::model::Error>,
13443 {
13444 use std::iter::Iterator;
13445 self.errors = v.into_iter().map(|i| i.into()).collect();
13446 self
13447 }
13448
13449 /// Sets the value of [customer_managed_encryption_key][crate::model::Stream::customer_managed_encryption_key].
13450 ///
13451 /// # Example
13452 /// ```ignore,no_run
13453 /// # use google_cloud_datastream_v1::model::Stream;
13454 /// let x = Stream::new().set_customer_managed_encryption_key("example");
13455 /// ```
13456 pub fn set_customer_managed_encryption_key<T>(mut self, v: T) -> Self
13457 where
13458 T: std::convert::Into<std::string::String>,
13459 {
13460 self.customer_managed_encryption_key = std::option::Option::Some(v.into());
13461 self
13462 }
13463
13464 /// Sets or clears the value of [customer_managed_encryption_key][crate::model::Stream::customer_managed_encryption_key].
13465 ///
13466 /// # Example
13467 /// ```ignore,no_run
13468 /// # use google_cloud_datastream_v1::model::Stream;
13469 /// let x = Stream::new().set_or_clear_customer_managed_encryption_key(Some("example"));
13470 /// let x = Stream::new().set_or_clear_customer_managed_encryption_key(None::<String>);
13471 /// ```
13472 pub fn set_or_clear_customer_managed_encryption_key<T>(
13473 mut self,
13474 v: std::option::Option<T>,
13475 ) -> Self
13476 where
13477 T: std::convert::Into<std::string::String>,
13478 {
13479 self.customer_managed_encryption_key = v.map(|x| x.into());
13480 self
13481 }
13482
13483 /// Sets the value of [last_recovery_time][crate::model::Stream::last_recovery_time].
13484 ///
13485 /// # Example
13486 /// ```ignore,no_run
13487 /// # use google_cloud_datastream_v1::model::Stream;
13488 /// use wkt::Timestamp;
13489 /// let x = Stream::new().set_last_recovery_time(Timestamp::default()/* use setters */);
13490 /// ```
13491 pub fn set_last_recovery_time<T>(mut self, v: T) -> Self
13492 where
13493 T: std::convert::Into<wkt::Timestamp>,
13494 {
13495 self.last_recovery_time = std::option::Option::Some(v.into());
13496 self
13497 }
13498
13499 /// Sets or clears the value of [last_recovery_time][crate::model::Stream::last_recovery_time].
13500 ///
13501 /// # Example
13502 /// ```ignore,no_run
13503 /// # use google_cloud_datastream_v1::model::Stream;
13504 /// use wkt::Timestamp;
13505 /// let x = Stream::new().set_or_clear_last_recovery_time(Some(Timestamp::default()/* use setters */));
13506 /// let x = Stream::new().set_or_clear_last_recovery_time(None::<Timestamp>);
13507 /// ```
13508 pub fn set_or_clear_last_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
13509 where
13510 T: std::convert::Into<wkt::Timestamp>,
13511 {
13512 self.last_recovery_time = v.map(|x| x.into());
13513 self
13514 }
13515
13516 /// Sets the value of [satisfies_pzs][crate::model::Stream::satisfies_pzs].
13517 ///
13518 /// # Example
13519 /// ```ignore,no_run
13520 /// # use google_cloud_datastream_v1::model::Stream;
13521 /// let x = Stream::new().set_satisfies_pzs(true);
13522 /// ```
13523 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
13524 where
13525 T: std::convert::Into<bool>,
13526 {
13527 self.satisfies_pzs = std::option::Option::Some(v.into());
13528 self
13529 }
13530
13531 /// Sets or clears the value of [satisfies_pzs][crate::model::Stream::satisfies_pzs].
13532 ///
13533 /// # Example
13534 /// ```ignore,no_run
13535 /// # use google_cloud_datastream_v1::model::Stream;
13536 /// let x = Stream::new().set_or_clear_satisfies_pzs(Some(false));
13537 /// let x = Stream::new().set_or_clear_satisfies_pzs(None::<bool>);
13538 /// ```
13539 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
13540 where
13541 T: std::convert::Into<bool>,
13542 {
13543 self.satisfies_pzs = v.map(|x| x.into());
13544 self
13545 }
13546
13547 /// Sets the value of [satisfies_pzi][crate::model::Stream::satisfies_pzi].
13548 ///
13549 /// # Example
13550 /// ```ignore,no_run
13551 /// # use google_cloud_datastream_v1::model::Stream;
13552 /// let x = Stream::new().set_satisfies_pzi(true);
13553 /// ```
13554 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
13555 where
13556 T: std::convert::Into<bool>,
13557 {
13558 self.satisfies_pzi = std::option::Option::Some(v.into());
13559 self
13560 }
13561
13562 /// Sets or clears the value of [satisfies_pzi][crate::model::Stream::satisfies_pzi].
13563 ///
13564 /// # Example
13565 /// ```ignore,no_run
13566 /// # use google_cloud_datastream_v1::model::Stream;
13567 /// let x = Stream::new().set_or_clear_satisfies_pzi(Some(false));
13568 /// let x = Stream::new().set_or_clear_satisfies_pzi(None::<bool>);
13569 /// ```
13570 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
13571 where
13572 T: std::convert::Into<bool>,
13573 {
13574 self.satisfies_pzi = v.map(|x| x.into());
13575 self
13576 }
13577
13578 /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy].
13579 ///
13580 /// Note that all the setters affecting `backfill_strategy` are mutually
13581 /// exclusive.
13582 ///
13583 /// # Example
13584 /// ```ignore,no_run
13585 /// # use google_cloud_datastream_v1::model::Stream;
13586 /// use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13587 /// let x = Stream::new().set_backfill_strategy(Some(
13588 /// google_cloud_datastream_v1::model::stream::BackfillStrategy::BackfillAll(BackfillAllStrategy::default().into())));
13589 /// ```
13590 pub fn set_backfill_strategy<
13591 T: std::convert::Into<std::option::Option<crate::model::stream::BackfillStrategy>>,
13592 >(
13593 mut self,
13594 v: T,
13595 ) -> Self {
13596 self.backfill_strategy = v.into();
13597 self
13598 }
13599
13600 /// The value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13601 /// if it holds a `BackfillAll`, `None` if the field is not set or
13602 /// holds a different branch.
13603 pub fn backfill_all(
13604 &self,
13605 ) -> std::option::Option<&std::boxed::Box<crate::model::stream::BackfillAllStrategy>> {
13606 #[allow(unreachable_patterns)]
13607 self.backfill_strategy.as_ref().and_then(|v| match v {
13608 crate::model::stream::BackfillStrategy::BackfillAll(v) => std::option::Option::Some(v),
13609 _ => std::option::Option::None,
13610 })
13611 }
13612
13613 /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13614 /// to hold a `BackfillAll`.
13615 ///
13616 /// Note that all the setters affecting `backfill_strategy` are
13617 /// mutually exclusive.
13618 ///
13619 /// # Example
13620 /// ```ignore,no_run
13621 /// # use google_cloud_datastream_v1::model::Stream;
13622 /// use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13623 /// let x = Stream::new().set_backfill_all(BackfillAllStrategy::default()/* use setters */);
13624 /// assert!(x.backfill_all().is_some());
13625 /// assert!(x.backfill_none().is_none());
13626 /// ```
13627 pub fn set_backfill_all<
13628 T: std::convert::Into<std::boxed::Box<crate::model::stream::BackfillAllStrategy>>,
13629 >(
13630 mut self,
13631 v: T,
13632 ) -> Self {
13633 self.backfill_strategy = std::option::Option::Some(
13634 crate::model::stream::BackfillStrategy::BackfillAll(v.into()),
13635 );
13636 self
13637 }
13638
13639 /// The value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13640 /// if it holds a `BackfillNone`, `None` if the field is not set or
13641 /// holds a different branch.
13642 pub fn backfill_none(
13643 &self,
13644 ) -> std::option::Option<&std::boxed::Box<crate::model::stream::BackfillNoneStrategy>> {
13645 #[allow(unreachable_patterns)]
13646 self.backfill_strategy.as_ref().and_then(|v| match v {
13647 crate::model::stream::BackfillStrategy::BackfillNone(v) => std::option::Option::Some(v),
13648 _ => std::option::Option::None,
13649 })
13650 }
13651
13652 /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13653 /// to hold a `BackfillNone`.
13654 ///
13655 /// Note that all the setters affecting `backfill_strategy` are
13656 /// mutually exclusive.
13657 ///
13658 /// # Example
13659 /// ```ignore,no_run
13660 /// # use google_cloud_datastream_v1::model::Stream;
13661 /// use google_cloud_datastream_v1::model::stream::BackfillNoneStrategy;
13662 /// let x = Stream::new().set_backfill_none(BackfillNoneStrategy::default()/* use setters */);
13663 /// assert!(x.backfill_none().is_some());
13664 /// assert!(x.backfill_all().is_none());
13665 /// ```
13666 pub fn set_backfill_none<
13667 T: std::convert::Into<std::boxed::Box<crate::model::stream::BackfillNoneStrategy>>,
13668 >(
13669 mut self,
13670 v: T,
13671 ) -> Self {
13672 self.backfill_strategy = std::option::Option::Some(
13673 crate::model::stream::BackfillStrategy::BackfillNone(v.into()),
13674 );
13675 self
13676 }
13677}
13678
13679impl wkt::message::Message for Stream {
13680 fn typename() -> &'static str {
13681 "type.googleapis.com/google.cloud.datastream.v1.Stream"
13682 }
13683}
13684
13685/// Defines additional types related to [Stream].
13686pub mod stream {
13687 #[allow(unused_imports)]
13688 use super::*;
13689
13690 /// Backfill strategy to automatically backfill the Stream's objects.
13691 /// Specific objects can be excluded.
13692 #[derive(Clone, Default, PartialEq)]
13693 #[non_exhaustive]
13694 pub struct BackfillAllStrategy {
13695 /// List of objects to exclude.
13696 pub excluded_objects:
13697 std::option::Option<crate::model::stream::backfill_all_strategy::ExcludedObjects>,
13698
13699 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13700 }
13701
13702 impl BackfillAllStrategy {
13703 pub fn new() -> Self {
13704 std::default::Default::default()
13705 }
13706
13707 /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects].
13708 ///
13709 /// Note that all the setters affecting `excluded_objects` are mutually
13710 /// exclusive.
13711 ///
13712 /// # Example
13713 /// ```ignore,no_run
13714 /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13715 /// use google_cloud_datastream_v1::model::OracleRdbms;
13716 /// let x = BackfillAllStrategy::new().set_excluded_objects(Some(
13717 /// google_cloud_datastream_v1::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(OracleRdbms::default().into())));
13718 /// ```
13719 pub fn set_excluded_objects<
13720 T: std::convert::Into<
13721 std::option::Option<
13722 crate::model::stream::backfill_all_strategy::ExcludedObjects,
13723 >,
13724 >,
13725 >(
13726 mut self,
13727 v: T,
13728 ) -> Self {
13729 self.excluded_objects = v.into();
13730 self
13731 }
13732
13733 /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13734 /// if it holds a `OracleExcludedObjects`, `None` if the field is not set or
13735 /// holds a different branch.
13736 pub fn oracle_excluded_objects(
13737 &self,
13738 ) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
13739 #[allow(unreachable_patterns)]
13740 self.excluded_objects.as_ref().and_then(|v| match v {
13741 crate::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(v) => std::option::Option::Some(v),
13742 _ => std::option::Option::None,
13743 })
13744 }
13745
13746 /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13747 /// to hold a `OracleExcludedObjects`.
13748 ///
13749 /// Note that all the setters affecting `excluded_objects` are
13750 /// mutually exclusive.
13751 ///
13752 /// # Example
13753 /// ```ignore,no_run
13754 /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13755 /// use google_cloud_datastream_v1::model::OracleRdbms;
13756 /// let x = BackfillAllStrategy::new().set_oracle_excluded_objects(OracleRdbms::default()/* use setters */);
13757 /// assert!(x.oracle_excluded_objects().is_some());
13758 /// assert!(x.mysql_excluded_objects().is_none());
13759 /// assert!(x.postgresql_excluded_objects().is_none());
13760 /// assert!(x.sql_server_excluded_objects().is_none());
13761 /// assert!(x.salesforce_excluded_objects().is_none());
13762 /// assert!(x.mongodb_excluded_objects().is_none());
13763 /// ```
13764 pub fn set_oracle_excluded_objects<
13765 T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>,
13766 >(
13767 mut self,
13768 v: T,
13769 ) -> Self {
13770 self.excluded_objects = std::option::Option::Some(
13771 crate::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(
13772 v.into(),
13773 ),
13774 );
13775 self
13776 }
13777
13778 /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13779 /// if it holds a `MysqlExcludedObjects`, `None` if the field is not set or
13780 /// holds a different branch.
13781 pub fn mysql_excluded_objects(
13782 &self,
13783 ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
13784 #[allow(unreachable_patterns)]
13785 self.excluded_objects.as_ref().and_then(|v| match v {
13786 crate::model::stream::backfill_all_strategy::ExcludedObjects::MysqlExcludedObjects(v) => std::option::Option::Some(v),
13787 _ => std::option::Option::None,
13788 })
13789 }
13790
13791 /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13792 /// to hold a `MysqlExcludedObjects`.
13793 ///
13794 /// Note that all the setters affecting `excluded_objects` are
13795 /// mutually exclusive.
13796 ///
13797 /// # Example
13798 /// ```ignore,no_run
13799 /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13800 /// use google_cloud_datastream_v1::model::MysqlRdbms;
13801 /// let x = BackfillAllStrategy::new().set_mysql_excluded_objects(MysqlRdbms::default()/* use setters */);
13802 /// assert!(x.mysql_excluded_objects().is_some());
13803 /// assert!(x.oracle_excluded_objects().is_none());
13804 /// assert!(x.postgresql_excluded_objects().is_none());
13805 /// assert!(x.sql_server_excluded_objects().is_none());
13806 /// assert!(x.salesforce_excluded_objects().is_none());
13807 /// assert!(x.mongodb_excluded_objects().is_none());
13808 /// ```
13809 pub fn set_mysql_excluded_objects<
13810 T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>,
13811 >(
13812 mut self,
13813 v: T,
13814 ) -> Self {
13815 self.excluded_objects = std::option::Option::Some(
13816 crate::model::stream::backfill_all_strategy::ExcludedObjects::MysqlExcludedObjects(
13817 v.into(),
13818 ),
13819 );
13820 self
13821 }
13822
13823 /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13824 /// if it holds a `PostgresqlExcludedObjects`, `None` if the field is not set or
13825 /// holds a different branch.
13826 pub fn postgresql_excluded_objects(
13827 &self,
13828 ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
13829 #[allow(unreachable_patterns)]
13830 self.excluded_objects.as_ref().and_then(|v| match v {
13831 crate::model::stream::backfill_all_strategy::ExcludedObjects::PostgresqlExcludedObjects(v) => std::option::Option::Some(v),
13832 _ => std::option::Option::None,
13833 })
13834 }
13835
13836 /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13837 /// to hold a `PostgresqlExcludedObjects`.
13838 ///
13839 /// Note that all the setters affecting `excluded_objects` are
13840 /// mutually exclusive.
13841 ///
13842 /// # Example
13843 /// ```ignore,no_run
13844 /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13845 /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
13846 /// let x = BackfillAllStrategy::new().set_postgresql_excluded_objects(PostgresqlRdbms::default()/* use setters */);
13847 /// assert!(x.postgresql_excluded_objects().is_some());
13848 /// assert!(x.oracle_excluded_objects().is_none());
13849 /// assert!(x.mysql_excluded_objects().is_none());
13850 /// assert!(x.sql_server_excluded_objects().is_none());
13851 /// assert!(x.salesforce_excluded_objects().is_none());
13852 /// assert!(x.mongodb_excluded_objects().is_none());
13853 /// ```
13854 pub fn set_postgresql_excluded_objects<
13855 T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
13856 >(
13857 mut self,
13858 v: T,
13859 ) -> Self {
13860 self.excluded_objects = std::option::Option::Some(
13861 crate::model::stream::backfill_all_strategy::ExcludedObjects::PostgresqlExcludedObjects(
13862 v.into()
13863 )
13864 );
13865 self
13866 }
13867
13868 /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13869 /// if it holds a `SqlServerExcludedObjects`, `None` if the field is not set or
13870 /// holds a different branch.
13871 pub fn sql_server_excluded_objects(
13872 &self,
13873 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
13874 #[allow(unreachable_patterns)]
13875 self.excluded_objects.as_ref().and_then(|v| match v {
13876 crate::model::stream::backfill_all_strategy::ExcludedObjects::SqlServerExcludedObjects(v) => std::option::Option::Some(v),
13877 _ => std::option::Option::None,
13878 })
13879 }
13880
13881 /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13882 /// to hold a `SqlServerExcludedObjects`.
13883 ///
13884 /// Note that all the setters affecting `excluded_objects` are
13885 /// mutually exclusive.
13886 ///
13887 /// # Example
13888 /// ```ignore,no_run
13889 /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13890 /// use google_cloud_datastream_v1::model::SqlServerRdbms;
13891 /// let x = BackfillAllStrategy::new().set_sql_server_excluded_objects(SqlServerRdbms::default()/* use setters */);
13892 /// assert!(x.sql_server_excluded_objects().is_some());
13893 /// assert!(x.oracle_excluded_objects().is_none());
13894 /// assert!(x.mysql_excluded_objects().is_none());
13895 /// assert!(x.postgresql_excluded_objects().is_none());
13896 /// assert!(x.salesforce_excluded_objects().is_none());
13897 /// assert!(x.mongodb_excluded_objects().is_none());
13898 /// ```
13899 pub fn set_sql_server_excluded_objects<
13900 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
13901 >(
13902 mut self,
13903 v: T,
13904 ) -> Self {
13905 self.excluded_objects = std::option::Option::Some(
13906 crate::model::stream::backfill_all_strategy::ExcludedObjects::SqlServerExcludedObjects(
13907 v.into()
13908 )
13909 );
13910 self
13911 }
13912
13913 /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13914 /// if it holds a `SalesforceExcludedObjects`, `None` if the field is not set or
13915 /// holds a different branch.
13916 pub fn salesforce_excluded_objects(
13917 &self,
13918 ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
13919 #[allow(unreachable_patterns)]
13920 self.excluded_objects.as_ref().and_then(|v| match v {
13921 crate::model::stream::backfill_all_strategy::ExcludedObjects::SalesforceExcludedObjects(v) => std::option::Option::Some(v),
13922 _ => std::option::Option::None,
13923 })
13924 }
13925
13926 /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13927 /// to hold a `SalesforceExcludedObjects`.
13928 ///
13929 /// Note that all the setters affecting `excluded_objects` are
13930 /// mutually exclusive.
13931 ///
13932 /// # Example
13933 /// ```ignore,no_run
13934 /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13935 /// use google_cloud_datastream_v1::model::SalesforceOrg;
13936 /// let x = BackfillAllStrategy::new().set_salesforce_excluded_objects(SalesforceOrg::default()/* use setters */);
13937 /// assert!(x.salesforce_excluded_objects().is_some());
13938 /// assert!(x.oracle_excluded_objects().is_none());
13939 /// assert!(x.mysql_excluded_objects().is_none());
13940 /// assert!(x.postgresql_excluded_objects().is_none());
13941 /// assert!(x.sql_server_excluded_objects().is_none());
13942 /// assert!(x.mongodb_excluded_objects().is_none());
13943 /// ```
13944 pub fn set_salesforce_excluded_objects<
13945 T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
13946 >(
13947 mut self,
13948 v: T,
13949 ) -> Self {
13950 self.excluded_objects = std::option::Option::Some(
13951 crate::model::stream::backfill_all_strategy::ExcludedObjects::SalesforceExcludedObjects(
13952 v.into()
13953 )
13954 );
13955 self
13956 }
13957
13958 /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13959 /// if it holds a `MongodbExcludedObjects`, `None` if the field is not set or
13960 /// holds a different branch.
13961 pub fn mongodb_excluded_objects(
13962 &self,
13963 ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
13964 #[allow(unreachable_patterns)]
13965 self.excluded_objects.as_ref().and_then(|v| match v {
13966 crate::model::stream::backfill_all_strategy::ExcludedObjects::MongodbExcludedObjects(v) => std::option::Option::Some(v),
13967 _ => std::option::Option::None,
13968 })
13969 }
13970
13971 /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13972 /// to hold a `MongodbExcludedObjects`.
13973 ///
13974 /// Note that all the setters affecting `excluded_objects` are
13975 /// mutually exclusive.
13976 ///
13977 /// # Example
13978 /// ```ignore,no_run
13979 /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13980 /// use google_cloud_datastream_v1::model::MongodbCluster;
13981 /// let x = BackfillAllStrategy::new().set_mongodb_excluded_objects(MongodbCluster::default()/* use setters */);
13982 /// assert!(x.mongodb_excluded_objects().is_some());
13983 /// assert!(x.oracle_excluded_objects().is_none());
13984 /// assert!(x.mysql_excluded_objects().is_none());
13985 /// assert!(x.postgresql_excluded_objects().is_none());
13986 /// assert!(x.sql_server_excluded_objects().is_none());
13987 /// assert!(x.salesforce_excluded_objects().is_none());
13988 /// ```
13989 pub fn set_mongodb_excluded_objects<
13990 T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
13991 >(
13992 mut self,
13993 v: T,
13994 ) -> Self {
13995 self.excluded_objects = std::option::Option::Some(
13996 crate::model::stream::backfill_all_strategy::ExcludedObjects::MongodbExcludedObjects(
13997 v.into()
13998 )
13999 );
14000 self
14001 }
14002 }
14003
14004 impl wkt::message::Message for BackfillAllStrategy {
14005 fn typename() -> &'static str {
14006 "type.googleapis.com/google.cloud.datastream.v1.Stream.BackfillAllStrategy"
14007 }
14008 }
14009
14010 /// Defines additional types related to [BackfillAllStrategy].
14011 pub mod backfill_all_strategy {
14012 #[allow(unused_imports)]
14013 use super::*;
14014
14015 /// List of objects to exclude.
14016 #[derive(Clone, Debug, PartialEq)]
14017 #[non_exhaustive]
14018 pub enum ExcludedObjects {
14019 /// Oracle data source objects to avoid backfilling.
14020 OracleExcludedObjects(std::boxed::Box<crate::model::OracleRdbms>),
14021 /// MySQL data source objects to avoid backfilling.
14022 MysqlExcludedObjects(std::boxed::Box<crate::model::MysqlRdbms>),
14023 /// PostgreSQL data source objects to avoid backfilling.
14024 PostgresqlExcludedObjects(std::boxed::Box<crate::model::PostgresqlRdbms>),
14025 /// SQLServer data source objects to avoid backfilling
14026 SqlServerExcludedObjects(std::boxed::Box<crate::model::SqlServerRdbms>),
14027 /// Salesforce data source objects to avoid backfilling
14028 SalesforceExcludedObjects(std::boxed::Box<crate::model::SalesforceOrg>),
14029 /// MongoDB data source objects to avoid backfilling
14030 MongodbExcludedObjects(std::boxed::Box<crate::model::MongodbCluster>),
14031 }
14032 }
14033
14034 /// Backfill strategy to disable automatic backfill for the Stream's objects.
14035 #[derive(Clone, Default, PartialEq)]
14036 #[non_exhaustive]
14037 pub struct BackfillNoneStrategy {
14038 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14039 }
14040
14041 impl BackfillNoneStrategy {
14042 pub fn new() -> Self {
14043 std::default::Default::default()
14044 }
14045 }
14046
14047 impl wkt::message::Message for BackfillNoneStrategy {
14048 fn typename() -> &'static str {
14049 "type.googleapis.com/google.cloud.datastream.v1.Stream.BackfillNoneStrategy"
14050 }
14051 }
14052
14053 /// Stream state.
14054 ///
14055 /// # Working with unknown values
14056 ///
14057 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14058 /// additional enum variants at any time. Adding new variants is not considered
14059 /// a breaking change. Applications should write their code in anticipation of:
14060 ///
14061 /// - New values appearing in future releases of the client library, **and**
14062 /// - New values received dynamically, without application changes.
14063 ///
14064 /// Please consult the [Working with enums] section in the user guide for some
14065 /// guidelines.
14066 ///
14067 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14068 #[derive(Clone, Debug, PartialEq)]
14069 #[non_exhaustive]
14070 pub enum State {
14071 /// Unspecified stream state.
14072 Unspecified,
14073 /// The stream has been created but has not yet started streaming data.
14074 NotStarted,
14075 /// The stream is running.
14076 Running,
14077 /// The stream is paused.
14078 Paused,
14079 /// The stream is in maintenance mode.
14080 ///
14081 /// Updates are rejected on the resource in this state.
14082 Maintenance,
14083 /// The stream is experiencing an error that is preventing data from being
14084 /// streamed.
14085 Failed,
14086 /// The stream has experienced a terminal failure.
14087 FailedPermanently,
14088 /// The stream is starting, but not yet running.
14089 Starting,
14090 /// The Stream is no longer reading new events, but still writing events in
14091 /// the buffer.
14092 Draining,
14093 /// If set, the enum was initialized with an unknown value.
14094 ///
14095 /// Applications can examine the value using [State::value] or
14096 /// [State::name].
14097 UnknownValue(state::UnknownValue),
14098 }
14099
14100 #[doc(hidden)]
14101 pub mod state {
14102 #[allow(unused_imports)]
14103 use super::*;
14104 #[derive(Clone, Debug, PartialEq)]
14105 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14106 }
14107
14108 impl State {
14109 /// Gets the enum value.
14110 ///
14111 /// Returns `None` if the enum contains an unknown value deserialized from
14112 /// the string representation of enums.
14113 pub fn value(&self) -> std::option::Option<i32> {
14114 match self {
14115 Self::Unspecified => std::option::Option::Some(0),
14116 Self::NotStarted => std::option::Option::Some(1),
14117 Self::Running => std::option::Option::Some(2),
14118 Self::Paused => std::option::Option::Some(3),
14119 Self::Maintenance => std::option::Option::Some(4),
14120 Self::Failed => std::option::Option::Some(5),
14121 Self::FailedPermanently => std::option::Option::Some(6),
14122 Self::Starting => std::option::Option::Some(7),
14123 Self::Draining => std::option::Option::Some(8),
14124 Self::UnknownValue(u) => u.0.value(),
14125 }
14126 }
14127
14128 /// Gets the enum value as a string.
14129 ///
14130 /// Returns `None` if the enum contains an unknown value deserialized from
14131 /// the integer representation of enums.
14132 pub fn name(&self) -> std::option::Option<&str> {
14133 match self {
14134 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14135 Self::NotStarted => std::option::Option::Some("NOT_STARTED"),
14136 Self::Running => std::option::Option::Some("RUNNING"),
14137 Self::Paused => std::option::Option::Some("PAUSED"),
14138 Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
14139 Self::Failed => std::option::Option::Some("FAILED"),
14140 Self::FailedPermanently => std::option::Option::Some("FAILED_PERMANENTLY"),
14141 Self::Starting => std::option::Option::Some("STARTING"),
14142 Self::Draining => std::option::Option::Some("DRAINING"),
14143 Self::UnknownValue(u) => u.0.name(),
14144 }
14145 }
14146 }
14147
14148 impl std::default::Default for State {
14149 fn default() -> Self {
14150 use std::convert::From;
14151 Self::from(0)
14152 }
14153 }
14154
14155 impl std::fmt::Display for State {
14156 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14157 wkt::internal::display_enum(f, self.name(), self.value())
14158 }
14159 }
14160
14161 impl std::convert::From<i32> for State {
14162 fn from(value: i32) -> Self {
14163 match value {
14164 0 => Self::Unspecified,
14165 1 => Self::NotStarted,
14166 2 => Self::Running,
14167 3 => Self::Paused,
14168 4 => Self::Maintenance,
14169 5 => Self::Failed,
14170 6 => Self::FailedPermanently,
14171 7 => Self::Starting,
14172 8 => Self::Draining,
14173 _ => Self::UnknownValue(state::UnknownValue(
14174 wkt::internal::UnknownEnumValue::Integer(value),
14175 )),
14176 }
14177 }
14178 }
14179
14180 impl std::convert::From<&str> for State {
14181 fn from(value: &str) -> Self {
14182 use std::string::ToString;
14183 match value {
14184 "STATE_UNSPECIFIED" => Self::Unspecified,
14185 "NOT_STARTED" => Self::NotStarted,
14186 "RUNNING" => Self::Running,
14187 "PAUSED" => Self::Paused,
14188 "MAINTENANCE" => Self::Maintenance,
14189 "FAILED" => Self::Failed,
14190 "FAILED_PERMANENTLY" => Self::FailedPermanently,
14191 "STARTING" => Self::Starting,
14192 "DRAINING" => Self::Draining,
14193 _ => Self::UnknownValue(state::UnknownValue(
14194 wkt::internal::UnknownEnumValue::String(value.to_string()),
14195 )),
14196 }
14197 }
14198 }
14199
14200 impl serde::ser::Serialize for State {
14201 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14202 where
14203 S: serde::Serializer,
14204 {
14205 match self {
14206 Self::Unspecified => serializer.serialize_i32(0),
14207 Self::NotStarted => serializer.serialize_i32(1),
14208 Self::Running => serializer.serialize_i32(2),
14209 Self::Paused => serializer.serialize_i32(3),
14210 Self::Maintenance => serializer.serialize_i32(4),
14211 Self::Failed => serializer.serialize_i32(5),
14212 Self::FailedPermanently => serializer.serialize_i32(6),
14213 Self::Starting => serializer.serialize_i32(7),
14214 Self::Draining => serializer.serialize_i32(8),
14215 Self::UnknownValue(u) => u.0.serialize(serializer),
14216 }
14217 }
14218 }
14219
14220 impl<'de> serde::de::Deserialize<'de> for State {
14221 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14222 where
14223 D: serde::Deserializer<'de>,
14224 {
14225 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14226 ".google.cloud.datastream.v1.Stream.State",
14227 ))
14228 }
14229 }
14230
14231 /// Stream backfill strategy.
14232 #[derive(Clone, Debug, PartialEq)]
14233 #[non_exhaustive]
14234 pub enum BackfillStrategy {
14235 /// Automatically backfill objects included in the stream source
14236 /// configuration. Specific objects can be excluded.
14237 BackfillAll(std::boxed::Box<crate::model::stream::BackfillAllStrategy>),
14238 /// Do not automatically backfill any objects.
14239 BackfillNone(std::boxed::Box<crate::model::stream::BackfillNoneStrategy>),
14240 }
14241}
14242
14243/// A specific stream object (e.g a specific DB table).
14244#[derive(Clone, Default, PartialEq)]
14245#[non_exhaustive]
14246pub struct StreamObject {
14247 /// Output only. Identifier. The object resource's name.
14248 pub name: std::string::String,
14249
14250 /// Output only. The creation time of the object.
14251 pub create_time: std::option::Option<wkt::Timestamp>,
14252
14253 /// Output only. The last update time of the object.
14254 pub update_time: std::option::Option<wkt::Timestamp>,
14255
14256 /// Required. Display name.
14257 pub display_name: std::string::String,
14258
14259 /// Output only. Active errors on the object.
14260 pub errors: std::vec::Vec<crate::model::Error>,
14261
14262 /// The latest backfill job that was initiated for the stream object.
14263 pub backfill_job: std::option::Option<crate::model::BackfillJob>,
14264
14265 /// The object identifier in the data source.
14266 pub source_object: std::option::Option<crate::model::SourceObjectIdentifier>,
14267
14268 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14269}
14270
14271impl StreamObject {
14272 pub fn new() -> Self {
14273 std::default::Default::default()
14274 }
14275
14276 /// Sets the value of [name][crate::model::StreamObject::name].
14277 ///
14278 /// # Example
14279 /// ```ignore,no_run
14280 /// # use google_cloud_datastream_v1::model::StreamObject;
14281 /// let x = StreamObject::new().set_name("example");
14282 /// ```
14283 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14284 self.name = v.into();
14285 self
14286 }
14287
14288 /// Sets the value of [create_time][crate::model::StreamObject::create_time].
14289 ///
14290 /// # Example
14291 /// ```ignore,no_run
14292 /// # use google_cloud_datastream_v1::model::StreamObject;
14293 /// use wkt::Timestamp;
14294 /// let x = StreamObject::new().set_create_time(Timestamp::default()/* use setters */);
14295 /// ```
14296 pub fn set_create_time<T>(mut self, v: T) -> Self
14297 where
14298 T: std::convert::Into<wkt::Timestamp>,
14299 {
14300 self.create_time = std::option::Option::Some(v.into());
14301 self
14302 }
14303
14304 /// Sets or clears the value of [create_time][crate::model::StreamObject::create_time].
14305 ///
14306 /// # Example
14307 /// ```ignore,no_run
14308 /// # use google_cloud_datastream_v1::model::StreamObject;
14309 /// use wkt::Timestamp;
14310 /// let x = StreamObject::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14311 /// let x = StreamObject::new().set_or_clear_create_time(None::<Timestamp>);
14312 /// ```
14313 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14314 where
14315 T: std::convert::Into<wkt::Timestamp>,
14316 {
14317 self.create_time = v.map(|x| x.into());
14318 self
14319 }
14320
14321 /// Sets the value of [update_time][crate::model::StreamObject::update_time].
14322 ///
14323 /// # Example
14324 /// ```ignore,no_run
14325 /// # use google_cloud_datastream_v1::model::StreamObject;
14326 /// use wkt::Timestamp;
14327 /// let x = StreamObject::new().set_update_time(Timestamp::default()/* use setters */);
14328 /// ```
14329 pub fn set_update_time<T>(mut self, v: T) -> Self
14330 where
14331 T: std::convert::Into<wkt::Timestamp>,
14332 {
14333 self.update_time = std::option::Option::Some(v.into());
14334 self
14335 }
14336
14337 /// Sets or clears the value of [update_time][crate::model::StreamObject::update_time].
14338 ///
14339 /// # Example
14340 /// ```ignore,no_run
14341 /// # use google_cloud_datastream_v1::model::StreamObject;
14342 /// use wkt::Timestamp;
14343 /// let x = StreamObject::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14344 /// let x = StreamObject::new().set_or_clear_update_time(None::<Timestamp>);
14345 /// ```
14346 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14347 where
14348 T: std::convert::Into<wkt::Timestamp>,
14349 {
14350 self.update_time = v.map(|x| x.into());
14351 self
14352 }
14353
14354 /// Sets the value of [display_name][crate::model::StreamObject::display_name].
14355 ///
14356 /// # Example
14357 /// ```ignore,no_run
14358 /// # use google_cloud_datastream_v1::model::StreamObject;
14359 /// let x = StreamObject::new().set_display_name("example");
14360 /// ```
14361 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14362 self.display_name = v.into();
14363 self
14364 }
14365
14366 /// Sets the value of [errors][crate::model::StreamObject::errors].
14367 ///
14368 /// # Example
14369 /// ```ignore,no_run
14370 /// # use google_cloud_datastream_v1::model::StreamObject;
14371 /// use google_cloud_datastream_v1::model::Error;
14372 /// let x = StreamObject::new()
14373 /// .set_errors([
14374 /// Error::default()/* use setters */,
14375 /// Error::default()/* use (different) setters */,
14376 /// ]);
14377 /// ```
14378 pub fn set_errors<T, V>(mut self, v: T) -> Self
14379 where
14380 T: std::iter::IntoIterator<Item = V>,
14381 V: std::convert::Into<crate::model::Error>,
14382 {
14383 use std::iter::Iterator;
14384 self.errors = v.into_iter().map(|i| i.into()).collect();
14385 self
14386 }
14387
14388 /// Sets the value of [backfill_job][crate::model::StreamObject::backfill_job].
14389 ///
14390 /// # Example
14391 /// ```ignore,no_run
14392 /// # use google_cloud_datastream_v1::model::StreamObject;
14393 /// use google_cloud_datastream_v1::model::BackfillJob;
14394 /// let x = StreamObject::new().set_backfill_job(BackfillJob::default()/* use setters */);
14395 /// ```
14396 pub fn set_backfill_job<T>(mut self, v: T) -> Self
14397 where
14398 T: std::convert::Into<crate::model::BackfillJob>,
14399 {
14400 self.backfill_job = std::option::Option::Some(v.into());
14401 self
14402 }
14403
14404 /// Sets or clears the value of [backfill_job][crate::model::StreamObject::backfill_job].
14405 ///
14406 /// # Example
14407 /// ```ignore,no_run
14408 /// # use google_cloud_datastream_v1::model::StreamObject;
14409 /// use google_cloud_datastream_v1::model::BackfillJob;
14410 /// let x = StreamObject::new().set_or_clear_backfill_job(Some(BackfillJob::default()/* use setters */));
14411 /// let x = StreamObject::new().set_or_clear_backfill_job(None::<BackfillJob>);
14412 /// ```
14413 pub fn set_or_clear_backfill_job<T>(mut self, v: std::option::Option<T>) -> Self
14414 where
14415 T: std::convert::Into<crate::model::BackfillJob>,
14416 {
14417 self.backfill_job = v.map(|x| x.into());
14418 self
14419 }
14420
14421 /// Sets the value of [source_object][crate::model::StreamObject::source_object].
14422 ///
14423 /// # Example
14424 /// ```ignore,no_run
14425 /// # use google_cloud_datastream_v1::model::StreamObject;
14426 /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14427 /// let x = StreamObject::new().set_source_object(SourceObjectIdentifier::default()/* use setters */);
14428 /// ```
14429 pub fn set_source_object<T>(mut self, v: T) -> Self
14430 where
14431 T: std::convert::Into<crate::model::SourceObjectIdentifier>,
14432 {
14433 self.source_object = std::option::Option::Some(v.into());
14434 self
14435 }
14436
14437 /// Sets or clears the value of [source_object][crate::model::StreamObject::source_object].
14438 ///
14439 /// # Example
14440 /// ```ignore,no_run
14441 /// # use google_cloud_datastream_v1::model::StreamObject;
14442 /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14443 /// let x = StreamObject::new().set_or_clear_source_object(Some(SourceObjectIdentifier::default()/* use setters */));
14444 /// let x = StreamObject::new().set_or_clear_source_object(None::<SourceObjectIdentifier>);
14445 /// ```
14446 pub fn set_or_clear_source_object<T>(mut self, v: std::option::Option<T>) -> Self
14447 where
14448 T: std::convert::Into<crate::model::SourceObjectIdentifier>,
14449 {
14450 self.source_object = v.map(|x| x.into());
14451 self
14452 }
14453}
14454
14455impl wkt::message::Message for StreamObject {
14456 fn typename() -> &'static str {
14457 "type.googleapis.com/google.cloud.datastream.v1.StreamObject"
14458 }
14459}
14460
14461/// Represents an identifier of an object in the data source.
14462#[derive(Clone, Default, PartialEq)]
14463#[non_exhaustive]
14464pub struct SourceObjectIdentifier {
14465 /// The identifier for an object in the data source.
14466 pub source_identifier:
14467 std::option::Option<crate::model::source_object_identifier::SourceIdentifier>,
14468
14469 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14470}
14471
14472impl SourceObjectIdentifier {
14473 pub fn new() -> Self {
14474 std::default::Default::default()
14475 }
14476
14477 /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier].
14478 ///
14479 /// Note that all the setters affecting `source_identifier` are mutually
14480 /// exclusive.
14481 ///
14482 /// # Example
14483 /// ```ignore,no_run
14484 /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14485 /// use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
14486 /// let x = SourceObjectIdentifier::new().set_source_identifier(Some(
14487 /// google_cloud_datastream_v1::model::source_object_identifier::SourceIdentifier::OracleIdentifier(OracleObjectIdentifier::default().into())));
14488 /// ```
14489 pub fn set_source_identifier<
14490 T: std::convert::Into<
14491 std::option::Option<crate::model::source_object_identifier::SourceIdentifier>,
14492 >,
14493 >(
14494 mut self,
14495 v: T,
14496 ) -> Self {
14497 self.source_identifier = v.into();
14498 self
14499 }
14500
14501 /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14502 /// if it holds a `OracleIdentifier`, `None` if the field is not set or
14503 /// holds a different branch.
14504 pub fn oracle_identifier(
14505 &self,
14506 ) -> std::option::Option<
14507 &std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
14508 > {
14509 #[allow(unreachable_patterns)]
14510 self.source_identifier.as_ref().and_then(|v| match v {
14511 crate::model::source_object_identifier::SourceIdentifier::OracleIdentifier(v) => {
14512 std::option::Option::Some(v)
14513 }
14514 _ => std::option::Option::None,
14515 })
14516 }
14517
14518 /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14519 /// to hold a `OracleIdentifier`.
14520 ///
14521 /// Note that all the setters affecting `source_identifier` are
14522 /// mutually exclusive.
14523 ///
14524 /// # Example
14525 /// ```ignore,no_run
14526 /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14527 /// use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
14528 /// let x = SourceObjectIdentifier::new().set_oracle_identifier(OracleObjectIdentifier::default()/* use setters */);
14529 /// assert!(x.oracle_identifier().is_some());
14530 /// assert!(x.mysql_identifier().is_none());
14531 /// assert!(x.postgresql_identifier().is_none());
14532 /// assert!(x.sql_server_identifier().is_none());
14533 /// assert!(x.salesforce_identifier().is_none());
14534 /// assert!(x.mongodb_identifier().is_none());
14535 /// ```
14536 pub fn set_oracle_identifier<
14537 T: std::convert::Into<
14538 std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
14539 >,
14540 >(
14541 mut self,
14542 v: T,
14543 ) -> Self {
14544 self.source_identifier = std::option::Option::Some(
14545 crate::model::source_object_identifier::SourceIdentifier::OracleIdentifier(v.into()),
14546 );
14547 self
14548 }
14549
14550 /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14551 /// if it holds a `MysqlIdentifier`, `None` if the field is not set or
14552 /// holds a different branch.
14553 pub fn mysql_identifier(
14554 &self,
14555 ) -> std::option::Option<
14556 &std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
14557 > {
14558 #[allow(unreachable_patterns)]
14559 self.source_identifier.as_ref().and_then(|v| match v {
14560 crate::model::source_object_identifier::SourceIdentifier::MysqlIdentifier(v) => {
14561 std::option::Option::Some(v)
14562 }
14563 _ => std::option::Option::None,
14564 })
14565 }
14566
14567 /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14568 /// to hold a `MysqlIdentifier`.
14569 ///
14570 /// Note that all the setters affecting `source_identifier` are
14571 /// mutually exclusive.
14572 ///
14573 /// # Example
14574 /// ```ignore,no_run
14575 /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14576 /// use google_cloud_datastream_v1::model::source_object_identifier::MysqlObjectIdentifier;
14577 /// let x = SourceObjectIdentifier::new().set_mysql_identifier(MysqlObjectIdentifier::default()/* use setters */);
14578 /// assert!(x.mysql_identifier().is_some());
14579 /// assert!(x.oracle_identifier().is_none());
14580 /// assert!(x.postgresql_identifier().is_none());
14581 /// assert!(x.sql_server_identifier().is_none());
14582 /// assert!(x.salesforce_identifier().is_none());
14583 /// assert!(x.mongodb_identifier().is_none());
14584 /// ```
14585 pub fn set_mysql_identifier<
14586 T: std::convert::Into<
14587 std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
14588 >,
14589 >(
14590 mut self,
14591 v: T,
14592 ) -> Self {
14593 self.source_identifier = std::option::Option::Some(
14594 crate::model::source_object_identifier::SourceIdentifier::MysqlIdentifier(v.into()),
14595 );
14596 self
14597 }
14598
14599 /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14600 /// if it holds a `PostgresqlIdentifier`, `None` if the field is not set or
14601 /// holds a different branch.
14602 pub fn postgresql_identifier(
14603 &self,
14604 ) -> std::option::Option<
14605 &std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
14606 > {
14607 #[allow(unreachable_patterns)]
14608 self.source_identifier.as_ref().and_then(|v| match v {
14609 crate::model::source_object_identifier::SourceIdentifier::PostgresqlIdentifier(v) => {
14610 std::option::Option::Some(v)
14611 }
14612 _ => std::option::Option::None,
14613 })
14614 }
14615
14616 /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14617 /// to hold a `PostgresqlIdentifier`.
14618 ///
14619 /// Note that all the setters affecting `source_identifier` are
14620 /// mutually exclusive.
14621 ///
14622 /// # Example
14623 /// ```ignore,no_run
14624 /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14625 /// use google_cloud_datastream_v1::model::source_object_identifier::PostgresqlObjectIdentifier;
14626 /// let x = SourceObjectIdentifier::new().set_postgresql_identifier(PostgresqlObjectIdentifier::default()/* use setters */);
14627 /// assert!(x.postgresql_identifier().is_some());
14628 /// assert!(x.oracle_identifier().is_none());
14629 /// assert!(x.mysql_identifier().is_none());
14630 /// assert!(x.sql_server_identifier().is_none());
14631 /// assert!(x.salesforce_identifier().is_none());
14632 /// assert!(x.mongodb_identifier().is_none());
14633 /// ```
14634 pub fn set_postgresql_identifier<
14635 T: std::convert::Into<
14636 std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
14637 >,
14638 >(
14639 mut self,
14640 v: T,
14641 ) -> Self {
14642 self.source_identifier = std::option::Option::Some(
14643 crate::model::source_object_identifier::SourceIdentifier::PostgresqlIdentifier(
14644 v.into(),
14645 ),
14646 );
14647 self
14648 }
14649
14650 /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14651 /// if it holds a `SqlServerIdentifier`, `None` if the field is not set or
14652 /// holds a different branch.
14653 pub fn sql_server_identifier(
14654 &self,
14655 ) -> std::option::Option<
14656 &std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
14657 > {
14658 #[allow(unreachable_patterns)]
14659 self.source_identifier.as_ref().and_then(|v| match v {
14660 crate::model::source_object_identifier::SourceIdentifier::SqlServerIdentifier(v) => {
14661 std::option::Option::Some(v)
14662 }
14663 _ => std::option::Option::None,
14664 })
14665 }
14666
14667 /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14668 /// to hold a `SqlServerIdentifier`.
14669 ///
14670 /// Note that all the setters affecting `source_identifier` are
14671 /// mutually exclusive.
14672 ///
14673 /// # Example
14674 /// ```ignore,no_run
14675 /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14676 /// use google_cloud_datastream_v1::model::source_object_identifier::SqlServerObjectIdentifier;
14677 /// let x = SourceObjectIdentifier::new().set_sql_server_identifier(SqlServerObjectIdentifier::default()/* use setters */);
14678 /// assert!(x.sql_server_identifier().is_some());
14679 /// assert!(x.oracle_identifier().is_none());
14680 /// assert!(x.mysql_identifier().is_none());
14681 /// assert!(x.postgresql_identifier().is_none());
14682 /// assert!(x.salesforce_identifier().is_none());
14683 /// assert!(x.mongodb_identifier().is_none());
14684 /// ```
14685 pub fn set_sql_server_identifier<
14686 T: std::convert::Into<
14687 std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
14688 >,
14689 >(
14690 mut self,
14691 v: T,
14692 ) -> Self {
14693 self.source_identifier = std::option::Option::Some(
14694 crate::model::source_object_identifier::SourceIdentifier::SqlServerIdentifier(v.into()),
14695 );
14696 self
14697 }
14698
14699 /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14700 /// if it holds a `SalesforceIdentifier`, `None` if the field is not set or
14701 /// holds a different branch.
14702 pub fn salesforce_identifier(
14703 &self,
14704 ) -> std::option::Option<
14705 &std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
14706 > {
14707 #[allow(unreachable_patterns)]
14708 self.source_identifier.as_ref().and_then(|v| match v {
14709 crate::model::source_object_identifier::SourceIdentifier::SalesforceIdentifier(v) => {
14710 std::option::Option::Some(v)
14711 }
14712 _ => std::option::Option::None,
14713 })
14714 }
14715
14716 /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14717 /// to hold a `SalesforceIdentifier`.
14718 ///
14719 /// Note that all the setters affecting `source_identifier` are
14720 /// mutually exclusive.
14721 ///
14722 /// # Example
14723 /// ```ignore,no_run
14724 /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14725 /// use google_cloud_datastream_v1::model::source_object_identifier::SalesforceObjectIdentifier;
14726 /// let x = SourceObjectIdentifier::new().set_salesforce_identifier(SalesforceObjectIdentifier::default()/* use setters */);
14727 /// assert!(x.salesforce_identifier().is_some());
14728 /// assert!(x.oracle_identifier().is_none());
14729 /// assert!(x.mysql_identifier().is_none());
14730 /// assert!(x.postgresql_identifier().is_none());
14731 /// assert!(x.sql_server_identifier().is_none());
14732 /// assert!(x.mongodb_identifier().is_none());
14733 /// ```
14734 pub fn set_salesforce_identifier<
14735 T: std::convert::Into<
14736 std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
14737 >,
14738 >(
14739 mut self,
14740 v: T,
14741 ) -> Self {
14742 self.source_identifier = std::option::Option::Some(
14743 crate::model::source_object_identifier::SourceIdentifier::SalesforceIdentifier(
14744 v.into(),
14745 ),
14746 );
14747 self
14748 }
14749
14750 /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14751 /// if it holds a `MongodbIdentifier`, `None` if the field is not set or
14752 /// holds a different branch.
14753 pub fn mongodb_identifier(
14754 &self,
14755 ) -> std::option::Option<
14756 &std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
14757 > {
14758 #[allow(unreachable_patterns)]
14759 self.source_identifier.as_ref().and_then(|v| match v {
14760 crate::model::source_object_identifier::SourceIdentifier::MongodbIdentifier(v) => {
14761 std::option::Option::Some(v)
14762 }
14763 _ => std::option::Option::None,
14764 })
14765 }
14766
14767 /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14768 /// to hold a `MongodbIdentifier`.
14769 ///
14770 /// Note that all the setters affecting `source_identifier` are
14771 /// mutually exclusive.
14772 ///
14773 /// # Example
14774 /// ```ignore,no_run
14775 /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14776 /// use google_cloud_datastream_v1::model::source_object_identifier::MongodbObjectIdentifier;
14777 /// let x = SourceObjectIdentifier::new().set_mongodb_identifier(MongodbObjectIdentifier::default()/* use setters */);
14778 /// assert!(x.mongodb_identifier().is_some());
14779 /// assert!(x.oracle_identifier().is_none());
14780 /// assert!(x.mysql_identifier().is_none());
14781 /// assert!(x.postgresql_identifier().is_none());
14782 /// assert!(x.sql_server_identifier().is_none());
14783 /// assert!(x.salesforce_identifier().is_none());
14784 /// ```
14785 pub fn set_mongodb_identifier<
14786 T: std::convert::Into<
14787 std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
14788 >,
14789 >(
14790 mut self,
14791 v: T,
14792 ) -> Self {
14793 self.source_identifier = std::option::Option::Some(
14794 crate::model::source_object_identifier::SourceIdentifier::MongodbIdentifier(v.into()),
14795 );
14796 self
14797 }
14798}
14799
14800impl wkt::message::Message for SourceObjectIdentifier {
14801 fn typename() -> &'static str {
14802 "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier"
14803 }
14804}
14805
14806/// Defines additional types related to [SourceObjectIdentifier].
14807pub mod source_object_identifier {
14808 #[allow(unused_imports)]
14809 use super::*;
14810
14811 /// Oracle data source object identifier.
14812 #[derive(Clone, Default, PartialEq)]
14813 #[non_exhaustive]
14814 pub struct OracleObjectIdentifier {
14815 /// Required. The schema name.
14816 pub schema: std::string::String,
14817
14818 /// Required. The table name.
14819 pub table: std::string::String,
14820
14821 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14822 }
14823
14824 impl OracleObjectIdentifier {
14825 pub fn new() -> Self {
14826 std::default::Default::default()
14827 }
14828
14829 /// Sets the value of [schema][crate::model::source_object_identifier::OracleObjectIdentifier::schema].
14830 ///
14831 /// # Example
14832 /// ```ignore,no_run
14833 /// # use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
14834 /// let x = OracleObjectIdentifier::new().set_schema("example");
14835 /// ```
14836 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14837 self.schema = v.into();
14838 self
14839 }
14840
14841 /// Sets the value of [table][crate::model::source_object_identifier::OracleObjectIdentifier::table].
14842 ///
14843 /// # Example
14844 /// ```ignore,no_run
14845 /// # use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
14846 /// let x = OracleObjectIdentifier::new().set_table("example");
14847 /// ```
14848 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14849 self.table = v.into();
14850 self
14851 }
14852 }
14853
14854 impl wkt::message::Message for OracleObjectIdentifier {
14855 fn typename() -> &'static str {
14856 "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.OracleObjectIdentifier"
14857 }
14858 }
14859
14860 /// PostgreSQL data source object identifier.
14861 #[derive(Clone, Default, PartialEq)]
14862 #[non_exhaustive]
14863 pub struct PostgresqlObjectIdentifier {
14864 /// Required. The schema name.
14865 pub schema: std::string::String,
14866
14867 /// Required. The table name.
14868 pub table: std::string::String,
14869
14870 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14871 }
14872
14873 impl PostgresqlObjectIdentifier {
14874 pub fn new() -> Self {
14875 std::default::Default::default()
14876 }
14877
14878 /// Sets the value of [schema][crate::model::source_object_identifier::PostgresqlObjectIdentifier::schema].
14879 ///
14880 /// # Example
14881 /// ```ignore,no_run
14882 /// # use google_cloud_datastream_v1::model::source_object_identifier::PostgresqlObjectIdentifier;
14883 /// let x = PostgresqlObjectIdentifier::new().set_schema("example");
14884 /// ```
14885 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14886 self.schema = v.into();
14887 self
14888 }
14889
14890 /// Sets the value of [table][crate::model::source_object_identifier::PostgresqlObjectIdentifier::table].
14891 ///
14892 /// # Example
14893 /// ```ignore,no_run
14894 /// # use google_cloud_datastream_v1::model::source_object_identifier::PostgresqlObjectIdentifier;
14895 /// let x = PostgresqlObjectIdentifier::new().set_table("example");
14896 /// ```
14897 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14898 self.table = v.into();
14899 self
14900 }
14901 }
14902
14903 impl wkt::message::Message for PostgresqlObjectIdentifier {
14904 fn typename() -> &'static str {
14905 "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.PostgresqlObjectIdentifier"
14906 }
14907 }
14908
14909 /// Mysql data source object identifier.
14910 #[derive(Clone, Default, PartialEq)]
14911 #[non_exhaustive]
14912 pub struct MysqlObjectIdentifier {
14913 /// Required. The database name.
14914 pub database: std::string::String,
14915
14916 /// Required. The table name.
14917 pub table: std::string::String,
14918
14919 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14920 }
14921
14922 impl MysqlObjectIdentifier {
14923 pub fn new() -> Self {
14924 std::default::Default::default()
14925 }
14926
14927 /// Sets the value of [database][crate::model::source_object_identifier::MysqlObjectIdentifier::database].
14928 ///
14929 /// # Example
14930 /// ```ignore,no_run
14931 /// # use google_cloud_datastream_v1::model::source_object_identifier::MysqlObjectIdentifier;
14932 /// let x = MysqlObjectIdentifier::new().set_database("example");
14933 /// ```
14934 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14935 self.database = v.into();
14936 self
14937 }
14938
14939 /// Sets the value of [table][crate::model::source_object_identifier::MysqlObjectIdentifier::table].
14940 ///
14941 /// # Example
14942 /// ```ignore,no_run
14943 /// # use google_cloud_datastream_v1::model::source_object_identifier::MysqlObjectIdentifier;
14944 /// let x = MysqlObjectIdentifier::new().set_table("example");
14945 /// ```
14946 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14947 self.table = v.into();
14948 self
14949 }
14950 }
14951
14952 impl wkt::message::Message for MysqlObjectIdentifier {
14953 fn typename() -> &'static str {
14954 "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.MysqlObjectIdentifier"
14955 }
14956 }
14957
14958 /// SQLServer data source object identifier.
14959 #[derive(Clone, Default, PartialEq)]
14960 #[non_exhaustive]
14961 pub struct SqlServerObjectIdentifier {
14962 /// Required. The schema name.
14963 pub schema: std::string::String,
14964
14965 /// Required. The table name.
14966 pub table: std::string::String,
14967
14968 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14969 }
14970
14971 impl SqlServerObjectIdentifier {
14972 pub fn new() -> Self {
14973 std::default::Default::default()
14974 }
14975
14976 /// Sets the value of [schema][crate::model::source_object_identifier::SqlServerObjectIdentifier::schema].
14977 ///
14978 /// # Example
14979 /// ```ignore,no_run
14980 /// # use google_cloud_datastream_v1::model::source_object_identifier::SqlServerObjectIdentifier;
14981 /// let x = SqlServerObjectIdentifier::new().set_schema("example");
14982 /// ```
14983 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14984 self.schema = v.into();
14985 self
14986 }
14987
14988 /// Sets the value of [table][crate::model::source_object_identifier::SqlServerObjectIdentifier::table].
14989 ///
14990 /// # Example
14991 /// ```ignore,no_run
14992 /// # use google_cloud_datastream_v1::model::source_object_identifier::SqlServerObjectIdentifier;
14993 /// let x = SqlServerObjectIdentifier::new().set_table("example");
14994 /// ```
14995 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14996 self.table = v.into();
14997 self
14998 }
14999 }
15000
15001 impl wkt::message::Message for SqlServerObjectIdentifier {
15002 fn typename() -> &'static str {
15003 "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.SqlServerObjectIdentifier"
15004 }
15005 }
15006
15007 /// Salesforce data source object identifier.
15008 #[derive(Clone, Default, PartialEq)]
15009 #[non_exhaustive]
15010 pub struct SalesforceObjectIdentifier {
15011 /// Required. The object name.
15012 pub object_name: std::string::String,
15013
15014 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15015 }
15016
15017 impl SalesforceObjectIdentifier {
15018 pub fn new() -> Self {
15019 std::default::Default::default()
15020 }
15021
15022 /// Sets the value of [object_name][crate::model::source_object_identifier::SalesforceObjectIdentifier::object_name].
15023 ///
15024 /// # Example
15025 /// ```ignore,no_run
15026 /// # use google_cloud_datastream_v1::model::source_object_identifier::SalesforceObjectIdentifier;
15027 /// let x = SalesforceObjectIdentifier::new().set_object_name("example");
15028 /// ```
15029 pub fn set_object_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15030 self.object_name = v.into();
15031 self
15032 }
15033 }
15034
15035 impl wkt::message::Message for SalesforceObjectIdentifier {
15036 fn typename() -> &'static str {
15037 "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.SalesforceObjectIdentifier"
15038 }
15039 }
15040
15041 /// MongoDB data source object identifier.
15042 #[derive(Clone, Default, PartialEq)]
15043 #[non_exhaustive]
15044 pub struct MongodbObjectIdentifier {
15045 /// Required. The database name.
15046 pub database: std::string::String,
15047
15048 /// Required. The collection name.
15049 pub collection: std::string::String,
15050
15051 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15052 }
15053
15054 impl MongodbObjectIdentifier {
15055 pub fn new() -> Self {
15056 std::default::Default::default()
15057 }
15058
15059 /// Sets the value of [database][crate::model::source_object_identifier::MongodbObjectIdentifier::database].
15060 ///
15061 /// # Example
15062 /// ```ignore,no_run
15063 /// # use google_cloud_datastream_v1::model::source_object_identifier::MongodbObjectIdentifier;
15064 /// let x = MongodbObjectIdentifier::new().set_database("example");
15065 /// ```
15066 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15067 self.database = v.into();
15068 self
15069 }
15070
15071 /// Sets the value of [collection][crate::model::source_object_identifier::MongodbObjectIdentifier::collection].
15072 ///
15073 /// # Example
15074 /// ```ignore,no_run
15075 /// # use google_cloud_datastream_v1::model::source_object_identifier::MongodbObjectIdentifier;
15076 /// let x = MongodbObjectIdentifier::new().set_collection("example");
15077 /// ```
15078 pub fn set_collection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15079 self.collection = v.into();
15080 self
15081 }
15082 }
15083
15084 impl wkt::message::Message for MongodbObjectIdentifier {
15085 fn typename() -> &'static str {
15086 "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.MongodbObjectIdentifier"
15087 }
15088 }
15089
15090 /// The identifier for an object in the data source.
15091 #[derive(Clone, Debug, PartialEq)]
15092 #[non_exhaustive]
15093 pub enum SourceIdentifier {
15094 /// Oracle data source object identifier.
15095 OracleIdentifier(
15096 std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
15097 ),
15098 /// Mysql data source object identifier.
15099 MysqlIdentifier(
15100 std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
15101 ),
15102 /// PostgreSQL data source object identifier.
15103 PostgresqlIdentifier(
15104 std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
15105 ),
15106 /// SQLServer data source object identifier.
15107 SqlServerIdentifier(
15108 std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
15109 ),
15110 /// Salesforce data source object identifier.
15111 SalesforceIdentifier(
15112 std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
15113 ),
15114 /// MongoDB data source object identifier.
15115 MongodbIdentifier(
15116 std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
15117 ),
15118 }
15119}
15120
15121/// Represents a backfill job on a specific stream object.
15122#[derive(Clone, Default, PartialEq)]
15123#[non_exhaustive]
15124pub struct BackfillJob {
15125 /// Output only. Backfill job state.
15126 pub state: crate::model::backfill_job::State,
15127
15128 /// Backfill job's triggering reason.
15129 pub trigger: crate::model::backfill_job::Trigger,
15130
15131 /// Output only. Backfill job's start time.
15132 pub last_start_time: std::option::Option<wkt::Timestamp>,
15133
15134 /// Output only. Backfill job's end time.
15135 pub last_end_time: std::option::Option<wkt::Timestamp>,
15136
15137 /// Output only. Errors which caused the backfill job to fail.
15138 pub errors: std::vec::Vec<crate::model::Error>,
15139
15140 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15141}
15142
15143impl BackfillJob {
15144 pub fn new() -> Self {
15145 std::default::Default::default()
15146 }
15147
15148 /// Sets the value of [state][crate::model::BackfillJob::state].
15149 ///
15150 /// # Example
15151 /// ```ignore,no_run
15152 /// # use google_cloud_datastream_v1::model::BackfillJob;
15153 /// use google_cloud_datastream_v1::model::backfill_job::State;
15154 /// let x0 = BackfillJob::new().set_state(State::NotStarted);
15155 /// let x1 = BackfillJob::new().set_state(State::Pending);
15156 /// let x2 = BackfillJob::new().set_state(State::Active);
15157 /// ```
15158 pub fn set_state<T: std::convert::Into<crate::model::backfill_job::State>>(
15159 mut self,
15160 v: T,
15161 ) -> Self {
15162 self.state = v.into();
15163 self
15164 }
15165
15166 /// Sets the value of [trigger][crate::model::BackfillJob::trigger].
15167 ///
15168 /// # Example
15169 /// ```ignore,no_run
15170 /// # use google_cloud_datastream_v1::model::BackfillJob;
15171 /// use google_cloud_datastream_v1::model::backfill_job::Trigger;
15172 /// let x0 = BackfillJob::new().set_trigger(Trigger::Automatic);
15173 /// let x1 = BackfillJob::new().set_trigger(Trigger::Manual);
15174 /// ```
15175 pub fn set_trigger<T: std::convert::Into<crate::model::backfill_job::Trigger>>(
15176 mut self,
15177 v: T,
15178 ) -> Self {
15179 self.trigger = v.into();
15180 self
15181 }
15182
15183 /// Sets the value of [last_start_time][crate::model::BackfillJob::last_start_time].
15184 ///
15185 /// # Example
15186 /// ```ignore,no_run
15187 /// # use google_cloud_datastream_v1::model::BackfillJob;
15188 /// use wkt::Timestamp;
15189 /// let x = BackfillJob::new().set_last_start_time(Timestamp::default()/* use setters */);
15190 /// ```
15191 pub fn set_last_start_time<T>(mut self, v: T) -> Self
15192 where
15193 T: std::convert::Into<wkt::Timestamp>,
15194 {
15195 self.last_start_time = std::option::Option::Some(v.into());
15196 self
15197 }
15198
15199 /// Sets or clears the value of [last_start_time][crate::model::BackfillJob::last_start_time].
15200 ///
15201 /// # Example
15202 /// ```ignore,no_run
15203 /// # use google_cloud_datastream_v1::model::BackfillJob;
15204 /// use wkt::Timestamp;
15205 /// let x = BackfillJob::new().set_or_clear_last_start_time(Some(Timestamp::default()/* use setters */));
15206 /// let x = BackfillJob::new().set_or_clear_last_start_time(None::<Timestamp>);
15207 /// ```
15208 pub fn set_or_clear_last_start_time<T>(mut self, v: std::option::Option<T>) -> Self
15209 where
15210 T: std::convert::Into<wkt::Timestamp>,
15211 {
15212 self.last_start_time = v.map(|x| x.into());
15213 self
15214 }
15215
15216 /// Sets the value of [last_end_time][crate::model::BackfillJob::last_end_time].
15217 ///
15218 /// # Example
15219 /// ```ignore,no_run
15220 /// # use google_cloud_datastream_v1::model::BackfillJob;
15221 /// use wkt::Timestamp;
15222 /// let x = BackfillJob::new().set_last_end_time(Timestamp::default()/* use setters */);
15223 /// ```
15224 pub fn set_last_end_time<T>(mut self, v: T) -> Self
15225 where
15226 T: std::convert::Into<wkt::Timestamp>,
15227 {
15228 self.last_end_time = std::option::Option::Some(v.into());
15229 self
15230 }
15231
15232 /// Sets or clears the value of [last_end_time][crate::model::BackfillJob::last_end_time].
15233 ///
15234 /// # Example
15235 /// ```ignore,no_run
15236 /// # use google_cloud_datastream_v1::model::BackfillJob;
15237 /// use wkt::Timestamp;
15238 /// let x = BackfillJob::new().set_or_clear_last_end_time(Some(Timestamp::default()/* use setters */));
15239 /// let x = BackfillJob::new().set_or_clear_last_end_time(None::<Timestamp>);
15240 /// ```
15241 pub fn set_or_clear_last_end_time<T>(mut self, v: std::option::Option<T>) -> Self
15242 where
15243 T: std::convert::Into<wkt::Timestamp>,
15244 {
15245 self.last_end_time = v.map(|x| x.into());
15246 self
15247 }
15248
15249 /// Sets the value of [errors][crate::model::BackfillJob::errors].
15250 ///
15251 /// # Example
15252 /// ```ignore,no_run
15253 /// # use google_cloud_datastream_v1::model::BackfillJob;
15254 /// use google_cloud_datastream_v1::model::Error;
15255 /// let x = BackfillJob::new()
15256 /// .set_errors([
15257 /// Error::default()/* use setters */,
15258 /// Error::default()/* use (different) setters */,
15259 /// ]);
15260 /// ```
15261 pub fn set_errors<T, V>(mut self, v: T) -> Self
15262 where
15263 T: std::iter::IntoIterator<Item = V>,
15264 V: std::convert::Into<crate::model::Error>,
15265 {
15266 use std::iter::Iterator;
15267 self.errors = v.into_iter().map(|i| i.into()).collect();
15268 self
15269 }
15270}
15271
15272impl wkt::message::Message for BackfillJob {
15273 fn typename() -> &'static str {
15274 "type.googleapis.com/google.cloud.datastream.v1.BackfillJob"
15275 }
15276}
15277
15278/// Defines additional types related to [BackfillJob].
15279pub mod backfill_job {
15280 #[allow(unused_imports)]
15281 use super::*;
15282
15283 /// State of the stream object's backfill job.
15284 ///
15285 /// # Working with unknown values
15286 ///
15287 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15288 /// additional enum variants at any time. Adding new variants is not considered
15289 /// a breaking change. Applications should write their code in anticipation of:
15290 ///
15291 /// - New values appearing in future releases of the client library, **and**
15292 /// - New values received dynamically, without application changes.
15293 ///
15294 /// Please consult the [Working with enums] section in the user guide for some
15295 /// guidelines.
15296 ///
15297 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15298 #[derive(Clone, Debug, PartialEq)]
15299 #[non_exhaustive]
15300 pub enum State {
15301 /// Default value.
15302 Unspecified,
15303 /// Backfill job was never started for the stream object (stream has backfill
15304 /// strategy defined as manual or object was explicitly excluded from
15305 /// automatic backfill).
15306 NotStarted,
15307 /// Backfill job will start pending available resources.
15308 Pending,
15309 /// Backfill job is running.
15310 Active,
15311 /// Backfill job stopped (next job run will start from beginning).
15312 Stopped,
15313 /// Backfill job failed (due to an error).
15314 Failed,
15315 /// Backfill completed successfully.
15316 Completed,
15317 /// Backfill job failed since the table structure is currently unsupported
15318 /// for backfill.
15319 Unsupported,
15320 /// If set, the enum was initialized with an unknown value.
15321 ///
15322 /// Applications can examine the value using [State::value] or
15323 /// [State::name].
15324 UnknownValue(state::UnknownValue),
15325 }
15326
15327 #[doc(hidden)]
15328 pub mod state {
15329 #[allow(unused_imports)]
15330 use super::*;
15331 #[derive(Clone, Debug, PartialEq)]
15332 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15333 }
15334
15335 impl State {
15336 /// Gets the enum value.
15337 ///
15338 /// Returns `None` if the enum contains an unknown value deserialized from
15339 /// the string representation of enums.
15340 pub fn value(&self) -> std::option::Option<i32> {
15341 match self {
15342 Self::Unspecified => std::option::Option::Some(0),
15343 Self::NotStarted => std::option::Option::Some(1),
15344 Self::Pending => std::option::Option::Some(2),
15345 Self::Active => std::option::Option::Some(3),
15346 Self::Stopped => std::option::Option::Some(4),
15347 Self::Failed => std::option::Option::Some(5),
15348 Self::Completed => std::option::Option::Some(6),
15349 Self::Unsupported => std::option::Option::Some(7),
15350 Self::UnknownValue(u) => u.0.value(),
15351 }
15352 }
15353
15354 /// Gets the enum value as a string.
15355 ///
15356 /// Returns `None` if the enum contains an unknown value deserialized from
15357 /// the integer representation of enums.
15358 pub fn name(&self) -> std::option::Option<&str> {
15359 match self {
15360 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
15361 Self::NotStarted => std::option::Option::Some("NOT_STARTED"),
15362 Self::Pending => std::option::Option::Some("PENDING"),
15363 Self::Active => std::option::Option::Some("ACTIVE"),
15364 Self::Stopped => std::option::Option::Some("STOPPED"),
15365 Self::Failed => std::option::Option::Some("FAILED"),
15366 Self::Completed => std::option::Option::Some("COMPLETED"),
15367 Self::Unsupported => std::option::Option::Some("UNSUPPORTED"),
15368 Self::UnknownValue(u) => u.0.name(),
15369 }
15370 }
15371 }
15372
15373 impl std::default::Default for State {
15374 fn default() -> Self {
15375 use std::convert::From;
15376 Self::from(0)
15377 }
15378 }
15379
15380 impl std::fmt::Display for State {
15381 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15382 wkt::internal::display_enum(f, self.name(), self.value())
15383 }
15384 }
15385
15386 impl std::convert::From<i32> for State {
15387 fn from(value: i32) -> Self {
15388 match value {
15389 0 => Self::Unspecified,
15390 1 => Self::NotStarted,
15391 2 => Self::Pending,
15392 3 => Self::Active,
15393 4 => Self::Stopped,
15394 5 => Self::Failed,
15395 6 => Self::Completed,
15396 7 => Self::Unsupported,
15397 _ => Self::UnknownValue(state::UnknownValue(
15398 wkt::internal::UnknownEnumValue::Integer(value),
15399 )),
15400 }
15401 }
15402 }
15403
15404 impl std::convert::From<&str> for State {
15405 fn from(value: &str) -> Self {
15406 use std::string::ToString;
15407 match value {
15408 "STATE_UNSPECIFIED" => Self::Unspecified,
15409 "NOT_STARTED" => Self::NotStarted,
15410 "PENDING" => Self::Pending,
15411 "ACTIVE" => Self::Active,
15412 "STOPPED" => Self::Stopped,
15413 "FAILED" => Self::Failed,
15414 "COMPLETED" => Self::Completed,
15415 "UNSUPPORTED" => Self::Unsupported,
15416 _ => Self::UnknownValue(state::UnknownValue(
15417 wkt::internal::UnknownEnumValue::String(value.to_string()),
15418 )),
15419 }
15420 }
15421 }
15422
15423 impl serde::ser::Serialize for State {
15424 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15425 where
15426 S: serde::Serializer,
15427 {
15428 match self {
15429 Self::Unspecified => serializer.serialize_i32(0),
15430 Self::NotStarted => serializer.serialize_i32(1),
15431 Self::Pending => serializer.serialize_i32(2),
15432 Self::Active => serializer.serialize_i32(3),
15433 Self::Stopped => serializer.serialize_i32(4),
15434 Self::Failed => serializer.serialize_i32(5),
15435 Self::Completed => serializer.serialize_i32(6),
15436 Self::Unsupported => serializer.serialize_i32(7),
15437 Self::UnknownValue(u) => u.0.serialize(serializer),
15438 }
15439 }
15440 }
15441
15442 impl<'de> serde::de::Deserialize<'de> for State {
15443 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15444 where
15445 D: serde::Deserializer<'de>,
15446 {
15447 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15448 ".google.cloud.datastream.v1.BackfillJob.State",
15449 ))
15450 }
15451 }
15452
15453 /// Triggering reason for a backfill job.
15454 ///
15455 /// # Working with unknown values
15456 ///
15457 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15458 /// additional enum variants at any time. Adding new variants is not considered
15459 /// a breaking change. Applications should write their code in anticipation of:
15460 ///
15461 /// - New values appearing in future releases of the client library, **and**
15462 /// - New values received dynamically, without application changes.
15463 ///
15464 /// Please consult the [Working with enums] section in the user guide for some
15465 /// guidelines.
15466 ///
15467 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15468 #[derive(Clone, Debug, PartialEq)]
15469 #[non_exhaustive]
15470 pub enum Trigger {
15471 /// Default value.
15472 Unspecified,
15473 /// Object backfill job was triggered automatically according to the stream's
15474 /// backfill strategy.
15475 Automatic,
15476 /// Object backfill job was triggered manually using the dedicated API.
15477 Manual,
15478 /// If set, the enum was initialized with an unknown value.
15479 ///
15480 /// Applications can examine the value using [Trigger::value] or
15481 /// [Trigger::name].
15482 UnknownValue(trigger::UnknownValue),
15483 }
15484
15485 #[doc(hidden)]
15486 pub mod trigger {
15487 #[allow(unused_imports)]
15488 use super::*;
15489 #[derive(Clone, Debug, PartialEq)]
15490 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15491 }
15492
15493 impl Trigger {
15494 /// Gets the enum value.
15495 ///
15496 /// Returns `None` if the enum contains an unknown value deserialized from
15497 /// the string representation of enums.
15498 pub fn value(&self) -> std::option::Option<i32> {
15499 match self {
15500 Self::Unspecified => std::option::Option::Some(0),
15501 Self::Automatic => std::option::Option::Some(1),
15502 Self::Manual => std::option::Option::Some(2),
15503 Self::UnknownValue(u) => u.0.value(),
15504 }
15505 }
15506
15507 /// Gets the enum value as a string.
15508 ///
15509 /// Returns `None` if the enum contains an unknown value deserialized from
15510 /// the integer representation of enums.
15511 pub fn name(&self) -> std::option::Option<&str> {
15512 match self {
15513 Self::Unspecified => std::option::Option::Some("TRIGGER_UNSPECIFIED"),
15514 Self::Automatic => std::option::Option::Some("AUTOMATIC"),
15515 Self::Manual => std::option::Option::Some("MANUAL"),
15516 Self::UnknownValue(u) => u.0.name(),
15517 }
15518 }
15519 }
15520
15521 impl std::default::Default for Trigger {
15522 fn default() -> Self {
15523 use std::convert::From;
15524 Self::from(0)
15525 }
15526 }
15527
15528 impl std::fmt::Display for Trigger {
15529 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15530 wkt::internal::display_enum(f, self.name(), self.value())
15531 }
15532 }
15533
15534 impl std::convert::From<i32> for Trigger {
15535 fn from(value: i32) -> Self {
15536 match value {
15537 0 => Self::Unspecified,
15538 1 => Self::Automatic,
15539 2 => Self::Manual,
15540 _ => Self::UnknownValue(trigger::UnknownValue(
15541 wkt::internal::UnknownEnumValue::Integer(value),
15542 )),
15543 }
15544 }
15545 }
15546
15547 impl std::convert::From<&str> for Trigger {
15548 fn from(value: &str) -> Self {
15549 use std::string::ToString;
15550 match value {
15551 "TRIGGER_UNSPECIFIED" => Self::Unspecified,
15552 "AUTOMATIC" => Self::Automatic,
15553 "MANUAL" => Self::Manual,
15554 _ => Self::UnknownValue(trigger::UnknownValue(
15555 wkt::internal::UnknownEnumValue::String(value.to_string()),
15556 )),
15557 }
15558 }
15559 }
15560
15561 impl serde::ser::Serialize for Trigger {
15562 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15563 where
15564 S: serde::Serializer,
15565 {
15566 match self {
15567 Self::Unspecified => serializer.serialize_i32(0),
15568 Self::Automatic => serializer.serialize_i32(1),
15569 Self::Manual => serializer.serialize_i32(2),
15570 Self::UnknownValue(u) => u.0.serialize(serializer),
15571 }
15572 }
15573 }
15574
15575 impl<'de> serde::de::Deserialize<'de> for Trigger {
15576 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15577 where
15578 D: serde::Deserializer<'de>,
15579 {
15580 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Trigger>::new(
15581 ".google.cloud.datastream.v1.BackfillJob.Trigger",
15582 ))
15583 }
15584 }
15585}
15586
15587/// Represent a user-facing Error.
15588#[derive(Clone, Default, PartialEq)]
15589#[non_exhaustive]
15590pub struct Error {
15591 /// A title that explains the reason for the error.
15592 pub reason: std::string::String,
15593
15594 /// A unique identifier for this specific error,
15595 /// allowing it to be traced throughout the system in logs and API responses.
15596 pub error_uuid: std::string::String,
15597
15598 /// A message containing more information about the error that occurred.
15599 pub message: std::string::String,
15600
15601 /// The time when the error occurred.
15602 pub error_time: std::option::Option<wkt::Timestamp>,
15603
15604 /// Additional information about the error.
15605 pub details: std::collections::HashMap<std::string::String, std::string::String>,
15606
15607 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15608}
15609
15610impl Error {
15611 pub fn new() -> Self {
15612 std::default::Default::default()
15613 }
15614
15615 /// Sets the value of [reason][crate::model::Error::reason].
15616 ///
15617 /// # Example
15618 /// ```ignore,no_run
15619 /// # use google_cloud_datastream_v1::model::Error;
15620 /// let x = Error::new().set_reason("example");
15621 /// ```
15622 pub fn set_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15623 self.reason = v.into();
15624 self
15625 }
15626
15627 /// Sets the value of [error_uuid][crate::model::Error::error_uuid].
15628 ///
15629 /// # Example
15630 /// ```ignore,no_run
15631 /// # use google_cloud_datastream_v1::model::Error;
15632 /// let x = Error::new().set_error_uuid("example");
15633 /// ```
15634 pub fn set_error_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15635 self.error_uuid = v.into();
15636 self
15637 }
15638
15639 /// Sets the value of [message][crate::model::Error::message].
15640 ///
15641 /// # Example
15642 /// ```ignore,no_run
15643 /// # use google_cloud_datastream_v1::model::Error;
15644 /// let x = Error::new().set_message("example");
15645 /// ```
15646 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15647 self.message = v.into();
15648 self
15649 }
15650
15651 /// Sets the value of [error_time][crate::model::Error::error_time].
15652 ///
15653 /// # Example
15654 /// ```ignore,no_run
15655 /// # use google_cloud_datastream_v1::model::Error;
15656 /// use wkt::Timestamp;
15657 /// let x = Error::new().set_error_time(Timestamp::default()/* use setters */);
15658 /// ```
15659 pub fn set_error_time<T>(mut self, v: T) -> Self
15660 where
15661 T: std::convert::Into<wkt::Timestamp>,
15662 {
15663 self.error_time = std::option::Option::Some(v.into());
15664 self
15665 }
15666
15667 /// Sets or clears the value of [error_time][crate::model::Error::error_time].
15668 ///
15669 /// # Example
15670 /// ```ignore,no_run
15671 /// # use google_cloud_datastream_v1::model::Error;
15672 /// use wkt::Timestamp;
15673 /// let x = Error::new().set_or_clear_error_time(Some(Timestamp::default()/* use setters */));
15674 /// let x = Error::new().set_or_clear_error_time(None::<Timestamp>);
15675 /// ```
15676 pub fn set_or_clear_error_time<T>(mut self, v: std::option::Option<T>) -> Self
15677 where
15678 T: std::convert::Into<wkt::Timestamp>,
15679 {
15680 self.error_time = v.map(|x| x.into());
15681 self
15682 }
15683
15684 /// Sets the value of [details][crate::model::Error::details].
15685 ///
15686 /// # Example
15687 /// ```ignore,no_run
15688 /// # use google_cloud_datastream_v1::model::Error;
15689 /// let x = Error::new().set_details([
15690 /// ("key0", "abc"),
15691 /// ("key1", "xyz"),
15692 /// ]);
15693 /// ```
15694 pub fn set_details<T, K, V>(mut self, v: T) -> Self
15695 where
15696 T: std::iter::IntoIterator<Item = (K, V)>,
15697 K: std::convert::Into<std::string::String>,
15698 V: std::convert::Into<std::string::String>,
15699 {
15700 use std::iter::Iterator;
15701 self.details = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15702 self
15703 }
15704}
15705
15706impl wkt::message::Message for Error {
15707 fn typename() -> &'static str {
15708 "type.googleapis.com/google.cloud.datastream.v1.Error"
15709 }
15710}
15711
15712/// Contains the current validation results.
15713#[derive(Clone, Default, PartialEq)]
15714#[non_exhaustive]
15715pub struct ValidationResult {
15716 /// A list of validations (includes both executed as well as not executed
15717 /// validations).
15718 pub validations: std::vec::Vec<crate::model::Validation>,
15719
15720 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15721}
15722
15723impl ValidationResult {
15724 pub fn new() -> Self {
15725 std::default::Default::default()
15726 }
15727
15728 /// Sets the value of [validations][crate::model::ValidationResult::validations].
15729 ///
15730 /// # Example
15731 /// ```ignore,no_run
15732 /// # use google_cloud_datastream_v1::model::ValidationResult;
15733 /// use google_cloud_datastream_v1::model::Validation;
15734 /// let x = ValidationResult::new()
15735 /// .set_validations([
15736 /// Validation::default()/* use setters */,
15737 /// Validation::default()/* use (different) setters */,
15738 /// ]);
15739 /// ```
15740 pub fn set_validations<T, V>(mut self, v: T) -> Self
15741 where
15742 T: std::iter::IntoIterator<Item = V>,
15743 V: std::convert::Into<crate::model::Validation>,
15744 {
15745 use std::iter::Iterator;
15746 self.validations = v.into_iter().map(|i| i.into()).collect();
15747 self
15748 }
15749}
15750
15751impl wkt::message::Message for ValidationResult {
15752 fn typename() -> &'static str {
15753 "type.googleapis.com/google.cloud.datastream.v1.ValidationResult"
15754 }
15755}
15756
15757/// A validation to perform on a stream.
15758#[derive(Clone, Default, PartialEq)]
15759#[non_exhaustive]
15760pub struct Validation {
15761 /// A short description of the validation.
15762 pub description: std::string::String,
15763
15764 /// Output only. Validation execution status.
15765 pub state: crate::model::validation::State,
15766
15767 /// Messages reflecting the validation results.
15768 pub message: std::vec::Vec<crate::model::ValidationMessage>,
15769
15770 /// A custom code identifying this validation.
15771 pub code: std::string::String,
15772
15773 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15774}
15775
15776impl Validation {
15777 pub fn new() -> Self {
15778 std::default::Default::default()
15779 }
15780
15781 /// Sets the value of [description][crate::model::Validation::description].
15782 ///
15783 /// # Example
15784 /// ```ignore,no_run
15785 /// # use google_cloud_datastream_v1::model::Validation;
15786 /// let x = Validation::new().set_description("example");
15787 /// ```
15788 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15789 self.description = v.into();
15790 self
15791 }
15792
15793 /// Sets the value of [state][crate::model::Validation::state].
15794 ///
15795 /// # Example
15796 /// ```ignore,no_run
15797 /// # use google_cloud_datastream_v1::model::Validation;
15798 /// use google_cloud_datastream_v1::model::validation::State;
15799 /// let x0 = Validation::new().set_state(State::NotExecuted);
15800 /// let x1 = Validation::new().set_state(State::Failed);
15801 /// let x2 = Validation::new().set_state(State::Passed);
15802 /// ```
15803 pub fn set_state<T: std::convert::Into<crate::model::validation::State>>(
15804 mut self,
15805 v: T,
15806 ) -> Self {
15807 self.state = v.into();
15808 self
15809 }
15810
15811 /// Sets the value of [message][crate::model::Validation::message].
15812 ///
15813 /// # Example
15814 /// ```ignore,no_run
15815 /// # use google_cloud_datastream_v1::model::Validation;
15816 /// use google_cloud_datastream_v1::model::ValidationMessage;
15817 /// let x = Validation::new()
15818 /// .set_message([
15819 /// ValidationMessage::default()/* use setters */,
15820 /// ValidationMessage::default()/* use (different) setters */,
15821 /// ]);
15822 /// ```
15823 pub fn set_message<T, V>(mut self, v: T) -> Self
15824 where
15825 T: std::iter::IntoIterator<Item = V>,
15826 V: std::convert::Into<crate::model::ValidationMessage>,
15827 {
15828 use std::iter::Iterator;
15829 self.message = v.into_iter().map(|i| i.into()).collect();
15830 self
15831 }
15832
15833 /// Sets the value of [code][crate::model::Validation::code].
15834 ///
15835 /// # Example
15836 /// ```ignore,no_run
15837 /// # use google_cloud_datastream_v1::model::Validation;
15838 /// let x = Validation::new().set_code("example");
15839 /// ```
15840 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15841 self.code = v.into();
15842 self
15843 }
15844}
15845
15846impl wkt::message::Message for Validation {
15847 fn typename() -> &'static str {
15848 "type.googleapis.com/google.cloud.datastream.v1.Validation"
15849 }
15850}
15851
15852/// Defines additional types related to [Validation].
15853pub mod validation {
15854 #[allow(unused_imports)]
15855 use super::*;
15856
15857 /// Validation execution state.
15858 ///
15859 /// # Working with unknown values
15860 ///
15861 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15862 /// additional enum variants at any time. Adding new variants is not considered
15863 /// a breaking change. Applications should write their code in anticipation of:
15864 ///
15865 /// - New values appearing in future releases of the client library, **and**
15866 /// - New values received dynamically, without application changes.
15867 ///
15868 /// Please consult the [Working with enums] section in the user guide for some
15869 /// guidelines.
15870 ///
15871 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15872 #[derive(Clone, Debug, PartialEq)]
15873 #[non_exhaustive]
15874 pub enum State {
15875 /// Unspecified state.
15876 Unspecified,
15877 /// Validation did not execute.
15878 NotExecuted,
15879 /// Validation failed.
15880 Failed,
15881 /// Validation passed.
15882 Passed,
15883 /// Validation executed with warnings.
15884 Warning,
15885 /// If set, the enum was initialized with an unknown value.
15886 ///
15887 /// Applications can examine the value using [State::value] or
15888 /// [State::name].
15889 UnknownValue(state::UnknownValue),
15890 }
15891
15892 #[doc(hidden)]
15893 pub mod state {
15894 #[allow(unused_imports)]
15895 use super::*;
15896 #[derive(Clone, Debug, PartialEq)]
15897 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15898 }
15899
15900 impl State {
15901 /// Gets the enum value.
15902 ///
15903 /// Returns `None` if the enum contains an unknown value deserialized from
15904 /// the string representation of enums.
15905 pub fn value(&self) -> std::option::Option<i32> {
15906 match self {
15907 Self::Unspecified => std::option::Option::Some(0),
15908 Self::NotExecuted => std::option::Option::Some(1),
15909 Self::Failed => std::option::Option::Some(2),
15910 Self::Passed => std::option::Option::Some(3),
15911 Self::Warning => std::option::Option::Some(4),
15912 Self::UnknownValue(u) => u.0.value(),
15913 }
15914 }
15915
15916 /// Gets the enum value as a string.
15917 ///
15918 /// Returns `None` if the enum contains an unknown value deserialized from
15919 /// the integer representation of enums.
15920 pub fn name(&self) -> std::option::Option<&str> {
15921 match self {
15922 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
15923 Self::NotExecuted => std::option::Option::Some("NOT_EXECUTED"),
15924 Self::Failed => std::option::Option::Some("FAILED"),
15925 Self::Passed => std::option::Option::Some("PASSED"),
15926 Self::Warning => std::option::Option::Some("WARNING"),
15927 Self::UnknownValue(u) => u.0.name(),
15928 }
15929 }
15930 }
15931
15932 impl std::default::Default for State {
15933 fn default() -> Self {
15934 use std::convert::From;
15935 Self::from(0)
15936 }
15937 }
15938
15939 impl std::fmt::Display for State {
15940 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15941 wkt::internal::display_enum(f, self.name(), self.value())
15942 }
15943 }
15944
15945 impl std::convert::From<i32> for State {
15946 fn from(value: i32) -> Self {
15947 match value {
15948 0 => Self::Unspecified,
15949 1 => Self::NotExecuted,
15950 2 => Self::Failed,
15951 3 => Self::Passed,
15952 4 => Self::Warning,
15953 _ => Self::UnknownValue(state::UnknownValue(
15954 wkt::internal::UnknownEnumValue::Integer(value),
15955 )),
15956 }
15957 }
15958 }
15959
15960 impl std::convert::From<&str> for State {
15961 fn from(value: &str) -> Self {
15962 use std::string::ToString;
15963 match value {
15964 "STATE_UNSPECIFIED" => Self::Unspecified,
15965 "NOT_EXECUTED" => Self::NotExecuted,
15966 "FAILED" => Self::Failed,
15967 "PASSED" => Self::Passed,
15968 "WARNING" => Self::Warning,
15969 _ => Self::UnknownValue(state::UnknownValue(
15970 wkt::internal::UnknownEnumValue::String(value.to_string()),
15971 )),
15972 }
15973 }
15974 }
15975
15976 impl serde::ser::Serialize for State {
15977 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15978 where
15979 S: serde::Serializer,
15980 {
15981 match self {
15982 Self::Unspecified => serializer.serialize_i32(0),
15983 Self::NotExecuted => serializer.serialize_i32(1),
15984 Self::Failed => serializer.serialize_i32(2),
15985 Self::Passed => serializer.serialize_i32(3),
15986 Self::Warning => serializer.serialize_i32(4),
15987 Self::UnknownValue(u) => u.0.serialize(serializer),
15988 }
15989 }
15990 }
15991
15992 impl<'de> serde::de::Deserialize<'de> for State {
15993 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15994 where
15995 D: serde::Deserializer<'de>,
15996 {
15997 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15998 ".google.cloud.datastream.v1.Validation.State",
15999 ))
16000 }
16001 }
16002}
16003
16004/// Represent user-facing validation result message.
16005#[derive(Clone, Default, PartialEq)]
16006#[non_exhaustive]
16007pub struct ValidationMessage {
16008 /// The result of the validation.
16009 pub message: std::string::String,
16010
16011 /// Message severity level (warning or error).
16012 pub level: crate::model::validation_message::Level,
16013
16014 /// Additional metadata related to the result.
16015 pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
16016
16017 /// A custom code identifying this specific message.
16018 pub code: std::string::String,
16019
16020 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16021}
16022
16023impl ValidationMessage {
16024 pub fn new() -> Self {
16025 std::default::Default::default()
16026 }
16027
16028 /// Sets the value of [message][crate::model::ValidationMessage::message].
16029 ///
16030 /// # Example
16031 /// ```ignore,no_run
16032 /// # use google_cloud_datastream_v1::model::ValidationMessage;
16033 /// let x = ValidationMessage::new().set_message("example");
16034 /// ```
16035 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16036 self.message = v.into();
16037 self
16038 }
16039
16040 /// Sets the value of [level][crate::model::ValidationMessage::level].
16041 ///
16042 /// # Example
16043 /// ```ignore,no_run
16044 /// # use google_cloud_datastream_v1::model::ValidationMessage;
16045 /// use google_cloud_datastream_v1::model::validation_message::Level;
16046 /// let x0 = ValidationMessage::new().set_level(Level::Warning);
16047 /// let x1 = ValidationMessage::new().set_level(Level::Error);
16048 /// ```
16049 pub fn set_level<T: std::convert::Into<crate::model::validation_message::Level>>(
16050 mut self,
16051 v: T,
16052 ) -> Self {
16053 self.level = v.into();
16054 self
16055 }
16056
16057 /// Sets the value of [metadata][crate::model::ValidationMessage::metadata].
16058 ///
16059 /// # Example
16060 /// ```ignore,no_run
16061 /// # use google_cloud_datastream_v1::model::ValidationMessage;
16062 /// let x = ValidationMessage::new().set_metadata([
16063 /// ("key0", "abc"),
16064 /// ("key1", "xyz"),
16065 /// ]);
16066 /// ```
16067 pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
16068 where
16069 T: std::iter::IntoIterator<Item = (K, V)>,
16070 K: std::convert::Into<std::string::String>,
16071 V: std::convert::Into<std::string::String>,
16072 {
16073 use std::iter::Iterator;
16074 self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16075 self
16076 }
16077
16078 /// Sets the value of [code][crate::model::ValidationMessage::code].
16079 ///
16080 /// # Example
16081 /// ```ignore,no_run
16082 /// # use google_cloud_datastream_v1::model::ValidationMessage;
16083 /// let x = ValidationMessage::new().set_code("example");
16084 /// ```
16085 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16086 self.code = v.into();
16087 self
16088 }
16089}
16090
16091impl wkt::message::Message for ValidationMessage {
16092 fn typename() -> &'static str {
16093 "type.googleapis.com/google.cloud.datastream.v1.ValidationMessage"
16094 }
16095}
16096
16097/// Defines additional types related to [ValidationMessage].
16098pub mod validation_message {
16099 #[allow(unused_imports)]
16100 use super::*;
16101
16102 /// Validation message level.
16103 ///
16104 /// # Working with unknown values
16105 ///
16106 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16107 /// additional enum variants at any time. Adding new variants is not considered
16108 /// a breaking change. Applications should write their code in anticipation of:
16109 ///
16110 /// - New values appearing in future releases of the client library, **and**
16111 /// - New values received dynamically, without application changes.
16112 ///
16113 /// Please consult the [Working with enums] section in the user guide for some
16114 /// guidelines.
16115 ///
16116 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16117 #[derive(Clone, Debug, PartialEq)]
16118 #[non_exhaustive]
16119 pub enum Level {
16120 /// Unspecified level.
16121 Unspecified,
16122 /// Potentially cause issues with the Stream.
16123 Warning,
16124 /// Definitely cause issues with the Stream.
16125 Error,
16126 /// If set, the enum was initialized with an unknown value.
16127 ///
16128 /// Applications can examine the value using [Level::value] or
16129 /// [Level::name].
16130 UnknownValue(level::UnknownValue),
16131 }
16132
16133 #[doc(hidden)]
16134 pub mod level {
16135 #[allow(unused_imports)]
16136 use super::*;
16137 #[derive(Clone, Debug, PartialEq)]
16138 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16139 }
16140
16141 impl Level {
16142 /// Gets the enum value.
16143 ///
16144 /// Returns `None` if the enum contains an unknown value deserialized from
16145 /// the string representation of enums.
16146 pub fn value(&self) -> std::option::Option<i32> {
16147 match self {
16148 Self::Unspecified => std::option::Option::Some(0),
16149 Self::Warning => std::option::Option::Some(1),
16150 Self::Error => std::option::Option::Some(2),
16151 Self::UnknownValue(u) => u.0.value(),
16152 }
16153 }
16154
16155 /// Gets the enum value as a string.
16156 ///
16157 /// Returns `None` if the enum contains an unknown value deserialized from
16158 /// the integer representation of enums.
16159 pub fn name(&self) -> std::option::Option<&str> {
16160 match self {
16161 Self::Unspecified => std::option::Option::Some("LEVEL_UNSPECIFIED"),
16162 Self::Warning => std::option::Option::Some("WARNING"),
16163 Self::Error => std::option::Option::Some("ERROR"),
16164 Self::UnknownValue(u) => u.0.name(),
16165 }
16166 }
16167 }
16168
16169 impl std::default::Default for Level {
16170 fn default() -> Self {
16171 use std::convert::From;
16172 Self::from(0)
16173 }
16174 }
16175
16176 impl std::fmt::Display for Level {
16177 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16178 wkt::internal::display_enum(f, self.name(), self.value())
16179 }
16180 }
16181
16182 impl std::convert::From<i32> for Level {
16183 fn from(value: i32) -> Self {
16184 match value {
16185 0 => Self::Unspecified,
16186 1 => Self::Warning,
16187 2 => Self::Error,
16188 _ => Self::UnknownValue(level::UnknownValue(
16189 wkt::internal::UnknownEnumValue::Integer(value),
16190 )),
16191 }
16192 }
16193 }
16194
16195 impl std::convert::From<&str> for Level {
16196 fn from(value: &str) -> Self {
16197 use std::string::ToString;
16198 match value {
16199 "LEVEL_UNSPECIFIED" => Self::Unspecified,
16200 "WARNING" => Self::Warning,
16201 "ERROR" => Self::Error,
16202 _ => Self::UnknownValue(level::UnknownValue(
16203 wkt::internal::UnknownEnumValue::String(value.to_string()),
16204 )),
16205 }
16206 }
16207 }
16208
16209 impl serde::ser::Serialize for Level {
16210 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16211 where
16212 S: serde::Serializer,
16213 {
16214 match self {
16215 Self::Unspecified => serializer.serialize_i32(0),
16216 Self::Warning => serializer.serialize_i32(1),
16217 Self::Error => serializer.serialize_i32(2),
16218 Self::UnknownValue(u) => u.0.serialize(serializer),
16219 }
16220 }
16221 }
16222
16223 impl<'de> serde::de::Deserialize<'de> for Level {
16224 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16225 where
16226 D: serde::Deserializer<'de>,
16227 {
16228 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Level>::new(
16229 ".google.cloud.datastream.v1.ValidationMessage.Level",
16230 ))
16231 }
16232 }
16233}
16234
16235/// The strategy that the stream uses for CDC replication.
16236#[derive(Clone, Default, PartialEq)]
16237#[non_exhaustive]
16238pub struct CdcStrategy {
16239 /// The position to start reading from when starting, resuming, or recovering
16240 /// the stream.
16241 /// If not set, the system's default value will be used.
16242 pub start_position: std::option::Option<crate::model::cdc_strategy::StartPosition>,
16243
16244 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16245}
16246
16247impl CdcStrategy {
16248 pub fn new() -> Self {
16249 std::default::Default::default()
16250 }
16251
16252 /// Sets the value of [start_position][crate::model::CdcStrategy::start_position].
16253 ///
16254 /// Note that all the setters affecting `start_position` are mutually
16255 /// exclusive.
16256 ///
16257 /// # Example
16258 /// ```ignore,no_run
16259 /// # use google_cloud_datastream_v1::model::CdcStrategy;
16260 /// use google_cloud_datastream_v1::model::cdc_strategy::MostRecentStartPosition;
16261 /// let x = CdcStrategy::new().set_start_position(Some(
16262 /// google_cloud_datastream_v1::model::cdc_strategy::StartPosition::MostRecentStartPosition(MostRecentStartPosition::default().into())));
16263 /// ```
16264 pub fn set_start_position<
16265 T: std::convert::Into<std::option::Option<crate::model::cdc_strategy::StartPosition>>,
16266 >(
16267 mut self,
16268 v: T,
16269 ) -> Self {
16270 self.start_position = v.into();
16271 self
16272 }
16273
16274 /// The value of [start_position][crate::model::CdcStrategy::start_position]
16275 /// if it holds a `MostRecentStartPosition`, `None` if the field is not set or
16276 /// holds a different branch.
16277 pub fn most_recent_start_position(
16278 &self,
16279 ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>>
16280 {
16281 #[allow(unreachable_patterns)]
16282 self.start_position.as_ref().and_then(|v| match v {
16283 crate::model::cdc_strategy::StartPosition::MostRecentStartPosition(v) => {
16284 std::option::Option::Some(v)
16285 }
16286 _ => std::option::Option::None,
16287 })
16288 }
16289
16290 /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
16291 /// to hold a `MostRecentStartPosition`.
16292 ///
16293 /// Note that all the setters affecting `start_position` are
16294 /// mutually exclusive.
16295 ///
16296 /// # Example
16297 /// ```ignore,no_run
16298 /// # use google_cloud_datastream_v1::model::CdcStrategy;
16299 /// use google_cloud_datastream_v1::model::cdc_strategy::MostRecentStartPosition;
16300 /// let x = CdcStrategy::new().set_most_recent_start_position(MostRecentStartPosition::default()/* use setters */);
16301 /// assert!(x.most_recent_start_position().is_some());
16302 /// assert!(x.next_available_start_position().is_none());
16303 /// assert!(x.specific_start_position().is_none());
16304 /// ```
16305 pub fn set_most_recent_start_position<
16306 T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>>,
16307 >(
16308 mut self,
16309 v: T,
16310 ) -> Self {
16311 self.start_position = std::option::Option::Some(
16312 crate::model::cdc_strategy::StartPosition::MostRecentStartPosition(v.into()),
16313 );
16314 self
16315 }
16316
16317 /// The value of [start_position][crate::model::CdcStrategy::start_position]
16318 /// if it holds a `NextAvailableStartPosition`, `None` if the field is not set or
16319 /// holds a different branch.
16320 pub fn next_available_start_position(
16321 &self,
16322 ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>>
16323 {
16324 #[allow(unreachable_patterns)]
16325 self.start_position.as_ref().and_then(|v| match v {
16326 crate::model::cdc_strategy::StartPosition::NextAvailableStartPosition(v) => {
16327 std::option::Option::Some(v)
16328 }
16329 _ => std::option::Option::None,
16330 })
16331 }
16332
16333 /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
16334 /// to hold a `NextAvailableStartPosition`.
16335 ///
16336 /// Note that all the setters affecting `start_position` are
16337 /// mutually exclusive.
16338 ///
16339 /// # Example
16340 /// ```ignore,no_run
16341 /// # use google_cloud_datastream_v1::model::CdcStrategy;
16342 /// use google_cloud_datastream_v1::model::cdc_strategy::NextAvailableStartPosition;
16343 /// let x = CdcStrategy::new().set_next_available_start_position(NextAvailableStartPosition::default()/* use setters */);
16344 /// assert!(x.next_available_start_position().is_some());
16345 /// assert!(x.most_recent_start_position().is_none());
16346 /// assert!(x.specific_start_position().is_none());
16347 /// ```
16348 pub fn set_next_available_start_position<
16349 T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>>,
16350 >(
16351 mut self,
16352 v: T,
16353 ) -> Self {
16354 self.start_position = std::option::Option::Some(
16355 crate::model::cdc_strategy::StartPosition::NextAvailableStartPosition(v.into()),
16356 );
16357 self
16358 }
16359
16360 /// The value of [start_position][crate::model::CdcStrategy::start_position]
16361 /// if it holds a `SpecificStartPosition`, `None` if the field is not set or
16362 /// holds a different branch.
16363 pub fn specific_start_position(
16364 &self,
16365 ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>>
16366 {
16367 #[allow(unreachable_patterns)]
16368 self.start_position.as_ref().and_then(|v| match v {
16369 crate::model::cdc_strategy::StartPosition::SpecificStartPosition(v) => {
16370 std::option::Option::Some(v)
16371 }
16372 _ => std::option::Option::None,
16373 })
16374 }
16375
16376 /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
16377 /// to hold a `SpecificStartPosition`.
16378 ///
16379 /// Note that all the setters affecting `start_position` are
16380 /// mutually exclusive.
16381 ///
16382 /// # Example
16383 /// ```ignore,no_run
16384 /// # use google_cloud_datastream_v1::model::CdcStrategy;
16385 /// use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16386 /// let x = CdcStrategy::new().set_specific_start_position(SpecificStartPosition::default()/* use setters */);
16387 /// assert!(x.specific_start_position().is_some());
16388 /// assert!(x.most_recent_start_position().is_none());
16389 /// assert!(x.next_available_start_position().is_none());
16390 /// ```
16391 pub fn set_specific_start_position<
16392 T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>>,
16393 >(
16394 mut self,
16395 v: T,
16396 ) -> Self {
16397 self.start_position = std::option::Option::Some(
16398 crate::model::cdc_strategy::StartPosition::SpecificStartPosition(v.into()),
16399 );
16400 self
16401 }
16402}
16403
16404impl wkt::message::Message for CdcStrategy {
16405 fn typename() -> &'static str {
16406 "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy"
16407 }
16408}
16409
16410/// Defines additional types related to [CdcStrategy].
16411pub mod cdc_strategy {
16412 #[allow(unused_imports)]
16413 use super::*;
16414
16415 /// CDC strategy to start replicating from the most recent position in the
16416 /// source.
16417 #[derive(Clone, Default, PartialEq)]
16418 #[non_exhaustive]
16419 pub struct MostRecentStartPosition {
16420 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16421 }
16422
16423 impl MostRecentStartPosition {
16424 pub fn new() -> Self {
16425 std::default::Default::default()
16426 }
16427 }
16428
16429 impl wkt::message::Message for MostRecentStartPosition {
16430 fn typename() -> &'static str {
16431 "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.MostRecentStartPosition"
16432 }
16433 }
16434
16435 /// CDC strategy to resume replication from the next available position in the
16436 /// source.
16437 #[derive(Clone, Default, PartialEq)]
16438 #[non_exhaustive]
16439 pub struct NextAvailableStartPosition {
16440 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16441 }
16442
16443 impl NextAvailableStartPosition {
16444 pub fn new() -> Self {
16445 std::default::Default::default()
16446 }
16447 }
16448
16449 impl wkt::message::Message for NextAvailableStartPosition {
16450 fn typename() -> &'static str {
16451 "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.NextAvailableStartPosition"
16452 }
16453 }
16454
16455 /// CDC strategy to start replicating from a specific position in the source.
16456 #[derive(Clone, Default, PartialEq)]
16457 #[non_exhaustive]
16458 pub struct SpecificStartPosition {
16459 pub position:
16460 std::option::Option<crate::model::cdc_strategy::specific_start_position::Position>,
16461
16462 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16463 }
16464
16465 impl SpecificStartPosition {
16466 pub fn new() -> Self {
16467 std::default::Default::default()
16468 }
16469
16470 /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position].
16471 ///
16472 /// Note that all the setters affecting `position` are mutually
16473 /// exclusive.
16474 ///
16475 /// # Example
16476 /// ```ignore,no_run
16477 /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16478 /// use google_cloud_datastream_v1::model::MysqlLogPosition;
16479 /// let x = SpecificStartPosition::new().set_position(Some(
16480 /// google_cloud_datastream_v1::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(MysqlLogPosition::default().into())));
16481 /// ```
16482 pub fn set_position<
16483 T: std::convert::Into<
16484 std::option::Option<
16485 crate::model::cdc_strategy::specific_start_position::Position,
16486 >,
16487 >,
16488 >(
16489 mut self,
16490 v: T,
16491 ) -> Self {
16492 self.position = v.into();
16493 self
16494 }
16495
16496 /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16497 /// if it holds a `MysqlLogPosition`, `None` if the field is not set or
16498 /// holds a different branch.
16499 pub fn mysql_log_position(
16500 &self,
16501 ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlLogPosition>> {
16502 #[allow(unreachable_patterns)]
16503 self.position.as_ref().and_then(|v| match v {
16504 crate::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(
16505 v,
16506 ) => std::option::Option::Some(v),
16507 _ => std::option::Option::None,
16508 })
16509 }
16510
16511 /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16512 /// to hold a `MysqlLogPosition`.
16513 ///
16514 /// Note that all the setters affecting `position` are
16515 /// mutually exclusive.
16516 ///
16517 /// # Example
16518 /// ```ignore,no_run
16519 /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16520 /// use google_cloud_datastream_v1::model::MysqlLogPosition;
16521 /// let x = SpecificStartPosition::new().set_mysql_log_position(MysqlLogPosition::default()/* use setters */);
16522 /// assert!(x.mysql_log_position().is_some());
16523 /// assert!(x.oracle_scn_position().is_none());
16524 /// assert!(x.sql_server_lsn_position().is_none());
16525 /// assert!(x.mysql_gtid_position().is_none());
16526 /// ```
16527 pub fn set_mysql_log_position<
16528 T: std::convert::Into<std::boxed::Box<crate::model::MysqlLogPosition>>,
16529 >(
16530 mut self,
16531 v: T,
16532 ) -> Self {
16533 self.position = std::option::Option::Some(
16534 crate::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(
16535 v.into(),
16536 ),
16537 );
16538 self
16539 }
16540
16541 /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16542 /// if it holds a `OracleScnPosition`, `None` if the field is not set or
16543 /// holds a different branch.
16544 pub fn oracle_scn_position(
16545 &self,
16546 ) -> std::option::Option<&std::boxed::Box<crate::model::OracleScnPosition>> {
16547 #[allow(unreachable_patterns)]
16548 self.position.as_ref().and_then(|v| match v {
16549 crate::model::cdc_strategy::specific_start_position::Position::OracleScnPosition(v) => std::option::Option::Some(v),
16550 _ => std::option::Option::None,
16551 })
16552 }
16553
16554 /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16555 /// to hold a `OracleScnPosition`.
16556 ///
16557 /// Note that all the setters affecting `position` are
16558 /// mutually exclusive.
16559 ///
16560 /// # Example
16561 /// ```ignore,no_run
16562 /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16563 /// use google_cloud_datastream_v1::model::OracleScnPosition;
16564 /// let x = SpecificStartPosition::new().set_oracle_scn_position(OracleScnPosition::default()/* use setters */);
16565 /// assert!(x.oracle_scn_position().is_some());
16566 /// assert!(x.mysql_log_position().is_none());
16567 /// assert!(x.sql_server_lsn_position().is_none());
16568 /// assert!(x.mysql_gtid_position().is_none());
16569 /// ```
16570 pub fn set_oracle_scn_position<
16571 T: std::convert::Into<std::boxed::Box<crate::model::OracleScnPosition>>,
16572 >(
16573 mut self,
16574 v: T,
16575 ) -> Self {
16576 self.position = std::option::Option::Some(
16577 crate::model::cdc_strategy::specific_start_position::Position::OracleScnPosition(
16578 v.into(),
16579 ),
16580 );
16581 self
16582 }
16583
16584 /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16585 /// if it holds a `SqlServerLsnPosition`, `None` if the field is not set or
16586 /// holds a different branch.
16587 pub fn sql_server_lsn_position(
16588 &self,
16589 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerLsnPosition>> {
16590 #[allow(unreachable_patterns)]
16591 self.position.as_ref().and_then(|v| match v {
16592 crate::model::cdc_strategy::specific_start_position::Position::SqlServerLsnPosition(v) => std::option::Option::Some(v),
16593 _ => std::option::Option::None,
16594 })
16595 }
16596
16597 /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16598 /// to hold a `SqlServerLsnPosition`.
16599 ///
16600 /// Note that all the setters affecting `position` are
16601 /// mutually exclusive.
16602 ///
16603 /// # Example
16604 /// ```ignore,no_run
16605 /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16606 /// use google_cloud_datastream_v1::model::SqlServerLsnPosition;
16607 /// let x = SpecificStartPosition::new().set_sql_server_lsn_position(SqlServerLsnPosition::default()/* use setters */);
16608 /// assert!(x.sql_server_lsn_position().is_some());
16609 /// assert!(x.mysql_log_position().is_none());
16610 /// assert!(x.oracle_scn_position().is_none());
16611 /// assert!(x.mysql_gtid_position().is_none());
16612 /// ```
16613 pub fn set_sql_server_lsn_position<
16614 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerLsnPosition>>,
16615 >(
16616 mut self,
16617 v: T,
16618 ) -> Self {
16619 self.position = std::option::Option::Some(
16620 crate::model::cdc_strategy::specific_start_position::Position::SqlServerLsnPosition(
16621 v.into(),
16622 ),
16623 );
16624 self
16625 }
16626
16627 /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16628 /// if it holds a `MysqlGtidPosition`, `None` if the field is not set or
16629 /// holds a different branch.
16630 pub fn mysql_gtid_position(
16631 &self,
16632 ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlGtidPosition>> {
16633 #[allow(unreachable_patterns)]
16634 self.position.as_ref().and_then(|v| match v {
16635 crate::model::cdc_strategy::specific_start_position::Position::MysqlGtidPosition(v) => std::option::Option::Some(v),
16636 _ => std::option::Option::None,
16637 })
16638 }
16639
16640 /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16641 /// to hold a `MysqlGtidPosition`.
16642 ///
16643 /// Note that all the setters affecting `position` are
16644 /// mutually exclusive.
16645 ///
16646 /// # Example
16647 /// ```ignore,no_run
16648 /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16649 /// use google_cloud_datastream_v1::model::MysqlGtidPosition;
16650 /// let x = SpecificStartPosition::new().set_mysql_gtid_position(MysqlGtidPosition::default()/* use setters */);
16651 /// assert!(x.mysql_gtid_position().is_some());
16652 /// assert!(x.mysql_log_position().is_none());
16653 /// assert!(x.oracle_scn_position().is_none());
16654 /// assert!(x.sql_server_lsn_position().is_none());
16655 /// ```
16656 pub fn set_mysql_gtid_position<
16657 T: std::convert::Into<std::boxed::Box<crate::model::MysqlGtidPosition>>,
16658 >(
16659 mut self,
16660 v: T,
16661 ) -> Self {
16662 self.position = std::option::Option::Some(
16663 crate::model::cdc_strategy::specific_start_position::Position::MysqlGtidPosition(
16664 v.into(),
16665 ),
16666 );
16667 self
16668 }
16669 }
16670
16671 impl wkt::message::Message for SpecificStartPosition {
16672 fn typename() -> &'static str {
16673 "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.SpecificStartPosition"
16674 }
16675 }
16676
16677 /// Defines additional types related to [SpecificStartPosition].
16678 pub mod specific_start_position {
16679 #[allow(unused_imports)]
16680 use super::*;
16681
16682 #[derive(Clone, Debug, PartialEq)]
16683 #[non_exhaustive]
16684 pub enum Position {
16685 /// MySQL specific log position to start replicating from.
16686 MysqlLogPosition(std::boxed::Box<crate::model::MysqlLogPosition>),
16687 /// Oracle SCN to start replicating from.
16688 OracleScnPosition(std::boxed::Box<crate::model::OracleScnPosition>),
16689 /// SqlServer LSN to start replicating from.
16690 SqlServerLsnPosition(std::boxed::Box<crate::model::SqlServerLsnPosition>),
16691 /// MySQL GTID set to start replicating from.
16692 MysqlGtidPosition(std::boxed::Box<crate::model::MysqlGtidPosition>),
16693 }
16694 }
16695
16696 /// The position to start reading from when starting, resuming, or recovering
16697 /// the stream.
16698 /// If not set, the system's default value will be used.
16699 #[derive(Clone, Debug, PartialEq)]
16700 #[non_exhaustive]
16701 pub enum StartPosition {
16702 /// Optional. Start replicating from the most recent position in the source.
16703 MostRecentStartPosition(
16704 std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>,
16705 ),
16706 /// Optional. Resume replication from the next available position in the
16707 /// source.
16708 NextAvailableStartPosition(
16709 std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>,
16710 ),
16711 /// Optional. Start replicating from a specific position in the source.
16712 SpecificStartPosition(std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>),
16713 }
16714}
16715
16716/// SQL Server LSN position
16717#[derive(Clone, Default, PartialEq)]
16718#[non_exhaustive]
16719pub struct SqlServerLsnPosition {
16720 /// Required. Log sequence number (LSN) from where Logs will be read
16721 pub lsn: std::string::String,
16722
16723 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16724}
16725
16726impl SqlServerLsnPosition {
16727 pub fn new() -> Self {
16728 std::default::Default::default()
16729 }
16730
16731 /// Sets the value of [lsn][crate::model::SqlServerLsnPosition::lsn].
16732 ///
16733 /// # Example
16734 /// ```ignore,no_run
16735 /// # use google_cloud_datastream_v1::model::SqlServerLsnPosition;
16736 /// let x = SqlServerLsnPosition::new().set_lsn("example");
16737 /// ```
16738 pub fn set_lsn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16739 self.lsn = v.into();
16740 self
16741 }
16742}
16743
16744impl wkt::message::Message for SqlServerLsnPosition {
16745 fn typename() -> &'static str {
16746 "type.googleapis.com/google.cloud.datastream.v1.SqlServerLsnPosition"
16747 }
16748}
16749
16750/// Oracle SCN position
16751#[derive(Clone, Default, PartialEq)]
16752#[non_exhaustive]
16753pub struct OracleScnPosition {
16754 /// Required. SCN number from where Logs will be read
16755 pub scn: i64,
16756
16757 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16758}
16759
16760impl OracleScnPosition {
16761 pub fn new() -> Self {
16762 std::default::Default::default()
16763 }
16764
16765 /// Sets the value of [scn][crate::model::OracleScnPosition::scn].
16766 ///
16767 /// # Example
16768 /// ```ignore,no_run
16769 /// # use google_cloud_datastream_v1::model::OracleScnPosition;
16770 /// let x = OracleScnPosition::new().set_scn(42);
16771 /// ```
16772 pub fn set_scn<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
16773 self.scn = v.into();
16774 self
16775 }
16776}
16777
16778impl wkt::message::Message for OracleScnPosition {
16779 fn typename() -> &'static str {
16780 "type.googleapis.com/google.cloud.datastream.v1.OracleScnPosition"
16781 }
16782}
16783
16784/// MySQL log position
16785#[derive(Clone, Default, PartialEq)]
16786#[non_exhaustive]
16787pub struct MysqlLogPosition {
16788 /// Required. The binary log file name.
16789 pub log_file: std::string::String,
16790
16791 /// Optional. The position within the binary log file. Default is head of file.
16792 pub log_position: std::option::Option<i32>,
16793
16794 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16795}
16796
16797impl MysqlLogPosition {
16798 pub fn new() -> Self {
16799 std::default::Default::default()
16800 }
16801
16802 /// Sets the value of [log_file][crate::model::MysqlLogPosition::log_file].
16803 ///
16804 /// # Example
16805 /// ```ignore,no_run
16806 /// # use google_cloud_datastream_v1::model::MysqlLogPosition;
16807 /// let x = MysqlLogPosition::new().set_log_file("example");
16808 /// ```
16809 pub fn set_log_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16810 self.log_file = v.into();
16811 self
16812 }
16813
16814 /// Sets the value of [log_position][crate::model::MysqlLogPosition::log_position].
16815 ///
16816 /// # Example
16817 /// ```ignore,no_run
16818 /// # use google_cloud_datastream_v1::model::MysqlLogPosition;
16819 /// let x = MysqlLogPosition::new().set_log_position(42);
16820 /// ```
16821 pub fn set_log_position<T>(mut self, v: T) -> Self
16822 where
16823 T: std::convert::Into<i32>,
16824 {
16825 self.log_position = std::option::Option::Some(v.into());
16826 self
16827 }
16828
16829 /// Sets or clears the value of [log_position][crate::model::MysqlLogPosition::log_position].
16830 ///
16831 /// # Example
16832 /// ```ignore,no_run
16833 /// # use google_cloud_datastream_v1::model::MysqlLogPosition;
16834 /// let x = MysqlLogPosition::new().set_or_clear_log_position(Some(42));
16835 /// let x = MysqlLogPosition::new().set_or_clear_log_position(None::<i32>);
16836 /// ```
16837 pub fn set_or_clear_log_position<T>(mut self, v: std::option::Option<T>) -> Self
16838 where
16839 T: std::convert::Into<i32>,
16840 {
16841 self.log_position = v.map(|x| x.into());
16842 self
16843 }
16844}
16845
16846impl wkt::message::Message for MysqlLogPosition {
16847 fn typename() -> &'static str {
16848 "type.googleapis.com/google.cloud.datastream.v1.MysqlLogPosition"
16849 }
16850}
16851
16852/// MySQL GTID position
16853#[derive(Clone, Default, PartialEq)]
16854#[non_exhaustive]
16855pub struct MysqlGtidPosition {
16856 /// Required. The gtid set to start replication from.
16857 pub gtid_set: std::string::String,
16858
16859 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16860}
16861
16862impl MysqlGtidPosition {
16863 pub fn new() -> Self {
16864 std::default::Default::default()
16865 }
16866
16867 /// Sets the value of [gtid_set][crate::model::MysqlGtidPosition::gtid_set].
16868 ///
16869 /// # Example
16870 /// ```ignore,no_run
16871 /// # use google_cloud_datastream_v1::model::MysqlGtidPosition;
16872 /// let x = MysqlGtidPosition::new().set_gtid_set("example");
16873 /// ```
16874 pub fn set_gtid_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16875 self.gtid_set = v.into();
16876 self
16877 }
16878}
16879
16880impl wkt::message::Message for MysqlGtidPosition {
16881 fn typename() -> &'static str {
16882 "type.googleapis.com/google.cloud.datastream.v1.MysqlGtidPosition"
16883 }
16884}