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::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_location;
27extern crate google_cloud_longrunning;
28extern crate google_cloud_lro;
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 /// Creates a new default instance.
64 pub fn new() -> Self {
65 std::default::Default::default()
66 }
67
68 /// Sets the value of [parent][crate::model::DiscoverConnectionProfileRequest::parent].
69 ///
70 /// # Example
71 /// ```ignore,no_run
72 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
73 /// # let project_id = "project_id";
74 /// # let location_id = "location_id";
75 /// let x = DiscoverConnectionProfileRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
76 /// ```
77 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
78 self.parent = v.into();
79 self
80 }
81
82 /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target].
83 ///
84 /// Note that all the setters affecting `target` are mutually
85 /// exclusive.
86 ///
87 /// # Example
88 /// ```ignore,no_run
89 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
90 /// use google_cloud_datastream_v1::model::discover_connection_profile_request::Target;
91 /// let x = DiscoverConnectionProfileRequest::new().set_target(Some(Target::ConnectionProfileName("example".to_string())));
92 /// ```
93 pub fn set_target<
94 T: std::convert::Into<
95 std::option::Option<crate::model::discover_connection_profile_request::Target>,
96 >,
97 >(
98 mut self,
99 v: T,
100 ) -> Self {
101 self.target = v.into();
102 self
103 }
104
105 /// The value of [target][crate::model::DiscoverConnectionProfileRequest::target]
106 /// if it holds a `ConnectionProfile`, `None` if the field is not set or
107 /// holds a different branch.
108 pub fn connection_profile(
109 &self,
110 ) -> std::option::Option<&std::boxed::Box<crate::model::ConnectionProfile>> {
111 #[allow(unreachable_patterns)]
112 self.target.as_ref().and_then(|v| match v {
113 crate::model::discover_connection_profile_request::Target::ConnectionProfile(v) => {
114 std::option::Option::Some(v)
115 }
116 _ => std::option::Option::None,
117 })
118 }
119
120 /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
121 /// to hold a `ConnectionProfile`.
122 ///
123 /// Note that all the setters affecting `target` are
124 /// mutually exclusive.
125 ///
126 /// # Example
127 /// ```ignore,no_run
128 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
129 /// use google_cloud_datastream_v1::model::ConnectionProfile;
130 /// let x = DiscoverConnectionProfileRequest::new().set_connection_profile(ConnectionProfile::default()/* use setters */);
131 /// assert!(x.connection_profile().is_some());
132 /// assert!(x.connection_profile_name().is_none());
133 /// ```
134 pub fn set_connection_profile<
135 T: std::convert::Into<std::boxed::Box<crate::model::ConnectionProfile>>,
136 >(
137 mut self,
138 v: T,
139 ) -> Self {
140 self.target = std::option::Option::Some(
141 crate::model::discover_connection_profile_request::Target::ConnectionProfile(v.into()),
142 );
143 self
144 }
145
146 /// The value of [target][crate::model::DiscoverConnectionProfileRequest::target]
147 /// if it holds a `ConnectionProfileName`, `None` if the field is not set or
148 /// holds a different branch.
149 pub fn connection_profile_name(&self) -> std::option::Option<&std::string::String> {
150 #[allow(unreachable_patterns)]
151 self.target.as_ref().and_then(|v| match v {
152 crate::model::discover_connection_profile_request::Target::ConnectionProfileName(v) => {
153 std::option::Option::Some(v)
154 }
155 _ => std::option::Option::None,
156 })
157 }
158
159 /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
160 /// to hold a `ConnectionProfileName`.
161 ///
162 /// Note that all the setters affecting `target` are
163 /// mutually exclusive.
164 ///
165 /// # Example
166 /// ```ignore,no_run
167 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
168 /// let x = DiscoverConnectionProfileRequest::new().set_connection_profile_name("example");
169 /// assert!(x.connection_profile_name().is_some());
170 /// assert!(x.connection_profile().is_none());
171 /// ```
172 pub fn set_connection_profile_name<T: std::convert::Into<std::string::String>>(
173 mut self,
174 v: T,
175 ) -> Self {
176 self.target = std::option::Option::Some(
177 crate::model::discover_connection_profile_request::Target::ConnectionProfileName(
178 v.into(),
179 ),
180 );
181 self
182 }
183
184 /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy].
185 ///
186 /// Note that all the setters affecting `hierarchy` are mutually
187 /// exclusive.
188 ///
189 /// # Example
190 /// ```ignore,no_run
191 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
192 /// use google_cloud_datastream_v1::model::discover_connection_profile_request::Hierarchy;
193 /// let x = DiscoverConnectionProfileRequest::new().set_hierarchy(Some(Hierarchy::FullHierarchy(true)));
194 /// ```
195 pub fn set_hierarchy<
196 T: std::convert::Into<
197 std::option::Option<crate::model::discover_connection_profile_request::Hierarchy>,
198 >,
199 >(
200 mut self,
201 v: T,
202 ) -> Self {
203 self.hierarchy = v.into();
204 self
205 }
206
207 /// The value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
208 /// if it holds a `FullHierarchy`, `None` if the field is not set or
209 /// holds a different branch.
210 pub fn full_hierarchy(&self) -> std::option::Option<&bool> {
211 #[allow(unreachable_patterns)]
212 self.hierarchy.as_ref().and_then(|v| match v {
213 crate::model::discover_connection_profile_request::Hierarchy::FullHierarchy(v) => {
214 std::option::Option::Some(v)
215 }
216 _ => std::option::Option::None,
217 })
218 }
219
220 /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
221 /// to hold a `FullHierarchy`.
222 ///
223 /// Note that all the setters affecting `hierarchy` are
224 /// mutually exclusive.
225 ///
226 /// # Example
227 /// ```ignore,no_run
228 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
229 /// let x = DiscoverConnectionProfileRequest::new().set_full_hierarchy(true);
230 /// assert!(x.full_hierarchy().is_some());
231 /// assert!(x.hierarchy_depth().is_none());
232 /// ```
233 pub fn set_full_hierarchy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
234 self.hierarchy = std::option::Option::Some(
235 crate::model::discover_connection_profile_request::Hierarchy::FullHierarchy(v.into()),
236 );
237 self
238 }
239
240 /// The value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
241 /// if it holds a `HierarchyDepth`, `None` if the field is not set or
242 /// holds a different branch.
243 pub fn hierarchy_depth(&self) -> std::option::Option<&i32> {
244 #[allow(unreachable_patterns)]
245 self.hierarchy.as_ref().and_then(|v| match v {
246 crate::model::discover_connection_profile_request::Hierarchy::HierarchyDepth(v) => {
247 std::option::Option::Some(v)
248 }
249 _ => std::option::Option::None,
250 })
251 }
252
253 /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
254 /// to hold a `HierarchyDepth`.
255 ///
256 /// Note that all the setters affecting `hierarchy` are
257 /// mutually exclusive.
258 ///
259 /// # Example
260 /// ```ignore,no_run
261 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
262 /// let x = DiscoverConnectionProfileRequest::new().set_hierarchy_depth(42);
263 /// assert!(x.hierarchy_depth().is_some());
264 /// assert!(x.full_hierarchy().is_none());
265 /// ```
266 pub fn set_hierarchy_depth<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
267 self.hierarchy = std::option::Option::Some(
268 crate::model::discover_connection_profile_request::Hierarchy::HierarchyDepth(v.into()),
269 );
270 self
271 }
272
273 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object].
274 ///
275 /// Note that all the setters affecting `data_object` are mutually
276 /// exclusive.
277 ///
278 /// # Example
279 /// ```ignore,no_run
280 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
281 /// use google_cloud_datastream_v1::model::OracleRdbms;
282 /// let x = DiscoverConnectionProfileRequest::new().set_data_object(Some(
283 /// google_cloud_datastream_v1::model::discover_connection_profile_request::DataObject::OracleRdbms(OracleRdbms::default().into())));
284 /// ```
285 pub fn set_data_object<
286 T: std::convert::Into<
287 std::option::Option<crate::model::discover_connection_profile_request::DataObject>,
288 >,
289 >(
290 mut self,
291 v: T,
292 ) -> Self {
293 self.data_object = v.into();
294 self
295 }
296
297 /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
298 /// if it holds a `OracleRdbms`, `None` if the field is not set or
299 /// holds a different branch.
300 pub fn oracle_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
301 #[allow(unreachable_patterns)]
302 self.data_object.as_ref().and_then(|v| match v {
303 crate::model::discover_connection_profile_request::DataObject::OracleRdbms(v) => {
304 std::option::Option::Some(v)
305 }
306 _ => std::option::Option::None,
307 })
308 }
309
310 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
311 /// to hold a `OracleRdbms`.
312 ///
313 /// Note that all the setters affecting `data_object` are
314 /// mutually exclusive.
315 ///
316 /// # Example
317 /// ```ignore,no_run
318 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
319 /// use google_cloud_datastream_v1::model::OracleRdbms;
320 /// let x = DiscoverConnectionProfileRequest::new().set_oracle_rdbms(OracleRdbms::default()/* use setters */);
321 /// assert!(x.oracle_rdbms().is_some());
322 /// assert!(x.mysql_rdbms().is_none());
323 /// assert!(x.postgresql_rdbms().is_none());
324 /// assert!(x.sql_server_rdbms().is_none());
325 /// assert!(x.salesforce_org().is_none());
326 /// assert!(x.mongodb_cluster().is_none());
327 /// ```
328 pub fn set_oracle_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>>(
329 mut self,
330 v: T,
331 ) -> Self {
332 self.data_object = std::option::Option::Some(
333 crate::model::discover_connection_profile_request::DataObject::OracleRdbms(v.into()),
334 );
335 self
336 }
337
338 /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
339 /// if it holds a `MysqlRdbms`, `None` if the field is not set or
340 /// holds a different branch.
341 pub fn mysql_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
342 #[allow(unreachable_patterns)]
343 self.data_object.as_ref().and_then(|v| match v {
344 crate::model::discover_connection_profile_request::DataObject::MysqlRdbms(v) => {
345 std::option::Option::Some(v)
346 }
347 _ => std::option::Option::None,
348 })
349 }
350
351 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
352 /// to hold a `MysqlRdbms`.
353 ///
354 /// Note that all the setters affecting `data_object` are
355 /// mutually exclusive.
356 ///
357 /// # Example
358 /// ```ignore,no_run
359 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
360 /// use google_cloud_datastream_v1::model::MysqlRdbms;
361 /// let x = DiscoverConnectionProfileRequest::new().set_mysql_rdbms(MysqlRdbms::default()/* use setters */);
362 /// assert!(x.mysql_rdbms().is_some());
363 /// assert!(x.oracle_rdbms().is_none());
364 /// assert!(x.postgresql_rdbms().is_none());
365 /// assert!(x.sql_server_rdbms().is_none());
366 /// assert!(x.salesforce_org().is_none());
367 /// assert!(x.mongodb_cluster().is_none());
368 /// ```
369 pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
370 mut self,
371 v: T,
372 ) -> Self {
373 self.data_object = std::option::Option::Some(
374 crate::model::discover_connection_profile_request::DataObject::MysqlRdbms(v.into()),
375 );
376 self
377 }
378
379 /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
380 /// if it holds a `PostgresqlRdbms`, `None` if the field is not set or
381 /// holds a different branch.
382 pub fn postgresql_rdbms(
383 &self,
384 ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
385 #[allow(unreachable_patterns)]
386 self.data_object.as_ref().and_then(|v| match v {
387 crate::model::discover_connection_profile_request::DataObject::PostgresqlRdbms(v) => {
388 std::option::Option::Some(v)
389 }
390 _ => std::option::Option::None,
391 })
392 }
393
394 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
395 /// to hold a `PostgresqlRdbms`.
396 ///
397 /// Note that all the setters affecting `data_object` are
398 /// mutually exclusive.
399 ///
400 /// # Example
401 /// ```ignore,no_run
402 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
403 /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
404 /// let x = DiscoverConnectionProfileRequest::new().set_postgresql_rdbms(PostgresqlRdbms::default()/* use setters */);
405 /// assert!(x.postgresql_rdbms().is_some());
406 /// assert!(x.oracle_rdbms().is_none());
407 /// assert!(x.mysql_rdbms().is_none());
408 /// assert!(x.sql_server_rdbms().is_none());
409 /// assert!(x.salesforce_org().is_none());
410 /// assert!(x.mongodb_cluster().is_none());
411 /// ```
412 pub fn set_postgresql_rdbms<
413 T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
414 >(
415 mut self,
416 v: T,
417 ) -> Self {
418 self.data_object = std::option::Option::Some(
419 crate::model::discover_connection_profile_request::DataObject::PostgresqlRdbms(
420 v.into(),
421 ),
422 );
423 self
424 }
425
426 /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
427 /// if it holds a `SqlServerRdbms`, `None` if the field is not set or
428 /// holds a different branch.
429 pub fn sql_server_rdbms(
430 &self,
431 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
432 #[allow(unreachable_patterns)]
433 self.data_object.as_ref().and_then(|v| match v {
434 crate::model::discover_connection_profile_request::DataObject::SqlServerRdbms(v) => {
435 std::option::Option::Some(v)
436 }
437 _ => std::option::Option::None,
438 })
439 }
440
441 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
442 /// to hold a `SqlServerRdbms`.
443 ///
444 /// Note that all the setters affecting `data_object` are
445 /// mutually exclusive.
446 ///
447 /// # Example
448 /// ```ignore,no_run
449 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
450 /// use google_cloud_datastream_v1::model::SqlServerRdbms;
451 /// let x = DiscoverConnectionProfileRequest::new().set_sql_server_rdbms(SqlServerRdbms::default()/* use setters */);
452 /// assert!(x.sql_server_rdbms().is_some());
453 /// assert!(x.oracle_rdbms().is_none());
454 /// assert!(x.mysql_rdbms().is_none());
455 /// assert!(x.postgresql_rdbms().is_none());
456 /// assert!(x.salesforce_org().is_none());
457 /// assert!(x.mongodb_cluster().is_none());
458 /// ```
459 pub fn set_sql_server_rdbms<
460 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
461 >(
462 mut self,
463 v: T,
464 ) -> Self {
465 self.data_object = std::option::Option::Some(
466 crate::model::discover_connection_profile_request::DataObject::SqlServerRdbms(v.into()),
467 );
468 self
469 }
470
471 /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
472 /// if it holds a `SalesforceOrg`, `None` if the field is not set or
473 /// holds a different branch.
474 pub fn salesforce_org(
475 &self,
476 ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
477 #[allow(unreachable_patterns)]
478 self.data_object.as_ref().and_then(|v| match v {
479 crate::model::discover_connection_profile_request::DataObject::SalesforceOrg(v) => {
480 std::option::Option::Some(v)
481 }
482 _ => std::option::Option::None,
483 })
484 }
485
486 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
487 /// to hold a `SalesforceOrg`.
488 ///
489 /// Note that all the setters affecting `data_object` are
490 /// mutually exclusive.
491 ///
492 /// # Example
493 /// ```ignore,no_run
494 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
495 /// use google_cloud_datastream_v1::model::SalesforceOrg;
496 /// let x = DiscoverConnectionProfileRequest::new().set_salesforce_org(SalesforceOrg::default()/* use setters */);
497 /// assert!(x.salesforce_org().is_some());
498 /// assert!(x.oracle_rdbms().is_none());
499 /// assert!(x.mysql_rdbms().is_none());
500 /// assert!(x.postgresql_rdbms().is_none());
501 /// assert!(x.sql_server_rdbms().is_none());
502 /// assert!(x.mongodb_cluster().is_none());
503 /// ```
504 pub fn set_salesforce_org<
505 T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
506 >(
507 mut self,
508 v: T,
509 ) -> Self {
510 self.data_object = std::option::Option::Some(
511 crate::model::discover_connection_profile_request::DataObject::SalesforceOrg(v.into()),
512 );
513 self
514 }
515
516 /// The value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
517 /// if it holds a `MongodbCluster`, `None` if the field is not set or
518 /// holds a different branch.
519 pub fn mongodb_cluster(
520 &self,
521 ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
522 #[allow(unreachable_patterns)]
523 self.data_object.as_ref().and_then(|v| match v {
524 crate::model::discover_connection_profile_request::DataObject::MongodbCluster(v) => {
525 std::option::Option::Some(v)
526 }
527 _ => std::option::Option::None,
528 })
529 }
530
531 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
532 /// to hold a `MongodbCluster`.
533 ///
534 /// Note that all the setters affecting `data_object` are
535 /// mutually exclusive.
536 ///
537 /// # Example
538 /// ```ignore,no_run
539 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileRequest;
540 /// use google_cloud_datastream_v1::model::MongodbCluster;
541 /// let x = DiscoverConnectionProfileRequest::new().set_mongodb_cluster(MongodbCluster::default()/* use setters */);
542 /// assert!(x.mongodb_cluster().is_some());
543 /// assert!(x.oracle_rdbms().is_none());
544 /// assert!(x.mysql_rdbms().is_none());
545 /// assert!(x.postgresql_rdbms().is_none());
546 /// assert!(x.sql_server_rdbms().is_none());
547 /// assert!(x.salesforce_org().is_none());
548 /// ```
549 pub fn set_mongodb_cluster<
550 T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
551 >(
552 mut self,
553 v: T,
554 ) -> Self {
555 self.data_object = std::option::Option::Some(
556 crate::model::discover_connection_profile_request::DataObject::MongodbCluster(v.into()),
557 );
558 self
559 }
560}
561
562impl wkt::message::Message for DiscoverConnectionProfileRequest {
563 fn typename() -> &'static str {
564 "type.googleapis.com/google.cloud.datastream.v1.DiscoverConnectionProfileRequest"
565 }
566}
567
568/// Defines additional types related to [DiscoverConnectionProfileRequest].
569pub mod discover_connection_profile_request {
570 #[allow(unused_imports)]
571 use super::*;
572
573 /// The connection profile on which to run discover.
574 #[derive(Clone, Debug, PartialEq)]
575 #[non_exhaustive]
576 pub enum Target {
577 /// An ad-hoc connection profile configuration.
578 ConnectionProfile(std::boxed::Box<crate::model::ConnectionProfile>),
579 /// A reference to an existing connection profile.
580 ConnectionProfileName(std::string::String),
581 }
582
583 /// The depth of the retrieved hierarchy of data objects.
584 #[derive(Clone, Debug, PartialEq)]
585 #[non_exhaustive]
586 pub enum Hierarchy {
587 /// Whether to retrieve the full hierarchy of data objects (TRUE) or only the
588 /// current level (FALSE).
589 FullHierarchy(bool),
590 /// The number of hierarchy levels below the current level to be retrieved.
591 HierarchyDepth(i32),
592 }
593
594 /// The data object to populate with child data objects and metadata.
595 #[derive(Clone, Debug, PartialEq)]
596 #[non_exhaustive]
597 pub enum DataObject {
598 /// Oracle RDBMS to enrich with child data objects and metadata.
599 OracleRdbms(std::boxed::Box<crate::model::OracleRdbms>),
600 /// MySQL RDBMS to enrich with child data objects and metadata.
601 MysqlRdbms(std::boxed::Box<crate::model::MysqlRdbms>),
602 /// PostgreSQL RDBMS to enrich with child data objects and metadata.
603 PostgresqlRdbms(std::boxed::Box<crate::model::PostgresqlRdbms>),
604 /// SQLServer RDBMS to enrich with child data objects and metadata.
605 SqlServerRdbms(std::boxed::Box<crate::model::SqlServerRdbms>),
606 /// Salesforce organization to enrich with child data objects and metadata.
607 SalesforceOrg(std::boxed::Box<crate::model::SalesforceOrg>),
608 /// MongoDB cluster to enrich with child data objects and metadata.
609 MongodbCluster(std::boxed::Box<crate::model::MongodbCluster>),
610 }
611}
612
613/// Response from a discover request.
614#[derive(Clone, Default, PartialEq)]
615#[non_exhaustive]
616pub struct DiscoverConnectionProfileResponse {
617 /// The data object that has been enriched by the discover API call.
618 pub data_object:
619 std::option::Option<crate::model::discover_connection_profile_response::DataObject>,
620
621 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
622}
623
624impl DiscoverConnectionProfileResponse {
625 /// Creates a new default instance.
626 pub fn new() -> Self {
627 std::default::Default::default()
628 }
629
630 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object].
631 ///
632 /// Note that all the setters affecting `data_object` are mutually
633 /// exclusive.
634 ///
635 /// # Example
636 /// ```ignore,no_run
637 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
638 /// use google_cloud_datastream_v1::model::OracleRdbms;
639 /// let x = DiscoverConnectionProfileResponse::new().set_data_object(Some(
640 /// google_cloud_datastream_v1::model::discover_connection_profile_response::DataObject::OracleRdbms(OracleRdbms::default().into())));
641 /// ```
642 pub fn set_data_object<
643 T: std::convert::Into<
644 std::option::Option<crate::model::discover_connection_profile_response::DataObject>,
645 >,
646 >(
647 mut self,
648 v: T,
649 ) -> Self {
650 self.data_object = v.into();
651 self
652 }
653
654 /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
655 /// if it holds a `OracleRdbms`, `None` if the field is not set or
656 /// holds a different branch.
657 pub fn oracle_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
658 #[allow(unreachable_patterns)]
659 self.data_object.as_ref().and_then(|v| match v {
660 crate::model::discover_connection_profile_response::DataObject::OracleRdbms(v) => {
661 std::option::Option::Some(v)
662 }
663 _ => std::option::Option::None,
664 })
665 }
666
667 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
668 /// to hold a `OracleRdbms`.
669 ///
670 /// Note that all the setters affecting `data_object` are
671 /// mutually exclusive.
672 ///
673 /// # Example
674 /// ```ignore,no_run
675 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
676 /// use google_cloud_datastream_v1::model::OracleRdbms;
677 /// let x = DiscoverConnectionProfileResponse::new().set_oracle_rdbms(OracleRdbms::default()/* use setters */);
678 /// assert!(x.oracle_rdbms().is_some());
679 /// assert!(x.mysql_rdbms().is_none());
680 /// assert!(x.postgresql_rdbms().is_none());
681 /// assert!(x.sql_server_rdbms().is_none());
682 /// assert!(x.salesforce_org().is_none());
683 /// assert!(x.mongodb_cluster().is_none());
684 /// ```
685 pub fn set_oracle_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>>(
686 mut self,
687 v: T,
688 ) -> Self {
689 self.data_object = std::option::Option::Some(
690 crate::model::discover_connection_profile_response::DataObject::OracleRdbms(v.into()),
691 );
692 self
693 }
694
695 /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
696 /// if it holds a `MysqlRdbms`, `None` if the field is not set or
697 /// holds a different branch.
698 pub fn mysql_rdbms(&self) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
699 #[allow(unreachable_patterns)]
700 self.data_object.as_ref().and_then(|v| match v {
701 crate::model::discover_connection_profile_response::DataObject::MysqlRdbms(v) => {
702 std::option::Option::Some(v)
703 }
704 _ => std::option::Option::None,
705 })
706 }
707
708 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
709 /// to hold a `MysqlRdbms`.
710 ///
711 /// Note that all the setters affecting `data_object` are
712 /// mutually exclusive.
713 ///
714 /// # Example
715 /// ```ignore,no_run
716 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
717 /// use google_cloud_datastream_v1::model::MysqlRdbms;
718 /// let x = DiscoverConnectionProfileResponse::new().set_mysql_rdbms(MysqlRdbms::default()/* use setters */);
719 /// assert!(x.mysql_rdbms().is_some());
720 /// assert!(x.oracle_rdbms().is_none());
721 /// assert!(x.postgresql_rdbms().is_none());
722 /// assert!(x.sql_server_rdbms().is_none());
723 /// assert!(x.salesforce_org().is_none());
724 /// assert!(x.mongodb_cluster().is_none());
725 /// ```
726 pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
727 mut self,
728 v: T,
729 ) -> Self {
730 self.data_object = std::option::Option::Some(
731 crate::model::discover_connection_profile_response::DataObject::MysqlRdbms(v.into()),
732 );
733 self
734 }
735
736 /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
737 /// if it holds a `PostgresqlRdbms`, `None` if the field is not set or
738 /// holds a different branch.
739 pub fn postgresql_rdbms(
740 &self,
741 ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
742 #[allow(unreachable_patterns)]
743 self.data_object.as_ref().and_then(|v| match v {
744 crate::model::discover_connection_profile_response::DataObject::PostgresqlRdbms(v) => {
745 std::option::Option::Some(v)
746 }
747 _ => std::option::Option::None,
748 })
749 }
750
751 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
752 /// to hold a `PostgresqlRdbms`.
753 ///
754 /// Note that all the setters affecting `data_object` are
755 /// mutually exclusive.
756 ///
757 /// # Example
758 /// ```ignore,no_run
759 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
760 /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
761 /// let x = DiscoverConnectionProfileResponse::new().set_postgresql_rdbms(PostgresqlRdbms::default()/* use setters */);
762 /// assert!(x.postgresql_rdbms().is_some());
763 /// assert!(x.oracle_rdbms().is_none());
764 /// assert!(x.mysql_rdbms().is_none());
765 /// assert!(x.sql_server_rdbms().is_none());
766 /// assert!(x.salesforce_org().is_none());
767 /// assert!(x.mongodb_cluster().is_none());
768 /// ```
769 pub fn set_postgresql_rdbms<
770 T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
771 >(
772 mut self,
773 v: T,
774 ) -> Self {
775 self.data_object = std::option::Option::Some(
776 crate::model::discover_connection_profile_response::DataObject::PostgresqlRdbms(
777 v.into(),
778 ),
779 );
780 self
781 }
782
783 /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
784 /// if it holds a `SqlServerRdbms`, `None` if the field is not set or
785 /// holds a different branch.
786 pub fn sql_server_rdbms(
787 &self,
788 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
789 #[allow(unreachable_patterns)]
790 self.data_object.as_ref().and_then(|v| match v {
791 crate::model::discover_connection_profile_response::DataObject::SqlServerRdbms(v) => {
792 std::option::Option::Some(v)
793 }
794 _ => std::option::Option::None,
795 })
796 }
797
798 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
799 /// to hold a `SqlServerRdbms`.
800 ///
801 /// Note that all the setters affecting `data_object` are
802 /// mutually exclusive.
803 ///
804 /// # Example
805 /// ```ignore,no_run
806 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
807 /// use google_cloud_datastream_v1::model::SqlServerRdbms;
808 /// let x = DiscoverConnectionProfileResponse::new().set_sql_server_rdbms(SqlServerRdbms::default()/* use setters */);
809 /// assert!(x.sql_server_rdbms().is_some());
810 /// assert!(x.oracle_rdbms().is_none());
811 /// assert!(x.mysql_rdbms().is_none());
812 /// assert!(x.postgresql_rdbms().is_none());
813 /// assert!(x.salesforce_org().is_none());
814 /// assert!(x.mongodb_cluster().is_none());
815 /// ```
816 pub fn set_sql_server_rdbms<
817 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
818 >(
819 mut self,
820 v: T,
821 ) -> Self {
822 self.data_object = std::option::Option::Some(
823 crate::model::discover_connection_profile_response::DataObject::SqlServerRdbms(
824 v.into(),
825 ),
826 );
827 self
828 }
829
830 /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
831 /// if it holds a `SalesforceOrg`, `None` if the field is not set or
832 /// holds a different branch.
833 pub fn salesforce_org(
834 &self,
835 ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
836 #[allow(unreachable_patterns)]
837 self.data_object.as_ref().and_then(|v| match v {
838 crate::model::discover_connection_profile_response::DataObject::SalesforceOrg(v) => {
839 std::option::Option::Some(v)
840 }
841 _ => std::option::Option::None,
842 })
843 }
844
845 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
846 /// to hold a `SalesforceOrg`.
847 ///
848 /// Note that all the setters affecting `data_object` are
849 /// mutually exclusive.
850 ///
851 /// # Example
852 /// ```ignore,no_run
853 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
854 /// use google_cloud_datastream_v1::model::SalesforceOrg;
855 /// let x = DiscoverConnectionProfileResponse::new().set_salesforce_org(SalesforceOrg::default()/* use setters */);
856 /// assert!(x.salesforce_org().is_some());
857 /// assert!(x.oracle_rdbms().is_none());
858 /// assert!(x.mysql_rdbms().is_none());
859 /// assert!(x.postgresql_rdbms().is_none());
860 /// assert!(x.sql_server_rdbms().is_none());
861 /// assert!(x.mongodb_cluster().is_none());
862 /// ```
863 pub fn set_salesforce_org<
864 T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
865 >(
866 mut self,
867 v: T,
868 ) -> Self {
869 self.data_object = std::option::Option::Some(
870 crate::model::discover_connection_profile_response::DataObject::SalesforceOrg(v.into()),
871 );
872 self
873 }
874
875 /// The value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
876 /// if it holds a `MongodbCluster`, `None` if the field is not set or
877 /// holds a different branch.
878 pub fn mongodb_cluster(
879 &self,
880 ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
881 #[allow(unreachable_patterns)]
882 self.data_object.as_ref().and_then(|v| match v {
883 crate::model::discover_connection_profile_response::DataObject::MongodbCluster(v) => {
884 std::option::Option::Some(v)
885 }
886 _ => std::option::Option::None,
887 })
888 }
889
890 /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileResponse::data_object]
891 /// to hold a `MongodbCluster`.
892 ///
893 /// Note that all the setters affecting `data_object` are
894 /// mutually exclusive.
895 ///
896 /// # Example
897 /// ```ignore,no_run
898 /// # use google_cloud_datastream_v1::model::DiscoverConnectionProfileResponse;
899 /// use google_cloud_datastream_v1::model::MongodbCluster;
900 /// let x = DiscoverConnectionProfileResponse::new().set_mongodb_cluster(MongodbCluster::default()/* use setters */);
901 /// assert!(x.mongodb_cluster().is_some());
902 /// assert!(x.oracle_rdbms().is_none());
903 /// assert!(x.mysql_rdbms().is_none());
904 /// assert!(x.postgresql_rdbms().is_none());
905 /// assert!(x.sql_server_rdbms().is_none());
906 /// assert!(x.salesforce_org().is_none());
907 /// ```
908 pub fn set_mongodb_cluster<
909 T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
910 >(
911 mut self,
912 v: T,
913 ) -> Self {
914 self.data_object = std::option::Option::Some(
915 crate::model::discover_connection_profile_response::DataObject::MongodbCluster(
916 v.into(),
917 ),
918 );
919 self
920 }
921}
922
923impl wkt::message::Message for DiscoverConnectionProfileResponse {
924 fn typename() -> &'static str {
925 "type.googleapis.com/google.cloud.datastream.v1.DiscoverConnectionProfileResponse"
926 }
927}
928
929/// Defines additional types related to [DiscoverConnectionProfileResponse].
930pub mod discover_connection_profile_response {
931 #[allow(unused_imports)]
932 use super::*;
933
934 /// The data object that has been enriched by the discover API call.
935 #[derive(Clone, Debug, PartialEq)]
936 #[non_exhaustive]
937 pub enum DataObject {
938 /// Enriched Oracle RDBMS object.
939 OracleRdbms(std::boxed::Box<crate::model::OracleRdbms>),
940 /// Enriched MySQL RDBMS object.
941 MysqlRdbms(std::boxed::Box<crate::model::MysqlRdbms>),
942 /// Enriched PostgreSQL RDBMS object.
943 PostgresqlRdbms(std::boxed::Box<crate::model::PostgresqlRdbms>),
944 /// Enriched SQLServer RDBMS object.
945 SqlServerRdbms(std::boxed::Box<crate::model::SqlServerRdbms>),
946 /// Enriched Salesforce organization.
947 SalesforceOrg(std::boxed::Box<crate::model::SalesforceOrg>),
948 /// Enriched MongoDB cluster.
949 MongodbCluster(std::boxed::Box<crate::model::MongodbCluster>),
950 }
951}
952
953/// Request message for 'FetchStaticIps' request.
954#[derive(Clone, Default, PartialEq)]
955#[non_exhaustive]
956pub struct FetchStaticIpsRequest {
957 /// Required. The resource name for the location for which static IPs should be
958 /// returned. Must be in the format `projects/*/locations/*`.
959 pub name: std::string::String,
960
961 /// Maximum number of Ips to return, will likely not be specified.
962 pub page_size: i32,
963
964 /// A page token, received from a previous `ListStaticIps` call.
965 /// will likely not be specified.
966 pub page_token: std::string::String,
967
968 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
969}
970
971impl FetchStaticIpsRequest {
972 /// Creates a new default instance.
973 pub fn new() -> Self {
974 std::default::Default::default()
975 }
976
977 /// Sets the value of [name][crate::model::FetchStaticIpsRequest::name].
978 ///
979 /// # Example
980 /// ```ignore,no_run
981 /// # use google_cloud_datastream_v1::model::FetchStaticIpsRequest;
982 /// let x = FetchStaticIpsRequest::new().set_name("example");
983 /// ```
984 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
985 self.name = v.into();
986 self
987 }
988
989 /// Sets the value of [page_size][crate::model::FetchStaticIpsRequest::page_size].
990 ///
991 /// # Example
992 /// ```ignore,no_run
993 /// # use google_cloud_datastream_v1::model::FetchStaticIpsRequest;
994 /// let x = FetchStaticIpsRequest::new().set_page_size(42);
995 /// ```
996 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
997 self.page_size = v.into();
998 self
999 }
1000
1001 /// Sets the value of [page_token][crate::model::FetchStaticIpsRequest::page_token].
1002 ///
1003 /// # Example
1004 /// ```ignore,no_run
1005 /// # use google_cloud_datastream_v1::model::FetchStaticIpsRequest;
1006 /// let x = FetchStaticIpsRequest::new().set_page_token("example");
1007 /// ```
1008 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1009 self.page_token = v.into();
1010 self
1011 }
1012}
1013
1014impl wkt::message::Message for FetchStaticIpsRequest {
1015 fn typename() -> &'static str {
1016 "type.googleapis.com/google.cloud.datastream.v1.FetchStaticIpsRequest"
1017 }
1018}
1019
1020/// Response message for a 'FetchStaticIps' response.
1021#[derive(Clone, Default, PartialEq)]
1022#[non_exhaustive]
1023pub struct FetchStaticIpsResponse {
1024 /// list of static ips by account
1025 pub static_ips: std::vec::Vec<std::string::String>,
1026
1027 /// A token that can be sent as `page_token` to retrieve the next page.
1028 /// If this field is omitted, there are no subsequent pages.
1029 pub next_page_token: std::string::String,
1030
1031 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1032}
1033
1034impl FetchStaticIpsResponse {
1035 /// Creates a new default instance.
1036 pub fn new() -> Self {
1037 std::default::Default::default()
1038 }
1039
1040 /// Sets the value of [static_ips][crate::model::FetchStaticIpsResponse::static_ips].
1041 ///
1042 /// # Example
1043 /// ```ignore,no_run
1044 /// # use google_cloud_datastream_v1::model::FetchStaticIpsResponse;
1045 /// let x = FetchStaticIpsResponse::new().set_static_ips(["a", "b", "c"]);
1046 /// ```
1047 pub fn set_static_ips<T, V>(mut self, v: T) -> Self
1048 where
1049 T: std::iter::IntoIterator<Item = V>,
1050 V: std::convert::Into<std::string::String>,
1051 {
1052 use std::iter::Iterator;
1053 self.static_ips = v.into_iter().map(|i| i.into()).collect();
1054 self
1055 }
1056
1057 /// Sets the value of [next_page_token][crate::model::FetchStaticIpsResponse::next_page_token].
1058 ///
1059 /// # Example
1060 /// ```ignore,no_run
1061 /// # use google_cloud_datastream_v1::model::FetchStaticIpsResponse;
1062 /// let x = FetchStaticIpsResponse::new().set_next_page_token("example");
1063 /// ```
1064 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1065 self.next_page_token = v.into();
1066 self
1067 }
1068}
1069
1070impl wkt::message::Message for FetchStaticIpsResponse {
1071 fn typename() -> &'static str {
1072 "type.googleapis.com/google.cloud.datastream.v1.FetchStaticIpsResponse"
1073 }
1074}
1075
1076/// Request message for listing connection profiles.
1077#[derive(Clone, Default, PartialEq)]
1078#[non_exhaustive]
1079pub struct ListConnectionProfilesRequest {
1080 /// Required. The parent that owns the collection of connection profiles.
1081 pub parent: std::string::String,
1082
1083 /// Maximum number of connection profiles to return.
1084 /// If unspecified, at most 50 connection profiles will be returned.
1085 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
1086 pub page_size: i32,
1087
1088 /// Page token received from a previous `ListConnectionProfiles` call.
1089 /// Provide this to retrieve the subsequent page.
1090 ///
1091 /// When paginating, all other parameters provided to `ListConnectionProfiles`
1092 /// must match the call that provided the page token.
1093 pub page_token: std::string::String,
1094
1095 /// Filter request.
1096 pub filter: std::string::String,
1097
1098 /// Order by fields for the result.
1099 pub order_by: std::string::String,
1100
1101 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1102}
1103
1104impl ListConnectionProfilesRequest {
1105 /// Creates a new default instance.
1106 pub fn new() -> Self {
1107 std::default::Default::default()
1108 }
1109
1110 /// Sets the value of [parent][crate::model::ListConnectionProfilesRequest::parent].
1111 ///
1112 /// # Example
1113 /// ```ignore,no_run
1114 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1115 /// # let project_id = "project_id";
1116 /// # let location_id = "location_id";
1117 /// let x = ListConnectionProfilesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
1118 /// ```
1119 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1120 self.parent = v.into();
1121 self
1122 }
1123
1124 /// Sets the value of [page_size][crate::model::ListConnectionProfilesRequest::page_size].
1125 ///
1126 /// # Example
1127 /// ```ignore,no_run
1128 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1129 /// let x = ListConnectionProfilesRequest::new().set_page_size(42);
1130 /// ```
1131 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1132 self.page_size = v.into();
1133 self
1134 }
1135
1136 /// Sets the value of [page_token][crate::model::ListConnectionProfilesRequest::page_token].
1137 ///
1138 /// # Example
1139 /// ```ignore,no_run
1140 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1141 /// let x = ListConnectionProfilesRequest::new().set_page_token("example");
1142 /// ```
1143 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1144 self.page_token = v.into();
1145 self
1146 }
1147
1148 /// Sets the value of [filter][crate::model::ListConnectionProfilesRequest::filter].
1149 ///
1150 /// # Example
1151 /// ```ignore,no_run
1152 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1153 /// let x = ListConnectionProfilesRequest::new().set_filter("example");
1154 /// ```
1155 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1156 self.filter = v.into();
1157 self
1158 }
1159
1160 /// Sets the value of [order_by][crate::model::ListConnectionProfilesRequest::order_by].
1161 ///
1162 /// # Example
1163 /// ```ignore,no_run
1164 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesRequest;
1165 /// let x = ListConnectionProfilesRequest::new().set_order_by("example");
1166 /// ```
1167 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1168 self.order_by = v.into();
1169 self
1170 }
1171}
1172
1173impl wkt::message::Message for ListConnectionProfilesRequest {
1174 fn typename() -> &'static str {
1175 "type.googleapis.com/google.cloud.datastream.v1.ListConnectionProfilesRequest"
1176 }
1177}
1178
1179/// Response message for listing connection profiles.
1180#[derive(Clone, Default, PartialEq)]
1181#[non_exhaustive]
1182pub struct ListConnectionProfilesResponse {
1183 /// List of connection profiles.
1184 pub connection_profiles: std::vec::Vec<crate::model::ConnectionProfile>,
1185
1186 /// A token, which can be sent as `page_token` to retrieve the next page.
1187 /// If this field is omitted, there are no subsequent pages.
1188 pub next_page_token: std::string::String,
1189
1190 /// Locations that could not be reached.
1191 pub unreachable: std::vec::Vec<std::string::String>,
1192
1193 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1194}
1195
1196impl ListConnectionProfilesResponse {
1197 /// Creates a new default instance.
1198 pub fn new() -> Self {
1199 std::default::Default::default()
1200 }
1201
1202 /// Sets the value of [connection_profiles][crate::model::ListConnectionProfilesResponse::connection_profiles].
1203 ///
1204 /// # Example
1205 /// ```ignore,no_run
1206 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesResponse;
1207 /// use google_cloud_datastream_v1::model::ConnectionProfile;
1208 /// let x = ListConnectionProfilesResponse::new()
1209 /// .set_connection_profiles([
1210 /// ConnectionProfile::default()/* use setters */,
1211 /// ConnectionProfile::default()/* use (different) setters */,
1212 /// ]);
1213 /// ```
1214 pub fn set_connection_profiles<T, V>(mut self, v: T) -> Self
1215 where
1216 T: std::iter::IntoIterator<Item = V>,
1217 V: std::convert::Into<crate::model::ConnectionProfile>,
1218 {
1219 use std::iter::Iterator;
1220 self.connection_profiles = v.into_iter().map(|i| i.into()).collect();
1221 self
1222 }
1223
1224 /// Sets the value of [next_page_token][crate::model::ListConnectionProfilesResponse::next_page_token].
1225 ///
1226 /// # Example
1227 /// ```ignore,no_run
1228 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesResponse;
1229 /// let x = ListConnectionProfilesResponse::new().set_next_page_token("example");
1230 /// ```
1231 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1232 self.next_page_token = v.into();
1233 self
1234 }
1235
1236 /// Sets the value of [unreachable][crate::model::ListConnectionProfilesResponse::unreachable].
1237 ///
1238 /// # Example
1239 /// ```ignore,no_run
1240 /// # use google_cloud_datastream_v1::model::ListConnectionProfilesResponse;
1241 /// let x = ListConnectionProfilesResponse::new().set_unreachable(["a", "b", "c"]);
1242 /// ```
1243 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1244 where
1245 T: std::iter::IntoIterator<Item = V>,
1246 V: std::convert::Into<std::string::String>,
1247 {
1248 use std::iter::Iterator;
1249 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1250 self
1251 }
1252}
1253
1254impl wkt::message::Message for ListConnectionProfilesResponse {
1255 fn typename() -> &'static str {
1256 "type.googleapis.com/google.cloud.datastream.v1.ListConnectionProfilesResponse"
1257 }
1258}
1259
1260#[doc(hidden)]
1261impl google_cloud_gax::paginator::internal::PageableResponse for ListConnectionProfilesResponse {
1262 type PageItem = crate::model::ConnectionProfile;
1263
1264 fn items(self) -> std::vec::Vec<Self::PageItem> {
1265 self.connection_profiles
1266 }
1267
1268 fn next_page_token(&self) -> std::string::String {
1269 use std::clone::Clone;
1270 self.next_page_token.clone()
1271 }
1272}
1273
1274/// Request message for getting a connection profile.
1275#[derive(Clone, Default, PartialEq)]
1276#[non_exhaustive]
1277pub struct GetConnectionProfileRequest {
1278 /// Required. The name of the connection profile resource to get.
1279 pub name: std::string::String,
1280
1281 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1282}
1283
1284impl GetConnectionProfileRequest {
1285 /// Creates a new default instance.
1286 pub fn new() -> Self {
1287 std::default::Default::default()
1288 }
1289
1290 /// Sets the value of [name][crate::model::GetConnectionProfileRequest::name].
1291 ///
1292 /// # Example
1293 /// ```ignore,no_run
1294 /// # use google_cloud_datastream_v1::model::GetConnectionProfileRequest;
1295 /// # let project_id = "project_id";
1296 /// # let location_id = "location_id";
1297 /// # let connection_profile_id = "connection_profile_id";
1298 /// let x = GetConnectionProfileRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connectionProfiles/{connection_profile_id}"));
1299 /// ```
1300 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1301 self.name = v.into();
1302 self
1303 }
1304}
1305
1306impl wkt::message::Message for GetConnectionProfileRequest {
1307 fn typename() -> &'static str {
1308 "type.googleapis.com/google.cloud.datastream.v1.GetConnectionProfileRequest"
1309 }
1310}
1311
1312/// Request message for creating a connection profile.
1313#[derive(Clone, Default, PartialEq)]
1314#[non_exhaustive]
1315pub struct CreateConnectionProfileRequest {
1316 /// Required. The parent that owns the collection of ConnectionProfiles.
1317 pub parent: std::string::String,
1318
1319 /// Required. The connection profile identifier.
1320 pub connection_profile_id: std::string::String,
1321
1322 /// Required. The connection profile resource to create.
1323 pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
1324
1325 /// Optional. A request ID to identify requests. Specify a unique request ID
1326 /// so that if you must retry your request, the server will know to ignore
1327 /// the request if it has already been completed. The server will guarantee
1328 /// that for at least 60 minutes since the first request.
1329 ///
1330 /// For example, consider a situation where you make an initial request and the
1331 /// request times out. If you make the request again with the same request ID,
1332 /// the server can check if original operation with the same request ID was
1333 /// received, and if so, will ignore the second request. This prevents clients
1334 /// from accidentally creating duplicate commitments.
1335 ///
1336 /// The request ID must be a valid UUID with the exception that zero UUID is
1337 /// not supported (00000000-0000-0000-0000-000000000000).
1338 pub request_id: std::string::String,
1339
1340 /// Optional. Only validate the connection profile, but don't create any
1341 /// resources. The default is false.
1342 pub validate_only: bool,
1343
1344 /// Optional. Create the connection profile without validating it.
1345 pub force: bool,
1346
1347 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1348}
1349
1350impl CreateConnectionProfileRequest {
1351 /// Creates a new default instance.
1352 pub fn new() -> Self {
1353 std::default::Default::default()
1354 }
1355
1356 /// Sets the value of [parent][crate::model::CreateConnectionProfileRequest::parent].
1357 ///
1358 /// # Example
1359 /// ```ignore,no_run
1360 /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1361 /// # let project_id = "project_id";
1362 /// # let location_id = "location_id";
1363 /// let x = CreateConnectionProfileRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
1364 /// ```
1365 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1366 self.parent = v.into();
1367 self
1368 }
1369
1370 /// Sets the value of [connection_profile_id][crate::model::CreateConnectionProfileRequest::connection_profile_id].
1371 ///
1372 /// # Example
1373 /// ```ignore,no_run
1374 /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1375 /// let x = CreateConnectionProfileRequest::new().set_connection_profile_id("example");
1376 /// ```
1377 pub fn set_connection_profile_id<T: std::convert::Into<std::string::String>>(
1378 mut self,
1379 v: T,
1380 ) -> Self {
1381 self.connection_profile_id = v.into();
1382 self
1383 }
1384
1385 /// Sets the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
1386 ///
1387 /// # Example
1388 /// ```ignore,no_run
1389 /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1390 /// use google_cloud_datastream_v1::model::ConnectionProfile;
1391 /// let x = CreateConnectionProfileRequest::new().set_connection_profile(ConnectionProfile::default()/* use setters */);
1392 /// ```
1393 pub fn set_connection_profile<T>(mut self, v: T) -> Self
1394 where
1395 T: std::convert::Into<crate::model::ConnectionProfile>,
1396 {
1397 self.connection_profile = std::option::Option::Some(v.into());
1398 self
1399 }
1400
1401 /// Sets or clears the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
1402 ///
1403 /// # Example
1404 /// ```ignore,no_run
1405 /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1406 /// use google_cloud_datastream_v1::model::ConnectionProfile;
1407 /// let x = CreateConnectionProfileRequest::new().set_or_clear_connection_profile(Some(ConnectionProfile::default()/* use setters */));
1408 /// let x = CreateConnectionProfileRequest::new().set_or_clear_connection_profile(None::<ConnectionProfile>);
1409 /// ```
1410 pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
1411 where
1412 T: std::convert::Into<crate::model::ConnectionProfile>,
1413 {
1414 self.connection_profile = v.map(|x| x.into());
1415 self
1416 }
1417
1418 /// Sets the value of [request_id][crate::model::CreateConnectionProfileRequest::request_id].
1419 ///
1420 /// # Example
1421 /// ```ignore,no_run
1422 /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1423 /// let x = CreateConnectionProfileRequest::new().set_request_id("example");
1424 /// ```
1425 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1426 self.request_id = v.into();
1427 self
1428 }
1429
1430 /// Sets the value of [validate_only][crate::model::CreateConnectionProfileRequest::validate_only].
1431 ///
1432 /// # Example
1433 /// ```ignore,no_run
1434 /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1435 /// let x = CreateConnectionProfileRequest::new().set_validate_only(true);
1436 /// ```
1437 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1438 self.validate_only = v.into();
1439 self
1440 }
1441
1442 /// Sets the value of [force][crate::model::CreateConnectionProfileRequest::force].
1443 ///
1444 /// # Example
1445 /// ```ignore,no_run
1446 /// # use google_cloud_datastream_v1::model::CreateConnectionProfileRequest;
1447 /// let x = CreateConnectionProfileRequest::new().set_force(true);
1448 /// ```
1449 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1450 self.force = v.into();
1451 self
1452 }
1453}
1454
1455impl wkt::message::Message for CreateConnectionProfileRequest {
1456 fn typename() -> &'static str {
1457 "type.googleapis.com/google.cloud.datastream.v1.CreateConnectionProfileRequest"
1458 }
1459}
1460
1461/// Connection profile update message.
1462#[derive(Clone, Default, PartialEq)]
1463#[non_exhaustive]
1464pub struct UpdateConnectionProfileRequest {
1465 /// Optional. Field mask is used to specify the fields to be overwritten in the
1466 /// ConnectionProfile resource by the update.
1467 /// The fields specified in the update_mask are relative to the resource, not
1468 /// the full request. A field will be overwritten if it is in the mask. If the
1469 /// user does not provide a mask then all fields will be overwritten.
1470 pub update_mask: std::option::Option<wkt::FieldMask>,
1471
1472 /// Required. The connection profile to update.
1473 pub connection_profile: std::option::Option<crate::model::ConnectionProfile>,
1474
1475 /// Optional. A request ID to identify requests. Specify a unique request ID
1476 /// so that if you must retry your request, the server will know to ignore
1477 /// the request if it has already been completed. The server will guarantee
1478 /// that for at least 60 minutes since the first request.
1479 ///
1480 /// For example, consider a situation where you make an initial request and the
1481 /// request times out. If you make the request again with the same request ID,
1482 /// the server can check if original operation with the same request ID was
1483 /// received, and if so, will ignore the second request. This prevents clients
1484 /// from accidentally creating duplicate commitments.
1485 ///
1486 /// The request ID must be a valid UUID with the exception that zero UUID is
1487 /// not supported (00000000-0000-0000-0000-000000000000).
1488 pub request_id: std::string::String,
1489
1490 /// Optional. Only validate the connection profile, but don't update any
1491 /// resources. The default is false.
1492 pub validate_only: bool,
1493
1494 /// Optional. Update the connection profile without validating it.
1495 pub force: bool,
1496
1497 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1498}
1499
1500impl UpdateConnectionProfileRequest {
1501 /// Creates a new default instance.
1502 pub fn new() -> Self {
1503 std::default::Default::default()
1504 }
1505
1506 /// Sets the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
1507 ///
1508 /// # Example
1509 /// ```ignore,no_run
1510 /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1511 /// use wkt::FieldMask;
1512 /// let x = UpdateConnectionProfileRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1513 /// ```
1514 pub fn set_update_mask<T>(mut self, v: T) -> Self
1515 where
1516 T: std::convert::Into<wkt::FieldMask>,
1517 {
1518 self.update_mask = std::option::Option::Some(v.into());
1519 self
1520 }
1521
1522 /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
1523 ///
1524 /// # Example
1525 /// ```ignore,no_run
1526 /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1527 /// use wkt::FieldMask;
1528 /// let x = UpdateConnectionProfileRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1529 /// let x = UpdateConnectionProfileRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1530 /// ```
1531 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1532 where
1533 T: std::convert::Into<wkt::FieldMask>,
1534 {
1535 self.update_mask = v.map(|x| x.into());
1536 self
1537 }
1538
1539 /// Sets the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
1540 ///
1541 /// # Example
1542 /// ```ignore,no_run
1543 /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1544 /// use google_cloud_datastream_v1::model::ConnectionProfile;
1545 /// let x = UpdateConnectionProfileRequest::new().set_connection_profile(ConnectionProfile::default()/* use setters */);
1546 /// ```
1547 pub fn set_connection_profile<T>(mut self, v: T) -> Self
1548 where
1549 T: std::convert::Into<crate::model::ConnectionProfile>,
1550 {
1551 self.connection_profile = std::option::Option::Some(v.into());
1552 self
1553 }
1554
1555 /// Sets or clears the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
1556 ///
1557 /// # Example
1558 /// ```ignore,no_run
1559 /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1560 /// use google_cloud_datastream_v1::model::ConnectionProfile;
1561 /// let x = UpdateConnectionProfileRequest::new().set_or_clear_connection_profile(Some(ConnectionProfile::default()/* use setters */));
1562 /// let x = UpdateConnectionProfileRequest::new().set_or_clear_connection_profile(None::<ConnectionProfile>);
1563 /// ```
1564 pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
1565 where
1566 T: std::convert::Into<crate::model::ConnectionProfile>,
1567 {
1568 self.connection_profile = v.map(|x| x.into());
1569 self
1570 }
1571
1572 /// Sets the value of [request_id][crate::model::UpdateConnectionProfileRequest::request_id].
1573 ///
1574 /// # Example
1575 /// ```ignore,no_run
1576 /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1577 /// let x = UpdateConnectionProfileRequest::new().set_request_id("example");
1578 /// ```
1579 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1580 self.request_id = v.into();
1581 self
1582 }
1583
1584 /// Sets the value of [validate_only][crate::model::UpdateConnectionProfileRequest::validate_only].
1585 ///
1586 /// # Example
1587 /// ```ignore,no_run
1588 /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1589 /// let x = UpdateConnectionProfileRequest::new().set_validate_only(true);
1590 /// ```
1591 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1592 self.validate_only = v.into();
1593 self
1594 }
1595
1596 /// Sets the value of [force][crate::model::UpdateConnectionProfileRequest::force].
1597 ///
1598 /// # Example
1599 /// ```ignore,no_run
1600 /// # use google_cloud_datastream_v1::model::UpdateConnectionProfileRequest;
1601 /// let x = UpdateConnectionProfileRequest::new().set_force(true);
1602 /// ```
1603 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1604 self.force = v.into();
1605 self
1606 }
1607}
1608
1609impl wkt::message::Message for UpdateConnectionProfileRequest {
1610 fn typename() -> &'static str {
1611 "type.googleapis.com/google.cloud.datastream.v1.UpdateConnectionProfileRequest"
1612 }
1613}
1614
1615/// Request message for deleting a connection profile.
1616#[derive(Clone, Default, PartialEq)]
1617#[non_exhaustive]
1618pub struct DeleteConnectionProfileRequest {
1619 /// Required. The name of the connection profile resource to delete.
1620 pub name: std::string::String,
1621
1622 /// Optional. A request ID to identify requests. Specify a unique request ID
1623 /// so that if you must retry your request, the server will know to ignore
1624 /// the request if it has already been completed. The server will guarantee
1625 /// that for at least 60 minutes after the first request.
1626 ///
1627 /// For example, consider a situation where you make an initial request and the
1628 /// request times out. If you make the request again with the same request ID,
1629 /// the server can check if original operation with the same request ID was
1630 /// received, and if so, will ignore the second request. This prevents clients
1631 /// from accidentally creating duplicate commitments.
1632 ///
1633 /// The request ID must be a valid UUID with the exception that zero UUID is
1634 /// not supported (00000000-0000-0000-0000-000000000000).
1635 pub request_id: std::string::String,
1636
1637 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1638}
1639
1640impl DeleteConnectionProfileRequest {
1641 /// Creates a new default instance.
1642 pub fn new() -> Self {
1643 std::default::Default::default()
1644 }
1645
1646 /// Sets the value of [name][crate::model::DeleteConnectionProfileRequest::name].
1647 ///
1648 /// # Example
1649 /// ```ignore,no_run
1650 /// # use google_cloud_datastream_v1::model::DeleteConnectionProfileRequest;
1651 /// # let project_id = "project_id";
1652 /// # let location_id = "location_id";
1653 /// # let connection_profile_id = "connection_profile_id";
1654 /// let x = DeleteConnectionProfileRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/connectionProfiles/{connection_profile_id}"));
1655 /// ```
1656 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1657 self.name = v.into();
1658 self
1659 }
1660
1661 /// Sets the value of [request_id][crate::model::DeleteConnectionProfileRequest::request_id].
1662 ///
1663 /// # Example
1664 /// ```ignore,no_run
1665 /// # use google_cloud_datastream_v1::model::DeleteConnectionProfileRequest;
1666 /// let x = DeleteConnectionProfileRequest::new().set_request_id("example");
1667 /// ```
1668 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1669 self.request_id = v.into();
1670 self
1671 }
1672}
1673
1674impl wkt::message::Message for DeleteConnectionProfileRequest {
1675 fn typename() -> &'static str {
1676 "type.googleapis.com/google.cloud.datastream.v1.DeleteConnectionProfileRequest"
1677 }
1678}
1679
1680/// Request message for listing streams.
1681#[derive(Clone, Default, PartialEq)]
1682#[non_exhaustive]
1683pub struct ListStreamsRequest {
1684 /// Required. The parent that owns the collection of streams.
1685 pub parent: std::string::String,
1686
1687 /// Maximum number of streams to return.
1688 /// If unspecified, at most 50 streams will be returned. The maximum
1689 /// value is 1000; values above 1000 will be coerced to 1000.
1690 pub page_size: i32,
1691
1692 /// Page token received from a previous `ListStreams` call.
1693 /// Provide this to retrieve the subsequent page.
1694 ///
1695 /// When paginating, all other parameters provided to `ListStreams`
1696 /// must match the call that provided the page token.
1697 pub page_token: std::string::String,
1698
1699 /// Filter request.
1700 pub filter: std::string::String,
1701
1702 /// Order by fields for the result.
1703 pub order_by: std::string::String,
1704
1705 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1706}
1707
1708impl ListStreamsRequest {
1709 /// Creates a new default instance.
1710 pub fn new() -> Self {
1711 std::default::Default::default()
1712 }
1713
1714 /// Sets the value of [parent][crate::model::ListStreamsRequest::parent].
1715 ///
1716 /// # Example
1717 /// ```ignore,no_run
1718 /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1719 /// # let project_id = "project_id";
1720 /// # let location_id = "location_id";
1721 /// let x = ListStreamsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
1722 /// ```
1723 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1724 self.parent = v.into();
1725 self
1726 }
1727
1728 /// Sets the value of [page_size][crate::model::ListStreamsRequest::page_size].
1729 ///
1730 /// # Example
1731 /// ```ignore,no_run
1732 /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1733 /// let x = ListStreamsRequest::new().set_page_size(42);
1734 /// ```
1735 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1736 self.page_size = v.into();
1737 self
1738 }
1739
1740 /// Sets the value of [page_token][crate::model::ListStreamsRequest::page_token].
1741 ///
1742 /// # Example
1743 /// ```ignore,no_run
1744 /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1745 /// let x = ListStreamsRequest::new().set_page_token("example");
1746 /// ```
1747 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1748 self.page_token = v.into();
1749 self
1750 }
1751
1752 /// Sets the value of [filter][crate::model::ListStreamsRequest::filter].
1753 ///
1754 /// # Example
1755 /// ```ignore,no_run
1756 /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1757 /// let x = ListStreamsRequest::new().set_filter("example");
1758 /// ```
1759 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1760 self.filter = v.into();
1761 self
1762 }
1763
1764 /// Sets the value of [order_by][crate::model::ListStreamsRequest::order_by].
1765 ///
1766 /// # Example
1767 /// ```ignore,no_run
1768 /// # use google_cloud_datastream_v1::model::ListStreamsRequest;
1769 /// let x = ListStreamsRequest::new().set_order_by("example");
1770 /// ```
1771 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1772 self.order_by = v.into();
1773 self
1774 }
1775}
1776
1777impl wkt::message::Message for ListStreamsRequest {
1778 fn typename() -> &'static str {
1779 "type.googleapis.com/google.cloud.datastream.v1.ListStreamsRequest"
1780 }
1781}
1782
1783/// Response message for listing streams.
1784#[derive(Clone, Default, PartialEq)]
1785#[non_exhaustive]
1786pub struct ListStreamsResponse {
1787 /// List of streams
1788 pub streams: std::vec::Vec<crate::model::Stream>,
1789
1790 /// A token, which can be sent as `page_token` to retrieve the next page.
1791 /// If this field is omitted, there are no subsequent pages.
1792 pub next_page_token: std::string::String,
1793
1794 /// Locations that could not be reached.
1795 pub unreachable: std::vec::Vec<std::string::String>,
1796
1797 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1798}
1799
1800impl ListStreamsResponse {
1801 /// Creates a new default instance.
1802 pub fn new() -> Self {
1803 std::default::Default::default()
1804 }
1805
1806 /// Sets the value of [streams][crate::model::ListStreamsResponse::streams].
1807 ///
1808 /// # Example
1809 /// ```ignore,no_run
1810 /// # use google_cloud_datastream_v1::model::ListStreamsResponse;
1811 /// use google_cloud_datastream_v1::model::Stream;
1812 /// let x = ListStreamsResponse::new()
1813 /// .set_streams([
1814 /// Stream::default()/* use setters */,
1815 /// Stream::default()/* use (different) setters */,
1816 /// ]);
1817 /// ```
1818 pub fn set_streams<T, V>(mut self, v: T) -> Self
1819 where
1820 T: std::iter::IntoIterator<Item = V>,
1821 V: std::convert::Into<crate::model::Stream>,
1822 {
1823 use std::iter::Iterator;
1824 self.streams = v.into_iter().map(|i| i.into()).collect();
1825 self
1826 }
1827
1828 /// Sets the value of [next_page_token][crate::model::ListStreamsResponse::next_page_token].
1829 ///
1830 /// # Example
1831 /// ```ignore,no_run
1832 /// # use google_cloud_datastream_v1::model::ListStreamsResponse;
1833 /// let x = ListStreamsResponse::new().set_next_page_token("example");
1834 /// ```
1835 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1836 self.next_page_token = v.into();
1837 self
1838 }
1839
1840 /// Sets the value of [unreachable][crate::model::ListStreamsResponse::unreachable].
1841 ///
1842 /// # Example
1843 /// ```ignore,no_run
1844 /// # use google_cloud_datastream_v1::model::ListStreamsResponse;
1845 /// let x = ListStreamsResponse::new().set_unreachable(["a", "b", "c"]);
1846 /// ```
1847 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1848 where
1849 T: std::iter::IntoIterator<Item = V>,
1850 V: std::convert::Into<std::string::String>,
1851 {
1852 use std::iter::Iterator;
1853 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1854 self
1855 }
1856}
1857
1858impl wkt::message::Message for ListStreamsResponse {
1859 fn typename() -> &'static str {
1860 "type.googleapis.com/google.cloud.datastream.v1.ListStreamsResponse"
1861 }
1862}
1863
1864#[doc(hidden)]
1865impl google_cloud_gax::paginator::internal::PageableResponse for ListStreamsResponse {
1866 type PageItem = crate::model::Stream;
1867
1868 fn items(self) -> std::vec::Vec<Self::PageItem> {
1869 self.streams
1870 }
1871
1872 fn next_page_token(&self) -> std::string::String {
1873 use std::clone::Clone;
1874 self.next_page_token.clone()
1875 }
1876}
1877
1878/// Request message for getting a stream.
1879#[derive(Clone, Default, PartialEq)]
1880#[non_exhaustive]
1881pub struct GetStreamRequest {
1882 /// Required. The name of the stream resource to get.
1883 pub name: std::string::String,
1884
1885 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1886}
1887
1888impl GetStreamRequest {
1889 /// Creates a new default instance.
1890 pub fn new() -> Self {
1891 std::default::Default::default()
1892 }
1893
1894 /// Sets the value of [name][crate::model::GetStreamRequest::name].
1895 ///
1896 /// # Example
1897 /// ```ignore,no_run
1898 /// # use google_cloud_datastream_v1::model::GetStreamRequest;
1899 /// # let project_id = "project_id";
1900 /// # let location_id = "location_id";
1901 /// # let stream_id = "stream_id";
1902 /// let x = GetStreamRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/streams/{stream_id}"));
1903 /// ```
1904 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1905 self.name = v.into();
1906 self
1907 }
1908}
1909
1910impl wkt::message::Message for GetStreamRequest {
1911 fn typename() -> &'static str {
1912 "type.googleapis.com/google.cloud.datastream.v1.GetStreamRequest"
1913 }
1914}
1915
1916/// Request message for creating a stream.
1917#[derive(Clone, Default, PartialEq)]
1918#[non_exhaustive]
1919pub struct CreateStreamRequest {
1920 /// Required. The parent that owns the collection of streams.
1921 pub parent: std::string::String,
1922
1923 /// Required. The stream identifier.
1924 pub stream_id: std::string::String,
1925
1926 /// Required. The stream resource to create.
1927 pub stream: std::option::Option<crate::model::Stream>,
1928
1929 /// Optional. A request ID to identify requests. Specify a unique request ID
1930 /// so that if you must retry your request, the server will know to ignore
1931 /// the request if it has already been completed. The server will guarantee
1932 /// that for at least 60 minutes since the first request.
1933 ///
1934 /// For example, consider a situation where you make an initial request and the
1935 /// request times out. If you make the request again with the same request ID,
1936 /// the server can check if original operation with the same request ID was
1937 /// received, and if so, will ignore the second request. This prevents clients
1938 /// from accidentally creating duplicate commitments.
1939 ///
1940 /// The request ID must be a valid UUID with the exception that zero UUID is
1941 /// not supported (00000000-0000-0000-0000-000000000000).
1942 pub request_id: std::string::String,
1943
1944 /// Optional. Only validate the stream, but don't create any resources.
1945 /// The default is false.
1946 pub validate_only: bool,
1947
1948 /// Optional. Create the stream without validating it.
1949 pub force: bool,
1950
1951 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1952}
1953
1954impl CreateStreamRequest {
1955 /// Creates a new default instance.
1956 pub fn new() -> Self {
1957 std::default::Default::default()
1958 }
1959
1960 /// Sets the value of [parent][crate::model::CreateStreamRequest::parent].
1961 ///
1962 /// # Example
1963 /// ```ignore,no_run
1964 /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1965 /// # let project_id = "project_id";
1966 /// # let location_id = "location_id";
1967 /// let x = CreateStreamRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
1968 /// ```
1969 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1970 self.parent = v.into();
1971 self
1972 }
1973
1974 /// Sets the value of [stream_id][crate::model::CreateStreamRequest::stream_id].
1975 ///
1976 /// # Example
1977 /// ```ignore,no_run
1978 /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1979 /// let x = CreateStreamRequest::new().set_stream_id("example");
1980 /// ```
1981 pub fn set_stream_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1982 self.stream_id = v.into();
1983 self
1984 }
1985
1986 /// Sets the value of [stream][crate::model::CreateStreamRequest::stream].
1987 ///
1988 /// # Example
1989 /// ```ignore,no_run
1990 /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
1991 /// use google_cloud_datastream_v1::model::Stream;
1992 /// let x = CreateStreamRequest::new().set_stream(Stream::default()/* use setters */);
1993 /// ```
1994 pub fn set_stream<T>(mut self, v: T) -> Self
1995 where
1996 T: std::convert::Into<crate::model::Stream>,
1997 {
1998 self.stream = std::option::Option::Some(v.into());
1999 self
2000 }
2001
2002 /// Sets or clears the value of [stream][crate::model::CreateStreamRequest::stream].
2003 ///
2004 /// # Example
2005 /// ```ignore,no_run
2006 /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
2007 /// use google_cloud_datastream_v1::model::Stream;
2008 /// let x = CreateStreamRequest::new().set_or_clear_stream(Some(Stream::default()/* use setters */));
2009 /// let x = CreateStreamRequest::new().set_or_clear_stream(None::<Stream>);
2010 /// ```
2011 pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
2012 where
2013 T: std::convert::Into<crate::model::Stream>,
2014 {
2015 self.stream = v.map(|x| x.into());
2016 self
2017 }
2018
2019 /// Sets the value of [request_id][crate::model::CreateStreamRequest::request_id].
2020 ///
2021 /// # Example
2022 /// ```ignore,no_run
2023 /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
2024 /// let x = CreateStreamRequest::new().set_request_id("example");
2025 /// ```
2026 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2027 self.request_id = v.into();
2028 self
2029 }
2030
2031 /// Sets the value of [validate_only][crate::model::CreateStreamRequest::validate_only].
2032 ///
2033 /// # Example
2034 /// ```ignore,no_run
2035 /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
2036 /// let x = CreateStreamRequest::new().set_validate_only(true);
2037 /// ```
2038 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2039 self.validate_only = v.into();
2040 self
2041 }
2042
2043 /// Sets the value of [force][crate::model::CreateStreamRequest::force].
2044 ///
2045 /// # Example
2046 /// ```ignore,no_run
2047 /// # use google_cloud_datastream_v1::model::CreateStreamRequest;
2048 /// let x = CreateStreamRequest::new().set_force(true);
2049 /// ```
2050 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2051 self.force = v.into();
2052 self
2053 }
2054}
2055
2056impl wkt::message::Message for CreateStreamRequest {
2057 fn typename() -> &'static str {
2058 "type.googleapis.com/google.cloud.datastream.v1.CreateStreamRequest"
2059 }
2060}
2061
2062/// Request message for updating a stream.
2063#[derive(Clone, Default, PartialEq)]
2064#[non_exhaustive]
2065pub struct UpdateStreamRequest {
2066 /// Optional. Field mask is used to specify the fields to be overwritten in the
2067 /// stream resource by the update.
2068 /// The fields specified in the update_mask are relative to the resource, not
2069 /// the full request. A field will be overwritten if it is in the mask. If the
2070 /// user does not provide a mask then all fields will be overwritten.
2071 pub update_mask: std::option::Option<wkt::FieldMask>,
2072
2073 /// Required. The stream resource to update.
2074 pub stream: std::option::Option<crate::model::Stream>,
2075
2076 /// Optional. A request ID to identify requests. Specify a unique request ID
2077 /// so that if you must retry your request, the server will know to ignore
2078 /// the request if it has already been completed. The server will guarantee
2079 /// that for at least 60 minutes since the first request.
2080 ///
2081 /// For example, consider a situation where you make an initial request and the
2082 /// request times out. If you make the request again with the same request ID,
2083 /// the server can check if original operation with the same request ID was
2084 /// received, and if so, will ignore the second request. This prevents clients
2085 /// from accidentally creating duplicate commitments.
2086 ///
2087 /// The request ID must be a valid UUID with the exception that zero UUID is
2088 /// not supported (00000000-0000-0000-0000-000000000000).
2089 pub request_id: std::string::String,
2090
2091 /// Optional. Only validate the stream with the changes, without actually
2092 /// updating it. The default is false.
2093 pub validate_only: bool,
2094
2095 /// Optional. Update the stream without validating it.
2096 pub force: bool,
2097
2098 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2099}
2100
2101impl UpdateStreamRequest {
2102 /// Creates a new default instance.
2103 pub fn new() -> Self {
2104 std::default::Default::default()
2105 }
2106
2107 /// Sets the value of [update_mask][crate::model::UpdateStreamRequest::update_mask].
2108 ///
2109 /// # Example
2110 /// ```ignore,no_run
2111 /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2112 /// use wkt::FieldMask;
2113 /// let x = UpdateStreamRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2114 /// ```
2115 pub fn set_update_mask<T>(mut self, v: T) -> Self
2116 where
2117 T: std::convert::Into<wkt::FieldMask>,
2118 {
2119 self.update_mask = std::option::Option::Some(v.into());
2120 self
2121 }
2122
2123 /// Sets or clears the value of [update_mask][crate::model::UpdateStreamRequest::update_mask].
2124 ///
2125 /// # Example
2126 /// ```ignore,no_run
2127 /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2128 /// use wkt::FieldMask;
2129 /// let x = UpdateStreamRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2130 /// let x = UpdateStreamRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2131 /// ```
2132 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2133 where
2134 T: std::convert::Into<wkt::FieldMask>,
2135 {
2136 self.update_mask = v.map(|x| x.into());
2137 self
2138 }
2139
2140 /// Sets the value of [stream][crate::model::UpdateStreamRequest::stream].
2141 ///
2142 /// # Example
2143 /// ```ignore,no_run
2144 /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2145 /// use google_cloud_datastream_v1::model::Stream;
2146 /// let x = UpdateStreamRequest::new().set_stream(Stream::default()/* use setters */);
2147 /// ```
2148 pub fn set_stream<T>(mut self, v: T) -> Self
2149 where
2150 T: std::convert::Into<crate::model::Stream>,
2151 {
2152 self.stream = std::option::Option::Some(v.into());
2153 self
2154 }
2155
2156 /// Sets or clears the value of [stream][crate::model::UpdateStreamRequest::stream].
2157 ///
2158 /// # Example
2159 /// ```ignore,no_run
2160 /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2161 /// use google_cloud_datastream_v1::model::Stream;
2162 /// let x = UpdateStreamRequest::new().set_or_clear_stream(Some(Stream::default()/* use setters */));
2163 /// let x = UpdateStreamRequest::new().set_or_clear_stream(None::<Stream>);
2164 /// ```
2165 pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
2166 where
2167 T: std::convert::Into<crate::model::Stream>,
2168 {
2169 self.stream = v.map(|x| x.into());
2170 self
2171 }
2172
2173 /// Sets the value of [request_id][crate::model::UpdateStreamRequest::request_id].
2174 ///
2175 /// # Example
2176 /// ```ignore,no_run
2177 /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2178 /// let x = UpdateStreamRequest::new().set_request_id("example");
2179 /// ```
2180 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2181 self.request_id = v.into();
2182 self
2183 }
2184
2185 /// Sets the value of [validate_only][crate::model::UpdateStreamRequest::validate_only].
2186 ///
2187 /// # Example
2188 /// ```ignore,no_run
2189 /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2190 /// let x = UpdateStreamRequest::new().set_validate_only(true);
2191 /// ```
2192 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2193 self.validate_only = v.into();
2194 self
2195 }
2196
2197 /// Sets the value of [force][crate::model::UpdateStreamRequest::force].
2198 ///
2199 /// # Example
2200 /// ```ignore,no_run
2201 /// # use google_cloud_datastream_v1::model::UpdateStreamRequest;
2202 /// let x = UpdateStreamRequest::new().set_force(true);
2203 /// ```
2204 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2205 self.force = v.into();
2206 self
2207 }
2208}
2209
2210impl wkt::message::Message for UpdateStreamRequest {
2211 fn typename() -> &'static str {
2212 "type.googleapis.com/google.cloud.datastream.v1.UpdateStreamRequest"
2213 }
2214}
2215
2216/// Request message for deleting a stream.
2217#[derive(Clone, Default, PartialEq)]
2218#[non_exhaustive]
2219pub struct DeleteStreamRequest {
2220 /// Required. The name of the stream resource to delete.
2221 pub name: std::string::String,
2222
2223 /// Optional. A request ID to identify requests. Specify a unique request ID
2224 /// so that if you must retry your request, the server will know to ignore
2225 /// the request if it has already been completed. The server will guarantee
2226 /// that for at least 60 minutes after the first request.
2227 ///
2228 /// For example, consider a situation where you make an initial request and the
2229 /// request times out. If you make the request again with the same request ID,
2230 /// the server can check if original operation with the same request ID was
2231 /// received, and if so, will ignore the second request. This prevents clients
2232 /// from accidentally creating duplicate commitments.
2233 ///
2234 /// The request ID must be a valid UUID with the exception that zero UUID is
2235 /// not supported (00000000-0000-0000-0000-000000000000).
2236 pub request_id: std::string::String,
2237
2238 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2239}
2240
2241impl DeleteStreamRequest {
2242 /// Creates a new default instance.
2243 pub fn new() -> Self {
2244 std::default::Default::default()
2245 }
2246
2247 /// Sets the value of [name][crate::model::DeleteStreamRequest::name].
2248 ///
2249 /// # Example
2250 /// ```ignore,no_run
2251 /// # use google_cloud_datastream_v1::model::DeleteStreamRequest;
2252 /// # let project_id = "project_id";
2253 /// # let location_id = "location_id";
2254 /// # let stream_id = "stream_id";
2255 /// let x = DeleteStreamRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/streams/{stream_id}"));
2256 /// ```
2257 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2258 self.name = v.into();
2259 self
2260 }
2261
2262 /// Sets the value of [request_id][crate::model::DeleteStreamRequest::request_id].
2263 ///
2264 /// # Example
2265 /// ```ignore,no_run
2266 /// # use google_cloud_datastream_v1::model::DeleteStreamRequest;
2267 /// let x = DeleteStreamRequest::new().set_request_id("example");
2268 /// ```
2269 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2270 self.request_id = v.into();
2271 self
2272 }
2273}
2274
2275impl wkt::message::Message for DeleteStreamRequest {
2276 fn typename() -> &'static str {
2277 "type.googleapis.com/google.cloud.datastream.v1.DeleteStreamRequest"
2278 }
2279}
2280
2281/// Request message for running a stream.
2282#[derive(Clone, Default, PartialEq)]
2283#[non_exhaustive]
2284pub struct RunStreamRequest {
2285 /// Required. Name of the stream resource to start, in the format:
2286 /// projects/{project_id}/locations/{location}/streams/{stream_name}
2287 pub name: std::string::String,
2288
2289 /// Optional. The CDC strategy of the stream. If not set, the system's default
2290 /// value will be used.
2291 pub cdc_strategy: std::option::Option<crate::model::CdcStrategy>,
2292
2293 /// Optional. Update the stream without validating it.
2294 pub force: bool,
2295
2296 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2297}
2298
2299impl RunStreamRequest {
2300 /// Creates a new default instance.
2301 pub fn new() -> Self {
2302 std::default::Default::default()
2303 }
2304
2305 /// Sets the value of [name][crate::model::RunStreamRequest::name].
2306 ///
2307 /// # Example
2308 /// ```ignore,no_run
2309 /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2310 /// # let project_id = "project_id";
2311 /// # let location_id = "location_id";
2312 /// # let stream_id = "stream_id";
2313 /// let x = RunStreamRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/streams/{stream_id}"));
2314 /// ```
2315 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2316 self.name = v.into();
2317 self
2318 }
2319
2320 /// Sets the value of [cdc_strategy][crate::model::RunStreamRequest::cdc_strategy].
2321 ///
2322 /// # Example
2323 /// ```ignore,no_run
2324 /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2325 /// use google_cloud_datastream_v1::model::CdcStrategy;
2326 /// let x = RunStreamRequest::new().set_cdc_strategy(CdcStrategy::default()/* use setters */);
2327 /// ```
2328 pub fn set_cdc_strategy<T>(mut self, v: T) -> Self
2329 where
2330 T: std::convert::Into<crate::model::CdcStrategy>,
2331 {
2332 self.cdc_strategy = std::option::Option::Some(v.into());
2333 self
2334 }
2335
2336 /// Sets or clears the value of [cdc_strategy][crate::model::RunStreamRequest::cdc_strategy].
2337 ///
2338 /// # Example
2339 /// ```ignore,no_run
2340 /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2341 /// use google_cloud_datastream_v1::model::CdcStrategy;
2342 /// let x = RunStreamRequest::new().set_or_clear_cdc_strategy(Some(CdcStrategy::default()/* use setters */));
2343 /// let x = RunStreamRequest::new().set_or_clear_cdc_strategy(None::<CdcStrategy>);
2344 /// ```
2345 pub fn set_or_clear_cdc_strategy<T>(mut self, v: std::option::Option<T>) -> Self
2346 where
2347 T: std::convert::Into<crate::model::CdcStrategy>,
2348 {
2349 self.cdc_strategy = v.map(|x| x.into());
2350 self
2351 }
2352
2353 /// Sets the value of [force][crate::model::RunStreamRequest::force].
2354 ///
2355 /// # Example
2356 /// ```ignore,no_run
2357 /// # use google_cloud_datastream_v1::model::RunStreamRequest;
2358 /// let x = RunStreamRequest::new().set_force(true);
2359 /// ```
2360 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2361 self.force = v.into();
2362 self
2363 }
2364}
2365
2366impl wkt::message::Message for RunStreamRequest {
2367 fn typename() -> &'static str {
2368 "type.googleapis.com/google.cloud.datastream.v1.RunStreamRequest"
2369 }
2370}
2371
2372/// Request for fetching a specific stream object.
2373#[derive(Clone, Default, PartialEq)]
2374#[non_exhaustive]
2375pub struct GetStreamObjectRequest {
2376 /// Required. The name of the stream object resource to get.
2377 pub name: std::string::String,
2378
2379 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2380}
2381
2382impl GetStreamObjectRequest {
2383 /// Creates a new default instance.
2384 pub fn new() -> Self {
2385 std::default::Default::default()
2386 }
2387
2388 /// Sets the value of [name][crate::model::GetStreamObjectRequest::name].
2389 ///
2390 /// # Example
2391 /// ```ignore,no_run
2392 /// # use google_cloud_datastream_v1::model::GetStreamObjectRequest;
2393 /// # let project_id = "project_id";
2394 /// # let location_id = "location_id";
2395 /// # let stream_id = "stream_id";
2396 /// # let object_id = "object_id";
2397 /// let x = GetStreamObjectRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/streams/{stream_id}/objects/{object_id}"));
2398 /// ```
2399 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2400 self.name = v.into();
2401 self
2402 }
2403}
2404
2405impl wkt::message::Message for GetStreamObjectRequest {
2406 fn typename() -> &'static str {
2407 "type.googleapis.com/google.cloud.datastream.v1.GetStreamObjectRequest"
2408 }
2409}
2410
2411/// Request for looking up a specific stream object by its source object
2412/// identifier.
2413#[derive(Clone, Default, PartialEq)]
2414#[non_exhaustive]
2415pub struct LookupStreamObjectRequest {
2416 /// Required. The parent stream that owns the collection of objects.
2417 pub parent: std::string::String,
2418
2419 /// Required. The source object identifier which maps to the stream object.
2420 pub source_object_identifier: std::option::Option<crate::model::SourceObjectIdentifier>,
2421
2422 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2423}
2424
2425impl LookupStreamObjectRequest {
2426 /// Creates a new default instance.
2427 pub fn new() -> Self {
2428 std::default::Default::default()
2429 }
2430
2431 /// Sets the value of [parent][crate::model::LookupStreamObjectRequest::parent].
2432 ///
2433 /// # Example
2434 /// ```ignore,no_run
2435 /// # use google_cloud_datastream_v1::model::LookupStreamObjectRequest;
2436 /// # let project_id = "project_id";
2437 /// # let location_id = "location_id";
2438 /// # let stream_id = "stream_id";
2439 /// let x = LookupStreamObjectRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/streams/{stream_id}"));
2440 /// ```
2441 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2442 self.parent = v.into();
2443 self
2444 }
2445
2446 /// Sets the value of [source_object_identifier][crate::model::LookupStreamObjectRequest::source_object_identifier].
2447 ///
2448 /// # Example
2449 /// ```ignore,no_run
2450 /// # use google_cloud_datastream_v1::model::LookupStreamObjectRequest;
2451 /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
2452 /// let x = LookupStreamObjectRequest::new().set_source_object_identifier(SourceObjectIdentifier::default()/* use setters */);
2453 /// ```
2454 pub fn set_source_object_identifier<T>(mut self, v: T) -> Self
2455 where
2456 T: std::convert::Into<crate::model::SourceObjectIdentifier>,
2457 {
2458 self.source_object_identifier = std::option::Option::Some(v.into());
2459 self
2460 }
2461
2462 /// Sets or clears the value of [source_object_identifier][crate::model::LookupStreamObjectRequest::source_object_identifier].
2463 ///
2464 /// # Example
2465 /// ```ignore,no_run
2466 /// # use google_cloud_datastream_v1::model::LookupStreamObjectRequest;
2467 /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
2468 /// let x = LookupStreamObjectRequest::new().set_or_clear_source_object_identifier(Some(SourceObjectIdentifier::default()/* use setters */));
2469 /// let x = LookupStreamObjectRequest::new().set_or_clear_source_object_identifier(None::<SourceObjectIdentifier>);
2470 /// ```
2471 pub fn set_or_clear_source_object_identifier<T>(mut self, v: std::option::Option<T>) -> Self
2472 where
2473 T: std::convert::Into<crate::model::SourceObjectIdentifier>,
2474 {
2475 self.source_object_identifier = v.map(|x| x.into());
2476 self
2477 }
2478}
2479
2480impl wkt::message::Message for LookupStreamObjectRequest {
2481 fn typename() -> &'static str {
2482 "type.googleapis.com/google.cloud.datastream.v1.LookupStreamObjectRequest"
2483 }
2484}
2485
2486/// Request for manually initiating a backfill job for a specific stream object.
2487#[derive(Clone, Default, PartialEq)]
2488#[non_exhaustive]
2489pub struct StartBackfillJobRequest {
2490 /// Required. The name of the stream object resource to start a backfill job
2491 /// for.
2492 pub object: std::string::String,
2493
2494 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2495}
2496
2497impl StartBackfillJobRequest {
2498 /// Creates a new default instance.
2499 pub fn new() -> Self {
2500 std::default::Default::default()
2501 }
2502
2503 /// Sets the value of [object][crate::model::StartBackfillJobRequest::object].
2504 ///
2505 /// # Example
2506 /// ```ignore,no_run
2507 /// # use google_cloud_datastream_v1::model::StartBackfillJobRequest;
2508 /// # let project_id = "project_id";
2509 /// # let location_id = "location_id";
2510 /// # let stream_id = "stream_id";
2511 /// # let object_id = "object_id";
2512 /// let x = StartBackfillJobRequest::new().set_object(format!("projects/{project_id}/locations/{location_id}/streams/{stream_id}/objects/{object_id}"));
2513 /// ```
2514 pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2515 self.object = v.into();
2516 self
2517 }
2518}
2519
2520impl wkt::message::Message for StartBackfillJobRequest {
2521 fn typename() -> &'static str {
2522 "type.googleapis.com/google.cloud.datastream.v1.StartBackfillJobRequest"
2523 }
2524}
2525
2526/// Response for manually initiating a backfill job for a specific stream object.
2527#[derive(Clone, Default, PartialEq)]
2528#[non_exhaustive]
2529pub struct StartBackfillJobResponse {
2530 /// The stream object resource a backfill job was started for.
2531 pub object: std::option::Option<crate::model::StreamObject>,
2532
2533 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2534}
2535
2536impl StartBackfillJobResponse {
2537 /// Creates a new default instance.
2538 pub fn new() -> Self {
2539 std::default::Default::default()
2540 }
2541
2542 /// Sets the value of [object][crate::model::StartBackfillJobResponse::object].
2543 ///
2544 /// # Example
2545 /// ```ignore,no_run
2546 /// # use google_cloud_datastream_v1::model::StartBackfillJobResponse;
2547 /// use google_cloud_datastream_v1::model::StreamObject;
2548 /// let x = StartBackfillJobResponse::new().set_object(StreamObject::default()/* use setters */);
2549 /// ```
2550 pub fn set_object<T>(mut self, v: T) -> Self
2551 where
2552 T: std::convert::Into<crate::model::StreamObject>,
2553 {
2554 self.object = std::option::Option::Some(v.into());
2555 self
2556 }
2557
2558 /// Sets or clears the value of [object][crate::model::StartBackfillJobResponse::object].
2559 ///
2560 /// # Example
2561 /// ```ignore,no_run
2562 /// # use google_cloud_datastream_v1::model::StartBackfillJobResponse;
2563 /// use google_cloud_datastream_v1::model::StreamObject;
2564 /// let x = StartBackfillJobResponse::new().set_or_clear_object(Some(StreamObject::default()/* use setters */));
2565 /// let x = StartBackfillJobResponse::new().set_or_clear_object(None::<StreamObject>);
2566 /// ```
2567 pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
2568 where
2569 T: std::convert::Into<crate::model::StreamObject>,
2570 {
2571 self.object = v.map(|x| x.into());
2572 self
2573 }
2574}
2575
2576impl wkt::message::Message for StartBackfillJobResponse {
2577 fn typename() -> &'static str {
2578 "type.googleapis.com/google.cloud.datastream.v1.StartBackfillJobResponse"
2579 }
2580}
2581
2582/// Request for manually stopping a running backfill job for a specific stream
2583/// object.
2584#[derive(Clone, Default, PartialEq)]
2585#[non_exhaustive]
2586pub struct StopBackfillJobRequest {
2587 /// Required. The name of the stream object resource to stop the backfill job
2588 /// for.
2589 pub object: std::string::String,
2590
2591 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2592}
2593
2594impl StopBackfillJobRequest {
2595 /// Creates a new default instance.
2596 pub fn new() -> Self {
2597 std::default::Default::default()
2598 }
2599
2600 /// Sets the value of [object][crate::model::StopBackfillJobRequest::object].
2601 ///
2602 /// # Example
2603 /// ```ignore,no_run
2604 /// # use google_cloud_datastream_v1::model::StopBackfillJobRequest;
2605 /// # let project_id = "project_id";
2606 /// # let location_id = "location_id";
2607 /// # let stream_id = "stream_id";
2608 /// # let object_id = "object_id";
2609 /// let x = StopBackfillJobRequest::new().set_object(format!("projects/{project_id}/locations/{location_id}/streams/{stream_id}/objects/{object_id}"));
2610 /// ```
2611 pub fn set_object<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2612 self.object = v.into();
2613 self
2614 }
2615}
2616
2617impl wkt::message::Message for StopBackfillJobRequest {
2618 fn typename() -> &'static str {
2619 "type.googleapis.com/google.cloud.datastream.v1.StopBackfillJobRequest"
2620 }
2621}
2622
2623/// Response for manually stop a backfill job for a specific stream object.
2624#[derive(Clone, Default, PartialEq)]
2625#[non_exhaustive]
2626pub struct StopBackfillJobResponse {
2627 /// The stream object resource the backfill job was stopped for.
2628 pub object: std::option::Option<crate::model::StreamObject>,
2629
2630 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2631}
2632
2633impl StopBackfillJobResponse {
2634 /// Creates a new default instance.
2635 pub fn new() -> Self {
2636 std::default::Default::default()
2637 }
2638
2639 /// Sets the value of [object][crate::model::StopBackfillJobResponse::object].
2640 ///
2641 /// # Example
2642 /// ```ignore,no_run
2643 /// # use google_cloud_datastream_v1::model::StopBackfillJobResponse;
2644 /// use google_cloud_datastream_v1::model::StreamObject;
2645 /// let x = StopBackfillJobResponse::new().set_object(StreamObject::default()/* use setters */);
2646 /// ```
2647 pub fn set_object<T>(mut self, v: T) -> Self
2648 where
2649 T: std::convert::Into<crate::model::StreamObject>,
2650 {
2651 self.object = std::option::Option::Some(v.into());
2652 self
2653 }
2654
2655 /// Sets or clears the value of [object][crate::model::StopBackfillJobResponse::object].
2656 ///
2657 /// # Example
2658 /// ```ignore,no_run
2659 /// # use google_cloud_datastream_v1::model::StopBackfillJobResponse;
2660 /// use google_cloud_datastream_v1::model::StreamObject;
2661 /// let x = StopBackfillJobResponse::new().set_or_clear_object(Some(StreamObject::default()/* use setters */));
2662 /// let x = StopBackfillJobResponse::new().set_or_clear_object(None::<StreamObject>);
2663 /// ```
2664 pub fn set_or_clear_object<T>(mut self, v: std::option::Option<T>) -> Self
2665 where
2666 T: std::convert::Into<crate::model::StreamObject>,
2667 {
2668 self.object = v.map(|x| x.into());
2669 self
2670 }
2671}
2672
2673impl wkt::message::Message for StopBackfillJobResponse {
2674 fn typename() -> &'static str {
2675 "type.googleapis.com/google.cloud.datastream.v1.StopBackfillJobResponse"
2676 }
2677}
2678
2679/// Request for listing all objects for a specific stream.
2680#[derive(Clone, Default, PartialEq)]
2681#[non_exhaustive]
2682pub struct ListStreamObjectsRequest {
2683 /// Required. The parent stream that owns the collection of objects.
2684 pub parent: std::string::String,
2685
2686 /// Maximum number of objects to return. Default is 50.
2687 /// The maximum value is 1000; values above 1000 will be coerced to 1000.
2688 pub page_size: i32,
2689
2690 /// Page token received from a previous `ListStreamObjectsRequest` call.
2691 /// Provide this to retrieve the subsequent page.
2692 ///
2693 /// When paginating, all other parameters provided to
2694 /// `ListStreamObjectsRequest` must match the call that provided the page
2695 /// token.
2696 pub page_token: std::string::String,
2697
2698 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2699}
2700
2701impl ListStreamObjectsRequest {
2702 /// Creates a new default instance.
2703 pub fn new() -> Self {
2704 std::default::Default::default()
2705 }
2706
2707 /// Sets the value of [parent][crate::model::ListStreamObjectsRequest::parent].
2708 ///
2709 /// # Example
2710 /// ```ignore,no_run
2711 /// # use google_cloud_datastream_v1::model::ListStreamObjectsRequest;
2712 /// # let project_id = "project_id";
2713 /// # let location_id = "location_id";
2714 /// # let stream_id = "stream_id";
2715 /// let x = ListStreamObjectsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/streams/{stream_id}"));
2716 /// ```
2717 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2718 self.parent = v.into();
2719 self
2720 }
2721
2722 /// Sets the value of [page_size][crate::model::ListStreamObjectsRequest::page_size].
2723 ///
2724 /// # Example
2725 /// ```ignore,no_run
2726 /// # use google_cloud_datastream_v1::model::ListStreamObjectsRequest;
2727 /// let x = ListStreamObjectsRequest::new().set_page_size(42);
2728 /// ```
2729 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2730 self.page_size = v.into();
2731 self
2732 }
2733
2734 /// Sets the value of [page_token][crate::model::ListStreamObjectsRequest::page_token].
2735 ///
2736 /// # Example
2737 /// ```ignore,no_run
2738 /// # use google_cloud_datastream_v1::model::ListStreamObjectsRequest;
2739 /// let x = ListStreamObjectsRequest::new().set_page_token("example");
2740 /// ```
2741 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2742 self.page_token = v.into();
2743 self
2744 }
2745}
2746
2747impl wkt::message::Message for ListStreamObjectsRequest {
2748 fn typename() -> &'static str {
2749 "type.googleapis.com/google.cloud.datastream.v1.ListStreamObjectsRequest"
2750 }
2751}
2752
2753/// Response containing the objects for a stream.
2754#[derive(Clone, Default, PartialEq)]
2755#[non_exhaustive]
2756pub struct ListStreamObjectsResponse {
2757 /// List of stream objects.
2758 pub stream_objects: std::vec::Vec<crate::model::StreamObject>,
2759
2760 /// A token, which can be sent as `page_token` to retrieve the next page.
2761 pub next_page_token: std::string::String,
2762
2763 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2764}
2765
2766impl ListStreamObjectsResponse {
2767 /// Creates a new default instance.
2768 pub fn new() -> Self {
2769 std::default::Default::default()
2770 }
2771
2772 /// Sets the value of [stream_objects][crate::model::ListStreamObjectsResponse::stream_objects].
2773 ///
2774 /// # Example
2775 /// ```ignore,no_run
2776 /// # use google_cloud_datastream_v1::model::ListStreamObjectsResponse;
2777 /// use google_cloud_datastream_v1::model::StreamObject;
2778 /// let x = ListStreamObjectsResponse::new()
2779 /// .set_stream_objects([
2780 /// StreamObject::default()/* use setters */,
2781 /// StreamObject::default()/* use (different) setters */,
2782 /// ]);
2783 /// ```
2784 pub fn set_stream_objects<T, V>(mut self, v: T) -> Self
2785 where
2786 T: std::iter::IntoIterator<Item = V>,
2787 V: std::convert::Into<crate::model::StreamObject>,
2788 {
2789 use std::iter::Iterator;
2790 self.stream_objects = v.into_iter().map(|i| i.into()).collect();
2791 self
2792 }
2793
2794 /// Sets the value of [next_page_token][crate::model::ListStreamObjectsResponse::next_page_token].
2795 ///
2796 /// # Example
2797 /// ```ignore,no_run
2798 /// # use google_cloud_datastream_v1::model::ListStreamObjectsResponse;
2799 /// let x = ListStreamObjectsResponse::new().set_next_page_token("example");
2800 /// ```
2801 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2802 self.next_page_token = v.into();
2803 self
2804 }
2805}
2806
2807impl wkt::message::Message for ListStreamObjectsResponse {
2808 fn typename() -> &'static str {
2809 "type.googleapis.com/google.cloud.datastream.v1.ListStreamObjectsResponse"
2810 }
2811}
2812
2813#[doc(hidden)]
2814impl google_cloud_gax::paginator::internal::PageableResponse for ListStreamObjectsResponse {
2815 type PageItem = crate::model::StreamObject;
2816
2817 fn items(self) -> std::vec::Vec<Self::PageItem> {
2818 self.stream_objects
2819 }
2820
2821 fn next_page_token(&self) -> std::string::String {
2822 use std::clone::Clone;
2823 self.next_page_token.clone()
2824 }
2825}
2826
2827/// Represents the metadata of the long-running operation.
2828#[derive(Clone, Default, PartialEq)]
2829#[non_exhaustive]
2830pub struct OperationMetadata {
2831 /// Output only. The time the operation was created.
2832 pub create_time: std::option::Option<wkt::Timestamp>,
2833
2834 /// Output only. The time the operation finished running.
2835 pub end_time: std::option::Option<wkt::Timestamp>,
2836
2837 /// Output only. Server-defined resource path for the target of the operation.
2838 pub target: std::string::String,
2839
2840 /// Output only. Name of the verb executed by the operation.
2841 pub verb: std::string::String,
2842
2843 /// Output only. Human-readable status of the operation, if any.
2844 pub status_message: std::string::String,
2845
2846 /// Output only. Identifies whether the user has requested cancellation
2847 /// of the operation. Operations that have successfully been cancelled
2848 /// have
2849 /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
2850 /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
2851 /// corresponding to `Code.CANCELLED`.
2852 ///
2853 /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
2854 /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
2855 pub requested_cancellation: bool,
2856
2857 /// Output only. API version used to start the operation.
2858 pub api_version: std::string::String,
2859
2860 /// Output only. Results of executed validations if there are any.
2861 pub validation_result: std::option::Option<crate::model::ValidationResult>,
2862
2863 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2864}
2865
2866impl OperationMetadata {
2867 /// Creates a new default instance.
2868 pub fn new() -> Self {
2869 std::default::Default::default()
2870 }
2871
2872 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
2873 ///
2874 /// # Example
2875 /// ```ignore,no_run
2876 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2877 /// use wkt::Timestamp;
2878 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
2879 /// ```
2880 pub fn set_create_time<T>(mut self, v: T) -> Self
2881 where
2882 T: std::convert::Into<wkt::Timestamp>,
2883 {
2884 self.create_time = std::option::Option::Some(v.into());
2885 self
2886 }
2887
2888 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
2889 ///
2890 /// # Example
2891 /// ```ignore,no_run
2892 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2893 /// use wkt::Timestamp;
2894 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2895 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
2896 /// ```
2897 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2898 where
2899 T: std::convert::Into<wkt::Timestamp>,
2900 {
2901 self.create_time = v.map(|x| x.into());
2902 self
2903 }
2904
2905 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
2906 ///
2907 /// # Example
2908 /// ```ignore,no_run
2909 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2910 /// use wkt::Timestamp;
2911 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
2912 /// ```
2913 pub fn set_end_time<T>(mut self, v: T) -> Self
2914 where
2915 T: std::convert::Into<wkt::Timestamp>,
2916 {
2917 self.end_time = std::option::Option::Some(v.into());
2918 self
2919 }
2920
2921 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
2922 ///
2923 /// # Example
2924 /// ```ignore,no_run
2925 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2926 /// use wkt::Timestamp;
2927 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2928 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
2929 /// ```
2930 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2931 where
2932 T: std::convert::Into<wkt::Timestamp>,
2933 {
2934 self.end_time = v.map(|x| x.into());
2935 self
2936 }
2937
2938 /// Sets the value of [target][crate::model::OperationMetadata::target].
2939 ///
2940 /// # Example
2941 /// ```ignore,no_run
2942 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2943 /// let x = OperationMetadata::new().set_target("example");
2944 /// ```
2945 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2946 self.target = v.into();
2947 self
2948 }
2949
2950 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
2951 ///
2952 /// # Example
2953 /// ```ignore,no_run
2954 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2955 /// let x = OperationMetadata::new().set_verb("example");
2956 /// ```
2957 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2958 self.verb = v.into();
2959 self
2960 }
2961
2962 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
2963 ///
2964 /// # Example
2965 /// ```ignore,no_run
2966 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2967 /// let x = OperationMetadata::new().set_status_message("example");
2968 /// ```
2969 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2970 self.status_message = v.into();
2971 self
2972 }
2973
2974 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
2975 ///
2976 /// # Example
2977 /// ```ignore,no_run
2978 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2979 /// let x = OperationMetadata::new().set_requested_cancellation(true);
2980 /// ```
2981 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2982 self.requested_cancellation = v.into();
2983 self
2984 }
2985
2986 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
2987 ///
2988 /// # Example
2989 /// ```ignore,no_run
2990 /// # use google_cloud_datastream_v1::model::OperationMetadata;
2991 /// let x = OperationMetadata::new().set_api_version("example");
2992 /// ```
2993 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2994 self.api_version = v.into();
2995 self
2996 }
2997
2998 /// Sets the value of [validation_result][crate::model::OperationMetadata::validation_result].
2999 ///
3000 /// # Example
3001 /// ```ignore,no_run
3002 /// # use google_cloud_datastream_v1::model::OperationMetadata;
3003 /// use google_cloud_datastream_v1::model::ValidationResult;
3004 /// let x = OperationMetadata::new().set_validation_result(ValidationResult::default()/* use setters */);
3005 /// ```
3006 pub fn set_validation_result<T>(mut self, v: T) -> Self
3007 where
3008 T: std::convert::Into<crate::model::ValidationResult>,
3009 {
3010 self.validation_result = std::option::Option::Some(v.into());
3011 self
3012 }
3013
3014 /// Sets or clears the value of [validation_result][crate::model::OperationMetadata::validation_result].
3015 ///
3016 /// # Example
3017 /// ```ignore,no_run
3018 /// # use google_cloud_datastream_v1::model::OperationMetadata;
3019 /// use google_cloud_datastream_v1::model::ValidationResult;
3020 /// let x = OperationMetadata::new().set_or_clear_validation_result(Some(ValidationResult::default()/* use setters */));
3021 /// let x = OperationMetadata::new().set_or_clear_validation_result(None::<ValidationResult>);
3022 /// ```
3023 pub fn set_or_clear_validation_result<T>(mut self, v: std::option::Option<T>) -> Self
3024 where
3025 T: std::convert::Into<crate::model::ValidationResult>,
3026 {
3027 self.validation_result = v.map(|x| x.into());
3028 self
3029 }
3030}
3031
3032impl wkt::message::Message for OperationMetadata {
3033 fn typename() -> &'static str {
3034 "type.googleapis.com/google.cloud.datastream.v1.OperationMetadata"
3035 }
3036}
3037
3038/// Request for creating a private connection.
3039#[derive(Clone, Default, PartialEq)]
3040#[non_exhaustive]
3041pub struct CreatePrivateConnectionRequest {
3042 /// Required. The parent that owns the collection of PrivateConnections.
3043 pub parent: std::string::String,
3044
3045 /// Required. The private connectivity identifier.
3046 pub private_connection_id: std::string::String,
3047
3048 /// Required. The Private Connectivity resource to create.
3049 pub private_connection: std::option::Option<crate::model::PrivateConnection>,
3050
3051 /// Optional. A request ID to identify requests. Specify a unique request ID
3052 /// so that if you must retry your request, the server will know to ignore
3053 /// the request if it has already been completed. The server will guarantee
3054 /// that for at least 60 minutes since the first request.
3055 ///
3056 /// For example, consider a situation where you make an initial request and the
3057 /// request times out. If you make the request again with the same request ID,
3058 /// the server can check if original operation with the same request ID was
3059 /// received, and if so, will ignore the second request. This prevents clients
3060 /// from accidentally creating duplicate commitments.
3061 ///
3062 /// The request ID must be a valid UUID with the exception that zero UUID is
3063 /// not supported (00000000-0000-0000-0000-000000000000).
3064 pub request_id: std::string::String,
3065
3066 /// Optional. If set to true, will skip validations.
3067 pub force: bool,
3068
3069 /// Optional. When supplied with PSC Interface config, will get/create the
3070 /// tenant project required for the customer to allow list and won't actually
3071 /// create the private connection.
3072 pub validate_only: bool,
3073
3074 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3075}
3076
3077impl CreatePrivateConnectionRequest {
3078 /// Creates a new default instance.
3079 pub fn new() -> Self {
3080 std::default::Default::default()
3081 }
3082
3083 /// Sets the value of [parent][crate::model::CreatePrivateConnectionRequest::parent].
3084 ///
3085 /// # Example
3086 /// ```ignore,no_run
3087 /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3088 /// # let project_id = "project_id";
3089 /// # let location_id = "location_id";
3090 /// let x = CreatePrivateConnectionRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3091 /// ```
3092 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3093 self.parent = v.into();
3094 self
3095 }
3096
3097 /// Sets the value of [private_connection_id][crate::model::CreatePrivateConnectionRequest::private_connection_id].
3098 ///
3099 /// # Example
3100 /// ```ignore,no_run
3101 /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3102 /// let x = CreatePrivateConnectionRequest::new().set_private_connection_id("example");
3103 /// ```
3104 pub fn set_private_connection_id<T: std::convert::Into<std::string::String>>(
3105 mut self,
3106 v: T,
3107 ) -> Self {
3108 self.private_connection_id = v.into();
3109 self
3110 }
3111
3112 /// Sets the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
3113 ///
3114 /// # Example
3115 /// ```ignore,no_run
3116 /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3117 /// use google_cloud_datastream_v1::model::PrivateConnection;
3118 /// let x = CreatePrivateConnectionRequest::new().set_private_connection(PrivateConnection::default()/* use setters */);
3119 /// ```
3120 pub fn set_private_connection<T>(mut self, v: T) -> Self
3121 where
3122 T: std::convert::Into<crate::model::PrivateConnection>,
3123 {
3124 self.private_connection = std::option::Option::Some(v.into());
3125 self
3126 }
3127
3128 /// Sets or clears the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
3129 ///
3130 /// # Example
3131 /// ```ignore,no_run
3132 /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3133 /// use google_cloud_datastream_v1::model::PrivateConnection;
3134 /// let x = CreatePrivateConnectionRequest::new().set_or_clear_private_connection(Some(PrivateConnection::default()/* use setters */));
3135 /// let x = CreatePrivateConnectionRequest::new().set_or_clear_private_connection(None::<PrivateConnection>);
3136 /// ```
3137 pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
3138 where
3139 T: std::convert::Into<crate::model::PrivateConnection>,
3140 {
3141 self.private_connection = v.map(|x| x.into());
3142 self
3143 }
3144
3145 /// Sets the value of [request_id][crate::model::CreatePrivateConnectionRequest::request_id].
3146 ///
3147 /// # Example
3148 /// ```ignore,no_run
3149 /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3150 /// let x = CreatePrivateConnectionRequest::new().set_request_id("example");
3151 /// ```
3152 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3153 self.request_id = v.into();
3154 self
3155 }
3156
3157 /// Sets the value of [force][crate::model::CreatePrivateConnectionRequest::force].
3158 ///
3159 /// # Example
3160 /// ```ignore,no_run
3161 /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3162 /// let x = CreatePrivateConnectionRequest::new().set_force(true);
3163 /// ```
3164 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3165 self.force = v.into();
3166 self
3167 }
3168
3169 /// Sets the value of [validate_only][crate::model::CreatePrivateConnectionRequest::validate_only].
3170 ///
3171 /// # Example
3172 /// ```ignore,no_run
3173 /// # use google_cloud_datastream_v1::model::CreatePrivateConnectionRequest;
3174 /// let x = CreatePrivateConnectionRequest::new().set_validate_only(true);
3175 /// ```
3176 pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3177 self.validate_only = v.into();
3178 self
3179 }
3180}
3181
3182impl wkt::message::Message for CreatePrivateConnectionRequest {
3183 fn typename() -> &'static str {
3184 "type.googleapis.com/google.cloud.datastream.v1.CreatePrivateConnectionRequest"
3185 }
3186}
3187
3188/// Request for listing private connections.
3189#[derive(Clone, Default, PartialEq)]
3190#[non_exhaustive]
3191pub struct ListPrivateConnectionsRequest {
3192 /// Required. The parent that owns the collection of private connectivity
3193 /// configurations.
3194 pub parent: std::string::String,
3195
3196 /// Maximum number of private connectivity configurations to return.
3197 /// If unspecified, at most 50 private connectivity configurations that will be
3198 /// returned. The maximum value is 1000; values above 1000 will be coerced to
3199 /// 1000.
3200 pub page_size: i32,
3201
3202 /// Page token received from a previous `ListPrivateConnections` call.
3203 /// Provide this to retrieve the subsequent page.
3204 ///
3205 /// When paginating, all other parameters provided to
3206 /// `ListPrivateConnections` must match the call that provided the page
3207 /// token.
3208 pub page_token: std::string::String,
3209
3210 /// Filter request.
3211 pub filter: std::string::String,
3212
3213 /// Order by fields for the result.
3214 pub order_by: std::string::String,
3215
3216 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3217}
3218
3219impl ListPrivateConnectionsRequest {
3220 /// Creates a new default instance.
3221 pub fn new() -> Self {
3222 std::default::Default::default()
3223 }
3224
3225 /// Sets the value of [parent][crate::model::ListPrivateConnectionsRequest::parent].
3226 ///
3227 /// # Example
3228 /// ```ignore,no_run
3229 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3230 /// # let project_id = "project_id";
3231 /// # let location_id = "location_id";
3232 /// let x = ListPrivateConnectionsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
3233 /// ```
3234 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3235 self.parent = v.into();
3236 self
3237 }
3238
3239 /// Sets the value of [page_size][crate::model::ListPrivateConnectionsRequest::page_size].
3240 ///
3241 /// # Example
3242 /// ```ignore,no_run
3243 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3244 /// let x = ListPrivateConnectionsRequest::new().set_page_size(42);
3245 /// ```
3246 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3247 self.page_size = v.into();
3248 self
3249 }
3250
3251 /// Sets the value of [page_token][crate::model::ListPrivateConnectionsRequest::page_token].
3252 ///
3253 /// # Example
3254 /// ```ignore,no_run
3255 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3256 /// let x = ListPrivateConnectionsRequest::new().set_page_token("example");
3257 /// ```
3258 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3259 self.page_token = v.into();
3260 self
3261 }
3262
3263 /// Sets the value of [filter][crate::model::ListPrivateConnectionsRequest::filter].
3264 ///
3265 /// # Example
3266 /// ```ignore,no_run
3267 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3268 /// let x = ListPrivateConnectionsRequest::new().set_filter("example");
3269 /// ```
3270 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3271 self.filter = v.into();
3272 self
3273 }
3274
3275 /// Sets the value of [order_by][crate::model::ListPrivateConnectionsRequest::order_by].
3276 ///
3277 /// # Example
3278 /// ```ignore,no_run
3279 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsRequest;
3280 /// let x = ListPrivateConnectionsRequest::new().set_order_by("example");
3281 /// ```
3282 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3283 self.order_by = v.into();
3284 self
3285 }
3286}
3287
3288impl wkt::message::Message for ListPrivateConnectionsRequest {
3289 fn typename() -> &'static str {
3290 "type.googleapis.com/google.cloud.datastream.v1.ListPrivateConnectionsRequest"
3291 }
3292}
3293
3294/// Response containing a list of private connection configurations.
3295#[derive(Clone, Default, PartialEq)]
3296#[non_exhaustive]
3297pub struct ListPrivateConnectionsResponse {
3298 /// List of private connectivity configurations.
3299 pub private_connections: std::vec::Vec<crate::model::PrivateConnection>,
3300
3301 /// A token, which can be sent as `page_token` to retrieve the next page.
3302 /// If this field is omitted, there are no subsequent pages.
3303 pub next_page_token: std::string::String,
3304
3305 /// Locations that could not be reached.
3306 pub unreachable: std::vec::Vec<std::string::String>,
3307
3308 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3309}
3310
3311impl ListPrivateConnectionsResponse {
3312 /// Creates a new default instance.
3313 pub fn new() -> Self {
3314 std::default::Default::default()
3315 }
3316
3317 /// Sets the value of [private_connections][crate::model::ListPrivateConnectionsResponse::private_connections].
3318 ///
3319 /// # Example
3320 /// ```ignore,no_run
3321 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsResponse;
3322 /// use google_cloud_datastream_v1::model::PrivateConnection;
3323 /// let x = ListPrivateConnectionsResponse::new()
3324 /// .set_private_connections([
3325 /// PrivateConnection::default()/* use setters */,
3326 /// PrivateConnection::default()/* use (different) setters */,
3327 /// ]);
3328 /// ```
3329 pub fn set_private_connections<T, V>(mut self, v: T) -> Self
3330 where
3331 T: std::iter::IntoIterator<Item = V>,
3332 V: std::convert::Into<crate::model::PrivateConnection>,
3333 {
3334 use std::iter::Iterator;
3335 self.private_connections = v.into_iter().map(|i| i.into()).collect();
3336 self
3337 }
3338
3339 /// Sets the value of [next_page_token][crate::model::ListPrivateConnectionsResponse::next_page_token].
3340 ///
3341 /// # Example
3342 /// ```ignore,no_run
3343 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsResponse;
3344 /// let x = ListPrivateConnectionsResponse::new().set_next_page_token("example");
3345 /// ```
3346 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3347 self.next_page_token = v.into();
3348 self
3349 }
3350
3351 /// Sets the value of [unreachable][crate::model::ListPrivateConnectionsResponse::unreachable].
3352 ///
3353 /// # Example
3354 /// ```ignore,no_run
3355 /// # use google_cloud_datastream_v1::model::ListPrivateConnectionsResponse;
3356 /// let x = ListPrivateConnectionsResponse::new().set_unreachable(["a", "b", "c"]);
3357 /// ```
3358 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3359 where
3360 T: std::iter::IntoIterator<Item = V>,
3361 V: std::convert::Into<std::string::String>,
3362 {
3363 use std::iter::Iterator;
3364 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3365 self
3366 }
3367}
3368
3369impl wkt::message::Message for ListPrivateConnectionsResponse {
3370 fn typename() -> &'static str {
3371 "type.googleapis.com/google.cloud.datastream.v1.ListPrivateConnectionsResponse"
3372 }
3373}
3374
3375#[doc(hidden)]
3376impl google_cloud_gax::paginator::internal::PageableResponse for ListPrivateConnectionsResponse {
3377 type PageItem = crate::model::PrivateConnection;
3378
3379 fn items(self) -> std::vec::Vec<Self::PageItem> {
3380 self.private_connections
3381 }
3382
3383 fn next_page_token(&self) -> std::string::String {
3384 use std::clone::Clone;
3385 self.next_page_token.clone()
3386 }
3387}
3388
3389/// Request to delete a private connection.
3390#[derive(Clone, Default, PartialEq)]
3391#[non_exhaustive]
3392pub struct DeletePrivateConnectionRequest {
3393 /// Required. The name of the private connectivity configuration to delete.
3394 pub name: std::string::String,
3395
3396 /// Optional. A request ID to identify requests. Specify a unique request ID
3397 /// so that if you must retry your request, the server will know to ignore
3398 /// the request if it has already been completed. The server will guarantee
3399 /// that for at least 60 minutes after the first request.
3400 ///
3401 /// For example, consider a situation where you make an initial request and the
3402 /// request times out. If you make the request again with the same request ID,
3403 /// the server can check if original operation with the same request ID was
3404 /// received, and if so, will ignore the second request. This prevents clients
3405 /// from accidentally creating duplicate commitments.
3406 ///
3407 /// The request ID must be a valid UUID with the exception that zero UUID is
3408 /// not supported (00000000-0000-0000-0000-000000000000).
3409 pub request_id: std::string::String,
3410
3411 /// Optional. If set to true, any child routes that belong to this
3412 /// PrivateConnection will also be deleted.
3413 pub force: bool,
3414
3415 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3416}
3417
3418impl DeletePrivateConnectionRequest {
3419 /// Creates a new default instance.
3420 pub fn new() -> Self {
3421 std::default::Default::default()
3422 }
3423
3424 /// Sets the value of [name][crate::model::DeletePrivateConnectionRequest::name].
3425 ///
3426 /// # Example
3427 /// ```ignore,no_run
3428 /// # use google_cloud_datastream_v1::model::DeletePrivateConnectionRequest;
3429 /// # let project_id = "project_id";
3430 /// # let location_id = "location_id";
3431 /// # let private_connection_id = "private_connection_id";
3432 /// let x = DeletePrivateConnectionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}"));
3433 /// ```
3434 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3435 self.name = v.into();
3436 self
3437 }
3438
3439 /// Sets the value of [request_id][crate::model::DeletePrivateConnectionRequest::request_id].
3440 ///
3441 /// # Example
3442 /// ```ignore,no_run
3443 /// # use google_cloud_datastream_v1::model::DeletePrivateConnectionRequest;
3444 /// let x = DeletePrivateConnectionRequest::new().set_request_id("example");
3445 /// ```
3446 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3447 self.request_id = v.into();
3448 self
3449 }
3450
3451 /// Sets the value of [force][crate::model::DeletePrivateConnectionRequest::force].
3452 ///
3453 /// # Example
3454 /// ```ignore,no_run
3455 /// # use google_cloud_datastream_v1::model::DeletePrivateConnectionRequest;
3456 /// let x = DeletePrivateConnectionRequest::new().set_force(true);
3457 /// ```
3458 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3459 self.force = v.into();
3460 self
3461 }
3462}
3463
3464impl wkt::message::Message for DeletePrivateConnectionRequest {
3465 fn typename() -> &'static str {
3466 "type.googleapis.com/google.cloud.datastream.v1.DeletePrivateConnectionRequest"
3467 }
3468}
3469
3470/// Request to get a private connection configuration.
3471#[derive(Clone, Default, PartialEq)]
3472#[non_exhaustive]
3473pub struct GetPrivateConnectionRequest {
3474 /// Required. The name of the private connectivity configuration to get.
3475 pub name: std::string::String,
3476
3477 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3478}
3479
3480impl GetPrivateConnectionRequest {
3481 /// Creates a new default instance.
3482 pub fn new() -> Self {
3483 std::default::Default::default()
3484 }
3485
3486 /// Sets the value of [name][crate::model::GetPrivateConnectionRequest::name].
3487 ///
3488 /// # Example
3489 /// ```ignore,no_run
3490 /// # use google_cloud_datastream_v1::model::GetPrivateConnectionRequest;
3491 /// # let project_id = "project_id";
3492 /// # let location_id = "location_id";
3493 /// # let private_connection_id = "private_connection_id";
3494 /// let x = GetPrivateConnectionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}"));
3495 /// ```
3496 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3497 self.name = v.into();
3498 self
3499 }
3500}
3501
3502impl wkt::message::Message for GetPrivateConnectionRequest {
3503 fn typename() -> &'static str {
3504 "type.googleapis.com/google.cloud.datastream.v1.GetPrivateConnectionRequest"
3505 }
3506}
3507
3508/// Route creation request.
3509#[derive(Clone, Default, PartialEq)]
3510#[non_exhaustive]
3511pub struct CreateRouteRequest {
3512 /// Required. The parent that owns the collection of Routes.
3513 pub parent: std::string::String,
3514
3515 /// Required. The Route identifier.
3516 pub route_id: std::string::String,
3517
3518 /// Required. The Route resource to create.
3519 pub route: std::option::Option<crate::model::Route>,
3520
3521 /// Optional. A request ID to identify requests. Specify a unique request ID
3522 /// so that if you must retry your request, the server will know to ignore
3523 /// the request if it has already been completed. The server will guarantee
3524 /// that for at least 60 minutes since the first request.
3525 ///
3526 /// For example, consider a situation where you make an initial request and the
3527 /// request times out. If you make the request again with the same request ID,
3528 /// the server can check if original operation with the same request ID was
3529 /// received, and if so, will ignore the second request. This prevents clients
3530 /// from accidentally creating duplicate commitments.
3531 ///
3532 /// The request ID must be a valid UUID with the exception that zero UUID is
3533 /// not supported (00000000-0000-0000-0000-000000000000).
3534 pub request_id: std::string::String,
3535
3536 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3537}
3538
3539impl CreateRouteRequest {
3540 /// Creates a new default instance.
3541 pub fn new() -> Self {
3542 std::default::Default::default()
3543 }
3544
3545 /// Sets the value of [parent][crate::model::CreateRouteRequest::parent].
3546 ///
3547 /// # Example
3548 /// ```ignore,no_run
3549 /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3550 /// # let project_id = "project_id";
3551 /// # let location_id = "location_id";
3552 /// # let private_connection_id = "private_connection_id";
3553 /// let x = CreateRouteRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}"));
3554 /// ```
3555 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3556 self.parent = v.into();
3557 self
3558 }
3559
3560 /// Sets the value of [route_id][crate::model::CreateRouteRequest::route_id].
3561 ///
3562 /// # Example
3563 /// ```ignore,no_run
3564 /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3565 /// let x = CreateRouteRequest::new().set_route_id("example");
3566 /// ```
3567 pub fn set_route_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3568 self.route_id = v.into();
3569 self
3570 }
3571
3572 /// Sets the value of [route][crate::model::CreateRouteRequest::route].
3573 ///
3574 /// # Example
3575 /// ```ignore,no_run
3576 /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3577 /// use google_cloud_datastream_v1::model::Route;
3578 /// let x = CreateRouteRequest::new().set_route(Route::default()/* use setters */);
3579 /// ```
3580 pub fn set_route<T>(mut self, v: T) -> Self
3581 where
3582 T: std::convert::Into<crate::model::Route>,
3583 {
3584 self.route = std::option::Option::Some(v.into());
3585 self
3586 }
3587
3588 /// Sets or clears the value of [route][crate::model::CreateRouteRequest::route].
3589 ///
3590 /// # Example
3591 /// ```ignore,no_run
3592 /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3593 /// use google_cloud_datastream_v1::model::Route;
3594 /// let x = CreateRouteRequest::new().set_or_clear_route(Some(Route::default()/* use setters */));
3595 /// let x = CreateRouteRequest::new().set_or_clear_route(None::<Route>);
3596 /// ```
3597 pub fn set_or_clear_route<T>(mut self, v: std::option::Option<T>) -> Self
3598 where
3599 T: std::convert::Into<crate::model::Route>,
3600 {
3601 self.route = v.map(|x| x.into());
3602 self
3603 }
3604
3605 /// Sets the value of [request_id][crate::model::CreateRouteRequest::request_id].
3606 ///
3607 /// # Example
3608 /// ```ignore,no_run
3609 /// # use google_cloud_datastream_v1::model::CreateRouteRequest;
3610 /// let x = CreateRouteRequest::new().set_request_id("example");
3611 /// ```
3612 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3613 self.request_id = v.into();
3614 self
3615 }
3616}
3617
3618impl wkt::message::Message for CreateRouteRequest {
3619 fn typename() -> &'static str {
3620 "type.googleapis.com/google.cloud.datastream.v1.CreateRouteRequest"
3621 }
3622}
3623
3624/// Route list request.
3625#[derive(Clone, Default, PartialEq)]
3626#[non_exhaustive]
3627pub struct ListRoutesRequest {
3628 /// Required. The parent that owns the collection of Routess.
3629 pub parent: std::string::String,
3630
3631 /// Maximum number of Routes to return. The service may return
3632 /// fewer than this value. If unspecified, at most 50 Routes
3633 /// will be returned. The maximum value is 1000; values above 1000 will be
3634 /// coerced to 1000.
3635 pub page_size: i32,
3636
3637 /// Page token received from a previous `ListRoutes` call.
3638 /// Provide this to retrieve the subsequent page.
3639 ///
3640 /// When paginating, all other parameters provided to
3641 /// `ListRoutes` must match the call that provided the page
3642 /// token.
3643 pub page_token: std::string::String,
3644
3645 /// Filter request.
3646 pub filter: std::string::String,
3647
3648 /// Order by fields for the result.
3649 pub order_by: std::string::String,
3650
3651 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3652}
3653
3654impl ListRoutesRequest {
3655 /// Creates a new default instance.
3656 pub fn new() -> Self {
3657 std::default::Default::default()
3658 }
3659
3660 /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
3661 ///
3662 /// # Example
3663 /// ```ignore,no_run
3664 /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3665 /// # let project_id = "project_id";
3666 /// # let location_id = "location_id";
3667 /// # let private_connection_id = "private_connection_id";
3668 /// let x = ListRoutesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}"));
3669 /// ```
3670 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3671 self.parent = v.into();
3672 self
3673 }
3674
3675 /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
3676 ///
3677 /// # Example
3678 /// ```ignore,no_run
3679 /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3680 /// let x = ListRoutesRequest::new().set_page_size(42);
3681 /// ```
3682 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3683 self.page_size = v.into();
3684 self
3685 }
3686
3687 /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
3688 ///
3689 /// # Example
3690 /// ```ignore,no_run
3691 /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3692 /// let x = ListRoutesRequest::new().set_page_token("example");
3693 /// ```
3694 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3695 self.page_token = v.into();
3696 self
3697 }
3698
3699 /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
3700 ///
3701 /// # Example
3702 /// ```ignore,no_run
3703 /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3704 /// let x = ListRoutesRequest::new().set_filter("example");
3705 /// ```
3706 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3707 self.filter = v.into();
3708 self
3709 }
3710
3711 /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
3712 ///
3713 /// # Example
3714 /// ```ignore,no_run
3715 /// # use google_cloud_datastream_v1::model::ListRoutesRequest;
3716 /// let x = ListRoutesRequest::new().set_order_by("example");
3717 /// ```
3718 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3719 self.order_by = v.into();
3720 self
3721 }
3722}
3723
3724impl wkt::message::Message for ListRoutesRequest {
3725 fn typename() -> &'static str {
3726 "type.googleapis.com/google.cloud.datastream.v1.ListRoutesRequest"
3727 }
3728}
3729
3730/// Route list response.
3731#[derive(Clone, Default, PartialEq)]
3732#[non_exhaustive]
3733pub struct ListRoutesResponse {
3734 /// List of Routes.
3735 pub routes: std::vec::Vec<crate::model::Route>,
3736
3737 /// A token, which can be sent as `page_token` to retrieve the next page.
3738 /// If this field is omitted, there are no subsequent pages.
3739 pub next_page_token: std::string::String,
3740
3741 /// Locations that could not be reached.
3742 pub unreachable: std::vec::Vec<std::string::String>,
3743
3744 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3745}
3746
3747impl ListRoutesResponse {
3748 /// Creates a new default instance.
3749 pub fn new() -> Self {
3750 std::default::Default::default()
3751 }
3752
3753 /// Sets the value of [routes][crate::model::ListRoutesResponse::routes].
3754 ///
3755 /// # Example
3756 /// ```ignore,no_run
3757 /// # use google_cloud_datastream_v1::model::ListRoutesResponse;
3758 /// use google_cloud_datastream_v1::model::Route;
3759 /// let x = ListRoutesResponse::new()
3760 /// .set_routes([
3761 /// Route::default()/* use setters */,
3762 /// Route::default()/* use (different) setters */,
3763 /// ]);
3764 /// ```
3765 pub fn set_routes<T, V>(mut self, v: T) -> Self
3766 where
3767 T: std::iter::IntoIterator<Item = V>,
3768 V: std::convert::Into<crate::model::Route>,
3769 {
3770 use std::iter::Iterator;
3771 self.routes = v.into_iter().map(|i| i.into()).collect();
3772 self
3773 }
3774
3775 /// Sets the value of [next_page_token][crate::model::ListRoutesResponse::next_page_token].
3776 ///
3777 /// # Example
3778 /// ```ignore,no_run
3779 /// # use google_cloud_datastream_v1::model::ListRoutesResponse;
3780 /// let x = ListRoutesResponse::new().set_next_page_token("example");
3781 /// ```
3782 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3783 self.next_page_token = v.into();
3784 self
3785 }
3786
3787 /// Sets the value of [unreachable][crate::model::ListRoutesResponse::unreachable].
3788 ///
3789 /// # Example
3790 /// ```ignore,no_run
3791 /// # use google_cloud_datastream_v1::model::ListRoutesResponse;
3792 /// let x = ListRoutesResponse::new().set_unreachable(["a", "b", "c"]);
3793 /// ```
3794 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3795 where
3796 T: std::iter::IntoIterator<Item = V>,
3797 V: std::convert::Into<std::string::String>,
3798 {
3799 use std::iter::Iterator;
3800 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3801 self
3802 }
3803}
3804
3805impl wkt::message::Message for ListRoutesResponse {
3806 fn typename() -> &'static str {
3807 "type.googleapis.com/google.cloud.datastream.v1.ListRoutesResponse"
3808 }
3809}
3810
3811#[doc(hidden)]
3812impl google_cloud_gax::paginator::internal::PageableResponse for ListRoutesResponse {
3813 type PageItem = crate::model::Route;
3814
3815 fn items(self) -> std::vec::Vec<Self::PageItem> {
3816 self.routes
3817 }
3818
3819 fn next_page_token(&self) -> std::string::String {
3820 use std::clone::Clone;
3821 self.next_page_token.clone()
3822 }
3823}
3824
3825/// Route deletion request.
3826#[derive(Clone, Default, PartialEq)]
3827#[non_exhaustive]
3828pub struct DeleteRouteRequest {
3829 /// Required. The name of the Route resource to delete.
3830 pub name: std::string::String,
3831
3832 /// Optional. A request ID to identify requests. Specify a unique request ID
3833 /// so that if you must retry your request, the server will know to ignore
3834 /// the request if it has already been completed. The server will guarantee
3835 /// that for at least 60 minutes after the first request.
3836 ///
3837 /// For example, consider a situation where you make an initial request and the
3838 /// request times out. If you make the request again with the same request ID,
3839 /// the server can check if original operation with the same request ID was
3840 /// received, and if so, will ignore the second request. This prevents clients
3841 /// from accidentally creating duplicate commitments.
3842 ///
3843 /// The request ID must be a valid UUID with the exception that zero UUID is
3844 /// not supported (00000000-0000-0000-0000-000000000000).
3845 pub request_id: std::string::String,
3846
3847 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3848}
3849
3850impl DeleteRouteRequest {
3851 /// Creates a new default instance.
3852 pub fn new() -> Self {
3853 std::default::Default::default()
3854 }
3855
3856 /// Sets the value of [name][crate::model::DeleteRouteRequest::name].
3857 ///
3858 /// # Example
3859 /// ```ignore,no_run
3860 /// # use google_cloud_datastream_v1::model::DeleteRouteRequest;
3861 /// # let project_id = "project_id";
3862 /// # let location_id = "location_id";
3863 /// # let private_connection_id = "private_connection_id";
3864 /// # let route_id = "route_id";
3865 /// let x = DeleteRouteRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}/routes/{route_id}"));
3866 /// ```
3867 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3868 self.name = v.into();
3869 self
3870 }
3871
3872 /// Sets the value of [request_id][crate::model::DeleteRouteRequest::request_id].
3873 ///
3874 /// # Example
3875 /// ```ignore,no_run
3876 /// # use google_cloud_datastream_v1::model::DeleteRouteRequest;
3877 /// let x = DeleteRouteRequest::new().set_request_id("example");
3878 /// ```
3879 pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3880 self.request_id = v.into();
3881 self
3882 }
3883}
3884
3885impl wkt::message::Message for DeleteRouteRequest {
3886 fn typename() -> &'static str {
3887 "type.googleapis.com/google.cloud.datastream.v1.DeleteRouteRequest"
3888 }
3889}
3890
3891/// Route get request.
3892#[derive(Clone, Default, PartialEq)]
3893#[non_exhaustive]
3894pub struct GetRouteRequest {
3895 /// Required. The name of the Route resource to get.
3896 pub name: std::string::String,
3897
3898 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3899}
3900
3901impl GetRouteRequest {
3902 /// Creates a new default instance.
3903 pub fn new() -> Self {
3904 std::default::Default::default()
3905 }
3906
3907 /// Sets the value of [name][crate::model::GetRouteRequest::name].
3908 ///
3909 /// # Example
3910 /// ```ignore,no_run
3911 /// # use google_cloud_datastream_v1::model::GetRouteRequest;
3912 /// # let project_id = "project_id";
3913 /// # let location_id = "location_id";
3914 /// # let private_connection_id = "private_connection_id";
3915 /// # let route_id = "route_id";
3916 /// let x = GetRouteRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}/routes/{route_id}"));
3917 /// ```
3918 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3919 self.name = v.into();
3920 self
3921 }
3922}
3923
3924impl wkt::message::Message for GetRouteRequest {
3925 fn typename() -> &'static str {
3926 "type.googleapis.com/google.cloud.datastream.v1.GetRouteRequest"
3927 }
3928}
3929
3930/// Oracle database profile.
3931#[derive(Clone, Default, PartialEq)]
3932#[non_exhaustive]
3933pub struct OracleProfile {
3934 /// Required. Hostname for the Oracle connection.
3935 pub hostname: std::string::String,
3936
3937 /// Port for the Oracle connection, default value is 1521.
3938 pub port: i32,
3939
3940 /// Required. Username for the Oracle connection.
3941 pub username: std::string::String,
3942
3943 /// Optional. Password for the Oracle connection. Mutually exclusive with the
3944 /// `secret_manager_stored_password` field.
3945 pub password: std::string::String,
3946
3947 /// Required. Database for the Oracle connection.
3948 pub database_service: std::string::String,
3949
3950 /// Connection string attributes
3951 pub connection_attributes: std::collections::HashMap<std::string::String, std::string::String>,
3952
3953 /// Optional. SSL configuration for the Oracle connection.
3954 pub oracle_ssl_config: std::option::Option<crate::model::OracleSslConfig>,
3955
3956 /// Optional. Configuration for Oracle ASM connection.
3957 pub oracle_asm_config: std::option::Option<crate::model::OracleAsmConfig>,
3958
3959 /// Optional. A reference to a Secret Manager resource name storing the Oracle
3960 /// connection password. Mutually exclusive with the `password` field.
3961 pub secret_manager_stored_password: std::string::String,
3962
3963 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3964}
3965
3966impl OracleProfile {
3967 /// Creates a new default instance.
3968 pub fn new() -> Self {
3969 std::default::Default::default()
3970 }
3971
3972 /// Sets the value of [hostname][crate::model::OracleProfile::hostname].
3973 ///
3974 /// # Example
3975 /// ```ignore,no_run
3976 /// # use google_cloud_datastream_v1::model::OracleProfile;
3977 /// let x = OracleProfile::new().set_hostname("example");
3978 /// ```
3979 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3980 self.hostname = v.into();
3981 self
3982 }
3983
3984 /// Sets the value of [port][crate::model::OracleProfile::port].
3985 ///
3986 /// # Example
3987 /// ```ignore,no_run
3988 /// # use google_cloud_datastream_v1::model::OracleProfile;
3989 /// let x = OracleProfile::new().set_port(42);
3990 /// ```
3991 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3992 self.port = v.into();
3993 self
3994 }
3995
3996 /// Sets the value of [username][crate::model::OracleProfile::username].
3997 ///
3998 /// # Example
3999 /// ```ignore,no_run
4000 /// # use google_cloud_datastream_v1::model::OracleProfile;
4001 /// let x = OracleProfile::new().set_username("example");
4002 /// ```
4003 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4004 self.username = v.into();
4005 self
4006 }
4007
4008 /// Sets the value of [password][crate::model::OracleProfile::password].
4009 ///
4010 /// # Example
4011 /// ```ignore,no_run
4012 /// # use google_cloud_datastream_v1::model::OracleProfile;
4013 /// let x = OracleProfile::new().set_password("example");
4014 /// ```
4015 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4016 self.password = v.into();
4017 self
4018 }
4019
4020 /// Sets the value of [database_service][crate::model::OracleProfile::database_service].
4021 ///
4022 /// # Example
4023 /// ```ignore,no_run
4024 /// # use google_cloud_datastream_v1::model::OracleProfile;
4025 /// let x = OracleProfile::new().set_database_service("example");
4026 /// ```
4027 pub fn set_database_service<T: std::convert::Into<std::string::String>>(
4028 mut self,
4029 v: T,
4030 ) -> Self {
4031 self.database_service = v.into();
4032 self
4033 }
4034
4035 /// Sets the value of [connection_attributes][crate::model::OracleProfile::connection_attributes].
4036 ///
4037 /// # Example
4038 /// ```ignore,no_run
4039 /// # use google_cloud_datastream_v1::model::OracleProfile;
4040 /// let x = OracleProfile::new().set_connection_attributes([
4041 /// ("key0", "abc"),
4042 /// ("key1", "xyz"),
4043 /// ]);
4044 /// ```
4045 pub fn set_connection_attributes<T, K, V>(mut self, v: T) -> Self
4046 where
4047 T: std::iter::IntoIterator<Item = (K, V)>,
4048 K: std::convert::Into<std::string::String>,
4049 V: std::convert::Into<std::string::String>,
4050 {
4051 use std::iter::Iterator;
4052 self.connection_attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4053 self
4054 }
4055
4056 /// Sets the value of [oracle_ssl_config][crate::model::OracleProfile::oracle_ssl_config].
4057 ///
4058 /// # Example
4059 /// ```ignore,no_run
4060 /// # use google_cloud_datastream_v1::model::OracleProfile;
4061 /// use google_cloud_datastream_v1::model::OracleSslConfig;
4062 /// let x = OracleProfile::new().set_oracle_ssl_config(OracleSslConfig::default()/* use setters */);
4063 /// ```
4064 pub fn set_oracle_ssl_config<T>(mut self, v: T) -> Self
4065 where
4066 T: std::convert::Into<crate::model::OracleSslConfig>,
4067 {
4068 self.oracle_ssl_config = std::option::Option::Some(v.into());
4069 self
4070 }
4071
4072 /// Sets or clears the value of [oracle_ssl_config][crate::model::OracleProfile::oracle_ssl_config].
4073 ///
4074 /// # Example
4075 /// ```ignore,no_run
4076 /// # use google_cloud_datastream_v1::model::OracleProfile;
4077 /// use google_cloud_datastream_v1::model::OracleSslConfig;
4078 /// let x = OracleProfile::new().set_or_clear_oracle_ssl_config(Some(OracleSslConfig::default()/* use setters */));
4079 /// let x = OracleProfile::new().set_or_clear_oracle_ssl_config(None::<OracleSslConfig>);
4080 /// ```
4081 pub fn set_or_clear_oracle_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
4082 where
4083 T: std::convert::Into<crate::model::OracleSslConfig>,
4084 {
4085 self.oracle_ssl_config = v.map(|x| x.into());
4086 self
4087 }
4088
4089 /// Sets the value of [oracle_asm_config][crate::model::OracleProfile::oracle_asm_config].
4090 ///
4091 /// # Example
4092 /// ```ignore,no_run
4093 /// # use google_cloud_datastream_v1::model::OracleProfile;
4094 /// use google_cloud_datastream_v1::model::OracleAsmConfig;
4095 /// let x = OracleProfile::new().set_oracle_asm_config(OracleAsmConfig::default()/* use setters */);
4096 /// ```
4097 pub fn set_oracle_asm_config<T>(mut self, v: T) -> Self
4098 where
4099 T: std::convert::Into<crate::model::OracleAsmConfig>,
4100 {
4101 self.oracle_asm_config = std::option::Option::Some(v.into());
4102 self
4103 }
4104
4105 /// Sets or clears the value of [oracle_asm_config][crate::model::OracleProfile::oracle_asm_config].
4106 ///
4107 /// # Example
4108 /// ```ignore,no_run
4109 /// # use google_cloud_datastream_v1::model::OracleProfile;
4110 /// use google_cloud_datastream_v1::model::OracleAsmConfig;
4111 /// let x = OracleProfile::new().set_or_clear_oracle_asm_config(Some(OracleAsmConfig::default()/* use setters */));
4112 /// let x = OracleProfile::new().set_or_clear_oracle_asm_config(None::<OracleAsmConfig>);
4113 /// ```
4114 pub fn set_or_clear_oracle_asm_config<T>(mut self, v: std::option::Option<T>) -> Self
4115 where
4116 T: std::convert::Into<crate::model::OracleAsmConfig>,
4117 {
4118 self.oracle_asm_config = v.map(|x| x.into());
4119 self
4120 }
4121
4122 /// Sets the value of [secret_manager_stored_password][crate::model::OracleProfile::secret_manager_stored_password].
4123 ///
4124 /// # Example
4125 /// ```ignore,no_run
4126 /// # use google_cloud_datastream_v1::model::OracleProfile;
4127 /// let x = OracleProfile::new().set_secret_manager_stored_password("example");
4128 /// ```
4129 pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4130 mut self,
4131 v: T,
4132 ) -> Self {
4133 self.secret_manager_stored_password = v.into();
4134 self
4135 }
4136}
4137
4138impl wkt::message::Message for OracleProfile {
4139 fn typename() -> &'static str {
4140 "type.googleapis.com/google.cloud.datastream.v1.OracleProfile"
4141 }
4142}
4143
4144/// Configuration for Oracle Automatic Storage Management (ASM) connection.
4145#[derive(Clone, Default, PartialEq)]
4146#[non_exhaustive]
4147pub struct OracleAsmConfig {
4148 /// Required. Hostname for the Oracle ASM connection.
4149 pub hostname: std::string::String,
4150
4151 /// Required. Port for the Oracle ASM connection.
4152 pub port: i32,
4153
4154 /// Required. Username for the Oracle ASM connection.
4155 pub username: std::string::String,
4156
4157 /// Optional. Password for the Oracle ASM connection. Mutually exclusive with
4158 /// the `secret_manager_stored_password` field.
4159 pub password: std::string::String,
4160
4161 /// Required. ASM service name for the Oracle ASM connection.
4162 pub asm_service: std::string::String,
4163
4164 /// Optional. Connection string attributes
4165 pub connection_attributes: std::collections::HashMap<std::string::String, std::string::String>,
4166
4167 /// Optional. SSL configuration for the Oracle connection.
4168 pub oracle_ssl_config: std::option::Option<crate::model::OracleSslConfig>,
4169
4170 /// Optional. A reference to a Secret Manager resource name storing the Oracle
4171 /// ASM connection password. Mutually exclusive with the `password` field.
4172 pub secret_manager_stored_password: std::string::String,
4173
4174 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4175}
4176
4177impl OracleAsmConfig {
4178 /// Creates a new default instance.
4179 pub fn new() -> Self {
4180 std::default::Default::default()
4181 }
4182
4183 /// Sets the value of [hostname][crate::model::OracleAsmConfig::hostname].
4184 ///
4185 /// # Example
4186 /// ```ignore,no_run
4187 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4188 /// let x = OracleAsmConfig::new().set_hostname("example");
4189 /// ```
4190 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4191 self.hostname = v.into();
4192 self
4193 }
4194
4195 /// Sets the value of [port][crate::model::OracleAsmConfig::port].
4196 ///
4197 /// # Example
4198 /// ```ignore,no_run
4199 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4200 /// let x = OracleAsmConfig::new().set_port(42);
4201 /// ```
4202 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4203 self.port = v.into();
4204 self
4205 }
4206
4207 /// Sets the value of [username][crate::model::OracleAsmConfig::username].
4208 ///
4209 /// # Example
4210 /// ```ignore,no_run
4211 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4212 /// let x = OracleAsmConfig::new().set_username("example");
4213 /// ```
4214 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4215 self.username = v.into();
4216 self
4217 }
4218
4219 /// Sets the value of [password][crate::model::OracleAsmConfig::password].
4220 ///
4221 /// # Example
4222 /// ```ignore,no_run
4223 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4224 /// let x = OracleAsmConfig::new().set_password("example");
4225 /// ```
4226 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4227 self.password = v.into();
4228 self
4229 }
4230
4231 /// Sets the value of [asm_service][crate::model::OracleAsmConfig::asm_service].
4232 ///
4233 /// # Example
4234 /// ```ignore,no_run
4235 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4236 /// let x = OracleAsmConfig::new().set_asm_service("example");
4237 /// ```
4238 pub fn set_asm_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4239 self.asm_service = v.into();
4240 self
4241 }
4242
4243 /// Sets the value of [connection_attributes][crate::model::OracleAsmConfig::connection_attributes].
4244 ///
4245 /// # Example
4246 /// ```ignore,no_run
4247 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4248 /// let x = OracleAsmConfig::new().set_connection_attributes([
4249 /// ("key0", "abc"),
4250 /// ("key1", "xyz"),
4251 /// ]);
4252 /// ```
4253 pub fn set_connection_attributes<T, K, V>(mut self, v: T) -> Self
4254 where
4255 T: std::iter::IntoIterator<Item = (K, V)>,
4256 K: std::convert::Into<std::string::String>,
4257 V: std::convert::Into<std::string::String>,
4258 {
4259 use std::iter::Iterator;
4260 self.connection_attributes = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4261 self
4262 }
4263
4264 /// Sets the value of [oracle_ssl_config][crate::model::OracleAsmConfig::oracle_ssl_config].
4265 ///
4266 /// # Example
4267 /// ```ignore,no_run
4268 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4269 /// use google_cloud_datastream_v1::model::OracleSslConfig;
4270 /// let x = OracleAsmConfig::new().set_oracle_ssl_config(OracleSslConfig::default()/* use setters */);
4271 /// ```
4272 pub fn set_oracle_ssl_config<T>(mut self, v: T) -> Self
4273 where
4274 T: std::convert::Into<crate::model::OracleSslConfig>,
4275 {
4276 self.oracle_ssl_config = std::option::Option::Some(v.into());
4277 self
4278 }
4279
4280 /// Sets or clears the value of [oracle_ssl_config][crate::model::OracleAsmConfig::oracle_ssl_config].
4281 ///
4282 /// # Example
4283 /// ```ignore,no_run
4284 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4285 /// use google_cloud_datastream_v1::model::OracleSslConfig;
4286 /// let x = OracleAsmConfig::new().set_or_clear_oracle_ssl_config(Some(OracleSslConfig::default()/* use setters */));
4287 /// let x = OracleAsmConfig::new().set_or_clear_oracle_ssl_config(None::<OracleSslConfig>);
4288 /// ```
4289 pub fn set_or_clear_oracle_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
4290 where
4291 T: std::convert::Into<crate::model::OracleSslConfig>,
4292 {
4293 self.oracle_ssl_config = v.map(|x| x.into());
4294 self
4295 }
4296
4297 /// Sets the value of [secret_manager_stored_password][crate::model::OracleAsmConfig::secret_manager_stored_password].
4298 ///
4299 /// # Example
4300 /// ```ignore,no_run
4301 /// # use google_cloud_datastream_v1::model::OracleAsmConfig;
4302 /// let x = OracleAsmConfig::new().set_secret_manager_stored_password("example");
4303 /// ```
4304 pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4305 mut self,
4306 v: T,
4307 ) -> Self {
4308 self.secret_manager_stored_password = v.into();
4309 self
4310 }
4311}
4312
4313impl wkt::message::Message for OracleAsmConfig {
4314 fn typename() -> &'static str {
4315 "type.googleapis.com/google.cloud.datastream.v1.OracleAsmConfig"
4316 }
4317}
4318
4319/// MySQL database profile.
4320#[derive(Clone, Default, PartialEq)]
4321#[non_exhaustive]
4322pub struct MysqlProfile {
4323 /// Required. Hostname for the MySQL connection.
4324 pub hostname: std::string::String,
4325
4326 /// Port for the MySQL connection, default value is 3306.
4327 pub port: i32,
4328
4329 /// Required. Username for the MySQL connection.
4330 pub username: std::string::String,
4331
4332 /// Optional. Input only. Password for the MySQL connection. Mutually exclusive
4333 /// with the `secret_manager_stored_password` field.
4334 pub password: std::string::String,
4335
4336 /// SSL configuration for the MySQL connection.
4337 pub ssl_config: std::option::Option<crate::model::MysqlSslConfig>,
4338
4339 /// Optional. A reference to a Secret Manager resource name storing the MySQL
4340 /// connection password. Mutually exclusive with the `password` field.
4341 pub secret_manager_stored_password: std::string::String,
4342
4343 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4344}
4345
4346impl MysqlProfile {
4347 /// Creates a new default instance.
4348 pub fn new() -> Self {
4349 std::default::Default::default()
4350 }
4351
4352 /// Sets the value of [hostname][crate::model::MysqlProfile::hostname].
4353 ///
4354 /// # Example
4355 /// ```ignore,no_run
4356 /// # use google_cloud_datastream_v1::model::MysqlProfile;
4357 /// let x = MysqlProfile::new().set_hostname("example");
4358 /// ```
4359 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4360 self.hostname = v.into();
4361 self
4362 }
4363
4364 /// Sets the value of [port][crate::model::MysqlProfile::port].
4365 ///
4366 /// # Example
4367 /// ```ignore,no_run
4368 /// # use google_cloud_datastream_v1::model::MysqlProfile;
4369 /// let x = MysqlProfile::new().set_port(42);
4370 /// ```
4371 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4372 self.port = v.into();
4373 self
4374 }
4375
4376 /// Sets the value of [username][crate::model::MysqlProfile::username].
4377 ///
4378 /// # Example
4379 /// ```ignore,no_run
4380 /// # use google_cloud_datastream_v1::model::MysqlProfile;
4381 /// let x = MysqlProfile::new().set_username("example");
4382 /// ```
4383 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4384 self.username = v.into();
4385 self
4386 }
4387
4388 /// Sets the value of [password][crate::model::MysqlProfile::password].
4389 ///
4390 /// # Example
4391 /// ```ignore,no_run
4392 /// # use google_cloud_datastream_v1::model::MysqlProfile;
4393 /// let x = MysqlProfile::new().set_password("example");
4394 /// ```
4395 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4396 self.password = v.into();
4397 self
4398 }
4399
4400 /// Sets the value of [ssl_config][crate::model::MysqlProfile::ssl_config].
4401 ///
4402 /// # Example
4403 /// ```ignore,no_run
4404 /// # use google_cloud_datastream_v1::model::MysqlProfile;
4405 /// use google_cloud_datastream_v1::model::MysqlSslConfig;
4406 /// let x = MysqlProfile::new().set_ssl_config(MysqlSslConfig::default()/* use setters */);
4407 /// ```
4408 pub fn set_ssl_config<T>(mut self, v: T) -> Self
4409 where
4410 T: std::convert::Into<crate::model::MysqlSslConfig>,
4411 {
4412 self.ssl_config = std::option::Option::Some(v.into());
4413 self
4414 }
4415
4416 /// Sets or clears the value of [ssl_config][crate::model::MysqlProfile::ssl_config].
4417 ///
4418 /// # Example
4419 /// ```ignore,no_run
4420 /// # use google_cloud_datastream_v1::model::MysqlProfile;
4421 /// use google_cloud_datastream_v1::model::MysqlSslConfig;
4422 /// let x = MysqlProfile::new().set_or_clear_ssl_config(Some(MysqlSslConfig::default()/* use setters */));
4423 /// let x = MysqlProfile::new().set_or_clear_ssl_config(None::<MysqlSslConfig>);
4424 /// ```
4425 pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
4426 where
4427 T: std::convert::Into<crate::model::MysqlSslConfig>,
4428 {
4429 self.ssl_config = v.map(|x| x.into());
4430 self
4431 }
4432
4433 /// Sets the value of [secret_manager_stored_password][crate::model::MysqlProfile::secret_manager_stored_password].
4434 ///
4435 /// # Example
4436 /// ```ignore,no_run
4437 /// # use google_cloud_datastream_v1::model::MysqlProfile;
4438 /// let x = MysqlProfile::new().set_secret_manager_stored_password("example");
4439 /// ```
4440 pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4441 mut self,
4442 v: T,
4443 ) -> Self {
4444 self.secret_manager_stored_password = v.into();
4445 self
4446 }
4447}
4448
4449impl wkt::message::Message for MysqlProfile {
4450 fn typename() -> &'static str {
4451 "type.googleapis.com/google.cloud.datastream.v1.MysqlProfile"
4452 }
4453}
4454
4455/// PostgreSQL database profile.
4456#[derive(Clone, Default, PartialEq)]
4457#[non_exhaustive]
4458pub struct PostgresqlProfile {
4459 /// Required. Hostname for the PostgreSQL connection.
4460 pub hostname: std::string::String,
4461
4462 /// Port for the PostgreSQL connection, default value is 5432.
4463 pub port: i32,
4464
4465 /// Required. Username for the PostgreSQL connection.
4466 pub username: std::string::String,
4467
4468 /// Optional. Password for the PostgreSQL connection. Mutually exclusive with
4469 /// the `secret_manager_stored_password` field.
4470 pub password: std::string::String,
4471
4472 /// Required. Database for the PostgreSQL connection.
4473 pub database: std::string::String,
4474
4475 /// Optional. A reference to a Secret Manager resource name storing the
4476 /// PostgreSQL connection password. Mutually exclusive with the `password`
4477 /// field.
4478 pub secret_manager_stored_password: std::string::String,
4479
4480 /// Optional. SSL configuration for the PostgreSQL connection.
4481 /// In case PostgresqlSslConfig is not set, the connection will use the default
4482 /// SSL mode, which is `prefer` (i.e. this mode will only use encryption if
4483 /// enabled from database side, otherwise will use unencrypted communication)
4484 pub ssl_config: std::option::Option<crate::model::PostgresqlSslConfig>,
4485
4486 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4487}
4488
4489impl PostgresqlProfile {
4490 /// Creates a new default instance.
4491 pub fn new() -> Self {
4492 std::default::Default::default()
4493 }
4494
4495 /// Sets the value of [hostname][crate::model::PostgresqlProfile::hostname].
4496 ///
4497 /// # Example
4498 /// ```ignore,no_run
4499 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4500 /// let x = PostgresqlProfile::new().set_hostname("example");
4501 /// ```
4502 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4503 self.hostname = v.into();
4504 self
4505 }
4506
4507 /// Sets the value of [port][crate::model::PostgresqlProfile::port].
4508 ///
4509 /// # Example
4510 /// ```ignore,no_run
4511 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4512 /// let x = PostgresqlProfile::new().set_port(42);
4513 /// ```
4514 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4515 self.port = v.into();
4516 self
4517 }
4518
4519 /// Sets the value of [username][crate::model::PostgresqlProfile::username].
4520 ///
4521 /// # Example
4522 /// ```ignore,no_run
4523 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4524 /// let x = PostgresqlProfile::new().set_username("example");
4525 /// ```
4526 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4527 self.username = v.into();
4528 self
4529 }
4530
4531 /// Sets the value of [password][crate::model::PostgresqlProfile::password].
4532 ///
4533 /// # Example
4534 /// ```ignore,no_run
4535 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4536 /// let x = PostgresqlProfile::new().set_password("example");
4537 /// ```
4538 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4539 self.password = v.into();
4540 self
4541 }
4542
4543 /// Sets the value of [database][crate::model::PostgresqlProfile::database].
4544 ///
4545 /// # Example
4546 /// ```ignore,no_run
4547 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4548 /// let x = PostgresqlProfile::new().set_database("example");
4549 /// ```
4550 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4551 self.database = v.into();
4552 self
4553 }
4554
4555 /// Sets the value of [secret_manager_stored_password][crate::model::PostgresqlProfile::secret_manager_stored_password].
4556 ///
4557 /// # Example
4558 /// ```ignore,no_run
4559 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4560 /// let x = PostgresqlProfile::new().set_secret_manager_stored_password("example");
4561 /// ```
4562 pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4563 mut self,
4564 v: T,
4565 ) -> Self {
4566 self.secret_manager_stored_password = v.into();
4567 self
4568 }
4569
4570 /// Sets the value of [ssl_config][crate::model::PostgresqlProfile::ssl_config].
4571 ///
4572 /// # Example
4573 /// ```ignore,no_run
4574 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4575 /// use google_cloud_datastream_v1::model::PostgresqlSslConfig;
4576 /// let x = PostgresqlProfile::new().set_ssl_config(PostgresqlSslConfig::default()/* use setters */);
4577 /// ```
4578 pub fn set_ssl_config<T>(mut self, v: T) -> Self
4579 where
4580 T: std::convert::Into<crate::model::PostgresqlSslConfig>,
4581 {
4582 self.ssl_config = std::option::Option::Some(v.into());
4583 self
4584 }
4585
4586 /// Sets or clears the value of [ssl_config][crate::model::PostgresqlProfile::ssl_config].
4587 ///
4588 /// # Example
4589 /// ```ignore,no_run
4590 /// # use google_cloud_datastream_v1::model::PostgresqlProfile;
4591 /// use google_cloud_datastream_v1::model::PostgresqlSslConfig;
4592 /// let x = PostgresqlProfile::new().set_or_clear_ssl_config(Some(PostgresqlSslConfig::default()/* use setters */));
4593 /// let x = PostgresqlProfile::new().set_or_clear_ssl_config(None::<PostgresqlSslConfig>);
4594 /// ```
4595 pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
4596 where
4597 T: std::convert::Into<crate::model::PostgresqlSslConfig>,
4598 {
4599 self.ssl_config = v.map(|x| x.into());
4600 self
4601 }
4602}
4603
4604impl wkt::message::Message for PostgresqlProfile {
4605 fn typename() -> &'static str {
4606 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlProfile"
4607 }
4608}
4609
4610/// SQLServer database profile.
4611#[derive(Clone, Default, PartialEq)]
4612#[non_exhaustive]
4613pub struct SqlServerProfile {
4614 /// Required. Hostname for the SQLServer connection.
4615 pub hostname: std::string::String,
4616
4617 /// Port for the SQLServer connection, default value is 1433.
4618 pub port: i32,
4619
4620 /// Required. Username for the SQLServer connection.
4621 pub username: std::string::String,
4622
4623 /// Optional. Password for the SQLServer connection. Mutually exclusive with
4624 /// the `secret_manager_stored_password` field.
4625 pub password: std::string::String,
4626
4627 /// Required. Database for the SQLServer connection.
4628 pub database: std::string::String,
4629
4630 /// Optional. A reference to a Secret Manager resource name storing the
4631 /// SQLServer connection password. Mutually exclusive with the `password`
4632 /// field.
4633 pub secret_manager_stored_password: std::string::String,
4634
4635 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4636}
4637
4638impl SqlServerProfile {
4639 /// Creates a new default instance.
4640 pub fn new() -> Self {
4641 std::default::Default::default()
4642 }
4643
4644 /// Sets the value of [hostname][crate::model::SqlServerProfile::hostname].
4645 ///
4646 /// # Example
4647 /// ```ignore,no_run
4648 /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4649 /// let x = SqlServerProfile::new().set_hostname("example");
4650 /// ```
4651 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4652 self.hostname = v.into();
4653 self
4654 }
4655
4656 /// Sets the value of [port][crate::model::SqlServerProfile::port].
4657 ///
4658 /// # Example
4659 /// ```ignore,no_run
4660 /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4661 /// let x = SqlServerProfile::new().set_port(42);
4662 /// ```
4663 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4664 self.port = v.into();
4665 self
4666 }
4667
4668 /// Sets the value of [username][crate::model::SqlServerProfile::username].
4669 ///
4670 /// # Example
4671 /// ```ignore,no_run
4672 /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4673 /// let x = SqlServerProfile::new().set_username("example");
4674 /// ```
4675 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4676 self.username = v.into();
4677 self
4678 }
4679
4680 /// Sets the value of [password][crate::model::SqlServerProfile::password].
4681 ///
4682 /// # Example
4683 /// ```ignore,no_run
4684 /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4685 /// let x = SqlServerProfile::new().set_password("example");
4686 /// ```
4687 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4688 self.password = v.into();
4689 self
4690 }
4691
4692 /// Sets the value of [database][crate::model::SqlServerProfile::database].
4693 ///
4694 /// # Example
4695 /// ```ignore,no_run
4696 /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4697 /// let x = SqlServerProfile::new().set_database("example");
4698 /// ```
4699 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4700 self.database = v.into();
4701 self
4702 }
4703
4704 /// Sets the value of [secret_manager_stored_password][crate::model::SqlServerProfile::secret_manager_stored_password].
4705 ///
4706 /// # Example
4707 /// ```ignore,no_run
4708 /// # use google_cloud_datastream_v1::model::SqlServerProfile;
4709 /// let x = SqlServerProfile::new().set_secret_manager_stored_password("example");
4710 /// ```
4711 pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4712 mut self,
4713 v: T,
4714 ) -> Self {
4715 self.secret_manager_stored_password = v.into();
4716 self
4717 }
4718}
4719
4720impl wkt::message::Message for SqlServerProfile {
4721 fn typename() -> &'static str {
4722 "type.googleapis.com/google.cloud.datastream.v1.SqlServerProfile"
4723 }
4724}
4725
4726/// Salesforce profile
4727#[derive(Clone, Default, PartialEq)]
4728#[non_exhaustive]
4729pub struct SalesforceProfile {
4730 /// Required. Domain endpoint for the Salesforce connection.
4731 pub domain: std::string::String,
4732
4733 /// Credentials for Salesforce connection.
4734 pub credentials: std::option::Option<crate::model::salesforce_profile::Credentials>,
4735
4736 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4737}
4738
4739impl SalesforceProfile {
4740 /// Creates a new default instance.
4741 pub fn new() -> Self {
4742 std::default::Default::default()
4743 }
4744
4745 /// Sets the value of [domain][crate::model::SalesforceProfile::domain].
4746 ///
4747 /// # Example
4748 /// ```ignore,no_run
4749 /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4750 /// let x = SalesforceProfile::new().set_domain("example");
4751 /// ```
4752 pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4753 self.domain = v.into();
4754 self
4755 }
4756
4757 /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials].
4758 ///
4759 /// Note that all the setters affecting `credentials` are mutually
4760 /// exclusive.
4761 ///
4762 /// # Example
4763 /// ```ignore,no_run
4764 /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4765 /// use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4766 /// let x = SalesforceProfile::new().set_credentials(Some(
4767 /// google_cloud_datastream_v1::model::salesforce_profile::Credentials::UserCredentials(UserCredentials::default().into())));
4768 /// ```
4769 pub fn set_credentials<
4770 T: std::convert::Into<std::option::Option<crate::model::salesforce_profile::Credentials>>,
4771 >(
4772 mut self,
4773 v: T,
4774 ) -> Self {
4775 self.credentials = v.into();
4776 self
4777 }
4778
4779 /// The value of [credentials][crate::model::SalesforceProfile::credentials]
4780 /// if it holds a `UserCredentials`, `None` if the field is not set or
4781 /// holds a different branch.
4782 pub fn user_credentials(
4783 &self,
4784 ) -> std::option::Option<&std::boxed::Box<crate::model::salesforce_profile::UserCredentials>>
4785 {
4786 #[allow(unreachable_patterns)]
4787 self.credentials.as_ref().and_then(|v| match v {
4788 crate::model::salesforce_profile::Credentials::UserCredentials(v) => {
4789 std::option::Option::Some(v)
4790 }
4791 _ => std::option::Option::None,
4792 })
4793 }
4794
4795 /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials]
4796 /// to hold a `UserCredentials`.
4797 ///
4798 /// Note that all the setters affecting `credentials` are
4799 /// mutually exclusive.
4800 ///
4801 /// # Example
4802 /// ```ignore,no_run
4803 /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4804 /// use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4805 /// let x = SalesforceProfile::new().set_user_credentials(UserCredentials::default()/* use setters */);
4806 /// assert!(x.user_credentials().is_some());
4807 /// assert!(x.oauth2_client_credentials().is_none());
4808 /// ```
4809 pub fn set_user_credentials<
4810 T: std::convert::Into<std::boxed::Box<crate::model::salesforce_profile::UserCredentials>>,
4811 >(
4812 mut self,
4813 v: T,
4814 ) -> Self {
4815 self.credentials = std::option::Option::Some(
4816 crate::model::salesforce_profile::Credentials::UserCredentials(v.into()),
4817 );
4818 self
4819 }
4820
4821 /// The value of [credentials][crate::model::SalesforceProfile::credentials]
4822 /// if it holds a `Oauth2ClientCredentials`, `None` if the field is not set or
4823 /// holds a different branch.
4824 pub fn oauth2_client_credentials(
4825 &self,
4826 ) -> std::option::Option<
4827 &std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
4828 > {
4829 #[allow(unreachable_patterns)]
4830 self.credentials.as_ref().and_then(|v| match v {
4831 crate::model::salesforce_profile::Credentials::Oauth2ClientCredentials(v) => {
4832 std::option::Option::Some(v)
4833 }
4834 _ => std::option::Option::None,
4835 })
4836 }
4837
4838 /// Sets the value of [credentials][crate::model::SalesforceProfile::credentials]
4839 /// to hold a `Oauth2ClientCredentials`.
4840 ///
4841 /// Note that all the setters affecting `credentials` are
4842 /// mutually exclusive.
4843 ///
4844 /// # Example
4845 /// ```ignore,no_run
4846 /// # use google_cloud_datastream_v1::model::SalesforceProfile;
4847 /// use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
4848 /// let x = SalesforceProfile::new().set_oauth2_client_credentials(Oauth2ClientCredentials::default()/* use setters */);
4849 /// assert!(x.oauth2_client_credentials().is_some());
4850 /// assert!(x.user_credentials().is_none());
4851 /// ```
4852 pub fn set_oauth2_client_credentials<
4853 T: std::convert::Into<
4854 std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
4855 >,
4856 >(
4857 mut self,
4858 v: T,
4859 ) -> Self {
4860 self.credentials = std::option::Option::Some(
4861 crate::model::salesforce_profile::Credentials::Oauth2ClientCredentials(v.into()),
4862 );
4863 self
4864 }
4865}
4866
4867impl wkt::message::Message for SalesforceProfile {
4868 fn typename() -> &'static str {
4869 "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile"
4870 }
4871}
4872
4873/// Defines additional types related to [SalesforceProfile].
4874pub mod salesforce_profile {
4875 #[allow(unused_imports)]
4876 use super::*;
4877
4878 /// Username-password credentials.
4879 #[derive(Clone, Default, PartialEq)]
4880 #[non_exhaustive]
4881 pub struct UserCredentials {
4882 /// Required. Username for the Salesforce connection.
4883 pub username: std::string::String,
4884
4885 /// Optional. Password for the Salesforce connection.
4886 /// Mutually exclusive with the `secret_manager_stored_password` field.
4887 pub password: std::string::String,
4888
4889 /// Optional. Security token for the Salesforce connection.
4890 /// Mutually exclusive with the `secret_manager_stored_security_token` field.
4891 pub security_token: std::string::String,
4892
4893 /// Optional. A reference to a Secret Manager resource name storing the
4894 /// Salesforce connection's password. Mutually exclusive with the `password`
4895 /// field.
4896 pub secret_manager_stored_password: std::string::String,
4897
4898 /// Optional. A reference to a Secret Manager resource name storing the
4899 /// Salesforce connection's security token. Mutually exclusive with the
4900 /// `security_token` field.
4901 pub secret_manager_stored_security_token: std::string::String,
4902
4903 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4904 }
4905
4906 impl UserCredentials {
4907 /// Creates a new default instance.
4908 pub fn new() -> Self {
4909 std::default::Default::default()
4910 }
4911
4912 /// Sets the value of [username][crate::model::salesforce_profile::UserCredentials::username].
4913 ///
4914 /// # Example
4915 /// ```ignore,no_run
4916 /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4917 /// let x = UserCredentials::new().set_username("example");
4918 /// ```
4919 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4920 self.username = v.into();
4921 self
4922 }
4923
4924 /// Sets the value of [password][crate::model::salesforce_profile::UserCredentials::password].
4925 ///
4926 /// # Example
4927 /// ```ignore,no_run
4928 /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4929 /// let x = UserCredentials::new().set_password("example");
4930 /// ```
4931 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4932 self.password = v.into();
4933 self
4934 }
4935
4936 /// Sets the value of [security_token][crate::model::salesforce_profile::UserCredentials::security_token].
4937 ///
4938 /// # Example
4939 /// ```ignore,no_run
4940 /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4941 /// let x = UserCredentials::new().set_security_token("example");
4942 /// ```
4943 pub fn set_security_token<T: std::convert::Into<std::string::String>>(
4944 mut self,
4945 v: T,
4946 ) -> Self {
4947 self.security_token = v.into();
4948 self
4949 }
4950
4951 /// Sets the value of [secret_manager_stored_password][crate::model::salesforce_profile::UserCredentials::secret_manager_stored_password].
4952 ///
4953 /// # Example
4954 /// ```ignore,no_run
4955 /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4956 /// let x = UserCredentials::new().set_secret_manager_stored_password("example");
4957 /// ```
4958 pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
4959 mut self,
4960 v: T,
4961 ) -> Self {
4962 self.secret_manager_stored_password = v.into();
4963 self
4964 }
4965
4966 /// Sets the value of [secret_manager_stored_security_token][crate::model::salesforce_profile::UserCredentials::secret_manager_stored_security_token].
4967 ///
4968 /// # Example
4969 /// ```ignore,no_run
4970 /// # use google_cloud_datastream_v1::model::salesforce_profile::UserCredentials;
4971 /// let x = UserCredentials::new().set_secret_manager_stored_security_token("example");
4972 /// ```
4973 pub fn set_secret_manager_stored_security_token<
4974 T: std::convert::Into<std::string::String>,
4975 >(
4976 mut self,
4977 v: T,
4978 ) -> Self {
4979 self.secret_manager_stored_security_token = v.into();
4980 self
4981 }
4982 }
4983
4984 impl wkt::message::Message for UserCredentials {
4985 fn typename() -> &'static str {
4986 "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile.UserCredentials"
4987 }
4988 }
4989
4990 /// OAuth2 Client Credentials.
4991 #[derive(Clone, Default, PartialEq)]
4992 #[non_exhaustive]
4993 pub struct Oauth2ClientCredentials {
4994 /// Required. Client ID for Salesforce OAuth2 Client Credentials.
4995 pub client_id: std::string::String,
4996
4997 /// Optional. Client secret for Salesforce OAuth2 Client Credentials.
4998 /// Mutually exclusive with the `secret_manager_stored_client_secret` field.
4999 pub client_secret: std::string::String,
5000
5001 /// Optional. A reference to a Secret Manager resource name storing the
5002 /// Salesforce OAuth2 client_secret. Mutually exclusive with the
5003 /// `client_secret` field.
5004 pub secret_manager_stored_client_secret: std::string::String,
5005
5006 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5007 }
5008
5009 impl Oauth2ClientCredentials {
5010 /// Creates a new default instance.
5011 pub fn new() -> Self {
5012 std::default::Default::default()
5013 }
5014
5015 /// Sets the value of [client_id][crate::model::salesforce_profile::Oauth2ClientCredentials::client_id].
5016 ///
5017 /// # Example
5018 /// ```ignore,no_run
5019 /// # use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
5020 /// let x = Oauth2ClientCredentials::new().set_client_id("example");
5021 /// ```
5022 pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5023 self.client_id = v.into();
5024 self
5025 }
5026
5027 /// Sets the value of [client_secret][crate::model::salesforce_profile::Oauth2ClientCredentials::client_secret].
5028 ///
5029 /// # Example
5030 /// ```ignore,no_run
5031 /// # use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
5032 /// let x = Oauth2ClientCredentials::new().set_client_secret("example");
5033 /// ```
5034 pub fn set_client_secret<T: std::convert::Into<std::string::String>>(
5035 mut self,
5036 v: T,
5037 ) -> Self {
5038 self.client_secret = v.into();
5039 self
5040 }
5041
5042 /// Sets the value of [secret_manager_stored_client_secret][crate::model::salesforce_profile::Oauth2ClientCredentials::secret_manager_stored_client_secret].
5043 ///
5044 /// # Example
5045 /// ```ignore,no_run
5046 /// # use google_cloud_datastream_v1::model::salesforce_profile::Oauth2ClientCredentials;
5047 /// let x = Oauth2ClientCredentials::new().set_secret_manager_stored_client_secret("example");
5048 /// ```
5049 pub fn set_secret_manager_stored_client_secret<
5050 T: std::convert::Into<std::string::String>,
5051 >(
5052 mut self,
5053 v: T,
5054 ) -> Self {
5055 self.secret_manager_stored_client_secret = v.into();
5056 self
5057 }
5058 }
5059
5060 impl wkt::message::Message for Oauth2ClientCredentials {
5061 fn typename() -> &'static str {
5062 "type.googleapis.com/google.cloud.datastream.v1.SalesforceProfile.Oauth2ClientCredentials"
5063 }
5064 }
5065
5066 /// Credentials for Salesforce connection.
5067 #[derive(Clone, Debug, PartialEq)]
5068 #[non_exhaustive]
5069 pub enum Credentials {
5070 /// User-password authentication.
5071 UserCredentials(std::boxed::Box<crate::model::salesforce_profile::UserCredentials>),
5072 /// Connected app authentication.
5073 Oauth2ClientCredentials(
5074 std::boxed::Box<crate::model::salesforce_profile::Oauth2ClientCredentials>,
5075 ),
5076 }
5077}
5078
5079/// MongoDB profile.
5080#[derive(Clone, Default, PartialEq)]
5081#[non_exhaustive]
5082pub struct MongodbProfile {
5083 /// Required. List of host addresses for a MongoDB cluster.
5084 /// For SRV connection format, this list must contain exactly one DNS host
5085 /// without a port. For Standard connection format, this list must contain all
5086 /// the required hosts in the cluster with their respective ports.
5087 pub host_addresses: std::vec::Vec<crate::model::HostAddress>,
5088
5089 /// Optional. Name of the replica set. Only needed for self hosted replica set
5090 /// type MongoDB cluster. For SRV connection format, this field must be empty.
5091 /// For Standard connection format, this field must be specified.
5092 pub replica_set: std::string::String,
5093
5094 /// Required. Username for the MongoDB connection.
5095 pub username: std::string::String,
5096
5097 /// Optional. Password for the MongoDB connection. Mutually exclusive with the
5098 /// `secret_manager_stored_password` field.
5099 pub password: std::string::String,
5100
5101 /// Optional. A reference to a Secret Manager resource name storing the
5102 /// SQLServer connection password. Mutually exclusive with the `password`
5103 /// field.
5104 pub secret_manager_stored_password: std::string::String,
5105
5106 /// Optional. SSL configuration for the MongoDB connection.
5107 pub ssl_config: std::option::Option<crate::model::MongodbSslConfig>,
5108
5109 /// MongoDB connection format.
5110 /// Must specify either srv_connection_format or standard_connection_format.
5111 pub mongodb_connection_format:
5112 std::option::Option<crate::model::mongodb_profile::MongodbConnectionFormat>,
5113
5114 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5115}
5116
5117impl MongodbProfile {
5118 /// Creates a new default instance.
5119 pub fn new() -> Self {
5120 std::default::Default::default()
5121 }
5122
5123 /// Sets the value of [host_addresses][crate::model::MongodbProfile::host_addresses].
5124 ///
5125 /// # Example
5126 /// ```ignore,no_run
5127 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5128 /// use google_cloud_datastream_v1::model::HostAddress;
5129 /// let x = MongodbProfile::new()
5130 /// .set_host_addresses([
5131 /// HostAddress::default()/* use setters */,
5132 /// HostAddress::default()/* use (different) setters */,
5133 /// ]);
5134 /// ```
5135 pub fn set_host_addresses<T, V>(mut self, v: T) -> Self
5136 where
5137 T: std::iter::IntoIterator<Item = V>,
5138 V: std::convert::Into<crate::model::HostAddress>,
5139 {
5140 use std::iter::Iterator;
5141 self.host_addresses = v.into_iter().map(|i| i.into()).collect();
5142 self
5143 }
5144
5145 /// Sets the value of [replica_set][crate::model::MongodbProfile::replica_set].
5146 ///
5147 /// # Example
5148 /// ```ignore,no_run
5149 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5150 /// let x = MongodbProfile::new().set_replica_set("example");
5151 /// ```
5152 pub fn set_replica_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5153 self.replica_set = v.into();
5154 self
5155 }
5156
5157 /// Sets the value of [username][crate::model::MongodbProfile::username].
5158 ///
5159 /// # Example
5160 /// ```ignore,no_run
5161 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5162 /// let x = MongodbProfile::new().set_username("example");
5163 /// ```
5164 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5165 self.username = v.into();
5166 self
5167 }
5168
5169 /// Sets the value of [password][crate::model::MongodbProfile::password].
5170 ///
5171 /// # Example
5172 /// ```ignore,no_run
5173 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5174 /// let x = MongodbProfile::new().set_password("example");
5175 /// ```
5176 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5177 self.password = v.into();
5178 self
5179 }
5180
5181 /// Sets the value of [secret_manager_stored_password][crate::model::MongodbProfile::secret_manager_stored_password].
5182 ///
5183 /// # Example
5184 /// ```ignore,no_run
5185 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5186 /// let x = MongodbProfile::new().set_secret_manager_stored_password("example");
5187 /// ```
5188 pub fn set_secret_manager_stored_password<T: std::convert::Into<std::string::String>>(
5189 mut self,
5190 v: T,
5191 ) -> Self {
5192 self.secret_manager_stored_password = v.into();
5193 self
5194 }
5195
5196 /// Sets the value of [ssl_config][crate::model::MongodbProfile::ssl_config].
5197 ///
5198 /// # Example
5199 /// ```ignore,no_run
5200 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5201 /// use google_cloud_datastream_v1::model::MongodbSslConfig;
5202 /// let x = MongodbProfile::new().set_ssl_config(MongodbSslConfig::default()/* use setters */);
5203 /// ```
5204 pub fn set_ssl_config<T>(mut self, v: T) -> Self
5205 where
5206 T: std::convert::Into<crate::model::MongodbSslConfig>,
5207 {
5208 self.ssl_config = std::option::Option::Some(v.into());
5209 self
5210 }
5211
5212 /// Sets or clears the value of [ssl_config][crate::model::MongodbProfile::ssl_config].
5213 ///
5214 /// # Example
5215 /// ```ignore,no_run
5216 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5217 /// use google_cloud_datastream_v1::model::MongodbSslConfig;
5218 /// let x = MongodbProfile::new().set_or_clear_ssl_config(Some(MongodbSslConfig::default()/* use setters */));
5219 /// let x = MongodbProfile::new().set_or_clear_ssl_config(None::<MongodbSslConfig>);
5220 /// ```
5221 pub fn set_or_clear_ssl_config<T>(mut self, v: std::option::Option<T>) -> Self
5222 where
5223 T: std::convert::Into<crate::model::MongodbSslConfig>,
5224 {
5225 self.ssl_config = v.map(|x| x.into());
5226 self
5227 }
5228
5229 /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format].
5230 ///
5231 /// Note that all the setters affecting `mongodb_connection_format` are mutually
5232 /// exclusive.
5233 ///
5234 /// # Example
5235 /// ```ignore,no_run
5236 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5237 /// use google_cloud_datastream_v1::model::SrvConnectionFormat;
5238 /// let x = MongodbProfile::new().set_mongodb_connection_format(Some(
5239 /// google_cloud_datastream_v1::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(SrvConnectionFormat::default().into())));
5240 /// ```
5241 pub fn set_mongodb_connection_format<
5242 T: std::convert::Into<
5243 std::option::Option<crate::model::mongodb_profile::MongodbConnectionFormat>,
5244 >,
5245 >(
5246 mut self,
5247 v: T,
5248 ) -> Self {
5249 self.mongodb_connection_format = v.into();
5250 self
5251 }
5252
5253 /// The value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5254 /// if it holds a `SrvConnectionFormat`, `None` if the field is not set or
5255 /// holds a different branch.
5256 pub fn srv_connection_format(
5257 &self,
5258 ) -> std::option::Option<&std::boxed::Box<crate::model::SrvConnectionFormat>> {
5259 #[allow(unreachable_patterns)]
5260 self.mongodb_connection_format
5261 .as_ref()
5262 .and_then(|v| match v {
5263 crate::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(v) => {
5264 std::option::Option::Some(v)
5265 }
5266 _ => std::option::Option::None,
5267 })
5268 }
5269
5270 /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5271 /// to hold a `SrvConnectionFormat`.
5272 ///
5273 /// Note that all the setters affecting `mongodb_connection_format` are
5274 /// mutually exclusive.
5275 ///
5276 /// # Example
5277 /// ```ignore,no_run
5278 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5279 /// use google_cloud_datastream_v1::model::SrvConnectionFormat;
5280 /// let x = MongodbProfile::new().set_srv_connection_format(SrvConnectionFormat::default()/* use setters */);
5281 /// assert!(x.srv_connection_format().is_some());
5282 /// assert!(x.standard_connection_format().is_none());
5283 /// ```
5284 pub fn set_srv_connection_format<
5285 T: std::convert::Into<std::boxed::Box<crate::model::SrvConnectionFormat>>,
5286 >(
5287 mut self,
5288 v: T,
5289 ) -> Self {
5290 self.mongodb_connection_format = std::option::Option::Some(
5291 crate::model::mongodb_profile::MongodbConnectionFormat::SrvConnectionFormat(v.into()),
5292 );
5293 self
5294 }
5295
5296 /// The value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5297 /// if it holds a `StandardConnectionFormat`, `None` if the field is not set or
5298 /// holds a different branch.
5299 pub fn standard_connection_format(
5300 &self,
5301 ) -> std::option::Option<&std::boxed::Box<crate::model::StandardConnectionFormat>> {
5302 #[allow(unreachable_patterns)]
5303 self.mongodb_connection_format.as_ref().and_then(|v| match v {
5304 crate::model::mongodb_profile::MongodbConnectionFormat::StandardConnectionFormat(v) => std::option::Option::Some(v),
5305 _ => std::option::Option::None,
5306 })
5307 }
5308
5309 /// Sets the value of [mongodb_connection_format][crate::model::MongodbProfile::mongodb_connection_format]
5310 /// to hold a `StandardConnectionFormat`.
5311 ///
5312 /// Note that all the setters affecting `mongodb_connection_format` are
5313 /// mutually exclusive.
5314 ///
5315 /// # Example
5316 /// ```ignore,no_run
5317 /// # use google_cloud_datastream_v1::model::MongodbProfile;
5318 /// use google_cloud_datastream_v1::model::StandardConnectionFormat;
5319 /// let x = MongodbProfile::new().set_standard_connection_format(StandardConnectionFormat::default()/* use setters */);
5320 /// assert!(x.standard_connection_format().is_some());
5321 /// assert!(x.srv_connection_format().is_none());
5322 /// ```
5323 pub fn set_standard_connection_format<
5324 T: std::convert::Into<std::boxed::Box<crate::model::StandardConnectionFormat>>,
5325 >(
5326 mut self,
5327 v: T,
5328 ) -> Self {
5329 self.mongodb_connection_format = std::option::Option::Some(
5330 crate::model::mongodb_profile::MongodbConnectionFormat::StandardConnectionFormat(
5331 v.into(),
5332 ),
5333 );
5334 self
5335 }
5336}
5337
5338impl wkt::message::Message for MongodbProfile {
5339 fn typename() -> &'static str {
5340 "type.googleapis.com/google.cloud.datastream.v1.MongodbProfile"
5341 }
5342}
5343
5344/// Defines additional types related to [MongodbProfile].
5345pub mod mongodb_profile {
5346 #[allow(unused_imports)]
5347 use super::*;
5348
5349 /// MongoDB connection format.
5350 /// Must specify either srv_connection_format or standard_connection_format.
5351 #[derive(Clone, Debug, PartialEq)]
5352 #[non_exhaustive]
5353 pub enum MongodbConnectionFormat {
5354 /// Srv connection format.
5355 SrvConnectionFormat(std::boxed::Box<crate::model::SrvConnectionFormat>),
5356 /// Standard connection format.
5357 StandardConnectionFormat(std::boxed::Box<crate::model::StandardConnectionFormat>),
5358 }
5359}
5360
5361/// A HostAddress represents a transport end point, which is the combination
5362/// of an IP address or hostname and a port number.
5363#[derive(Clone, Default, PartialEq)]
5364#[non_exhaustive]
5365pub struct HostAddress {
5366 /// Required. Hostname for the connection.
5367 pub hostname: std::string::String,
5368
5369 /// Optional. Port for the connection.
5370 pub port: i32,
5371
5372 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5373}
5374
5375impl HostAddress {
5376 /// Creates a new default instance.
5377 pub fn new() -> Self {
5378 std::default::Default::default()
5379 }
5380
5381 /// Sets the value of [hostname][crate::model::HostAddress::hostname].
5382 ///
5383 /// # Example
5384 /// ```ignore,no_run
5385 /// # use google_cloud_datastream_v1::model::HostAddress;
5386 /// let x = HostAddress::new().set_hostname("example");
5387 /// ```
5388 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5389 self.hostname = v.into();
5390 self
5391 }
5392
5393 /// Sets the value of [port][crate::model::HostAddress::port].
5394 ///
5395 /// # Example
5396 /// ```ignore,no_run
5397 /// # use google_cloud_datastream_v1::model::HostAddress;
5398 /// let x = HostAddress::new().set_port(42);
5399 /// ```
5400 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5401 self.port = v.into();
5402 self
5403 }
5404}
5405
5406impl wkt::message::Message for HostAddress {
5407 fn typename() -> &'static str {
5408 "type.googleapis.com/google.cloud.datastream.v1.HostAddress"
5409 }
5410}
5411
5412/// Srv connection format.
5413#[derive(Clone, Default, PartialEq)]
5414#[non_exhaustive]
5415pub struct SrvConnectionFormat {
5416 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5417}
5418
5419impl SrvConnectionFormat {
5420 /// Creates a new default instance.
5421 pub fn new() -> Self {
5422 std::default::Default::default()
5423 }
5424}
5425
5426impl wkt::message::Message for SrvConnectionFormat {
5427 fn typename() -> &'static str {
5428 "type.googleapis.com/google.cloud.datastream.v1.SrvConnectionFormat"
5429 }
5430}
5431
5432/// Standard connection format.
5433#[derive(Clone, Default, PartialEq)]
5434#[non_exhaustive]
5435pub struct StandardConnectionFormat {
5436 /// Optional. Specifies whether the client connects directly to the host[:port]
5437 /// in the connection URI.
5438 pub direct_connection: bool,
5439
5440 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5441}
5442
5443impl StandardConnectionFormat {
5444 /// Creates a new default instance.
5445 pub fn new() -> Self {
5446 std::default::Default::default()
5447 }
5448
5449 /// Sets the value of [direct_connection][crate::model::StandardConnectionFormat::direct_connection].
5450 ///
5451 /// # Example
5452 /// ```ignore,no_run
5453 /// # use google_cloud_datastream_v1::model::StandardConnectionFormat;
5454 /// let x = StandardConnectionFormat::new().set_direct_connection(true);
5455 /// ```
5456 pub fn set_direct_connection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5457 self.direct_connection = v.into();
5458 self
5459 }
5460}
5461
5462impl wkt::message::Message for StandardConnectionFormat {
5463 fn typename() -> &'static str {
5464 "type.googleapis.com/google.cloud.datastream.v1.StandardConnectionFormat"
5465 }
5466}
5467
5468/// Cloud Storage bucket profile.
5469#[derive(Clone, Default, PartialEq)]
5470#[non_exhaustive]
5471pub struct GcsProfile {
5472 /// Required. The Cloud Storage bucket name.
5473 pub bucket: std::string::String,
5474
5475 /// The root path inside the Cloud Storage bucket.
5476 pub root_path: std::string::String,
5477
5478 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5479}
5480
5481impl GcsProfile {
5482 /// Creates a new default instance.
5483 pub fn new() -> Self {
5484 std::default::Default::default()
5485 }
5486
5487 /// Sets the value of [bucket][crate::model::GcsProfile::bucket].
5488 ///
5489 /// # Example
5490 /// ```ignore,no_run
5491 /// # use google_cloud_datastream_v1::model::GcsProfile;
5492 /// let x = GcsProfile::new().set_bucket("example");
5493 /// ```
5494 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5495 self.bucket = v.into();
5496 self
5497 }
5498
5499 /// Sets the value of [root_path][crate::model::GcsProfile::root_path].
5500 ///
5501 /// # Example
5502 /// ```ignore,no_run
5503 /// # use google_cloud_datastream_v1::model::GcsProfile;
5504 /// let x = GcsProfile::new().set_root_path("example");
5505 /// ```
5506 pub fn set_root_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5507 self.root_path = v.into();
5508 self
5509 }
5510}
5511
5512impl wkt::message::Message for GcsProfile {
5513 fn typename() -> &'static str {
5514 "type.googleapis.com/google.cloud.datastream.v1.GcsProfile"
5515 }
5516}
5517
5518/// BigQuery warehouse profile.
5519#[derive(Clone, Default, PartialEq)]
5520#[non_exhaustive]
5521pub struct BigQueryProfile {
5522 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5523}
5524
5525impl BigQueryProfile {
5526 /// Creates a new default instance.
5527 pub fn new() -> Self {
5528 std::default::Default::default()
5529 }
5530}
5531
5532impl wkt::message::Message for BigQueryProfile {
5533 fn typename() -> &'static str {
5534 "type.googleapis.com/google.cloud.datastream.v1.BigQueryProfile"
5535 }
5536}
5537
5538/// Static IP address connectivity. Used when the source database is configured
5539/// to allow incoming connections from the Datastream public IP addresses
5540/// for the region specified in the connection profile.
5541#[derive(Clone, Default, PartialEq)]
5542#[non_exhaustive]
5543pub struct StaticServiceIpConnectivity {
5544 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5545}
5546
5547impl StaticServiceIpConnectivity {
5548 /// Creates a new default instance.
5549 pub fn new() -> Self {
5550 std::default::Default::default()
5551 }
5552}
5553
5554impl wkt::message::Message for StaticServiceIpConnectivity {
5555 fn typename() -> &'static str {
5556 "type.googleapis.com/google.cloud.datastream.v1.StaticServiceIpConnectivity"
5557 }
5558}
5559
5560/// Forward SSH Tunnel connectivity.
5561#[derive(Clone, Default, PartialEq)]
5562#[non_exhaustive]
5563pub struct ForwardSshTunnelConnectivity {
5564 /// Required. Hostname for the SSH tunnel.
5565 pub hostname: std::string::String,
5566
5567 /// Required. Username for the SSH tunnel.
5568 pub username: std::string::String,
5569
5570 /// Port for the SSH tunnel, default value is 22.
5571 pub port: i32,
5572
5573 #[allow(missing_docs)]
5574 pub authentication_method:
5575 std::option::Option<crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod>,
5576
5577 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5578}
5579
5580impl ForwardSshTunnelConnectivity {
5581 /// Creates a new default instance.
5582 pub fn new() -> Self {
5583 std::default::Default::default()
5584 }
5585
5586 /// Sets the value of [hostname][crate::model::ForwardSshTunnelConnectivity::hostname].
5587 ///
5588 /// # Example
5589 /// ```ignore,no_run
5590 /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5591 /// let x = ForwardSshTunnelConnectivity::new().set_hostname("example");
5592 /// ```
5593 pub fn set_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5594 self.hostname = v.into();
5595 self
5596 }
5597
5598 /// Sets the value of [username][crate::model::ForwardSshTunnelConnectivity::username].
5599 ///
5600 /// # Example
5601 /// ```ignore,no_run
5602 /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5603 /// let x = ForwardSshTunnelConnectivity::new().set_username("example");
5604 /// ```
5605 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5606 self.username = v.into();
5607 self
5608 }
5609
5610 /// Sets the value of [port][crate::model::ForwardSshTunnelConnectivity::port].
5611 ///
5612 /// # Example
5613 /// ```ignore,no_run
5614 /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5615 /// let x = ForwardSshTunnelConnectivity::new().set_port(42);
5616 /// ```
5617 pub fn set_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5618 self.port = v.into();
5619 self
5620 }
5621
5622 /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method].
5623 ///
5624 /// Note that all the setters affecting `authentication_method` are mutually
5625 /// exclusive.
5626 ///
5627 /// # Example
5628 /// ```ignore,no_run
5629 /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5630 /// use google_cloud_datastream_v1::model::forward_ssh_tunnel_connectivity::AuthenticationMethod;
5631 /// let x = ForwardSshTunnelConnectivity::new().set_authentication_method(Some(AuthenticationMethod::Password("example".to_string())));
5632 /// ```
5633 pub fn set_authentication_method<
5634 T: std::convert::Into<
5635 std::option::Option<
5636 crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod,
5637 >,
5638 >,
5639 >(
5640 mut self,
5641 v: T,
5642 ) -> Self {
5643 self.authentication_method = v.into();
5644 self
5645 }
5646
5647 /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5648 /// if it holds a `Password`, `None` if the field is not set or
5649 /// holds a different branch.
5650 pub fn password(&self) -> std::option::Option<&std::string::String> {
5651 #[allow(unreachable_patterns)]
5652 self.authentication_method.as_ref().and_then(|v| match v {
5653 crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v) => {
5654 std::option::Option::Some(v)
5655 }
5656 _ => std::option::Option::None,
5657 })
5658 }
5659
5660 /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5661 /// to hold a `Password`.
5662 ///
5663 /// Note that all the setters affecting `authentication_method` are
5664 /// mutually exclusive.
5665 ///
5666 /// # Example
5667 /// ```ignore,no_run
5668 /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5669 /// let x = ForwardSshTunnelConnectivity::new().set_password("example");
5670 /// assert!(x.password().is_some());
5671 /// assert!(x.private_key().is_none());
5672 /// ```
5673 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5674 self.authentication_method = std::option::Option::Some(
5675 crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::Password(v.into()),
5676 );
5677 self
5678 }
5679
5680 /// The value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5681 /// if it holds a `PrivateKey`, `None` if the field is not set or
5682 /// holds a different branch.
5683 pub fn private_key(&self) -> std::option::Option<&std::string::String> {
5684 #[allow(unreachable_patterns)]
5685 self.authentication_method.as_ref().and_then(|v| match v {
5686 crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(v) => {
5687 std::option::Option::Some(v)
5688 }
5689 _ => std::option::Option::None,
5690 })
5691 }
5692
5693 /// Sets the value of [authentication_method][crate::model::ForwardSshTunnelConnectivity::authentication_method]
5694 /// to hold a `PrivateKey`.
5695 ///
5696 /// Note that all the setters affecting `authentication_method` are
5697 /// mutually exclusive.
5698 ///
5699 /// # Example
5700 /// ```ignore,no_run
5701 /// # use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
5702 /// let x = ForwardSshTunnelConnectivity::new().set_private_key("example");
5703 /// assert!(x.private_key().is_some());
5704 /// assert!(x.password().is_none());
5705 /// ```
5706 pub fn set_private_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5707 self.authentication_method = std::option::Option::Some(
5708 crate::model::forward_ssh_tunnel_connectivity::AuthenticationMethod::PrivateKey(
5709 v.into(),
5710 ),
5711 );
5712 self
5713 }
5714}
5715
5716impl wkt::message::Message for ForwardSshTunnelConnectivity {
5717 fn typename() -> &'static str {
5718 "type.googleapis.com/google.cloud.datastream.v1.ForwardSshTunnelConnectivity"
5719 }
5720}
5721
5722/// Defines additional types related to [ForwardSshTunnelConnectivity].
5723pub mod forward_ssh_tunnel_connectivity {
5724 #[allow(unused_imports)]
5725 use super::*;
5726
5727 #[allow(missing_docs)]
5728 #[derive(Clone, Debug, PartialEq)]
5729 #[non_exhaustive]
5730 pub enum AuthenticationMethod {
5731 /// Input only. SSH password.
5732 Password(std::string::String),
5733 /// Input only. SSH private key.
5734 PrivateKey(std::string::String),
5735 }
5736}
5737
5738/// The VPC Peering configuration is used to create VPC peering between
5739/// Datastream and the consumer's VPC.
5740#[derive(Clone, Default, PartialEq)]
5741#[non_exhaustive]
5742pub struct VpcPeeringConfig {
5743 /// Required. Fully qualified name of the VPC that Datastream will peer to.
5744 /// Format: `projects/{project}/global/{networks}/{name}`
5745 pub vpc: std::string::String,
5746
5747 /// Required. A free subnet for peering. (CIDR of /29)
5748 pub subnet: std::string::String,
5749
5750 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5751}
5752
5753impl VpcPeeringConfig {
5754 /// Creates a new default instance.
5755 pub fn new() -> Self {
5756 std::default::Default::default()
5757 }
5758
5759 /// Sets the value of [vpc][crate::model::VpcPeeringConfig::vpc].
5760 ///
5761 /// # Example
5762 /// ```ignore,no_run
5763 /// # use google_cloud_datastream_v1::model::VpcPeeringConfig;
5764 /// let x = VpcPeeringConfig::new().set_vpc("example");
5765 /// ```
5766 pub fn set_vpc<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5767 self.vpc = v.into();
5768 self
5769 }
5770
5771 /// Sets the value of [subnet][crate::model::VpcPeeringConfig::subnet].
5772 ///
5773 /// # Example
5774 /// ```ignore,no_run
5775 /// # use google_cloud_datastream_v1::model::VpcPeeringConfig;
5776 /// let x = VpcPeeringConfig::new().set_subnet("example");
5777 /// ```
5778 pub fn set_subnet<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5779 self.subnet = v.into();
5780 self
5781 }
5782}
5783
5784impl wkt::message::Message for VpcPeeringConfig {
5785 fn typename() -> &'static str {
5786 "type.googleapis.com/google.cloud.datastream.v1.VpcPeeringConfig"
5787 }
5788}
5789
5790/// The PSC Interface configuration is used to create PSC Interface between
5791/// Datastream and the consumer's PSC.
5792#[derive(Clone, Default, PartialEq)]
5793#[non_exhaustive]
5794pub struct PscInterfaceConfig {
5795 /// Required. Fully qualified name of the Network Attachment that Datastream
5796 /// will connect to. Format:
5797 /// `projects/{project}/regions/{region}/networkAttachments/{name}`
5798 pub network_attachment: std::string::String,
5799
5800 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5801}
5802
5803impl PscInterfaceConfig {
5804 /// Creates a new default instance.
5805 pub fn new() -> Self {
5806 std::default::Default::default()
5807 }
5808
5809 /// Sets the value of [network_attachment][crate::model::PscInterfaceConfig::network_attachment].
5810 ///
5811 /// # Example
5812 /// ```ignore,no_run
5813 /// # use google_cloud_datastream_v1::model::PscInterfaceConfig;
5814 /// let x = PscInterfaceConfig::new().set_network_attachment("example");
5815 /// ```
5816 pub fn set_network_attachment<T: std::convert::Into<std::string::String>>(
5817 mut self,
5818 v: T,
5819 ) -> Self {
5820 self.network_attachment = v.into();
5821 self
5822 }
5823}
5824
5825impl wkt::message::Message for PscInterfaceConfig {
5826 fn typename() -> &'static str {
5827 "type.googleapis.com/google.cloud.datastream.v1.PscInterfaceConfig"
5828 }
5829}
5830
5831/// The PrivateConnection resource is used to establish private connectivity
5832/// between Datastream and a customer's network.
5833#[derive(Clone, Default, PartialEq)]
5834#[non_exhaustive]
5835pub struct PrivateConnection {
5836 /// Output only. Identifier. The resource's name.
5837 pub name: std::string::String,
5838
5839 /// Output only. The create time of the resource.
5840 pub create_time: std::option::Option<wkt::Timestamp>,
5841
5842 /// Output only. The update time of the resource.
5843 pub update_time: std::option::Option<wkt::Timestamp>,
5844
5845 /// Labels.
5846 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5847
5848 /// Required. Display name.
5849 pub display_name: std::string::String,
5850
5851 /// Output only. The state of the Private Connection.
5852 pub state: crate::model::private_connection::State,
5853
5854 /// Output only. In case of error, the details of the error in a user-friendly
5855 /// format.
5856 pub error: std::option::Option<crate::model::Error>,
5857
5858 /// Output only. Reserved for future use.
5859 pub satisfies_pzs: std::option::Option<bool>,
5860
5861 /// Output only. Reserved for future use.
5862 pub satisfies_pzi: std::option::Option<bool>,
5863
5864 /// VPC Peering Config.
5865 pub vpc_peering_config: std::option::Option<crate::model::VpcPeeringConfig>,
5866
5867 /// PSC Interface Config.
5868 pub psc_interface_config: std::option::Option<crate::model::PscInterfaceConfig>,
5869
5870 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5871}
5872
5873impl PrivateConnection {
5874 /// Creates a new default instance.
5875 pub fn new() -> Self {
5876 std::default::Default::default()
5877 }
5878
5879 /// Sets the value of [name][crate::model::PrivateConnection::name].
5880 ///
5881 /// # Example
5882 /// ```ignore,no_run
5883 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5884 /// # let project_id = "project_id";
5885 /// # let location_id = "location_id";
5886 /// # let private_connection_id = "private_connection_id";
5887 /// let x = PrivateConnection::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}"));
5888 /// ```
5889 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5890 self.name = v.into();
5891 self
5892 }
5893
5894 /// Sets the value of [create_time][crate::model::PrivateConnection::create_time].
5895 ///
5896 /// # Example
5897 /// ```ignore,no_run
5898 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5899 /// use wkt::Timestamp;
5900 /// let x = PrivateConnection::new().set_create_time(Timestamp::default()/* use setters */);
5901 /// ```
5902 pub fn set_create_time<T>(mut self, v: T) -> Self
5903 where
5904 T: std::convert::Into<wkt::Timestamp>,
5905 {
5906 self.create_time = std::option::Option::Some(v.into());
5907 self
5908 }
5909
5910 /// Sets or clears the value of [create_time][crate::model::PrivateConnection::create_time].
5911 ///
5912 /// # Example
5913 /// ```ignore,no_run
5914 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5915 /// use wkt::Timestamp;
5916 /// let x = PrivateConnection::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5917 /// let x = PrivateConnection::new().set_or_clear_create_time(None::<Timestamp>);
5918 /// ```
5919 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5920 where
5921 T: std::convert::Into<wkt::Timestamp>,
5922 {
5923 self.create_time = v.map(|x| x.into());
5924 self
5925 }
5926
5927 /// Sets the value of [update_time][crate::model::PrivateConnection::update_time].
5928 ///
5929 /// # Example
5930 /// ```ignore,no_run
5931 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5932 /// use wkt::Timestamp;
5933 /// let x = PrivateConnection::new().set_update_time(Timestamp::default()/* use setters */);
5934 /// ```
5935 pub fn set_update_time<T>(mut self, v: T) -> Self
5936 where
5937 T: std::convert::Into<wkt::Timestamp>,
5938 {
5939 self.update_time = std::option::Option::Some(v.into());
5940 self
5941 }
5942
5943 /// Sets or clears the value of [update_time][crate::model::PrivateConnection::update_time].
5944 ///
5945 /// # Example
5946 /// ```ignore,no_run
5947 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5948 /// use wkt::Timestamp;
5949 /// let x = PrivateConnection::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5950 /// let x = PrivateConnection::new().set_or_clear_update_time(None::<Timestamp>);
5951 /// ```
5952 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5953 where
5954 T: std::convert::Into<wkt::Timestamp>,
5955 {
5956 self.update_time = v.map(|x| x.into());
5957 self
5958 }
5959
5960 /// Sets the value of [labels][crate::model::PrivateConnection::labels].
5961 ///
5962 /// # Example
5963 /// ```ignore,no_run
5964 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5965 /// let x = PrivateConnection::new().set_labels([
5966 /// ("key0", "abc"),
5967 /// ("key1", "xyz"),
5968 /// ]);
5969 /// ```
5970 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5971 where
5972 T: std::iter::IntoIterator<Item = (K, V)>,
5973 K: std::convert::Into<std::string::String>,
5974 V: std::convert::Into<std::string::String>,
5975 {
5976 use std::iter::Iterator;
5977 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5978 self
5979 }
5980
5981 /// Sets the value of [display_name][crate::model::PrivateConnection::display_name].
5982 ///
5983 /// # Example
5984 /// ```ignore,no_run
5985 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5986 /// let x = PrivateConnection::new().set_display_name("example");
5987 /// ```
5988 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5989 self.display_name = v.into();
5990 self
5991 }
5992
5993 /// Sets the value of [state][crate::model::PrivateConnection::state].
5994 ///
5995 /// # Example
5996 /// ```ignore,no_run
5997 /// # use google_cloud_datastream_v1::model::PrivateConnection;
5998 /// use google_cloud_datastream_v1::model::private_connection::State;
5999 /// let x0 = PrivateConnection::new().set_state(State::Creating);
6000 /// let x1 = PrivateConnection::new().set_state(State::Created);
6001 /// let x2 = PrivateConnection::new().set_state(State::Failed);
6002 /// ```
6003 pub fn set_state<T: std::convert::Into<crate::model::private_connection::State>>(
6004 mut self,
6005 v: T,
6006 ) -> Self {
6007 self.state = v.into();
6008 self
6009 }
6010
6011 /// Sets the value of [error][crate::model::PrivateConnection::error].
6012 ///
6013 /// # Example
6014 /// ```ignore,no_run
6015 /// # use google_cloud_datastream_v1::model::PrivateConnection;
6016 /// use google_cloud_datastream_v1::model::Error;
6017 /// let x = PrivateConnection::new().set_error(Error::default()/* use setters */);
6018 /// ```
6019 pub fn set_error<T>(mut self, v: T) -> Self
6020 where
6021 T: std::convert::Into<crate::model::Error>,
6022 {
6023 self.error = std::option::Option::Some(v.into());
6024 self
6025 }
6026
6027 /// Sets or clears the value of [error][crate::model::PrivateConnection::error].
6028 ///
6029 /// # Example
6030 /// ```ignore,no_run
6031 /// # use google_cloud_datastream_v1::model::PrivateConnection;
6032 /// use google_cloud_datastream_v1::model::Error;
6033 /// let x = PrivateConnection::new().set_or_clear_error(Some(Error::default()/* use setters */));
6034 /// let x = PrivateConnection::new().set_or_clear_error(None::<Error>);
6035 /// ```
6036 pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
6037 where
6038 T: std::convert::Into<crate::model::Error>,
6039 {
6040 self.error = v.map(|x| x.into());
6041 self
6042 }
6043
6044 /// Sets the value of [satisfies_pzs][crate::model::PrivateConnection::satisfies_pzs].
6045 ///
6046 /// # Example
6047 /// ```ignore,no_run
6048 /// # use google_cloud_datastream_v1::model::PrivateConnection;
6049 /// let x = PrivateConnection::new().set_satisfies_pzs(true);
6050 /// ```
6051 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
6052 where
6053 T: std::convert::Into<bool>,
6054 {
6055 self.satisfies_pzs = std::option::Option::Some(v.into());
6056 self
6057 }
6058
6059 /// Sets or clears the value of [satisfies_pzs][crate::model::PrivateConnection::satisfies_pzs].
6060 ///
6061 /// # Example
6062 /// ```ignore,no_run
6063 /// # use google_cloud_datastream_v1::model::PrivateConnection;
6064 /// let x = PrivateConnection::new().set_or_clear_satisfies_pzs(Some(false));
6065 /// let x = PrivateConnection::new().set_or_clear_satisfies_pzs(None::<bool>);
6066 /// ```
6067 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
6068 where
6069 T: std::convert::Into<bool>,
6070 {
6071 self.satisfies_pzs = v.map(|x| x.into());
6072 self
6073 }
6074
6075 /// Sets the value of [satisfies_pzi][crate::model::PrivateConnection::satisfies_pzi].
6076 ///
6077 /// # Example
6078 /// ```ignore,no_run
6079 /// # use google_cloud_datastream_v1::model::PrivateConnection;
6080 /// let x = PrivateConnection::new().set_satisfies_pzi(true);
6081 /// ```
6082 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
6083 where
6084 T: std::convert::Into<bool>,
6085 {
6086 self.satisfies_pzi = std::option::Option::Some(v.into());
6087 self
6088 }
6089
6090 /// Sets or clears the value of [satisfies_pzi][crate::model::PrivateConnection::satisfies_pzi].
6091 ///
6092 /// # Example
6093 /// ```ignore,no_run
6094 /// # use google_cloud_datastream_v1::model::PrivateConnection;
6095 /// let x = PrivateConnection::new().set_or_clear_satisfies_pzi(Some(false));
6096 /// let x = PrivateConnection::new().set_or_clear_satisfies_pzi(None::<bool>);
6097 /// ```
6098 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
6099 where
6100 T: std::convert::Into<bool>,
6101 {
6102 self.satisfies_pzi = v.map(|x| x.into());
6103 self
6104 }
6105
6106 /// Sets the value of [vpc_peering_config][crate::model::PrivateConnection::vpc_peering_config].
6107 ///
6108 /// # Example
6109 /// ```ignore,no_run
6110 /// # use google_cloud_datastream_v1::model::PrivateConnection;
6111 /// use google_cloud_datastream_v1::model::VpcPeeringConfig;
6112 /// let x = PrivateConnection::new().set_vpc_peering_config(VpcPeeringConfig::default()/* use setters */);
6113 /// ```
6114 pub fn set_vpc_peering_config<T>(mut self, v: T) -> Self
6115 where
6116 T: std::convert::Into<crate::model::VpcPeeringConfig>,
6117 {
6118 self.vpc_peering_config = std::option::Option::Some(v.into());
6119 self
6120 }
6121
6122 /// Sets or clears the value of [vpc_peering_config][crate::model::PrivateConnection::vpc_peering_config].
6123 ///
6124 /// # Example
6125 /// ```ignore,no_run
6126 /// # use google_cloud_datastream_v1::model::PrivateConnection;
6127 /// use google_cloud_datastream_v1::model::VpcPeeringConfig;
6128 /// let x = PrivateConnection::new().set_or_clear_vpc_peering_config(Some(VpcPeeringConfig::default()/* use setters */));
6129 /// let x = PrivateConnection::new().set_or_clear_vpc_peering_config(None::<VpcPeeringConfig>);
6130 /// ```
6131 pub fn set_or_clear_vpc_peering_config<T>(mut self, v: std::option::Option<T>) -> Self
6132 where
6133 T: std::convert::Into<crate::model::VpcPeeringConfig>,
6134 {
6135 self.vpc_peering_config = v.map(|x| x.into());
6136 self
6137 }
6138
6139 /// Sets the value of [psc_interface_config][crate::model::PrivateConnection::psc_interface_config].
6140 ///
6141 /// # Example
6142 /// ```ignore,no_run
6143 /// # use google_cloud_datastream_v1::model::PrivateConnection;
6144 /// use google_cloud_datastream_v1::model::PscInterfaceConfig;
6145 /// let x = PrivateConnection::new().set_psc_interface_config(PscInterfaceConfig::default()/* use setters */);
6146 /// ```
6147 pub fn set_psc_interface_config<T>(mut self, v: T) -> Self
6148 where
6149 T: std::convert::Into<crate::model::PscInterfaceConfig>,
6150 {
6151 self.psc_interface_config = std::option::Option::Some(v.into());
6152 self
6153 }
6154
6155 /// Sets or clears the value of [psc_interface_config][crate::model::PrivateConnection::psc_interface_config].
6156 ///
6157 /// # Example
6158 /// ```ignore,no_run
6159 /// # use google_cloud_datastream_v1::model::PrivateConnection;
6160 /// use google_cloud_datastream_v1::model::PscInterfaceConfig;
6161 /// let x = PrivateConnection::new().set_or_clear_psc_interface_config(Some(PscInterfaceConfig::default()/* use setters */));
6162 /// let x = PrivateConnection::new().set_or_clear_psc_interface_config(None::<PscInterfaceConfig>);
6163 /// ```
6164 pub fn set_or_clear_psc_interface_config<T>(mut self, v: std::option::Option<T>) -> Self
6165 where
6166 T: std::convert::Into<crate::model::PscInterfaceConfig>,
6167 {
6168 self.psc_interface_config = v.map(|x| x.into());
6169 self
6170 }
6171}
6172
6173impl wkt::message::Message for PrivateConnection {
6174 fn typename() -> &'static str {
6175 "type.googleapis.com/google.cloud.datastream.v1.PrivateConnection"
6176 }
6177}
6178
6179/// Defines additional types related to [PrivateConnection].
6180pub mod private_connection {
6181 #[allow(unused_imports)]
6182 use super::*;
6183
6184 /// Private Connection state.
6185 ///
6186 /// # Working with unknown values
6187 ///
6188 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6189 /// additional enum variants at any time. Adding new variants is not considered
6190 /// a breaking change. Applications should write their code in anticipation of:
6191 ///
6192 /// - New values appearing in future releases of the client library, **and**
6193 /// - New values received dynamically, without application changes.
6194 ///
6195 /// Please consult the [Working with enums] section in the user guide for some
6196 /// guidelines.
6197 ///
6198 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6199 #[derive(Clone, Debug, PartialEq)]
6200 #[non_exhaustive]
6201 pub enum State {
6202 /// Unspecified state.
6203 Unspecified,
6204 /// The private connection is in creation state - creating resources.
6205 Creating,
6206 /// The private connection has been created with all of its resources.
6207 Created,
6208 /// The private connection creation has failed.
6209 Failed,
6210 /// The private connection is being deleted.
6211 Deleting,
6212 /// Delete request has failed, resource is in invalid state.
6213 FailedToDelete,
6214 /// If set, the enum was initialized with an unknown value.
6215 ///
6216 /// Applications can examine the value using [State::value] or
6217 /// [State::name].
6218 UnknownValue(state::UnknownValue),
6219 }
6220
6221 #[doc(hidden)]
6222 pub mod state {
6223 #[allow(unused_imports)]
6224 use super::*;
6225 #[derive(Clone, Debug, PartialEq)]
6226 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6227 }
6228
6229 impl State {
6230 /// Gets the enum value.
6231 ///
6232 /// Returns `None` if the enum contains an unknown value deserialized from
6233 /// the string representation of enums.
6234 pub fn value(&self) -> std::option::Option<i32> {
6235 match self {
6236 Self::Unspecified => std::option::Option::Some(0),
6237 Self::Creating => std::option::Option::Some(1),
6238 Self::Created => std::option::Option::Some(2),
6239 Self::Failed => std::option::Option::Some(3),
6240 Self::Deleting => std::option::Option::Some(4),
6241 Self::FailedToDelete => std::option::Option::Some(5),
6242 Self::UnknownValue(u) => u.0.value(),
6243 }
6244 }
6245
6246 /// Gets the enum value as a string.
6247 ///
6248 /// Returns `None` if the enum contains an unknown value deserialized from
6249 /// the integer representation of enums.
6250 pub fn name(&self) -> std::option::Option<&str> {
6251 match self {
6252 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6253 Self::Creating => std::option::Option::Some("CREATING"),
6254 Self::Created => std::option::Option::Some("CREATED"),
6255 Self::Failed => std::option::Option::Some("FAILED"),
6256 Self::Deleting => std::option::Option::Some("DELETING"),
6257 Self::FailedToDelete => std::option::Option::Some("FAILED_TO_DELETE"),
6258 Self::UnknownValue(u) => u.0.name(),
6259 }
6260 }
6261 }
6262
6263 impl std::default::Default for State {
6264 fn default() -> Self {
6265 use std::convert::From;
6266 Self::from(0)
6267 }
6268 }
6269
6270 impl std::fmt::Display for State {
6271 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6272 wkt::internal::display_enum(f, self.name(), self.value())
6273 }
6274 }
6275
6276 impl std::convert::From<i32> for State {
6277 fn from(value: i32) -> Self {
6278 match value {
6279 0 => Self::Unspecified,
6280 1 => Self::Creating,
6281 2 => Self::Created,
6282 3 => Self::Failed,
6283 4 => Self::Deleting,
6284 5 => Self::FailedToDelete,
6285 _ => Self::UnknownValue(state::UnknownValue(
6286 wkt::internal::UnknownEnumValue::Integer(value),
6287 )),
6288 }
6289 }
6290 }
6291
6292 impl std::convert::From<&str> for State {
6293 fn from(value: &str) -> Self {
6294 use std::string::ToString;
6295 match value {
6296 "STATE_UNSPECIFIED" => Self::Unspecified,
6297 "CREATING" => Self::Creating,
6298 "CREATED" => Self::Created,
6299 "FAILED" => Self::Failed,
6300 "DELETING" => Self::Deleting,
6301 "FAILED_TO_DELETE" => Self::FailedToDelete,
6302 _ => Self::UnknownValue(state::UnknownValue(
6303 wkt::internal::UnknownEnumValue::String(value.to_string()),
6304 )),
6305 }
6306 }
6307 }
6308
6309 impl serde::ser::Serialize for State {
6310 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6311 where
6312 S: serde::Serializer,
6313 {
6314 match self {
6315 Self::Unspecified => serializer.serialize_i32(0),
6316 Self::Creating => serializer.serialize_i32(1),
6317 Self::Created => serializer.serialize_i32(2),
6318 Self::Failed => serializer.serialize_i32(3),
6319 Self::Deleting => serializer.serialize_i32(4),
6320 Self::FailedToDelete => serializer.serialize_i32(5),
6321 Self::UnknownValue(u) => u.0.serialize(serializer),
6322 }
6323 }
6324 }
6325
6326 impl<'de> serde::de::Deserialize<'de> for State {
6327 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6328 where
6329 D: serde::Deserializer<'de>,
6330 {
6331 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6332 ".google.cloud.datastream.v1.PrivateConnection.State",
6333 ))
6334 }
6335 }
6336}
6337
6338/// Private Connectivity
6339#[derive(Clone, Default, PartialEq)]
6340#[non_exhaustive]
6341pub struct PrivateConnectivity {
6342 /// Required. A reference to a private connection resource.
6343 /// Format: `projects/{project}/locations/{location}/privateConnections/{name}`
6344 pub private_connection: std::string::String,
6345
6346 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6347}
6348
6349impl PrivateConnectivity {
6350 /// Creates a new default instance.
6351 pub fn new() -> Self {
6352 std::default::Default::default()
6353 }
6354
6355 /// Sets the value of [private_connection][crate::model::PrivateConnectivity::private_connection].
6356 ///
6357 /// # Example
6358 /// ```ignore,no_run
6359 /// # use google_cloud_datastream_v1::model::PrivateConnectivity;
6360 /// # let project_id = "project_id";
6361 /// # let location_id = "location_id";
6362 /// # let private_connection_id = "private_connection_id";
6363 /// let x = PrivateConnectivity::new().set_private_connection(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}"));
6364 /// ```
6365 pub fn set_private_connection<T: std::convert::Into<std::string::String>>(
6366 mut self,
6367 v: T,
6368 ) -> Self {
6369 self.private_connection = v.into();
6370 self
6371 }
6372}
6373
6374impl wkt::message::Message for PrivateConnectivity {
6375 fn typename() -> &'static str {
6376 "type.googleapis.com/google.cloud.datastream.v1.PrivateConnectivity"
6377 }
6378}
6379
6380/// The route resource is the child of the private connection resource,
6381/// used for defining a route for a private connection.
6382#[derive(Clone, Default, PartialEq)]
6383#[non_exhaustive]
6384pub struct Route {
6385 /// Output only. Identifier. The resource's name.
6386 pub name: std::string::String,
6387
6388 /// Output only. The create time of the resource.
6389 pub create_time: std::option::Option<wkt::Timestamp>,
6390
6391 /// Output only. The update time of the resource.
6392 pub update_time: std::option::Option<wkt::Timestamp>,
6393
6394 /// Labels.
6395 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6396
6397 /// Required. Display name.
6398 pub display_name: std::string::String,
6399
6400 /// Required. Destination address for connection
6401 pub destination_address: std::string::String,
6402
6403 /// Destination port for connection
6404 pub destination_port: i32,
6405
6406 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6407}
6408
6409impl Route {
6410 /// Creates a new default instance.
6411 pub fn new() -> Self {
6412 std::default::Default::default()
6413 }
6414
6415 /// Sets the value of [name][crate::model::Route::name].
6416 ///
6417 /// # Example
6418 /// ```ignore,no_run
6419 /// # use google_cloud_datastream_v1::model::Route;
6420 /// # let project_id = "project_id";
6421 /// # let location_id = "location_id";
6422 /// # let private_connection_id = "private_connection_id";
6423 /// # let route_id = "route_id";
6424 /// let x = Route::new().set_name(format!("projects/{project_id}/locations/{location_id}/privateConnections/{private_connection_id}/routes/{route_id}"));
6425 /// ```
6426 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6427 self.name = v.into();
6428 self
6429 }
6430
6431 /// Sets the value of [create_time][crate::model::Route::create_time].
6432 ///
6433 /// # Example
6434 /// ```ignore,no_run
6435 /// # use google_cloud_datastream_v1::model::Route;
6436 /// use wkt::Timestamp;
6437 /// let x = Route::new().set_create_time(Timestamp::default()/* use setters */);
6438 /// ```
6439 pub fn set_create_time<T>(mut self, v: T) -> Self
6440 where
6441 T: std::convert::Into<wkt::Timestamp>,
6442 {
6443 self.create_time = std::option::Option::Some(v.into());
6444 self
6445 }
6446
6447 /// Sets or clears the value of [create_time][crate::model::Route::create_time].
6448 ///
6449 /// # Example
6450 /// ```ignore,no_run
6451 /// # use google_cloud_datastream_v1::model::Route;
6452 /// use wkt::Timestamp;
6453 /// let x = Route::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6454 /// let x = Route::new().set_or_clear_create_time(None::<Timestamp>);
6455 /// ```
6456 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6457 where
6458 T: std::convert::Into<wkt::Timestamp>,
6459 {
6460 self.create_time = v.map(|x| x.into());
6461 self
6462 }
6463
6464 /// Sets the value of [update_time][crate::model::Route::update_time].
6465 ///
6466 /// # Example
6467 /// ```ignore,no_run
6468 /// # use google_cloud_datastream_v1::model::Route;
6469 /// use wkt::Timestamp;
6470 /// let x = Route::new().set_update_time(Timestamp::default()/* use setters */);
6471 /// ```
6472 pub fn set_update_time<T>(mut self, v: T) -> Self
6473 where
6474 T: std::convert::Into<wkt::Timestamp>,
6475 {
6476 self.update_time = std::option::Option::Some(v.into());
6477 self
6478 }
6479
6480 /// Sets or clears the value of [update_time][crate::model::Route::update_time].
6481 ///
6482 /// # Example
6483 /// ```ignore,no_run
6484 /// # use google_cloud_datastream_v1::model::Route;
6485 /// use wkt::Timestamp;
6486 /// let x = Route::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6487 /// let x = Route::new().set_or_clear_update_time(None::<Timestamp>);
6488 /// ```
6489 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6490 where
6491 T: std::convert::Into<wkt::Timestamp>,
6492 {
6493 self.update_time = v.map(|x| x.into());
6494 self
6495 }
6496
6497 /// Sets the value of [labels][crate::model::Route::labels].
6498 ///
6499 /// # Example
6500 /// ```ignore,no_run
6501 /// # use google_cloud_datastream_v1::model::Route;
6502 /// let x = Route::new().set_labels([
6503 /// ("key0", "abc"),
6504 /// ("key1", "xyz"),
6505 /// ]);
6506 /// ```
6507 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6508 where
6509 T: std::iter::IntoIterator<Item = (K, V)>,
6510 K: std::convert::Into<std::string::String>,
6511 V: std::convert::Into<std::string::String>,
6512 {
6513 use std::iter::Iterator;
6514 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6515 self
6516 }
6517
6518 /// Sets the value of [display_name][crate::model::Route::display_name].
6519 ///
6520 /// # Example
6521 /// ```ignore,no_run
6522 /// # use google_cloud_datastream_v1::model::Route;
6523 /// let x = Route::new().set_display_name("example");
6524 /// ```
6525 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6526 self.display_name = v.into();
6527 self
6528 }
6529
6530 /// Sets the value of [destination_address][crate::model::Route::destination_address].
6531 ///
6532 /// # Example
6533 /// ```ignore,no_run
6534 /// # use google_cloud_datastream_v1::model::Route;
6535 /// let x = Route::new().set_destination_address("example");
6536 /// ```
6537 pub fn set_destination_address<T: std::convert::Into<std::string::String>>(
6538 mut self,
6539 v: T,
6540 ) -> Self {
6541 self.destination_address = v.into();
6542 self
6543 }
6544
6545 /// Sets the value of [destination_port][crate::model::Route::destination_port].
6546 ///
6547 /// # Example
6548 /// ```ignore,no_run
6549 /// # use google_cloud_datastream_v1::model::Route;
6550 /// let x = Route::new().set_destination_port(42);
6551 /// ```
6552 pub fn set_destination_port<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6553 self.destination_port = v.into();
6554 self
6555 }
6556}
6557
6558impl wkt::message::Message for Route {
6559 fn typename() -> &'static str {
6560 "type.googleapis.com/google.cloud.datastream.v1.Route"
6561 }
6562}
6563
6564/// MongoDB SSL configuration information.
6565#[derive(Clone, Default, PartialEq)]
6566#[non_exhaustive]
6567pub struct MongodbSslConfig {
6568 /// Optional. Input only. PEM-encoded private key associated with the Client
6569 /// Certificate. If this field is used then the 'client_certificate' and the
6570 /// 'ca_certificate' fields are mandatory.
6571 pub client_key: std::string::String,
6572
6573 /// Output only. Indicates whether the client_key field is set.
6574 pub client_key_set: bool,
6575
6576 /// Optional. Input only. PEM-encoded certificate that will be used by the
6577 /// replica to authenticate against the source database server. If this field
6578 /// is used then the 'client_key' and the 'ca_certificate' fields are
6579 /// mandatory.
6580 pub client_certificate: std::string::String,
6581
6582 /// Output only. Indicates whether the client_certificate field is set.
6583 pub client_certificate_set: bool,
6584
6585 /// Optional. Input only. PEM-encoded certificate of the CA that signed the
6586 /// source database server's certificate.
6587 pub ca_certificate: std::string::String,
6588
6589 /// Output only. Indicates whether the ca_certificate field is set.
6590 pub ca_certificate_set: bool,
6591
6592 /// Optional. Input only. A reference to a Secret Manager resource name storing
6593 /// the PEM-encoded private key associated with the Client Certificate. If this
6594 /// field is used then the 'client_certificate' and the 'ca_certificate' fields
6595 /// are mandatory. Mutually exclusive with the `client_key` field.
6596 pub secret_manager_stored_client_key: std::string::String,
6597
6598 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6599}
6600
6601impl MongodbSslConfig {
6602 /// Creates a new default instance.
6603 pub fn new() -> Self {
6604 std::default::Default::default()
6605 }
6606
6607 /// Sets the value of [client_key][crate::model::MongodbSslConfig::client_key].
6608 ///
6609 /// # Example
6610 /// ```ignore,no_run
6611 /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6612 /// let x = MongodbSslConfig::new().set_client_key("example");
6613 /// ```
6614 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6615 self.client_key = v.into();
6616 self
6617 }
6618
6619 /// Sets the value of [client_key_set][crate::model::MongodbSslConfig::client_key_set].
6620 ///
6621 /// # Example
6622 /// ```ignore,no_run
6623 /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6624 /// let x = MongodbSslConfig::new().set_client_key_set(true);
6625 /// ```
6626 pub fn set_client_key_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6627 self.client_key_set = v.into();
6628 self
6629 }
6630
6631 /// Sets the value of [client_certificate][crate::model::MongodbSslConfig::client_certificate].
6632 ///
6633 /// # Example
6634 /// ```ignore,no_run
6635 /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6636 /// let x = MongodbSslConfig::new().set_client_certificate("example");
6637 /// ```
6638 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
6639 mut self,
6640 v: T,
6641 ) -> Self {
6642 self.client_certificate = v.into();
6643 self
6644 }
6645
6646 /// Sets the value of [client_certificate_set][crate::model::MongodbSslConfig::client_certificate_set].
6647 ///
6648 /// # Example
6649 /// ```ignore,no_run
6650 /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6651 /// let x = MongodbSslConfig::new().set_client_certificate_set(true);
6652 /// ```
6653 pub fn set_client_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6654 self.client_certificate_set = v.into();
6655 self
6656 }
6657
6658 /// Sets the value of [ca_certificate][crate::model::MongodbSslConfig::ca_certificate].
6659 ///
6660 /// # Example
6661 /// ```ignore,no_run
6662 /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6663 /// let x = MongodbSslConfig::new().set_ca_certificate("example");
6664 /// ```
6665 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6666 self.ca_certificate = v.into();
6667 self
6668 }
6669
6670 /// Sets the value of [ca_certificate_set][crate::model::MongodbSslConfig::ca_certificate_set].
6671 ///
6672 /// # Example
6673 /// ```ignore,no_run
6674 /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6675 /// let x = MongodbSslConfig::new().set_ca_certificate_set(true);
6676 /// ```
6677 pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6678 self.ca_certificate_set = v.into();
6679 self
6680 }
6681
6682 /// Sets the value of [secret_manager_stored_client_key][crate::model::MongodbSslConfig::secret_manager_stored_client_key].
6683 ///
6684 /// # Example
6685 /// ```ignore,no_run
6686 /// # use google_cloud_datastream_v1::model::MongodbSslConfig;
6687 /// let x = MongodbSslConfig::new().set_secret_manager_stored_client_key("example");
6688 /// ```
6689 pub fn set_secret_manager_stored_client_key<T: std::convert::Into<std::string::String>>(
6690 mut self,
6691 v: T,
6692 ) -> Self {
6693 self.secret_manager_stored_client_key = v.into();
6694 self
6695 }
6696}
6697
6698impl wkt::message::Message for MongodbSslConfig {
6699 fn typename() -> &'static str {
6700 "type.googleapis.com/google.cloud.datastream.v1.MongodbSslConfig"
6701 }
6702}
6703
6704/// MySQL SSL configuration information.
6705#[derive(Clone, Default, PartialEq)]
6706#[non_exhaustive]
6707pub struct MysqlSslConfig {
6708 /// Optional. Input only. PEM-encoded private key associated with the Client
6709 /// Certificate. If this field is used then the 'client_certificate' and the
6710 /// 'ca_certificate' fields are mandatory.
6711 pub client_key: std::string::String,
6712
6713 /// Output only. Indicates whether the client_key field is set.
6714 pub client_key_set: bool,
6715
6716 /// Optional. Input only. PEM-encoded certificate that will be used by the
6717 /// replica to authenticate against the source database server. If this field
6718 /// is used then the 'client_key' and the 'ca_certificate' fields are
6719 /// mandatory.
6720 pub client_certificate: std::string::String,
6721
6722 /// Output only. Indicates whether the client_certificate field is set.
6723 pub client_certificate_set: bool,
6724
6725 /// Input only. PEM-encoded certificate of the CA that signed the source
6726 /// database server's certificate.
6727 pub ca_certificate: std::string::String,
6728
6729 /// Output only. Indicates whether the ca_certificate field is set.
6730 pub ca_certificate_set: bool,
6731
6732 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6733}
6734
6735impl MysqlSslConfig {
6736 /// Creates a new default instance.
6737 pub fn new() -> Self {
6738 std::default::Default::default()
6739 }
6740
6741 /// Sets the value of [client_key][crate::model::MysqlSslConfig::client_key].
6742 ///
6743 /// # Example
6744 /// ```ignore,no_run
6745 /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6746 /// let x = MysqlSslConfig::new().set_client_key("example");
6747 /// ```
6748 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6749 self.client_key = v.into();
6750 self
6751 }
6752
6753 /// Sets the value of [client_key_set][crate::model::MysqlSslConfig::client_key_set].
6754 ///
6755 /// # Example
6756 /// ```ignore,no_run
6757 /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6758 /// let x = MysqlSslConfig::new().set_client_key_set(true);
6759 /// ```
6760 pub fn set_client_key_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6761 self.client_key_set = v.into();
6762 self
6763 }
6764
6765 /// Sets the value of [client_certificate][crate::model::MysqlSslConfig::client_certificate].
6766 ///
6767 /// # Example
6768 /// ```ignore,no_run
6769 /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6770 /// let x = MysqlSslConfig::new().set_client_certificate("example");
6771 /// ```
6772 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
6773 mut self,
6774 v: T,
6775 ) -> Self {
6776 self.client_certificate = v.into();
6777 self
6778 }
6779
6780 /// Sets the value of [client_certificate_set][crate::model::MysqlSslConfig::client_certificate_set].
6781 ///
6782 /// # Example
6783 /// ```ignore,no_run
6784 /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6785 /// let x = MysqlSslConfig::new().set_client_certificate_set(true);
6786 /// ```
6787 pub fn set_client_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6788 self.client_certificate_set = v.into();
6789 self
6790 }
6791
6792 /// Sets the value of [ca_certificate][crate::model::MysqlSslConfig::ca_certificate].
6793 ///
6794 /// # Example
6795 /// ```ignore,no_run
6796 /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6797 /// let x = MysqlSslConfig::new().set_ca_certificate("example");
6798 /// ```
6799 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6800 self.ca_certificate = v.into();
6801 self
6802 }
6803
6804 /// Sets the value of [ca_certificate_set][crate::model::MysqlSslConfig::ca_certificate_set].
6805 ///
6806 /// # Example
6807 /// ```ignore,no_run
6808 /// # use google_cloud_datastream_v1::model::MysqlSslConfig;
6809 /// let x = MysqlSslConfig::new().set_ca_certificate_set(true);
6810 /// ```
6811 pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6812 self.ca_certificate_set = v.into();
6813 self
6814 }
6815}
6816
6817impl wkt::message::Message for MysqlSslConfig {
6818 fn typename() -> &'static str {
6819 "type.googleapis.com/google.cloud.datastream.v1.MysqlSslConfig"
6820 }
6821}
6822
6823/// Oracle SSL configuration information.
6824#[derive(Clone, Default, PartialEq)]
6825#[non_exhaustive]
6826pub struct OracleSslConfig {
6827 /// Input only. PEM-encoded certificate of the CA that signed the source
6828 /// database server's certificate.
6829 pub ca_certificate: std::string::String,
6830
6831 /// Output only. Indicates whether the ca_certificate field has been set for
6832 /// this Connection-Profile.
6833 pub ca_certificate_set: bool,
6834
6835 /// Optional. The distinguished name (DN) mentioned in the server
6836 /// certificate. This corresponds to SSL_SERVER_CERT_DN sqlnet parameter.
6837 /// Refer
6838 /// <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>
6839 /// If this field is not provided, the DN matching is not enforced.
6840 pub server_certificate_distinguished_name: std::string::String,
6841
6842 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6843}
6844
6845impl OracleSslConfig {
6846 /// Creates a new default instance.
6847 pub fn new() -> Self {
6848 std::default::Default::default()
6849 }
6850
6851 /// Sets the value of [ca_certificate][crate::model::OracleSslConfig::ca_certificate].
6852 ///
6853 /// # Example
6854 /// ```ignore,no_run
6855 /// # use google_cloud_datastream_v1::model::OracleSslConfig;
6856 /// let x = OracleSslConfig::new().set_ca_certificate("example");
6857 /// ```
6858 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6859 self.ca_certificate = v.into();
6860 self
6861 }
6862
6863 /// Sets the value of [ca_certificate_set][crate::model::OracleSslConfig::ca_certificate_set].
6864 ///
6865 /// # Example
6866 /// ```ignore,no_run
6867 /// # use google_cloud_datastream_v1::model::OracleSslConfig;
6868 /// let x = OracleSslConfig::new().set_ca_certificate_set(true);
6869 /// ```
6870 pub fn set_ca_certificate_set<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6871 self.ca_certificate_set = v.into();
6872 self
6873 }
6874
6875 /// Sets the value of [server_certificate_distinguished_name][crate::model::OracleSslConfig::server_certificate_distinguished_name].
6876 ///
6877 /// # Example
6878 /// ```ignore,no_run
6879 /// # use google_cloud_datastream_v1::model::OracleSslConfig;
6880 /// let x = OracleSslConfig::new().set_server_certificate_distinguished_name("example");
6881 /// ```
6882 pub fn set_server_certificate_distinguished_name<T: std::convert::Into<std::string::String>>(
6883 mut self,
6884 v: T,
6885 ) -> Self {
6886 self.server_certificate_distinguished_name = v.into();
6887 self
6888 }
6889}
6890
6891impl wkt::message::Message for OracleSslConfig {
6892 fn typename() -> &'static str {
6893 "type.googleapis.com/google.cloud.datastream.v1.OracleSslConfig"
6894 }
6895}
6896
6897/// PostgreSQL SSL configuration information.
6898#[derive(Clone, Default, PartialEq)]
6899#[non_exhaustive]
6900pub struct PostgresqlSslConfig {
6901 /// The encryption settings available for PostgreSQL connection profiles.
6902 /// This captures various SSL mode supported by PostgreSQL, which includes
6903 /// TLS encryption with server verification, TLS encryption with both server
6904 /// and client verification and no TLS encryption.
6905 pub encryption_setting:
6906 std::option::Option<crate::model::postgresql_ssl_config::EncryptionSetting>,
6907
6908 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6909}
6910
6911impl PostgresqlSslConfig {
6912 /// Creates a new default instance.
6913 pub fn new() -> Self {
6914 std::default::Default::default()
6915 }
6916
6917 /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting].
6918 ///
6919 /// Note that all the setters affecting `encryption_setting` are mutually
6920 /// exclusive.
6921 ///
6922 /// # Example
6923 /// ```ignore,no_run
6924 /// # use google_cloud_datastream_v1::model::PostgresqlSslConfig;
6925 /// use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
6926 /// let x = PostgresqlSslConfig::new().set_encryption_setting(Some(
6927 /// google_cloud_datastream_v1::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(ServerVerification::default().into())));
6928 /// ```
6929 pub fn set_encryption_setting<
6930 T: std::convert::Into<
6931 std::option::Option<crate::model::postgresql_ssl_config::EncryptionSetting>,
6932 >,
6933 >(
6934 mut self,
6935 v: T,
6936 ) -> Self {
6937 self.encryption_setting = v.into();
6938 self
6939 }
6940
6941 /// The value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
6942 /// if it holds a `ServerVerification`, `None` if the field is not set or
6943 /// holds a different branch.
6944 pub fn server_verification(
6945 &self,
6946 ) -> std::option::Option<
6947 &std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
6948 > {
6949 #[allow(unreachable_patterns)]
6950 self.encryption_setting.as_ref().and_then(|v| match v {
6951 crate::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(v) => {
6952 std::option::Option::Some(v)
6953 }
6954 _ => std::option::Option::None,
6955 })
6956 }
6957
6958 /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
6959 /// to hold a `ServerVerification`.
6960 ///
6961 /// Note that all the setters affecting `encryption_setting` are
6962 /// mutually exclusive.
6963 ///
6964 /// # Example
6965 /// ```ignore,no_run
6966 /// # use google_cloud_datastream_v1::model::PostgresqlSslConfig;
6967 /// use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
6968 /// let x = PostgresqlSslConfig::new().set_server_verification(ServerVerification::default()/* use setters */);
6969 /// assert!(x.server_verification().is_some());
6970 /// assert!(x.server_and_client_verification().is_none());
6971 /// ```
6972 pub fn set_server_verification<
6973 T: std::convert::Into<
6974 std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
6975 >,
6976 >(
6977 mut self,
6978 v: T,
6979 ) -> Self {
6980 self.encryption_setting = std::option::Option::Some(
6981 crate::model::postgresql_ssl_config::EncryptionSetting::ServerVerification(v.into()),
6982 );
6983 self
6984 }
6985
6986 /// The value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
6987 /// if it holds a `ServerAndClientVerification`, `None` if the field is not set or
6988 /// holds a different branch.
6989 pub fn server_and_client_verification(
6990 &self,
6991 ) -> std::option::Option<
6992 &std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
6993 > {
6994 #[allow(unreachable_patterns)]
6995 self.encryption_setting.as_ref().and_then(|v| match v {
6996 crate::model::postgresql_ssl_config::EncryptionSetting::ServerAndClientVerification(
6997 v,
6998 ) => std::option::Option::Some(v),
6999 _ => std::option::Option::None,
7000 })
7001 }
7002
7003 /// Sets the value of [encryption_setting][crate::model::PostgresqlSslConfig::encryption_setting]
7004 /// to hold a `ServerAndClientVerification`.
7005 ///
7006 /// Note that all the setters affecting `encryption_setting` are
7007 /// mutually exclusive.
7008 ///
7009 /// # Example
7010 /// ```ignore,no_run
7011 /// # use google_cloud_datastream_v1::model::PostgresqlSslConfig;
7012 /// use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7013 /// let x = PostgresqlSslConfig::new().set_server_and_client_verification(ServerAndClientVerification::default()/* use setters */);
7014 /// assert!(x.server_and_client_verification().is_some());
7015 /// assert!(x.server_verification().is_none());
7016 /// ```
7017 pub fn set_server_and_client_verification<
7018 T: std::convert::Into<
7019 std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
7020 >,
7021 >(
7022 mut self,
7023 v: T,
7024 ) -> Self {
7025 self.encryption_setting = std::option::Option::Some(
7026 crate::model::postgresql_ssl_config::EncryptionSetting::ServerAndClientVerification(
7027 v.into(),
7028 ),
7029 );
7030 self
7031 }
7032}
7033
7034impl wkt::message::Message for PostgresqlSslConfig {
7035 fn typename() -> &'static str {
7036 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig"
7037 }
7038}
7039
7040/// Defines additional types related to [PostgresqlSslConfig].
7041pub mod postgresql_ssl_config {
7042 #[allow(unused_imports)]
7043 use super::*;
7044
7045 /// Message represents the option where Datastream will enforce the encryption
7046 /// and authenticate the server identity. ca_certificate must be set if user
7047 /// selects this option.
7048 #[derive(Clone, Default, PartialEq)]
7049 #[non_exhaustive]
7050 pub struct ServerVerification {
7051 /// Required. Input only. PEM-encoded server root CA certificate.
7052 pub ca_certificate: std::string::String,
7053
7054 /// Optional. The hostname mentioned in the Subject or SAN extension of the
7055 /// server certificate. If this field is not provided, the hostname in the
7056 /// server certificate is not validated.
7057 pub server_certificate_hostname: std::string::String,
7058
7059 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7060 }
7061
7062 impl ServerVerification {
7063 /// Creates a new default instance.
7064 pub fn new() -> Self {
7065 std::default::Default::default()
7066 }
7067
7068 /// Sets the value of [ca_certificate][crate::model::postgresql_ssl_config::ServerVerification::ca_certificate].
7069 ///
7070 /// # Example
7071 /// ```ignore,no_run
7072 /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
7073 /// let x = ServerVerification::new().set_ca_certificate("example");
7074 /// ```
7075 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(
7076 mut self,
7077 v: T,
7078 ) -> Self {
7079 self.ca_certificate = v.into();
7080 self
7081 }
7082
7083 /// Sets the value of [server_certificate_hostname][crate::model::postgresql_ssl_config::ServerVerification::server_certificate_hostname].
7084 ///
7085 /// # Example
7086 /// ```ignore,no_run
7087 /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerVerification;
7088 /// let x = ServerVerification::new().set_server_certificate_hostname("example");
7089 /// ```
7090 pub fn set_server_certificate_hostname<T: std::convert::Into<std::string::String>>(
7091 mut self,
7092 v: T,
7093 ) -> Self {
7094 self.server_certificate_hostname = v.into();
7095 self
7096 }
7097 }
7098
7099 impl wkt::message::Message for ServerVerification {
7100 fn typename() -> &'static str {
7101 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig.ServerVerification"
7102 }
7103 }
7104
7105 /// Message represents the option where Datastream will enforce the encryption
7106 /// and authenticate the server identity as well as the client identity.
7107 /// ca_certificate, client_certificate and client_key must be set if user
7108 /// selects this option.
7109 #[derive(Clone, Default, PartialEq)]
7110 #[non_exhaustive]
7111 pub struct ServerAndClientVerification {
7112 /// Required. Input only. PEM-encoded certificate used by the source database
7113 /// to authenticate the client identity (i.e., the Datastream's identity).
7114 /// This certificate is signed by either a root certificate trusted by the
7115 /// server or one or more intermediate certificates (which is stored with the
7116 /// leaf certificate) to link the this certificate to the trusted root
7117 /// certificate.
7118 pub client_certificate: std::string::String,
7119
7120 /// Optional. Input only. PEM-encoded private key associated with the client
7121 /// certificate. This value will be used during the SSL/TLS handshake,
7122 /// allowing the PostgreSQL server to authenticate the client's identity,
7123 /// i.e. identity of the Datastream.
7124 pub client_key: std::string::String,
7125
7126 /// Required. Input only. PEM-encoded server root CA certificate.
7127 pub ca_certificate: std::string::String,
7128
7129 /// Optional. The hostname mentioned in the Subject or SAN extension of the
7130 /// server certificate. If this field is not provided, the hostname in the
7131 /// server certificate is not validated.
7132 pub server_certificate_hostname: std::string::String,
7133
7134 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7135 }
7136
7137 impl ServerAndClientVerification {
7138 /// Creates a new default instance.
7139 pub fn new() -> Self {
7140 std::default::Default::default()
7141 }
7142
7143 /// Sets the value of [client_certificate][crate::model::postgresql_ssl_config::ServerAndClientVerification::client_certificate].
7144 ///
7145 /// # Example
7146 /// ```ignore,no_run
7147 /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7148 /// let x = ServerAndClientVerification::new().set_client_certificate("example");
7149 /// ```
7150 pub fn set_client_certificate<T: std::convert::Into<std::string::String>>(
7151 mut self,
7152 v: T,
7153 ) -> Self {
7154 self.client_certificate = v.into();
7155 self
7156 }
7157
7158 /// Sets the value of [client_key][crate::model::postgresql_ssl_config::ServerAndClientVerification::client_key].
7159 ///
7160 /// # Example
7161 /// ```ignore,no_run
7162 /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7163 /// let x = ServerAndClientVerification::new().set_client_key("example");
7164 /// ```
7165 pub fn set_client_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7166 self.client_key = v.into();
7167 self
7168 }
7169
7170 /// Sets the value of [ca_certificate][crate::model::postgresql_ssl_config::ServerAndClientVerification::ca_certificate].
7171 ///
7172 /// # Example
7173 /// ```ignore,no_run
7174 /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7175 /// let x = ServerAndClientVerification::new().set_ca_certificate("example");
7176 /// ```
7177 pub fn set_ca_certificate<T: std::convert::Into<std::string::String>>(
7178 mut self,
7179 v: T,
7180 ) -> Self {
7181 self.ca_certificate = v.into();
7182 self
7183 }
7184
7185 /// Sets the value of [server_certificate_hostname][crate::model::postgresql_ssl_config::ServerAndClientVerification::server_certificate_hostname].
7186 ///
7187 /// # Example
7188 /// ```ignore,no_run
7189 /// # use google_cloud_datastream_v1::model::postgresql_ssl_config::ServerAndClientVerification;
7190 /// let x = ServerAndClientVerification::new().set_server_certificate_hostname("example");
7191 /// ```
7192 pub fn set_server_certificate_hostname<T: std::convert::Into<std::string::String>>(
7193 mut self,
7194 v: T,
7195 ) -> Self {
7196 self.server_certificate_hostname = v.into();
7197 self
7198 }
7199 }
7200
7201 impl wkt::message::Message for ServerAndClientVerification {
7202 fn typename() -> &'static str {
7203 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSslConfig.ServerAndClientVerification"
7204 }
7205 }
7206
7207 /// The encryption settings available for PostgreSQL connection profiles.
7208 /// This captures various SSL mode supported by PostgreSQL, which includes
7209 /// TLS encryption with server verification, TLS encryption with both server
7210 /// and client verification and no TLS encryption.
7211 #[derive(Clone, Debug, PartialEq)]
7212 #[non_exhaustive]
7213 pub enum EncryptionSetting {
7214 /// Â If this field is set, the communication will be encrypted with TLS
7215 /// encryption and the server identity will be authenticated.
7216 ServerVerification(
7217 std::boxed::Box<crate::model::postgresql_ssl_config::ServerVerification>,
7218 ),
7219 /// If this field is set, the communication will be encrypted with TLS
7220 /// encryption and both the server identity and the client identity will be
7221 /// authenticated.
7222 ServerAndClientVerification(
7223 std::boxed::Box<crate::model::postgresql_ssl_config::ServerAndClientVerification>,
7224 ),
7225 }
7226}
7227
7228/// A set of reusable connection configurations to be used as a source or
7229/// destination for a stream.
7230#[derive(Clone, Default, PartialEq)]
7231#[non_exhaustive]
7232pub struct ConnectionProfile {
7233 /// Output only. Identifier. The resource's name.
7234 pub name: std::string::String,
7235
7236 /// Output only. The create time of the resource.
7237 pub create_time: std::option::Option<wkt::Timestamp>,
7238
7239 /// Output only. The update time of the resource.
7240 pub update_time: std::option::Option<wkt::Timestamp>,
7241
7242 /// Labels.
7243 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7244
7245 /// Required. Display name.
7246 pub display_name: std::string::String,
7247
7248 /// Output only. Reserved for future use.
7249 pub satisfies_pzs: std::option::Option<bool>,
7250
7251 /// Output only. Reserved for future use.
7252 pub satisfies_pzi: std::option::Option<bool>,
7253
7254 /// Connection configuration for the ConnectionProfile.
7255 pub profile: std::option::Option<crate::model::connection_profile::Profile>,
7256
7257 /// Connectivity options used to establish a connection to the profile.
7258 pub connectivity: std::option::Option<crate::model::connection_profile::Connectivity>,
7259
7260 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7261}
7262
7263impl ConnectionProfile {
7264 /// Creates a new default instance.
7265 pub fn new() -> Self {
7266 std::default::Default::default()
7267 }
7268
7269 /// Sets the value of [name][crate::model::ConnectionProfile::name].
7270 ///
7271 /// # Example
7272 /// ```ignore,no_run
7273 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7274 /// # let project_id = "project_id";
7275 /// # let location_id = "location_id";
7276 /// # let connection_profile_id = "connection_profile_id";
7277 /// let x = ConnectionProfile::new().set_name(format!("projects/{project_id}/locations/{location_id}/connectionProfiles/{connection_profile_id}"));
7278 /// ```
7279 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7280 self.name = v.into();
7281 self
7282 }
7283
7284 /// Sets the value of [create_time][crate::model::ConnectionProfile::create_time].
7285 ///
7286 /// # Example
7287 /// ```ignore,no_run
7288 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7289 /// use wkt::Timestamp;
7290 /// let x = ConnectionProfile::new().set_create_time(Timestamp::default()/* use setters */);
7291 /// ```
7292 pub fn set_create_time<T>(mut self, v: T) -> Self
7293 where
7294 T: std::convert::Into<wkt::Timestamp>,
7295 {
7296 self.create_time = std::option::Option::Some(v.into());
7297 self
7298 }
7299
7300 /// Sets or clears the value of [create_time][crate::model::ConnectionProfile::create_time].
7301 ///
7302 /// # Example
7303 /// ```ignore,no_run
7304 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7305 /// use wkt::Timestamp;
7306 /// let x = ConnectionProfile::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7307 /// let x = ConnectionProfile::new().set_or_clear_create_time(None::<Timestamp>);
7308 /// ```
7309 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7310 where
7311 T: std::convert::Into<wkt::Timestamp>,
7312 {
7313 self.create_time = v.map(|x| x.into());
7314 self
7315 }
7316
7317 /// Sets the value of [update_time][crate::model::ConnectionProfile::update_time].
7318 ///
7319 /// # Example
7320 /// ```ignore,no_run
7321 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7322 /// use wkt::Timestamp;
7323 /// let x = ConnectionProfile::new().set_update_time(Timestamp::default()/* use setters */);
7324 /// ```
7325 pub fn set_update_time<T>(mut self, v: T) -> Self
7326 where
7327 T: std::convert::Into<wkt::Timestamp>,
7328 {
7329 self.update_time = std::option::Option::Some(v.into());
7330 self
7331 }
7332
7333 /// Sets or clears the value of [update_time][crate::model::ConnectionProfile::update_time].
7334 ///
7335 /// # Example
7336 /// ```ignore,no_run
7337 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7338 /// use wkt::Timestamp;
7339 /// let x = ConnectionProfile::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7340 /// let x = ConnectionProfile::new().set_or_clear_update_time(None::<Timestamp>);
7341 /// ```
7342 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7343 where
7344 T: std::convert::Into<wkt::Timestamp>,
7345 {
7346 self.update_time = v.map(|x| x.into());
7347 self
7348 }
7349
7350 /// Sets the value of [labels][crate::model::ConnectionProfile::labels].
7351 ///
7352 /// # Example
7353 /// ```ignore,no_run
7354 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7355 /// let x = ConnectionProfile::new().set_labels([
7356 /// ("key0", "abc"),
7357 /// ("key1", "xyz"),
7358 /// ]);
7359 /// ```
7360 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7361 where
7362 T: std::iter::IntoIterator<Item = (K, V)>,
7363 K: std::convert::Into<std::string::String>,
7364 V: std::convert::Into<std::string::String>,
7365 {
7366 use std::iter::Iterator;
7367 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7368 self
7369 }
7370
7371 /// Sets the value of [display_name][crate::model::ConnectionProfile::display_name].
7372 ///
7373 /// # Example
7374 /// ```ignore,no_run
7375 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7376 /// let x = ConnectionProfile::new().set_display_name("example");
7377 /// ```
7378 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7379 self.display_name = v.into();
7380 self
7381 }
7382
7383 /// Sets the value of [satisfies_pzs][crate::model::ConnectionProfile::satisfies_pzs].
7384 ///
7385 /// # Example
7386 /// ```ignore,no_run
7387 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7388 /// let x = ConnectionProfile::new().set_satisfies_pzs(true);
7389 /// ```
7390 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
7391 where
7392 T: std::convert::Into<bool>,
7393 {
7394 self.satisfies_pzs = std::option::Option::Some(v.into());
7395 self
7396 }
7397
7398 /// Sets or clears the value of [satisfies_pzs][crate::model::ConnectionProfile::satisfies_pzs].
7399 ///
7400 /// # Example
7401 /// ```ignore,no_run
7402 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7403 /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzs(Some(false));
7404 /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzs(None::<bool>);
7405 /// ```
7406 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
7407 where
7408 T: std::convert::Into<bool>,
7409 {
7410 self.satisfies_pzs = v.map(|x| x.into());
7411 self
7412 }
7413
7414 /// Sets the value of [satisfies_pzi][crate::model::ConnectionProfile::satisfies_pzi].
7415 ///
7416 /// # Example
7417 /// ```ignore,no_run
7418 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7419 /// let x = ConnectionProfile::new().set_satisfies_pzi(true);
7420 /// ```
7421 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
7422 where
7423 T: std::convert::Into<bool>,
7424 {
7425 self.satisfies_pzi = std::option::Option::Some(v.into());
7426 self
7427 }
7428
7429 /// Sets or clears the value of [satisfies_pzi][crate::model::ConnectionProfile::satisfies_pzi].
7430 ///
7431 /// # Example
7432 /// ```ignore,no_run
7433 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7434 /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzi(Some(false));
7435 /// let x = ConnectionProfile::new().set_or_clear_satisfies_pzi(None::<bool>);
7436 /// ```
7437 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
7438 where
7439 T: std::convert::Into<bool>,
7440 {
7441 self.satisfies_pzi = v.map(|x| x.into());
7442 self
7443 }
7444
7445 /// Sets the value of [profile][crate::model::ConnectionProfile::profile].
7446 ///
7447 /// Note that all the setters affecting `profile` are mutually
7448 /// exclusive.
7449 ///
7450 /// # Example
7451 /// ```ignore,no_run
7452 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7453 /// use google_cloud_datastream_v1::model::OracleProfile;
7454 /// let x = ConnectionProfile::new().set_profile(Some(
7455 /// google_cloud_datastream_v1::model::connection_profile::Profile::OracleProfile(OracleProfile::default().into())));
7456 /// ```
7457 pub fn set_profile<
7458 T: std::convert::Into<std::option::Option<crate::model::connection_profile::Profile>>,
7459 >(
7460 mut self,
7461 v: T,
7462 ) -> Self {
7463 self.profile = v.into();
7464 self
7465 }
7466
7467 /// The value of [profile][crate::model::ConnectionProfile::profile]
7468 /// if it holds a `OracleProfile`, `None` if the field is not set or
7469 /// holds a different branch.
7470 pub fn oracle_profile(
7471 &self,
7472 ) -> std::option::Option<&std::boxed::Box<crate::model::OracleProfile>> {
7473 #[allow(unreachable_patterns)]
7474 self.profile.as_ref().and_then(|v| match v {
7475 crate::model::connection_profile::Profile::OracleProfile(v) => {
7476 std::option::Option::Some(v)
7477 }
7478 _ => std::option::Option::None,
7479 })
7480 }
7481
7482 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7483 /// to hold a `OracleProfile`.
7484 ///
7485 /// Note that all the setters affecting `profile` are
7486 /// mutually exclusive.
7487 ///
7488 /// # Example
7489 /// ```ignore,no_run
7490 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7491 /// use google_cloud_datastream_v1::model::OracleProfile;
7492 /// let x = ConnectionProfile::new().set_oracle_profile(OracleProfile::default()/* use setters */);
7493 /// assert!(x.oracle_profile().is_some());
7494 /// assert!(x.gcs_profile().is_none());
7495 /// assert!(x.mysql_profile().is_none());
7496 /// assert!(x.bigquery_profile().is_none());
7497 /// assert!(x.postgresql_profile().is_none());
7498 /// assert!(x.sql_server_profile().is_none());
7499 /// assert!(x.salesforce_profile().is_none());
7500 /// assert!(x.mongodb_profile().is_none());
7501 /// ```
7502 pub fn set_oracle_profile<
7503 T: std::convert::Into<std::boxed::Box<crate::model::OracleProfile>>,
7504 >(
7505 mut self,
7506 v: T,
7507 ) -> Self {
7508 self.profile = std::option::Option::Some(
7509 crate::model::connection_profile::Profile::OracleProfile(v.into()),
7510 );
7511 self
7512 }
7513
7514 /// The value of [profile][crate::model::ConnectionProfile::profile]
7515 /// if it holds a `GcsProfile`, `None` if the field is not set or
7516 /// holds a different branch.
7517 pub fn gcs_profile(&self) -> std::option::Option<&std::boxed::Box<crate::model::GcsProfile>> {
7518 #[allow(unreachable_patterns)]
7519 self.profile.as_ref().and_then(|v| match v {
7520 crate::model::connection_profile::Profile::GcsProfile(v) => {
7521 std::option::Option::Some(v)
7522 }
7523 _ => std::option::Option::None,
7524 })
7525 }
7526
7527 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7528 /// to hold a `GcsProfile`.
7529 ///
7530 /// Note that all the setters affecting `profile` are
7531 /// mutually exclusive.
7532 ///
7533 /// # Example
7534 /// ```ignore,no_run
7535 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7536 /// use google_cloud_datastream_v1::model::GcsProfile;
7537 /// let x = ConnectionProfile::new().set_gcs_profile(GcsProfile::default()/* use setters */);
7538 /// assert!(x.gcs_profile().is_some());
7539 /// assert!(x.oracle_profile().is_none());
7540 /// assert!(x.mysql_profile().is_none());
7541 /// assert!(x.bigquery_profile().is_none());
7542 /// assert!(x.postgresql_profile().is_none());
7543 /// assert!(x.sql_server_profile().is_none());
7544 /// assert!(x.salesforce_profile().is_none());
7545 /// assert!(x.mongodb_profile().is_none());
7546 /// ```
7547 pub fn set_gcs_profile<T: std::convert::Into<std::boxed::Box<crate::model::GcsProfile>>>(
7548 mut self,
7549 v: T,
7550 ) -> Self {
7551 self.profile = std::option::Option::Some(
7552 crate::model::connection_profile::Profile::GcsProfile(v.into()),
7553 );
7554 self
7555 }
7556
7557 /// The value of [profile][crate::model::ConnectionProfile::profile]
7558 /// if it holds a `MysqlProfile`, `None` if the field is not set or
7559 /// holds a different branch.
7560 pub fn mysql_profile(
7561 &self,
7562 ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlProfile>> {
7563 #[allow(unreachable_patterns)]
7564 self.profile.as_ref().and_then(|v| match v {
7565 crate::model::connection_profile::Profile::MysqlProfile(v) => {
7566 std::option::Option::Some(v)
7567 }
7568 _ => std::option::Option::None,
7569 })
7570 }
7571
7572 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7573 /// to hold a `MysqlProfile`.
7574 ///
7575 /// Note that all the setters affecting `profile` are
7576 /// mutually exclusive.
7577 ///
7578 /// # Example
7579 /// ```ignore,no_run
7580 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7581 /// use google_cloud_datastream_v1::model::MysqlProfile;
7582 /// let x = ConnectionProfile::new().set_mysql_profile(MysqlProfile::default()/* use setters */);
7583 /// assert!(x.mysql_profile().is_some());
7584 /// assert!(x.oracle_profile().is_none());
7585 /// assert!(x.gcs_profile().is_none());
7586 /// assert!(x.bigquery_profile().is_none());
7587 /// assert!(x.postgresql_profile().is_none());
7588 /// assert!(x.sql_server_profile().is_none());
7589 /// assert!(x.salesforce_profile().is_none());
7590 /// assert!(x.mongodb_profile().is_none());
7591 /// ```
7592 pub fn set_mysql_profile<T: std::convert::Into<std::boxed::Box<crate::model::MysqlProfile>>>(
7593 mut self,
7594 v: T,
7595 ) -> Self {
7596 self.profile = std::option::Option::Some(
7597 crate::model::connection_profile::Profile::MysqlProfile(v.into()),
7598 );
7599 self
7600 }
7601
7602 /// The value of [profile][crate::model::ConnectionProfile::profile]
7603 /// if it holds a `BigqueryProfile`, `None` if the field is not set or
7604 /// holds a different branch.
7605 pub fn bigquery_profile(
7606 &self,
7607 ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryProfile>> {
7608 #[allow(unreachable_patterns)]
7609 self.profile.as_ref().and_then(|v| match v {
7610 crate::model::connection_profile::Profile::BigqueryProfile(v) => {
7611 std::option::Option::Some(v)
7612 }
7613 _ => std::option::Option::None,
7614 })
7615 }
7616
7617 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7618 /// to hold a `BigqueryProfile`.
7619 ///
7620 /// Note that all the setters affecting `profile` are
7621 /// mutually exclusive.
7622 ///
7623 /// # Example
7624 /// ```ignore,no_run
7625 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7626 /// use google_cloud_datastream_v1::model::BigQueryProfile;
7627 /// let x = ConnectionProfile::new().set_bigquery_profile(BigQueryProfile::default()/* use setters */);
7628 /// assert!(x.bigquery_profile().is_some());
7629 /// assert!(x.oracle_profile().is_none());
7630 /// assert!(x.gcs_profile().is_none());
7631 /// assert!(x.mysql_profile().is_none());
7632 /// assert!(x.postgresql_profile().is_none());
7633 /// assert!(x.sql_server_profile().is_none());
7634 /// assert!(x.salesforce_profile().is_none());
7635 /// assert!(x.mongodb_profile().is_none());
7636 /// ```
7637 pub fn set_bigquery_profile<
7638 T: std::convert::Into<std::boxed::Box<crate::model::BigQueryProfile>>,
7639 >(
7640 mut self,
7641 v: T,
7642 ) -> Self {
7643 self.profile = std::option::Option::Some(
7644 crate::model::connection_profile::Profile::BigqueryProfile(v.into()),
7645 );
7646 self
7647 }
7648
7649 /// The value of [profile][crate::model::ConnectionProfile::profile]
7650 /// if it holds a `PostgresqlProfile`, `None` if the field is not set or
7651 /// holds a different branch.
7652 pub fn postgresql_profile(
7653 &self,
7654 ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlProfile>> {
7655 #[allow(unreachable_patterns)]
7656 self.profile.as_ref().and_then(|v| match v {
7657 crate::model::connection_profile::Profile::PostgresqlProfile(v) => {
7658 std::option::Option::Some(v)
7659 }
7660 _ => std::option::Option::None,
7661 })
7662 }
7663
7664 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7665 /// to hold a `PostgresqlProfile`.
7666 ///
7667 /// Note that all the setters affecting `profile` are
7668 /// mutually exclusive.
7669 ///
7670 /// # Example
7671 /// ```ignore,no_run
7672 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7673 /// use google_cloud_datastream_v1::model::PostgresqlProfile;
7674 /// let x = ConnectionProfile::new().set_postgresql_profile(PostgresqlProfile::default()/* use setters */);
7675 /// assert!(x.postgresql_profile().is_some());
7676 /// assert!(x.oracle_profile().is_none());
7677 /// assert!(x.gcs_profile().is_none());
7678 /// assert!(x.mysql_profile().is_none());
7679 /// assert!(x.bigquery_profile().is_none());
7680 /// assert!(x.sql_server_profile().is_none());
7681 /// assert!(x.salesforce_profile().is_none());
7682 /// assert!(x.mongodb_profile().is_none());
7683 /// ```
7684 pub fn set_postgresql_profile<
7685 T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlProfile>>,
7686 >(
7687 mut self,
7688 v: T,
7689 ) -> Self {
7690 self.profile = std::option::Option::Some(
7691 crate::model::connection_profile::Profile::PostgresqlProfile(v.into()),
7692 );
7693 self
7694 }
7695
7696 /// The value of [profile][crate::model::ConnectionProfile::profile]
7697 /// if it holds a `SqlServerProfile`, `None` if the field is not set or
7698 /// holds a different branch.
7699 pub fn sql_server_profile(
7700 &self,
7701 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerProfile>> {
7702 #[allow(unreachable_patterns)]
7703 self.profile.as_ref().and_then(|v| match v {
7704 crate::model::connection_profile::Profile::SqlServerProfile(v) => {
7705 std::option::Option::Some(v)
7706 }
7707 _ => std::option::Option::None,
7708 })
7709 }
7710
7711 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7712 /// to hold a `SqlServerProfile`.
7713 ///
7714 /// Note that all the setters affecting `profile` are
7715 /// mutually exclusive.
7716 ///
7717 /// # Example
7718 /// ```ignore,no_run
7719 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7720 /// use google_cloud_datastream_v1::model::SqlServerProfile;
7721 /// let x = ConnectionProfile::new().set_sql_server_profile(SqlServerProfile::default()/* use setters */);
7722 /// assert!(x.sql_server_profile().is_some());
7723 /// assert!(x.oracle_profile().is_none());
7724 /// assert!(x.gcs_profile().is_none());
7725 /// assert!(x.mysql_profile().is_none());
7726 /// assert!(x.bigquery_profile().is_none());
7727 /// assert!(x.postgresql_profile().is_none());
7728 /// assert!(x.salesforce_profile().is_none());
7729 /// assert!(x.mongodb_profile().is_none());
7730 /// ```
7731 pub fn set_sql_server_profile<
7732 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerProfile>>,
7733 >(
7734 mut self,
7735 v: T,
7736 ) -> Self {
7737 self.profile = std::option::Option::Some(
7738 crate::model::connection_profile::Profile::SqlServerProfile(v.into()),
7739 );
7740 self
7741 }
7742
7743 /// The value of [profile][crate::model::ConnectionProfile::profile]
7744 /// if it holds a `SalesforceProfile`, `None` if the field is not set or
7745 /// holds a different branch.
7746 pub fn salesforce_profile(
7747 &self,
7748 ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceProfile>> {
7749 #[allow(unreachable_patterns)]
7750 self.profile.as_ref().and_then(|v| match v {
7751 crate::model::connection_profile::Profile::SalesforceProfile(v) => {
7752 std::option::Option::Some(v)
7753 }
7754 _ => std::option::Option::None,
7755 })
7756 }
7757
7758 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7759 /// to hold a `SalesforceProfile`.
7760 ///
7761 /// Note that all the setters affecting `profile` are
7762 /// mutually exclusive.
7763 ///
7764 /// # Example
7765 /// ```ignore,no_run
7766 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7767 /// use google_cloud_datastream_v1::model::SalesforceProfile;
7768 /// let x = ConnectionProfile::new().set_salesforce_profile(SalesforceProfile::default()/* use setters */);
7769 /// assert!(x.salesforce_profile().is_some());
7770 /// assert!(x.oracle_profile().is_none());
7771 /// assert!(x.gcs_profile().is_none());
7772 /// assert!(x.mysql_profile().is_none());
7773 /// assert!(x.bigquery_profile().is_none());
7774 /// assert!(x.postgresql_profile().is_none());
7775 /// assert!(x.sql_server_profile().is_none());
7776 /// assert!(x.mongodb_profile().is_none());
7777 /// ```
7778 pub fn set_salesforce_profile<
7779 T: std::convert::Into<std::boxed::Box<crate::model::SalesforceProfile>>,
7780 >(
7781 mut self,
7782 v: T,
7783 ) -> Self {
7784 self.profile = std::option::Option::Some(
7785 crate::model::connection_profile::Profile::SalesforceProfile(v.into()),
7786 );
7787 self
7788 }
7789
7790 /// The value of [profile][crate::model::ConnectionProfile::profile]
7791 /// if it holds a `MongodbProfile`, `None` if the field is not set or
7792 /// holds a different branch.
7793 pub fn mongodb_profile(
7794 &self,
7795 ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbProfile>> {
7796 #[allow(unreachable_patterns)]
7797 self.profile.as_ref().and_then(|v| match v {
7798 crate::model::connection_profile::Profile::MongodbProfile(v) => {
7799 std::option::Option::Some(v)
7800 }
7801 _ => std::option::Option::None,
7802 })
7803 }
7804
7805 /// Sets the value of [profile][crate::model::ConnectionProfile::profile]
7806 /// to hold a `MongodbProfile`.
7807 ///
7808 /// Note that all the setters affecting `profile` are
7809 /// mutually exclusive.
7810 ///
7811 /// # Example
7812 /// ```ignore,no_run
7813 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7814 /// use google_cloud_datastream_v1::model::MongodbProfile;
7815 /// let x = ConnectionProfile::new().set_mongodb_profile(MongodbProfile::default()/* use setters */);
7816 /// assert!(x.mongodb_profile().is_some());
7817 /// assert!(x.oracle_profile().is_none());
7818 /// assert!(x.gcs_profile().is_none());
7819 /// assert!(x.mysql_profile().is_none());
7820 /// assert!(x.bigquery_profile().is_none());
7821 /// assert!(x.postgresql_profile().is_none());
7822 /// assert!(x.sql_server_profile().is_none());
7823 /// assert!(x.salesforce_profile().is_none());
7824 /// ```
7825 pub fn set_mongodb_profile<
7826 T: std::convert::Into<std::boxed::Box<crate::model::MongodbProfile>>,
7827 >(
7828 mut self,
7829 v: T,
7830 ) -> Self {
7831 self.profile = std::option::Option::Some(
7832 crate::model::connection_profile::Profile::MongodbProfile(v.into()),
7833 );
7834 self
7835 }
7836
7837 /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity].
7838 ///
7839 /// Note that all the setters affecting `connectivity` are mutually
7840 /// exclusive.
7841 ///
7842 /// # Example
7843 /// ```ignore,no_run
7844 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7845 /// use google_cloud_datastream_v1::model::StaticServiceIpConnectivity;
7846 /// let x = ConnectionProfile::new().set_connectivity(Some(
7847 /// google_cloud_datastream_v1::model::connection_profile::Connectivity::StaticServiceIpConnectivity(StaticServiceIpConnectivity::default().into())));
7848 /// ```
7849 pub fn set_connectivity<
7850 T: std::convert::Into<std::option::Option<crate::model::connection_profile::Connectivity>>,
7851 >(
7852 mut self,
7853 v: T,
7854 ) -> Self {
7855 self.connectivity = v.into();
7856 self
7857 }
7858
7859 /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
7860 /// if it holds a `StaticServiceIpConnectivity`, `None` if the field is not set or
7861 /// holds a different branch.
7862 pub fn static_service_ip_connectivity(
7863 &self,
7864 ) -> std::option::Option<&std::boxed::Box<crate::model::StaticServiceIpConnectivity>> {
7865 #[allow(unreachable_patterns)]
7866 self.connectivity.as_ref().and_then(|v| match v {
7867 crate::model::connection_profile::Connectivity::StaticServiceIpConnectivity(v) => {
7868 std::option::Option::Some(v)
7869 }
7870 _ => std::option::Option::None,
7871 })
7872 }
7873
7874 /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
7875 /// to hold a `StaticServiceIpConnectivity`.
7876 ///
7877 /// Note that all the setters affecting `connectivity` are
7878 /// mutually exclusive.
7879 ///
7880 /// # Example
7881 /// ```ignore,no_run
7882 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7883 /// use google_cloud_datastream_v1::model::StaticServiceIpConnectivity;
7884 /// let x = ConnectionProfile::new().set_static_service_ip_connectivity(StaticServiceIpConnectivity::default()/* use setters */);
7885 /// assert!(x.static_service_ip_connectivity().is_some());
7886 /// assert!(x.forward_ssh_connectivity().is_none());
7887 /// assert!(x.private_connectivity().is_none());
7888 /// ```
7889 pub fn set_static_service_ip_connectivity<
7890 T: std::convert::Into<std::boxed::Box<crate::model::StaticServiceIpConnectivity>>,
7891 >(
7892 mut self,
7893 v: T,
7894 ) -> Self {
7895 self.connectivity = std::option::Option::Some(
7896 crate::model::connection_profile::Connectivity::StaticServiceIpConnectivity(v.into()),
7897 );
7898 self
7899 }
7900
7901 /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
7902 /// if it holds a `ForwardSshConnectivity`, `None` if the field is not set or
7903 /// holds a different branch.
7904 pub fn forward_ssh_connectivity(
7905 &self,
7906 ) -> std::option::Option<&std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>> {
7907 #[allow(unreachable_patterns)]
7908 self.connectivity.as_ref().and_then(|v| match v {
7909 crate::model::connection_profile::Connectivity::ForwardSshConnectivity(v) => {
7910 std::option::Option::Some(v)
7911 }
7912 _ => std::option::Option::None,
7913 })
7914 }
7915
7916 /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
7917 /// to hold a `ForwardSshConnectivity`.
7918 ///
7919 /// Note that all the setters affecting `connectivity` are
7920 /// mutually exclusive.
7921 ///
7922 /// # Example
7923 /// ```ignore,no_run
7924 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7925 /// use google_cloud_datastream_v1::model::ForwardSshTunnelConnectivity;
7926 /// let x = ConnectionProfile::new().set_forward_ssh_connectivity(ForwardSshTunnelConnectivity::default()/* use setters */);
7927 /// assert!(x.forward_ssh_connectivity().is_some());
7928 /// assert!(x.static_service_ip_connectivity().is_none());
7929 /// assert!(x.private_connectivity().is_none());
7930 /// ```
7931 pub fn set_forward_ssh_connectivity<
7932 T: std::convert::Into<std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>>,
7933 >(
7934 mut self,
7935 v: T,
7936 ) -> Self {
7937 self.connectivity = std::option::Option::Some(
7938 crate::model::connection_profile::Connectivity::ForwardSshConnectivity(v.into()),
7939 );
7940 self
7941 }
7942
7943 /// The value of [connectivity][crate::model::ConnectionProfile::connectivity]
7944 /// if it holds a `PrivateConnectivity`, `None` if the field is not set or
7945 /// holds a different branch.
7946 pub fn private_connectivity(
7947 &self,
7948 ) -> std::option::Option<&std::boxed::Box<crate::model::PrivateConnectivity>> {
7949 #[allow(unreachable_patterns)]
7950 self.connectivity.as_ref().and_then(|v| match v {
7951 crate::model::connection_profile::Connectivity::PrivateConnectivity(v) => {
7952 std::option::Option::Some(v)
7953 }
7954 _ => std::option::Option::None,
7955 })
7956 }
7957
7958 /// Sets the value of [connectivity][crate::model::ConnectionProfile::connectivity]
7959 /// to hold a `PrivateConnectivity`.
7960 ///
7961 /// Note that all the setters affecting `connectivity` are
7962 /// mutually exclusive.
7963 ///
7964 /// # Example
7965 /// ```ignore,no_run
7966 /// # use google_cloud_datastream_v1::model::ConnectionProfile;
7967 /// use google_cloud_datastream_v1::model::PrivateConnectivity;
7968 /// let x = ConnectionProfile::new().set_private_connectivity(PrivateConnectivity::default()/* use setters */);
7969 /// assert!(x.private_connectivity().is_some());
7970 /// assert!(x.static_service_ip_connectivity().is_none());
7971 /// assert!(x.forward_ssh_connectivity().is_none());
7972 /// ```
7973 pub fn set_private_connectivity<
7974 T: std::convert::Into<std::boxed::Box<crate::model::PrivateConnectivity>>,
7975 >(
7976 mut self,
7977 v: T,
7978 ) -> Self {
7979 self.connectivity = std::option::Option::Some(
7980 crate::model::connection_profile::Connectivity::PrivateConnectivity(v.into()),
7981 );
7982 self
7983 }
7984}
7985
7986impl wkt::message::Message for ConnectionProfile {
7987 fn typename() -> &'static str {
7988 "type.googleapis.com/google.cloud.datastream.v1.ConnectionProfile"
7989 }
7990}
7991
7992/// Defines additional types related to [ConnectionProfile].
7993pub mod connection_profile {
7994 #[allow(unused_imports)]
7995 use super::*;
7996
7997 /// Connection configuration for the ConnectionProfile.
7998 #[derive(Clone, Debug, PartialEq)]
7999 #[non_exhaustive]
8000 pub enum Profile {
8001 /// Oracle ConnectionProfile configuration.
8002 OracleProfile(std::boxed::Box<crate::model::OracleProfile>),
8003 /// Cloud Storage ConnectionProfile configuration.
8004 GcsProfile(std::boxed::Box<crate::model::GcsProfile>),
8005 /// MySQL ConnectionProfile configuration.
8006 MysqlProfile(std::boxed::Box<crate::model::MysqlProfile>),
8007 /// BigQuery Connection Profile configuration.
8008 BigqueryProfile(std::boxed::Box<crate::model::BigQueryProfile>),
8009 /// PostgreSQL Connection Profile configuration.
8010 PostgresqlProfile(std::boxed::Box<crate::model::PostgresqlProfile>),
8011 /// SQLServer Connection Profile configuration.
8012 SqlServerProfile(std::boxed::Box<crate::model::SqlServerProfile>),
8013 /// Salesforce Connection Profile configuration.
8014 SalesforceProfile(std::boxed::Box<crate::model::SalesforceProfile>),
8015 /// MongoDB Connection Profile configuration.
8016 MongodbProfile(std::boxed::Box<crate::model::MongodbProfile>),
8017 }
8018
8019 /// Connectivity options used to establish a connection to the profile.
8020 #[derive(Clone, Debug, PartialEq)]
8021 #[non_exhaustive]
8022 pub enum Connectivity {
8023 /// Static Service IP connectivity.
8024 StaticServiceIpConnectivity(std::boxed::Box<crate::model::StaticServiceIpConnectivity>),
8025 /// Forward SSH tunnel connectivity.
8026 ForwardSshConnectivity(std::boxed::Box<crate::model::ForwardSshTunnelConnectivity>),
8027 /// Private connectivity.
8028 PrivateConnectivity(std::boxed::Box<crate::model::PrivateConnectivity>),
8029 }
8030}
8031
8032/// Oracle Column.
8033#[derive(Clone, Default, PartialEq)]
8034#[non_exhaustive]
8035pub struct OracleColumn {
8036 /// Column name.
8037 pub column: std::string::String,
8038
8039 /// The Oracle data type.
8040 pub data_type: std::string::String,
8041
8042 /// Column length.
8043 pub length: i32,
8044
8045 /// Column precision.
8046 pub precision: i32,
8047
8048 /// Column scale.
8049 pub scale: i32,
8050
8051 /// Column encoding.
8052 pub encoding: std::string::String,
8053
8054 /// Whether or not the column represents a primary key.
8055 pub primary_key: bool,
8056
8057 /// Whether or not the column can accept a null value.
8058 pub nullable: bool,
8059
8060 /// The ordinal position of the column in the table.
8061 pub ordinal_position: i32,
8062
8063 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8064}
8065
8066impl OracleColumn {
8067 /// Creates a new default instance.
8068 pub fn new() -> Self {
8069 std::default::Default::default()
8070 }
8071
8072 /// Sets the value of [column][crate::model::OracleColumn::column].
8073 ///
8074 /// # Example
8075 /// ```ignore,no_run
8076 /// # use google_cloud_datastream_v1::model::OracleColumn;
8077 /// let x = OracleColumn::new().set_column("example");
8078 /// ```
8079 pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8080 self.column = v.into();
8081 self
8082 }
8083
8084 /// Sets the value of [data_type][crate::model::OracleColumn::data_type].
8085 ///
8086 /// # Example
8087 /// ```ignore,no_run
8088 /// # use google_cloud_datastream_v1::model::OracleColumn;
8089 /// let x = OracleColumn::new().set_data_type("example");
8090 /// ```
8091 pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8092 self.data_type = v.into();
8093 self
8094 }
8095
8096 /// Sets the value of [length][crate::model::OracleColumn::length].
8097 ///
8098 /// # Example
8099 /// ```ignore,no_run
8100 /// # use google_cloud_datastream_v1::model::OracleColumn;
8101 /// let x = OracleColumn::new().set_length(42);
8102 /// ```
8103 pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8104 self.length = v.into();
8105 self
8106 }
8107
8108 /// Sets the value of [precision][crate::model::OracleColumn::precision].
8109 ///
8110 /// # Example
8111 /// ```ignore,no_run
8112 /// # use google_cloud_datastream_v1::model::OracleColumn;
8113 /// let x = OracleColumn::new().set_precision(42);
8114 /// ```
8115 pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8116 self.precision = v.into();
8117 self
8118 }
8119
8120 /// Sets the value of [scale][crate::model::OracleColumn::scale].
8121 ///
8122 /// # Example
8123 /// ```ignore,no_run
8124 /// # use google_cloud_datastream_v1::model::OracleColumn;
8125 /// let x = OracleColumn::new().set_scale(42);
8126 /// ```
8127 pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8128 self.scale = v.into();
8129 self
8130 }
8131
8132 /// Sets the value of [encoding][crate::model::OracleColumn::encoding].
8133 ///
8134 /// # Example
8135 /// ```ignore,no_run
8136 /// # use google_cloud_datastream_v1::model::OracleColumn;
8137 /// let x = OracleColumn::new().set_encoding("example");
8138 /// ```
8139 pub fn set_encoding<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8140 self.encoding = v.into();
8141 self
8142 }
8143
8144 /// Sets the value of [primary_key][crate::model::OracleColumn::primary_key].
8145 ///
8146 /// # Example
8147 /// ```ignore,no_run
8148 /// # use google_cloud_datastream_v1::model::OracleColumn;
8149 /// let x = OracleColumn::new().set_primary_key(true);
8150 /// ```
8151 pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8152 self.primary_key = v.into();
8153 self
8154 }
8155
8156 /// Sets the value of [nullable][crate::model::OracleColumn::nullable].
8157 ///
8158 /// # Example
8159 /// ```ignore,no_run
8160 /// # use google_cloud_datastream_v1::model::OracleColumn;
8161 /// let x = OracleColumn::new().set_nullable(true);
8162 /// ```
8163 pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8164 self.nullable = v.into();
8165 self
8166 }
8167
8168 /// Sets the value of [ordinal_position][crate::model::OracleColumn::ordinal_position].
8169 ///
8170 /// # Example
8171 /// ```ignore,no_run
8172 /// # use google_cloud_datastream_v1::model::OracleColumn;
8173 /// let x = OracleColumn::new().set_ordinal_position(42);
8174 /// ```
8175 pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8176 self.ordinal_position = v.into();
8177 self
8178 }
8179}
8180
8181impl wkt::message::Message for OracleColumn {
8182 fn typename() -> &'static str {
8183 "type.googleapis.com/google.cloud.datastream.v1.OracleColumn"
8184 }
8185}
8186
8187/// Oracle table.
8188#[derive(Clone, Default, PartialEq)]
8189#[non_exhaustive]
8190pub struct OracleTable {
8191 /// Table name.
8192 pub table: std::string::String,
8193
8194 /// Oracle columns in the schema.
8195 /// When unspecified as part of include/exclude objects, includes/excludes
8196 /// everything.
8197 pub oracle_columns: std::vec::Vec<crate::model::OracleColumn>,
8198
8199 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8200}
8201
8202impl OracleTable {
8203 /// Creates a new default instance.
8204 pub fn new() -> Self {
8205 std::default::Default::default()
8206 }
8207
8208 /// Sets the value of [table][crate::model::OracleTable::table].
8209 ///
8210 /// # Example
8211 /// ```ignore,no_run
8212 /// # use google_cloud_datastream_v1::model::OracleTable;
8213 /// let x = OracleTable::new().set_table("example");
8214 /// ```
8215 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8216 self.table = v.into();
8217 self
8218 }
8219
8220 /// Sets the value of [oracle_columns][crate::model::OracleTable::oracle_columns].
8221 ///
8222 /// # Example
8223 /// ```ignore,no_run
8224 /// # use google_cloud_datastream_v1::model::OracleTable;
8225 /// use google_cloud_datastream_v1::model::OracleColumn;
8226 /// let x = OracleTable::new()
8227 /// .set_oracle_columns([
8228 /// OracleColumn::default()/* use setters */,
8229 /// OracleColumn::default()/* use (different) setters */,
8230 /// ]);
8231 /// ```
8232 pub fn set_oracle_columns<T, V>(mut self, v: T) -> Self
8233 where
8234 T: std::iter::IntoIterator<Item = V>,
8235 V: std::convert::Into<crate::model::OracleColumn>,
8236 {
8237 use std::iter::Iterator;
8238 self.oracle_columns = v.into_iter().map(|i| i.into()).collect();
8239 self
8240 }
8241}
8242
8243impl wkt::message::Message for OracleTable {
8244 fn typename() -> &'static str {
8245 "type.googleapis.com/google.cloud.datastream.v1.OracleTable"
8246 }
8247}
8248
8249/// Oracle schema.
8250#[derive(Clone, Default, PartialEq)]
8251#[non_exhaustive]
8252pub struct OracleSchema {
8253 /// Schema name.
8254 pub schema: std::string::String,
8255
8256 /// Tables in the schema.
8257 pub oracle_tables: std::vec::Vec<crate::model::OracleTable>,
8258
8259 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8260}
8261
8262impl OracleSchema {
8263 /// Creates a new default instance.
8264 pub fn new() -> Self {
8265 std::default::Default::default()
8266 }
8267
8268 /// Sets the value of [schema][crate::model::OracleSchema::schema].
8269 ///
8270 /// # Example
8271 /// ```ignore,no_run
8272 /// # use google_cloud_datastream_v1::model::OracleSchema;
8273 /// let x = OracleSchema::new().set_schema("example");
8274 /// ```
8275 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8276 self.schema = v.into();
8277 self
8278 }
8279
8280 /// Sets the value of [oracle_tables][crate::model::OracleSchema::oracle_tables].
8281 ///
8282 /// # Example
8283 /// ```ignore,no_run
8284 /// # use google_cloud_datastream_v1::model::OracleSchema;
8285 /// use google_cloud_datastream_v1::model::OracleTable;
8286 /// let x = OracleSchema::new()
8287 /// .set_oracle_tables([
8288 /// OracleTable::default()/* use setters */,
8289 /// OracleTable::default()/* use (different) setters */,
8290 /// ]);
8291 /// ```
8292 pub fn set_oracle_tables<T, V>(mut self, v: T) -> Self
8293 where
8294 T: std::iter::IntoIterator<Item = V>,
8295 V: std::convert::Into<crate::model::OracleTable>,
8296 {
8297 use std::iter::Iterator;
8298 self.oracle_tables = v.into_iter().map(|i| i.into()).collect();
8299 self
8300 }
8301}
8302
8303impl wkt::message::Message for OracleSchema {
8304 fn typename() -> &'static str {
8305 "type.googleapis.com/google.cloud.datastream.v1.OracleSchema"
8306 }
8307}
8308
8309/// Oracle database structure.
8310#[derive(Clone, Default, PartialEq)]
8311#[non_exhaustive]
8312pub struct OracleRdbms {
8313 /// Oracle schemas/databases in the database server.
8314 pub oracle_schemas: std::vec::Vec<crate::model::OracleSchema>,
8315
8316 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8317}
8318
8319impl OracleRdbms {
8320 /// Creates a new default instance.
8321 pub fn new() -> Self {
8322 std::default::Default::default()
8323 }
8324
8325 /// Sets the value of [oracle_schemas][crate::model::OracleRdbms::oracle_schemas].
8326 ///
8327 /// # Example
8328 /// ```ignore,no_run
8329 /// # use google_cloud_datastream_v1::model::OracleRdbms;
8330 /// use google_cloud_datastream_v1::model::OracleSchema;
8331 /// let x = OracleRdbms::new()
8332 /// .set_oracle_schemas([
8333 /// OracleSchema::default()/* use setters */,
8334 /// OracleSchema::default()/* use (different) setters */,
8335 /// ]);
8336 /// ```
8337 pub fn set_oracle_schemas<T, V>(mut self, v: T) -> Self
8338 where
8339 T: std::iter::IntoIterator<Item = V>,
8340 V: std::convert::Into<crate::model::OracleSchema>,
8341 {
8342 use std::iter::Iterator;
8343 self.oracle_schemas = v.into_iter().map(|i| i.into()).collect();
8344 self
8345 }
8346}
8347
8348impl wkt::message::Message for OracleRdbms {
8349 fn typename() -> &'static str {
8350 "type.googleapis.com/google.cloud.datastream.v1.OracleRdbms"
8351 }
8352}
8353
8354/// Oracle data source configuration
8355#[derive(Clone, Default, PartialEq)]
8356#[non_exhaustive]
8357pub struct OracleSourceConfig {
8358 /// Oracle objects to include in the stream.
8359 pub include_objects: std::option::Option<crate::model::OracleRdbms>,
8360
8361 /// Oracle objects to exclude from the stream.
8362 pub exclude_objects: std::option::Option<crate::model::OracleRdbms>,
8363
8364 /// Maximum number of concurrent CDC tasks. The number should be non-negative.
8365 /// If not set (or set to 0), the system's default value is used.
8366 pub max_concurrent_cdc_tasks: i32,
8367
8368 /// Maximum number of concurrent backfill tasks. The number should be
8369 /// non-negative. If not set (or set to 0), the system's default value is used.
8370 pub max_concurrent_backfill_tasks: i32,
8371
8372 /// The configuration for handle Oracle large objects.
8373 pub large_objects_handling:
8374 std::option::Option<crate::model::oracle_source_config::LargeObjectsHandling>,
8375
8376 /// Configuration to select the CDC method.
8377 pub cdc_method: std::option::Option<crate::model::oracle_source_config::CdcMethod>,
8378
8379 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8380}
8381
8382impl OracleSourceConfig {
8383 /// Creates a new default instance.
8384 pub fn new() -> Self {
8385 std::default::Default::default()
8386 }
8387
8388 /// Sets the value of [include_objects][crate::model::OracleSourceConfig::include_objects].
8389 ///
8390 /// # Example
8391 /// ```ignore,no_run
8392 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8393 /// use google_cloud_datastream_v1::model::OracleRdbms;
8394 /// let x = OracleSourceConfig::new().set_include_objects(OracleRdbms::default()/* use setters */);
8395 /// ```
8396 pub fn set_include_objects<T>(mut self, v: T) -> Self
8397 where
8398 T: std::convert::Into<crate::model::OracleRdbms>,
8399 {
8400 self.include_objects = std::option::Option::Some(v.into());
8401 self
8402 }
8403
8404 /// Sets or clears the value of [include_objects][crate::model::OracleSourceConfig::include_objects].
8405 ///
8406 /// # Example
8407 /// ```ignore,no_run
8408 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8409 /// use google_cloud_datastream_v1::model::OracleRdbms;
8410 /// let x = OracleSourceConfig::new().set_or_clear_include_objects(Some(OracleRdbms::default()/* use setters */));
8411 /// let x = OracleSourceConfig::new().set_or_clear_include_objects(None::<OracleRdbms>);
8412 /// ```
8413 pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
8414 where
8415 T: std::convert::Into<crate::model::OracleRdbms>,
8416 {
8417 self.include_objects = v.map(|x| x.into());
8418 self
8419 }
8420
8421 /// Sets the value of [exclude_objects][crate::model::OracleSourceConfig::exclude_objects].
8422 ///
8423 /// # Example
8424 /// ```ignore,no_run
8425 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8426 /// use google_cloud_datastream_v1::model::OracleRdbms;
8427 /// let x = OracleSourceConfig::new().set_exclude_objects(OracleRdbms::default()/* use setters */);
8428 /// ```
8429 pub fn set_exclude_objects<T>(mut self, v: T) -> Self
8430 where
8431 T: std::convert::Into<crate::model::OracleRdbms>,
8432 {
8433 self.exclude_objects = std::option::Option::Some(v.into());
8434 self
8435 }
8436
8437 /// Sets or clears the value of [exclude_objects][crate::model::OracleSourceConfig::exclude_objects].
8438 ///
8439 /// # Example
8440 /// ```ignore,no_run
8441 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8442 /// use google_cloud_datastream_v1::model::OracleRdbms;
8443 /// let x = OracleSourceConfig::new().set_or_clear_exclude_objects(Some(OracleRdbms::default()/* use setters */));
8444 /// let x = OracleSourceConfig::new().set_or_clear_exclude_objects(None::<OracleRdbms>);
8445 /// ```
8446 pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
8447 where
8448 T: std::convert::Into<crate::model::OracleRdbms>,
8449 {
8450 self.exclude_objects = v.map(|x| x.into());
8451 self
8452 }
8453
8454 /// Sets the value of [max_concurrent_cdc_tasks][crate::model::OracleSourceConfig::max_concurrent_cdc_tasks].
8455 ///
8456 /// # Example
8457 /// ```ignore,no_run
8458 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8459 /// let x = OracleSourceConfig::new().set_max_concurrent_cdc_tasks(42);
8460 /// ```
8461 pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8462 self.max_concurrent_cdc_tasks = v.into();
8463 self
8464 }
8465
8466 /// Sets the value of [max_concurrent_backfill_tasks][crate::model::OracleSourceConfig::max_concurrent_backfill_tasks].
8467 ///
8468 /// # Example
8469 /// ```ignore,no_run
8470 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8471 /// let x = OracleSourceConfig::new().set_max_concurrent_backfill_tasks(42);
8472 /// ```
8473 pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8474 self.max_concurrent_backfill_tasks = v.into();
8475 self
8476 }
8477
8478 /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling].
8479 ///
8480 /// Note that all the setters affecting `large_objects_handling` are mutually
8481 /// exclusive.
8482 ///
8483 /// # Example
8484 /// ```ignore,no_run
8485 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8486 /// use google_cloud_datastream_v1::model::oracle_source_config::DropLargeObjects;
8487 /// let x = OracleSourceConfig::new().set_large_objects_handling(Some(
8488 /// google_cloud_datastream_v1::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(DropLargeObjects::default().into())));
8489 /// ```
8490 pub fn set_large_objects_handling<
8491 T: std::convert::Into<
8492 std::option::Option<crate::model::oracle_source_config::LargeObjectsHandling>,
8493 >,
8494 >(
8495 mut self,
8496 v: T,
8497 ) -> Self {
8498 self.large_objects_handling = v.into();
8499 self
8500 }
8501
8502 /// The value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8503 /// if it holds a `DropLargeObjects`, `None` if the field is not set or
8504 /// holds a different branch.
8505 pub fn drop_large_objects(
8506 &self,
8507 ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>>
8508 {
8509 #[allow(unreachable_patterns)]
8510 self.large_objects_handling.as_ref().and_then(|v| match v {
8511 crate::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(v) => {
8512 std::option::Option::Some(v)
8513 }
8514 _ => std::option::Option::None,
8515 })
8516 }
8517
8518 /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8519 /// to hold a `DropLargeObjects`.
8520 ///
8521 /// Note that all the setters affecting `large_objects_handling` are
8522 /// mutually exclusive.
8523 ///
8524 /// # Example
8525 /// ```ignore,no_run
8526 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8527 /// use google_cloud_datastream_v1::model::oracle_source_config::DropLargeObjects;
8528 /// let x = OracleSourceConfig::new().set_drop_large_objects(DropLargeObjects::default()/* use setters */);
8529 /// assert!(x.drop_large_objects().is_some());
8530 /// assert!(x.stream_large_objects().is_none());
8531 /// ```
8532 pub fn set_drop_large_objects<
8533 T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>>,
8534 >(
8535 mut self,
8536 v: T,
8537 ) -> Self {
8538 self.large_objects_handling = std::option::Option::Some(
8539 crate::model::oracle_source_config::LargeObjectsHandling::DropLargeObjects(v.into()),
8540 );
8541 self
8542 }
8543
8544 /// The value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8545 /// if it holds a `StreamLargeObjects`, `None` if the field is not set or
8546 /// holds a different branch.
8547 pub fn stream_large_objects(
8548 &self,
8549 ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>>
8550 {
8551 #[allow(unreachable_patterns)]
8552 self.large_objects_handling.as_ref().and_then(|v| match v {
8553 crate::model::oracle_source_config::LargeObjectsHandling::StreamLargeObjects(v) => {
8554 std::option::Option::Some(v)
8555 }
8556 _ => std::option::Option::None,
8557 })
8558 }
8559
8560 /// Sets the value of [large_objects_handling][crate::model::OracleSourceConfig::large_objects_handling]
8561 /// to hold a `StreamLargeObjects`.
8562 ///
8563 /// Note that all the setters affecting `large_objects_handling` are
8564 /// mutually exclusive.
8565 ///
8566 /// # Example
8567 /// ```ignore,no_run
8568 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8569 /// use google_cloud_datastream_v1::model::oracle_source_config::StreamLargeObjects;
8570 /// let x = OracleSourceConfig::new().set_stream_large_objects(StreamLargeObjects::default()/* use setters */);
8571 /// assert!(x.stream_large_objects().is_some());
8572 /// assert!(x.drop_large_objects().is_none());
8573 /// ```
8574 pub fn set_stream_large_objects<
8575 T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>>,
8576 >(
8577 mut self,
8578 v: T,
8579 ) -> Self {
8580 self.large_objects_handling = std::option::Option::Some(
8581 crate::model::oracle_source_config::LargeObjectsHandling::StreamLargeObjects(v.into()),
8582 );
8583 self
8584 }
8585
8586 /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method].
8587 ///
8588 /// Note that all the setters affecting `cdc_method` are mutually
8589 /// exclusive.
8590 ///
8591 /// # Example
8592 /// ```ignore,no_run
8593 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8594 /// use google_cloud_datastream_v1::model::oracle_source_config::LogMiner;
8595 /// let x = OracleSourceConfig::new().set_cdc_method(Some(
8596 /// google_cloud_datastream_v1::model::oracle_source_config::CdcMethod::LogMiner(LogMiner::default().into())));
8597 /// ```
8598 pub fn set_cdc_method<
8599 T: std::convert::Into<std::option::Option<crate::model::oracle_source_config::CdcMethod>>,
8600 >(
8601 mut self,
8602 v: T,
8603 ) -> Self {
8604 self.cdc_method = v.into();
8605 self
8606 }
8607
8608 /// The value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8609 /// if it holds a `LogMiner`, `None` if the field is not set or
8610 /// holds a different branch.
8611 pub fn log_miner(
8612 &self,
8613 ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::LogMiner>> {
8614 #[allow(unreachable_patterns)]
8615 self.cdc_method.as_ref().and_then(|v| match v {
8616 crate::model::oracle_source_config::CdcMethod::LogMiner(v) => {
8617 std::option::Option::Some(v)
8618 }
8619 _ => std::option::Option::None,
8620 })
8621 }
8622
8623 /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8624 /// to hold a `LogMiner`.
8625 ///
8626 /// Note that all the setters affecting `cdc_method` are
8627 /// mutually exclusive.
8628 ///
8629 /// # Example
8630 /// ```ignore,no_run
8631 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8632 /// use google_cloud_datastream_v1::model::oracle_source_config::LogMiner;
8633 /// let x = OracleSourceConfig::new().set_log_miner(LogMiner::default()/* use setters */);
8634 /// assert!(x.log_miner().is_some());
8635 /// assert!(x.binary_log_parser().is_none());
8636 /// ```
8637 pub fn set_log_miner<
8638 T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::LogMiner>>,
8639 >(
8640 mut self,
8641 v: T,
8642 ) -> Self {
8643 self.cdc_method = std::option::Option::Some(
8644 crate::model::oracle_source_config::CdcMethod::LogMiner(v.into()),
8645 );
8646 self
8647 }
8648
8649 /// The value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8650 /// if it holds a `BinaryLogParser`, `None` if the field is not set or
8651 /// holds a different branch.
8652 pub fn binary_log_parser(
8653 &self,
8654 ) -> std::option::Option<&std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>>
8655 {
8656 #[allow(unreachable_patterns)]
8657 self.cdc_method.as_ref().and_then(|v| match v {
8658 crate::model::oracle_source_config::CdcMethod::BinaryLogParser(v) => {
8659 std::option::Option::Some(v)
8660 }
8661 _ => std::option::Option::None,
8662 })
8663 }
8664
8665 /// Sets the value of [cdc_method][crate::model::OracleSourceConfig::cdc_method]
8666 /// to hold a `BinaryLogParser`.
8667 ///
8668 /// Note that all the setters affecting `cdc_method` are
8669 /// mutually exclusive.
8670 ///
8671 /// # Example
8672 /// ```ignore,no_run
8673 /// # use google_cloud_datastream_v1::model::OracleSourceConfig;
8674 /// use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8675 /// let x = OracleSourceConfig::new().set_binary_log_parser(BinaryLogParser::default()/* use setters */);
8676 /// assert!(x.binary_log_parser().is_some());
8677 /// assert!(x.log_miner().is_none());
8678 /// ```
8679 pub fn set_binary_log_parser<
8680 T: std::convert::Into<std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>>,
8681 >(
8682 mut self,
8683 v: T,
8684 ) -> Self {
8685 self.cdc_method = std::option::Option::Some(
8686 crate::model::oracle_source_config::CdcMethod::BinaryLogParser(v.into()),
8687 );
8688 self
8689 }
8690}
8691
8692impl wkt::message::Message for OracleSourceConfig {
8693 fn typename() -> &'static str {
8694 "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig"
8695 }
8696}
8697
8698/// Defines additional types related to [OracleSourceConfig].
8699pub mod oracle_source_config {
8700 #[allow(unused_imports)]
8701 use super::*;
8702
8703 /// Configuration to drop large object values.
8704 #[derive(Clone, Default, PartialEq)]
8705 #[non_exhaustive]
8706 pub struct DropLargeObjects {
8707 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8708 }
8709
8710 impl DropLargeObjects {
8711 /// Creates a new default instance.
8712 pub fn new() -> Self {
8713 std::default::Default::default()
8714 }
8715 }
8716
8717 impl wkt::message::Message for DropLargeObjects {
8718 fn typename() -> &'static str {
8719 "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.DropLargeObjects"
8720 }
8721 }
8722
8723 /// Configuration to stream large object values.
8724 #[derive(Clone, Default, PartialEq)]
8725 #[non_exhaustive]
8726 pub struct StreamLargeObjects {
8727 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8728 }
8729
8730 impl StreamLargeObjects {
8731 /// Creates a new default instance.
8732 pub fn new() -> Self {
8733 std::default::Default::default()
8734 }
8735 }
8736
8737 impl wkt::message::Message for StreamLargeObjects {
8738 fn typename() -> &'static str {
8739 "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.StreamLargeObjects"
8740 }
8741 }
8742
8743 /// Configuration to use LogMiner CDC method.
8744 #[derive(Clone, Default, PartialEq)]
8745 #[non_exhaustive]
8746 pub struct LogMiner {
8747 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8748 }
8749
8750 impl LogMiner {
8751 /// Creates a new default instance.
8752 pub fn new() -> Self {
8753 std::default::Default::default()
8754 }
8755 }
8756
8757 impl wkt::message::Message for LogMiner {
8758 fn typename() -> &'static str {
8759 "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.LogMiner"
8760 }
8761 }
8762
8763 /// Configuration to use Binary Log Parser CDC technique.
8764 #[derive(Clone, Default, PartialEq)]
8765 #[non_exhaustive]
8766 pub struct BinaryLogParser {
8767 /// Configuration to specify how the log file should be accessed.
8768 pub log_file_access: std::option::Option<
8769 crate::model::oracle_source_config::binary_log_parser::LogFileAccess,
8770 >,
8771
8772 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8773 }
8774
8775 impl BinaryLogParser {
8776 /// Creates a new default instance.
8777 pub fn new() -> Self {
8778 std::default::Default::default()
8779 }
8780
8781 /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access].
8782 ///
8783 /// Note that all the setters affecting `log_file_access` are mutually
8784 /// exclusive.
8785 ///
8786 /// # Example
8787 /// ```ignore,no_run
8788 /// # use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8789 /// use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess;
8790 /// let x = BinaryLogParser::new().set_log_file_access(Some(
8791 /// google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(OracleAsmLogFileAccess::default().into())));
8792 /// ```
8793 pub fn set_log_file_access<
8794 T: std::convert::Into<
8795 std::option::Option<
8796 crate::model::oracle_source_config::binary_log_parser::LogFileAccess,
8797 >,
8798 >,
8799 >(
8800 mut self,
8801 v: T,
8802 ) -> Self {
8803 self.log_file_access = v.into();
8804 self
8805 }
8806
8807 /// The value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8808 /// if it holds a `OracleAsmLogFileAccess`, `None` if the field is not set or
8809 /// holds a different branch.
8810 pub fn oracle_asm_log_file_access(
8811 &self,
8812 ) -> std::option::Option<
8813 &std::boxed::Box<
8814 crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess,
8815 >,
8816 > {
8817 #[allow(unreachable_patterns)]
8818 self.log_file_access.as_ref().and_then(|v| match v {
8819 crate::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(v) => std::option::Option::Some(v),
8820 _ => std::option::Option::None,
8821 })
8822 }
8823
8824 /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8825 /// to hold a `OracleAsmLogFileAccess`.
8826 ///
8827 /// Note that all the setters affecting `log_file_access` are
8828 /// mutually exclusive.
8829 ///
8830 /// # Example
8831 /// ```ignore,no_run
8832 /// # use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8833 /// use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess;
8834 /// let x = BinaryLogParser::new().set_oracle_asm_log_file_access(OracleAsmLogFileAccess::default()/* use setters */);
8835 /// assert!(x.oracle_asm_log_file_access().is_some());
8836 /// assert!(x.log_file_directories().is_none());
8837 /// ```
8838 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{
8839 self.log_file_access = std::option::Option::Some(
8840 crate::model::oracle_source_config::binary_log_parser::LogFileAccess::OracleAsmLogFileAccess(
8841 v.into()
8842 )
8843 );
8844 self
8845 }
8846
8847 /// The value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8848 /// if it holds a `LogFileDirectories`, `None` if the field is not set or
8849 /// holds a different branch.
8850 pub fn log_file_directories(
8851 &self,
8852 ) -> std::option::Option<
8853 &std::boxed::Box<
8854 crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
8855 >,
8856 > {
8857 #[allow(unreachable_patterns)]
8858 self.log_file_access.as_ref().and_then(|v| match v {
8859 crate::model::oracle_source_config::binary_log_parser::LogFileAccess::LogFileDirectories(v) => std::option::Option::Some(v),
8860 _ => std::option::Option::None,
8861 })
8862 }
8863
8864 /// Sets the value of [log_file_access][crate::model::oracle_source_config::BinaryLogParser::log_file_access]
8865 /// to hold a `LogFileDirectories`.
8866 ///
8867 /// Note that all the setters affecting `log_file_access` are
8868 /// mutually exclusive.
8869 ///
8870 /// # Example
8871 /// ```ignore,no_run
8872 /// # use google_cloud_datastream_v1::model::oracle_source_config::BinaryLogParser;
8873 /// use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileDirectories;
8874 /// let x = BinaryLogParser::new().set_log_file_directories(LogFileDirectories::default()/* use setters */);
8875 /// assert!(x.log_file_directories().is_some());
8876 /// assert!(x.oracle_asm_log_file_access().is_none());
8877 /// ```
8878 pub fn set_log_file_directories<
8879 T: std::convert::Into<
8880 std::boxed::Box<
8881 crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
8882 >,
8883 >,
8884 >(
8885 mut self,
8886 v: T,
8887 ) -> Self {
8888 self.log_file_access = std::option::Option::Some(
8889 crate::model::oracle_source_config::binary_log_parser::LogFileAccess::LogFileDirectories(
8890 v.into()
8891 )
8892 );
8893 self
8894 }
8895 }
8896
8897 impl wkt::message::Message for BinaryLogParser {
8898 fn typename() -> &'static str {
8899 "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser"
8900 }
8901 }
8902
8903 /// Defines additional types related to [BinaryLogParser].
8904 pub mod binary_log_parser {
8905 #[allow(unused_imports)]
8906 use super::*;
8907
8908 /// Configuration to use Oracle ASM to access the log files.
8909 #[derive(Clone, Default, PartialEq)]
8910 #[non_exhaustive]
8911 pub struct OracleAsmLogFileAccess {
8912 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8913 }
8914
8915 impl OracleAsmLogFileAccess {
8916 /// Creates a new default instance.
8917 pub fn new() -> Self {
8918 std::default::Default::default()
8919 }
8920 }
8921
8922 impl wkt::message::Message for OracleAsmLogFileAccess {
8923 fn typename() -> &'static str {
8924 "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser.OracleAsmLogFileAccess"
8925 }
8926 }
8927
8928 /// Configuration to specify the Oracle directories to access the log files.
8929 #[derive(Clone, Default, PartialEq)]
8930 #[non_exhaustive]
8931 pub struct LogFileDirectories {
8932 /// Required. Oracle directory for online logs.
8933 pub online_log_directory: std::string::String,
8934
8935 /// Required. Oracle directory for archived logs.
8936 pub archived_log_directory: std::string::String,
8937
8938 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8939 }
8940
8941 impl LogFileDirectories {
8942 /// Creates a new default instance.
8943 pub fn new() -> Self {
8944 std::default::Default::default()
8945 }
8946
8947 /// Sets the value of [online_log_directory][crate::model::oracle_source_config::binary_log_parser::LogFileDirectories::online_log_directory].
8948 ///
8949 /// # Example
8950 /// ```ignore,no_run
8951 /// # use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileDirectories;
8952 /// let x = LogFileDirectories::new().set_online_log_directory("example");
8953 /// ```
8954 pub fn set_online_log_directory<T: std::convert::Into<std::string::String>>(
8955 mut self,
8956 v: T,
8957 ) -> Self {
8958 self.online_log_directory = v.into();
8959 self
8960 }
8961
8962 /// Sets the value of [archived_log_directory][crate::model::oracle_source_config::binary_log_parser::LogFileDirectories::archived_log_directory].
8963 ///
8964 /// # Example
8965 /// ```ignore,no_run
8966 /// # use google_cloud_datastream_v1::model::oracle_source_config::binary_log_parser::LogFileDirectories;
8967 /// let x = LogFileDirectories::new().set_archived_log_directory("example");
8968 /// ```
8969 pub fn set_archived_log_directory<T: std::convert::Into<std::string::String>>(
8970 mut self,
8971 v: T,
8972 ) -> Self {
8973 self.archived_log_directory = v.into();
8974 self
8975 }
8976 }
8977
8978 impl wkt::message::Message for LogFileDirectories {
8979 fn typename() -> &'static str {
8980 "type.googleapis.com/google.cloud.datastream.v1.OracleSourceConfig.BinaryLogParser.LogFileDirectories"
8981 }
8982 }
8983
8984 /// Configuration to specify how the log file should be accessed.
8985 #[derive(Clone, Debug, PartialEq)]
8986 #[non_exhaustive]
8987 pub enum LogFileAccess {
8988 /// Use Oracle ASM.
8989 OracleAsmLogFileAccess(
8990 std::boxed::Box<
8991 crate::model::oracle_source_config::binary_log_parser::OracleAsmLogFileAccess,
8992 >,
8993 ),
8994 /// Use Oracle directories.
8995 LogFileDirectories(
8996 std::boxed::Box<
8997 crate::model::oracle_source_config::binary_log_parser::LogFileDirectories,
8998 >,
8999 ),
9000 }
9001 }
9002
9003 /// The configuration for handle Oracle large objects.
9004 #[derive(Clone, Debug, PartialEq)]
9005 #[non_exhaustive]
9006 pub enum LargeObjectsHandling {
9007 /// Drop large object values.
9008 DropLargeObjects(std::boxed::Box<crate::model::oracle_source_config::DropLargeObjects>),
9009 /// Stream large object values.
9010 StreamLargeObjects(std::boxed::Box<crate::model::oracle_source_config::StreamLargeObjects>),
9011 }
9012
9013 /// Configuration to select the CDC method.
9014 #[derive(Clone, Debug, PartialEq)]
9015 #[non_exhaustive]
9016 pub enum CdcMethod {
9017 /// Use LogMiner.
9018 LogMiner(std::boxed::Box<crate::model::oracle_source_config::LogMiner>),
9019 /// Use Binary Log Parser.
9020 BinaryLogParser(std::boxed::Box<crate::model::oracle_source_config::BinaryLogParser>),
9021 }
9022}
9023
9024/// PostgreSQL Column.
9025#[derive(Clone, Default, PartialEq)]
9026#[non_exhaustive]
9027pub struct PostgresqlColumn {
9028 /// Column name.
9029 pub column: std::string::String,
9030
9031 /// The PostgreSQL data type.
9032 pub data_type: std::string::String,
9033
9034 /// Column length.
9035 pub length: i32,
9036
9037 /// Column precision.
9038 pub precision: i32,
9039
9040 /// Column scale.
9041 pub scale: i32,
9042
9043 /// Whether or not the column represents a primary key.
9044 pub primary_key: bool,
9045
9046 /// Whether or not the column can accept a null value.
9047 pub nullable: bool,
9048
9049 /// The ordinal position of the column in the table.
9050 pub ordinal_position: i32,
9051
9052 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9053}
9054
9055impl PostgresqlColumn {
9056 /// Creates a new default instance.
9057 pub fn new() -> Self {
9058 std::default::Default::default()
9059 }
9060
9061 /// Sets the value of [column][crate::model::PostgresqlColumn::column].
9062 ///
9063 /// # Example
9064 /// ```ignore,no_run
9065 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
9066 /// let x = PostgresqlColumn::new().set_column("example");
9067 /// ```
9068 pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9069 self.column = v.into();
9070 self
9071 }
9072
9073 /// Sets the value of [data_type][crate::model::PostgresqlColumn::data_type].
9074 ///
9075 /// # Example
9076 /// ```ignore,no_run
9077 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
9078 /// let x = PostgresqlColumn::new().set_data_type("example");
9079 /// ```
9080 pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9081 self.data_type = v.into();
9082 self
9083 }
9084
9085 /// Sets the value of [length][crate::model::PostgresqlColumn::length].
9086 ///
9087 /// # Example
9088 /// ```ignore,no_run
9089 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
9090 /// let x = PostgresqlColumn::new().set_length(42);
9091 /// ```
9092 pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9093 self.length = v.into();
9094 self
9095 }
9096
9097 /// Sets the value of [precision][crate::model::PostgresqlColumn::precision].
9098 ///
9099 /// # Example
9100 /// ```ignore,no_run
9101 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
9102 /// let x = PostgresqlColumn::new().set_precision(42);
9103 /// ```
9104 pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9105 self.precision = v.into();
9106 self
9107 }
9108
9109 /// Sets the value of [scale][crate::model::PostgresqlColumn::scale].
9110 ///
9111 /// # Example
9112 /// ```ignore,no_run
9113 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
9114 /// let x = PostgresqlColumn::new().set_scale(42);
9115 /// ```
9116 pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9117 self.scale = v.into();
9118 self
9119 }
9120
9121 /// Sets the value of [primary_key][crate::model::PostgresqlColumn::primary_key].
9122 ///
9123 /// # Example
9124 /// ```ignore,no_run
9125 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
9126 /// let x = PostgresqlColumn::new().set_primary_key(true);
9127 /// ```
9128 pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9129 self.primary_key = v.into();
9130 self
9131 }
9132
9133 /// Sets the value of [nullable][crate::model::PostgresqlColumn::nullable].
9134 ///
9135 /// # Example
9136 /// ```ignore,no_run
9137 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
9138 /// let x = PostgresqlColumn::new().set_nullable(true);
9139 /// ```
9140 pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9141 self.nullable = v.into();
9142 self
9143 }
9144
9145 /// Sets the value of [ordinal_position][crate::model::PostgresqlColumn::ordinal_position].
9146 ///
9147 /// # Example
9148 /// ```ignore,no_run
9149 /// # use google_cloud_datastream_v1::model::PostgresqlColumn;
9150 /// let x = PostgresqlColumn::new().set_ordinal_position(42);
9151 /// ```
9152 pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9153 self.ordinal_position = v.into();
9154 self
9155 }
9156}
9157
9158impl wkt::message::Message for PostgresqlColumn {
9159 fn typename() -> &'static str {
9160 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlColumn"
9161 }
9162}
9163
9164/// PostgreSQL table.
9165#[derive(Clone, Default, PartialEq)]
9166#[non_exhaustive]
9167pub struct PostgresqlTable {
9168 /// Table name.
9169 pub table: std::string::String,
9170
9171 /// PostgreSQL columns in the schema.
9172 /// When unspecified as part of include/exclude objects,
9173 /// includes/excludes everything.
9174 pub postgresql_columns: std::vec::Vec<crate::model::PostgresqlColumn>,
9175
9176 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9177}
9178
9179impl PostgresqlTable {
9180 /// Creates a new default instance.
9181 pub fn new() -> Self {
9182 std::default::Default::default()
9183 }
9184
9185 /// Sets the value of [table][crate::model::PostgresqlTable::table].
9186 ///
9187 /// # Example
9188 /// ```ignore,no_run
9189 /// # use google_cloud_datastream_v1::model::PostgresqlTable;
9190 /// let x = PostgresqlTable::new().set_table("example");
9191 /// ```
9192 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9193 self.table = v.into();
9194 self
9195 }
9196
9197 /// Sets the value of [postgresql_columns][crate::model::PostgresqlTable::postgresql_columns].
9198 ///
9199 /// # Example
9200 /// ```ignore,no_run
9201 /// # use google_cloud_datastream_v1::model::PostgresqlTable;
9202 /// use google_cloud_datastream_v1::model::PostgresqlColumn;
9203 /// let x = PostgresqlTable::new()
9204 /// .set_postgresql_columns([
9205 /// PostgresqlColumn::default()/* use setters */,
9206 /// PostgresqlColumn::default()/* use (different) setters */,
9207 /// ]);
9208 /// ```
9209 pub fn set_postgresql_columns<T, V>(mut self, v: T) -> Self
9210 where
9211 T: std::iter::IntoIterator<Item = V>,
9212 V: std::convert::Into<crate::model::PostgresqlColumn>,
9213 {
9214 use std::iter::Iterator;
9215 self.postgresql_columns = v.into_iter().map(|i| i.into()).collect();
9216 self
9217 }
9218}
9219
9220impl wkt::message::Message for PostgresqlTable {
9221 fn typename() -> &'static str {
9222 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlTable"
9223 }
9224}
9225
9226/// PostgreSQL schema.
9227#[derive(Clone, Default, PartialEq)]
9228#[non_exhaustive]
9229pub struct PostgresqlSchema {
9230 /// Schema name.
9231 pub schema: std::string::String,
9232
9233 /// Tables in the schema.
9234 pub postgresql_tables: std::vec::Vec<crate::model::PostgresqlTable>,
9235
9236 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9237}
9238
9239impl PostgresqlSchema {
9240 /// Creates a new default instance.
9241 pub fn new() -> Self {
9242 std::default::Default::default()
9243 }
9244
9245 /// Sets the value of [schema][crate::model::PostgresqlSchema::schema].
9246 ///
9247 /// # Example
9248 /// ```ignore,no_run
9249 /// # use google_cloud_datastream_v1::model::PostgresqlSchema;
9250 /// let x = PostgresqlSchema::new().set_schema("example");
9251 /// ```
9252 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9253 self.schema = v.into();
9254 self
9255 }
9256
9257 /// Sets the value of [postgresql_tables][crate::model::PostgresqlSchema::postgresql_tables].
9258 ///
9259 /// # Example
9260 /// ```ignore,no_run
9261 /// # use google_cloud_datastream_v1::model::PostgresqlSchema;
9262 /// use google_cloud_datastream_v1::model::PostgresqlTable;
9263 /// let x = PostgresqlSchema::new()
9264 /// .set_postgresql_tables([
9265 /// PostgresqlTable::default()/* use setters */,
9266 /// PostgresqlTable::default()/* use (different) setters */,
9267 /// ]);
9268 /// ```
9269 pub fn set_postgresql_tables<T, V>(mut self, v: T) -> Self
9270 where
9271 T: std::iter::IntoIterator<Item = V>,
9272 V: std::convert::Into<crate::model::PostgresqlTable>,
9273 {
9274 use std::iter::Iterator;
9275 self.postgresql_tables = v.into_iter().map(|i| i.into()).collect();
9276 self
9277 }
9278}
9279
9280impl wkt::message::Message for PostgresqlSchema {
9281 fn typename() -> &'static str {
9282 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSchema"
9283 }
9284}
9285
9286/// PostgreSQL database structure.
9287#[derive(Clone, Default, PartialEq)]
9288#[non_exhaustive]
9289pub struct PostgresqlRdbms {
9290 /// PostgreSQL schemas in the database server.
9291 pub postgresql_schemas: std::vec::Vec<crate::model::PostgresqlSchema>,
9292
9293 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9294}
9295
9296impl PostgresqlRdbms {
9297 /// Creates a new default instance.
9298 pub fn new() -> Self {
9299 std::default::Default::default()
9300 }
9301
9302 /// Sets the value of [postgresql_schemas][crate::model::PostgresqlRdbms::postgresql_schemas].
9303 ///
9304 /// # Example
9305 /// ```ignore,no_run
9306 /// # use google_cloud_datastream_v1::model::PostgresqlRdbms;
9307 /// use google_cloud_datastream_v1::model::PostgresqlSchema;
9308 /// let x = PostgresqlRdbms::new()
9309 /// .set_postgresql_schemas([
9310 /// PostgresqlSchema::default()/* use setters */,
9311 /// PostgresqlSchema::default()/* use (different) setters */,
9312 /// ]);
9313 /// ```
9314 pub fn set_postgresql_schemas<T, V>(mut self, v: T) -> Self
9315 where
9316 T: std::iter::IntoIterator<Item = V>,
9317 V: std::convert::Into<crate::model::PostgresqlSchema>,
9318 {
9319 use std::iter::Iterator;
9320 self.postgresql_schemas = v.into_iter().map(|i| i.into()).collect();
9321 self
9322 }
9323}
9324
9325impl wkt::message::Message for PostgresqlRdbms {
9326 fn typename() -> &'static str {
9327 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlRdbms"
9328 }
9329}
9330
9331/// PostgreSQL data source configuration
9332#[derive(Clone, Default, PartialEq)]
9333#[non_exhaustive]
9334pub struct PostgresqlSourceConfig {
9335 /// PostgreSQL objects to include in the stream.
9336 pub include_objects: std::option::Option<crate::model::PostgresqlRdbms>,
9337
9338 /// PostgreSQL objects to exclude from the stream.
9339 pub exclude_objects: std::option::Option<crate::model::PostgresqlRdbms>,
9340
9341 /// Required. Immutable. The name of the logical replication slot that's
9342 /// configured with the pgoutput plugin.
9343 pub replication_slot: std::string::String,
9344
9345 /// Required. The name of the publication that includes the set of all tables
9346 /// that are defined in the stream's include_objects.
9347 pub publication: std::string::String,
9348
9349 /// Maximum number of concurrent backfill tasks. The number should be non
9350 /// negative. If not set (or set to 0), the system's default value will be
9351 /// used.
9352 pub max_concurrent_backfill_tasks: i32,
9353
9354 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9355}
9356
9357impl PostgresqlSourceConfig {
9358 /// Creates a new default instance.
9359 pub fn new() -> Self {
9360 std::default::Default::default()
9361 }
9362
9363 /// Sets the value of [include_objects][crate::model::PostgresqlSourceConfig::include_objects].
9364 ///
9365 /// # Example
9366 /// ```ignore,no_run
9367 /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9368 /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9369 /// let x = PostgresqlSourceConfig::new().set_include_objects(PostgresqlRdbms::default()/* use setters */);
9370 /// ```
9371 pub fn set_include_objects<T>(mut self, v: T) -> Self
9372 where
9373 T: std::convert::Into<crate::model::PostgresqlRdbms>,
9374 {
9375 self.include_objects = std::option::Option::Some(v.into());
9376 self
9377 }
9378
9379 /// Sets or clears the value of [include_objects][crate::model::PostgresqlSourceConfig::include_objects].
9380 ///
9381 /// # Example
9382 /// ```ignore,no_run
9383 /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9384 /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9385 /// let x = PostgresqlSourceConfig::new().set_or_clear_include_objects(Some(PostgresqlRdbms::default()/* use setters */));
9386 /// let x = PostgresqlSourceConfig::new().set_or_clear_include_objects(None::<PostgresqlRdbms>);
9387 /// ```
9388 pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
9389 where
9390 T: std::convert::Into<crate::model::PostgresqlRdbms>,
9391 {
9392 self.include_objects = v.map(|x| x.into());
9393 self
9394 }
9395
9396 /// Sets the value of [exclude_objects][crate::model::PostgresqlSourceConfig::exclude_objects].
9397 ///
9398 /// # Example
9399 /// ```ignore,no_run
9400 /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9401 /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9402 /// let x = PostgresqlSourceConfig::new().set_exclude_objects(PostgresqlRdbms::default()/* use setters */);
9403 /// ```
9404 pub fn set_exclude_objects<T>(mut self, v: T) -> Self
9405 where
9406 T: std::convert::Into<crate::model::PostgresqlRdbms>,
9407 {
9408 self.exclude_objects = std::option::Option::Some(v.into());
9409 self
9410 }
9411
9412 /// Sets or clears the value of [exclude_objects][crate::model::PostgresqlSourceConfig::exclude_objects].
9413 ///
9414 /// # Example
9415 /// ```ignore,no_run
9416 /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9417 /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
9418 /// let x = PostgresqlSourceConfig::new().set_or_clear_exclude_objects(Some(PostgresqlRdbms::default()/* use setters */));
9419 /// let x = PostgresqlSourceConfig::new().set_or_clear_exclude_objects(None::<PostgresqlRdbms>);
9420 /// ```
9421 pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
9422 where
9423 T: std::convert::Into<crate::model::PostgresqlRdbms>,
9424 {
9425 self.exclude_objects = v.map(|x| x.into());
9426 self
9427 }
9428
9429 /// Sets the value of [replication_slot][crate::model::PostgresqlSourceConfig::replication_slot].
9430 ///
9431 /// # Example
9432 /// ```ignore,no_run
9433 /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9434 /// let x = PostgresqlSourceConfig::new().set_replication_slot("example");
9435 /// ```
9436 pub fn set_replication_slot<T: std::convert::Into<std::string::String>>(
9437 mut self,
9438 v: T,
9439 ) -> Self {
9440 self.replication_slot = v.into();
9441 self
9442 }
9443
9444 /// Sets the value of [publication][crate::model::PostgresqlSourceConfig::publication].
9445 ///
9446 /// # Example
9447 /// ```ignore,no_run
9448 /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9449 /// let x = PostgresqlSourceConfig::new().set_publication("example");
9450 /// ```
9451 pub fn set_publication<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9452 self.publication = v.into();
9453 self
9454 }
9455
9456 /// Sets the value of [max_concurrent_backfill_tasks][crate::model::PostgresqlSourceConfig::max_concurrent_backfill_tasks].
9457 ///
9458 /// # Example
9459 /// ```ignore,no_run
9460 /// # use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
9461 /// let x = PostgresqlSourceConfig::new().set_max_concurrent_backfill_tasks(42);
9462 /// ```
9463 pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9464 self.max_concurrent_backfill_tasks = v.into();
9465 self
9466 }
9467}
9468
9469impl wkt::message::Message for PostgresqlSourceConfig {
9470 fn typename() -> &'static str {
9471 "type.googleapis.com/google.cloud.datastream.v1.PostgresqlSourceConfig"
9472 }
9473}
9474
9475/// SQLServer Column.
9476#[derive(Clone, Default, PartialEq)]
9477#[non_exhaustive]
9478pub struct SqlServerColumn {
9479 /// Column name.
9480 pub column: std::string::String,
9481
9482 /// The SQLServer data type.
9483 pub data_type: std::string::String,
9484
9485 /// Column length.
9486 pub length: i32,
9487
9488 /// Column precision.
9489 pub precision: i32,
9490
9491 /// Column scale.
9492 pub scale: i32,
9493
9494 /// Whether or not the column represents a primary key.
9495 pub primary_key: bool,
9496
9497 /// Whether or not the column can accept a null value.
9498 pub nullable: bool,
9499
9500 /// The ordinal position of the column in the table.
9501 pub ordinal_position: i32,
9502
9503 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9504}
9505
9506impl SqlServerColumn {
9507 /// Creates a new default instance.
9508 pub fn new() -> Self {
9509 std::default::Default::default()
9510 }
9511
9512 /// Sets the value of [column][crate::model::SqlServerColumn::column].
9513 ///
9514 /// # Example
9515 /// ```ignore,no_run
9516 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9517 /// let x = SqlServerColumn::new().set_column("example");
9518 /// ```
9519 pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9520 self.column = v.into();
9521 self
9522 }
9523
9524 /// Sets the value of [data_type][crate::model::SqlServerColumn::data_type].
9525 ///
9526 /// # Example
9527 /// ```ignore,no_run
9528 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9529 /// let x = SqlServerColumn::new().set_data_type("example");
9530 /// ```
9531 pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9532 self.data_type = v.into();
9533 self
9534 }
9535
9536 /// Sets the value of [length][crate::model::SqlServerColumn::length].
9537 ///
9538 /// # Example
9539 /// ```ignore,no_run
9540 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9541 /// let x = SqlServerColumn::new().set_length(42);
9542 /// ```
9543 pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9544 self.length = v.into();
9545 self
9546 }
9547
9548 /// Sets the value of [precision][crate::model::SqlServerColumn::precision].
9549 ///
9550 /// # Example
9551 /// ```ignore,no_run
9552 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9553 /// let x = SqlServerColumn::new().set_precision(42);
9554 /// ```
9555 pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9556 self.precision = v.into();
9557 self
9558 }
9559
9560 /// Sets the value of [scale][crate::model::SqlServerColumn::scale].
9561 ///
9562 /// # Example
9563 /// ```ignore,no_run
9564 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9565 /// let x = SqlServerColumn::new().set_scale(42);
9566 /// ```
9567 pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9568 self.scale = v.into();
9569 self
9570 }
9571
9572 /// Sets the value of [primary_key][crate::model::SqlServerColumn::primary_key].
9573 ///
9574 /// # Example
9575 /// ```ignore,no_run
9576 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9577 /// let x = SqlServerColumn::new().set_primary_key(true);
9578 /// ```
9579 pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9580 self.primary_key = v.into();
9581 self
9582 }
9583
9584 /// Sets the value of [nullable][crate::model::SqlServerColumn::nullable].
9585 ///
9586 /// # Example
9587 /// ```ignore,no_run
9588 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9589 /// let x = SqlServerColumn::new().set_nullable(true);
9590 /// ```
9591 pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9592 self.nullable = v.into();
9593 self
9594 }
9595
9596 /// Sets the value of [ordinal_position][crate::model::SqlServerColumn::ordinal_position].
9597 ///
9598 /// # Example
9599 /// ```ignore,no_run
9600 /// # use google_cloud_datastream_v1::model::SqlServerColumn;
9601 /// let x = SqlServerColumn::new().set_ordinal_position(42);
9602 /// ```
9603 pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9604 self.ordinal_position = v.into();
9605 self
9606 }
9607}
9608
9609impl wkt::message::Message for SqlServerColumn {
9610 fn typename() -> &'static str {
9611 "type.googleapis.com/google.cloud.datastream.v1.SqlServerColumn"
9612 }
9613}
9614
9615/// SQLServer table.
9616#[derive(Clone, Default, PartialEq)]
9617#[non_exhaustive]
9618pub struct SqlServerTable {
9619 /// Table name.
9620 pub table: std::string::String,
9621
9622 /// SQLServer columns in the schema.
9623 /// When unspecified as part of include/exclude objects,
9624 /// includes/excludes everything.
9625 pub columns: std::vec::Vec<crate::model::SqlServerColumn>,
9626
9627 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9628}
9629
9630impl SqlServerTable {
9631 /// Creates a new default instance.
9632 pub fn new() -> Self {
9633 std::default::Default::default()
9634 }
9635
9636 /// Sets the value of [table][crate::model::SqlServerTable::table].
9637 ///
9638 /// # Example
9639 /// ```ignore,no_run
9640 /// # use google_cloud_datastream_v1::model::SqlServerTable;
9641 /// let x = SqlServerTable::new().set_table("example");
9642 /// ```
9643 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9644 self.table = v.into();
9645 self
9646 }
9647
9648 /// Sets the value of [columns][crate::model::SqlServerTable::columns].
9649 ///
9650 /// # Example
9651 /// ```ignore,no_run
9652 /// # use google_cloud_datastream_v1::model::SqlServerTable;
9653 /// use google_cloud_datastream_v1::model::SqlServerColumn;
9654 /// let x = SqlServerTable::new()
9655 /// .set_columns([
9656 /// SqlServerColumn::default()/* use setters */,
9657 /// SqlServerColumn::default()/* use (different) setters */,
9658 /// ]);
9659 /// ```
9660 pub fn set_columns<T, V>(mut self, v: T) -> Self
9661 where
9662 T: std::iter::IntoIterator<Item = V>,
9663 V: std::convert::Into<crate::model::SqlServerColumn>,
9664 {
9665 use std::iter::Iterator;
9666 self.columns = v.into_iter().map(|i| i.into()).collect();
9667 self
9668 }
9669}
9670
9671impl wkt::message::Message for SqlServerTable {
9672 fn typename() -> &'static str {
9673 "type.googleapis.com/google.cloud.datastream.v1.SqlServerTable"
9674 }
9675}
9676
9677/// SQLServer schema.
9678#[derive(Clone, Default, PartialEq)]
9679#[non_exhaustive]
9680pub struct SqlServerSchema {
9681 /// Schema name.
9682 pub schema: std::string::String,
9683
9684 /// Tables in the schema.
9685 pub tables: std::vec::Vec<crate::model::SqlServerTable>,
9686
9687 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9688}
9689
9690impl SqlServerSchema {
9691 /// Creates a new default instance.
9692 pub fn new() -> Self {
9693 std::default::Default::default()
9694 }
9695
9696 /// Sets the value of [schema][crate::model::SqlServerSchema::schema].
9697 ///
9698 /// # Example
9699 /// ```ignore,no_run
9700 /// # use google_cloud_datastream_v1::model::SqlServerSchema;
9701 /// let x = SqlServerSchema::new().set_schema("example");
9702 /// ```
9703 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9704 self.schema = v.into();
9705 self
9706 }
9707
9708 /// Sets the value of [tables][crate::model::SqlServerSchema::tables].
9709 ///
9710 /// # Example
9711 /// ```ignore,no_run
9712 /// # use google_cloud_datastream_v1::model::SqlServerSchema;
9713 /// use google_cloud_datastream_v1::model::SqlServerTable;
9714 /// let x = SqlServerSchema::new()
9715 /// .set_tables([
9716 /// SqlServerTable::default()/* use setters */,
9717 /// SqlServerTable::default()/* use (different) setters */,
9718 /// ]);
9719 /// ```
9720 pub fn set_tables<T, V>(mut self, v: T) -> Self
9721 where
9722 T: std::iter::IntoIterator<Item = V>,
9723 V: std::convert::Into<crate::model::SqlServerTable>,
9724 {
9725 use std::iter::Iterator;
9726 self.tables = v.into_iter().map(|i| i.into()).collect();
9727 self
9728 }
9729}
9730
9731impl wkt::message::Message for SqlServerSchema {
9732 fn typename() -> &'static str {
9733 "type.googleapis.com/google.cloud.datastream.v1.SqlServerSchema"
9734 }
9735}
9736
9737/// SQLServer database structure.
9738#[derive(Clone, Default, PartialEq)]
9739#[non_exhaustive]
9740pub struct SqlServerRdbms {
9741 /// SQLServer schemas in the database server.
9742 pub schemas: std::vec::Vec<crate::model::SqlServerSchema>,
9743
9744 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9745}
9746
9747impl SqlServerRdbms {
9748 /// Creates a new default instance.
9749 pub fn new() -> Self {
9750 std::default::Default::default()
9751 }
9752
9753 /// Sets the value of [schemas][crate::model::SqlServerRdbms::schemas].
9754 ///
9755 /// # Example
9756 /// ```ignore,no_run
9757 /// # use google_cloud_datastream_v1::model::SqlServerRdbms;
9758 /// use google_cloud_datastream_v1::model::SqlServerSchema;
9759 /// let x = SqlServerRdbms::new()
9760 /// .set_schemas([
9761 /// SqlServerSchema::default()/* use setters */,
9762 /// SqlServerSchema::default()/* use (different) setters */,
9763 /// ]);
9764 /// ```
9765 pub fn set_schemas<T, V>(mut self, v: T) -> Self
9766 where
9767 T: std::iter::IntoIterator<Item = V>,
9768 V: std::convert::Into<crate::model::SqlServerSchema>,
9769 {
9770 use std::iter::Iterator;
9771 self.schemas = v.into_iter().map(|i| i.into()).collect();
9772 self
9773 }
9774}
9775
9776impl wkt::message::Message for SqlServerRdbms {
9777 fn typename() -> &'static str {
9778 "type.googleapis.com/google.cloud.datastream.v1.SqlServerRdbms"
9779 }
9780}
9781
9782/// SQLServer data source configuration
9783#[derive(Clone, Default, PartialEq)]
9784#[non_exhaustive]
9785pub struct SqlServerSourceConfig {
9786 /// SQLServer objects to include in the stream.
9787 pub include_objects: std::option::Option<crate::model::SqlServerRdbms>,
9788
9789 /// SQLServer objects to exclude from the stream.
9790 pub exclude_objects: std::option::Option<crate::model::SqlServerRdbms>,
9791
9792 /// Max concurrent CDC tasks.
9793 pub max_concurrent_cdc_tasks: i32,
9794
9795 /// Max concurrent backfill tasks.
9796 pub max_concurrent_backfill_tasks: i32,
9797
9798 /// Configuration to select the CDC read method for the stream.
9799 pub cdc_method: std::option::Option<crate::model::sql_server_source_config::CdcMethod>,
9800
9801 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9802}
9803
9804impl SqlServerSourceConfig {
9805 /// Creates a new default instance.
9806 pub fn new() -> Self {
9807 std::default::Default::default()
9808 }
9809
9810 /// Sets the value of [include_objects][crate::model::SqlServerSourceConfig::include_objects].
9811 ///
9812 /// # Example
9813 /// ```ignore,no_run
9814 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9815 /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9816 /// let x = SqlServerSourceConfig::new().set_include_objects(SqlServerRdbms::default()/* use setters */);
9817 /// ```
9818 pub fn set_include_objects<T>(mut self, v: T) -> Self
9819 where
9820 T: std::convert::Into<crate::model::SqlServerRdbms>,
9821 {
9822 self.include_objects = std::option::Option::Some(v.into());
9823 self
9824 }
9825
9826 /// Sets or clears the value of [include_objects][crate::model::SqlServerSourceConfig::include_objects].
9827 ///
9828 /// # Example
9829 /// ```ignore,no_run
9830 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9831 /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9832 /// let x = SqlServerSourceConfig::new().set_or_clear_include_objects(Some(SqlServerRdbms::default()/* use setters */));
9833 /// let x = SqlServerSourceConfig::new().set_or_clear_include_objects(None::<SqlServerRdbms>);
9834 /// ```
9835 pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
9836 where
9837 T: std::convert::Into<crate::model::SqlServerRdbms>,
9838 {
9839 self.include_objects = v.map(|x| x.into());
9840 self
9841 }
9842
9843 /// Sets the value of [exclude_objects][crate::model::SqlServerSourceConfig::exclude_objects].
9844 ///
9845 /// # Example
9846 /// ```ignore,no_run
9847 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9848 /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9849 /// let x = SqlServerSourceConfig::new().set_exclude_objects(SqlServerRdbms::default()/* use setters */);
9850 /// ```
9851 pub fn set_exclude_objects<T>(mut self, v: T) -> Self
9852 where
9853 T: std::convert::Into<crate::model::SqlServerRdbms>,
9854 {
9855 self.exclude_objects = std::option::Option::Some(v.into());
9856 self
9857 }
9858
9859 /// Sets or clears the value of [exclude_objects][crate::model::SqlServerSourceConfig::exclude_objects].
9860 ///
9861 /// # Example
9862 /// ```ignore,no_run
9863 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9864 /// use google_cloud_datastream_v1::model::SqlServerRdbms;
9865 /// let x = SqlServerSourceConfig::new().set_or_clear_exclude_objects(Some(SqlServerRdbms::default()/* use setters */));
9866 /// let x = SqlServerSourceConfig::new().set_or_clear_exclude_objects(None::<SqlServerRdbms>);
9867 /// ```
9868 pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
9869 where
9870 T: std::convert::Into<crate::model::SqlServerRdbms>,
9871 {
9872 self.exclude_objects = v.map(|x| x.into());
9873 self
9874 }
9875
9876 /// Sets the value of [max_concurrent_cdc_tasks][crate::model::SqlServerSourceConfig::max_concurrent_cdc_tasks].
9877 ///
9878 /// # Example
9879 /// ```ignore,no_run
9880 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9881 /// let x = SqlServerSourceConfig::new().set_max_concurrent_cdc_tasks(42);
9882 /// ```
9883 pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9884 self.max_concurrent_cdc_tasks = v.into();
9885 self
9886 }
9887
9888 /// Sets the value of [max_concurrent_backfill_tasks][crate::model::SqlServerSourceConfig::max_concurrent_backfill_tasks].
9889 ///
9890 /// # Example
9891 /// ```ignore,no_run
9892 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9893 /// let x = SqlServerSourceConfig::new().set_max_concurrent_backfill_tasks(42);
9894 /// ```
9895 pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9896 self.max_concurrent_backfill_tasks = v.into();
9897 self
9898 }
9899
9900 /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method].
9901 ///
9902 /// Note that all the setters affecting `cdc_method` are mutually
9903 /// exclusive.
9904 ///
9905 /// # Example
9906 /// ```ignore,no_run
9907 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9908 /// use google_cloud_datastream_v1::model::SqlServerTransactionLogs;
9909 /// let x = SqlServerSourceConfig::new().set_cdc_method(Some(
9910 /// google_cloud_datastream_v1::model::sql_server_source_config::CdcMethod::TransactionLogs(SqlServerTransactionLogs::default().into())));
9911 /// ```
9912 pub fn set_cdc_method<
9913 T: std::convert::Into<std::option::Option<crate::model::sql_server_source_config::CdcMethod>>,
9914 >(
9915 mut self,
9916 v: T,
9917 ) -> Self {
9918 self.cdc_method = v.into();
9919 self
9920 }
9921
9922 /// The value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9923 /// if it holds a `TransactionLogs`, `None` if the field is not set or
9924 /// holds a different branch.
9925 pub fn transaction_logs(
9926 &self,
9927 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerTransactionLogs>> {
9928 #[allow(unreachable_patterns)]
9929 self.cdc_method.as_ref().and_then(|v| match v {
9930 crate::model::sql_server_source_config::CdcMethod::TransactionLogs(v) => {
9931 std::option::Option::Some(v)
9932 }
9933 _ => std::option::Option::None,
9934 })
9935 }
9936
9937 /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9938 /// to hold a `TransactionLogs`.
9939 ///
9940 /// Note that all the setters affecting `cdc_method` are
9941 /// mutually exclusive.
9942 ///
9943 /// # Example
9944 /// ```ignore,no_run
9945 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9946 /// use google_cloud_datastream_v1::model::SqlServerTransactionLogs;
9947 /// let x = SqlServerSourceConfig::new().set_transaction_logs(SqlServerTransactionLogs::default()/* use setters */);
9948 /// assert!(x.transaction_logs().is_some());
9949 /// assert!(x.change_tables().is_none());
9950 /// ```
9951 pub fn set_transaction_logs<
9952 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerTransactionLogs>>,
9953 >(
9954 mut self,
9955 v: T,
9956 ) -> Self {
9957 self.cdc_method = std::option::Option::Some(
9958 crate::model::sql_server_source_config::CdcMethod::TransactionLogs(v.into()),
9959 );
9960 self
9961 }
9962
9963 /// The value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9964 /// if it holds a `ChangeTables`, `None` if the field is not set or
9965 /// holds a different branch.
9966 pub fn change_tables(
9967 &self,
9968 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerChangeTables>> {
9969 #[allow(unreachable_patterns)]
9970 self.cdc_method.as_ref().and_then(|v| match v {
9971 crate::model::sql_server_source_config::CdcMethod::ChangeTables(v) => {
9972 std::option::Option::Some(v)
9973 }
9974 _ => std::option::Option::None,
9975 })
9976 }
9977
9978 /// Sets the value of [cdc_method][crate::model::SqlServerSourceConfig::cdc_method]
9979 /// to hold a `ChangeTables`.
9980 ///
9981 /// Note that all the setters affecting `cdc_method` are
9982 /// mutually exclusive.
9983 ///
9984 /// # Example
9985 /// ```ignore,no_run
9986 /// # use google_cloud_datastream_v1::model::SqlServerSourceConfig;
9987 /// use google_cloud_datastream_v1::model::SqlServerChangeTables;
9988 /// let x = SqlServerSourceConfig::new().set_change_tables(SqlServerChangeTables::default()/* use setters */);
9989 /// assert!(x.change_tables().is_some());
9990 /// assert!(x.transaction_logs().is_none());
9991 /// ```
9992 pub fn set_change_tables<
9993 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerChangeTables>>,
9994 >(
9995 mut self,
9996 v: T,
9997 ) -> Self {
9998 self.cdc_method = std::option::Option::Some(
9999 crate::model::sql_server_source_config::CdcMethod::ChangeTables(v.into()),
10000 );
10001 self
10002 }
10003}
10004
10005impl wkt::message::Message for SqlServerSourceConfig {
10006 fn typename() -> &'static str {
10007 "type.googleapis.com/google.cloud.datastream.v1.SqlServerSourceConfig"
10008 }
10009}
10010
10011/// Defines additional types related to [SqlServerSourceConfig].
10012pub mod sql_server_source_config {
10013 #[allow(unused_imports)]
10014 use super::*;
10015
10016 /// Configuration to select the CDC read method for the stream.
10017 #[derive(Clone, Debug, PartialEq)]
10018 #[non_exhaustive]
10019 pub enum CdcMethod {
10020 /// CDC reader reads from transaction logs.
10021 TransactionLogs(std::boxed::Box<crate::model::SqlServerTransactionLogs>),
10022 /// CDC reader reads from change tables.
10023 ChangeTables(std::boxed::Box<crate::model::SqlServerChangeTables>),
10024 }
10025}
10026
10027/// Configuration to use Transaction Logs CDC read method.
10028#[derive(Clone, Default, PartialEq)]
10029#[non_exhaustive]
10030pub struct SqlServerTransactionLogs {
10031 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10032}
10033
10034impl SqlServerTransactionLogs {
10035 /// Creates a new default instance.
10036 pub fn new() -> Self {
10037 std::default::Default::default()
10038 }
10039}
10040
10041impl wkt::message::Message for SqlServerTransactionLogs {
10042 fn typename() -> &'static str {
10043 "type.googleapis.com/google.cloud.datastream.v1.SqlServerTransactionLogs"
10044 }
10045}
10046
10047/// Configuration to use Change Tables CDC read method.
10048#[derive(Clone, Default, PartialEq)]
10049#[non_exhaustive]
10050pub struct SqlServerChangeTables {
10051 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10052}
10053
10054impl SqlServerChangeTables {
10055 /// Creates a new default instance.
10056 pub fn new() -> Self {
10057 std::default::Default::default()
10058 }
10059}
10060
10061impl wkt::message::Message for SqlServerChangeTables {
10062 fn typename() -> &'static str {
10063 "type.googleapis.com/google.cloud.datastream.v1.SqlServerChangeTables"
10064 }
10065}
10066
10067/// MySQL Column.
10068#[derive(Clone, Default, PartialEq)]
10069#[non_exhaustive]
10070pub struct MysqlColumn {
10071 /// Column name.
10072 pub column: std::string::String,
10073
10074 /// The MySQL data type. Full data types list can be found here:
10075 /// <https://dev.mysql.com/doc/refman/8.0/en/data-types.html>
10076 pub data_type: std::string::String,
10077
10078 /// Column length.
10079 pub length: i32,
10080
10081 /// Column collation.
10082 pub collation: std::string::String,
10083
10084 /// Whether or not the column represents a primary key.
10085 pub primary_key: bool,
10086
10087 /// Whether or not the column can accept a null value.
10088 pub nullable: bool,
10089
10090 /// The ordinal position of the column in the table.
10091 pub ordinal_position: i32,
10092
10093 /// Column precision.
10094 pub precision: i32,
10095
10096 /// Column scale.
10097 pub scale: i32,
10098
10099 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10100}
10101
10102impl MysqlColumn {
10103 /// Creates a new default instance.
10104 pub fn new() -> Self {
10105 std::default::Default::default()
10106 }
10107
10108 /// Sets the value of [column][crate::model::MysqlColumn::column].
10109 ///
10110 /// # Example
10111 /// ```ignore,no_run
10112 /// # use google_cloud_datastream_v1::model::MysqlColumn;
10113 /// let x = MysqlColumn::new().set_column("example");
10114 /// ```
10115 pub fn set_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10116 self.column = v.into();
10117 self
10118 }
10119
10120 /// Sets the value of [data_type][crate::model::MysqlColumn::data_type].
10121 ///
10122 /// # Example
10123 /// ```ignore,no_run
10124 /// # use google_cloud_datastream_v1::model::MysqlColumn;
10125 /// let x = MysqlColumn::new().set_data_type("example");
10126 /// ```
10127 pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10128 self.data_type = v.into();
10129 self
10130 }
10131
10132 /// Sets the value of [length][crate::model::MysqlColumn::length].
10133 ///
10134 /// # Example
10135 /// ```ignore,no_run
10136 /// # use google_cloud_datastream_v1::model::MysqlColumn;
10137 /// let x = MysqlColumn::new().set_length(42);
10138 /// ```
10139 pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10140 self.length = v.into();
10141 self
10142 }
10143
10144 /// Sets the value of [collation][crate::model::MysqlColumn::collation].
10145 ///
10146 /// # Example
10147 /// ```ignore,no_run
10148 /// # use google_cloud_datastream_v1::model::MysqlColumn;
10149 /// let x = MysqlColumn::new().set_collation("example");
10150 /// ```
10151 pub fn set_collation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10152 self.collation = v.into();
10153 self
10154 }
10155
10156 /// Sets the value of [primary_key][crate::model::MysqlColumn::primary_key].
10157 ///
10158 /// # Example
10159 /// ```ignore,no_run
10160 /// # use google_cloud_datastream_v1::model::MysqlColumn;
10161 /// let x = MysqlColumn::new().set_primary_key(true);
10162 /// ```
10163 pub fn set_primary_key<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10164 self.primary_key = v.into();
10165 self
10166 }
10167
10168 /// Sets the value of [nullable][crate::model::MysqlColumn::nullable].
10169 ///
10170 /// # Example
10171 /// ```ignore,no_run
10172 /// # use google_cloud_datastream_v1::model::MysqlColumn;
10173 /// let x = MysqlColumn::new().set_nullable(true);
10174 /// ```
10175 pub fn set_nullable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10176 self.nullable = v.into();
10177 self
10178 }
10179
10180 /// Sets the value of [ordinal_position][crate::model::MysqlColumn::ordinal_position].
10181 ///
10182 /// # Example
10183 /// ```ignore,no_run
10184 /// # use google_cloud_datastream_v1::model::MysqlColumn;
10185 /// let x = MysqlColumn::new().set_ordinal_position(42);
10186 /// ```
10187 pub fn set_ordinal_position<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10188 self.ordinal_position = v.into();
10189 self
10190 }
10191
10192 /// Sets the value of [precision][crate::model::MysqlColumn::precision].
10193 ///
10194 /// # Example
10195 /// ```ignore,no_run
10196 /// # use google_cloud_datastream_v1::model::MysqlColumn;
10197 /// let x = MysqlColumn::new().set_precision(42);
10198 /// ```
10199 pub fn set_precision<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10200 self.precision = v.into();
10201 self
10202 }
10203
10204 /// Sets the value of [scale][crate::model::MysqlColumn::scale].
10205 ///
10206 /// # Example
10207 /// ```ignore,no_run
10208 /// # use google_cloud_datastream_v1::model::MysqlColumn;
10209 /// let x = MysqlColumn::new().set_scale(42);
10210 /// ```
10211 pub fn set_scale<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10212 self.scale = v.into();
10213 self
10214 }
10215}
10216
10217impl wkt::message::Message for MysqlColumn {
10218 fn typename() -> &'static str {
10219 "type.googleapis.com/google.cloud.datastream.v1.MysqlColumn"
10220 }
10221}
10222
10223/// MySQL table.
10224#[derive(Clone, Default, PartialEq)]
10225#[non_exhaustive]
10226pub struct MysqlTable {
10227 /// Table name.
10228 pub table: std::string::String,
10229
10230 /// MySQL columns in the database.
10231 /// When unspecified as part of include/exclude objects, includes/excludes
10232 /// everything.
10233 pub mysql_columns: std::vec::Vec<crate::model::MysqlColumn>,
10234
10235 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10236}
10237
10238impl MysqlTable {
10239 /// Creates a new default instance.
10240 pub fn new() -> Self {
10241 std::default::Default::default()
10242 }
10243
10244 /// Sets the value of [table][crate::model::MysqlTable::table].
10245 ///
10246 /// # Example
10247 /// ```ignore,no_run
10248 /// # use google_cloud_datastream_v1::model::MysqlTable;
10249 /// let x = MysqlTable::new().set_table("example");
10250 /// ```
10251 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10252 self.table = v.into();
10253 self
10254 }
10255
10256 /// Sets the value of [mysql_columns][crate::model::MysqlTable::mysql_columns].
10257 ///
10258 /// # Example
10259 /// ```ignore,no_run
10260 /// # use google_cloud_datastream_v1::model::MysqlTable;
10261 /// use google_cloud_datastream_v1::model::MysqlColumn;
10262 /// let x = MysqlTable::new()
10263 /// .set_mysql_columns([
10264 /// MysqlColumn::default()/* use setters */,
10265 /// MysqlColumn::default()/* use (different) setters */,
10266 /// ]);
10267 /// ```
10268 pub fn set_mysql_columns<T, V>(mut self, v: T) -> Self
10269 where
10270 T: std::iter::IntoIterator<Item = V>,
10271 V: std::convert::Into<crate::model::MysqlColumn>,
10272 {
10273 use std::iter::Iterator;
10274 self.mysql_columns = v.into_iter().map(|i| i.into()).collect();
10275 self
10276 }
10277}
10278
10279impl wkt::message::Message for MysqlTable {
10280 fn typename() -> &'static str {
10281 "type.googleapis.com/google.cloud.datastream.v1.MysqlTable"
10282 }
10283}
10284
10285/// MySQL database.
10286#[derive(Clone, Default, PartialEq)]
10287#[non_exhaustive]
10288pub struct MysqlDatabase {
10289 /// Database name.
10290 pub database: std::string::String,
10291
10292 /// Tables in the database.
10293 pub mysql_tables: std::vec::Vec<crate::model::MysqlTable>,
10294
10295 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10296}
10297
10298impl MysqlDatabase {
10299 /// Creates a new default instance.
10300 pub fn new() -> Self {
10301 std::default::Default::default()
10302 }
10303
10304 /// Sets the value of [database][crate::model::MysqlDatabase::database].
10305 ///
10306 /// # Example
10307 /// ```ignore,no_run
10308 /// # use google_cloud_datastream_v1::model::MysqlDatabase;
10309 /// let x = MysqlDatabase::new().set_database("example");
10310 /// ```
10311 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10312 self.database = v.into();
10313 self
10314 }
10315
10316 /// Sets the value of [mysql_tables][crate::model::MysqlDatabase::mysql_tables].
10317 ///
10318 /// # Example
10319 /// ```ignore,no_run
10320 /// # use google_cloud_datastream_v1::model::MysqlDatabase;
10321 /// use google_cloud_datastream_v1::model::MysqlTable;
10322 /// let x = MysqlDatabase::new()
10323 /// .set_mysql_tables([
10324 /// MysqlTable::default()/* use setters */,
10325 /// MysqlTable::default()/* use (different) setters */,
10326 /// ]);
10327 /// ```
10328 pub fn set_mysql_tables<T, V>(mut self, v: T) -> Self
10329 where
10330 T: std::iter::IntoIterator<Item = V>,
10331 V: std::convert::Into<crate::model::MysqlTable>,
10332 {
10333 use std::iter::Iterator;
10334 self.mysql_tables = v.into_iter().map(|i| i.into()).collect();
10335 self
10336 }
10337}
10338
10339impl wkt::message::Message for MysqlDatabase {
10340 fn typename() -> &'static str {
10341 "type.googleapis.com/google.cloud.datastream.v1.MysqlDatabase"
10342 }
10343}
10344
10345/// MySQL database structure
10346#[derive(Clone, Default, PartialEq)]
10347#[non_exhaustive]
10348pub struct MysqlRdbms {
10349 /// Mysql databases on the server
10350 pub mysql_databases: std::vec::Vec<crate::model::MysqlDatabase>,
10351
10352 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10353}
10354
10355impl MysqlRdbms {
10356 /// Creates a new default instance.
10357 pub fn new() -> Self {
10358 std::default::Default::default()
10359 }
10360
10361 /// Sets the value of [mysql_databases][crate::model::MysqlRdbms::mysql_databases].
10362 ///
10363 /// # Example
10364 /// ```ignore,no_run
10365 /// # use google_cloud_datastream_v1::model::MysqlRdbms;
10366 /// use google_cloud_datastream_v1::model::MysqlDatabase;
10367 /// let x = MysqlRdbms::new()
10368 /// .set_mysql_databases([
10369 /// MysqlDatabase::default()/* use setters */,
10370 /// MysqlDatabase::default()/* use (different) setters */,
10371 /// ]);
10372 /// ```
10373 pub fn set_mysql_databases<T, V>(mut self, v: T) -> Self
10374 where
10375 T: std::iter::IntoIterator<Item = V>,
10376 V: std::convert::Into<crate::model::MysqlDatabase>,
10377 {
10378 use std::iter::Iterator;
10379 self.mysql_databases = v.into_iter().map(|i| i.into()).collect();
10380 self
10381 }
10382}
10383
10384impl wkt::message::Message for MysqlRdbms {
10385 fn typename() -> &'static str {
10386 "type.googleapis.com/google.cloud.datastream.v1.MysqlRdbms"
10387 }
10388}
10389
10390/// MySQL source configuration
10391#[derive(Clone, Default, PartialEq)]
10392#[non_exhaustive]
10393pub struct MysqlSourceConfig {
10394 /// MySQL objects to retrieve from the source.
10395 pub include_objects: std::option::Option<crate::model::MysqlRdbms>,
10396
10397 /// MySQL objects to exclude from the stream.
10398 pub exclude_objects: std::option::Option<crate::model::MysqlRdbms>,
10399
10400 /// Maximum number of concurrent CDC tasks. The number should be non negative.
10401 /// If not set (or set to 0), the system's default value will be used.
10402 pub max_concurrent_cdc_tasks: i32,
10403
10404 /// Maximum number of concurrent backfill tasks. The number should be non
10405 /// negative. If not set (or set to 0), the system's default value will be
10406 /// used.
10407 pub max_concurrent_backfill_tasks: i32,
10408
10409 /// The CDC method to use for the stream.
10410 pub cdc_method: std::option::Option<crate::model::mysql_source_config::CdcMethod>,
10411
10412 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10413}
10414
10415impl MysqlSourceConfig {
10416 /// Creates a new default instance.
10417 pub fn new() -> Self {
10418 std::default::Default::default()
10419 }
10420
10421 /// Sets the value of [include_objects][crate::model::MysqlSourceConfig::include_objects].
10422 ///
10423 /// # Example
10424 /// ```ignore,no_run
10425 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10426 /// use google_cloud_datastream_v1::model::MysqlRdbms;
10427 /// let x = MysqlSourceConfig::new().set_include_objects(MysqlRdbms::default()/* use setters */);
10428 /// ```
10429 pub fn set_include_objects<T>(mut self, v: T) -> Self
10430 where
10431 T: std::convert::Into<crate::model::MysqlRdbms>,
10432 {
10433 self.include_objects = std::option::Option::Some(v.into());
10434 self
10435 }
10436
10437 /// Sets or clears the value of [include_objects][crate::model::MysqlSourceConfig::include_objects].
10438 ///
10439 /// # Example
10440 /// ```ignore,no_run
10441 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10442 /// use google_cloud_datastream_v1::model::MysqlRdbms;
10443 /// let x = MysqlSourceConfig::new().set_or_clear_include_objects(Some(MysqlRdbms::default()/* use setters */));
10444 /// let x = MysqlSourceConfig::new().set_or_clear_include_objects(None::<MysqlRdbms>);
10445 /// ```
10446 pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
10447 where
10448 T: std::convert::Into<crate::model::MysqlRdbms>,
10449 {
10450 self.include_objects = v.map(|x| x.into());
10451 self
10452 }
10453
10454 /// Sets the value of [exclude_objects][crate::model::MysqlSourceConfig::exclude_objects].
10455 ///
10456 /// # Example
10457 /// ```ignore,no_run
10458 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10459 /// use google_cloud_datastream_v1::model::MysqlRdbms;
10460 /// let x = MysqlSourceConfig::new().set_exclude_objects(MysqlRdbms::default()/* use setters */);
10461 /// ```
10462 pub fn set_exclude_objects<T>(mut self, v: T) -> Self
10463 where
10464 T: std::convert::Into<crate::model::MysqlRdbms>,
10465 {
10466 self.exclude_objects = std::option::Option::Some(v.into());
10467 self
10468 }
10469
10470 /// Sets or clears the value of [exclude_objects][crate::model::MysqlSourceConfig::exclude_objects].
10471 ///
10472 /// # Example
10473 /// ```ignore,no_run
10474 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10475 /// use google_cloud_datastream_v1::model::MysqlRdbms;
10476 /// let x = MysqlSourceConfig::new().set_or_clear_exclude_objects(Some(MysqlRdbms::default()/* use setters */));
10477 /// let x = MysqlSourceConfig::new().set_or_clear_exclude_objects(None::<MysqlRdbms>);
10478 /// ```
10479 pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
10480 where
10481 T: std::convert::Into<crate::model::MysqlRdbms>,
10482 {
10483 self.exclude_objects = v.map(|x| x.into());
10484 self
10485 }
10486
10487 /// Sets the value of [max_concurrent_cdc_tasks][crate::model::MysqlSourceConfig::max_concurrent_cdc_tasks].
10488 ///
10489 /// # Example
10490 /// ```ignore,no_run
10491 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10492 /// let x = MysqlSourceConfig::new().set_max_concurrent_cdc_tasks(42);
10493 /// ```
10494 pub fn set_max_concurrent_cdc_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10495 self.max_concurrent_cdc_tasks = v.into();
10496 self
10497 }
10498
10499 /// Sets the value of [max_concurrent_backfill_tasks][crate::model::MysqlSourceConfig::max_concurrent_backfill_tasks].
10500 ///
10501 /// # Example
10502 /// ```ignore,no_run
10503 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10504 /// let x = MysqlSourceConfig::new().set_max_concurrent_backfill_tasks(42);
10505 /// ```
10506 pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10507 self.max_concurrent_backfill_tasks = v.into();
10508 self
10509 }
10510
10511 /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method].
10512 ///
10513 /// Note that all the setters affecting `cdc_method` are mutually
10514 /// exclusive.
10515 ///
10516 /// # Example
10517 /// ```ignore,no_run
10518 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10519 /// use google_cloud_datastream_v1::model::mysql_source_config::BinaryLogPosition;
10520 /// let x = MysqlSourceConfig::new().set_cdc_method(Some(
10521 /// google_cloud_datastream_v1::model::mysql_source_config::CdcMethod::BinaryLogPosition(BinaryLogPosition::default().into())));
10522 /// ```
10523 pub fn set_cdc_method<
10524 T: std::convert::Into<std::option::Option<crate::model::mysql_source_config::CdcMethod>>,
10525 >(
10526 mut self,
10527 v: T,
10528 ) -> Self {
10529 self.cdc_method = v.into();
10530 self
10531 }
10532
10533 /// The value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10534 /// if it holds a `BinaryLogPosition`, `None` if the field is not set or
10535 /// holds a different branch.
10536 pub fn binary_log_position(
10537 &self,
10538 ) -> std::option::Option<&std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>>
10539 {
10540 #[allow(unreachable_patterns)]
10541 self.cdc_method.as_ref().and_then(|v| match v {
10542 crate::model::mysql_source_config::CdcMethod::BinaryLogPosition(v) => {
10543 std::option::Option::Some(v)
10544 }
10545 _ => std::option::Option::None,
10546 })
10547 }
10548
10549 /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10550 /// to hold a `BinaryLogPosition`.
10551 ///
10552 /// Note that all the setters affecting `cdc_method` are
10553 /// mutually exclusive.
10554 ///
10555 /// # Example
10556 /// ```ignore,no_run
10557 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10558 /// use google_cloud_datastream_v1::model::mysql_source_config::BinaryLogPosition;
10559 /// let x = MysqlSourceConfig::new().set_binary_log_position(BinaryLogPosition::default()/* use setters */);
10560 /// assert!(x.binary_log_position().is_some());
10561 /// assert!(x.gtid().is_none());
10562 /// ```
10563 pub fn set_binary_log_position<
10564 T: std::convert::Into<std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>>,
10565 >(
10566 mut self,
10567 v: T,
10568 ) -> Self {
10569 self.cdc_method = std::option::Option::Some(
10570 crate::model::mysql_source_config::CdcMethod::BinaryLogPosition(v.into()),
10571 );
10572 self
10573 }
10574
10575 /// The value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10576 /// if it holds a `Gtid`, `None` if the field is not set or
10577 /// holds a different branch.
10578 pub fn gtid(
10579 &self,
10580 ) -> std::option::Option<&std::boxed::Box<crate::model::mysql_source_config::Gtid>> {
10581 #[allow(unreachable_patterns)]
10582 self.cdc_method.as_ref().and_then(|v| match v {
10583 crate::model::mysql_source_config::CdcMethod::Gtid(v) => std::option::Option::Some(v),
10584 _ => std::option::Option::None,
10585 })
10586 }
10587
10588 /// Sets the value of [cdc_method][crate::model::MysqlSourceConfig::cdc_method]
10589 /// to hold a `Gtid`.
10590 ///
10591 /// Note that all the setters affecting `cdc_method` are
10592 /// mutually exclusive.
10593 ///
10594 /// # Example
10595 /// ```ignore,no_run
10596 /// # use google_cloud_datastream_v1::model::MysqlSourceConfig;
10597 /// use google_cloud_datastream_v1::model::mysql_source_config::Gtid;
10598 /// let x = MysqlSourceConfig::new().set_gtid(Gtid::default()/* use setters */);
10599 /// assert!(x.gtid().is_some());
10600 /// assert!(x.binary_log_position().is_none());
10601 /// ```
10602 pub fn set_gtid<
10603 T: std::convert::Into<std::boxed::Box<crate::model::mysql_source_config::Gtid>>,
10604 >(
10605 mut self,
10606 v: T,
10607 ) -> Self {
10608 self.cdc_method =
10609 std::option::Option::Some(crate::model::mysql_source_config::CdcMethod::Gtid(v.into()));
10610 self
10611 }
10612}
10613
10614impl wkt::message::Message for MysqlSourceConfig {
10615 fn typename() -> &'static str {
10616 "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig"
10617 }
10618}
10619
10620/// Defines additional types related to [MysqlSourceConfig].
10621pub mod mysql_source_config {
10622 #[allow(unused_imports)]
10623 use super::*;
10624
10625 /// Use Binary log position based replication.
10626 #[derive(Clone, Default, PartialEq)]
10627 #[non_exhaustive]
10628 pub struct BinaryLogPosition {
10629 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10630 }
10631
10632 impl BinaryLogPosition {
10633 /// Creates a new default instance.
10634 pub fn new() -> Self {
10635 std::default::Default::default()
10636 }
10637 }
10638
10639 impl wkt::message::Message for BinaryLogPosition {
10640 fn typename() -> &'static str {
10641 "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig.BinaryLogPosition"
10642 }
10643 }
10644
10645 /// Use GTID based replication.
10646 #[derive(Clone, Default, PartialEq)]
10647 #[non_exhaustive]
10648 pub struct Gtid {
10649 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10650 }
10651
10652 impl Gtid {
10653 /// Creates a new default instance.
10654 pub fn new() -> Self {
10655 std::default::Default::default()
10656 }
10657 }
10658
10659 impl wkt::message::Message for Gtid {
10660 fn typename() -> &'static str {
10661 "type.googleapis.com/google.cloud.datastream.v1.MysqlSourceConfig.Gtid"
10662 }
10663 }
10664
10665 /// The CDC method to use for the stream.
10666 #[derive(Clone, Debug, PartialEq)]
10667 #[non_exhaustive]
10668 pub enum CdcMethod {
10669 /// Use Binary log position based replication.
10670 BinaryLogPosition(std::boxed::Box<crate::model::mysql_source_config::BinaryLogPosition>),
10671 /// Use GTID based replication.
10672 Gtid(std::boxed::Box<crate::model::mysql_source_config::Gtid>),
10673 }
10674}
10675
10676/// Salesforce source configuration
10677#[derive(Clone, Default, PartialEq)]
10678#[non_exhaustive]
10679pub struct SalesforceSourceConfig {
10680 /// Salesforce objects to retrieve from the source.
10681 pub include_objects: std::option::Option<crate::model::SalesforceOrg>,
10682
10683 /// Salesforce objects to exclude from the stream.
10684 pub exclude_objects: std::option::Option<crate::model::SalesforceOrg>,
10685
10686 /// Required. Salesforce objects polling interval. The interval at which new
10687 /// changes will be polled for each object. The duration must be between 5
10688 /// minutes and 24 hours.
10689 pub polling_interval: std::option::Option<wkt::Duration>,
10690
10691 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10692}
10693
10694impl SalesforceSourceConfig {
10695 /// Creates a new default instance.
10696 pub fn new() -> Self {
10697 std::default::Default::default()
10698 }
10699
10700 /// Sets the value of [include_objects][crate::model::SalesforceSourceConfig::include_objects].
10701 ///
10702 /// # Example
10703 /// ```ignore,no_run
10704 /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10705 /// use google_cloud_datastream_v1::model::SalesforceOrg;
10706 /// let x = SalesforceSourceConfig::new().set_include_objects(SalesforceOrg::default()/* use setters */);
10707 /// ```
10708 pub fn set_include_objects<T>(mut self, v: T) -> Self
10709 where
10710 T: std::convert::Into<crate::model::SalesforceOrg>,
10711 {
10712 self.include_objects = std::option::Option::Some(v.into());
10713 self
10714 }
10715
10716 /// Sets or clears the value of [include_objects][crate::model::SalesforceSourceConfig::include_objects].
10717 ///
10718 /// # Example
10719 /// ```ignore,no_run
10720 /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10721 /// use google_cloud_datastream_v1::model::SalesforceOrg;
10722 /// let x = SalesforceSourceConfig::new().set_or_clear_include_objects(Some(SalesforceOrg::default()/* use setters */));
10723 /// let x = SalesforceSourceConfig::new().set_or_clear_include_objects(None::<SalesforceOrg>);
10724 /// ```
10725 pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
10726 where
10727 T: std::convert::Into<crate::model::SalesforceOrg>,
10728 {
10729 self.include_objects = v.map(|x| x.into());
10730 self
10731 }
10732
10733 /// Sets the value of [exclude_objects][crate::model::SalesforceSourceConfig::exclude_objects].
10734 ///
10735 /// # Example
10736 /// ```ignore,no_run
10737 /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10738 /// use google_cloud_datastream_v1::model::SalesforceOrg;
10739 /// let x = SalesforceSourceConfig::new().set_exclude_objects(SalesforceOrg::default()/* use setters */);
10740 /// ```
10741 pub fn set_exclude_objects<T>(mut self, v: T) -> Self
10742 where
10743 T: std::convert::Into<crate::model::SalesforceOrg>,
10744 {
10745 self.exclude_objects = std::option::Option::Some(v.into());
10746 self
10747 }
10748
10749 /// Sets or clears the value of [exclude_objects][crate::model::SalesforceSourceConfig::exclude_objects].
10750 ///
10751 /// # Example
10752 /// ```ignore,no_run
10753 /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10754 /// use google_cloud_datastream_v1::model::SalesforceOrg;
10755 /// let x = SalesforceSourceConfig::new().set_or_clear_exclude_objects(Some(SalesforceOrg::default()/* use setters */));
10756 /// let x = SalesforceSourceConfig::new().set_or_clear_exclude_objects(None::<SalesforceOrg>);
10757 /// ```
10758 pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
10759 where
10760 T: std::convert::Into<crate::model::SalesforceOrg>,
10761 {
10762 self.exclude_objects = v.map(|x| x.into());
10763 self
10764 }
10765
10766 /// Sets the value of [polling_interval][crate::model::SalesforceSourceConfig::polling_interval].
10767 ///
10768 /// # Example
10769 /// ```ignore,no_run
10770 /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10771 /// use wkt::Duration;
10772 /// let x = SalesforceSourceConfig::new().set_polling_interval(Duration::default()/* use setters */);
10773 /// ```
10774 pub fn set_polling_interval<T>(mut self, v: T) -> Self
10775 where
10776 T: std::convert::Into<wkt::Duration>,
10777 {
10778 self.polling_interval = std::option::Option::Some(v.into());
10779 self
10780 }
10781
10782 /// Sets or clears the value of [polling_interval][crate::model::SalesforceSourceConfig::polling_interval].
10783 ///
10784 /// # Example
10785 /// ```ignore,no_run
10786 /// # use google_cloud_datastream_v1::model::SalesforceSourceConfig;
10787 /// use wkt::Duration;
10788 /// let x = SalesforceSourceConfig::new().set_or_clear_polling_interval(Some(Duration::default()/* use setters */));
10789 /// let x = SalesforceSourceConfig::new().set_or_clear_polling_interval(None::<Duration>);
10790 /// ```
10791 pub fn set_or_clear_polling_interval<T>(mut self, v: std::option::Option<T>) -> Self
10792 where
10793 T: std::convert::Into<wkt::Duration>,
10794 {
10795 self.polling_interval = v.map(|x| x.into());
10796 self
10797 }
10798}
10799
10800impl wkt::message::Message for SalesforceSourceConfig {
10801 fn typename() -> &'static str {
10802 "type.googleapis.com/google.cloud.datastream.v1.SalesforceSourceConfig"
10803 }
10804}
10805
10806/// Salesforce organization structure.
10807#[derive(Clone, Default, PartialEq)]
10808#[non_exhaustive]
10809pub struct SalesforceOrg {
10810 /// Salesforce objects in the database server.
10811 pub objects: std::vec::Vec<crate::model::SalesforceObject>,
10812
10813 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10814}
10815
10816impl SalesforceOrg {
10817 /// Creates a new default instance.
10818 pub fn new() -> Self {
10819 std::default::Default::default()
10820 }
10821
10822 /// Sets the value of [objects][crate::model::SalesforceOrg::objects].
10823 ///
10824 /// # Example
10825 /// ```ignore,no_run
10826 /// # use google_cloud_datastream_v1::model::SalesforceOrg;
10827 /// use google_cloud_datastream_v1::model::SalesforceObject;
10828 /// let x = SalesforceOrg::new()
10829 /// .set_objects([
10830 /// SalesforceObject::default()/* use setters */,
10831 /// SalesforceObject::default()/* use (different) setters */,
10832 /// ]);
10833 /// ```
10834 pub fn set_objects<T, V>(mut self, v: T) -> Self
10835 where
10836 T: std::iter::IntoIterator<Item = V>,
10837 V: std::convert::Into<crate::model::SalesforceObject>,
10838 {
10839 use std::iter::Iterator;
10840 self.objects = v.into_iter().map(|i| i.into()).collect();
10841 self
10842 }
10843}
10844
10845impl wkt::message::Message for SalesforceOrg {
10846 fn typename() -> &'static str {
10847 "type.googleapis.com/google.cloud.datastream.v1.SalesforceOrg"
10848 }
10849}
10850
10851/// Salesforce object.
10852#[derive(Clone, Default, PartialEq)]
10853#[non_exhaustive]
10854pub struct SalesforceObject {
10855 /// Object name.
10856 pub object_name: std::string::String,
10857
10858 /// Salesforce fields.
10859 /// When unspecified as part of include objects,
10860 /// includes everything, when unspecified as part of exclude objects,
10861 /// excludes nothing.
10862 pub fields: std::vec::Vec<crate::model::SalesforceField>,
10863
10864 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10865}
10866
10867impl SalesforceObject {
10868 /// Creates a new default instance.
10869 pub fn new() -> Self {
10870 std::default::Default::default()
10871 }
10872
10873 /// Sets the value of [object_name][crate::model::SalesforceObject::object_name].
10874 ///
10875 /// # Example
10876 /// ```ignore,no_run
10877 /// # use google_cloud_datastream_v1::model::SalesforceObject;
10878 /// let x = SalesforceObject::new().set_object_name("example");
10879 /// ```
10880 pub fn set_object_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10881 self.object_name = v.into();
10882 self
10883 }
10884
10885 /// Sets the value of [fields][crate::model::SalesforceObject::fields].
10886 ///
10887 /// # Example
10888 /// ```ignore,no_run
10889 /// # use google_cloud_datastream_v1::model::SalesforceObject;
10890 /// use google_cloud_datastream_v1::model::SalesforceField;
10891 /// let x = SalesforceObject::new()
10892 /// .set_fields([
10893 /// SalesforceField::default()/* use setters */,
10894 /// SalesforceField::default()/* use (different) setters */,
10895 /// ]);
10896 /// ```
10897 pub fn set_fields<T, V>(mut self, v: T) -> Self
10898 where
10899 T: std::iter::IntoIterator<Item = V>,
10900 V: std::convert::Into<crate::model::SalesforceField>,
10901 {
10902 use std::iter::Iterator;
10903 self.fields = v.into_iter().map(|i| i.into()).collect();
10904 self
10905 }
10906}
10907
10908impl wkt::message::Message for SalesforceObject {
10909 fn typename() -> &'static str {
10910 "type.googleapis.com/google.cloud.datastream.v1.SalesforceObject"
10911 }
10912}
10913
10914/// Salesforce field.
10915#[derive(Clone, Default, PartialEq)]
10916#[non_exhaustive]
10917pub struct SalesforceField {
10918 /// Field name.
10919 pub name: std::string::String,
10920
10921 /// The data type.
10922 pub data_type: std::string::String,
10923
10924 /// Indicates whether the field can accept nil values.
10925 pub nillable: bool,
10926
10927 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10928}
10929
10930impl SalesforceField {
10931 /// Creates a new default instance.
10932 pub fn new() -> Self {
10933 std::default::Default::default()
10934 }
10935
10936 /// Sets the value of [name][crate::model::SalesforceField::name].
10937 ///
10938 /// # Example
10939 /// ```ignore,no_run
10940 /// # use google_cloud_datastream_v1::model::SalesforceField;
10941 /// let x = SalesforceField::new().set_name("example");
10942 /// ```
10943 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10944 self.name = v.into();
10945 self
10946 }
10947
10948 /// Sets the value of [data_type][crate::model::SalesforceField::data_type].
10949 ///
10950 /// # Example
10951 /// ```ignore,no_run
10952 /// # use google_cloud_datastream_v1::model::SalesforceField;
10953 /// let x = SalesforceField::new().set_data_type("example");
10954 /// ```
10955 pub fn set_data_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10956 self.data_type = v.into();
10957 self
10958 }
10959
10960 /// Sets the value of [nillable][crate::model::SalesforceField::nillable].
10961 ///
10962 /// # Example
10963 /// ```ignore,no_run
10964 /// # use google_cloud_datastream_v1::model::SalesforceField;
10965 /// let x = SalesforceField::new().set_nillable(true);
10966 /// ```
10967 pub fn set_nillable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10968 self.nillable = v.into();
10969 self
10970 }
10971}
10972
10973impl wkt::message::Message for SalesforceField {
10974 fn typename() -> &'static str {
10975 "type.googleapis.com/google.cloud.datastream.v1.SalesforceField"
10976 }
10977}
10978
10979/// MongoDB source configuration.
10980#[derive(Clone, Default, PartialEq)]
10981#[non_exhaustive]
10982pub struct MongodbSourceConfig {
10983 /// MongoDB collections to include in the stream.
10984 pub include_objects: std::option::Option<crate::model::MongodbCluster>,
10985
10986 /// MongoDB collections to exclude from the stream.
10987 pub exclude_objects: std::option::Option<crate::model::MongodbCluster>,
10988
10989 /// Optional. Maximum number of concurrent backfill tasks. The number should be
10990 /// non-negative and less than or equal to 50. If not set (or set to 0), the
10991 /// system's default value is used
10992 pub max_concurrent_backfill_tasks: i32,
10993
10994 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10995}
10996
10997impl MongodbSourceConfig {
10998 /// Creates a new default instance.
10999 pub fn new() -> Self {
11000 std::default::Default::default()
11001 }
11002
11003 /// Sets the value of [include_objects][crate::model::MongodbSourceConfig::include_objects].
11004 ///
11005 /// # Example
11006 /// ```ignore,no_run
11007 /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
11008 /// use google_cloud_datastream_v1::model::MongodbCluster;
11009 /// let x = MongodbSourceConfig::new().set_include_objects(MongodbCluster::default()/* use setters */);
11010 /// ```
11011 pub fn set_include_objects<T>(mut self, v: T) -> Self
11012 where
11013 T: std::convert::Into<crate::model::MongodbCluster>,
11014 {
11015 self.include_objects = std::option::Option::Some(v.into());
11016 self
11017 }
11018
11019 /// Sets or clears the value of [include_objects][crate::model::MongodbSourceConfig::include_objects].
11020 ///
11021 /// # Example
11022 /// ```ignore,no_run
11023 /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
11024 /// use google_cloud_datastream_v1::model::MongodbCluster;
11025 /// let x = MongodbSourceConfig::new().set_or_clear_include_objects(Some(MongodbCluster::default()/* use setters */));
11026 /// let x = MongodbSourceConfig::new().set_or_clear_include_objects(None::<MongodbCluster>);
11027 /// ```
11028 pub fn set_or_clear_include_objects<T>(mut self, v: std::option::Option<T>) -> Self
11029 where
11030 T: std::convert::Into<crate::model::MongodbCluster>,
11031 {
11032 self.include_objects = v.map(|x| x.into());
11033 self
11034 }
11035
11036 /// Sets the value of [exclude_objects][crate::model::MongodbSourceConfig::exclude_objects].
11037 ///
11038 /// # Example
11039 /// ```ignore,no_run
11040 /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
11041 /// use google_cloud_datastream_v1::model::MongodbCluster;
11042 /// let x = MongodbSourceConfig::new().set_exclude_objects(MongodbCluster::default()/* use setters */);
11043 /// ```
11044 pub fn set_exclude_objects<T>(mut self, v: T) -> Self
11045 where
11046 T: std::convert::Into<crate::model::MongodbCluster>,
11047 {
11048 self.exclude_objects = std::option::Option::Some(v.into());
11049 self
11050 }
11051
11052 /// Sets or clears the value of [exclude_objects][crate::model::MongodbSourceConfig::exclude_objects].
11053 ///
11054 /// # Example
11055 /// ```ignore,no_run
11056 /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
11057 /// use google_cloud_datastream_v1::model::MongodbCluster;
11058 /// let x = MongodbSourceConfig::new().set_or_clear_exclude_objects(Some(MongodbCluster::default()/* use setters */));
11059 /// let x = MongodbSourceConfig::new().set_or_clear_exclude_objects(None::<MongodbCluster>);
11060 /// ```
11061 pub fn set_or_clear_exclude_objects<T>(mut self, v: std::option::Option<T>) -> Self
11062 where
11063 T: std::convert::Into<crate::model::MongodbCluster>,
11064 {
11065 self.exclude_objects = v.map(|x| x.into());
11066 self
11067 }
11068
11069 /// Sets the value of [max_concurrent_backfill_tasks][crate::model::MongodbSourceConfig::max_concurrent_backfill_tasks].
11070 ///
11071 /// # Example
11072 /// ```ignore,no_run
11073 /// # use google_cloud_datastream_v1::model::MongodbSourceConfig;
11074 /// let x = MongodbSourceConfig::new().set_max_concurrent_backfill_tasks(42);
11075 /// ```
11076 pub fn set_max_concurrent_backfill_tasks<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11077 self.max_concurrent_backfill_tasks = v.into();
11078 self
11079 }
11080}
11081
11082impl wkt::message::Message for MongodbSourceConfig {
11083 fn typename() -> &'static str {
11084 "type.googleapis.com/google.cloud.datastream.v1.MongodbSourceConfig"
11085 }
11086}
11087
11088/// MongoDB Cluster structure.
11089#[derive(Clone, Default, PartialEq)]
11090#[non_exhaustive]
11091pub struct MongodbCluster {
11092 /// MongoDB databases in the cluster.
11093 pub databases: std::vec::Vec<crate::model::MongodbDatabase>,
11094
11095 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11096}
11097
11098impl MongodbCluster {
11099 /// Creates a new default instance.
11100 pub fn new() -> Self {
11101 std::default::Default::default()
11102 }
11103
11104 /// Sets the value of [databases][crate::model::MongodbCluster::databases].
11105 ///
11106 /// # Example
11107 /// ```ignore,no_run
11108 /// # use google_cloud_datastream_v1::model::MongodbCluster;
11109 /// use google_cloud_datastream_v1::model::MongodbDatabase;
11110 /// let x = MongodbCluster::new()
11111 /// .set_databases([
11112 /// MongodbDatabase::default()/* use setters */,
11113 /// MongodbDatabase::default()/* use (different) setters */,
11114 /// ]);
11115 /// ```
11116 pub fn set_databases<T, V>(mut self, v: T) -> Self
11117 where
11118 T: std::iter::IntoIterator<Item = V>,
11119 V: std::convert::Into<crate::model::MongodbDatabase>,
11120 {
11121 use std::iter::Iterator;
11122 self.databases = v.into_iter().map(|i| i.into()).collect();
11123 self
11124 }
11125}
11126
11127impl wkt::message::Message for MongodbCluster {
11128 fn typename() -> &'static str {
11129 "type.googleapis.com/google.cloud.datastream.v1.MongodbCluster"
11130 }
11131}
11132
11133/// MongoDB Database.
11134#[derive(Clone, Default, PartialEq)]
11135#[non_exhaustive]
11136pub struct MongodbDatabase {
11137 /// Database name.
11138 pub database: std::string::String,
11139
11140 /// Collections in the database.
11141 pub collections: std::vec::Vec<crate::model::MongodbCollection>,
11142
11143 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11144}
11145
11146impl MongodbDatabase {
11147 /// Creates a new default instance.
11148 pub fn new() -> Self {
11149 std::default::Default::default()
11150 }
11151
11152 /// Sets the value of [database][crate::model::MongodbDatabase::database].
11153 ///
11154 /// # Example
11155 /// ```ignore,no_run
11156 /// # use google_cloud_datastream_v1::model::MongodbDatabase;
11157 /// let x = MongodbDatabase::new().set_database("example");
11158 /// ```
11159 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11160 self.database = v.into();
11161 self
11162 }
11163
11164 /// Sets the value of [collections][crate::model::MongodbDatabase::collections].
11165 ///
11166 /// # Example
11167 /// ```ignore,no_run
11168 /// # use google_cloud_datastream_v1::model::MongodbDatabase;
11169 /// use google_cloud_datastream_v1::model::MongodbCollection;
11170 /// let x = MongodbDatabase::new()
11171 /// .set_collections([
11172 /// MongodbCollection::default()/* use setters */,
11173 /// MongodbCollection::default()/* use (different) setters */,
11174 /// ]);
11175 /// ```
11176 pub fn set_collections<T, V>(mut self, v: T) -> Self
11177 where
11178 T: std::iter::IntoIterator<Item = V>,
11179 V: std::convert::Into<crate::model::MongodbCollection>,
11180 {
11181 use std::iter::Iterator;
11182 self.collections = v.into_iter().map(|i| i.into()).collect();
11183 self
11184 }
11185}
11186
11187impl wkt::message::Message for MongodbDatabase {
11188 fn typename() -> &'static str {
11189 "type.googleapis.com/google.cloud.datastream.v1.MongodbDatabase"
11190 }
11191}
11192
11193/// MongoDB Collection.
11194#[derive(Clone, Default, PartialEq)]
11195#[non_exhaustive]
11196pub struct MongodbCollection {
11197 /// Collection name.
11198 pub collection: std::string::String,
11199
11200 /// Fields in the collection.
11201 pub fields: std::vec::Vec<crate::model::MongodbField>,
11202
11203 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11204}
11205
11206impl MongodbCollection {
11207 /// Creates a new default instance.
11208 pub fn new() -> Self {
11209 std::default::Default::default()
11210 }
11211
11212 /// Sets the value of [collection][crate::model::MongodbCollection::collection].
11213 ///
11214 /// # Example
11215 /// ```ignore,no_run
11216 /// # use google_cloud_datastream_v1::model::MongodbCollection;
11217 /// let x = MongodbCollection::new().set_collection("example");
11218 /// ```
11219 pub fn set_collection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11220 self.collection = v.into();
11221 self
11222 }
11223
11224 /// Sets the value of [fields][crate::model::MongodbCollection::fields].
11225 ///
11226 /// # Example
11227 /// ```ignore,no_run
11228 /// # use google_cloud_datastream_v1::model::MongodbCollection;
11229 /// use google_cloud_datastream_v1::model::MongodbField;
11230 /// let x = MongodbCollection::new()
11231 /// .set_fields([
11232 /// MongodbField::default()/* use setters */,
11233 /// MongodbField::default()/* use (different) setters */,
11234 /// ]);
11235 /// ```
11236 pub fn set_fields<T, V>(mut self, v: T) -> Self
11237 where
11238 T: std::iter::IntoIterator<Item = V>,
11239 V: std::convert::Into<crate::model::MongodbField>,
11240 {
11241 use std::iter::Iterator;
11242 self.fields = v.into_iter().map(|i| i.into()).collect();
11243 self
11244 }
11245}
11246
11247impl wkt::message::Message for MongodbCollection {
11248 fn typename() -> &'static str {
11249 "type.googleapis.com/google.cloud.datastream.v1.MongodbCollection"
11250 }
11251}
11252
11253/// MongoDB Field.
11254#[derive(Clone, Default, PartialEq)]
11255#[non_exhaustive]
11256pub struct MongodbField {
11257 /// Field name.
11258 pub field: std::string::String,
11259
11260 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11261}
11262
11263impl MongodbField {
11264 /// Creates a new default instance.
11265 pub fn new() -> Self {
11266 std::default::Default::default()
11267 }
11268
11269 /// Sets the value of [field][crate::model::MongodbField::field].
11270 ///
11271 /// # Example
11272 /// ```ignore,no_run
11273 /// # use google_cloud_datastream_v1::model::MongodbField;
11274 /// let x = MongodbField::new().set_field("example");
11275 /// ```
11276 pub fn set_field<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11277 self.field = v.into();
11278 self
11279 }
11280}
11281
11282impl wkt::message::Message for MongodbField {
11283 fn typename() -> &'static str {
11284 "type.googleapis.com/google.cloud.datastream.v1.MongodbField"
11285 }
11286}
11287
11288/// The configuration of the stream source.
11289#[derive(Clone, Default, PartialEq)]
11290#[non_exhaustive]
11291pub struct SourceConfig {
11292 /// Required. Source connection profile resource.
11293 /// Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
11294 pub source_connection_profile: std::string::String,
11295
11296 /// Stream configuration that is specific to the data source type.
11297 pub source_stream_config: std::option::Option<crate::model::source_config::SourceStreamConfig>,
11298
11299 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11300}
11301
11302impl SourceConfig {
11303 /// Creates a new default instance.
11304 pub fn new() -> Self {
11305 std::default::Default::default()
11306 }
11307
11308 /// Sets the value of [source_connection_profile][crate::model::SourceConfig::source_connection_profile].
11309 ///
11310 /// # Example
11311 /// ```ignore,no_run
11312 /// # use google_cloud_datastream_v1::model::SourceConfig;
11313 /// # let project_id = "project_id";
11314 /// # let location_id = "location_id";
11315 /// # let connection_profile_id = "connection_profile_id";
11316 /// let x = SourceConfig::new().set_source_connection_profile(format!("projects/{project_id}/locations/{location_id}/connectionProfiles/{connection_profile_id}"));
11317 /// ```
11318 pub fn set_source_connection_profile<T: std::convert::Into<std::string::String>>(
11319 mut self,
11320 v: T,
11321 ) -> Self {
11322 self.source_connection_profile = v.into();
11323 self
11324 }
11325
11326 /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config].
11327 ///
11328 /// Note that all the setters affecting `source_stream_config` are mutually
11329 /// exclusive.
11330 ///
11331 /// # Example
11332 /// ```ignore,no_run
11333 /// # use google_cloud_datastream_v1::model::SourceConfig;
11334 /// use google_cloud_datastream_v1::model::OracleSourceConfig;
11335 /// let x = SourceConfig::new().set_source_stream_config(Some(
11336 /// google_cloud_datastream_v1::model::source_config::SourceStreamConfig::OracleSourceConfig(OracleSourceConfig::default().into())));
11337 /// ```
11338 pub fn set_source_stream_config<
11339 T: std::convert::Into<std::option::Option<crate::model::source_config::SourceStreamConfig>>,
11340 >(
11341 mut self,
11342 v: T,
11343 ) -> Self {
11344 self.source_stream_config = v.into();
11345 self
11346 }
11347
11348 /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11349 /// if it holds a `OracleSourceConfig`, `None` if the field is not set or
11350 /// holds a different branch.
11351 pub fn oracle_source_config(
11352 &self,
11353 ) -> std::option::Option<&std::boxed::Box<crate::model::OracleSourceConfig>> {
11354 #[allow(unreachable_patterns)]
11355 self.source_stream_config.as_ref().and_then(|v| match v {
11356 crate::model::source_config::SourceStreamConfig::OracleSourceConfig(v) => {
11357 std::option::Option::Some(v)
11358 }
11359 _ => std::option::Option::None,
11360 })
11361 }
11362
11363 /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11364 /// to hold a `OracleSourceConfig`.
11365 ///
11366 /// Note that all the setters affecting `source_stream_config` are
11367 /// mutually exclusive.
11368 ///
11369 /// # Example
11370 /// ```ignore,no_run
11371 /// # use google_cloud_datastream_v1::model::SourceConfig;
11372 /// use google_cloud_datastream_v1::model::OracleSourceConfig;
11373 /// let x = SourceConfig::new().set_oracle_source_config(OracleSourceConfig::default()/* use setters */);
11374 /// assert!(x.oracle_source_config().is_some());
11375 /// assert!(x.mysql_source_config().is_none());
11376 /// assert!(x.postgresql_source_config().is_none());
11377 /// assert!(x.sql_server_source_config().is_none());
11378 /// assert!(x.salesforce_source_config().is_none());
11379 /// assert!(x.mongodb_source_config().is_none());
11380 /// ```
11381 pub fn set_oracle_source_config<
11382 T: std::convert::Into<std::boxed::Box<crate::model::OracleSourceConfig>>,
11383 >(
11384 mut self,
11385 v: T,
11386 ) -> Self {
11387 self.source_stream_config = std::option::Option::Some(
11388 crate::model::source_config::SourceStreamConfig::OracleSourceConfig(v.into()),
11389 );
11390 self
11391 }
11392
11393 /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11394 /// if it holds a `MysqlSourceConfig`, `None` if the field is not set or
11395 /// holds a different branch.
11396 pub fn mysql_source_config(
11397 &self,
11398 ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlSourceConfig>> {
11399 #[allow(unreachable_patterns)]
11400 self.source_stream_config.as_ref().and_then(|v| match v {
11401 crate::model::source_config::SourceStreamConfig::MysqlSourceConfig(v) => {
11402 std::option::Option::Some(v)
11403 }
11404 _ => std::option::Option::None,
11405 })
11406 }
11407
11408 /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11409 /// to hold a `MysqlSourceConfig`.
11410 ///
11411 /// Note that all the setters affecting `source_stream_config` are
11412 /// mutually exclusive.
11413 ///
11414 /// # Example
11415 /// ```ignore,no_run
11416 /// # use google_cloud_datastream_v1::model::SourceConfig;
11417 /// use google_cloud_datastream_v1::model::MysqlSourceConfig;
11418 /// let x = SourceConfig::new().set_mysql_source_config(MysqlSourceConfig::default()/* use setters */);
11419 /// assert!(x.mysql_source_config().is_some());
11420 /// assert!(x.oracle_source_config().is_none());
11421 /// assert!(x.postgresql_source_config().is_none());
11422 /// assert!(x.sql_server_source_config().is_none());
11423 /// assert!(x.salesforce_source_config().is_none());
11424 /// assert!(x.mongodb_source_config().is_none());
11425 /// ```
11426 pub fn set_mysql_source_config<
11427 T: std::convert::Into<std::boxed::Box<crate::model::MysqlSourceConfig>>,
11428 >(
11429 mut self,
11430 v: T,
11431 ) -> Self {
11432 self.source_stream_config = std::option::Option::Some(
11433 crate::model::source_config::SourceStreamConfig::MysqlSourceConfig(v.into()),
11434 );
11435 self
11436 }
11437
11438 /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11439 /// if it holds a `PostgresqlSourceConfig`, `None` if the field is not set or
11440 /// holds a different branch.
11441 pub fn postgresql_source_config(
11442 &self,
11443 ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlSourceConfig>> {
11444 #[allow(unreachable_patterns)]
11445 self.source_stream_config.as_ref().and_then(|v| match v {
11446 crate::model::source_config::SourceStreamConfig::PostgresqlSourceConfig(v) => {
11447 std::option::Option::Some(v)
11448 }
11449 _ => std::option::Option::None,
11450 })
11451 }
11452
11453 /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11454 /// to hold a `PostgresqlSourceConfig`.
11455 ///
11456 /// Note that all the setters affecting `source_stream_config` are
11457 /// mutually exclusive.
11458 ///
11459 /// # Example
11460 /// ```ignore,no_run
11461 /// # use google_cloud_datastream_v1::model::SourceConfig;
11462 /// use google_cloud_datastream_v1::model::PostgresqlSourceConfig;
11463 /// let x = SourceConfig::new().set_postgresql_source_config(PostgresqlSourceConfig::default()/* use setters */);
11464 /// assert!(x.postgresql_source_config().is_some());
11465 /// assert!(x.oracle_source_config().is_none());
11466 /// assert!(x.mysql_source_config().is_none());
11467 /// assert!(x.sql_server_source_config().is_none());
11468 /// assert!(x.salesforce_source_config().is_none());
11469 /// assert!(x.mongodb_source_config().is_none());
11470 /// ```
11471 pub fn set_postgresql_source_config<
11472 T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlSourceConfig>>,
11473 >(
11474 mut self,
11475 v: T,
11476 ) -> Self {
11477 self.source_stream_config = std::option::Option::Some(
11478 crate::model::source_config::SourceStreamConfig::PostgresqlSourceConfig(v.into()),
11479 );
11480 self
11481 }
11482
11483 /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11484 /// if it holds a `SqlServerSourceConfig`, `None` if the field is not set or
11485 /// holds a different branch.
11486 pub fn sql_server_source_config(
11487 &self,
11488 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerSourceConfig>> {
11489 #[allow(unreachable_patterns)]
11490 self.source_stream_config.as_ref().and_then(|v| match v {
11491 crate::model::source_config::SourceStreamConfig::SqlServerSourceConfig(v) => {
11492 std::option::Option::Some(v)
11493 }
11494 _ => std::option::Option::None,
11495 })
11496 }
11497
11498 /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11499 /// to hold a `SqlServerSourceConfig`.
11500 ///
11501 /// Note that all the setters affecting `source_stream_config` are
11502 /// mutually exclusive.
11503 ///
11504 /// # Example
11505 /// ```ignore,no_run
11506 /// # use google_cloud_datastream_v1::model::SourceConfig;
11507 /// use google_cloud_datastream_v1::model::SqlServerSourceConfig;
11508 /// let x = SourceConfig::new().set_sql_server_source_config(SqlServerSourceConfig::default()/* use setters */);
11509 /// assert!(x.sql_server_source_config().is_some());
11510 /// assert!(x.oracle_source_config().is_none());
11511 /// assert!(x.mysql_source_config().is_none());
11512 /// assert!(x.postgresql_source_config().is_none());
11513 /// assert!(x.salesforce_source_config().is_none());
11514 /// assert!(x.mongodb_source_config().is_none());
11515 /// ```
11516 pub fn set_sql_server_source_config<
11517 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerSourceConfig>>,
11518 >(
11519 mut self,
11520 v: T,
11521 ) -> Self {
11522 self.source_stream_config = std::option::Option::Some(
11523 crate::model::source_config::SourceStreamConfig::SqlServerSourceConfig(v.into()),
11524 );
11525 self
11526 }
11527
11528 /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11529 /// if it holds a `SalesforceSourceConfig`, `None` if the field is not set or
11530 /// holds a different branch.
11531 pub fn salesforce_source_config(
11532 &self,
11533 ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceSourceConfig>> {
11534 #[allow(unreachable_patterns)]
11535 self.source_stream_config.as_ref().and_then(|v| match v {
11536 crate::model::source_config::SourceStreamConfig::SalesforceSourceConfig(v) => {
11537 std::option::Option::Some(v)
11538 }
11539 _ => std::option::Option::None,
11540 })
11541 }
11542
11543 /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11544 /// to hold a `SalesforceSourceConfig`.
11545 ///
11546 /// Note that all the setters affecting `source_stream_config` are
11547 /// mutually exclusive.
11548 ///
11549 /// # Example
11550 /// ```ignore,no_run
11551 /// # use google_cloud_datastream_v1::model::SourceConfig;
11552 /// use google_cloud_datastream_v1::model::SalesforceSourceConfig;
11553 /// let x = SourceConfig::new().set_salesforce_source_config(SalesforceSourceConfig::default()/* use setters */);
11554 /// assert!(x.salesforce_source_config().is_some());
11555 /// assert!(x.oracle_source_config().is_none());
11556 /// assert!(x.mysql_source_config().is_none());
11557 /// assert!(x.postgresql_source_config().is_none());
11558 /// assert!(x.sql_server_source_config().is_none());
11559 /// assert!(x.mongodb_source_config().is_none());
11560 /// ```
11561 pub fn set_salesforce_source_config<
11562 T: std::convert::Into<std::boxed::Box<crate::model::SalesforceSourceConfig>>,
11563 >(
11564 mut self,
11565 v: T,
11566 ) -> Self {
11567 self.source_stream_config = std::option::Option::Some(
11568 crate::model::source_config::SourceStreamConfig::SalesforceSourceConfig(v.into()),
11569 );
11570 self
11571 }
11572
11573 /// The value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11574 /// if it holds a `MongodbSourceConfig`, `None` if the field is not set or
11575 /// holds a different branch.
11576 pub fn mongodb_source_config(
11577 &self,
11578 ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbSourceConfig>> {
11579 #[allow(unreachable_patterns)]
11580 self.source_stream_config.as_ref().and_then(|v| match v {
11581 crate::model::source_config::SourceStreamConfig::MongodbSourceConfig(v) => {
11582 std::option::Option::Some(v)
11583 }
11584 _ => std::option::Option::None,
11585 })
11586 }
11587
11588 /// Sets the value of [source_stream_config][crate::model::SourceConfig::source_stream_config]
11589 /// to hold a `MongodbSourceConfig`.
11590 ///
11591 /// Note that all the setters affecting `source_stream_config` are
11592 /// mutually exclusive.
11593 ///
11594 /// # Example
11595 /// ```ignore,no_run
11596 /// # use google_cloud_datastream_v1::model::SourceConfig;
11597 /// use google_cloud_datastream_v1::model::MongodbSourceConfig;
11598 /// let x = SourceConfig::new().set_mongodb_source_config(MongodbSourceConfig::default()/* use setters */);
11599 /// assert!(x.mongodb_source_config().is_some());
11600 /// assert!(x.oracle_source_config().is_none());
11601 /// assert!(x.mysql_source_config().is_none());
11602 /// assert!(x.postgresql_source_config().is_none());
11603 /// assert!(x.sql_server_source_config().is_none());
11604 /// assert!(x.salesforce_source_config().is_none());
11605 /// ```
11606 pub fn set_mongodb_source_config<
11607 T: std::convert::Into<std::boxed::Box<crate::model::MongodbSourceConfig>>,
11608 >(
11609 mut self,
11610 v: T,
11611 ) -> Self {
11612 self.source_stream_config = std::option::Option::Some(
11613 crate::model::source_config::SourceStreamConfig::MongodbSourceConfig(v.into()),
11614 );
11615 self
11616 }
11617}
11618
11619impl wkt::message::Message for SourceConfig {
11620 fn typename() -> &'static str {
11621 "type.googleapis.com/google.cloud.datastream.v1.SourceConfig"
11622 }
11623}
11624
11625/// Defines additional types related to [SourceConfig].
11626pub mod source_config {
11627 #[allow(unused_imports)]
11628 use super::*;
11629
11630 /// Stream configuration that is specific to the data source type.
11631 #[derive(Clone, Debug, PartialEq)]
11632 #[non_exhaustive]
11633 pub enum SourceStreamConfig {
11634 /// Oracle data source configuration.
11635 OracleSourceConfig(std::boxed::Box<crate::model::OracleSourceConfig>),
11636 /// MySQL data source configuration.
11637 MysqlSourceConfig(std::boxed::Box<crate::model::MysqlSourceConfig>),
11638 /// PostgreSQL data source configuration.
11639 PostgresqlSourceConfig(std::boxed::Box<crate::model::PostgresqlSourceConfig>),
11640 /// SQLServer data source configuration.
11641 SqlServerSourceConfig(std::boxed::Box<crate::model::SqlServerSourceConfig>),
11642 /// Salesforce data source configuration.
11643 SalesforceSourceConfig(std::boxed::Box<crate::model::SalesforceSourceConfig>),
11644 /// MongoDB data source configuration.
11645 MongodbSourceConfig(std::boxed::Box<crate::model::MongodbSourceConfig>),
11646 }
11647}
11648
11649/// AVRO file format configuration.
11650#[derive(Clone, Default, PartialEq)]
11651#[non_exhaustive]
11652pub struct AvroFileFormat {
11653 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11654}
11655
11656impl AvroFileFormat {
11657 /// Creates a new default instance.
11658 pub fn new() -> Self {
11659 std::default::Default::default()
11660 }
11661}
11662
11663impl wkt::message::Message for AvroFileFormat {
11664 fn typename() -> &'static str {
11665 "type.googleapis.com/google.cloud.datastream.v1.AvroFileFormat"
11666 }
11667}
11668
11669/// JSON file format configuration.
11670#[derive(Clone, Default, PartialEq)]
11671#[non_exhaustive]
11672pub struct JsonFileFormat {
11673 /// The schema file format along JSON data files.
11674 pub schema_file_format: crate::model::json_file_format::SchemaFileFormat,
11675
11676 /// Compression of the loaded JSON file.
11677 pub compression: crate::model::json_file_format::JsonCompression,
11678
11679 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11680}
11681
11682impl JsonFileFormat {
11683 /// Creates a new default instance.
11684 pub fn new() -> Self {
11685 std::default::Default::default()
11686 }
11687
11688 /// Sets the value of [schema_file_format][crate::model::JsonFileFormat::schema_file_format].
11689 ///
11690 /// # Example
11691 /// ```ignore,no_run
11692 /// # use google_cloud_datastream_v1::model::JsonFileFormat;
11693 /// use google_cloud_datastream_v1::model::json_file_format::SchemaFileFormat;
11694 /// let x0 = JsonFileFormat::new().set_schema_file_format(SchemaFileFormat::NoSchemaFile);
11695 /// let x1 = JsonFileFormat::new().set_schema_file_format(SchemaFileFormat::AvroSchemaFile);
11696 /// ```
11697 pub fn set_schema_file_format<
11698 T: std::convert::Into<crate::model::json_file_format::SchemaFileFormat>,
11699 >(
11700 mut self,
11701 v: T,
11702 ) -> Self {
11703 self.schema_file_format = v.into();
11704 self
11705 }
11706
11707 /// Sets the value of [compression][crate::model::JsonFileFormat::compression].
11708 ///
11709 /// # Example
11710 /// ```ignore,no_run
11711 /// # use google_cloud_datastream_v1::model::JsonFileFormat;
11712 /// use google_cloud_datastream_v1::model::json_file_format::JsonCompression;
11713 /// let x0 = JsonFileFormat::new().set_compression(JsonCompression::NoCompression);
11714 /// let x1 = JsonFileFormat::new().set_compression(JsonCompression::Gzip);
11715 /// ```
11716 pub fn set_compression<
11717 T: std::convert::Into<crate::model::json_file_format::JsonCompression>,
11718 >(
11719 mut self,
11720 v: T,
11721 ) -> Self {
11722 self.compression = v.into();
11723 self
11724 }
11725}
11726
11727impl wkt::message::Message for JsonFileFormat {
11728 fn typename() -> &'static str {
11729 "type.googleapis.com/google.cloud.datastream.v1.JsonFileFormat"
11730 }
11731}
11732
11733/// Defines additional types related to [JsonFileFormat].
11734pub mod json_file_format {
11735 #[allow(unused_imports)]
11736 use super::*;
11737
11738 /// Schema file format.
11739 ///
11740 /// # Working with unknown values
11741 ///
11742 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11743 /// additional enum variants at any time. Adding new variants is not considered
11744 /// a breaking change. Applications should write their code in anticipation of:
11745 ///
11746 /// - New values appearing in future releases of the client library, **and**
11747 /// - New values received dynamically, without application changes.
11748 ///
11749 /// Please consult the [Working with enums] section in the user guide for some
11750 /// guidelines.
11751 ///
11752 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11753 #[derive(Clone, Debug, PartialEq)]
11754 #[non_exhaustive]
11755 pub enum SchemaFileFormat {
11756 /// Unspecified schema file format.
11757 Unspecified,
11758 /// Do not attach schema file.
11759 NoSchemaFile,
11760 /// Avro schema format.
11761 AvroSchemaFile,
11762 /// If set, the enum was initialized with an unknown value.
11763 ///
11764 /// Applications can examine the value using [SchemaFileFormat::value] or
11765 /// [SchemaFileFormat::name].
11766 UnknownValue(schema_file_format::UnknownValue),
11767 }
11768
11769 #[doc(hidden)]
11770 pub mod schema_file_format {
11771 #[allow(unused_imports)]
11772 use super::*;
11773 #[derive(Clone, Debug, PartialEq)]
11774 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11775 }
11776
11777 impl SchemaFileFormat {
11778 /// Gets the enum value.
11779 ///
11780 /// Returns `None` if the enum contains an unknown value deserialized from
11781 /// the string representation of enums.
11782 pub fn value(&self) -> std::option::Option<i32> {
11783 match self {
11784 Self::Unspecified => std::option::Option::Some(0),
11785 Self::NoSchemaFile => std::option::Option::Some(1),
11786 Self::AvroSchemaFile => std::option::Option::Some(2),
11787 Self::UnknownValue(u) => u.0.value(),
11788 }
11789 }
11790
11791 /// Gets the enum value as a string.
11792 ///
11793 /// Returns `None` if the enum contains an unknown value deserialized from
11794 /// the integer representation of enums.
11795 pub fn name(&self) -> std::option::Option<&str> {
11796 match self {
11797 Self::Unspecified => std::option::Option::Some("SCHEMA_FILE_FORMAT_UNSPECIFIED"),
11798 Self::NoSchemaFile => std::option::Option::Some("NO_SCHEMA_FILE"),
11799 Self::AvroSchemaFile => std::option::Option::Some("AVRO_SCHEMA_FILE"),
11800 Self::UnknownValue(u) => u.0.name(),
11801 }
11802 }
11803 }
11804
11805 impl std::default::Default for SchemaFileFormat {
11806 fn default() -> Self {
11807 use std::convert::From;
11808 Self::from(0)
11809 }
11810 }
11811
11812 impl std::fmt::Display for SchemaFileFormat {
11813 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11814 wkt::internal::display_enum(f, self.name(), self.value())
11815 }
11816 }
11817
11818 impl std::convert::From<i32> for SchemaFileFormat {
11819 fn from(value: i32) -> Self {
11820 match value {
11821 0 => Self::Unspecified,
11822 1 => Self::NoSchemaFile,
11823 2 => Self::AvroSchemaFile,
11824 _ => Self::UnknownValue(schema_file_format::UnknownValue(
11825 wkt::internal::UnknownEnumValue::Integer(value),
11826 )),
11827 }
11828 }
11829 }
11830
11831 impl std::convert::From<&str> for SchemaFileFormat {
11832 fn from(value: &str) -> Self {
11833 use std::string::ToString;
11834 match value {
11835 "SCHEMA_FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
11836 "NO_SCHEMA_FILE" => Self::NoSchemaFile,
11837 "AVRO_SCHEMA_FILE" => Self::AvroSchemaFile,
11838 _ => Self::UnknownValue(schema_file_format::UnknownValue(
11839 wkt::internal::UnknownEnumValue::String(value.to_string()),
11840 )),
11841 }
11842 }
11843 }
11844
11845 impl serde::ser::Serialize for SchemaFileFormat {
11846 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11847 where
11848 S: serde::Serializer,
11849 {
11850 match self {
11851 Self::Unspecified => serializer.serialize_i32(0),
11852 Self::NoSchemaFile => serializer.serialize_i32(1),
11853 Self::AvroSchemaFile => serializer.serialize_i32(2),
11854 Self::UnknownValue(u) => u.0.serialize(serializer),
11855 }
11856 }
11857 }
11858
11859 impl<'de> serde::de::Deserialize<'de> for SchemaFileFormat {
11860 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11861 where
11862 D: serde::Deserializer<'de>,
11863 {
11864 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SchemaFileFormat>::new(
11865 ".google.cloud.datastream.v1.JsonFileFormat.SchemaFileFormat",
11866 ))
11867 }
11868 }
11869
11870 /// Json file compression.
11871 ///
11872 /// # Working with unknown values
11873 ///
11874 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11875 /// additional enum variants at any time. Adding new variants is not considered
11876 /// a breaking change. Applications should write their code in anticipation of:
11877 ///
11878 /// - New values appearing in future releases of the client library, **and**
11879 /// - New values received dynamically, without application changes.
11880 ///
11881 /// Please consult the [Working with enums] section in the user guide for some
11882 /// guidelines.
11883 ///
11884 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11885 #[derive(Clone, Debug, PartialEq)]
11886 #[non_exhaustive]
11887 pub enum JsonCompression {
11888 /// Unspecified json file compression.
11889 Unspecified,
11890 /// Do not compress JSON file.
11891 NoCompression,
11892 /// Gzip compression.
11893 Gzip,
11894 /// If set, the enum was initialized with an unknown value.
11895 ///
11896 /// Applications can examine the value using [JsonCompression::value] or
11897 /// [JsonCompression::name].
11898 UnknownValue(json_compression::UnknownValue),
11899 }
11900
11901 #[doc(hidden)]
11902 pub mod json_compression {
11903 #[allow(unused_imports)]
11904 use super::*;
11905 #[derive(Clone, Debug, PartialEq)]
11906 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11907 }
11908
11909 impl JsonCompression {
11910 /// Gets the enum value.
11911 ///
11912 /// Returns `None` if the enum contains an unknown value deserialized from
11913 /// the string representation of enums.
11914 pub fn value(&self) -> std::option::Option<i32> {
11915 match self {
11916 Self::Unspecified => std::option::Option::Some(0),
11917 Self::NoCompression => std::option::Option::Some(1),
11918 Self::Gzip => std::option::Option::Some(2),
11919 Self::UnknownValue(u) => u.0.value(),
11920 }
11921 }
11922
11923 /// Gets the enum value as a string.
11924 ///
11925 /// Returns `None` if the enum contains an unknown value deserialized from
11926 /// the integer representation of enums.
11927 pub fn name(&self) -> std::option::Option<&str> {
11928 match self {
11929 Self::Unspecified => std::option::Option::Some("JSON_COMPRESSION_UNSPECIFIED"),
11930 Self::NoCompression => std::option::Option::Some("NO_COMPRESSION"),
11931 Self::Gzip => std::option::Option::Some("GZIP"),
11932 Self::UnknownValue(u) => u.0.name(),
11933 }
11934 }
11935 }
11936
11937 impl std::default::Default for JsonCompression {
11938 fn default() -> Self {
11939 use std::convert::From;
11940 Self::from(0)
11941 }
11942 }
11943
11944 impl std::fmt::Display for JsonCompression {
11945 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11946 wkt::internal::display_enum(f, self.name(), self.value())
11947 }
11948 }
11949
11950 impl std::convert::From<i32> for JsonCompression {
11951 fn from(value: i32) -> Self {
11952 match value {
11953 0 => Self::Unspecified,
11954 1 => Self::NoCompression,
11955 2 => Self::Gzip,
11956 _ => Self::UnknownValue(json_compression::UnknownValue(
11957 wkt::internal::UnknownEnumValue::Integer(value),
11958 )),
11959 }
11960 }
11961 }
11962
11963 impl std::convert::From<&str> for JsonCompression {
11964 fn from(value: &str) -> Self {
11965 use std::string::ToString;
11966 match value {
11967 "JSON_COMPRESSION_UNSPECIFIED" => Self::Unspecified,
11968 "NO_COMPRESSION" => Self::NoCompression,
11969 "GZIP" => Self::Gzip,
11970 _ => Self::UnknownValue(json_compression::UnknownValue(
11971 wkt::internal::UnknownEnumValue::String(value.to_string()),
11972 )),
11973 }
11974 }
11975 }
11976
11977 impl serde::ser::Serialize for JsonCompression {
11978 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11979 where
11980 S: serde::Serializer,
11981 {
11982 match self {
11983 Self::Unspecified => serializer.serialize_i32(0),
11984 Self::NoCompression => serializer.serialize_i32(1),
11985 Self::Gzip => serializer.serialize_i32(2),
11986 Self::UnknownValue(u) => u.0.serialize(serializer),
11987 }
11988 }
11989 }
11990
11991 impl<'de> serde::de::Deserialize<'de> for JsonCompression {
11992 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11993 where
11994 D: serde::Deserializer<'de>,
11995 {
11996 deserializer.deserialize_any(wkt::internal::EnumVisitor::<JsonCompression>::new(
11997 ".google.cloud.datastream.v1.JsonFileFormat.JsonCompression",
11998 ))
11999 }
12000 }
12001}
12002
12003/// Google Cloud Storage destination configuration
12004#[derive(Clone, Default, PartialEq)]
12005#[non_exhaustive]
12006pub struct GcsDestinationConfig {
12007 /// Path inside the Cloud Storage bucket to write data to.
12008 pub path: std::string::String,
12009
12010 /// The maximum file size to be saved in the bucket.
12011 pub file_rotation_mb: i32,
12012
12013 /// The maximum duration for which new events are added before a file is
12014 /// closed and a new file is created. Values within the range of 15-60 seconds
12015 /// are allowed.
12016 pub file_rotation_interval: std::option::Option<wkt::Duration>,
12017
12018 /// File Format that the data should be written in.
12019 pub file_format: std::option::Option<crate::model::gcs_destination_config::FileFormat>,
12020
12021 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12022}
12023
12024impl GcsDestinationConfig {
12025 /// Creates a new default instance.
12026 pub fn new() -> Self {
12027 std::default::Default::default()
12028 }
12029
12030 /// Sets the value of [path][crate::model::GcsDestinationConfig::path].
12031 ///
12032 /// # Example
12033 /// ```ignore,no_run
12034 /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
12035 /// let x = GcsDestinationConfig::new().set_path("example");
12036 /// ```
12037 pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12038 self.path = v.into();
12039 self
12040 }
12041
12042 /// Sets the value of [file_rotation_mb][crate::model::GcsDestinationConfig::file_rotation_mb].
12043 ///
12044 /// # Example
12045 /// ```ignore,no_run
12046 /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
12047 /// let x = GcsDestinationConfig::new().set_file_rotation_mb(42);
12048 /// ```
12049 pub fn set_file_rotation_mb<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12050 self.file_rotation_mb = v.into();
12051 self
12052 }
12053
12054 /// Sets the value of [file_rotation_interval][crate::model::GcsDestinationConfig::file_rotation_interval].
12055 ///
12056 /// # Example
12057 /// ```ignore,no_run
12058 /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
12059 /// use wkt::Duration;
12060 /// let x = GcsDestinationConfig::new().set_file_rotation_interval(Duration::default()/* use setters */);
12061 /// ```
12062 pub fn set_file_rotation_interval<T>(mut self, v: T) -> Self
12063 where
12064 T: std::convert::Into<wkt::Duration>,
12065 {
12066 self.file_rotation_interval = std::option::Option::Some(v.into());
12067 self
12068 }
12069
12070 /// Sets or clears the value of [file_rotation_interval][crate::model::GcsDestinationConfig::file_rotation_interval].
12071 ///
12072 /// # Example
12073 /// ```ignore,no_run
12074 /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
12075 /// use wkt::Duration;
12076 /// let x = GcsDestinationConfig::new().set_or_clear_file_rotation_interval(Some(Duration::default()/* use setters */));
12077 /// let x = GcsDestinationConfig::new().set_or_clear_file_rotation_interval(None::<Duration>);
12078 /// ```
12079 pub fn set_or_clear_file_rotation_interval<T>(mut self, v: std::option::Option<T>) -> Self
12080 where
12081 T: std::convert::Into<wkt::Duration>,
12082 {
12083 self.file_rotation_interval = v.map(|x| x.into());
12084 self
12085 }
12086
12087 /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format].
12088 ///
12089 /// Note that all the setters affecting `file_format` are mutually
12090 /// exclusive.
12091 ///
12092 /// # Example
12093 /// ```ignore,no_run
12094 /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
12095 /// use google_cloud_datastream_v1::model::AvroFileFormat;
12096 /// let x = GcsDestinationConfig::new().set_file_format(Some(
12097 /// google_cloud_datastream_v1::model::gcs_destination_config::FileFormat::AvroFileFormat(AvroFileFormat::default().into())));
12098 /// ```
12099 pub fn set_file_format<
12100 T: std::convert::Into<std::option::Option<crate::model::gcs_destination_config::FileFormat>>,
12101 >(
12102 mut self,
12103 v: T,
12104 ) -> Self {
12105 self.file_format = v.into();
12106 self
12107 }
12108
12109 /// The value of [file_format][crate::model::GcsDestinationConfig::file_format]
12110 /// if it holds a `AvroFileFormat`, `None` if the field is not set or
12111 /// holds a different branch.
12112 pub fn avro_file_format(
12113 &self,
12114 ) -> std::option::Option<&std::boxed::Box<crate::model::AvroFileFormat>> {
12115 #[allow(unreachable_patterns)]
12116 self.file_format.as_ref().and_then(|v| match v {
12117 crate::model::gcs_destination_config::FileFormat::AvroFileFormat(v) => {
12118 std::option::Option::Some(v)
12119 }
12120 _ => std::option::Option::None,
12121 })
12122 }
12123
12124 /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format]
12125 /// to hold a `AvroFileFormat`.
12126 ///
12127 /// Note that all the setters affecting `file_format` are
12128 /// mutually exclusive.
12129 ///
12130 /// # Example
12131 /// ```ignore,no_run
12132 /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
12133 /// use google_cloud_datastream_v1::model::AvroFileFormat;
12134 /// let x = GcsDestinationConfig::new().set_avro_file_format(AvroFileFormat::default()/* use setters */);
12135 /// assert!(x.avro_file_format().is_some());
12136 /// assert!(x.json_file_format().is_none());
12137 /// ```
12138 pub fn set_avro_file_format<
12139 T: std::convert::Into<std::boxed::Box<crate::model::AvroFileFormat>>,
12140 >(
12141 mut self,
12142 v: T,
12143 ) -> Self {
12144 self.file_format = std::option::Option::Some(
12145 crate::model::gcs_destination_config::FileFormat::AvroFileFormat(v.into()),
12146 );
12147 self
12148 }
12149
12150 /// The value of [file_format][crate::model::GcsDestinationConfig::file_format]
12151 /// if it holds a `JsonFileFormat`, `None` if the field is not set or
12152 /// holds a different branch.
12153 pub fn json_file_format(
12154 &self,
12155 ) -> std::option::Option<&std::boxed::Box<crate::model::JsonFileFormat>> {
12156 #[allow(unreachable_patterns)]
12157 self.file_format.as_ref().and_then(|v| match v {
12158 crate::model::gcs_destination_config::FileFormat::JsonFileFormat(v) => {
12159 std::option::Option::Some(v)
12160 }
12161 _ => std::option::Option::None,
12162 })
12163 }
12164
12165 /// Sets the value of [file_format][crate::model::GcsDestinationConfig::file_format]
12166 /// to hold a `JsonFileFormat`.
12167 ///
12168 /// Note that all the setters affecting `file_format` are
12169 /// mutually exclusive.
12170 ///
12171 /// # Example
12172 /// ```ignore,no_run
12173 /// # use google_cloud_datastream_v1::model::GcsDestinationConfig;
12174 /// use google_cloud_datastream_v1::model::JsonFileFormat;
12175 /// let x = GcsDestinationConfig::new().set_json_file_format(JsonFileFormat::default()/* use setters */);
12176 /// assert!(x.json_file_format().is_some());
12177 /// assert!(x.avro_file_format().is_none());
12178 /// ```
12179 pub fn set_json_file_format<
12180 T: std::convert::Into<std::boxed::Box<crate::model::JsonFileFormat>>,
12181 >(
12182 mut self,
12183 v: T,
12184 ) -> Self {
12185 self.file_format = std::option::Option::Some(
12186 crate::model::gcs_destination_config::FileFormat::JsonFileFormat(v.into()),
12187 );
12188 self
12189 }
12190}
12191
12192impl wkt::message::Message for GcsDestinationConfig {
12193 fn typename() -> &'static str {
12194 "type.googleapis.com/google.cloud.datastream.v1.GcsDestinationConfig"
12195 }
12196}
12197
12198/// Defines additional types related to [GcsDestinationConfig].
12199pub mod gcs_destination_config {
12200 #[allow(unused_imports)]
12201 use super::*;
12202
12203 /// File Format that the data should be written in.
12204 #[derive(Clone, Debug, PartialEq)]
12205 #[non_exhaustive]
12206 pub enum FileFormat {
12207 /// AVRO file format configuration.
12208 AvroFileFormat(std::boxed::Box<crate::model::AvroFileFormat>),
12209 /// JSON file format configuration.
12210 JsonFileFormat(std::boxed::Box<crate::model::JsonFileFormat>),
12211 }
12212}
12213
12214/// BigQuery destination configuration
12215#[derive(Clone, Default, PartialEq)]
12216#[non_exhaustive]
12217pub struct BigQueryDestinationConfig {
12218 /// The guaranteed data freshness (in seconds) when querying tables created by
12219 /// the stream. Editing this field will only affect new tables created in the
12220 /// future, but existing tables will not be impacted. Lower values mean that
12221 /// queries will return fresher data, but may result in higher cost.
12222 pub data_freshness: std::option::Option<wkt::Duration>,
12223
12224 /// Optional. Big Lake Managed Tables (BLMT) configuration.
12225 pub blmt_config: std::option::Option<crate::model::big_query_destination_config::BlmtConfig>,
12226
12227 /// Target dataset(s) configuration.
12228 pub dataset_config:
12229 std::option::Option<crate::model::big_query_destination_config::DatasetConfig>,
12230
12231 #[allow(missing_docs)]
12232 pub write_mode: std::option::Option<crate::model::big_query_destination_config::WriteMode>,
12233
12234 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12235}
12236
12237impl BigQueryDestinationConfig {
12238 /// Creates a new default instance.
12239 pub fn new() -> Self {
12240 std::default::Default::default()
12241 }
12242
12243 /// Sets the value of [data_freshness][crate::model::BigQueryDestinationConfig::data_freshness].
12244 ///
12245 /// # Example
12246 /// ```ignore,no_run
12247 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12248 /// use wkt::Duration;
12249 /// let x = BigQueryDestinationConfig::new().set_data_freshness(Duration::default()/* use setters */);
12250 /// ```
12251 pub fn set_data_freshness<T>(mut self, v: T) -> Self
12252 where
12253 T: std::convert::Into<wkt::Duration>,
12254 {
12255 self.data_freshness = std::option::Option::Some(v.into());
12256 self
12257 }
12258
12259 /// Sets or clears the value of [data_freshness][crate::model::BigQueryDestinationConfig::data_freshness].
12260 ///
12261 /// # Example
12262 /// ```ignore,no_run
12263 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12264 /// use wkt::Duration;
12265 /// let x = BigQueryDestinationConfig::new().set_or_clear_data_freshness(Some(Duration::default()/* use setters */));
12266 /// let x = BigQueryDestinationConfig::new().set_or_clear_data_freshness(None::<Duration>);
12267 /// ```
12268 pub fn set_or_clear_data_freshness<T>(mut self, v: std::option::Option<T>) -> Self
12269 where
12270 T: std::convert::Into<wkt::Duration>,
12271 {
12272 self.data_freshness = v.map(|x| x.into());
12273 self
12274 }
12275
12276 /// Sets the value of [blmt_config][crate::model::BigQueryDestinationConfig::blmt_config].
12277 ///
12278 /// # Example
12279 /// ```ignore,no_run
12280 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12281 /// use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12282 /// let x = BigQueryDestinationConfig::new().set_blmt_config(BlmtConfig::default()/* use setters */);
12283 /// ```
12284 pub fn set_blmt_config<T>(mut self, v: T) -> Self
12285 where
12286 T: std::convert::Into<crate::model::big_query_destination_config::BlmtConfig>,
12287 {
12288 self.blmt_config = std::option::Option::Some(v.into());
12289 self
12290 }
12291
12292 /// Sets or clears the value of [blmt_config][crate::model::BigQueryDestinationConfig::blmt_config].
12293 ///
12294 /// # Example
12295 /// ```ignore,no_run
12296 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12297 /// use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12298 /// let x = BigQueryDestinationConfig::new().set_or_clear_blmt_config(Some(BlmtConfig::default()/* use setters */));
12299 /// let x = BigQueryDestinationConfig::new().set_or_clear_blmt_config(None::<BlmtConfig>);
12300 /// ```
12301 pub fn set_or_clear_blmt_config<T>(mut self, v: std::option::Option<T>) -> Self
12302 where
12303 T: std::convert::Into<crate::model::big_query_destination_config::BlmtConfig>,
12304 {
12305 self.blmt_config = v.map(|x| x.into());
12306 self
12307 }
12308
12309 /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config].
12310 ///
12311 /// Note that all the setters affecting `dataset_config` are mutually
12312 /// exclusive.
12313 ///
12314 /// # Example
12315 /// ```ignore,no_run
12316 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12317 /// use google_cloud_datastream_v1::model::big_query_destination_config::SingleTargetDataset;
12318 /// let x = BigQueryDestinationConfig::new().set_dataset_config(Some(
12319 /// google_cloud_datastream_v1::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(SingleTargetDataset::default().into())));
12320 /// ```
12321 pub fn set_dataset_config<
12322 T: std::convert::Into<
12323 std::option::Option<crate::model::big_query_destination_config::DatasetConfig>,
12324 >,
12325 >(
12326 mut self,
12327 v: T,
12328 ) -> Self {
12329 self.dataset_config = v.into();
12330 self
12331 }
12332
12333 /// The value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12334 /// if it holds a `SingleTargetDataset`, `None` if the field is not set or
12335 /// holds a different branch.
12336 pub fn single_target_dataset(
12337 &self,
12338 ) -> std::option::Option<
12339 &std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
12340 > {
12341 #[allow(unreachable_patterns)]
12342 self.dataset_config.as_ref().and_then(|v| match v {
12343 crate::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(v) => {
12344 std::option::Option::Some(v)
12345 }
12346 _ => std::option::Option::None,
12347 })
12348 }
12349
12350 /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12351 /// to hold a `SingleTargetDataset`.
12352 ///
12353 /// Note that all the setters affecting `dataset_config` are
12354 /// mutually exclusive.
12355 ///
12356 /// # Example
12357 /// ```ignore,no_run
12358 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12359 /// use google_cloud_datastream_v1::model::big_query_destination_config::SingleTargetDataset;
12360 /// let x = BigQueryDestinationConfig::new().set_single_target_dataset(SingleTargetDataset::default()/* use setters */);
12361 /// assert!(x.single_target_dataset().is_some());
12362 /// assert!(x.source_hierarchy_datasets().is_none());
12363 /// ```
12364 pub fn set_single_target_dataset<
12365 T: std::convert::Into<
12366 std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
12367 >,
12368 >(
12369 mut self,
12370 v: T,
12371 ) -> Self {
12372 self.dataset_config = std::option::Option::Some(
12373 crate::model::big_query_destination_config::DatasetConfig::SingleTargetDataset(
12374 v.into(),
12375 ),
12376 );
12377 self
12378 }
12379
12380 /// The value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12381 /// if it holds a `SourceHierarchyDatasets`, `None` if the field is not set or
12382 /// holds a different branch.
12383 pub fn source_hierarchy_datasets(
12384 &self,
12385 ) -> std::option::Option<
12386 &std::boxed::Box<crate::model::big_query_destination_config::SourceHierarchyDatasets>,
12387 > {
12388 #[allow(unreachable_patterns)]
12389 self.dataset_config.as_ref().and_then(|v| match v {
12390 crate::model::big_query_destination_config::DatasetConfig::SourceHierarchyDatasets(
12391 v,
12392 ) => std::option::Option::Some(v),
12393 _ => std::option::Option::None,
12394 })
12395 }
12396
12397 /// Sets the value of [dataset_config][crate::model::BigQueryDestinationConfig::dataset_config]
12398 /// to hold a `SourceHierarchyDatasets`.
12399 ///
12400 /// Note that all the setters affecting `dataset_config` are
12401 /// mutually exclusive.
12402 ///
12403 /// # Example
12404 /// ```ignore,no_run
12405 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12406 /// use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12407 /// let x = BigQueryDestinationConfig::new().set_source_hierarchy_datasets(SourceHierarchyDatasets::default()/* use setters */);
12408 /// assert!(x.source_hierarchy_datasets().is_some());
12409 /// assert!(x.single_target_dataset().is_none());
12410 /// ```
12411 pub fn set_source_hierarchy_datasets<
12412 T: std::convert::Into<
12413 std::boxed::Box<
12414 crate::model::big_query_destination_config::SourceHierarchyDatasets,
12415 >,
12416 >,
12417 >(
12418 mut self,
12419 v: T,
12420 ) -> Self {
12421 self.dataset_config = std::option::Option::Some(
12422 crate::model::big_query_destination_config::DatasetConfig::SourceHierarchyDatasets(
12423 v.into(),
12424 ),
12425 );
12426 self
12427 }
12428
12429 /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode].
12430 ///
12431 /// Note that all the setters affecting `write_mode` are mutually
12432 /// exclusive.
12433 ///
12434 /// # Example
12435 /// ```ignore,no_run
12436 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12437 /// use google_cloud_datastream_v1::model::big_query_destination_config::Merge;
12438 /// let x = BigQueryDestinationConfig::new().set_write_mode(Some(
12439 /// google_cloud_datastream_v1::model::big_query_destination_config::WriteMode::Merge(Merge::default().into())));
12440 /// ```
12441 pub fn set_write_mode<
12442 T: std::convert::Into<
12443 std::option::Option<crate::model::big_query_destination_config::WriteMode>,
12444 >,
12445 >(
12446 mut self,
12447 v: T,
12448 ) -> Self {
12449 self.write_mode = v.into();
12450 self
12451 }
12452
12453 /// The value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12454 /// if it holds a `Merge`, `None` if the field is not set or
12455 /// holds a different branch.
12456 pub fn merge(
12457 &self,
12458 ) -> std::option::Option<&std::boxed::Box<crate::model::big_query_destination_config::Merge>>
12459 {
12460 #[allow(unreachable_patterns)]
12461 self.write_mode.as_ref().and_then(|v| match v {
12462 crate::model::big_query_destination_config::WriteMode::Merge(v) => {
12463 std::option::Option::Some(v)
12464 }
12465 _ => std::option::Option::None,
12466 })
12467 }
12468
12469 /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12470 /// to hold a `Merge`.
12471 ///
12472 /// Note that all the setters affecting `write_mode` are
12473 /// mutually exclusive.
12474 ///
12475 /// # Example
12476 /// ```ignore,no_run
12477 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12478 /// use google_cloud_datastream_v1::model::big_query_destination_config::Merge;
12479 /// let x = BigQueryDestinationConfig::new().set_merge(Merge::default()/* use setters */);
12480 /// assert!(x.merge().is_some());
12481 /// assert!(x.append_only().is_none());
12482 /// ```
12483 pub fn set_merge<
12484 T: std::convert::Into<std::boxed::Box<crate::model::big_query_destination_config::Merge>>,
12485 >(
12486 mut self,
12487 v: T,
12488 ) -> Self {
12489 self.write_mode = std::option::Option::Some(
12490 crate::model::big_query_destination_config::WriteMode::Merge(v.into()),
12491 );
12492 self
12493 }
12494
12495 /// The value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12496 /// if it holds a `AppendOnly`, `None` if the field is not set or
12497 /// holds a different branch.
12498 pub fn append_only(
12499 &self,
12500 ) -> std::option::Option<&std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>>
12501 {
12502 #[allow(unreachable_patterns)]
12503 self.write_mode.as_ref().and_then(|v| match v {
12504 crate::model::big_query_destination_config::WriteMode::AppendOnly(v) => {
12505 std::option::Option::Some(v)
12506 }
12507 _ => std::option::Option::None,
12508 })
12509 }
12510
12511 /// Sets the value of [write_mode][crate::model::BigQueryDestinationConfig::write_mode]
12512 /// to hold a `AppendOnly`.
12513 ///
12514 /// Note that all the setters affecting `write_mode` are
12515 /// mutually exclusive.
12516 ///
12517 /// # Example
12518 /// ```ignore,no_run
12519 /// # use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
12520 /// use google_cloud_datastream_v1::model::big_query_destination_config::AppendOnly;
12521 /// let x = BigQueryDestinationConfig::new().set_append_only(AppendOnly::default()/* use setters */);
12522 /// assert!(x.append_only().is_some());
12523 /// assert!(x.merge().is_none());
12524 /// ```
12525 pub fn set_append_only<
12526 T: std::convert::Into<std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>>,
12527 >(
12528 mut self,
12529 v: T,
12530 ) -> Self {
12531 self.write_mode = std::option::Option::Some(
12532 crate::model::big_query_destination_config::WriteMode::AppendOnly(v.into()),
12533 );
12534 self
12535 }
12536}
12537
12538impl wkt::message::Message for BigQueryDestinationConfig {
12539 fn typename() -> &'static str {
12540 "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig"
12541 }
12542}
12543
12544/// Defines additional types related to [BigQueryDestinationConfig].
12545pub mod big_query_destination_config {
12546 #[allow(unused_imports)]
12547 use super::*;
12548
12549 /// A single target dataset to which all data will be streamed.
12550 #[derive(Clone, Default, PartialEq)]
12551 #[non_exhaustive]
12552 pub struct SingleTargetDataset {
12553 /// The dataset ID of the target dataset.
12554 /// DatasetIds allowed characters:
12555 /// <https://cloud.google.com/bigquery/docs/reference/rest/v2/datasets#datasetreference>.
12556 pub dataset_id: std::string::String,
12557
12558 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12559 }
12560
12561 impl SingleTargetDataset {
12562 /// Creates a new default instance.
12563 pub fn new() -> Self {
12564 std::default::Default::default()
12565 }
12566
12567 /// Sets the value of [dataset_id][crate::model::big_query_destination_config::SingleTargetDataset::dataset_id].
12568 ///
12569 /// # Example
12570 /// ```ignore,no_run
12571 /// # use google_cloud_datastream_v1::model::big_query_destination_config::SingleTargetDataset;
12572 /// let x = SingleTargetDataset::new().set_dataset_id("example");
12573 /// ```
12574 pub fn set_dataset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12575 self.dataset_id = v.into();
12576 self
12577 }
12578 }
12579
12580 impl wkt::message::Message for SingleTargetDataset {
12581 fn typename() -> &'static str {
12582 "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SingleTargetDataset"
12583 }
12584 }
12585
12586 /// Destination datasets are created so that hierarchy of the destination data
12587 /// objects matches the source hierarchy.
12588 #[derive(Clone, Default, PartialEq)]
12589 #[non_exhaustive]
12590 pub struct SourceHierarchyDatasets {
12591 /// The dataset template to use for dynamic dataset creation.
12592 pub dataset_template: std::option::Option<
12593 crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate,
12594 >,
12595
12596 /// Optional. The project id of the BigQuery dataset. If not specified, the
12597 /// project will be inferred from the stream resource.
12598 pub project_id: std::option::Option<std::string::String>,
12599
12600 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12601 }
12602
12603 impl SourceHierarchyDatasets {
12604 /// Creates a new default instance.
12605 pub fn new() -> Self {
12606 std::default::Default::default()
12607 }
12608
12609 /// Sets the value of [dataset_template][crate::model::big_query_destination_config::SourceHierarchyDatasets::dataset_template].
12610 ///
12611 /// # Example
12612 /// ```ignore,no_run
12613 /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12614 /// use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12615 /// let x = SourceHierarchyDatasets::new().set_dataset_template(DatasetTemplate::default()/* use setters */);
12616 /// ```
12617 pub fn set_dataset_template<T>(mut self, v: T) -> Self
12618 where T: std::convert::Into<crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate>
12619 {
12620 self.dataset_template = std::option::Option::Some(v.into());
12621 self
12622 }
12623
12624 /// Sets or clears the value of [dataset_template][crate::model::big_query_destination_config::SourceHierarchyDatasets::dataset_template].
12625 ///
12626 /// # Example
12627 /// ```ignore,no_run
12628 /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12629 /// use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12630 /// let x = SourceHierarchyDatasets::new().set_or_clear_dataset_template(Some(DatasetTemplate::default()/* use setters */));
12631 /// let x = SourceHierarchyDatasets::new().set_or_clear_dataset_template(None::<DatasetTemplate>);
12632 /// ```
12633 pub fn set_or_clear_dataset_template<T>(mut self, v: std::option::Option<T>) -> Self
12634 where T: std::convert::Into<crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate>
12635 {
12636 self.dataset_template = v.map(|x| x.into());
12637 self
12638 }
12639
12640 /// Sets the value of [project_id][crate::model::big_query_destination_config::SourceHierarchyDatasets::project_id].
12641 ///
12642 /// # Example
12643 /// ```ignore,no_run
12644 /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12645 /// let x = SourceHierarchyDatasets::new().set_project_id("example");
12646 /// ```
12647 pub fn set_project_id<T>(mut self, v: T) -> Self
12648 where
12649 T: std::convert::Into<std::string::String>,
12650 {
12651 self.project_id = std::option::Option::Some(v.into());
12652 self
12653 }
12654
12655 /// Sets or clears the value of [project_id][crate::model::big_query_destination_config::SourceHierarchyDatasets::project_id].
12656 ///
12657 /// # Example
12658 /// ```ignore,no_run
12659 /// # use google_cloud_datastream_v1::model::big_query_destination_config::SourceHierarchyDatasets;
12660 /// let x = SourceHierarchyDatasets::new().set_or_clear_project_id(Some("example"));
12661 /// let x = SourceHierarchyDatasets::new().set_or_clear_project_id(None::<String>);
12662 /// ```
12663 pub fn set_or_clear_project_id<T>(mut self, v: std::option::Option<T>) -> Self
12664 where
12665 T: std::convert::Into<std::string::String>,
12666 {
12667 self.project_id = v.map(|x| x.into());
12668 self
12669 }
12670 }
12671
12672 impl wkt::message::Message for SourceHierarchyDatasets {
12673 fn typename() -> &'static str {
12674 "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SourceHierarchyDatasets"
12675 }
12676 }
12677
12678 /// Defines additional types related to [SourceHierarchyDatasets].
12679 pub mod source_hierarchy_datasets {
12680 #[allow(unused_imports)]
12681 use super::*;
12682
12683 /// Dataset template used for dynamic dataset creation.
12684 #[derive(Clone, Default, PartialEq)]
12685 #[non_exhaustive]
12686 pub struct DatasetTemplate {
12687 /// Required. The geographic location where the dataset should reside. See
12688 /// <https://cloud.google.com/bigquery/docs/locations> for supported
12689 /// locations.
12690 pub location: std::string::String,
12691
12692 /// If supplied, every created dataset will have its name prefixed by the
12693 /// provided value. The prefix and name will be separated by an underscore.
12694 /// i.e. \<prefix\>_<dataset_name>.
12695 pub dataset_id_prefix: std::string::String,
12696
12697 /// Describes the Cloud KMS encryption key that will be used to
12698 /// protect destination BigQuery table. The BigQuery Service Account
12699 /// associated with your project requires access to this encryption key.
12700 /// i.e.
12701 /// projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{cryptoKey}.
12702 /// See <https://cloud.google.com/bigquery/docs/customer-managed-encryption>
12703 /// for more information.
12704 pub kms_key_name: std::string::String,
12705
12706 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12707 }
12708
12709 impl DatasetTemplate {
12710 /// Creates a new default instance.
12711 pub fn new() -> Self {
12712 std::default::Default::default()
12713 }
12714
12715 /// Sets the value of [location][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::location].
12716 ///
12717 /// # Example
12718 /// ```ignore,no_run
12719 /// # use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12720 /// let x = DatasetTemplate::new().set_location("example");
12721 /// ```
12722 pub fn set_location<T: std::convert::Into<std::string::String>>(
12723 mut self,
12724 v: T,
12725 ) -> Self {
12726 self.location = v.into();
12727 self
12728 }
12729
12730 /// Sets the value of [dataset_id_prefix][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::dataset_id_prefix].
12731 ///
12732 /// # Example
12733 /// ```ignore,no_run
12734 /// # use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12735 /// let x = DatasetTemplate::new().set_dataset_id_prefix("example");
12736 /// ```
12737 pub fn set_dataset_id_prefix<T: std::convert::Into<std::string::String>>(
12738 mut self,
12739 v: T,
12740 ) -> Self {
12741 self.dataset_id_prefix = v.into();
12742 self
12743 }
12744
12745 /// Sets the value of [kms_key_name][crate::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate::kms_key_name].
12746 ///
12747 /// # Example
12748 /// ```ignore,no_run
12749 /// # use google_cloud_datastream_v1::model::big_query_destination_config::source_hierarchy_datasets::DatasetTemplate;
12750 /// let x = DatasetTemplate::new().set_kms_key_name("example");
12751 /// ```
12752 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(
12753 mut self,
12754 v: T,
12755 ) -> Self {
12756 self.kms_key_name = v.into();
12757 self
12758 }
12759 }
12760
12761 impl wkt::message::Message for DatasetTemplate {
12762 fn typename() -> &'static str {
12763 "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.SourceHierarchyDatasets.DatasetTemplate"
12764 }
12765 }
12766 }
12767
12768 /// The configuration for BLMT.
12769 #[derive(Clone, Default, PartialEq)]
12770 #[non_exhaustive]
12771 pub struct BlmtConfig {
12772 /// Required. The Cloud Storage bucket name.
12773 pub bucket: std::string::String,
12774
12775 /// The root path inside the Cloud Storage bucket.
12776 pub root_path: std::string::String,
12777
12778 /// Required. The bigquery connection.
12779 /// Format: `{project}.{location}.{name}`
12780 pub connection_name: std::string::String,
12781
12782 /// Required. The file format.
12783 pub file_format: crate::model::big_query_destination_config::blmt_config::FileFormat,
12784
12785 /// Required. The table format.
12786 pub table_format: crate::model::big_query_destination_config::blmt_config::TableFormat,
12787
12788 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12789 }
12790
12791 impl BlmtConfig {
12792 /// Creates a new default instance.
12793 pub fn new() -> Self {
12794 std::default::Default::default()
12795 }
12796
12797 /// Sets the value of [bucket][crate::model::big_query_destination_config::BlmtConfig::bucket].
12798 ///
12799 /// # Example
12800 /// ```ignore,no_run
12801 /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12802 /// let x = BlmtConfig::new().set_bucket("example");
12803 /// ```
12804 pub fn set_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12805 self.bucket = v.into();
12806 self
12807 }
12808
12809 /// Sets the value of [root_path][crate::model::big_query_destination_config::BlmtConfig::root_path].
12810 ///
12811 /// # Example
12812 /// ```ignore,no_run
12813 /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12814 /// let x = BlmtConfig::new().set_root_path("example");
12815 /// ```
12816 pub fn set_root_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12817 self.root_path = v.into();
12818 self
12819 }
12820
12821 /// Sets the value of [connection_name][crate::model::big_query_destination_config::BlmtConfig::connection_name].
12822 ///
12823 /// # Example
12824 /// ```ignore,no_run
12825 /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12826 /// let x = BlmtConfig::new().set_connection_name("example");
12827 /// ```
12828 pub fn set_connection_name<T: std::convert::Into<std::string::String>>(
12829 mut self,
12830 v: T,
12831 ) -> Self {
12832 self.connection_name = v.into();
12833 self
12834 }
12835
12836 /// Sets the value of [file_format][crate::model::big_query_destination_config::BlmtConfig::file_format].
12837 ///
12838 /// # Example
12839 /// ```ignore,no_run
12840 /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12841 /// use google_cloud_datastream_v1::model::big_query_destination_config::blmt_config::FileFormat;
12842 /// let x0 = BlmtConfig::new().set_file_format(FileFormat::Parquet);
12843 /// ```
12844 pub fn set_file_format<
12845 T: std::convert::Into<crate::model::big_query_destination_config::blmt_config::FileFormat>,
12846 >(
12847 mut self,
12848 v: T,
12849 ) -> Self {
12850 self.file_format = v.into();
12851 self
12852 }
12853
12854 /// Sets the value of [table_format][crate::model::big_query_destination_config::BlmtConfig::table_format].
12855 ///
12856 /// # Example
12857 /// ```ignore,no_run
12858 /// # use google_cloud_datastream_v1::model::big_query_destination_config::BlmtConfig;
12859 /// use google_cloud_datastream_v1::model::big_query_destination_config::blmt_config::TableFormat;
12860 /// let x0 = BlmtConfig::new().set_table_format(TableFormat::Iceberg);
12861 /// ```
12862 pub fn set_table_format<
12863 T: std::convert::Into<
12864 crate::model::big_query_destination_config::blmt_config::TableFormat,
12865 >,
12866 >(
12867 mut self,
12868 v: T,
12869 ) -> Self {
12870 self.table_format = v.into();
12871 self
12872 }
12873 }
12874
12875 impl wkt::message::Message for BlmtConfig {
12876 fn typename() -> &'static str {
12877 "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig"
12878 }
12879 }
12880
12881 /// Defines additional types related to [BlmtConfig].
12882 pub mod blmt_config {
12883 #[allow(unused_imports)]
12884 use super::*;
12885
12886 /// Supported file formats for BigLake managed tables.
12887 ///
12888 /// # Working with unknown values
12889 ///
12890 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12891 /// additional enum variants at any time. Adding new variants is not considered
12892 /// a breaking change. Applications should write their code in anticipation of:
12893 ///
12894 /// - New values appearing in future releases of the client library, **and**
12895 /// - New values received dynamically, without application changes.
12896 ///
12897 /// Please consult the [Working with enums] section in the user guide for some
12898 /// guidelines.
12899 ///
12900 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12901 #[derive(Clone, Debug, PartialEq)]
12902 #[non_exhaustive]
12903 pub enum FileFormat {
12904 /// Default value.
12905 Unspecified,
12906 /// Parquet file format.
12907 Parquet,
12908 /// If set, the enum was initialized with an unknown value.
12909 ///
12910 /// Applications can examine the value using [FileFormat::value] or
12911 /// [FileFormat::name].
12912 UnknownValue(file_format::UnknownValue),
12913 }
12914
12915 #[doc(hidden)]
12916 pub mod file_format {
12917 #[allow(unused_imports)]
12918 use super::*;
12919 #[derive(Clone, Debug, PartialEq)]
12920 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12921 }
12922
12923 impl FileFormat {
12924 /// Gets the enum value.
12925 ///
12926 /// Returns `None` if the enum contains an unknown value deserialized from
12927 /// the string representation of enums.
12928 pub fn value(&self) -> std::option::Option<i32> {
12929 match self {
12930 Self::Unspecified => std::option::Option::Some(0),
12931 Self::Parquet => std::option::Option::Some(1),
12932 Self::UnknownValue(u) => u.0.value(),
12933 }
12934 }
12935
12936 /// Gets the enum value as a string.
12937 ///
12938 /// Returns `None` if the enum contains an unknown value deserialized from
12939 /// the integer representation of enums.
12940 pub fn name(&self) -> std::option::Option<&str> {
12941 match self {
12942 Self::Unspecified => std::option::Option::Some("FILE_FORMAT_UNSPECIFIED"),
12943 Self::Parquet => std::option::Option::Some("PARQUET"),
12944 Self::UnknownValue(u) => u.0.name(),
12945 }
12946 }
12947 }
12948
12949 impl std::default::Default for FileFormat {
12950 fn default() -> Self {
12951 use std::convert::From;
12952 Self::from(0)
12953 }
12954 }
12955
12956 impl std::fmt::Display for FileFormat {
12957 fn fmt(
12958 &self,
12959 f: &mut std::fmt::Formatter<'_>,
12960 ) -> std::result::Result<(), std::fmt::Error> {
12961 wkt::internal::display_enum(f, self.name(), self.value())
12962 }
12963 }
12964
12965 impl std::convert::From<i32> for FileFormat {
12966 fn from(value: i32) -> Self {
12967 match value {
12968 0 => Self::Unspecified,
12969 1 => Self::Parquet,
12970 _ => Self::UnknownValue(file_format::UnknownValue(
12971 wkt::internal::UnknownEnumValue::Integer(value),
12972 )),
12973 }
12974 }
12975 }
12976
12977 impl std::convert::From<&str> for FileFormat {
12978 fn from(value: &str) -> Self {
12979 use std::string::ToString;
12980 match value {
12981 "FILE_FORMAT_UNSPECIFIED" => Self::Unspecified,
12982 "PARQUET" => Self::Parquet,
12983 _ => Self::UnknownValue(file_format::UnknownValue(
12984 wkt::internal::UnknownEnumValue::String(value.to_string()),
12985 )),
12986 }
12987 }
12988 }
12989
12990 impl serde::ser::Serialize for FileFormat {
12991 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12992 where
12993 S: serde::Serializer,
12994 {
12995 match self {
12996 Self::Unspecified => serializer.serialize_i32(0),
12997 Self::Parquet => serializer.serialize_i32(1),
12998 Self::UnknownValue(u) => u.0.serialize(serializer),
12999 }
13000 }
13001 }
13002
13003 impl<'de> serde::de::Deserialize<'de> for FileFormat {
13004 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13005 where
13006 D: serde::Deserializer<'de>,
13007 {
13008 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FileFormat>::new(
13009 ".google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig.FileFormat",
13010 ))
13011 }
13012 }
13013
13014 /// Supported table formats for BigLake managed tables.
13015 ///
13016 /// # Working with unknown values
13017 ///
13018 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13019 /// additional enum variants at any time. Adding new variants is not considered
13020 /// a breaking change. Applications should write their code in anticipation of:
13021 ///
13022 /// - New values appearing in future releases of the client library, **and**
13023 /// - New values received dynamically, without application changes.
13024 ///
13025 /// Please consult the [Working with enums] section in the user guide for some
13026 /// guidelines.
13027 ///
13028 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
13029 #[derive(Clone, Debug, PartialEq)]
13030 #[non_exhaustive]
13031 pub enum TableFormat {
13032 /// Default value.
13033 Unspecified,
13034 /// Iceberg table format.
13035 Iceberg,
13036 /// If set, the enum was initialized with an unknown value.
13037 ///
13038 /// Applications can examine the value using [TableFormat::value] or
13039 /// [TableFormat::name].
13040 UnknownValue(table_format::UnknownValue),
13041 }
13042
13043 #[doc(hidden)]
13044 pub mod table_format {
13045 #[allow(unused_imports)]
13046 use super::*;
13047 #[derive(Clone, Debug, PartialEq)]
13048 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13049 }
13050
13051 impl TableFormat {
13052 /// Gets the enum value.
13053 ///
13054 /// Returns `None` if the enum contains an unknown value deserialized from
13055 /// the string representation of enums.
13056 pub fn value(&self) -> std::option::Option<i32> {
13057 match self {
13058 Self::Unspecified => std::option::Option::Some(0),
13059 Self::Iceberg => std::option::Option::Some(1),
13060 Self::UnknownValue(u) => u.0.value(),
13061 }
13062 }
13063
13064 /// Gets the enum value as a string.
13065 ///
13066 /// Returns `None` if the enum contains an unknown value deserialized from
13067 /// the integer representation of enums.
13068 pub fn name(&self) -> std::option::Option<&str> {
13069 match self {
13070 Self::Unspecified => std::option::Option::Some("TABLE_FORMAT_UNSPECIFIED"),
13071 Self::Iceberg => std::option::Option::Some("ICEBERG"),
13072 Self::UnknownValue(u) => u.0.name(),
13073 }
13074 }
13075 }
13076
13077 impl std::default::Default for TableFormat {
13078 fn default() -> Self {
13079 use std::convert::From;
13080 Self::from(0)
13081 }
13082 }
13083
13084 impl std::fmt::Display for TableFormat {
13085 fn fmt(
13086 &self,
13087 f: &mut std::fmt::Formatter<'_>,
13088 ) -> std::result::Result<(), std::fmt::Error> {
13089 wkt::internal::display_enum(f, self.name(), self.value())
13090 }
13091 }
13092
13093 impl std::convert::From<i32> for TableFormat {
13094 fn from(value: i32) -> Self {
13095 match value {
13096 0 => Self::Unspecified,
13097 1 => Self::Iceberg,
13098 _ => Self::UnknownValue(table_format::UnknownValue(
13099 wkt::internal::UnknownEnumValue::Integer(value),
13100 )),
13101 }
13102 }
13103 }
13104
13105 impl std::convert::From<&str> for TableFormat {
13106 fn from(value: &str) -> Self {
13107 use std::string::ToString;
13108 match value {
13109 "TABLE_FORMAT_UNSPECIFIED" => Self::Unspecified,
13110 "ICEBERG" => Self::Iceberg,
13111 _ => Self::UnknownValue(table_format::UnknownValue(
13112 wkt::internal::UnknownEnumValue::String(value.to_string()),
13113 )),
13114 }
13115 }
13116 }
13117
13118 impl serde::ser::Serialize for TableFormat {
13119 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13120 where
13121 S: serde::Serializer,
13122 {
13123 match self {
13124 Self::Unspecified => serializer.serialize_i32(0),
13125 Self::Iceberg => serializer.serialize_i32(1),
13126 Self::UnknownValue(u) => u.0.serialize(serializer),
13127 }
13128 }
13129 }
13130
13131 impl<'de> serde::de::Deserialize<'de> for TableFormat {
13132 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13133 where
13134 D: serde::Deserializer<'de>,
13135 {
13136 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TableFormat>::new(
13137 ".google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig.TableFormat",
13138 ))
13139 }
13140 }
13141 }
13142
13143 /// AppendOnly mode defines that all changes to a table will be written to the
13144 /// destination table.
13145 #[derive(Clone, Default, PartialEq)]
13146 #[non_exhaustive]
13147 pub struct AppendOnly {
13148 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13149 }
13150
13151 impl AppendOnly {
13152 /// Creates a new default instance.
13153 pub fn new() -> Self {
13154 std::default::Default::default()
13155 }
13156 }
13157
13158 impl wkt::message::Message for AppendOnly {
13159 fn typename() -> &'static str {
13160 "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.AppendOnly"
13161 }
13162 }
13163
13164 /// Merge mode defines that all changes to a table will be merged at the
13165 /// destination table.
13166 #[derive(Clone, Default, PartialEq)]
13167 #[non_exhaustive]
13168 pub struct Merge {
13169 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13170 }
13171
13172 impl Merge {
13173 /// Creates a new default instance.
13174 pub fn new() -> Self {
13175 std::default::Default::default()
13176 }
13177 }
13178
13179 impl wkt::message::Message for Merge {
13180 fn typename() -> &'static str {
13181 "type.googleapis.com/google.cloud.datastream.v1.BigQueryDestinationConfig.Merge"
13182 }
13183 }
13184
13185 /// Target dataset(s) configuration.
13186 #[derive(Clone, Debug, PartialEq)]
13187 #[non_exhaustive]
13188 pub enum DatasetConfig {
13189 /// Single destination dataset.
13190 SingleTargetDataset(
13191 std::boxed::Box<crate::model::big_query_destination_config::SingleTargetDataset>,
13192 ),
13193 /// Source hierarchy datasets.
13194 SourceHierarchyDatasets(
13195 std::boxed::Box<crate::model::big_query_destination_config::SourceHierarchyDatasets>,
13196 ),
13197 }
13198
13199 #[allow(missing_docs)]
13200 #[derive(Clone, Debug, PartialEq)]
13201 #[non_exhaustive]
13202 pub enum WriteMode {
13203 /// The standard mode
13204 Merge(std::boxed::Box<crate::model::big_query_destination_config::Merge>),
13205 /// Append only mode
13206 AppendOnly(std::boxed::Box<crate::model::big_query_destination_config::AppendOnly>),
13207 }
13208}
13209
13210/// The configuration of the stream destination.
13211#[derive(Clone, Default, PartialEq)]
13212#[non_exhaustive]
13213pub struct DestinationConfig {
13214 /// Required. Destination connection profile resource.
13215 /// Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
13216 pub destination_connection_profile: std::string::String,
13217
13218 /// Stream configuration that is specific to the data destination type.
13219 pub destination_stream_config:
13220 std::option::Option<crate::model::destination_config::DestinationStreamConfig>,
13221
13222 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13223}
13224
13225impl DestinationConfig {
13226 /// Creates a new default instance.
13227 pub fn new() -> Self {
13228 std::default::Default::default()
13229 }
13230
13231 /// Sets the value of [destination_connection_profile][crate::model::DestinationConfig::destination_connection_profile].
13232 ///
13233 /// # Example
13234 /// ```ignore,no_run
13235 /// # use google_cloud_datastream_v1::model::DestinationConfig;
13236 /// # let project_id = "project_id";
13237 /// # let location_id = "location_id";
13238 /// # let connection_profile_id = "connection_profile_id";
13239 /// let x = DestinationConfig::new().set_destination_connection_profile(format!("projects/{project_id}/locations/{location_id}/connectionProfiles/{connection_profile_id}"));
13240 /// ```
13241 pub fn set_destination_connection_profile<T: std::convert::Into<std::string::String>>(
13242 mut self,
13243 v: T,
13244 ) -> Self {
13245 self.destination_connection_profile = v.into();
13246 self
13247 }
13248
13249 /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config].
13250 ///
13251 /// Note that all the setters affecting `destination_stream_config` are mutually
13252 /// exclusive.
13253 ///
13254 /// # Example
13255 /// ```ignore,no_run
13256 /// # use google_cloud_datastream_v1::model::DestinationConfig;
13257 /// use google_cloud_datastream_v1::model::GcsDestinationConfig;
13258 /// let x = DestinationConfig::new().set_destination_stream_config(Some(
13259 /// google_cloud_datastream_v1::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(GcsDestinationConfig::default().into())));
13260 /// ```
13261 pub fn set_destination_stream_config<
13262 T: std::convert::Into<
13263 std::option::Option<crate::model::destination_config::DestinationStreamConfig>,
13264 >,
13265 >(
13266 mut self,
13267 v: T,
13268 ) -> Self {
13269 self.destination_stream_config = v.into();
13270 self
13271 }
13272
13273 /// The value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13274 /// if it holds a `GcsDestinationConfig`, `None` if the field is not set or
13275 /// holds a different branch.
13276 pub fn gcs_destination_config(
13277 &self,
13278 ) -> std::option::Option<&std::boxed::Box<crate::model::GcsDestinationConfig>> {
13279 #[allow(unreachable_patterns)]
13280 self.destination_stream_config
13281 .as_ref()
13282 .and_then(|v| match v {
13283 crate::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(
13284 v,
13285 ) => std::option::Option::Some(v),
13286 _ => std::option::Option::None,
13287 })
13288 }
13289
13290 /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13291 /// to hold a `GcsDestinationConfig`.
13292 ///
13293 /// Note that all the setters affecting `destination_stream_config` are
13294 /// mutually exclusive.
13295 ///
13296 /// # Example
13297 /// ```ignore,no_run
13298 /// # use google_cloud_datastream_v1::model::DestinationConfig;
13299 /// use google_cloud_datastream_v1::model::GcsDestinationConfig;
13300 /// let x = DestinationConfig::new().set_gcs_destination_config(GcsDestinationConfig::default()/* use setters */);
13301 /// assert!(x.gcs_destination_config().is_some());
13302 /// assert!(x.bigquery_destination_config().is_none());
13303 /// ```
13304 pub fn set_gcs_destination_config<
13305 T: std::convert::Into<std::boxed::Box<crate::model::GcsDestinationConfig>>,
13306 >(
13307 mut self,
13308 v: T,
13309 ) -> Self {
13310 self.destination_stream_config = std::option::Option::Some(
13311 crate::model::destination_config::DestinationStreamConfig::GcsDestinationConfig(
13312 v.into(),
13313 ),
13314 );
13315 self
13316 }
13317
13318 /// The value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13319 /// if it holds a `BigqueryDestinationConfig`, `None` if the field is not set or
13320 /// holds a different branch.
13321 pub fn bigquery_destination_config(
13322 &self,
13323 ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryDestinationConfig>> {
13324 #[allow(unreachable_patterns)]
13325 self.destination_stream_config.as_ref().and_then(|v| match v {
13326 crate::model::destination_config::DestinationStreamConfig::BigqueryDestinationConfig(v) => std::option::Option::Some(v),
13327 _ => std::option::Option::None,
13328 })
13329 }
13330
13331 /// Sets the value of [destination_stream_config][crate::model::DestinationConfig::destination_stream_config]
13332 /// to hold a `BigqueryDestinationConfig`.
13333 ///
13334 /// Note that all the setters affecting `destination_stream_config` are
13335 /// mutually exclusive.
13336 ///
13337 /// # Example
13338 /// ```ignore,no_run
13339 /// # use google_cloud_datastream_v1::model::DestinationConfig;
13340 /// use google_cloud_datastream_v1::model::BigQueryDestinationConfig;
13341 /// let x = DestinationConfig::new().set_bigquery_destination_config(BigQueryDestinationConfig::default()/* use setters */);
13342 /// assert!(x.bigquery_destination_config().is_some());
13343 /// assert!(x.gcs_destination_config().is_none());
13344 /// ```
13345 pub fn set_bigquery_destination_config<
13346 T: std::convert::Into<std::boxed::Box<crate::model::BigQueryDestinationConfig>>,
13347 >(
13348 mut self,
13349 v: T,
13350 ) -> Self {
13351 self.destination_stream_config = std::option::Option::Some(
13352 crate::model::destination_config::DestinationStreamConfig::BigqueryDestinationConfig(
13353 v.into(),
13354 ),
13355 );
13356 self
13357 }
13358}
13359
13360impl wkt::message::Message for DestinationConfig {
13361 fn typename() -> &'static str {
13362 "type.googleapis.com/google.cloud.datastream.v1.DestinationConfig"
13363 }
13364}
13365
13366/// Defines additional types related to [DestinationConfig].
13367pub mod destination_config {
13368 #[allow(unused_imports)]
13369 use super::*;
13370
13371 /// Stream configuration that is specific to the data destination type.
13372 #[derive(Clone, Debug, PartialEq)]
13373 #[non_exhaustive]
13374 pub enum DestinationStreamConfig {
13375 /// A configuration for how data should be loaded to Cloud Storage.
13376 GcsDestinationConfig(std::boxed::Box<crate::model::GcsDestinationConfig>),
13377 /// BigQuery destination configuration.
13378 BigqueryDestinationConfig(std::boxed::Box<crate::model::BigQueryDestinationConfig>),
13379 }
13380}
13381
13382/// A resource representing streaming data from a source to a destination.
13383#[derive(Clone, Default, PartialEq)]
13384#[non_exhaustive]
13385pub struct Stream {
13386 /// Output only. Identifier. The stream's name.
13387 pub name: std::string::String,
13388
13389 /// Output only. The creation time of the stream.
13390 pub create_time: std::option::Option<wkt::Timestamp>,
13391
13392 /// Output only. The last update time of the stream.
13393 pub update_time: std::option::Option<wkt::Timestamp>,
13394
13395 /// Labels.
13396 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
13397
13398 /// Required. Display name.
13399 pub display_name: std::string::String,
13400
13401 /// Required. Source connection profile configuration.
13402 pub source_config: std::option::Option<crate::model::SourceConfig>,
13403
13404 /// Required. Destination connection profile configuration.
13405 pub destination_config: std::option::Option<crate::model::DestinationConfig>,
13406
13407 /// The state of the stream.
13408 pub state: crate::model::stream::State,
13409
13410 /// Output only. Errors on the Stream.
13411 pub errors: std::vec::Vec<crate::model::Error>,
13412
13413 /// Immutable. A reference to a KMS encryption key.
13414 /// If provided, it will be used to encrypt the data.
13415 /// If left blank, data will be encrypted using an internal Stream-specific
13416 /// encryption key provisioned through KMS.
13417 pub customer_managed_encryption_key: std::option::Option<std::string::String>,
13418
13419 /// Output only. If the stream was recovered, the time of the last recovery.
13420 /// Note: This field is currently experimental.
13421 pub last_recovery_time: std::option::Option<wkt::Timestamp>,
13422
13423 /// Output only. Reserved for future use.
13424 pub satisfies_pzs: std::option::Option<bool>,
13425
13426 /// Output only. Reserved for future use.
13427 pub satisfies_pzi: std::option::Option<bool>,
13428
13429 /// Stream backfill strategy.
13430 pub backfill_strategy: std::option::Option<crate::model::stream::BackfillStrategy>,
13431
13432 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13433}
13434
13435impl Stream {
13436 /// Creates a new default instance.
13437 pub fn new() -> Self {
13438 std::default::Default::default()
13439 }
13440
13441 /// Sets the value of [name][crate::model::Stream::name].
13442 ///
13443 /// # Example
13444 /// ```ignore,no_run
13445 /// # use google_cloud_datastream_v1::model::Stream;
13446 /// # let project_id = "project_id";
13447 /// # let location_id = "location_id";
13448 /// # let stream_id = "stream_id";
13449 /// let x = Stream::new().set_name(format!("projects/{project_id}/locations/{location_id}/streams/{stream_id}"));
13450 /// ```
13451 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13452 self.name = v.into();
13453 self
13454 }
13455
13456 /// Sets the value of [create_time][crate::model::Stream::create_time].
13457 ///
13458 /// # Example
13459 /// ```ignore,no_run
13460 /// # use google_cloud_datastream_v1::model::Stream;
13461 /// use wkt::Timestamp;
13462 /// let x = Stream::new().set_create_time(Timestamp::default()/* use setters */);
13463 /// ```
13464 pub fn set_create_time<T>(mut self, v: T) -> Self
13465 where
13466 T: std::convert::Into<wkt::Timestamp>,
13467 {
13468 self.create_time = std::option::Option::Some(v.into());
13469 self
13470 }
13471
13472 /// Sets or clears the value of [create_time][crate::model::Stream::create_time].
13473 ///
13474 /// # Example
13475 /// ```ignore,no_run
13476 /// # use google_cloud_datastream_v1::model::Stream;
13477 /// use wkt::Timestamp;
13478 /// let x = Stream::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13479 /// let x = Stream::new().set_or_clear_create_time(None::<Timestamp>);
13480 /// ```
13481 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13482 where
13483 T: std::convert::Into<wkt::Timestamp>,
13484 {
13485 self.create_time = v.map(|x| x.into());
13486 self
13487 }
13488
13489 /// Sets the value of [update_time][crate::model::Stream::update_time].
13490 ///
13491 /// # Example
13492 /// ```ignore,no_run
13493 /// # use google_cloud_datastream_v1::model::Stream;
13494 /// use wkt::Timestamp;
13495 /// let x = Stream::new().set_update_time(Timestamp::default()/* use setters */);
13496 /// ```
13497 pub fn set_update_time<T>(mut self, v: T) -> Self
13498 where
13499 T: std::convert::Into<wkt::Timestamp>,
13500 {
13501 self.update_time = std::option::Option::Some(v.into());
13502 self
13503 }
13504
13505 /// Sets or clears the value of [update_time][crate::model::Stream::update_time].
13506 ///
13507 /// # Example
13508 /// ```ignore,no_run
13509 /// # use google_cloud_datastream_v1::model::Stream;
13510 /// use wkt::Timestamp;
13511 /// let x = Stream::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
13512 /// let x = Stream::new().set_or_clear_update_time(None::<Timestamp>);
13513 /// ```
13514 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
13515 where
13516 T: std::convert::Into<wkt::Timestamp>,
13517 {
13518 self.update_time = v.map(|x| x.into());
13519 self
13520 }
13521
13522 /// Sets the value of [labels][crate::model::Stream::labels].
13523 ///
13524 /// # Example
13525 /// ```ignore,no_run
13526 /// # use google_cloud_datastream_v1::model::Stream;
13527 /// let x = Stream::new().set_labels([
13528 /// ("key0", "abc"),
13529 /// ("key1", "xyz"),
13530 /// ]);
13531 /// ```
13532 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
13533 where
13534 T: std::iter::IntoIterator<Item = (K, V)>,
13535 K: std::convert::Into<std::string::String>,
13536 V: std::convert::Into<std::string::String>,
13537 {
13538 use std::iter::Iterator;
13539 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13540 self
13541 }
13542
13543 /// Sets the value of [display_name][crate::model::Stream::display_name].
13544 ///
13545 /// # Example
13546 /// ```ignore,no_run
13547 /// # use google_cloud_datastream_v1::model::Stream;
13548 /// let x = Stream::new().set_display_name("example");
13549 /// ```
13550 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13551 self.display_name = v.into();
13552 self
13553 }
13554
13555 /// Sets the value of [source_config][crate::model::Stream::source_config].
13556 ///
13557 /// # Example
13558 /// ```ignore,no_run
13559 /// # use google_cloud_datastream_v1::model::Stream;
13560 /// use google_cloud_datastream_v1::model::SourceConfig;
13561 /// let x = Stream::new().set_source_config(SourceConfig::default()/* use setters */);
13562 /// ```
13563 pub fn set_source_config<T>(mut self, v: T) -> Self
13564 where
13565 T: std::convert::Into<crate::model::SourceConfig>,
13566 {
13567 self.source_config = std::option::Option::Some(v.into());
13568 self
13569 }
13570
13571 /// Sets or clears the value of [source_config][crate::model::Stream::source_config].
13572 ///
13573 /// # Example
13574 /// ```ignore,no_run
13575 /// # use google_cloud_datastream_v1::model::Stream;
13576 /// use google_cloud_datastream_v1::model::SourceConfig;
13577 /// let x = Stream::new().set_or_clear_source_config(Some(SourceConfig::default()/* use setters */));
13578 /// let x = Stream::new().set_or_clear_source_config(None::<SourceConfig>);
13579 /// ```
13580 pub fn set_or_clear_source_config<T>(mut self, v: std::option::Option<T>) -> Self
13581 where
13582 T: std::convert::Into<crate::model::SourceConfig>,
13583 {
13584 self.source_config = v.map(|x| x.into());
13585 self
13586 }
13587
13588 /// Sets the value of [destination_config][crate::model::Stream::destination_config].
13589 ///
13590 /// # Example
13591 /// ```ignore,no_run
13592 /// # use google_cloud_datastream_v1::model::Stream;
13593 /// use google_cloud_datastream_v1::model::DestinationConfig;
13594 /// let x = Stream::new().set_destination_config(DestinationConfig::default()/* use setters */);
13595 /// ```
13596 pub fn set_destination_config<T>(mut self, v: T) -> Self
13597 where
13598 T: std::convert::Into<crate::model::DestinationConfig>,
13599 {
13600 self.destination_config = std::option::Option::Some(v.into());
13601 self
13602 }
13603
13604 /// Sets or clears the value of [destination_config][crate::model::Stream::destination_config].
13605 ///
13606 /// # Example
13607 /// ```ignore,no_run
13608 /// # use google_cloud_datastream_v1::model::Stream;
13609 /// use google_cloud_datastream_v1::model::DestinationConfig;
13610 /// let x = Stream::new().set_or_clear_destination_config(Some(DestinationConfig::default()/* use setters */));
13611 /// let x = Stream::new().set_or_clear_destination_config(None::<DestinationConfig>);
13612 /// ```
13613 pub fn set_or_clear_destination_config<T>(mut self, v: std::option::Option<T>) -> Self
13614 where
13615 T: std::convert::Into<crate::model::DestinationConfig>,
13616 {
13617 self.destination_config = v.map(|x| x.into());
13618 self
13619 }
13620
13621 /// Sets the value of [state][crate::model::Stream::state].
13622 ///
13623 /// # Example
13624 /// ```ignore,no_run
13625 /// # use google_cloud_datastream_v1::model::Stream;
13626 /// use google_cloud_datastream_v1::model::stream::State;
13627 /// let x0 = Stream::new().set_state(State::NotStarted);
13628 /// let x1 = Stream::new().set_state(State::Running);
13629 /// let x2 = Stream::new().set_state(State::Paused);
13630 /// ```
13631 pub fn set_state<T: std::convert::Into<crate::model::stream::State>>(mut self, v: T) -> Self {
13632 self.state = v.into();
13633 self
13634 }
13635
13636 /// Sets the value of [errors][crate::model::Stream::errors].
13637 ///
13638 /// # Example
13639 /// ```ignore,no_run
13640 /// # use google_cloud_datastream_v1::model::Stream;
13641 /// use google_cloud_datastream_v1::model::Error;
13642 /// let x = Stream::new()
13643 /// .set_errors([
13644 /// Error::default()/* use setters */,
13645 /// Error::default()/* use (different) setters */,
13646 /// ]);
13647 /// ```
13648 pub fn set_errors<T, V>(mut self, v: T) -> Self
13649 where
13650 T: std::iter::IntoIterator<Item = V>,
13651 V: std::convert::Into<crate::model::Error>,
13652 {
13653 use std::iter::Iterator;
13654 self.errors = v.into_iter().map(|i| i.into()).collect();
13655 self
13656 }
13657
13658 /// Sets the value of [customer_managed_encryption_key][crate::model::Stream::customer_managed_encryption_key].
13659 ///
13660 /// # Example
13661 /// ```ignore,no_run
13662 /// # use google_cloud_datastream_v1::model::Stream;
13663 /// let x = Stream::new().set_customer_managed_encryption_key("example");
13664 /// ```
13665 pub fn set_customer_managed_encryption_key<T>(mut self, v: T) -> Self
13666 where
13667 T: std::convert::Into<std::string::String>,
13668 {
13669 self.customer_managed_encryption_key = std::option::Option::Some(v.into());
13670 self
13671 }
13672
13673 /// Sets or clears the value of [customer_managed_encryption_key][crate::model::Stream::customer_managed_encryption_key].
13674 ///
13675 /// # Example
13676 /// ```ignore,no_run
13677 /// # use google_cloud_datastream_v1::model::Stream;
13678 /// let x = Stream::new().set_or_clear_customer_managed_encryption_key(Some("example"));
13679 /// let x = Stream::new().set_or_clear_customer_managed_encryption_key(None::<String>);
13680 /// ```
13681 pub fn set_or_clear_customer_managed_encryption_key<T>(
13682 mut self,
13683 v: std::option::Option<T>,
13684 ) -> Self
13685 where
13686 T: std::convert::Into<std::string::String>,
13687 {
13688 self.customer_managed_encryption_key = v.map(|x| x.into());
13689 self
13690 }
13691
13692 /// Sets the value of [last_recovery_time][crate::model::Stream::last_recovery_time].
13693 ///
13694 /// # Example
13695 /// ```ignore,no_run
13696 /// # use google_cloud_datastream_v1::model::Stream;
13697 /// use wkt::Timestamp;
13698 /// let x = Stream::new().set_last_recovery_time(Timestamp::default()/* use setters */);
13699 /// ```
13700 pub fn set_last_recovery_time<T>(mut self, v: T) -> Self
13701 where
13702 T: std::convert::Into<wkt::Timestamp>,
13703 {
13704 self.last_recovery_time = std::option::Option::Some(v.into());
13705 self
13706 }
13707
13708 /// Sets or clears the value of [last_recovery_time][crate::model::Stream::last_recovery_time].
13709 ///
13710 /// # Example
13711 /// ```ignore,no_run
13712 /// # use google_cloud_datastream_v1::model::Stream;
13713 /// use wkt::Timestamp;
13714 /// let x = Stream::new().set_or_clear_last_recovery_time(Some(Timestamp::default()/* use setters */));
13715 /// let x = Stream::new().set_or_clear_last_recovery_time(None::<Timestamp>);
13716 /// ```
13717 pub fn set_or_clear_last_recovery_time<T>(mut self, v: std::option::Option<T>) -> Self
13718 where
13719 T: std::convert::Into<wkt::Timestamp>,
13720 {
13721 self.last_recovery_time = v.map(|x| x.into());
13722 self
13723 }
13724
13725 /// Sets the value of [satisfies_pzs][crate::model::Stream::satisfies_pzs].
13726 ///
13727 /// # Example
13728 /// ```ignore,no_run
13729 /// # use google_cloud_datastream_v1::model::Stream;
13730 /// let x = Stream::new().set_satisfies_pzs(true);
13731 /// ```
13732 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
13733 where
13734 T: std::convert::Into<bool>,
13735 {
13736 self.satisfies_pzs = std::option::Option::Some(v.into());
13737 self
13738 }
13739
13740 /// Sets or clears the value of [satisfies_pzs][crate::model::Stream::satisfies_pzs].
13741 ///
13742 /// # Example
13743 /// ```ignore,no_run
13744 /// # use google_cloud_datastream_v1::model::Stream;
13745 /// let x = Stream::new().set_or_clear_satisfies_pzs(Some(false));
13746 /// let x = Stream::new().set_or_clear_satisfies_pzs(None::<bool>);
13747 /// ```
13748 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
13749 where
13750 T: std::convert::Into<bool>,
13751 {
13752 self.satisfies_pzs = v.map(|x| x.into());
13753 self
13754 }
13755
13756 /// Sets the value of [satisfies_pzi][crate::model::Stream::satisfies_pzi].
13757 ///
13758 /// # Example
13759 /// ```ignore,no_run
13760 /// # use google_cloud_datastream_v1::model::Stream;
13761 /// let x = Stream::new().set_satisfies_pzi(true);
13762 /// ```
13763 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
13764 where
13765 T: std::convert::Into<bool>,
13766 {
13767 self.satisfies_pzi = std::option::Option::Some(v.into());
13768 self
13769 }
13770
13771 /// Sets or clears the value of [satisfies_pzi][crate::model::Stream::satisfies_pzi].
13772 ///
13773 /// # Example
13774 /// ```ignore,no_run
13775 /// # use google_cloud_datastream_v1::model::Stream;
13776 /// let x = Stream::new().set_or_clear_satisfies_pzi(Some(false));
13777 /// let x = Stream::new().set_or_clear_satisfies_pzi(None::<bool>);
13778 /// ```
13779 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
13780 where
13781 T: std::convert::Into<bool>,
13782 {
13783 self.satisfies_pzi = v.map(|x| x.into());
13784 self
13785 }
13786
13787 /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy].
13788 ///
13789 /// Note that all the setters affecting `backfill_strategy` are mutually
13790 /// exclusive.
13791 ///
13792 /// # Example
13793 /// ```ignore,no_run
13794 /// # use google_cloud_datastream_v1::model::Stream;
13795 /// use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13796 /// let x = Stream::new().set_backfill_strategy(Some(
13797 /// google_cloud_datastream_v1::model::stream::BackfillStrategy::BackfillAll(BackfillAllStrategy::default().into())));
13798 /// ```
13799 pub fn set_backfill_strategy<
13800 T: std::convert::Into<std::option::Option<crate::model::stream::BackfillStrategy>>,
13801 >(
13802 mut self,
13803 v: T,
13804 ) -> Self {
13805 self.backfill_strategy = v.into();
13806 self
13807 }
13808
13809 /// The value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13810 /// if it holds a `BackfillAll`, `None` if the field is not set or
13811 /// holds a different branch.
13812 pub fn backfill_all(
13813 &self,
13814 ) -> std::option::Option<&std::boxed::Box<crate::model::stream::BackfillAllStrategy>> {
13815 #[allow(unreachable_patterns)]
13816 self.backfill_strategy.as_ref().and_then(|v| match v {
13817 crate::model::stream::BackfillStrategy::BackfillAll(v) => std::option::Option::Some(v),
13818 _ => std::option::Option::None,
13819 })
13820 }
13821
13822 /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13823 /// to hold a `BackfillAll`.
13824 ///
13825 /// Note that all the setters affecting `backfill_strategy` are
13826 /// mutually exclusive.
13827 ///
13828 /// # Example
13829 /// ```ignore,no_run
13830 /// # use google_cloud_datastream_v1::model::Stream;
13831 /// use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13832 /// let x = Stream::new().set_backfill_all(BackfillAllStrategy::default()/* use setters */);
13833 /// assert!(x.backfill_all().is_some());
13834 /// assert!(x.backfill_none().is_none());
13835 /// ```
13836 pub fn set_backfill_all<
13837 T: std::convert::Into<std::boxed::Box<crate::model::stream::BackfillAllStrategy>>,
13838 >(
13839 mut self,
13840 v: T,
13841 ) -> Self {
13842 self.backfill_strategy = std::option::Option::Some(
13843 crate::model::stream::BackfillStrategy::BackfillAll(v.into()),
13844 );
13845 self
13846 }
13847
13848 /// The value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13849 /// if it holds a `BackfillNone`, `None` if the field is not set or
13850 /// holds a different branch.
13851 pub fn backfill_none(
13852 &self,
13853 ) -> std::option::Option<&std::boxed::Box<crate::model::stream::BackfillNoneStrategy>> {
13854 #[allow(unreachable_patterns)]
13855 self.backfill_strategy.as_ref().and_then(|v| match v {
13856 crate::model::stream::BackfillStrategy::BackfillNone(v) => std::option::Option::Some(v),
13857 _ => std::option::Option::None,
13858 })
13859 }
13860
13861 /// Sets the value of [backfill_strategy][crate::model::Stream::backfill_strategy]
13862 /// to hold a `BackfillNone`.
13863 ///
13864 /// Note that all the setters affecting `backfill_strategy` are
13865 /// mutually exclusive.
13866 ///
13867 /// # Example
13868 /// ```ignore,no_run
13869 /// # use google_cloud_datastream_v1::model::Stream;
13870 /// use google_cloud_datastream_v1::model::stream::BackfillNoneStrategy;
13871 /// let x = Stream::new().set_backfill_none(BackfillNoneStrategy::default()/* use setters */);
13872 /// assert!(x.backfill_none().is_some());
13873 /// assert!(x.backfill_all().is_none());
13874 /// ```
13875 pub fn set_backfill_none<
13876 T: std::convert::Into<std::boxed::Box<crate::model::stream::BackfillNoneStrategy>>,
13877 >(
13878 mut self,
13879 v: T,
13880 ) -> Self {
13881 self.backfill_strategy = std::option::Option::Some(
13882 crate::model::stream::BackfillStrategy::BackfillNone(v.into()),
13883 );
13884 self
13885 }
13886}
13887
13888impl wkt::message::Message for Stream {
13889 fn typename() -> &'static str {
13890 "type.googleapis.com/google.cloud.datastream.v1.Stream"
13891 }
13892}
13893
13894/// Defines additional types related to [Stream].
13895pub mod stream {
13896 #[allow(unused_imports)]
13897 use super::*;
13898
13899 /// Backfill strategy to automatically backfill the Stream's objects.
13900 /// Specific objects can be excluded.
13901 #[derive(Clone, Default, PartialEq)]
13902 #[non_exhaustive]
13903 pub struct BackfillAllStrategy {
13904 /// List of objects to exclude.
13905 pub excluded_objects:
13906 std::option::Option<crate::model::stream::backfill_all_strategy::ExcludedObjects>,
13907
13908 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13909 }
13910
13911 impl BackfillAllStrategy {
13912 /// Creates a new default instance.
13913 pub fn new() -> Self {
13914 std::default::Default::default()
13915 }
13916
13917 /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects].
13918 ///
13919 /// Note that all the setters affecting `excluded_objects` are mutually
13920 /// exclusive.
13921 ///
13922 /// # Example
13923 /// ```ignore,no_run
13924 /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13925 /// use google_cloud_datastream_v1::model::OracleRdbms;
13926 /// let x = BackfillAllStrategy::new().set_excluded_objects(Some(
13927 /// google_cloud_datastream_v1::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(OracleRdbms::default().into())));
13928 /// ```
13929 pub fn set_excluded_objects<
13930 T: std::convert::Into<
13931 std::option::Option<
13932 crate::model::stream::backfill_all_strategy::ExcludedObjects,
13933 >,
13934 >,
13935 >(
13936 mut self,
13937 v: T,
13938 ) -> Self {
13939 self.excluded_objects = v.into();
13940 self
13941 }
13942
13943 /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13944 /// if it holds a `OracleExcludedObjects`, `None` if the field is not set or
13945 /// holds a different branch.
13946 pub fn oracle_excluded_objects(
13947 &self,
13948 ) -> std::option::Option<&std::boxed::Box<crate::model::OracleRdbms>> {
13949 #[allow(unreachable_patterns)]
13950 self.excluded_objects.as_ref().and_then(|v| match v {
13951 crate::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(v) => std::option::Option::Some(v),
13952 _ => std::option::Option::None,
13953 })
13954 }
13955
13956 /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13957 /// to hold a `OracleExcludedObjects`.
13958 ///
13959 /// Note that all the setters affecting `excluded_objects` are
13960 /// mutually exclusive.
13961 ///
13962 /// # Example
13963 /// ```ignore,no_run
13964 /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
13965 /// use google_cloud_datastream_v1::model::OracleRdbms;
13966 /// let x = BackfillAllStrategy::new().set_oracle_excluded_objects(OracleRdbms::default()/* use setters */);
13967 /// assert!(x.oracle_excluded_objects().is_some());
13968 /// assert!(x.mysql_excluded_objects().is_none());
13969 /// assert!(x.postgresql_excluded_objects().is_none());
13970 /// assert!(x.sql_server_excluded_objects().is_none());
13971 /// assert!(x.salesforce_excluded_objects().is_none());
13972 /// assert!(x.mongodb_excluded_objects().is_none());
13973 /// ```
13974 pub fn set_oracle_excluded_objects<
13975 T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>,
13976 >(
13977 mut self,
13978 v: T,
13979 ) -> Self {
13980 self.excluded_objects = std::option::Option::Some(
13981 crate::model::stream::backfill_all_strategy::ExcludedObjects::OracleExcludedObjects(
13982 v.into(),
13983 ),
13984 );
13985 self
13986 }
13987
13988 /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
13989 /// if it holds a `MysqlExcludedObjects`, `None` if the field is not set or
13990 /// holds a different branch.
13991 pub fn mysql_excluded_objects(
13992 &self,
13993 ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlRdbms>> {
13994 #[allow(unreachable_patterns)]
13995 self.excluded_objects.as_ref().and_then(|v| match v {
13996 crate::model::stream::backfill_all_strategy::ExcludedObjects::MysqlExcludedObjects(v) => std::option::Option::Some(v),
13997 _ => std::option::Option::None,
13998 })
13999 }
14000
14001 /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14002 /// to hold a `MysqlExcludedObjects`.
14003 ///
14004 /// Note that all the setters affecting `excluded_objects` are
14005 /// mutually exclusive.
14006 ///
14007 /// # Example
14008 /// ```ignore,no_run
14009 /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
14010 /// use google_cloud_datastream_v1::model::MysqlRdbms;
14011 /// let x = BackfillAllStrategy::new().set_mysql_excluded_objects(MysqlRdbms::default()/* use setters */);
14012 /// assert!(x.mysql_excluded_objects().is_some());
14013 /// assert!(x.oracle_excluded_objects().is_none());
14014 /// assert!(x.postgresql_excluded_objects().is_none());
14015 /// assert!(x.sql_server_excluded_objects().is_none());
14016 /// assert!(x.salesforce_excluded_objects().is_none());
14017 /// assert!(x.mongodb_excluded_objects().is_none());
14018 /// ```
14019 pub fn set_mysql_excluded_objects<
14020 T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>,
14021 >(
14022 mut self,
14023 v: T,
14024 ) -> Self {
14025 self.excluded_objects = std::option::Option::Some(
14026 crate::model::stream::backfill_all_strategy::ExcludedObjects::MysqlExcludedObjects(
14027 v.into(),
14028 ),
14029 );
14030 self
14031 }
14032
14033 /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14034 /// if it holds a `PostgresqlExcludedObjects`, `None` if the field is not set or
14035 /// holds a different branch.
14036 pub fn postgresql_excluded_objects(
14037 &self,
14038 ) -> std::option::Option<&std::boxed::Box<crate::model::PostgresqlRdbms>> {
14039 #[allow(unreachable_patterns)]
14040 self.excluded_objects.as_ref().and_then(|v| match v {
14041 crate::model::stream::backfill_all_strategy::ExcludedObjects::PostgresqlExcludedObjects(v) => std::option::Option::Some(v),
14042 _ => std::option::Option::None,
14043 })
14044 }
14045
14046 /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14047 /// to hold a `PostgresqlExcludedObjects`.
14048 ///
14049 /// Note that all the setters affecting `excluded_objects` are
14050 /// mutually exclusive.
14051 ///
14052 /// # Example
14053 /// ```ignore,no_run
14054 /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
14055 /// use google_cloud_datastream_v1::model::PostgresqlRdbms;
14056 /// let x = BackfillAllStrategy::new().set_postgresql_excluded_objects(PostgresqlRdbms::default()/* use setters */);
14057 /// assert!(x.postgresql_excluded_objects().is_some());
14058 /// assert!(x.oracle_excluded_objects().is_none());
14059 /// assert!(x.mysql_excluded_objects().is_none());
14060 /// assert!(x.sql_server_excluded_objects().is_none());
14061 /// assert!(x.salesforce_excluded_objects().is_none());
14062 /// assert!(x.mongodb_excluded_objects().is_none());
14063 /// ```
14064 pub fn set_postgresql_excluded_objects<
14065 T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
14066 >(
14067 mut self,
14068 v: T,
14069 ) -> Self {
14070 self.excluded_objects = std::option::Option::Some(
14071 crate::model::stream::backfill_all_strategy::ExcludedObjects::PostgresqlExcludedObjects(
14072 v.into()
14073 )
14074 );
14075 self
14076 }
14077
14078 /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14079 /// if it holds a `SqlServerExcludedObjects`, `None` if the field is not set or
14080 /// holds a different branch.
14081 pub fn sql_server_excluded_objects(
14082 &self,
14083 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerRdbms>> {
14084 #[allow(unreachable_patterns)]
14085 self.excluded_objects.as_ref().and_then(|v| match v {
14086 crate::model::stream::backfill_all_strategy::ExcludedObjects::SqlServerExcludedObjects(v) => std::option::Option::Some(v),
14087 _ => std::option::Option::None,
14088 })
14089 }
14090
14091 /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14092 /// to hold a `SqlServerExcludedObjects`.
14093 ///
14094 /// Note that all the setters affecting `excluded_objects` are
14095 /// mutually exclusive.
14096 ///
14097 /// # Example
14098 /// ```ignore,no_run
14099 /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
14100 /// use google_cloud_datastream_v1::model::SqlServerRdbms;
14101 /// let x = BackfillAllStrategy::new().set_sql_server_excluded_objects(SqlServerRdbms::default()/* use setters */);
14102 /// assert!(x.sql_server_excluded_objects().is_some());
14103 /// assert!(x.oracle_excluded_objects().is_none());
14104 /// assert!(x.mysql_excluded_objects().is_none());
14105 /// assert!(x.postgresql_excluded_objects().is_none());
14106 /// assert!(x.salesforce_excluded_objects().is_none());
14107 /// assert!(x.mongodb_excluded_objects().is_none());
14108 /// ```
14109 pub fn set_sql_server_excluded_objects<
14110 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
14111 >(
14112 mut self,
14113 v: T,
14114 ) -> Self {
14115 self.excluded_objects = std::option::Option::Some(
14116 crate::model::stream::backfill_all_strategy::ExcludedObjects::SqlServerExcludedObjects(
14117 v.into()
14118 )
14119 );
14120 self
14121 }
14122
14123 /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14124 /// if it holds a `SalesforceExcludedObjects`, `None` if the field is not set or
14125 /// holds a different branch.
14126 pub fn salesforce_excluded_objects(
14127 &self,
14128 ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceOrg>> {
14129 #[allow(unreachable_patterns)]
14130 self.excluded_objects.as_ref().and_then(|v| match v {
14131 crate::model::stream::backfill_all_strategy::ExcludedObjects::SalesforceExcludedObjects(v) => std::option::Option::Some(v),
14132 _ => std::option::Option::None,
14133 })
14134 }
14135
14136 /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14137 /// to hold a `SalesforceExcludedObjects`.
14138 ///
14139 /// Note that all the setters affecting `excluded_objects` are
14140 /// mutually exclusive.
14141 ///
14142 /// # Example
14143 /// ```ignore,no_run
14144 /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
14145 /// use google_cloud_datastream_v1::model::SalesforceOrg;
14146 /// let x = BackfillAllStrategy::new().set_salesforce_excluded_objects(SalesforceOrg::default()/* use setters */);
14147 /// assert!(x.salesforce_excluded_objects().is_some());
14148 /// assert!(x.oracle_excluded_objects().is_none());
14149 /// assert!(x.mysql_excluded_objects().is_none());
14150 /// assert!(x.postgresql_excluded_objects().is_none());
14151 /// assert!(x.sql_server_excluded_objects().is_none());
14152 /// assert!(x.mongodb_excluded_objects().is_none());
14153 /// ```
14154 pub fn set_salesforce_excluded_objects<
14155 T: std::convert::Into<std::boxed::Box<crate::model::SalesforceOrg>>,
14156 >(
14157 mut self,
14158 v: T,
14159 ) -> Self {
14160 self.excluded_objects = std::option::Option::Some(
14161 crate::model::stream::backfill_all_strategy::ExcludedObjects::SalesforceExcludedObjects(
14162 v.into()
14163 )
14164 );
14165 self
14166 }
14167
14168 /// The value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14169 /// if it holds a `MongodbExcludedObjects`, `None` if the field is not set or
14170 /// holds a different branch.
14171 pub fn mongodb_excluded_objects(
14172 &self,
14173 ) -> std::option::Option<&std::boxed::Box<crate::model::MongodbCluster>> {
14174 #[allow(unreachable_patterns)]
14175 self.excluded_objects.as_ref().and_then(|v| match v {
14176 crate::model::stream::backfill_all_strategy::ExcludedObjects::MongodbExcludedObjects(v) => std::option::Option::Some(v),
14177 _ => std::option::Option::None,
14178 })
14179 }
14180
14181 /// Sets the value of [excluded_objects][crate::model::stream::BackfillAllStrategy::excluded_objects]
14182 /// to hold a `MongodbExcludedObjects`.
14183 ///
14184 /// Note that all the setters affecting `excluded_objects` are
14185 /// mutually exclusive.
14186 ///
14187 /// # Example
14188 /// ```ignore,no_run
14189 /// # use google_cloud_datastream_v1::model::stream::BackfillAllStrategy;
14190 /// use google_cloud_datastream_v1::model::MongodbCluster;
14191 /// let x = BackfillAllStrategy::new().set_mongodb_excluded_objects(MongodbCluster::default()/* use setters */);
14192 /// assert!(x.mongodb_excluded_objects().is_some());
14193 /// assert!(x.oracle_excluded_objects().is_none());
14194 /// assert!(x.mysql_excluded_objects().is_none());
14195 /// assert!(x.postgresql_excluded_objects().is_none());
14196 /// assert!(x.sql_server_excluded_objects().is_none());
14197 /// assert!(x.salesforce_excluded_objects().is_none());
14198 /// ```
14199 pub fn set_mongodb_excluded_objects<
14200 T: std::convert::Into<std::boxed::Box<crate::model::MongodbCluster>>,
14201 >(
14202 mut self,
14203 v: T,
14204 ) -> Self {
14205 self.excluded_objects = std::option::Option::Some(
14206 crate::model::stream::backfill_all_strategy::ExcludedObjects::MongodbExcludedObjects(
14207 v.into()
14208 )
14209 );
14210 self
14211 }
14212 }
14213
14214 impl wkt::message::Message for BackfillAllStrategy {
14215 fn typename() -> &'static str {
14216 "type.googleapis.com/google.cloud.datastream.v1.Stream.BackfillAllStrategy"
14217 }
14218 }
14219
14220 /// Defines additional types related to [BackfillAllStrategy].
14221 pub mod backfill_all_strategy {
14222 #[allow(unused_imports)]
14223 use super::*;
14224
14225 /// List of objects to exclude.
14226 #[derive(Clone, Debug, PartialEq)]
14227 #[non_exhaustive]
14228 pub enum ExcludedObjects {
14229 /// Oracle data source objects to avoid backfilling.
14230 OracleExcludedObjects(std::boxed::Box<crate::model::OracleRdbms>),
14231 /// MySQL data source objects to avoid backfilling.
14232 MysqlExcludedObjects(std::boxed::Box<crate::model::MysqlRdbms>),
14233 /// PostgreSQL data source objects to avoid backfilling.
14234 PostgresqlExcludedObjects(std::boxed::Box<crate::model::PostgresqlRdbms>),
14235 /// SQLServer data source objects to avoid backfilling
14236 SqlServerExcludedObjects(std::boxed::Box<crate::model::SqlServerRdbms>),
14237 /// Salesforce data source objects to avoid backfilling
14238 SalesforceExcludedObjects(std::boxed::Box<crate::model::SalesforceOrg>),
14239 /// MongoDB data source objects to avoid backfilling
14240 MongodbExcludedObjects(std::boxed::Box<crate::model::MongodbCluster>),
14241 }
14242 }
14243
14244 /// Backfill strategy to disable automatic backfill for the Stream's objects.
14245 #[derive(Clone, Default, PartialEq)]
14246 #[non_exhaustive]
14247 pub struct BackfillNoneStrategy {
14248 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14249 }
14250
14251 impl BackfillNoneStrategy {
14252 /// Creates a new default instance.
14253 pub fn new() -> Self {
14254 std::default::Default::default()
14255 }
14256 }
14257
14258 impl wkt::message::Message for BackfillNoneStrategy {
14259 fn typename() -> &'static str {
14260 "type.googleapis.com/google.cloud.datastream.v1.Stream.BackfillNoneStrategy"
14261 }
14262 }
14263
14264 /// Stream state.
14265 ///
14266 /// # Working with unknown values
14267 ///
14268 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14269 /// additional enum variants at any time. Adding new variants is not considered
14270 /// a breaking change. Applications should write their code in anticipation of:
14271 ///
14272 /// - New values appearing in future releases of the client library, **and**
14273 /// - New values received dynamically, without application changes.
14274 ///
14275 /// Please consult the [Working with enums] section in the user guide for some
14276 /// guidelines.
14277 ///
14278 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14279 #[derive(Clone, Debug, PartialEq)]
14280 #[non_exhaustive]
14281 pub enum State {
14282 /// Unspecified stream state.
14283 Unspecified,
14284 /// The stream has been created but has not yet started streaming data.
14285 NotStarted,
14286 /// The stream is running.
14287 Running,
14288 /// The stream is paused.
14289 Paused,
14290 /// The stream is in maintenance mode.
14291 ///
14292 /// Updates are rejected on the resource in this state.
14293 Maintenance,
14294 /// The stream is experiencing an error that is preventing data from being
14295 /// streamed.
14296 Failed,
14297 /// The stream has experienced a terminal failure.
14298 FailedPermanently,
14299 /// The stream is starting, but not yet running.
14300 Starting,
14301 /// The Stream is no longer reading new events, but still writing events in
14302 /// the buffer.
14303 Draining,
14304 /// If set, the enum was initialized with an unknown value.
14305 ///
14306 /// Applications can examine the value using [State::value] or
14307 /// [State::name].
14308 UnknownValue(state::UnknownValue),
14309 }
14310
14311 #[doc(hidden)]
14312 pub mod state {
14313 #[allow(unused_imports)]
14314 use super::*;
14315 #[derive(Clone, Debug, PartialEq)]
14316 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14317 }
14318
14319 impl State {
14320 /// Gets the enum value.
14321 ///
14322 /// Returns `None` if the enum contains an unknown value deserialized from
14323 /// the string representation of enums.
14324 pub fn value(&self) -> std::option::Option<i32> {
14325 match self {
14326 Self::Unspecified => std::option::Option::Some(0),
14327 Self::NotStarted => std::option::Option::Some(1),
14328 Self::Running => std::option::Option::Some(2),
14329 Self::Paused => std::option::Option::Some(3),
14330 Self::Maintenance => std::option::Option::Some(4),
14331 Self::Failed => std::option::Option::Some(5),
14332 Self::FailedPermanently => std::option::Option::Some(6),
14333 Self::Starting => std::option::Option::Some(7),
14334 Self::Draining => std::option::Option::Some(8),
14335 Self::UnknownValue(u) => u.0.value(),
14336 }
14337 }
14338
14339 /// Gets the enum value as a string.
14340 ///
14341 /// Returns `None` if the enum contains an unknown value deserialized from
14342 /// the integer representation of enums.
14343 pub fn name(&self) -> std::option::Option<&str> {
14344 match self {
14345 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14346 Self::NotStarted => std::option::Option::Some("NOT_STARTED"),
14347 Self::Running => std::option::Option::Some("RUNNING"),
14348 Self::Paused => std::option::Option::Some("PAUSED"),
14349 Self::Maintenance => std::option::Option::Some("MAINTENANCE"),
14350 Self::Failed => std::option::Option::Some("FAILED"),
14351 Self::FailedPermanently => std::option::Option::Some("FAILED_PERMANENTLY"),
14352 Self::Starting => std::option::Option::Some("STARTING"),
14353 Self::Draining => std::option::Option::Some("DRAINING"),
14354 Self::UnknownValue(u) => u.0.name(),
14355 }
14356 }
14357 }
14358
14359 impl std::default::Default for State {
14360 fn default() -> Self {
14361 use std::convert::From;
14362 Self::from(0)
14363 }
14364 }
14365
14366 impl std::fmt::Display for State {
14367 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14368 wkt::internal::display_enum(f, self.name(), self.value())
14369 }
14370 }
14371
14372 impl std::convert::From<i32> for State {
14373 fn from(value: i32) -> Self {
14374 match value {
14375 0 => Self::Unspecified,
14376 1 => Self::NotStarted,
14377 2 => Self::Running,
14378 3 => Self::Paused,
14379 4 => Self::Maintenance,
14380 5 => Self::Failed,
14381 6 => Self::FailedPermanently,
14382 7 => Self::Starting,
14383 8 => Self::Draining,
14384 _ => Self::UnknownValue(state::UnknownValue(
14385 wkt::internal::UnknownEnumValue::Integer(value),
14386 )),
14387 }
14388 }
14389 }
14390
14391 impl std::convert::From<&str> for State {
14392 fn from(value: &str) -> Self {
14393 use std::string::ToString;
14394 match value {
14395 "STATE_UNSPECIFIED" => Self::Unspecified,
14396 "NOT_STARTED" => Self::NotStarted,
14397 "RUNNING" => Self::Running,
14398 "PAUSED" => Self::Paused,
14399 "MAINTENANCE" => Self::Maintenance,
14400 "FAILED" => Self::Failed,
14401 "FAILED_PERMANENTLY" => Self::FailedPermanently,
14402 "STARTING" => Self::Starting,
14403 "DRAINING" => Self::Draining,
14404 _ => Self::UnknownValue(state::UnknownValue(
14405 wkt::internal::UnknownEnumValue::String(value.to_string()),
14406 )),
14407 }
14408 }
14409 }
14410
14411 impl serde::ser::Serialize for State {
14412 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14413 where
14414 S: serde::Serializer,
14415 {
14416 match self {
14417 Self::Unspecified => serializer.serialize_i32(0),
14418 Self::NotStarted => serializer.serialize_i32(1),
14419 Self::Running => serializer.serialize_i32(2),
14420 Self::Paused => serializer.serialize_i32(3),
14421 Self::Maintenance => serializer.serialize_i32(4),
14422 Self::Failed => serializer.serialize_i32(5),
14423 Self::FailedPermanently => serializer.serialize_i32(6),
14424 Self::Starting => serializer.serialize_i32(7),
14425 Self::Draining => serializer.serialize_i32(8),
14426 Self::UnknownValue(u) => u.0.serialize(serializer),
14427 }
14428 }
14429 }
14430
14431 impl<'de> serde::de::Deserialize<'de> for State {
14432 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14433 where
14434 D: serde::Deserializer<'de>,
14435 {
14436 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14437 ".google.cloud.datastream.v1.Stream.State",
14438 ))
14439 }
14440 }
14441
14442 /// Stream backfill strategy.
14443 #[derive(Clone, Debug, PartialEq)]
14444 #[non_exhaustive]
14445 pub enum BackfillStrategy {
14446 /// Automatically backfill objects included in the stream source
14447 /// configuration. Specific objects can be excluded.
14448 BackfillAll(std::boxed::Box<crate::model::stream::BackfillAllStrategy>),
14449 /// Do not automatically backfill any objects.
14450 BackfillNone(std::boxed::Box<crate::model::stream::BackfillNoneStrategy>),
14451 }
14452}
14453
14454/// A specific stream object (e.g a specific DB table).
14455#[derive(Clone, Default, PartialEq)]
14456#[non_exhaustive]
14457pub struct StreamObject {
14458 /// Output only. Identifier. The object resource's name.
14459 pub name: std::string::String,
14460
14461 /// Output only. The creation time of the object.
14462 pub create_time: std::option::Option<wkt::Timestamp>,
14463
14464 /// Output only. The last update time of the object.
14465 pub update_time: std::option::Option<wkt::Timestamp>,
14466
14467 /// Required. Display name.
14468 pub display_name: std::string::String,
14469
14470 /// Output only. Active errors on the object.
14471 pub errors: std::vec::Vec<crate::model::Error>,
14472
14473 /// The latest backfill job that was initiated for the stream object.
14474 pub backfill_job: std::option::Option<crate::model::BackfillJob>,
14475
14476 /// The object identifier in the data source.
14477 pub source_object: std::option::Option<crate::model::SourceObjectIdentifier>,
14478
14479 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14480}
14481
14482impl StreamObject {
14483 /// Creates a new default instance.
14484 pub fn new() -> Self {
14485 std::default::Default::default()
14486 }
14487
14488 /// Sets the value of [name][crate::model::StreamObject::name].
14489 ///
14490 /// # Example
14491 /// ```ignore,no_run
14492 /// # use google_cloud_datastream_v1::model::StreamObject;
14493 /// # let project_id = "project_id";
14494 /// # let location_id = "location_id";
14495 /// # let stream_id = "stream_id";
14496 /// # let object_id = "object_id";
14497 /// let x = StreamObject::new().set_name(format!("projects/{project_id}/locations/{location_id}/streams/{stream_id}/objects/{object_id}"));
14498 /// ```
14499 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14500 self.name = v.into();
14501 self
14502 }
14503
14504 /// Sets the value of [create_time][crate::model::StreamObject::create_time].
14505 ///
14506 /// # Example
14507 /// ```ignore,no_run
14508 /// # use google_cloud_datastream_v1::model::StreamObject;
14509 /// use wkt::Timestamp;
14510 /// let x = StreamObject::new().set_create_time(Timestamp::default()/* use setters */);
14511 /// ```
14512 pub fn set_create_time<T>(mut self, v: T) -> Self
14513 where
14514 T: std::convert::Into<wkt::Timestamp>,
14515 {
14516 self.create_time = std::option::Option::Some(v.into());
14517 self
14518 }
14519
14520 /// Sets or clears the value of [create_time][crate::model::StreamObject::create_time].
14521 ///
14522 /// # Example
14523 /// ```ignore,no_run
14524 /// # use google_cloud_datastream_v1::model::StreamObject;
14525 /// use wkt::Timestamp;
14526 /// let x = StreamObject::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
14527 /// let x = StreamObject::new().set_or_clear_create_time(None::<Timestamp>);
14528 /// ```
14529 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
14530 where
14531 T: std::convert::Into<wkt::Timestamp>,
14532 {
14533 self.create_time = v.map(|x| x.into());
14534 self
14535 }
14536
14537 /// Sets the value of [update_time][crate::model::StreamObject::update_time].
14538 ///
14539 /// # Example
14540 /// ```ignore,no_run
14541 /// # use google_cloud_datastream_v1::model::StreamObject;
14542 /// use wkt::Timestamp;
14543 /// let x = StreamObject::new().set_update_time(Timestamp::default()/* use setters */);
14544 /// ```
14545 pub fn set_update_time<T>(mut self, v: T) -> Self
14546 where
14547 T: std::convert::Into<wkt::Timestamp>,
14548 {
14549 self.update_time = std::option::Option::Some(v.into());
14550 self
14551 }
14552
14553 /// Sets or clears the value of [update_time][crate::model::StreamObject::update_time].
14554 ///
14555 /// # Example
14556 /// ```ignore,no_run
14557 /// # use google_cloud_datastream_v1::model::StreamObject;
14558 /// use wkt::Timestamp;
14559 /// let x = StreamObject::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
14560 /// let x = StreamObject::new().set_or_clear_update_time(None::<Timestamp>);
14561 /// ```
14562 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
14563 where
14564 T: std::convert::Into<wkt::Timestamp>,
14565 {
14566 self.update_time = v.map(|x| x.into());
14567 self
14568 }
14569
14570 /// Sets the value of [display_name][crate::model::StreamObject::display_name].
14571 ///
14572 /// # Example
14573 /// ```ignore,no_run
14574 /// # use google_cloud_datastream_v1::model::StreamObject;
14575 /// let x = StreamObject::new().set_display_name("example");
14576 /// ```
14577 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14578 self.display_name = v.into();
14579 self
14580 }
14581
14582 /// Sets the value of [errors][crate::model::StreamObject::errors].
14583 ///
14584 /// # Example
14585 /// ```ignore,no_run
14586 /// # use google_cloud_datastream_v1::model::StreamObject;
14587 /// use google_cloud_datastream_v1::model::Error;
14588 /// let x = StreamObject::new()
14589 /// .set_errors([
14590 /// Error::default()/* use setters */,
14591 /// Error::default()/* use (different) setters */,
14592 /// ]);
14593 /// ```
14594 pub fn set_errors<T, V>(mut self, v: T) -> Self
14595 where
14596 T: std::iter::IntoIterator<Item = V>,
14597 V: std::convert::Into<crate::model::Error>,
14598 {
14599 use std::iter::Iterator;
14600 self.errors = v.into_iter().map(|i| i.into()).collect();
14601 self
14602 }
14603
14604 /// Sets the value of [backfill_job][crate::model::StreamObject::backfill_job].
14605 ///
14606 /// # Example
14607 /// ```ignore,no_run
14608 /// # use google_cloud_datastream_v1::model::StreamObject;
14609 /// use google_cloud_datastream_v1::model::BackfillJob;
14610 /// let x = StreamObject::new().set_backfill_job(BackfillJob::default()/* use setters */);
14611 /// ```
14612 pub fn set_backfill_job<T>(mut self, v: T) -> Self
14613 where
14614 T: std::convert::Into<crate::model::BackfillJob>,
14615 {
14616 self.backfill_job = std::option::Option::Some(v.into());
14617 self
14618 }
14619
14620 /// Sets or clears the value of [backfill_job][crate::model::StreamObject::backfill_job].
14621 ///
14622 /// # Example
14623 /// ```ignore,no_run
14624 /// # use google_cloud_datastream_v1::model::StreamObject;
14625 /// use google_cloud_datastream_v1::model::BackfillJob;
14626 /// let x = StreamObject::new().set_or_clear_backfill_job(Some(BackfillJob::default()/* use setters */));
14627 /// let x = StreamObject::new().set_or_clear_backfill_job(None::<BackfillJob>);
14628 /// ```
14629 pub fn set_or_clear_backfill_job<T>(mut self, v: std::option::Option<T>) -> Self
14630 where
14631 T: std::convert::Into<crate::model::BackfillJob>,
14632 {
14633 self.backfill_job = v.map(|x| x.into());
14634 self
14635 }
14636
14637 /// Sets the value of [source_object][crate::model::StreamObject::source_object].
14638 ///
14639 /// # Example
14640 /// ```ignore,no_run
14641 /// # use google_cloud_datastream_v1::model::StreamObject;
14642 /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14643 /// let x = StreamObject::new().set_source_object(SourceObjectIdentifier::default()/* use setters */);
14644 /// ```
14645 pub fn set_source_object<T>(mut self, v: T) -> Self
14646 where
14647 T: std::convert::Into<crate::model::SourceObjectIdentifier>,
14648 {
14649 self.source_object = std::option::Option::Some(v.into());
14650 self
14651 }
14652
14653 /// Sets or clears the value of [source_object][crate::model::StreamObject::source_object].
14654 ///
14655 /// # Example
14656 /// ```ignore,no_run
14657 /// # use google_cloud_datastream_v1::model::StreamObject;
14658 /// use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14659 /// let x = StreamObject::new().set_or_clear_source_object(Some(SourceObjectIdentifier::default()/* use setters */));
14660 /// let x = StreamObject::new().set_or_clear_source_object(None::<SourceObjectIdentifier>);
14661 /// ```
14662 pub fn set_or_clear_source_object<T>(mut self, v: std::option::Option<T>) -> Self
14663 where
14664 T: std::convert::Into<crate::model::SourceObjectIdentifier>,
14665 {
14666 self.source_object = v.map(|x| x.into());
14667 self
14668 }
14669}
14670
14671impl wkt::message::Message for StreamObject {
14672 fn typename() -> &'static str {
14673 "type.googleapis.com/google.cloud.datastream.v1.StreamObject"
14674 }
14675}
14676
14677/// Represents an identifier of an object in the data source.
14678#[derive(Clone, Default, PartialEq)]
14679#[non_exhaustive]
14680pub struct SourceObjectIdentifier {
14681 /// The identifier for an object in the data source.
14682 pub source_identifier:
14683 std::option::Option<crate::model::source_object_identifier::SourceIdentifier>,
14684
14685 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14686}
14687
14688impl SourceObjectIdentifier {
14689 /// Creates a new default instance.
14690 pub fn new() -> Self {
14691 std::default::Default::default()
14692 }
14693
14694 /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier].
14695 ///
14696 /// Note that all the setters affecting `source_identifier` are mutually
14697 /// exclusive.
14698 ///
14699 /// # Example
14700 /// ```ignore,no_run
14701 /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14702 /// use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
14703 /// let x = SourceObjectIdentifier::new().set_source_identifier(Some(
14704 /// google_cloud_datastream_v1::model::source_object_identifier::SourceIdentifier::OracleIdentifier(OracleObjectIdentifier::default().into())));
14705 /// ```
14706 pub fn set_source_identifier<
14707 T: std::convert::Into<
14708 std::option::Option<crate::model::source_object_identifier::SourceIdentifier>,
14709 >,
14710 >(
14711 mut self,
14712 v: T,
14713 ) -> Self {
14714 self.source_identifier = v.into();
14715 self
14716 }
14717
14718 /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14719 /// if it holds a `OracleIdentifier`, `None` if the field is not set or
14720 /// holds a different branch.
14721 pub fn oracle_identifier(
14722 &self,
14723 ) -> std::option::Option<
14724 &std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
14725 > {
14726 #[allow(unreachable_patterns)]
14727 self.source_identifier.as_ref().and_then(|v| match v {
14728 crate::model::source_object_identifier::SourceIdentifier::OracleIdentifier(v) => {
14729 std::option::Option::Some(v)
14730 }
14731 _ => std::option::Option::None,
14732 })
14733 }
14734
14735 /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14736 /// to hold a `OracleIdentifier`.
14737 ///
14738 /// Note that all the setters affecting `source_identifier` are
14739 /// mutually exclusive.
14740 ///
14741 /// # Example
14742 /// ```ignore,no_run
14743 /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14744 /// use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
14745 /// let x = SourceObjectIdentifier::new().set_oracle_identifier(OracleObjectIdentifier::default()/* use setters */);
14746 /// assert!(x.oracle_identifier().is_some());
14747 /// assert!(x.mysql_identifier().is_none());
14748 /// assert!(x.postgresql_identifier().is_none());
14749 /// assert!(x.sql_server_identifier().is_none());
14750 /// assert!(x.salesforce_identifier().is_none());
14751 /// assert!(x.mongodb_identifier().is_none());
14752 /// ```
14753 pub fn set_oracle_identifier<
14754 T: std::convert::Into<
14755 std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
14756 >,
14757 >(
14758 mut self,
14759 v: T,
14760 ) -> Self {
14761 self.source_identifier = std::option::Option::Some(
14762 crate::model::source_object_identifier::SourceIdentifier::OracleIdentifier(v.into()),
14763 );
14764 self
14765 }
14766
14767 /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14768 /// if it holds a `MysqlIdentifier`, `None` if the field is not set or
14769 /// holds a different branch.
14770 pub fn mysql_identifier(
14771 &self,
14772 ) -> std::option::Option<
14773 &std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
14774 > {
14775 #[allow(unreachable_patterns)]
14776 self.source_identifier.as_ref().and_then(|v| match v {
14777 crate::model::source_object_identifier::SourceIdentifier::MysqlIdentifier(v) => {
14778 std::option::Option::Some(v)
14779 }
14780 _ => std::option::Option::None,
14781 })
14782 }
14783
14784 /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14785 /// to hold a `MysqlIdentifier`.
14786 ///
14787 /// Note that all the setters affecting `source_identifier` are
14788 /// mutually exclusive.
14789 ///
14790 /// # Example
14791 /// ```ignore,no_run
14792 /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14793 /// use google_cloud_datastream_v1::model::source_object_identifier::MysqlObjectIdentifier;
14794 /// let x = SourceObjectIdentifier::new().set_mysql_identifier(MysqlObjectIdentifier::default()/* use setters */);
14795 /// assert!(x.mysql_identifier().is_some());
14796 /// assert!(x.oracle_identifier().is_none());
14797 /// assert!(x.postgresql_identifier().is_none());
14798 /// assert!(x.sql_server_identifier().is_none());
14799 /// assert!(x.salesforce_identifier().is_none());
14800 /// assert!(x.mongodb_identifier().is_none());
14801 /// ```
14802 pub fn set_mysql_identifier<
14803 T: std::convert::Into<
14804 std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
14805 >,
14806 >(
14807 mut self,
14808 v: T,
14809 ) -> Self {
14810 self.source_identifier = std::option::Option::Some(
14811 crate::model::source_object_identifier::SourceIdentifier::MysqlIdentifier(v.into()),
14812 );
14813 self
14814 }
14815
14816 /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14817 /// if it holds a `PostgresqlIdentifier`, `None` if the field is not set or
14818 /// holds a different branch.
14819 pub fn postgresql_identifier(
14820 &self,
14821 ) -> std::option::Option<
14822 &std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
14823 > {
14824 #[allow(unreachable_patterns)]
14825 self.source_identifier.as_ref().and_then(|v| match v {
14826 crate::model::source_object_identifier::SourceIdentifier::PostgresqlIdentifier(v) => {
14827 std::option::Option::Some(v)
14828 }
14829 _ => std::option::Option::None,
14830 })
14831 }
14832
14833 /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14834 /// to hold a `PostgresqlIdentifier`.
14835 ///
14836 /// Note that all the setters affecting `source_identifier` are
14837 /// mutually exclusive.
14838 ///
14839 /// # Example
14840 /// ```ignore,no_run
14841 /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14842 /// use google_cloud_datastream_v1::model::source_object_identifier::PostgresqlObjectIdentifier;
14843 /// let x = SourceObjectIdentifier::new().set_postgresql_identifier(PostgresqlObjectIdentifier::default()/* use setters */);
14844 /// assert!(x.postgresql_identifier().is_some());
14845 /// assert!(x.oracle_identifier().is_none());
14846 /// assert!(x.mysql_identifier().is_none());
14847 /// assert!(x.sql_server_identifier().is_none());
14848 /// assert!(x.salesforce_identifier().is_none());
14849 /// assert!(x.mongodb_identifier().is_none());
14850 /// ```
14851 pub fn set_postgresql_identifier<
14852 T: std::convert::Into<
14853 std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
14854 >,
14855 >(
14856 mut self,
14857 v: T,
14858 ) -> Self {
14859 self.source_identifier = std::option::Option::Some(
14860 crate::model::source_object_identifier::SourceIdentifier::PostgresqlIdentifier(
14861 v.into(),
14862 ),
14863 );
14864 self
14865 }
14866
14867 /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14868 /// if it holds a `SqlServerIdentifier`, `None` if the field is not set or
14869 /// holds a different branch.
14870 pub fn sql_server_identifier(
14871 &self,
14872 ) -> std::option::Option<
14873 &std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
14874 > {
14875 #[allow(unreachable_patterns)]
14876 self.source_identifier.as_ref().and_then(|v| match v {
14877 crate::model::source_object_identifier::SourceIdentifier::SqlServerIdentifier(v) => {
14878 std::option::Option::Some(v)
14879 }
14880 _ => std::option::Option::None,
14881 })
14882 }
14883
14884 /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14885 /// to hold a `SqlServerIdentifier`.
14886 ///
14887 /// Note that all the setters affecting `source_identifier` are
14888 /// mutually exclusive.
14889 ///
14890 /// # Example
14891 /// ```ignore,no_run
14892 /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14893 /// use google_cloud_datastream_v1::model::source_object_identifier::SqlServerObjectIdentifier;
14894 /// let x = SourceObjectIdentifier::new().set_sql_server_identifier(SqlServerObjectIdentifier::default()/* use setters */);
14895 /// assert!(x.sql_server_identifier().is_some());
14896 /// assert!(x.oracle_identifier().is_none());
14897 /// assert!(x.mysql_identifier().is_none());
14898 /// assert!(x.postgresql_identifier().is_none());
14899 /// assert!(x.salesforce_identifier().is_none());
14900 /// assert!(x.mongodb_identifier().is_none());
14901 /// ```
14902 pub fn set_sql_server_identifier<
14903 T: std::convert::Into<
14904 std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
14905 >,
14906 >(
14907 mut self,
14908 v: T,
14909 ) -> Self {
14910 self.source_identifier = std::option::Option::Some(
14911 crate::model::source_object_identifier::SourceIdentifier::SqlServerIdentifier(v.into()),
14912 );
14913 self
14914 }
14915
14916 /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14917 /// if it holds a `SalesforceIdentifier`, `None` if the field is not set or
14918 /// holds a different branch.
14919 pub fn salesforce_identifier(
14920 &self,
14921 ) -> std::option::Option<
14922 &std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
14923 > {
14924 #[allow(unreachable_patterns)]
14925 self.source_identifier.as_ref().and_then(|v| match v {
14926 crate::model::source_object_identifier::SourceIdentifier::SalesforceIdentifier(v) => {
14927 std::option::Option::Some(v)
14928 }
14929 _ => std::option::Option::None,
14930 })
14931 }
14932
14933 /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14934 /// to hold a `SalesforceIdentifier`.
14935 ///
14936 /// Note that all the setters affecting `source_identifier` are
14937 /// mutually exclusive.
14938 ///
14939 /// # Example
14940 /// ```ignore,no_run
14941 /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14942 /// use google_cloud_datastream_v1::model::source_object_identifier::SalesforceObjectIdentifier;
14943 /// let x = SourceObjectIdentifier::new().set_salesforce_identifier(SalesforceObjectIdentifier::default()/* use setters */);
14944 /// assert!(x.salesforce_identifier().is_some());
14945 /// assert!(x.oracle_identifier().is_none());
14946 /// assert!(x.mysql_identifier().is_none());
14947 /// assert!(x.postgresql_identifier().is_none());
14948 /// assert!(x.sql_server_identifier().is_none());
14949 /// assert!(x.mongodb_identifier().is_none());
14950 /// ```
14951 pub fn set_salesforce_identifier<
14952 T: std::convert::Into<
14953 std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
14954 >,
14955 >(
14956 mut self,
14957 v: T,
14958 ) -> Self {
14959 self.source_identifier = std::option::Option::Some(
14960 crate::model::source_object_identifier::SourceIdentifier::SalesforceIdentifier(
14961 v.into(),
14962 ),
14963 );
14964 self
14965 }
14966
14967 /// The value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14968 /// if it holds a `MongodbIdentifier`, `None` if the field is not set or
14969 /// holds a different branch.
14970 pub fn mongodb_identifier(
14971 &self,
14972 ) -> std::option::Option<
14973 &std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
14974 > {
14975 #[allow(unreachable_patterns)]
14976 self.source_identifier.as_ref().and_then(|v| match v {
14977 crate::model::source_object_identifier::SourceIdentifier::MongodbIdentifier(v) => {
14978 std::option::Option::Some(v)
14979 }
14980 _ => std::option::Option::None,
14981 })
14982 }
14983
14984 /// Sets the value of [source_identifier][crate::model::SourceObjectIdentifier::source_identifier]
14985 /// to hold a `MongodbIdentifier`.
14986 ///
14987 /// Note that all the setters affecting `source_identifier` are
14988 /// mutually exclusive.
14989 ///
14990 /// # Example
14991 /// ```ignore,no_run
14992 /// # use google_cloud_datastream_v1::model::SourceObjectIdentifier;
14993 /// use google_cloud_datastream_v1::model::source_object_identifier::MongodbObjectIdentifier;
14994 /// let x = SourceObjectIdentifier::new().set_mongodb_identifier(MongodbObjectIdentifier::default()/* use setters */);
14995 /// assert!(x.mongodb_identifier().is_some());
14996 /// assert!(x.oracle_identifier().is_none());
14997 /// assert!(x.mysql_identifier().is_none());
14998 /// assert!(x.postgresql_identifier().is_none());
14999 /// assert!(x.sql_server_identifier().is_none());
15000 /// assert!(x.salesforce_identifier().is_none());
15001 /// ```
15002 pub fn set_mongodb_identifier<
15003 T: std::convert::Into<
15004 std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
15005 >,
15006 >(
15007 mut self,
15008 v: T,
15009 ) -> Self {
15010 self.source_identifier = std::option::Option::Some(
15011 crate::model::source_object_identifier::SourceIdentifier::MongodbIdentifier(v.into()),
15012 );
15013 self
15014 }
15015}
15016
15017impl wkt::message::Message for SourceObjectIdentifier {
15018 fn typename() -> &'static str {
15019 "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier"
15020 }
15021}
15022
15023/// Defines additional types related to [SourceObjectIdentifier].
15024pub mod source_object_identifier {
15025 #[allow(unused_imports)]
15026 use super::*;
15027
15028 /// Oracle data source object identifier.
15029 #[derive(Clone, Default, PartialEq)]
15030 #[non_exhaustive]
15031 pub struct OracleObjectIdentifier {
15032 /// Required. The schema name.
15033 pub schema: std::string::String,
15034
15035 /// Required. The table name.
15036 pub table: std::string::String,
15037
15038 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15039 }
15040
15041 impl OracleObjectIdentifier {
15042 /// Creates a new default instance.
15043 pub fn new() -> Self {
15044 std::default::Default::default()
15045 }
15046
15047 /// Sets the value of [schema][crate::model::source_object_identifier::OracleObjectIdentifier::schema].
15048 ///
15049 /// # Example
15050 /// ```ignore,no_run
15051 /// # use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
15052 /// let x = OracleObjectIdentifier::new().set_schema("example");
15053 /// ```
15054 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15055 self.schema = v.into();
15056 self
15057 }
15058
15059 /// Sets the value of [table][crate::model::source_object_identifier::OracleObjectIdentifier::table].
15060 ///
15061 /// # Example
15062 /// ```ignore,no_run
15063 /// # use google_cloud_datastream_v1::model::source_object_identifier::OracleObjectIdentifier;
15064 /// let x = OracleObjectIdentifier::new().set_table("example");
15065 /// ```
15066 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15067 self.table = v.into();
15068 self
15069 }
15070 }
15071
15072 impl wkt::message::Message for OracleObjectIdentifier {
15073 fn typename() -> &'static str {
15074 "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.OracleObjectIdentifier"
15075 }
15076 }
15077
15078 /// PostgreSQL data source object identifier.
15079 #[derive(Clone, Default, PartialEq)]
15080 #[non_exhaustive]
15081 pub struct PostgresqlObjectIdentifier {
15082 /// Required. The schema name.
15083 pub schema: std::string::String,
15084
15085 /// Required. The table name.
15086 pub table: std::string::String,
15087
15088 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15089 }
15090
15091 impl PostgresqlObjectIdentifier {
15092 /// Creates a new default instance.
15093 pub fn new() -> Self {
15094 std::default::Default::default()
15095 }
15096
15097 /// Sets the value of [schema][crate::model::source_object_identifier::PostgresqlObjectIdentifier::schema].
15098 ///
15099 /// # Example
15100 /// ```ignore,no_run
15101 /// # use google_cloud_datastream_v1::model::source_object_identifier::PostgresqlObjectIdentifier;
15102 /// let x = PostgresqlObjectIdentifier::new().set_schema("example");
15103 /// ```
15104 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15105 self.schema = v.into();
15106 self
15107 }
15108
15109 /// Sets the value of [table][crate::model::source_object_identifier::PostgresqlObjectIdentifier::table].
15110 ///
15111 /// # Example
15112 /// ```ignore,no_run
15113 /// # use google_cloud_datastream_v1::model::source_object_identifier::PostgresqlObjectIdentifier;
15114 /// let x = PostgresqlObjectIdentifier::new().set_table("example");
15115 /// ```
15116 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15117 self.table = v.into();
15118 self
15119 }
15120 }
15121
15122 impl wkt::message::Message for PostgresqlObjectIdentifier {
15123 fn typename() -> &'static str {
15124 "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.PostgresqlObjectIdentifier"
15125 }
15126 }
15127
15128 /// Mysql data source object identifier.
15129 #[derive(Clone, Default, PartialEq)]
15130 #[non_exhaustive]
15131 pub struct MysqlObjectIdentifier {
15132 /// Required. The database name.
15133 pub database: std::string::String,
15134
15135 /// Required. The table name.
15136 pub table: std::string::String,
15137
15138 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15139 }
15140
15141 impl MysqlObjectIdentifier {
15142 /// Creates a new default instance.
15143 pub fn new() -> Self {
15144 std::default::Default::default()
15145 }
15146
15147 /// Sets the value of [database][crate::model::source_object_identifier::MysqlObjectIdentifier::database].
15148 ///
15149 /// # Example
15150 /// ```ignore,no_run
15151 /// # use google_cloud_datastream_v1::model::source_object_identifier::MysqlObjectIdentifier;
15152 /// let x = MysqlObjectIdentifier::new().set_database("example");
15153 /// ```
15154 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15155 self.database = v.into();
15156 self
15157 }
15158
15159 /// Sets the value of [table][crate::model::source_object_identifier::MysqlObjectIdentifier::table].
15160 ///
15161 /// # Example
15162 /// ```ignore,no_run
15163 /// # use google_cloud_datastream_v1::model::source_object_identifier::MysqlObjectIdentifier;
15164 /// let x = MysqlObjectIdentifier::new().set_table("example");
15165 /// ```
15166 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15167 self.table = v.into();
15168 self
15169 }
15170 }
15171
15172 impl wkt::message::Message for MysqlObjectIdentifier {
15173 fn typename() -> &'static str {
15174 "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.MysqlObjectIdentifier"
15175 }
15176 }
15177
15178 /// SQLServer data source object identifier.
15179 #[derive(Clone, Default, PartialEq)]
15180 #[non_exhaustive]
15181 pub struct SqlServerObjectIdentifier {
15182 /// Required. The schema name.
15183 pub schema: std::string::String,
15184
15185 /// Required. The table name.
15186 pub table: std::string::String,
15187
15188 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15189 }
15190
15191 impl SqlServerObjectIdentifier {
15192 /// Creates a new default instance.
15193 pub fn new() -> Self {
15194 std::default::Default::default()
15195 }
15196
15197 /// Sets the value of [schema][crate::model::source_object_identifier::SqlServerObjectIdentifier::schema].
15198 ///
15199 /// # Example
15200 /// ```ignore,no_run
15201 /// # use google_cloud_datastream_v1::model::source_object_identifier::SqlServerObjectIdentifier;
15202 /// let x = SqlServerObjectIdentifier::new().set_schema("example");
15203 /// ```
15204 pub fn set_schema<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15205 self.schema = v.into();
15206 self
15207 }
15208
15209 /// Sets the value of [table][crate::model::source_object_identifier::SqlServerObjectIdentifier::table].
15210 ///
15211 /// # Example
15212 /// ```ignore,no_run
15213 /// # use google_cloud_datastream_v1::model::source_object_identifier::SqlServerObjectIdentifier;
15214 /// let x = SqlServerObjectIdentifier::new().set_table("example");
15215 /// ```
15216 pub fn set_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15217 self.table = v.into();
15218 self
15219 }
15220 }
15221
15222 impl wkt::message::Message for SqlServerObjectIdentifier {
15223 fn typename() -> &'static str {
15224 "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.SqlServerObjectIdentifier"
15225 }
15226 }
15227
15228 /// Salesforce data source object identifier.
15229 #[derive(Clone, Default, PartialEq)]
15230 #[non_exhaustive]
15231 pub struct SalesforceObjectIdentifier {
15232 /// Required. The object name.
15233 pub object_name: std::string::String,
15234
15235 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15236 }
15237
15238 impl SalesforceObjectIdentifier {
15239 /// Creates a new default instance.
15240 pub fn new() -> Self {
15241 std::default::Default::default()
15242 }
15243
15244 /// Sets the value of [object_name][crate::model::source_object_identifier::SalesforceObjectIdentifier::object_name].
15245 ///
15246 /// # Example
15247 /// ```ignore,no_run
15248 /// # use google_cloud_datastream_v1::model::source_object_identifier::SalesforceObjectIdentifier;
15249 /// let x = SalesforceObjectIdentifier::new().set_object_name("example");
15250 /// ```
15251 pub fn set_object_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15252 self.object_name = v.into();
15253 self
15254 }
15255 }
15256
15257 impl wkt::message::Message for SalesforceObjectIdentifier {
15258 fn typename() -> &'static str {
15259 "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.SalesforceObjectIdentifier"
15260 }
15261 }
15262
15263 /// MongoDB data source object identifier.
15264 #[derive(Clone, Default, PartialEq)]
15265 #[non_exhaustive]
15266 pub struct MongodbObjectIdentifier {
15267 /// Required. The database name.
15268 pub database: std::string::String,
15269
15270 /// Required. The collection name.
15271 pub collection: std::string::String,
15272
15273 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15274 }
15275
15276 impl MongodbObjectIdentifier {
15277 /// Creates a new default instance.
15278 pub fn new() -> Self {
15279 std::default::Default::default()
15280 }
15281
15282 /// Sets the value of [database][crate::model::source_object_identifier::MongodbObjectIdentifier::database].
15283 ///
15284 /// # Example
15285 /// ```ignore,no_run
15286 /// # use google_cloud_datastream_v1::model::source_object_identifier::MongodbObjectIdentifier;
15287 /// let x = MongodbObjectIdentifier::new().set_database("example");
15288 /// ```
15289 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15290 self.database = v.into();
15291 self
15292 }
15293
15294 /// Sets the value of [collection][crate::model::source_object_identifier::MongodbObjectIdentifier::collection].
15295 ///
15296 /// # Example
15297 /// ```ignore,no_run
15298 /// # use google_cloud_datastream_v1::model::source_object_identifier::MongodbObjectIdentifier;
15299 /// let x = MongodbObjectIdentifier::new().set_collection("example");
15300 /// ```
15301 pub fn set_collection<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15302 self.collection = v.into();
15303 self
15304 }
15305 }
15306
15307 impl wkt::message::Message for MongodbObjectIdentifier {
15308 fn typename() -> &'static str {
15309 "type.googleapis.com/google.cloud.datastream.v1.SourceObjectIdentifier.MongodbObjectIdentifier"
15310 }
15311 }
15312
15313 /// The identifier for an object in the data source.
15314 #[derive(Clone, Debug, PartialEq)]
15315 #[non_exhaustive]
15316 pub enum SourceIdentifier {
15317 /// Oracle data source object identifier.
15318 OracleIdentifier(
15319 std::boxed::Box<crate::model::source_object_identifier::OracleObjectIdentifier>,
15320 ),
15321 /// Mysql data source object identifier.
15322 MysqlIdentifier(
15323 std::boxed::Box<crate::model::source_object_identifier::MysqlObjectIdentifier>,
15324 ),
15325 /// PostgreSQL data source object identifier.
15326 PostgresqlIdentifier(
15327 std::boxed::Box<crate::model::source_object_identifier::PostgresqlObjectIdentifier>,
15328 ),
15329 /// SQLServer data source object identifier.
15330 SqlServerIdentifier(
15331 std::boxed::Box<crate::model::source_object_identifier::SqlServerObjectIdentifier>,
15332 ),
15333 /// Salesforce data source object identifier.
15334 SalesforceIdentifier(
15335 std::boxed::Box<crate::model::source_object_identifier::SalesforceObjectIdentifier>,
15336 ),
15337 /// MongoDB data source object identifier.
15338 MongodbIdentifier(
15339 std::boxed::Box<crate::model::source_object_identifier::MongodbObjectIdentifier>,
15340 ),
15341 }
15342}
15343
15344/// Represents a backfill job on a specific stream object.
15345#[derive(Clone, Default, PartialEq)]
15346#[non_exhaustive]
15347pub struct BackfillJob {
15348 /// Output only. Backfill job state.
15349 pub state: crate::model::backfill_job::State,
15350
15351 /// Backfill job's triggering reason.
15352 pub trigger: crate::model::backfill_job::Trigger,
15353
15354 /// Output only. Backfill job's start time.
15355 pub last_start_time: std::option::Option<wkt::Timestamp>,
15356
15357 /// Output only. Backfill job's end time.
15358 pub last_end_time: std::option::Option<wkt::Timestamp>,
15359
15360 /// Output only. Errors which caused the backfill job to fail.
15361 pub errors: std::vec::Vec<crate::model::Error>,
15362
15363 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15364}
15365
15366impl BackfillJob {
15367 /// Creates a new default instance.
15368 pub fn new() -> Self {
15369 std::default::Default::default()
15370 }
15371
15372 /// Sets the value of [state][crate::model::BackfillJob::state].
15373 ///
15374 /// # Example
15375 /// ```ignore,no_run
15376 /// # use google_cloud_datastream_v1::model::BackfillJob;
15377 /// use google_cloud_datastream_v1::model::backfill_job::State;
15378 /// let x0 = BackfillJob::new().set_state(State::NotStarted);
15379 /// let x1 = BackfillJob::new().set_state(State::Pending);
15380 /// let x2 = BackfillJob::new().set_state(State::Active);
15381 /// ```
15382 pub fn set_state<T: std::convert::Into<crate::model::backfill_job::State>>(
15383 mut self,
15384 v: T,
15385 ) -> Self {
15386 self.state = v.into();
15387 self
15388 }
15389
15390 /// Sets the value of [trigger][crate::model::BackfillJob::trigger].
15391 ///
15392 /// # Example
15393 /// ```ignore,no_run
15394 /// # use google_cloud_datastream_v1::model::BackfillJob;
15395 /// use google_cloud_datastream_v1::model::backfill_job::Trigger;
15396 /// let x0 = BackfillJob::new().set_trigger(Trigger::Automatic);
15397 /// let x1 = BackfillJob::new().set_trigger(Trigger::Manual);
15398 /// ```
15399 pub fn set_trigger<T: std::convert::Into<crate::model::backfill_job::Trigger>>(
15400 mut self,
15401 v: T,
15402 ) -> Self {
15403 self.trigger = v.into();
15404 self
15405 }
15406
15407 /// Sets the value of [last_start_time][crate::model::BackfillJob::last_start_time].
15408 ///
15409 /// # Example
15410 /// ```ignore,no_run
15411 /// # use google_cloud_datastream_v1::model::BackfillJob;
15412 /// use wkt::Timestamp;
15413 /// let x = BackfillJob::new().set_last_start_time(Timestamp::default()/* use setters */);
15414 /// ```
15415 pub fn set_last_start_time<T>(mut self, v: T) -> Self
15416 where
15417 T: std::convert::Into<wkt::Timestamp>,
15418 {
15419 self.last_start_time = std::option::Option::Some(v.into());
15420 self
15421 }
15422
15423 /// Sets or clears the value of [last_start_time][crate::model::BackfillJob::last_start_time].
15424 ///
15425 /// # Example
15426 /// ```ignore,no_run
15427 /// # use google_cloud_datastream_v1::model::BackfillJob;
15428 /// use wkt::Timestamp;
15429 /// let x = BackfillJob::new().set_or_clear_last_start_time(Some(Timestamp::default()/* use setters */));
15430 /// let x = BackfillJob::new().set_or_clear_last_start_time(None::<Timestamp>);
15431 /// ```
15432 pub fn set_or_clear_last_start_time<T>(mut self, v: std::option::Option<T>) -> Self
15433 where
15434 T: std::convert::Into<wkt::Timestamp>,
15435 {
15436 self.last_start_time = v.map(|x| x.into());
15437 self
15438 }
15439
15440 /// Sets the value of [last_end_time][crate::model::BackfillJob::last_end_time].
15441 ///
15442 /// # Example
15443 /// ```ignore,no_run
15444 /// # use google_cloud_datastream_v1::model::BackfillJob;
15445 /// use wkt::Timestamp;
15446 /// let x = BackfillJob::new().set_last_end_time(Timestamp::default()/* use setters */);
15447 /// ```
15448 pub fn set_last_end_time<T>(mut self, v: T) -> Self
15449 where
15450 T: std::convert::Into<wkt::Timestamp>,
15451 {
15452 self.last_end_time = std::option::Option::Some(v.into());
15453 self
15454 }
15455
15456 /// Sets or clears the value of [last_end_time][crate::model::BackfillJob::last_end_time].
15457 ///
15458 /// # Example
15459 /// ```ignore,no_run
15460 /// # use google_cloud_datastream_v1::model::BackfillJob;
15461 /// use wkt::Timestamp;
15462 /// let x = BackfillJob::new().set_or_clear_last_end_time(Some(Timestamp::default()/* use setters */));
15463 /// let x = BackfillJob::new().set_or_clear_last_end_time(None::<Timestamp>);
15464 /// ```
15465 pub fn set_or_clear_last_end_time<T>(mut self, v: std::option::Option<T>) -> Self
15466 where
15467 T: std::convert::Into<wkt::Timestamp>,
15468 {
15469 self.last_end_time = v.map(|x| x.into());
15470 self
15471 }
15472
15473 /// Sets the value of [errors][crate::model::BackfillJob::errors].
15474 ///
15475 /// # Example
15476 /// ```ignore,no_run
15477 /// # use google_cloud_datastream_v1::model::BackfillJob;
15478 /// use google_cloud_datastream_v1::model::Error;
15479 /// let x = BackfillJob::new()
15480 /// .set_errors([
15481 /// Error::default()/* use setters */,
15482 /// Error::default()/* use (different) setters */,
15483 /// ]);
15484 /// ```
15485 pub fn set_errors<T, V>(mut self, v: T) -> Self
15486 where
15487 T: std::iter::IntoIterator<Item = V>,
15488 V: std::convert::Into<crate::model::Error>,
15489 {
15490 use std::iter::Iterator;
15491 self.errors = v.into_iter().map(|i| i.into()).collect();
15492 self
15493 }
15494}
15495
15496impl wkt::message::Message for BackfillJob {
15497 fn typename() -> &'static str {
15498 "type.googleapis.com/google.cloud.datastream.v1.BackfillJob"
15499 }
15500}
15501
15502/// Defines additional types related to [BackfillJob].
15503pub mod backfill_job {
15504 #[allow(unused_imports)]
15505 use super::*;
15506
15507 /// State of the stream object's backfill job.
15508 ///
15509 /// # Working with unknown values
15510 ///
15511 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15512 /// additional enum variants at any time. Adding new variants is not considered
15513 /// a breaking change. Applications should write their code in anticipation of:
15514 ///
15515 /// - New values appearing in future releases of the client library, **and**
15516 /// - New values received dynamically, without application changes.
15517 ///
15518 /// Please consult the [Working with enums] section in the user guide for some
15519 /// guidelines.
15520 ///
15521 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15522 #[derive(Clone, Debug, PartialEq)]
15523 #[non_exhaustive]
15524 pub enum State {
15525 /// Default value.
15526 Unspecified,
15527 /// Backfill job was never started for the stream object (stream has backfill
15528 /// strategy defined as manual or object was explicitly excluded from
15529 /// automatic backfill).
15530 NotStarted,
15531 /// Backfill job will start pending available resources.
15532 Pending,
15533 /// Backfill job is running.
15534 Active,
15535 /// Backfill job stopped (next job run will start from beginning).
15536 Stopped,
15537 /// Backfill job failed (due to an error).
15538 Failed,
15539 /// Backfill completed successfully.
15540 Completed,
15541 /// Backfill job failed since the table structure is currently unsupported
15542 /// for backfill.
15543 Unsupported,
15544 /// If set, the enum was initialized with an unknown value.
15545 ///
15546 /// Applications can examine the value using [State::value] or
15547 /// [State::name].
15548 UnknownValue(state::UnknownValue),
15549 }
15550
15551 #[doc(hidden)]
15552 pub mod state {
15553 #[allow(unused_imports)]
15554 use super::*;
15555 #[derive(Clone, Debug, PartialEq)]
15556 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15557 }
15558
15559 impl State {
15560 /// Gets the enum value.
15561 ///
15562 /// Returns `None` if the enum contains an unknown value deserialized from
15563 /// the string representation of enums.
15564 pub fn value(&self) -> std::option::Option<i32> {
15565 match self {
15566 Self::Unspecified => std::option::Option::Some(0),
15567 Self::NotStarted => std::option::Option::Some(1),
15568 Self::Pending => std::option::Option::Some(2),
15569 Self::Active => std::option::Option::Some(3),
15570 Self::Stopped => std::option::Option::Some(4),
15571 Self::Failed => std::option::Option::Some(5),
15572 Self::Completed => std::option::Option::Some(6),
15573 Self::Unsupported => std::option::Option::Some(7),
15574 Self::UnknownValue(u) => u.0.value(),
15575 }
15576 }
15577
15578 /// Gets the enum value as a string.
15579 ///
15580 /// Returns `None` if the enum contains an unknown value deserialized from
15581 /// the integer representation of enums.
15582 pub fn name(&self) -> std::option::Option<&str> {
15583 match self {
15584 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
15585 Self::NotStarted => std::option::Option::Some("NOT_STARTED"),
15586 Self::Pending => std::option::Option::Some("PENDING"),
15587 Self::Active => std::option::Option::Some("ACTIVE"),
15588 Self::Stopped => std::option::Option::Some("STOPPED"),
15589 Self::Failed => std::option::Option::Some("FAILED"),
15590 Self::Completed => std::option::Option::Some("COMPLETED"),
15591 Self::Unsupported => std::option::Option::Some("UNSUPPORTED"),
15592 Self::UnknownValue(u) => u.0.name(),
15593 }
15594 }
15595 }
15596
15597 impl std::default::Default for State {
15598 fn default() -> Self {
15599 use std::convert::From;
15600 Self::from(0)
15601 }
15602 }
15603
15604 impl std::fmt::Display for State {
15605 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15606 wkt::internal::display_enum(f, self.name(), self.value())
15607 }
15608 }
15609
15610 impl std::convert::From<i32> for State {
15611 fn from(value: i32) -> Self {
15612 match value {
15613 0 => Self::Unspecified,
15614 1 => Self::NotStarted,
15615 2 => Self::Pending,
15616 3 => Self::Active,
15617 4 => Self::Stopped,
15618 5 => Self::Failed,
15619 6 => Self::Completed,
15620 7 => Self::Unsupported,
15621 _ => Self::UnknownValue(state::UnknownValue(
15622 wkt::internal::UnknownEnumValue::Integer(value),
15623 )),
15624 }
15625 }
15626 }
15627
15628 impl std::convert::From<&str> for State {
15629 fn from(value: &str) -> Self {
15630 use std::string::ToString;
15631 match value {
15632 "STATE_UNSPECIFIED" => Self::Unspecified,
15633 "NOT_STARTED" => Self::NotStarted,
15634 "PENDING" => Self::Pending,
15635 "ACTIVE" => Self::Active,
15636 "STOPPED" => Self::Stopped,
15637 "FAILED" => Self::Failed,
15638 "COMPLETED" => Self::Completed,
15639 "UNSUPPORTED" => Self::Unsupported,
15640 _ => Self::UnknownValue(state::UnknownValue(
15641 wkt::internal::UnknownEnumValue::String(value.to_string()),
15642 )),
15643 }
15644 }
15645 }
15646
15647 impl serde::ser::Serialize for State {
15648 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15649 where
15650 S: serde::Serializer,
15651 {
15652 match self {
15653 Self::Unspecified => serializer.serialize_i32(0),
15654 Self::NotStarted => serializer.serialize_i32(1),
15655 Self::Pending => serializer.serialize_i32(2),
15656 Self::Active => serializer.serialize_i32(3),
15657 Self::Stopped => serializer.serialize_i32(4),
15658 Self::Failed => serializer.serialize_i32(5),
15659 Self::Completed => serializer.serialize_i32(6),
15660 Self::Unsupported => serializer.serialize_i32(7),
15661 Self::UnknownValue(u) => u.0.serialize(serializer),
15662 }
15663 }
15664 }
15665
15666 impl<'de> serde::de::Deserialize<'de> for State {
15667 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15668 where
15669 D: serde::Deserializer<'de>,
15670 {
15671 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
15672 ".google.cloud.datastream.v1.BackfillJob.State",
15673 ))
15674 }
15675 }
15676
15677 /// Triggering reason for a backfill job.
15678 ///
15679 /// # Working with unknown values
15680 ///
15681 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15682 /// additional enum variants at any time. Adding new variants is not considered
15683 /// a breaking change. Applications should write their code in anticipation of:
15684 ///
15685 /// - New values appearing in future releases of the client library, **and**
15686 /// - New values received dynamically, without application changes.
15687 ///
15688 /// Please consult the [Working with enums] section in the user guide for some
15689 /// guidelines.
15690 ///
15691 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15692 #[derive(Clone, Debug, PartialEq)]
15693 #[non_exhaustive]
15694 pub enum Trigger {
15695 /// Default value.
15696 Unspecified,
15697 /// Object backfill job was triggered automatically according to the stream's
15698 /// backfill strategy.
15699 Automatic,
15700 /// Object backfill job was triggered manually using the dedicated API.
15701 Manual,
15702 /// If set, the enum was initialized with an unknown value.
15703 ///
15704 /// Applications can examine the value using [Trigger::value] or
15705 /// [Trigger::name].
15706 UnknownValue(trigger::UnknownValue),
15707 }
15708
15709 #[doc(hidden)]
15710 pub mod trigger {
15711 #[allow(unused_imports)]
15712 use super::*;
15713 #[derive(Clone, Debug, PartialEq)]
15714 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15715 }
15716
15717 impl Trigger {
15718 /// Gets the enum value.
15719 ///
15720 /// Returns `None` if the enum contains an unknown value deserialized from
15721 /// the string representation of enums.
15722 pub fn value(&self) -> std::option::Option<i32> {
15723 match self {
15724 Self::Unspecified => std::option::Option::Some(0),
15725 Self::Automatic => std::option::Option::Some(1),
15726 Self::Manual => std::option::Option::Some(2),
15727 Self::UnknownValue(u) => u.0.value(),
15728 }
15729 }
15730
15731 /// Gets the enum value as a string.
15732 ///
15733 /// Returns `None` if the enum contains an unknown value deserialized from
15734 /// the integer representation of enums.
15735 pub fn name(&self) -> std::option::Option<&str> {
15736 match self {
15737 Self::Unspecified => std::option::Option::Some("TRIGGER_UNSPECIFIED"),
15738 Self::Automatic => std::option::Option::Some("AUTOMATIC"),
15739 Self::Manual => std::option::Option::Some("MANUAL"),
15740 Self::UnknownValue(u) => u.0.name(),
15741 }
15742 }
15743 }
15744
15745 impl std::default::Default for Trigger {
15746 fn default() -> Self {
15747 use std::convert::From;
15748 Self::from(0)
15749 }
15750 }
15751
15752 impl std::fmt::Display for Trigger {
15753 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15754 wkt::internal::display_enum(f, self.name(), self.value())
15755 }
15756 }
15757
15758 impl std::convert::From<i32> for Trigger {
15759 fn from(value: i32) -> Self {
15760 match value {
15761 0 => Self::Unspecified,
15762 1 => Self::Automatic,
15763 2 => Self::Manual,
15764 _ => Self::UnknownValue(trigger::UnknownValue(
15765 wkt::internal::UnknownEnumValue::Integer(value),
15766 )),
15767 }
15768 }
15769 }
15770
15771 impl std::convert::From<&str> for Trigger {
15772 fn from(value: &str) -> Self {
15773 use std::string::ToString;
15774 match value {
15775 "TRIGGER_UNSPECIFIED" => Self::Unspecified,
15776 "AUTOMATIC" => Self::Automatic,
15777 "MANUAL" => Self::Manual,
15778 _ => Self::UnknownValue(trigger::UnknownValue(
15779 wkt::internal::UnknownEnumValue::String(value.to_string()),
15780 )),
15781 }
15782 }
15783 }
15784
15785 impl serde::ser::Serialize for Trigger {
15786 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15787 where
15788 S: serde::Serializer,
15789 {
15790 match self {
15791 Self::Unspecified => serializer.serialize_i32(0),
15792 Self::Automatic => serializer.serialize_i32(1),
15793 Self::Manual => serializer.serialize_i32(2),
15794 Self::UnknownValue(u) => u.0.serialize(serializer),
15795 }
15796 }
15797 }
15798
15799 impl<'de> serde::de::Deserialize<'de> for Trigger {
15800 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15801 where
15802 D: serde::Deserializer<'de>,
15803 {
15804 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Trigger>::new(
15805 ".google.cloud.datastream.v1.BackfillJob.Trigger",
15806 ))
15807 }
15808 }
15809}
15810
15811/// Represent a user-facing Error.
15812#[derive(Clone, Default, PartialEq)]
15813#[non_exhaustive]
15814pub struct Error {
15815 /// A title that explains the reason for the error.
15816 pub reason: std::string::String,
15817
15818 /// A unique identifier for this specific error,
15819 /// allowing it to be traced throughout the system in logs and API responses.
15820 pub error_uuid: std::string::String,
15821
15822 /// A message containing more information about the error that occurred.
15823 pub message: std::string::String,
15824
15825 /// The time when the error occurred.
15826 pub error_time: std::option::Option<wkt::Timestamp>,
15827
15828 /// Additional information about the error.
15829 pub details: std::collections::HashMap<std::string::String, std::string::String>,
15830
15831 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15832}
15833
15834impl Error {
15835 /// Creates a new default instance.
15836 pub fn new() -> Self {
15837 std::default::Default::default()
15838 }
15839
15840 /// Sets the value of [reason][crate::model::Error::reason].
15841 ///
15842 /// # Example
15843 /// ```ignore,no_run
15844 /// # use google_cloud_datastream_v1::model::Error;
15845 /// let x = Error::new().set_reason("example");
15846 /// ```
15847 pub fn set_reason<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15848 self.reason = v.into();
15849 self
15850 }
15851
15852 /// Sets the value of [error_uuid][crate::model::Error::error_uuid].
15853 ///
15854 /// # Example
15855 /// ```ignore,no_run
15856 /// # use google_cloud_datastream_v1::model::Error;
15857 /// let x = Error::new().set_error_uuid("example");
15858 /// ```
15859 pub fn set_error_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15860 self.error_uuid = v.into();
15861 self
15862 }
15863
15864 /// Sets the value of [message][crate::model::Error::message].
15865 ///
15866 /// # Example
15867 /// ```ignore,no_run
15868 /// # use google_cloud_datastream_v1::model::Error;
15869 /// let x = Error::new().set_message("example");
15870 /// ```
15871 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15872 self.message = v.into();
15873 self
15874 }
15875
15876 /// Sets the value of [error_time][crate::model::Error::error_time].
15877 ///
15878 /// # Example
15879 /// ```ignore,no_run
15880 /// # use google_cloud_datastream_v1::model::Error;
15881 /// use wkt::Timestamp;
15882 /// let x = Error::new().set_error_time(Timestamp::default()/* use setters */);
15883 /// ```
15884 pub fn set_error_time<T>(mut self, v: T) -> Self
15885 where
15886 T: std::convert::Into<wkt::Timestamp>,
15887 {
15888 self.error_time = std::option::Option::Some(v.into());
15889 self
15890 }
15891
15892 /// Sets or clears the value of [error_time][crate::model::Error::error_time].
15893 ///
15894 /// # Example
15895 /// ```ignore,no_run
15896 /// # use google_cloud_datastream_v1::model::Error;
15897 /// use wkt::Timestamp;
15898 /// let x = Error::new().set_or_clear_error_time(Some(Timestamp::default()/* use setters */));
15899 /// let x = Error::new().set_or_clear_error_time(None::<Timestamp>);
15900 /// ```
15901 pub fn set_or_clear_error_time<T>(mut self, v: std::option::Option<T>) -> Self
15902 where
15903 T: std::convert::Into<wkt::Timestamp>,
15904 {
15905 self.error_time = v.map(|x| x.into());
15906 self
15907 }
15908
15909 /// Sets the value of [details][crate::model::Error::details].
15910 ///
15911 /// # Example
15912 /// ```ignore,no_run
15913 /// # use google_cloud_datastream_v1::model::Error;
15914 /// let x = Error::new().set_details([
15915 /// ("key0", "abc"),
15916 /// ("key1", "xyz"),
15917 /// ]);
15918 /// ```
15919 pub fn set_details<T, K, V>(mut self, v: T) -> Self
15920 where
15921 T: std::iter::IntoIterator<Item = (K, V)>,
15922 K: std::convert::Into<std::string::String>,
15923 V: std::convert::Into<std::string::String>,
15924 {
15925 use std::iter::Iterator;
15926 self.details = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
15927 self
15928 }
15929}
15930
15931impl wkt::message::Message for Error {
15932 fn typename() -> &'static str {
15933 "type.googleapis.com/google.cloud.datastream.v1.Error"
15934 }
15935}
15936
15937/// Contains the current validation results.
15938#[derive(Clone, Default, PartialEq)]
15939#[non_exhaustive]
15940pub struct ValidationResult {
15941 /// A list of validations (includes both executed as well as not executed
15942 /// validations).
15943 pub validations: std::vec::Vec<crate::model::Validation>,
15944
15945 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15946}
15947
15948impl ValidationResult {
15949 /// Creates a new default instance.
15950 pub fn new() -> Self {
15951 std::default::Default::default()
15952 }
15953
15954 /// Sets the value of [validations][crate::model::ValidationResult::validations].
15955 ///
15956 /// # Example
15957 /// ```ignore,no_run
15958 /// # use google_cloud_datastream_v1::model::ValidationResult;
15959 /// use google_cloud_datastream_v1::model::Validation;
15960 /// let x = ValidationResult::new()
15961 /// .set_validations([
15962 /// Validation::default()/* use setters */,
15963 /// Validation::default()/* use (different) setters */,
15964 /// ]);
15965 /// ```
15966 pub fn set_validations<T, V>(mut self, v: T) -> Self
15967 where
15968 T: std::iter::IntoIterator<Item = V>,
15969 V: std::convert::Into<crate::model::Validation>,
15970 {
15971 use std::iter::Iterator;
15972 self.validations = v.into_iter().map(|i| i.into()).collect();
15973 self
15974 }
15975}
15976
15977impl wkt::message::Message for ValidationResult {
15978 fn typename() -> &'static str {
15979 "type.googleapis.com/google.cloud.datastream.v1.ValidationResult"
15980 }
15981}
15982
15983/// A validation to perform on a stream.
15984#[derive(Clone, Default, PartialEq)]
15985#[non_exhaustive]
15986pub struct Validation {
15987 /// A short description of the validation.
15988 pub description: std::string::String,
15989
15990 /// Output only. Validation execution status.
15991 pub state: crate::model::validation::State,
15992
15993 /// Messages reflecting the validation results.
15994 pub message: std::vec::Vec<crate::model::ValidationMessage>,
15995
15996 /// A custom code identifying this validation.
15997 pub code: std::string::String,
15998
15999 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16000}
16001
16002impl Validation {
16003 /// Creates a new default instance.
16004 pub fn new() -> Self {
16005 std::default::Default::default()
16006 }
16007
16008 /// Sets the value of [description][crate::model::Validation::description].
16009 ///
16010 /// # Example
16011 /// ```ignore,no_run
16012 /// # use google_cloud_datastream_v1::model::Validation;
16013 /// let x = Validation::new().set_description("example");
16014 /// ```
16015 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16016 self.description = v.into();
16017 self
16018 }
16019
16020 /// Sets the value of [state][crate::model::Validation::state].
16021 ///
16022 /// # Example
16023 /// ```ignore,no_run
16024 /// # use google_cloud_datastream_v1::model::Validation;
16025 /// use google_cloud_datastream_v1::model::validation::State;
16026 /// let x0 = Validation::new().set_state(State::NotExecuted);
16027 /// let x1 = Validation::new().set_state(State::Failed);
16028 /// let x2 = Validation::new().set_state(State::Passed);
16029 /// ```
16030 pub fn set_state<T: std::convert::Into<crate::model::validation::State>>(
16031 mut self,
16032 v: T,
16033 ) -> Self {
16034 self.state = v.into();
16035 self
16036 }
16037
16038 /// Sets the value of [message][crate::model::Validation::message].
16039 ///
16040 /// # Example
16041 /// ```ignore,no_run
16042 /// # use google_cloud_datastream_v1::model::Validation;
16043 /// use google_cloud_datastream_v1::model::ValidationMessage;
16044 /// let x = Validation::new()
16045 /// .set_message([
16046 /// ValidationMessage::default()/* use setters */,
16047 /// ValidationMessage::default()/* use (different) setters */,
16048 /// ]);
16049 /// ```
16050 pub fn set_message<T, V>(mut self, v: T) -> Self
16051 where
16052 T: std::iter::IntoIterator<Item = V>,
16053 V: std::convert::Into<crate::model::ValidationMessage>,
16054 {
16055 use std::iter::Iterator;
16056 self.message = v.into_iter().map(|i| i.into()).collect();
16057 self
16058 }
16059
16060 /// Sets the value of [code][crate::model::Validation::code].
16061 ///
16062 /// # Example
16063 /// ```ignore,no_run
16064 /// # use google_cloud_datastream_v1::model::Validation;
16065 /// let x = Validation::new().set_code("example");
16066 /// ```
16067 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16068 self.code = v.into();
16069 self
16070 }
16071}
16072
16073impl wkt::message::Message for Validation {
16074 fn typename() -> &'static str {
16075 "type.googleapis.com/google.cloud.datastream.v1.Validation"
16076 }
16077}
16078
16079/// Defines additional types related to [Validation].
16080pub mod validation {
16081 #[allow(unused_imports)]
16082 use super::*;
16083
16084 /// Validation execution state.
16085 ///
16086 /// # Working with unknown values
16087 ///
16088 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16089 /// additional enum variants at any time. Adding new variants is not considered
16090 /// a breaking change. Applications should write their code in anticipation of:
16091 ///
16092 /// - New values appearing in future releases of the client library, **and**
16093 /// - New values received dynamically, without application changes.
16094 ///
16095 /// Please consult the [Working with enums] section in the user guide for some
16096 /// guidelines.
16097 ///
16098 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16099 #[derive(Clone, Debug, PartialEq)]
16100 #[non_exhaustive]
16101 pub enum State {
16102 /// Unspecified state.
16103 Unspecified,
16104 /// Validation did not execute.
16105 NotExecuted,
16106 /// Validation failed.
16107 Failed,
16108 /// Validation passed.
16109 Passed,
16110 /// Validation executed with warnings.
16111 Warning,
16112 /// If set, the enum was initialized with an unknown value.
16113 ///
16114 /// Applications can examine the value using [State::value] or
16115 /// [State::name].
16116 UnknownValue(state::UnknownValue),
16117 }
16118
16119 #[doc(hidden)]
16120 pub mod state {
16121 #[allow(unused_imports)]
16122 use super::*;
16123 #[derive(Clone, Debug, PartialEq)]
16124 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16125 }
16126
16127 impl State {
16128 /// Gets the enum value.
16129 ///
16130 /// Returns `None` if the enum contains an unknown value deserialized from
16131 /// the string representation of enums.
16132 pub fn value(&self) -> std::option::Option<i32> {
16133 match self {
16134 Self::Unspecified => std::option::Option::Some(0),
16135 Self::NotExecuted => std::option::Option::Some(1),
16136 Self::Failed => std::option::Option::Some(2),
16137 Self::Passed => std::option::Option::Some(3),
16138 Self::Warning => std::option::Option::Some(4),
16139 Self::UnknownValue(u) => u.0.value(),
16140 }
16141 }
16142
16143 /// Gets the enum value as a string.
16144 ///
16145 /// Returns `None` if the enum contains an unknown value deserialized from
16146 /// the integer representation of enums.
16147 pub fn name(&self) -> std::option::Option<&str> {
16148 match self {
16149 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
16150 Self::NotExecuted => std::option::Option::Some("NOT_EXECUTED"),
16151 Self::Failed => std::option::Option::Some("FAILED"),
16152 Self::Passed => std::option::Option::Some("PASSED"),
16153 Self::Warning => std::option::Option::Some("WARNING"),
16154 Self::UnknownValue(u) => u.0.name(),
16155 }
16156 }
16157 }
16158
16159 impl std::default::Default for State {
16160 fn default() -> Self {
16161 use std::convert::From;
16162 Self::from(0)
16163 }
16164 }
16165
16166 impl std::fmt::Display for State {
16167 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16168 wkt::internal::display_enum(f, self.name(), self.value())
16169 }
16170 }
16171
16172 impl std::convert::From<i32> for State {
16173 fn from(value: i32) -> Self {
16174 match value {
16175 0 => Self::Unspecified,
16176 1 => Self::NotExecuted,
16177 2 => Self::Failed,
16178 3 => Self::Passed,
16179 4 => Self::Warning,
16180 _ => Self::UnknownValue(state::UnknownValue(
16181 wkt::internal::UnknownEnumValue::Integer(value),
16182 )),
16183 }
16184 }
16185 }
16186
16187 impl std::convert::From<&str> for State {
16188 fn from(value: &str) -> Self {
16189 use std::string::ToString;
16190 match value {
16191 "STATE_UNSPECIFIED" => Self::Unspecified,
16192 "NOT_EXECUTED" => Self::NotExecuted,
16193 "FAILED" => Self::Failed,
16194 "PASSED" => Self::Passed,
16195 "WARNING" => Self::Warning,
16196 _ => Self::UnknownValue(state::UnknownValue(
16197 wkt::internal::UnknownEnumValue::String(value.to_string()),
16198 )),
16199 }
16200 }
16201 }
16202
16203 impl serde::ser::Serialize for State {
16204 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16205 where
16206 S: serde::Serializer,
16207 {
16208 match self {
16209 Self::Unspecified => serializer.serialize_i32(0),
16210 Self::NotExecuted => serializer.serialize_i32(1),
16211 Self::Failed => serializer.serialize_i32(2),
16212 Self::Passed => serializer.serialize_i32(3),
16213 Self::Warning => serializer.serialize_i32(4),
16214 Self::UnknownValue(u) => u.0.serialize(serializer),
16215 }
16216 }
16217 }
16218
16219 impl<'de> serde::de::Deserialize<'de> for State {
16220 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16221 where
16222 D: serde::Deserializer<'de>,
16223 {
16224 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
16225 ".google.cloud.datastream.v1.Validation.State",
16226 ))
16227 }
16228 }
16229}
16230
16231/// Represent user-facing validation result message.
16232#[derive(Clone, Default, PartialEq)]
16233#[non_exhaustive]
16234pub struct ValidationMessage {
16235 /// The result of the validation.
16236 pub message: std::string::String,
16237
16238 /// Message severity level (warning or error).
16239 pub level: crate::model::validation_message::Level,
16240
16241 /// Additional metadata related to the result.
16242 pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
16243
16244 /// A custom code identifying this specific message.
16245 pub code: std::string::String,
16246
16247 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16248}
16249
16250impl ValidationMessage {
16251 /// Creates a new default instance.
16252 pub fn new() -> Self {
16253 std::default::Default::default()
16254 }
16255
16256 /// Sets the value of [message][crate::model::ValidationMessage::message].
16257 ///
16258 /// # Example
16259 /// ```ignore,no_run
16260 /// # use google_cloud_datastream_v1::model::ValidationMessage;
16261 /// let x = ValidationMessage::new().set_message("example");
16262 /// ```
16263 pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16264 self.message = v.into();
16265 self
16266 }
16267
16268 /// Sets the value of [level][crate::model::ValidationMessage::level].
16269 ///
16270 /// # Example
16271 /// ```ignore,no_run
16272 /// # use google_cloud_datastream_v1::model::ValidationMessage;
16273 /// use google_cloud_datastream_v1::model::validation_message::Level;
16274 /// let x0 = ValidationMessage::new().set_level(Level::Warning);
16275 /// let x1 = ValidationMessage::new().set_level(Level::Error);
16276 /// ```
16277 pub fn set_level<T: std::convert::Into<crate::model::validation_message::Level>>(
16278 mut self,
16279 v: T,
16280 ) -> Self {
16281 self.level = v.into();
16282 self
16283 }
16284
16285 /// Sets the value of [metadata][crate::model::ValidationMessage::metadata].
16286 ///
16287 /// # Example
16288 /// ```ignore,no_run
16289 /// # use google_cloud_datastream_v1::model::ValidationMessage;
16290 /// let x = ValidationMessage::new().set_metadata([
16291 /// ("key0", "abc"),
16292 /// ("key1", "xyz"),
16293 /// ]);
16294 /// ```
16295 pub fn set_metadata<T, K, V>(mut self, v: T) -> Self
16296 where
16297 T: std::iter::IntoIterator<Item = (K, V)>,
16298 K: std::convert::Into<std::string::String>,
16299 V: std::convert::Into<std::string::String>,
16300 {
16301 use std::iter::Iterator;
16302 self.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16303 self
16304 }
16305
16306 /// Sets the value of [code][crate::model::ValidationMessage::code].
16307 ///
16308 /// # Example
16309 /// ```ignore,no_run
16310 /// # use google_cloud_datastream_v1::model::ValidationMessage;
16311 /// let x = ValidationMessage::new().set_code("example");
16312 /// ```
16313 pub fn set_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16314 self.code = v.into();
16315 self
16316 }
16317}
16318
16319impl wkt::message::Message for ValidationMessage {
16320 fn typename() -> &'static str {
16321 "type.googleapis.com/google.cloud.datastream.v1.ValidationMessage"
16322 }
16323}
16324
16325/// Defines additional types related to [ValidationMessage].
16326pub mod validation_message {
16327 #[allow(unused_imports)]
16328 use super::*;
16329
16330 /// Validation message level.
16331 ///
16332 /// # Working with unknown values
16333 ///
16334 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16335 /// additional enum variants at any time. Adding new variants is not considered
16336 /// a breaking change. Applications should write their code in anticipation of:
16337 ///
16338 /// - New values appearing in future releases of the client library, **and**
16339 /// - New values received dynamically, without application changes.
16340 ///
16341 /// Please consult the [Working with enums] section in the user guide for some
16342 /// guidelines.
16343 ///
16344 /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16345 #[derive(Clone, Debug, PartialEq)]
16346 #[non_exhaustive]
16347 pub enum Level {
16348 /// Unspecified level.
16349 Unspecified,
16350 /// Potentially cause issues with the Stream.
16351 Warning,
16352 /// Definitely cause issues with the Stream.
16353 Error,
16354 /// If set, the enum was initialized with an unknown value.
16355 ///
16356 /// Applications can examine the value using [Level::value] or
16357 /// [Level::name].
16358 UnknownValue(level::UnknownValue),
16359 }
16360
16361 #[doc(hidden)]
16362 pub mod level {
16363 #[allow(unused_imports)]
16364 use super::*;
16365 #[derive(Clone, Debug, PartialEq)]
16366 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16367 }
16368
16369 impl Level {
16370 /// Gets the enum value.
16371 ///
16372 /// Returns `None` if the enum contains an unknown value deserialized from
16373 /// the string representation of enums.
16374 pub fn value(&self) -> std::option::Option<i32> {
16375 match self {
16376 Self::Unspecified => std::option::Option::Some(0),
16377 Self::Warning => std::option::Option::Some(1),
16378 Self::Error => std::option::Option::Some(2),
16379 Self::UnknownValue(u) => u.0.value(),
16380 }
16381 }
16382
16383 /// Gets the enum value as a string.
16384 ///
16385 /// Returns `None` if the enum contains an unknown value deserialized from
16386 /// the integer representation of enums.
16387 pub fn name(&self) -> std::option::Option<&str> {
16388 match self {
16389 Self::Unspecified => std::option::Option::Some("LEVEL_UNSPECIFIED"),
16390 Self::Warning => std::option::Option::Some("WARNING"),
16391 Self::Error => std::option::Option::Some("ERROR"),
16392 Self::UnknownValue(u) => u.0.name(),
16393 }
16394 }
16395 }
16396
16397 impl std::default::Default for Level {
16398 fn default() -> Self {
16399 use std::convert::From;
16400 Self::from(0)
16401 }
16402 }
16403
16404 impl std::fmt::Display for Level {
16405 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16406 wkt::internal::display_enum(f, self.name(), self.value())
16407 }
16408 }
16409
16410 impl std::convert::From<i32> for Level {
16411 fn from(value: i32) -> Self {
16412 match value {
16413 0 => Self::Unspecified,
16414 1 => Self::Warning,
16415 2 => Self::Error,
16416 _ => Self::UnknownValue(level::UnknownValue(
16417 wkt::internal::UnknownEnumValue::Integer(value),
16418 )),
16419 }
16420 }
16421 }
16422
16423 impl std::convert::From<&str> for Level {
16424 fn from(value: &str) -> Self {
16425 use std::string::ToString;
16426 match value {
16427 "LEVEL_UNSPECIFIED" => Self::Unspecified,
16428 "WARNING" => Self::Warning,
16429 "ERROR" => Self::Error,
16430 _ => Self::UnknownValue(level::UnknownValue(
16431 wkt::internal::UnknownEnumValue::String(value.to_string()),
16432 )),
16433 }
16434 }
16435 }
16436
16437 impl serde::ser::Serialize for Level {
16438 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16439 where
16440 S: serde::Serializer,
16441 {
16442 match self {
16443 Self::Unspecified => serializer.serialize_i32(0),
16444 Self::Warning => serializer.serialize_i32(1),
16445 Self::Error => serializer.serialize_i32(2),
16446 Self::UnknownValue(u) => u.0.serialize(serializer),
16447 }
16448 }
16449 }
16450
16451 impl<'de> serde::de::Deserialize<'de> for Level {
16452 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16453 where
16454 D: serde::Deserializer<'de>,
16455 {
16456 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Level>::new(
16457 ".google.cloud.datastream.v1.ValidationMessage.Level",
16458 ))
16459 }
16460 }
16461}
16462
16463/// The strategy that the stream uses for CDC replication.
16464#[derive(Clone, Default, PartialEq)]
16465#[non_exhaustive]
16466pub struct CdcStrategy {
16467 /// The position to start reading from when starting, resuming, or recovering
16468 /// the stream.
16469 /// If not set, the system's default value will be used.
16470 pub start_position: std::option::Option<crate::model::cdc_strategy::StartPosition>,
16471
16472 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16473}
16474
16475impl CdcStrategy {
16476 /// Creates a new default instance.
16477 pub fn new() -> Self {
16478 std::default::Default::default()
16479 }
16480
16481 /// Sets the value of [start_position][crate::model::CdcStrategy::start_position].
16482 ///
16483 /// Note that all the setters affecting `start_position` are mutually
16484 /// exclusive.
16485 ///
16486 /// # Example
16487 /// ```ignore,no_run
16488 /// # use google_cloud_datastream_v1::model::CdcStrategy;
16489 /// use google_cloud_datastream_v1::model::cdc_strategy::MostRecentStartPosition;
16490 /// let x = CdcStrategy::new().set_start_position(Some(
16491 /// google_cloud_datastream_v1::model::cdc_strategy::StartPosition::MostRecentStartPosition(MostRecentStartPosition::default().into())));
16492 /// ```
16493 pub fn set_start_position<
16494 T: std::convert::Into<std::option::Option<crate::model::cdc_strategy::StartPosition>>,
16495 >(
16496 mut self,
16497 v: T,
16498 ) -> Self {
16499 self.start_position = v.into();
16500 self
16501 }
16502
16503 /// The value of [start_position][crate::model::CdcStrategy::start_position]
16504 /// if it holds a `MostRecentStartPosition`, `None` if the field is not set or
16505 /// holds a different branch.
16506 pub fn most_recent_start_position(
16507 &self,
16508 ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>>
16509 {
16510 #[allow(unreachable_patterns)]
16511 self.start_position.as_ref().and_then(|v| match v {
16512 crate::model::cdc_strategy::StartPosition::MostRecentStartPosition(v) => {
16513 std::option::Option::Some(v)
16514 }
16515 _ => std::option::Option::None,
16516 })
16517 }
16518
16519 /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
16520 /// to hold a `MostRecentStartPosition`.
16521 ///
16522 /// Note that all the setters affecting `start_position` are
16523 /// mutually exclusive.
16524 ///
16525 /// # Example
16526 /// ```ignore,no_run
16527 /// # use google_cloud_datastream_v1::model::CdcStrategy;
16528 /// use google_cloud_datastream_v1::model::cdc_strategy::MostRecentStartPosition;
16529 /// let x = CdcStrategy::new().set_most_recent_start_position(MostRecentStartPosition::default()/* use setters */);
16530 /// assert!(x.most_recent_start_position().is_some());
16531 /// assert!(x.next_available_start_position().is_none());
16532 /// assert!(x.specific_start_position().is_none());
16533 /// ```
16534 pub fn set_most_recent_start_position<
16535 T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>>,
16536 >(
16537 mut self,
16538 v: T,
16539 ) -> Self {
16540 self.start_position = std::option::Option::Some(
16541 crate::model::cdc_strategy::StartPosition::MostRecentStartPosition(v.into()),
16542 );
16543 self
16544 }
16545
16546 /// The value of [start_position][crate::model::CdcStrategy::start_position]
16547 /// if it holds a `NextAvailableStartPosition`, `None` if the field is not set or
16548 /// holds a different branch.
16549 pub fn next_available_start_position(
16550 &self,
16551 ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>>
16552 {
16553 #[allow(unreachable_patterns)]
16554 self.start_position.as_ref().and_then(|v| match v {
16555 crate::model::cdc_strategy::StartPosition::NextAvailableStartPosition(v) => {
16556 std::option::Option::Some(v)
16557 }
16558 _ => std::option::Option::None,
16559 })
16560 }
16561
16562 /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
16563 /// to hold a `NextAvailableStartPosition`.
16564 ///
16565 /// Note that all the setters affecting `start_position` are
16566 /// mutually exclusive.
16567 ///
16568 /// # Example
16569 /// ```ignore,no_run
16570 /// # use google_cloud_datastream_v1::model::CdcStrategy;
16571 /// use google_cloud_datastream_v1::model::cdc_strategy::NextAvailableStartPosition;
16572 /// let x = CdcStrategy::new().set_next_available_start_position(NextAvailableStartPosition::default()/* use setters */);
16573 /// assert!(x.next_available_start_position().is_some());
16574 /// assert!(x.most_recent_start_position().is_none());
16575 /// assert!(x.specific_start_position().is_none());
16576 /// ```
16577 pub fn set_next_available_start_position<
16578 T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>>,
16579 >(
16580 mut self,
16581 v: T,
16582 ) -> Self {
16583 self.start_position = std::option::Option::Some(
16584 crate::model::cdc_strategy::StartPosition::NextAvailableStartPosition(v.into()),
16585 );
16586 self
16587 }
16588
16589 /// The value of [start_position][crate::model::CdcStrategy::start_position]
16590 /// if it holds a `SpecificStartPosition`, `None` if the field is not set or
16591 /// holds a different branch.
16592 pub fn specific_start_position(
16593 &self,
16594 ) -> std::option::Option<&std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>>
16595 {
16596 #[allow(unreachable_patterns)]
16597 self.start_position.as_ref().and_then(|v| match v {
16598 crate::model::cdc_strategy::StartPosition::SpecificStartPosition(v) => {
16599 std::option::Option::Some(v)
16600 }
16601 _ => std::option::Option::None,
16602 })
16603 }
16604
16605 /// Sets the value of [start_position][crate::model::CdcStrategy::start_position]
16606 /// to hold a `SpecificStartPosition`.
16607 ///
16608 /// Note that all the setters affecting `start_position` are
16609 /// mutually exclusive.
16610 ///
16611 /// # Example
16612 /// ```ignore,no_run
16613 /// # use google_cloud_datastream_v1::model::CdcStrategy;
16614 /// use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16615 /// let x = CdcStrategy::new().set_specific_start_position(SpecificStartPosition::default()/* use setters */);
16616 /// assert!(x.specific_start_position().is_some());
16617 /// assert!(x.most_recent_start_position().is_none());
16618 /// assert!(x.next_available_start_position().is_none());
16619 /// ```
16620 pub fn set_specific_start_position<
16621 T: std::convert::Into<std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>>,
16622 >(
16623 mut self,
16624 v: T,
16625 ) -> Self {
16626 self.start_position = std::option::Option::Some(
16627 crate::model::cdc_strategy::StartPosition::SpecificStartPosition(v.into()),
16628 );
16629 self
16630 }
16631}
16632
16633impl wkt::message::Message for CdcStrategy {
16634 fn typename() -> &'static str {
16635 "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy"
16636 }
16637}
16638
16639/// Defines additional types related to [CdcStrategy].
16640pub mod cdc_strategy {
16641 #[allow(unused_imports)]
16642 use super::*;
16643
16644 /// CDC strategy to start replicating from the most recent position in the
16645 /// source.
16646 #[derive(Clone, Default, PartialEq)]
16647 #[non_exhaustive]
16648 pub struct MostRecentStartPosition {
16649 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16650 }
16651
16652 impl MostRecentStartPosition {
16653 /// Creates a new default instance.
16654 pub fn new() -> Self {
16655 std::default::Default::default()
16656 }
16657 }
16658
16659 impl wkt::message::Message for MostRecentStartPosition {
16660 fn typename() -> &'static str {
16661 "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.MostRecentStartPosition"
16662 }
16663 }
16664
16665 /// CDC strategy to resume replication from the next available position in the
16666 /// source.
16667 #[derive(Clone, Default, PartialEq)]
16668 #[non_exhaustive]
16669 pub struct NextAvailableStartPosition {
16670 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16671 }
16672
16673 impl NextAvailableStartPosition {
16674 /// Creates a new default instance.
16675 pub fn new() -> Self {
16676 std::default::Default::default()
16677 }
16678 }
16679
16680 impl wkt::message::Message for NextAvailableStartPosition {
16681 fn typename() -> &'static str {
16682 "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.NextAvailableStartPosition"
16683 }
16684 }
16685
16686 /// CDC strategy to start replicating from a specific position in the source.
16687 #[derive(Clone, Default, PartialEq)]
16688 #[non_exhaustive]
16689 pub struct SpecificStartPosition {
16690 #[allow(missing_docs)]
16691 pub position:
16692 std::option::Option<crate::model::cdc_strategy::specific_start_position::Position>,
16693
16694 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16695 }
16696
16697 impl SpecificStartPosition {
16698 /// Creates a new default instance.
16699 pub fn new() -> Self {
16700 std::default::Default::default()
16701 }
16702
16703 /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position].
16704 ///
16705 /// Note that all the setters affecting `position` are mutually
16706 /// exclusive.
16707 ///
16708 /// # Example
16709 /// ```ignore,no_run
16710 /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16711 /// use google_cloud_datastream_v1::model::MysqlLogPosition;
16712 /// let x = SpecificStartPosition::new().set_position(Some(
16713 /// google_cloud_datastream_v1::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(MysqlLogPosition::default().into())));
16714 /// ```
16715 pub fn set_position<
16716 T: std::convert::Into<
16717 std::option::Option<
16718 crate::model::cdc_strategy::specific_start_position::Position,
16719 >,
16720 >,
16721 >(
16722 mut self,
16723 v: T,
16724 ) -> Self {
16725 self.position = v.into();
16726 self
16727 }
16728
16729 /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16730 /// if it holds a `MysqlLogPosition`, `None` if the field is not set or
16731 /// holds a different branch.
16732 pub fn mysql_log_position(
16733 &self,
16734 ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlLogPosition>> {
16735 #[allow(unreachable_patterns)]
16736 self.position.as_ref().and_then(|v| match v {
16737 crate::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(
16738 v,
16739 ) => std::option::Option::Some(v),
16740 _ => std::option::Option::None,
16741 })
16742 }
16743
16744 /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16745 /// to hold a `MysqlLogPosition`.
16746 ///
16747 /// Note that all the setters affecting `position` are
16748 /// mutually exclusive.
16749 ///
16750 /// # Example
16751 /// ```ignore,no_run
16752 /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16753 /// use google_cloud_datastream_v1::model::MysqlLogPosition;
16754 /// let x = SpecificStartPosition::new().set_mysql_log_position(MysqlLogPosition::default()/* use setters */);
16755 /// assert!(x.mysql_log_position().is_some());
16756 /// assert!(x.oracle_scn_position().is_none());
16757 /// assert!(x.sql_server_lsn_position().is_none());
16758 /// assert!(x.mysql_gtid_position().is_none());
16759 /// ```
16760 pub fn set_mysql_log_position<
16761 T: std::convert::Into<std::boxed::Box<crate::model::MysqlLogPosition>>,
16762 >(
16763 mut self,
16764 v: T,
16765 ) -> Self {
16766 self.position = std::option::Option::Some(
16767 crate::model::cdc_strategy::specific_start_position::Position::MysqlLogPosition(
16768 v.into(),
16769 ),
16770 );
16771 self
16772 }
16773
16774 /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16775 /// if it holds a `OracleScnPosition`, `None` if the field is not set or
16776 /// holds a different branch.
16777 pub fn oracle_scn_position(
16778 &self,
16779 ) -> std::option::Option<&std::boxed::Box<crate::model::OracleScnPosition>> {
16780 #[allow(unreachable_patterns)]
16781 self.position.as_ref().and_then(|v| match v {
16782 crate::model::cdc_strategy::specific_start_position::Position::OracleScnPosition(v) => std::option::Option::Some(v),
16783 _ => std::option::Option::None,
16784 })
16785 }
16786
16787 /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16788 /// to hold a `OracleScnPosition`.
16789 ///
16790 /// Note that all the setters affecting `position` are
16791 /// mutually exclusive.
16792 ///
16793 /// # Example
16794 /// ```ignore,no_run
16795 /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16796 /// use google_cloud_datastream_v1::model::OracleScnPosition;
16797 /// let x = SpecificStartPosition::new().set_oracle_scn_position(OracleScnPosition::default()/* use setters */);
16798 /// assert!(x.oracle_scn_position().is_some());
16799 /// assert!(x.mysql_log_position().is_none());
16800 /// assert!(x.sql_server_lsn_position().is_none());
16801 /// assert!(x.mysql_gtid_position().is_none());
16802 /// ```
16803 pub fn set_oracle_scn_position<
16804 T: std::convert::Into<std::boxed::Box<crate::model::OracleScnPosition>>,
16805 >(
16806 mut self,
16807 v: T,
16808 ) -> Self {
16809 self.position = std::option::Option::Some(
16810 crate::model::cdc_strategy::specific_start_position::Position::OracleScnPosition(
16811 v.into(),
16812 ),
16813 );
16814 self
16815 }
16816
16817 /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16818 /// if it holds a `SqlServerLsnPosition`, `None` if the field is not set or
16819 /// holds a different branch.
16820 pub fn sql_server_lsn_position(
16821 &self,
16822 ) -> std::option::Option<&std::boxed::Box<crate::model::SqlServerLsnPosition>> {
16823 #[allow(unreachable_patterns)]
16824 self.position.as_ref().and_then(|v| match v {
16825 crate::model::cdc_strategy::specific_start_position::Position::SqlServerLsnPosition(v) => std::option::Option::Some(v),
16826 _ => std::option::Option::None,
16827 })
16828 }
16829
16830 /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16831 /// to hold a `SqlServerLsnPosition`.
16832 ///
16833 /// Note that all the setters affecting `position` are
16834 /// mutually exclusive.
16835 ///
16836 /// # Example
16837 /// ```ignore,no_run
16838 /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16839 /// use google_cloud_datastream_v1::model::SqlServerLsnPosition;
16840 /// let x = SpecificStartPosition::new().set_sql_server_lsn_position(SqlServerLsnPosition::default()/* use setters */);
16841 /// assert!(x.sql_server_lsn_position().is_some());
16842 /// assert!(x.mysql_log_position().is_none());
16843 /// assert!(x.oracle_scn_position().is_none());
16844 /// assert!(x.mysql_gtid_position().is_none());
16845 /// ```
16846 pub fn set_sql_server_lsn_position<
16847 T: std::convert::Into<std::boxed::Box<crate::model::SqlServerLsnPosition>>,
16848 >(
16849 mut self,
16850 v: T,
16851 ) -> Self {
16852 self.position = std::option::Option::Some(
16853 crate::model::cdc_strategy::specific_start_position::Position::SqlServerLsnPosition(
16854 v.into(),
16855 ),
16856 );
16857 self
16858 }
16859
16860 /// The value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16861 /// if it holds a `MysqlGtidPosition`, `None` if the field is not set or
16862 /// holds a different branch.
16863 pub fn mysql_gtid_position(
16864 &self,
16865 ) -> std::option::Option<&std::boxed::Box<crate::model::MysqlGtidPosition>> {
16866 #[allow(unreachable_patterns)]
16867 self.position.as_ref().and_then(|v| match v {
16868 crate::model::cdc_strategy::specific_start_position::Position::MysqlGtidPosition(v) => std::option::Option::Some(v),
16869 _ => std::option::Option::None,
16870 })
16871 }
16872
16873 /// Sets the value of [position][crate::model::cdc_strategy::SpecificStartPosition::position]
16874 /// to hold a `MysqlGtidPosition`.
16875 ///
16876 /// Note that all the setters affecting `position` are
16877 /// mutually exclusive.
16878 ///
16879 /// # Example
16880 /// ```ignore,no_run
16881 /// # use google_cloud_datastream_v1::model::cdc_strategy::SpecificStartPosition;
16882 /// use google_cloud_datastream_v1::model::MysqlGtidPosition;
16883 /// let x = SpecificStartPosition::new().set_mysql_gtid_position(MysqlGtidPosition::default()/* use setters */);
16884 /// assert!(x.mysql_gtid_position().is_some());
16885 /// assert!(x.mysql_log_position().is_none());
16886 /// assert!(x.oracle_scn_position().is_none());
16887 /// assert!(x.sql_server_lsn_position().is_none());
16888 /// ```
16889 pub fn set_mysql_gtid_position<
16890 T: std::convert::Into<std::boxed::Box<crate::model::MysqlGtidPosition>>,
16891 >(
16892 mut self,
16893 v: T,
16894 ) -> Self {
16895 self.position = std::option::Option::Some(
16896 crate::model::cdc_strategy::specific_start_position::Position::MysqlGtidPosition(
16897 v.into(),
16898 ),
16899 );
16900 self
16901 }
16902 }
16903
16904 impl wkt::message::Message for SpecificStartPosition {
16905 fn typename() -> &'static str {
16906 "type.googleapis.com/google.cloud.datastream.v1.CdcStrategy.SpecificStartPosition"
16907 }
16908 }
16909
16910 /// Defines additional types related to [SpecificStartPosition].
16911 pub mod specific_start_position {
16912 #[allow(unused_imports)]
16913 use super::*;
16914
16915 #[allow(missing_docs)]
16916 #[derive(Clone, Debug, PartialEq)]
16917 #[non_exhaustive]
16918 pub enum Position {
16919 /// MySQL specific log position to start replicating from.
16920 MysqlLogPosition(std::boxed::Box<crate::model::MysqlLogPosition>),
16921 /// Oracle SCN to start replicating from.
16922 OracleScnPosition(std::boxed::Box<crate::model::OracleScnPosition>),
16923 /// SqlServer LSN to start replicating from.
16924 SqlServerLsnPosition(std::boxed::Box<crate::model::SqlServerLsnPosition>),
16925 /// MySQL GTID set to start replicating from.
16926 MysqlGtidPosition(std::boxed::Box<crate::model::MysqlGtidPosition>),
16927 }
16928 }
16929
16930 /// The position to start reading from when starting, resuming, or recovering
16931 /// the stream.
16932 /// If not set, the system's default value will be used.
16933 #[derive(Clone, Debug, PartialEq)]
16934 #[non_exhaustive]
16935 pub enum StartPosition {
16936 /// Optional. Start replicating from the most recent position in the source.
16937 MostRecentStartPosition(
16938 std::boxed::Box<crate::model::cdc_strategy::MostRecentStartPosition>,
16939 ),
16940 /// Optional. Resume replication from the next available position in the
16941 /// source.
16942 NextAvailableStartPosition(
16943 std::boxed::Box<crate::model::cdc_strategy::NextAvailableStartPosition>,
16944 ),
16945 /// Optional. Start replicating from a specific position in the source.
16946 SpecificStartPosition(std::boxed::Box<crate::model::cdc_strategy::SpecificStartPosition>),
16947 }
16948}
16949
16950/// SQL Server LSN position
16951#[derive(Clone, Default, PartialEq)]
16952#[non_exhaustive]
16953pub struct SqlServerLsnPosition {
16954 /// Required. Log sequence number (LSN) from where Logs will be read
16955 pub lsn: std::string::String,
16956
16957 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16958}
16959
16960impl SqlServerLsnPosition {
16961 /// Creates a new default instance.
16962 pub fn new() -> Self {
16963 std::default::Default::default()
16964 }
16965
16966 /// Sets the value of [lsn][crate::model::SqlServerLsnPosition::lsn].
16967 ///
16968 /// # Example
16969 /// ```ignore,no_run
16970 /// # use google_cloud_datastream_v1::model::SqlServerLsnPosition;
16971 /// let x = SqlServerLsnPosition::new().set_lsn("example");
16972 /// ```
16973 pub fn set_lsn<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16974 self.lsn = v.into();
16975 self
16976 }
16977}
16978
16979impl wkt::message::Message for SqlServerLsnPosition {
16980 fn typename() -> &'static str {
16981 "type.googleapis.com/google.cloud.datastream.v1.SqlServerLsnPosition"
16982 }
16983}
16984
16985/// Oracle SCN position
16986#[derive(Clone, Default, PartialEq)]
16987#[non_exhaustive]
16988pub struct OracleScnPosition {
16989 /// Required. SCN number from where Logs will be read
16990 pub scn: i64,
16991
16992 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16993}
16994
16995impl OracleScnPosition {
16996 /// Creates a new default instance.
16997 pub fn new() -> Self {
16998 std::default::Default::default()
16999 }
17000
17001 /// Sets the value of [scn][crate::model::OracleScnPosition::scn].
17002 ///
17003 /// # Example
17004 /// ```ignore,no_run
17005 /// # use google_cloud_datastream_v1::model::OracleScnPosition;
17006 /// let x = OracleScnPosition::new().set_scn(42);
17007 /// ```
17008 pub fn set_scn<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
17009 self.scn = v.into();
17010 self
17011 }
17012}
17013
17014impl wkt::message::Message for OracleScnPosition {
17015 fn typename() -> &'static str {
17016 "type.googleapis.com/google.cloud.datastream.v1.OracleScnPosition"
17017 }
17018}
17019
17020/// MySQL log position
17021#[derive(Clone, Default, PartialEq)]
17022#[non_exhaustive]
17023pub struct MysqlLogPosition {
17024 /// Required. The binary log file name.
17025 pub log_file: std::string::String,
17026
17027 /// Optional. The position within the binary log file. Default is head of file.
17028 pub log_position: std::option::Option<i32>,
17029
17030 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17031}
17032
17033impl MysqlLogPosition {
17034 /// Creates a new default instance.
17035 pub fn new() -> Self {
17036 std::default::Default::default()
17037 }
17038
17039 /// Sets the value of [log_file][crate::model::MysqlLogPosition::log_file].
17040 ///
17041 /// # Example
17042 /// ```ignore,no_run
17043 /// # use google_cloud_datastream_v1::model::MysqlLogPosition;
17044 /// let x = MysqlLogPosition::new().set_log_file("example");
17045 /// ```
17046 pub fn set_log_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17047 self.log_file = v.into();
17048 self
17049 }
17050
17051 /// Sets the value of [log_position][crate::model::MysqlLogPosition::log_position].
17052 ///
17053 /// # Example
17054 /// ```ignore,no_run
17055 /// # use google_cloud_datastream_v1::model::MysqlLogPosition;
17056 /// let x = MysqlLogPosition::new().set_log_position(42);
17057 /// ```
17058 pub fn set_log_position<T>(mut self, v: T) -> Self
17059 where
17060 T: std::convert::Into<i32>,
17061 {
17062 self.log_position = std::option::Option::Some(v.into());
17063 self
17064 }
17065
17066 /// Sets or clears the value of [log_position][crate::model::MysqlLogPosition::log_position].
17067 ///
17068 /// # Example
17069 /// ```ignore,no_run
17070 /// # use google_cloud_datastream_v1::model::MysqlLogPosition;
17071 /// let x = MysqlLogPosition::new().set_or_clear_log_position(Some(42));
17072 /// let x = MysqlLogPosition::new().set_or_clear_log_position(None::<i32>);
17073 /// ```
17074 pub fn set_or_clear_log_position<T>(mut self, v: std::option::Option<T>) -> Self
17075 where
17076 T: std::convert::Into<i32>,
17077 {
17078 self.log_position = v.map(|x| x.into());
17079 self
17080 }
17081}
17082
17083impl wkt::message::Message for MysqlLogPosition {
17084 fn typename() -> &'static str {
17085 "type.googleapis.com/google.cloud.datastream.v1.MysqlLogPosition"
17086 }
17087}
17088
17089/// MySQL GTID position
17090#[derive(Clone, Default, PartialEq)]
17091#[non_exhaustive]
17092pub struct MysqlGtidPosition {
17093 /// Required. The gtid set to start replication from.
17094 pub gtid_set: std::string::String,
17095
17096 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17097}
17098
17099impl MysqlGtidPosition {
17100 /// Creates a new default instance.
17101 pub fn new() -> Self {
17102 std::default::Default::default()
17103 }
17104
17105 /// Sets the value of [gtid_set][crate::model::MysqlGtidPosition::gtid_set].
17106 ///
17107 /// # Example
17108 /// ```ignore,no_run
17109 /// # use google_cloud_datastream_v1::model::MysqlGtidPosition;
17110 /// let x = MysqlGtidPosition::new().set_gtid_set("example");
17111 /// ```
17112 pub fn set_gtid_set<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17113 self.gtid_set = v.into();
17114 self
17115 }
17116}
17117
17118impl wkt::message::Message for MysqlGtidPosition {
17119 fn typename() -> &'static str {
17120 "type.googleapis.com/google.cloud.datastream.v1.MysqlGtidPosition"
17121 }
17122}