google_cloud_bigquery_connection_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate lazy_static;
26extern crate serde;
27extern crate serde_json;
28extern crate serde_with;
29extern crate std;
30extern crate tracing;
31extern crate wkt;
32
33mod debug;
34mod deserialize;
35mod serialize;
36
37/// The request for
38/// [ConnectionService.CreateConnection][google.cloud.bigquery.connection.v1.ConnectionService.CreateConnection].
39///
40/// [google.cloud.bigquery.connection.v1.ConnectionService.CreateConnection]: crate::client::ConnectionService::create_connection
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct CreateConnectionRequest {
44 /// Required. Parent resource name.
45 /// Must be in the format `projects/{project_id}/locations/{location_id}`
46 pub parent: std::string::String,
47
48 /// Optional. Connection id that should be assigned to the created connection.
49 pub connection_id: std::string::String,
50
51 /// Required. Connection to create.
52 pub connection: std::option::Option<crate::model::Connection>,
53
54 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
55}
56
57impl CreateConnectionRequest {
58 pub fn new() -> Self {
59 std::default::Default::default()
60 }
61
62 /// Sets the value of [parent][crate::model::CreateConnectionRequest::parent].
63 ///
64 /// # Example
65 /// ```ignore,no_run
66 /// # use google_cloud_bigquery_connection_v1::model::CreateConnectionRequest;
67 /// let x = CreateConnectionRequest::new().set_parent("example");
68 /// ```
69 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
70 self.parent = v.into();
71 self
72 }
73
74 /// Sets the value of [connection_id][crate::model::CreateConnectionRequest::connection_id].
75 ///
76 /// # Example
77 /// ```ignore,no_run
78 /// # use google_cloud_bigquery_connection_v1::model::CreateConnectionRequest;
79 /// let x = CreateConnectionRequest::new().set_connection_id("example");
80 /// ```
81 pub fn set_connection_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
82 self.connection_id = v.into();
83 self
84 }
85
86 /// Sets the value of [connection][crate::model::CreateConnectionRequest::connection].
87 ///
88 /// # Example
89 /// ```ignore,no_run
90 /// # use google_cloud_bigquery_connection_v1::model::CreateConnectionRequest;
91 /// use google_cloud_bigquery_connection_v1::model::Connection;
92 /// let x = CreateConnectionRequest::new().set_connection(Connection::default()/* use setters */);
93 /// ```
94 pub fn set_connection<T>(mut self, v: T) -> Self
95 where
96 T: std::convert::Into<crate::model::Connection>,
97 {
98 self.connection = std::option::Option::Some(v.into());
99 self
100 }
101
102 /// Sets or clears the value of [connection][crate::model::CreateConnectionRequest::connection].
103 ///
104 /// # Example
105 /// ```ignore,no_run
106 /// # use google_cloud_bigquery_connection_v1::model::CreateConnectionRequest;
107 /// use google_cloud_bigquery_connection_v1::model::Connection;
108 /// let x = CreateConnectionRequest::new().set_or_clear_connection(Some(Connection::default()/* use setters */));
109 /// let x = CreateConnectionRequest::new().set_or_clear_connection(None::<Connection>);
110 /// ```
111 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
112 where
113 T: std::convert::Into<crate::model::Connection>,
114 {
115 self.connection = v.map(|x| x.into());
116 self
117 }
118}
119
120impl wkt::message::Message for CreateConnectionRequest {
121 fn typename() -> &'static str {
122 "type.googleapis.com/google.cloud.bigquery.connection.v1.CreateConnectionRequest"
123 }
124}
125
126/// The request for
127/// [ConnectionService.GetConnection][google.cloud.bigquery.connection.v1.ConnectionService.GetConnection].
128///
129/// [google.cloud.bigquery.connection.v1.ConnectionService.GetConnection]: crate::client::ConnectionService::get_connection
130#[derive(Clone, Default, PartialEq)]
131#[non_exhaustive]
132pub struct GetConnectionRequest {
133 /// Required. Name of the requested connection, for example:
134 /// `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
135 pub name: std::string::String,
136
137 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
138}
139
140impl GetConnectionRequest {
141 pub fn new() -> Self {
142 std::default::Default::default()
143 }
144
145 /// Sets the value of [name][crate::model::GetConnectionRequest::name].
146 ///
147 /// # Example
148 /// ```ignore,no_run
149 /// # use google_cloud_bigquery_connection_v1::model::GetConnectionRequest;
150 /// let x = GetConnectionRequest::new().set_name("example");
151 /// ```
152 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
153 self.name = v.into();
154 self
155 }
156}
157
158impl wkt::message::Message for GetConnectionRequest {
159 fn typename() -> &'static str {
160 "type.googleapis.com/google.cloud.bigquery.connection.v1.GetConnectionRequest"
161 }
162}
163
164/// The request for
165/// [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1.ConnectionService.ListConnections].
166///
167/// [google.cloud.bigquery.connection.v1.ConnectionService.ListConnections]: crate::client::ConnectionService::list_connections
168#[derive(Clone, Default, PartialEq)]
169#[non_exhaustive]
170pub struct ListConnectionsRequest {
171 /// Required. Parent resource name.
172 /// Must be in the form: `projects/{project_id}/locations/{location_id}`
173 pub parent: std::string::String,
174
175 /// Required. Page size.
176 pub page_size: i32,
177
178 /// Page token.
179 pub page_token: std::string::String,
180
181 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
182}
183
184impl ListConnectionsRequest {
185 pub fn new() -> Self {
186 std::default::Default::default()
187 }
188
189 /// Sets the value of [parent][crate::model::ListConnectionsRequest::parent].
190 ///
191 /// # Example
192 /// ```ignore,no_run
193 /// # use google_cloud_bigquery_connection_v1::model::ListConnectionsRequest;
194 /// let x = ListConnectionsRequest::new().set_parent("example");
195 /// ```
196 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
197 self.parent = v.into();
198 self
199 }
200
201 /// Sets the value of [page_size][crate::model::ListConnectionsRequest::page_size].
202 ///
203 /// # Example
204 /// ```ignore,no_run
205 /// # use google_cloud_bigquery_connection_v1::model::ListConnectionsRequest;
206 /// let x = ListConnectionsRequest::new().set_page_size(42);
207 /// ```
208 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
209 self.page_size = v.into();
210 self
211 }
212
213 /// Sets the value of [page_token][crate::model::ListConnectionsRequest::page_token].
214 ///
215 /// # Example
216 /// ```ignore,no_run
217 /// # use google_cloud_bigquery_connection_v1::model::ListConnectionsRequest;
218 /// let x = ListConnectionsRequest::new().set_page_token("example");
219 /// ```
220 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
221 self.page_token = v.into();
222 self
223 }
224}
225
226impl wkt::message::Message for ListConnectionsRequest {
227 fn typename() -> &'static str {
228 "type.googleapis.com/google.cloud.bigquery.connection.v1.ListConnectionsRequest"
229 }
230}
231
232/// The response for
233/// [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1.ConnectionService.ListConnections].
234///
235/// [google.cloud.bigquery.connection.v1.ConnectionService.ListConnections]: crate::client::ConnectionService::list_connections
236#[derive(Clone, Default, PartialEq)]
237#[non_exhaustive]
238pub struct ListConnectionsResponse {
239 /// Next page token.
240 pub next_page_token: std::string::String,
241
242 /// List of connections.
243 pub connections: std::vec::Vec<crate::model::Connection>,
244
245 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
246}
247
248impl ListConnectionsResponse {
249 pub fn new() -> Self {
250 std::default::Default::default()
251 }
252
253 /// Sets the value of [next_page_token][crate::model::ListConnectionsResponse::next_page_token].
254 ///
255 /// # Example
256 /// ```ignore,no_run
257 /// # use google_cloud_bigquery_connection_v1::model::ListConnectionsResponse;
258 /// let x = ListConnectionsResponse::new().set_next_page_token("example");
259 /// ```
260 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
261 self.next_page_token = v.into();
262 self
263 }
264
265 /// Sets the value of [connections][crate::model::ListConnectionsResponse::connections].
266 ///
267 /// # Example
268 /// ```ignore,no_run
269 /// # use google_cloud_bigquery_connection_v1::model::ListConnectionsResponse;
270 /// use google_cloud_bigquery_connection_v1::model::Connection;
271 /// let x = ListConnectionsResponse::new()
272 /// .set_connections([
273 /// Connection::default()/* use setters */,
274 /// Connection::default()/* use (different) setters */,
275 /// ]);
276 /// ```
277 pub fn set_connections<T, V>(mut self, v: T) -> Self
278 where
279 T: std::iter::IntoIterator<Item = V>,
280 V: std::convert::Into<crate::model::Connection>,
281 {
282 use std::iter::Iterator;
283 self.connections = v.into_iter().map(|i| i.into()).collect();
284 self
285 }
286}
287
288impl wkt::message::Message for ListConnectionsResponse {
289 fn typename() -> &'static str {
290 "type.googleapis.com/google.cloud.bigquery.connection.v1.ListConnectionsResponse"
291 }
292}
293
294#[doc(hidden)]
295impl google_cloud_gax::paginator::internal::PageableResponse for ListConnectionsResponse {
296 type PageItem = crate::model::Connection;
297
298 fn items(self) -> std::vec::Vec<Self::PageItem> {
299 self.connections
300 }
301
302 fn next_page_token(&self) -> std::string::String {
303 use std::clone::Clone;
304 self.next_page_token.clone()
305 }
306}
307
308/// The request for
309/// [ConnectionService.UpdateConnection][google.cloud.bigquery.connection.v1.ConnectionService.UpdateConnection].
310///
311/// [google.cloud.bigquery.connection.v1.ConnectionService.UpdateConnection]: crate::client::ConnectionService::update_connection
312#[derive(Clone, Default, PartialEq)]
313#[non_exhaustive]
314pub struct UpdateConnectionRequest {
315 /// Required. Name of the connection to update, for example:
316 /// `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
317 pub name: std::string::String,
318
319 /// Required. Connection containing the updated fields.
320 pub connection: std::option::Option<crate::model::Connection>,
321
322 /// Required. Update mask for the connection fields to be updated.
323 pub update_mask: std::option::Option<wkt::FieldMask>,
324
325 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
326}
327
328impl UpdateConnectionRequest {
329 pub fn new() -> Self {
330 std::default::Default::default()
331 }
332
333 /// Sets the value of [name][crate::model::UpdateConnectionRequest::name].
334 ///
335 /// # Example
336 /// ```ignore,no_run
337 /// # use google_cloud_bigquery_connection_v1::model::UpdateConnectionRequest;
338 /// let x = UpdateConnectionRequest::new().set_name("example");
339 /// ```
340 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
341 self.name = v.into();
342 self
343 }
344
345 /// Sets the value of [connection][crate::model::UpdateConnectionRequest::connection].
346 ///
347 /// # Example
348 /// ```ignore,no_run
349 /// # use google_cloud_bigquery_connection_v1::model::UpdateConnectionRequest;
350 /// use google_cloud_bigquery_connection_v1::model::Connection;
351 /// let x = UpdateConnectionRequest::new().set_connection(Connection::default()/* use setters */);
352 /// ```
353 pub fn set_connection<T>(mut self, v: T) -> Self
354 where
355 T: std::convert::Into<crate::model::Connection>,
356 {
357 self.connection = std::option::Option::Some(v.into());
358 self
359 }
360
361 /// Sets or clears the value of [connection][crate::model::UpdateConnectionRequest::connection].
362 ///
363 /// # Example
364 /// ```ignore,no_run
365 /// # use google_cloud_bigquery_connection_v1::model::UpdateConnectionRequest;
366 /// use google_cloud_bigquery_connection_v1::model::Connection;
367 /// let x = UpdateConnectionRequest::new().set_or_clear_connection(Some(Connection::default()/* use setters */));
368 /// let x = UpdateConnectionRequest::new().set_or_clear_connection(None::<Connection>);
369 /// ```
370 pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
371 where
372 T: std::convert::Into<crate::model::Connection>,
373 {
374 self.connection = v.map(|x| x.into());
375 self
376 }
377
378 /// Sets the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
379 ///
380 /// # Example
381 /// ```ignore,no_run
382 /// # use google_cloud_bigquery_connection_v1::model::UpdateConnectionRequest;
383 /// use wkt::FieldMask;
384 /// let x = UpdateConnectionRequest::new().set_update_mask(FieldMask::default()/* use setters */);
385 /// ```
386 pub fn set_update_mask<T>(mut self, v: T) -> Self
387 where
388 T: std::convert::Into<wkt::FieldMask>,
389 {
390 self.update_mask = std::option::Option::Some(v.into());
391 self
392 }
393
394 /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
395 ///
396 /// # Example
397 /// ```ignore,no_run
398 /// # use google_cloud_bigquery_connection_v1::model::UpdateConnectionRequest;
399 /// use wkt::FieldMask;
400 /// let x = UpdateConnectionRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
401 /// let x = UpdateConnectionRequest::new().set_or_clear_update_mask(None::<FieldMask>);
402 /// ```
403 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
404 where
405 T: std::convert::Into<wkt::FieldMask>,
406 {
407 self.update_mask = v.map(|x| x.into());
408 self
409 }
410}
411
412impl wkt::message::Message for UpdateConnectionRequest {
413 fn typename() -> &'static str {
414 "type.googleapis.com/google.cloud.bigquery.connection.v1.UpdateConnectionRequest"
415 }
416}
417
418/// The request for [ConnectionService.DeleteConnectionRequest][].
419#[derive(Clone, Default, PartialEq)]
420#[non_exhaustive]
421pub struct DeleteConnectionRequest {
422 /// Required. Name of the deleted connection, for example:
423 /// `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
424 pub name: std::string::String,
425
426 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
427}
428
429impl DeleteConnectionRequest {
430 pub fn new() -> Self {
431 std::default::Default::default()
432 }
433
434 /// Sets the value of [name][crate::model::DeleteConnectionRequest::name].
435 ///
436 /// # Example
437 /// ```ignore,no_run
438 /// # use google_cloud_bigquery_connection_v1::model::DeleteConnectionRequest;
439 /// let x = DeleteConnectionRequest::new().set_name("example");
440 /// ```
441 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
442 self.name = v.into();
443 self
444 }
445}
446
447impl wkt::message::Message for DeleteConnectionRequest {
448 fn typename() -> &'static str {
449 "type.googleapis.com/google.cloud.bigquery.connection.v1.DeleteConnectionRequest"
450 }
451}
452
453/// Configuration parameters to establish connection with an external data
454/// source, except the credential attributes.
455#[derive(Clone, Default, PartialEq)]
456#[non_exhaustive]
457pub struct Connection {
458 /// The resource name of the connection in the form of:
459 /// `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
460 pub name: std::string::String,
461
462 /// User provided display name for the connection.
463 pub friendly_name: std::string::String,
464
465 /// User provided description.
466 pub description: std::string::String,
467
468 /// Output only. The creation timestamp of the connection.
469 pub creation_time: i64,
470
471 /// Output only. The last update timestamp of the connection.
472 pub last_modified_time: i64,
473
474 /// Output only. True, if credential is configured for this connection.
475 pub has_credential: bool,
476
477 /// Properties specific to the underlying data source.
478 pub properties: std::option::Option<crate::model::connection::Properties>,
479
480 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
481}
482
483impl Connection {
484 pub fn new() -> Self {
485 std::default::Default::default()
486 }
487
488 /// Sets the value of [name][crate::model::Connection::name].
489 ///
490 /// # Example
491 /// ```ignore,no_run
492 /// # use google_cloud_bigquery_connection_v1::model::Connection;
493 /// let x = Connection::new().set_name("example");
494 /// ```
495 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
496 self.name = v.into();
497 self
498 }
499
500 /// Sets the value of [friendly_name][crate::model::Connection::friendly_name].
501 ///
502 /// # Example
503 /// ```ignore,no_run
504 /// # use google_cloud_bigquery_connection_v1::model::Connection;
505 /// let x = Connection::new().set_friendly_name("example");
506 /// ```
507 pub fn set_friendly_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
508 self.friendly_name = v.into();
509 self
510 }
511
512 /// Sets the value of [description][crate::model::Connection::description].
513 ///
514 /// # Example
515 /// ```ignore,no_run
516 /// # use google_cloud_bigquery_connection_v1::model::Connection;
517 /// let x = Connection::new().set_description("example");
518 /// ```
519 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
520 self.description = v.into();
521 self
522 }
523
524 /// Sets the value of [creation_time][crate::model::Connection::creation_time].
525 ///
526 /// # Example
527 /// ```ignore,no_run
528 /// # use google_cloud_bigquery_connection_v1::model::Connection;
529 /// let x = Connection::new().set_creation_time(42);
530 /// ```
531 pub fn set_creation_time<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
532 self.creation_time = v.into();
533 self
534 }
535
536 /// Sets the value of [last_modified_time][crate::model::Connection::last_modified_time].
537 ///
538 /// # Example
539 /// ```ignore,no_run
540 /// # use google_cloud_bigquery_connection_v1::model::Connection;
541 /// let x = Connection::new().set_last_modified_time(42);
542 /// ```
543 pub fn set_last_modified_time<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
544 self.last_modified_time = v.into();
545 self
546 }
547
548 /// Sets the value of [has_credential][crate::model::Connection::has_credential].
549 ///
550 /// # Example
551 /// ```ignore,no_run
552 /// # use google_cloud_bigquery_connection_v1::model::Connection;
553 /// let x = Connection::new().set_has_credential(true);
554 /// ```
555 pub fn set_has_credential<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
556 self.has_credential = v.into();
557 self
558 }
559
560 /// Sets the value of [properties][crate::model::Connection::properties].
561 ///
562 /// Note that all the setters affecting `properties` are mutually
563 /// exclusive.
564 ///
565 /// # Example
566 /// ```ignore,no_run
567 /// # use google_cloud_bigquery_connection_v1::model::Connection;
568 /// use google_cloud_bigquery_connection_v1::model::CloudSqlProperties;
569 /// let x = Connection::new().set_properties(Some(
570 /// google_cloud_bigquery_connection_v1::model::connection::Properties::CloudSql(CloudSqlProperties::default().into())));
571 /// ```
572 pub fn set_properties<
573 T: std::convert::Into<std::option::Option<crate::model::connection::Properties>>,
574 >(
575 mut self,
576 v: T,
577 ) -> Self {
578 self.properties = v.into();
579 self
580 }
581
582 /// The value of [properties][crate::model::Connection::properties]
583 /// if it holds a `CloudSql`, `None` if the field is not set or
584 /// holds a different branch.
585 pub fn cloud_sql(
586 &self,
587 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudSqlProperties>> {
588 #[allow(unreachable_patterns)]
589 self.properties.as_ref().and_then(|v| match v {
590 crate::model::connection::Properties::CloudSql(v) => std::option::Option::Some(v),
591 _ => std::option::Option::None,
592 })
593 }
594
595 /// Sets the value of [properties][crate::model::Connection::properties]
596 /// to hold a `CloudSql`.
597 ///
598 /// Note that all the setters affecting `properties` are
599 /// mutually exclusive.
600 ///
601 /// # Example
602 /// ```ignore,no_run
603 /// # use google_cloud_bigquery_connection_v1::model::Connection;
604 /// use google_cloud_bigquery_connection_v1::model::CloudSqlProperties;
605 /// let x = Connection::new().set_cloud_sql(CloudSqlProperties::default()/* use setters */);
606 /// assert!(x.cloud_sql().is_some());
607 /// assert!(x.aws().is_none());
608 /// assert!(x.azure().is_none());
609 /// assert!(x.cloud_spanner().is_none());
610 /// assert!(x.cloud_resource().is_none());
611 /// assert!(x.spark().is_none());
612 /// assert!(x.salesforce_data_cloud().is_none());
613 /// ```
614 pub fn set_cloud_sql<
615 T: std::convert::Into<std::boxed::Box<crate::model::CloudSqlProperties>>,
616 >(
617 mut self,
618 v: T,
619 ) -> Self {
620 self.properties =
621 std::option::Option::Some(crate::model::connection::Properties::CloudSql(v.into()));
622 self
623 }
624
625 /// The value of [properties][crate::model::Connection::properties]
626 /// if it holds a `Aws`, `None` if the field is not set or
627 /// holds a different branch.
628 pub fn aws(&self) -> std::option::Option<&std::boxed::Box<crate::model::AwsProperties>> {
629 #[allow(unreachable_patterns)]
630 self.properties.as_ref().and_then(|v| match v {
631 crate::model::connection::Properties::Aws(v) => std::option::Option::Some(v),
632 _ => std::option::Option::None,
633 })
634 }
635
636 /// Sets the value of [properties][crate::model::Connection::properties]
637 /// to hold a `Aws`.
638 ///
639 /// Note that all the setters affecting `properties` are
640 /// mutually exclusive.
641 ///
642 /// # Example
643 /// ```ignore,no_run
644 /// # use google_cloud_bigquery_connection_v1::model::Connection;
645 /// use google_cloud_bigquery_connection_v1::model::AwsProperties;
646 /// let x = Connection::new().set_aws(AwsProperties::default()/* use setters */);
647 /// assert!(x.aws().is_some());
648 /// assert!(x.cloud_sql().is_none());
649 /// assert!(x.azure().is_none());
650 /// assert!(x.cloud_spanner().is_none());
651 /// assert!(x.cloud_resource().is_none());
652 /// assert!(x.spark().is_none());
653 /// assert!(x.salesforce_data_cloud().is_none());
654 /// ```
655 pub fn set_aws<T: std::convert::Into<std::boxed::Box<crate::model::AwsProperties>>>(
656 mut self,
657 v: T,
658 ) -> Self {
659 self.properties =
660 std::option::Option::Some(crate::model::connection::Properties::Aws(v.into()));
661 self
662 }
663
664 /// The value of [properties][crate::model::Connection::properties]
665 /// if it holds a `Azure`, `None` if the field is not set or
666 /// holds a different branch.
667 pub fn azure(&self) -> std::option::Option<&std::boxed::Box<crate::model::AzureProperties>> {
668 #[allow(unreachable_patterns)]
669 self.properties.as_ref().and_then(|v| match v {
670 crate::model::connection::Properties::Azure(v) => std::option::Option::Some(v),
671 _ => std::option::Option::None,
672 })
673 }
674
675 /// Sets the value of [properties][crate::model::Connection::properties]
676 /// to hold a `Azure`.
677 ///
678 /// Note that all the setters affecting `properties` are
679 /// mutually exclusive.
680 ///
681 /// # Example
682 /// ```ignore,no_run
683 /// # use google_cloud_bigquery_connection_v1::model::Connection;
684 /// use google_cloud_bigquery_connection_v1::model::AzureProperties;
685 /// let x = Connection::new().set_azure(AzureProperties::default()/* use setters */);
686 /// assert!(x.azure().is_some());
687 /// assert!(x.cloud_sql().is_none());
688 /// assert!(x.aws().is_none());
689 /// assert!(x.cloud_spanner().is_none());
690 /// assert!(x.cloud_resource().is_none());
691 /// assert!(x.spark().is_none());
692 /// assert!(x.salesforce_data_cloud().is_none());
693 /// ```
694 pub fn set_azure<T: std::convert::Into<std::boxed::Box<crate::model::AzureProperties>>>(
695 mut self,
696 v: T,
697 ) -> Self {
698 self.properties =
699 std::option::Option::Some(crate::model::connection::Properties::Azure(v.into()));
700 self
701 }
702
703 /// The value of [properties][crate::model::Connection::properties]
704 /// if it holds a `CloudSpanner`, `None` if the field is not set or
705 /// holds a different branch.
706 pub fn cloud_spanner(
707 &self,
708 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudSpannerProperties>> {
709 #[allow(unreachable_patterns)]
710 self.properties.as_ref().and_then(|v| match v {
711 crate::model::connection::Properties::CloudSpanner(v) => std::option::Option::Some(v),
712 _ => std::option::Option::None,
713 })
714 }
715
716 /// Sets the value of [properties][crate::model::Connection::properties]
717 /// to hold a `CloudSpanner`.
718 ///
719 /// Note that all the setters affecting `properties` are
720 /// mutually exclusive.
721 ///
722 /// # Example
723 /// ```ignore,no_run
724 /// # use google_cloud_bigquery_connection_v1::model::Connection;
725 /// use google_cloud_bigquery_connection_v1::model::CloudSpannerProperties;
726 /// let x = Connection::new().set_cloud_spanner(CloudSpannerProperties::default()/* use setters */);
727 /// assert!(x.cloud_spanner().is_some());
728 /// assert!(x.cloud_sql().is_none());
729 /// assert!(x.aws().is_none());
730 /// assert!(x.azure().is_none());
731 /// assert!(x.cloud_resource().is_none());
732 /// assert!(x.spark().is_none());
733 /// assert!(x.salesforce_data_cloud().is_none());
734 /// ```
735 pub fn set_cloud_spanner<
736 T: std::convert::Into<std::boxed::Box<crate::model::CloudSpannerProperties>>,
737 >(
738 mut self,
739 v: T,
740 ) -> Self {
741 self.properties =
742 std::option::Option::Some(crate::model::connection::Properties::CloudSpanner(v.into()));
743 self
744 }
745
746 /// The value of [properties][crate::model::Connection::properties]
747 /// if it holds a `CloudResource`, `None` if the field is not set or
748 /// holds a different branch.
749 pub fn cloud_resource(
750 &self,
751 ) -> std::option::Option<&std::boxed::Box<crate::model::CloudResourceProperties>> {
752 #[allow(unreachable_patterns)]
753 self.properties.as_ref().and_then(|v| match v {
754 crate::model::connection::Properties::CloudResource(v) => std::option::Option::Some(v),
755 _ => std::option::Option::None,
756 })
757 }
758
759 /// Sets the value of [properties][crate::model::Connection::properties]
760 /// to hold a `CloudResource`.
761 ///
762 /// Note that all the setters affecting `properties` are
763 /// mutually exclusive.
764 ///
765 /// # Example
766 /// ```ignore,no_run
767 /// # use google_cloud_bigquery_connection_v1::model::Connection;
768 /// use google_cloud_bigquery_connection_v1::model::CloudResourceProperties;
769 /// let x = Connection::new().set_cloud_resource(CloudResourceProperties::default()/* use setters */);
770 /// assert!(x.cloud_resource().is_some());
771 /// assert!(x.cloud_sql().is_none());
772 /// assert!(x.aws().is_none());
773 /// assert!(x.azure().is_none());
774 /// assert!(x.cloud_spanner().is_none());
775 /// assert!(x.spark().is_none());
776 /// assert!(x.salesforce_data_cloud().is_none());
777 /// ```
778 pub fn set_cloud_resource<
779 T: std::convert::Into<std::boxed::Box<crate::model::CloudResourceProperties>>,
780 >(
781 mut self,
782 v: T,
783 ) -> Self {
784 self.properties = std::option::Option::Some(
785 crate::model::connection::Properties::CloudResource(v.into()),
786 );
787 self
788 }
789
790 /// The value of [properties][crate::model::Connection::properties]
791 /// if it holds a `Spark`, `None` if the field is not set or
792 /// holds a different branch.
793 pub fn spark(&self) -> std::option::Option<&std::boxed::Box<crate::model::SparkProperties>> {
794 #[allow(unreachable_patterns)]
795 self.properties.as_ref().and_then(|v| match v {
796 crate::model::connection::Properties::Spark(v) => std::option::Option::Some(v),
797 _ => std::option::Option::None,
798 })
799 }
800
801 /// Sets the value of [properties][crate::model::Connection::properties]
802 /// to hold a `Spark`.
803 ///
804 /// Note that all the setters affecting `properties` are
805 /// mutually exclusive.
806 ///
807 /// # Example
808 /// ```ignore,no_run
809 /// # use google_cloud_bigquery_connection_v1::model::Connection;
810 /// use google_cloud_bigquery_connection_v1::model::SparkProperties;
811 /// let x = Connection::new().set_spark(SparkProperties::default()/* use setters */);
812 /// assert!(x.spark().is_some());
813 /// assert!(x.cloud_sql().is_none());
814 /// assert!(x.aws().is_none());
815 /// assert!(x.azure().is_none());
816 /// assert!(x.cloud_spanner().is_none());
817 /// assert!(x.cloud_resource().is_none());
818 /// assert!(x.salesforce_data_cloud().is_none());
819 /// ```
820 pub fn set_spark<T: std::convert::Into<std::boxed::Box<crate::model::SparkProperties>>>(
821 mut self,
822 v: T,
823 ) -> Self {
824 self.properties =
825 std::option::Option::Some(crate::model::connection::Properties::Spark(v.into()));
826 self
827 }
828
829 /// The value of [properties][crate::model::Connection::properties]
830 /// if it holds a `SalesforceDataCloud`, `None` if the field is not set or
831 /// holds a different branch.
832 pub fn salesforce_data_cloud(
833 &self,
834 ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceDataCloudProperties>> {
835 #[allow(unreachable_patterns)]
836 self.properties.as_ref().and_then(|v| match v {
837 crate::model::connection::Properties::SalesforceDataCloud(v) => {
838 std::option::Option::Some(v)
839 }
840 _ => std::option::Option::None,
841 })
842 }
843
844 /// Sets the value of [properties][crate::model::Connection::properties]
845 /// to hold a `SalesforceDataCloud`.
846 ///
847 /// Note that all the setters affecting `properties` are
848 /// mutually exclusive.
849 ///
850 /// # Example
851 /// ```ignore,no_run
852 /// # use google_cloud_bigquery_connection_v1::model::Connection;
853 /// use google_cloud_bigquery_connection_v1::model::SalesforceDataCloudProperties;
854 /// let x = Connection::new().set_salesforce_data_cloud(SalesforceDataCloudProperties::default()/* use setters */);
855 /// assert!(x.salesforce_data_cloud().is_some());
856 /// assert!(x.cloud_sql().is_none());
857 /// assert!(x.aws().is_none());
858 /// assert!(x.azure().is_none());
859 /// assert!(x.cloud_spanner().is_none());
860 /// assert!(x.cloud_resource().is_none());
861 /// assert!(x.spark().is_none());
862 /// ```
863 pub fn set_salesforce_data_cloud<
864 T: std::convert::Into<std::boxed::Box<crate::model::SalesforceDataCloudProperties>>,
865 >(
866 mut self,
867 v: T,
868 ) -> Self {
869 self.properties = std::option::Option::Some(
870 crate::model::connection::Properties::SalesforceDataCloud(v.into()),
871 );
872 self
873 }
874}
875
876impl wkt::message::Message for Connection {
877 fn typename() -> &'static str {
878 "type.googleapis.com/google.cloud.bigquery.connection.v1.Connection"
879 }
880}
881
882/// Defines additional types related to [Connection].
883pub mod connection {
884 #[allow(unused_imports)]
885 use super::*;
886
887 /// Properties specific to the underlying data source.
888 #[derive(Clone, Debug, PartialEq)]
889 #[non_exhaustive]
890 pub enum Properties {
891 /// Cloud SQL properties.
892 CloudSql(std::boxed::Box<crate::model::CloudSqlProperties>),
893 /// Amazon Web Services (AWS) properties.
894 Aws(std::boxed::Box<crate::model::AwsProperties>),
895 /// Azure properties.
896 Azure(std::boxed::Box<crate::model::AzureProperties>),
897 /// Cloud Spanner properties.
898 CloudSpanner(std::boxed::Box<crate::model::CloudSpannerProperties>),
899 /// Cloud Resource properties.
900 CloudResource(std::boxed::Box<crate::model::CloudResourceProperties>),
901 /// Spark properties.
902 Spark(std::boxed::Box<crate::model::SparkProperties>),
903 /// Optional. Salesforce DataCloud properties. This field is intended for
904 /// use only by Salesforce partner projects. This field contains properties
905 /// for your Salesforce DataCloud connection.
906 SalesforceDataCloud(std::boxed::Box<crate::model::SalesforceDataCloudProperties>),
907 }
908}
909
910/// Connection properties specific to the Cloud SQL.
911#[derive(Clone, Default, PartialEq)]
912#[non_exhaustive]
913pub struct CloudSqlProperties {
914 /// Cloud SQL instance ID in the form `project:location:instance`.
915 pub instance_id: std::string::String,
916
917 /// Database name.
918 pub database: std::string::String,
919
920 /// Type of the Cloud SQL database.
921 pub r#type: crate::model::cloud_sql_properties::DatabaseType,
922
923 /// Input only. Cloud SQL credential.
924 pub credential: std::option::Option<crate::model::CloudSqlCredential>,
925
926 /// Output only. The account ID of the service used for the purpose of this
927 /// connection.
928 ///
929 /// When the connection is used in the context of an operation in
930 /// BigQuery, this service account will serve as the identity being used for
931 /// connecting to the CloudSQL instance specified in this connection.
932 pub service_account_id: std::string::String,
933
934 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
935}
936
937impl CloudSqlProperties {
938 pub fn new() -> Self {
939 std::default::Default::default()
940 }
941
942 /// Sets the value of [instance_id][crate::model::CloudSqlProperties::instance_id].
943 ///
944 /// # Example
945 /// ```ignore,no_run
946 /// # use google_cloud_bigquery_connection_v1::model::CloudSqlProperties;
947 /// let x = CloudSqlProperties::new().set_instance_id("example");
948 /// ```
949 pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
950 self.instance_id = v.into();
951 self
952 }
953
954 /// Sets the value of [database][crate::model::CloudSqlProperties::database].
955 ///
956 /// # Example
957 /// ```ignore,no_run
958 /// # use google_cloud_bigquery_connection_v1::model::CloudSqlProperties;
959 /// let x = CloudSqlProperties::new().set_database("example");
960 /// ```
961 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
962 self.database = v.into();
963 self
964 }
965
966 /// Sets the value of [r#type][crate::model::CloudSqlProperties::type].
967 ///
968 /// # Example
969 /// ```ignore,no_run
970 /// # use google_cloud_bigquery_connection_v1::model::CloudSqlProperties;
971 /// use google_cloud_bigquery_connection_v1::model::cloud_sql_properties::DatabaseType;
972 /// let x0 = CloudSqlProperties::new().set_type(DatabaseType::Postgres);
973 /// let x1 = CloudSqlProperties::new().set_type(DatabaseType::Mysql);
974 /// ```
975 pub fn set_type<T: std::convert::Into<crate::model::cloud_sql_properties::DatabaseType>>(
976 mut self,
977 v: T,
978 ) -> Self {
979 self.r#type = v.into();
980 self
981 }
982
983 /// Sets the value of [credential][crate::model::CloudSqlProperties::credential].
984 ///
985 /// # Example
986 /// ```ignore,no_run
987 /// # use google_cloud_bigquery_connection_v1::model::CloudSqlProperties;
988 /// use google_cloud_bigquery_connection_v1::model::CloudSqlCredential;
989 /// let x = CloudSqlProperties::new().set_credential(CloudSqlCredential::default()/* use setters */);
990 /// ```
991 pub fn set_credential<T>(mut self, v: T) -> Self
992 where
993 T: std::convert::Into<crate::model::CloudSqlCredential>,
994 {
995 self.credential = std::option::Option::Some(v.into());
996 self
997 }
998
999 /// Sets or clears the value of [credential][crate::model::CloudSqlProperties::credential].
1000 ///
1001 /// # Example
1002 /// ```ignore,no_run
1003 /// # use google_cloud_bigquery_connection_v1::model::CloudSqlProperties;
1004 /// use google_cloud_bigquery_connection_v1::model::CloudSqlCredential;
1005 /// let x = CloudSqlProperties::new().set_or_clear_credential(Some(CloudSqlCredential::default()/* use setters */));
1006 /// let x = CloudSqlProperties::new().set_or_clear_credential(None::<CloudSqlCredential>);
1007 /// ```
1008 pub fn set_or_clear_credential<T>(mut self, v: std::option::Option<T>) -> Self
1009 where
1010 T: std::convert::Into<crate::model::CloudSqlCredential>,
1011 {
1012 self.credential = v.map(|x| x.into());
1013 self
1014 }
1015
1016 /// Sets the value of [service_account_id][crate::model::CloudSqlProperties::service_account_id].
1017 ///
1018 /// # Example
1019 /// ```ignore,no_run
1020 /// # use google_cloud_bigquery_connection_v1::model::CloudSqlProperties;
1021 /// let x = CloudSqlProperties::new().set_service_account_id("example");
1022 /// ```
1023 pub fn set_service_account_id<T: std::convert::Into<std::string::String>>(
1024 mut self,
1025 v: T,
1026 ) -> Self {
1027 self.service_account_id = v.into();
1028 self
1029 }
1030}
1031
1032impl wkt::message::Message for CloudSqlProperties {
1033 fn typename() -> &'static str {
1034 "type.googleapis.com/google.cloud.bigquery.connection.v1.CloudSqlProperties"
1035 }
1036}
1037
1038/// Defines additional types related to [CloudSqlProperties].
1039pub mod cloud_sql_properties {
1040 #[allow(unused_imports)]
1041 use super::*;
1042
1043 /// Supported Cloud SQL database types.
1044 ///
1045 /// # Working with unknown values
1046 ///
1047 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1048 /// additional enum variants at any time. Adding new variants is not considered
1049 /// a breaking change. Applications should write their code in anticipation of:
1050 ///
1051 /// - New values appearing in future releases of the client library, **and**
1052 /// - New values received dynamically, without application changes.
1053 ///
1054 /// Please consult the [Working with enums] section in the user guide for some
1055 /// guidelines.
1056 ///
1057 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1058 #[derive(Clone, Debug, PartialEq)]
1059 #[non_exhaustive]
1060 pub enum DatabaseType {
1061 /// Unspecified database type.
1062 Unspecified,
1063 /// Cloud SQL for PostgreSQL.
1064 Postgres,
1065 /// Cloud SQL for MySQL.
1066 Mysql,
1067 /// If set, the enum was initialized with an unknown value.
1068 ///
1069 /// Applications can examine the value using [DatabaseType::value] or
1070 /// [DatabaseType::name].
1071 UnknownValue(database_type::UnknownValue),
1072 }
1073
1074 #[doc(hidden)]
1075 pub mod database_type {
1076 #[allow(unused_imports)]
1077 use super::*;
1078 #[derive(Clone, Debug, PartialEq)]
1079 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1080 }
1081
1082 impl DatabaseType {
1083 /// Gets the enum value.
1084 ///
1085 /// Returns `None` if the enum contains an unknown value deserialized from
1086 /// the string representation of enums.
1087 pub fn value(&self) -> std::option::Option<i32> {
1088 match self {
1089 Self::Unspecified => std::option::Option::Some(0),
1090 Self::Postgres => std::option::Option::Some(1),
1091 Self::Mysql => std::option::Option::Some(2),
1092 Self::UnknownValue(u) => u.0.value(),
1093 }
1094 }
1095
1096 /// Gets the enum value as a string.
1097 ///
1098 /// Returns `None` if the enum contains an unknown value deserialized from
1099 /// the integer representation of enums.
1100 pub fn name(&self) -> std::option::Option<&str> {
1101 match self {
1102 Self::Unspecified => std::option::Option::Some("DATABASE_TYPE_UNSPECIFIED"),
1103 Self::Postgres => std::option::Option::Some("POSTGRES"),
1104 Self::Mysql => std::option::Option::Some("MYSQL"),
1105 Self::UnknownValue(u) => u.0.name(),
1106 }
1107 }
1108 }
1109
1110 impl std::default::Default for DatabaseType {
1111 fn default() -> Self {
1112 use std::convert::From;
1113 Self::from(0)
1114 }
1115 }
1116
1117 impl std::fmt::Display for DatabaseType {
1118 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1119 wkt::internal::display_enum(f, self.name(), self.value())
1120 }
1121 }
1122
1123 impl std::convert::From<i32> for DatabaseType {
1124 fn from(value: i32) -> Self {
1125 match value {
1126 0 => Self::Unspecified,
1127 1 => Self::Postgres,
1128 2 => Self::Mysql,
1129 _ => Self::UnknownValue(database_type::UnknownValue(
1130 wkt::internal::UnknownEnumValue::Integer(value),
1131 )),
1132 }
1133 }
1134 }
1135
1136 impl std::convert::From<&str> for DatabaseType {
1137 fn from(value: &str) -> Self {
1138 use std::string::ToString;
1139 match value {
1140 "DATABASE_TYPE_UNSPECIFIED" => Self::Unspecified,
1141 "POSTGRES" => Self::Postgres,
1142 "MYSQL" => Self::Mysql,
1143 _ => Self::UnknownValue(database_type::UnknownValue(
1144 wkt::internal::UnknownEnumValue::String(value.to_string()),
1145 )),
1146 }
1147 }
1148 }
1149
1150 impl serde::ser::Serialize for DatabaseType {
1151 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1152 where
1153 S: serde::Serializer,
1154 {
1155 match self {
1156 Self::Unspecified => serializer.serialize_i32(0),
1157 Self::Postgres => serializer.serialize_i32(1),
1158 Self::Mysql => serializer.serialize_i32(2),
1159 Self::UnknownValue(u) => u.0.serialize(serializer),
1160 }
1161 }
1162 }
1163
1164 impl<'de> serde::de::Deserialize<'de> for DatabaseType {
1165 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1166 where
1167 D: serde::Deserializer<'de>,
1168 {
1169 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseType>::new(
1170 ".google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType",
1171 ))
1172 }
1173 }
1174}
1175
1176/// Credential info for the Cloud SQL.
1177#[derive(Clone, Default, PartialEq)]
1178#[non_exhaustive]
1179pub struct CloudSqlCredential {
1180 /// The username for the credential.
1181 pub username: std::string::String,
1182
1183 /// The password for the credential.
1184 pub password: std::string::String,
1185
1186 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1187}
1188
1189impl CloudSqlCredential {
1190 pub fn new() -> Self {
1191 std::default::Default::default()
1192 }
1193
1194 /// Sets the value of [username][crate::model::CloudSqlCredential::username].
1195 ///
1196 /// # Example
1197 /// ```ignore,no_run
1198 /// # use google_cloud_bigquery_connection_v1::model::CloudSqlCredential;
1199 /// let x = CloudSqlCredential::new().set_username("example");
1200 /// ```
1201 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1202 self.username = v.into();
1203 self
1204 }
1205
1206 /// Sets the value of [password][crate::model::CloudSqlCredential::password].
1207 ///
1208 /// # Example
1209 /// ```ignore,no_run
1210 /// # use google_cloud_bigquery_connection_v1::model::CloudSqlCredential;
1211 /// let x = CloudSqlCredential::new().set_password("example");
1212 /// ```
1213 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1214 self.password = v.into();
1215 self
1216 }
1217}
1218
1219impl wkt::message::Message for CloudSqlCredential {
1220 fn typename() -> &'static str {
1221 "type.googleapis.com/google.cloud.bigquery.connection.v1.CloudSqlCredential"
1222 }
1223}
1224
1225/// Connection properties specific to Cloud Spanner.
1226#[derive(Clone, Default, PartialEq)]
1227#[non_exhaustive]
1228pub struct CloudSpannerProperties {
1229 /// Cloud Spanner database in the form `project/instance/database'
1230 pub database: std::string::String,
1231
1232 /// If parallelism should be used when reading from Cloud Spanner
1233 pub use_parallelism: bool,
1234
1235 /// Allows setting max parallelism per query when executing on Spanner
1236 /// independent compute resources. If unspecified, default values of
1237 /// parallelism are chosen that are dependent on the Cloud Spanner instance
1238 /// configuration.
1239 ///
1240 /// REQUIRES: `use_parallelism` must be set.
1241 /// REQUIRES: Either `use_data_boost` or `use_serverless_analytics` must be
1242 /// set.
1243 pub max_parallelism: i32,
1244
1245 /// If the serverless analytics service should be used to read data from Cloud
1246 /// Spanner.
1247 /// Note: `use_parallelism` must be set when using serverless analytics.
1248 pub use_serverless_analytics: bool,
1249
1250 /// If set, the request will be executed via Spanner independent compute
1251 /// resources.
1252 /// REQUIRES: `use_parallelism` must be set.
1253 ///
1254 /// NOTE: `use_serverless_analytics` will be deprecated. Prefer
1255 /// `use_data_boost` over `use_serverless_analytics`.
1256 pub use_data_boost: bool,
1257
1258 /// Optional. Cloud Spanner database role for fine-grained access control.
1259 /// The Cloud Spanner admin should have provisioned the database role with
1260 /// appropriate permissions, such as `SELECT` and `INSERT`. Other users should
1261 /// only use roles provided by their Cloud Spanner admins.
1262 ///
1263 /// For more details, see [About fine-grained access control]
1264 /// (<https://cloud.google.com/spanner/docs/fgac-about>).
1265 ///
1266 /// REQUIRES: The database role name must start with a letter, and can only
1267 /// contain letters, numbers, and underscores.
1268 pub database_role: std::string::String,
1269
1270 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1271}
1272
1273impl CloudSpannerProperties {
1274 pub fn new() -> Self {
1275 std::default::Default::default()
1276 }
1277
1278 /// Sets the value of [database][crate::model::CloudSpannerProperties::database].
1279 ///
1280 /// # Example
1281 /// ```ignore,no_run
1282 /// # use google_cloud_bigquery_connection_v1::model::CloudSpannerProperties;
1283 /// let x = CloudSpannerProperties::new().set_database("example");
1284 /// ```
1285 pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1286 self.database = v.into();
1287 self
1288 }
1289
1290 /// Sets the value of [use_parallelism][crate::model::CloudSpannerProperties::use_parallelism].
1291 ///
1292 /// # Example
1293 /// ```ignore,no_run
1294 /// # use google_cloud_bigquery_connection_v1::model::CloudSpannerProperties;
1295 /// let x = CloudSpannerProperties::new().set_use_parallelism(true);
1296 /// ```
1297 pub fn set_use_parallelism<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1298 self.use_parallelism = v.into();
1299 self
1300 }
1301
1302 /// Sets the value of [max_parallelism][crate::model::CloudSpannerProperties::max_parallelism].
1303 ///
1304 /// # Example
1305 /// ```ignore,no_run
1306 /// # use google_cloud_bigquery_connection_v1::model::CloudSpannerProperties;
1307 /// let x = CloudSpannerProperties::new().set_max_parallelism(42);
1308 /// ```
1309 pub fn set_max_parallelism<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1310 self.max_parallelism = v.into();
1311 self
1312 }
1313
1314 /// Sets the value of [use_serverless_analytics][crate::model::CloudSpannerProperties::use_serverless_analytics].
1315 ///
1316 /// # Example
1317 /// ```ignore,no_run
1318 /// # use google_cloud_bigquery_connection_v1::model::CloudSpannerProperties;
1319 /// let x = CloudSpannerProperties::new().set_use_serverless_analytics(true);
1320 /// ```
1321 pub fn set_use_serverless_analytics<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1322 self.use_serverless_analytics = v.into();
1323 self
1324 }
1325
1326 /// Sets the value of [use_data_boost][crate::model::CloudSpannerProperties::use_data_boost].
1327 ///
1328 /// # Example
1329 /// ```ignore,no_run
1330 /// # use google_cloud_bigquery_connection_v1::model::CloudSpannerProperties;
1331 /// let x = CloudSpannerProperties::new().set_use_data_boost(true);
1332 /// ```
1333 pub fn set_use_data_boost<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1334 self.use_data_boost = v.into();
1335 self
1336 }
1337
1338 /// Sets the value of [database_role][crate::model::CloudSpannerProperties::database_role].
1339 ///
1340 /// # Example
1341 /// ```ignore,no_run
1342 /// # use google_cloud_bigquery_connection_v1::model::CloudSpannerProperties;
1343 /// let x = CloudSpannerProperties::new().set_database_role("example");
1344 /// ```
1345 pub fn set_database_role<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1346 self.database_role = v.into();
1347 self
1348 }
1349}
1350
1351impl wkt::message::Message for CloudSpannerProperties {
1352 fn typename() -> &'static str {
1353 "type.googleapis.com/google.cloud.bigquery.connection.v1.CloudSpannerProperties"
1354 }
1355}
1356
1357/// Connection properties specific to Amazon Web Services (AWS).
1358#[derive(Clone, Default, PartialEq)]
1359#[non_exhaustive]
1360pub struct AwsProperties {
1361 /// Authentication method chosen at connection creation.
1362 pub authentication_method:
1363 std::option::Option<crate::model::aws_properties::AuthenticationMethod>,
1364
1365 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1366}
1367
1368impl AwsProperties {
1369 pub fn new() -> Self {
1370 std::default::Default::default()
1371 }
1372
1373 /// Sets the value of [authentication_method][crate::model::AwsProperties::authentication_method].
1374 ///
1375 /// Note that all the setters affecting `authentication_method` are mutually
1376 /// exclusive.
1377 ///
1378 /// # Example
1379 /// ```ignore,no_run
1380 /// # use google_cloud_bigquery_connection_v1::model::AwsProperties;
1381 /// use google_cloud_bigquery_connection_v1::model::AwsAccessRole;
1382 /// let x = AwsProperties::new().set_authentication_method(Some(
1383 /// google_cloud_bigquery_connection_v1::model::aws_properties::AuthenticationMethod::AccessRole(AwsAccessRole::default().into())));
1384 /// ```
1385 pub fn set_authentication_method<
1386 T: std::convert::Into<std::option::Option<crate::model::aws_properties::AuthenticationMethod>>,
1387 >(
1388 mut self,
1389 v: T,
1390 ) -> Self {
1391 self.authentication_method = v.into();
1392 self
1393 }
1394
1395 /// The value of [authentication_method][crate::model::AwsProperties::authentication_method]
1396 /// if it holds a `CrossAccountRole`, `None` if the field is not set or
1397 /// holds a different branch.
1398 #[deprecated]
1399 pub fn cross_account_role(
1400 &self,
1401 ) -> std::option::Option<&std::boxed::Box<crate::model::AwsCrossAccountRole>> {
1402 #[allow(unreachable_patterns)]
1403 self.authentication_method.as_ref().and_then(|v| match v {
1404 crate::model::aws_properties::AuthenticationMethod::CrossAccountRole(v) => {
1405 std::option::Option::Some(v)
1406 }
1407 _ => std::option::Option::None,
1408 })
1409 }
1410
1411 /// Sets the value of [authentication_method][crate::model::AwsProperties::authentication_method]
1412 /// to hold a `CrossAccountRole`.
1413 ///
1414 /// Note that all the setters affecting `authentication_method` are
1415 /// mutually exclusive.
1416 ///
1417 /// # Example
1418 /// ```ignore,no_run
1419 /// # use google_cloud_bigquery_connection_v1::model::AwsProperties;
1420 /// use google_cloud_bigquery_connection_v1::model::AwsCrossAccountRole;
1421 /// let x = AwsProperties::new().set_cross_account_role(AwsCrossAccountRole::default()/* use setters */);
1422 /// assert!(x.cross_account_role().is_some());
1423 /// assert!(x.access_role().is_none());
1424 /// ```
1425 #[deprecated]
1426 pub fn set_cross_account_role<
1427 T: std::convert::Into<std::boxed::Box<crate::model::AwsCrossAccountRole>>,
1428 >(
1429 mut self,
1430 v: T,
1431 ) -> Self {
1432 self.authentication_method = std::option::Option::Some(
1433 crate::model::aws_properties::AuthenticationMethod::CrossAccountRole(v.into()),
1434 );
1435 self
1436 }
1437
1438 /// The value of [authentication_method][crate::model::AwsProperties::authentication_method]
1439 /// if it holds a `AccessRole`, `None` if the field is not set or
1440 /// holds a different branch.
1441 pub fn access_role(
1442 &self,
1443 ) -> std::option::Option<&std::boxed::Box<crate::model::AwsAccessRole>> {
1444 #[allow(unreachable_patterns)]
1445 self.authentication_method.as_ref().and_then(|v| match v {
1446 crate::model::aws_properties::AuthenticationMethod::AccessRole(v) => {
1447 std::option::Option::Some(v)
1448 }
1449 _ => std::option::Option::None,
1450 })
1451 }
1452
1453 /// Sets the value of [authentication_method][crate::model::AwsProperties::authentication_method]
1454 /// to hold a `AccessRole`.
1455 ///
1456 /// Note that all the setters affecting `authentication_method` are
1457 /// mutually exclusive.
1458 ///
1459 /// # Example
1460 /// ```ignore,no_run
1461 /// # use google_cloud_bigquery_connection_v1::model::AwsProperties;
1462 /// use google_cloud_bigquery_connection_v1::model::AwsAccessRole;
1463 /// let x = AwsProperties::new().set_access_role(AwsAccessRole::default()/* use setters */);
1464 /// assert!(x.access_role().is_some());
1465 /// assert!(x.cross_account_role().is_none());
1466 /// ```
1467 pub fn set_access_role<T: std::convert::Into<std::boxed::Box<crate::model::AwsAccessRole>>>(
1468 mut self,
1469 v: T,
1470 ) -> Self {
1471 self.authentication_method = std::option::Option::Some(
1472 crate::model::aws_properties::AuthenticationMethod::AccessRole(v.into()),
1473 );
1474 self
1475 }
1476}
1477
1478impl wkt::message::Message for AwsProperties {
1479 fn typename() -> &'static str {
1480 "type.googleapis.com/google.cloud.bigquery.connection.v1.AwsProperties"
1481 }
1482}
1483
1484/// Defines additional types related to [AwsProperties].
1485pub mod aws_properties {
1486 #[allow(unused_imports)]
1487 use super::*;
1488
1489 /// Authentication method chosen at connection creation.
1490 #[derive(Clone, Debug, PartialEq)]
1491 #[non_exhaustive]
1492 pub enum AuthenticationMethod {
1493 /// Authentication using Google owned AWS IAM user's access key to assume
1494 /// into customer's AWS IAM Role.
1495 /// Deprecated, do not use.
1496 #[deprecated]
1497 CrossAccountRole(std::boxed::Box<crate::model::AwsCrossAccountRole>),
1498 /// Authentication using Google owned service account to assume into
1499 /// customer's AWS IAM Role.
1500 AccessRole(std::boxed::Box<crate::model::AwsAccessRole>),
1501 }
1502}
1503
1504/// Authentication method for Amazon Web Services (AWS) that uses Google owned
1505/// AWS IAM user's access key to assume into customer's AWS IAM Role.
1506#[derive(Clone, Default, PartialEq)]
1507#[non_exhaustive]
1508pub struct AwsCrossAccountRole {
1509 /// The user’s AWS IAM Role that trusts the Google-owned AWS IAM user
1510 /// Connection.
1511 pub iam_role_id: std::string::String,
1512
1513 /// Output only. Google-owned AWS IAM User for a Connection.
1514 pub iam_user_id: std::string::String,
1515
1516 /// Output only. A Google-generated id for representing Connection’s identity
1517 /// in AWS. External Id is also used for preventing the Confused Deputy
1518 /// Problem. See
1519 /// <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html>
1520 pub external_id: std::string::String,
1521
1522 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1523}
1524
1525impl AwsCrossAccountRole {
1526 pub fn new() -> Self {
1527 std::default::Default::default()
1528 }
1529
1530 /// Sets the value of [iam_role_id][crate::model::AwsCrossAccountRole::iam_role_id].
1531 ///
1532 /// # Example
1533 /// ```ignore,no_run
1534 /// # use google_cloud_bigquery_connection_v1::model::AwsCrossAccountRole;
1535 /// let x = AwsCrossAccountRole::new().set_iam_role_id("example");
1536 /// ```
1537 pub fn set_iam_role_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1538 self.iam_role_id = v.into();
1539 self
1540 }
1541
1542 /// Sets the value of [iam_user_id][crate::model::AwsCrossAccountRole::iam_user_id].
1543 ///
1544 /// # Example
1545 /// ```ignore,no_run
1546 /// # use google_cloud_bigquery_connection_v1::model::AwsCrossAccountRole;
1547 /// let x = AwsCrossAccountRole::new().set_iam_user_id("example");
1548 /// ```
1549 pub fn set_iam_user_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1550 self.iam_user_id = v.into();
1551 self
1552 }
1553
1554 /// Sets the value of [external_id][crate::model::AwsCrossAccountRole::external_id].
1555 ///
1556 /// # Example
1557 /// ```ignore,no_run
1558 /// # use google_cloud_bigquery_connection_v1::model::AwsCrossAccountRole;
1559 /// let x = AwsCrossAccountRole::new().set_external_id("example");
1560 /// ```
1561 pub fn set_external_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1562 self.external_id = v.into();
1563 self
1564 }
1565}
1566
1567impl wkt::message::Message for AwsCrossAccountRole {
1568 fn typename() -> &'static str {
1569 "type.googleapis.com/google.cloud.bigquery.connection.v1.AwsCrossAccountRole"
1570 }
1571}
1572
1573/// Authentication method for Amazon Web Services (AWS) that uses Google owned
1574/// Google service account to assume into customer's AWS IAM Role.
1575#[derive(Clone, Default, PartialEq)]
1576#[non_exhaustive]
1577pub struct AwsAccessRole {
1578 /// The user’s AWS IAM Role that trusts the Google-owned AWS IAM user
1579 /// Connection.
1580 pub iam_role_id: std::string::String,
1581
1582 /// A unique Google-owned and Google-generated identity for the Connection.
1583 /// This identity will be used to access the user's AWS IAM Role.
1584 pub identity: std::string::String,
1585
1586 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1587}
1588
1589impl AwsAccessRole {
1590 pub fn new() -> Self {
1591 std::default::Default::default()
1592 }
1593
1594 /// Sets the value of [iam_role_id][crate::model::AwsAccessRole::iam_role_id].
1595 ///
1596 /// # Example
1597 /// ```ignore,no_run
1598 /// # use google_cloud_bigquery_connection_v1::model::AwsAccessRole;
1599 /// let x = AwsAccessRole::new().set_iam_role_id("example");
1600 /// ```
1601 pub fn set_iam_role_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1602 self.iam_role_id = v.into();
1603 self
1604 }
1605
1606 /// Sets the value of [identity][crate::model::AwsAccessRole::identity].
1607 ///
1608 /// # Example
1609 /// ```ignore,no_run
1610 /// # use google_cloud_bigquery_connection_v1::model::AwsAccessRole;
1611 /// let x = AwsAccessRole::new().set_identity("example");
1612 /// ```
1613 pub fn set_identity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1614 self.identity = v.into();
1615 self
1616 }
1617}
1618
1619impl wkt::message::Message for AwsAccessRole {
1620 fn typename() -> &'static str {
1621 "type.googleapis.com/google.cloud.bigquery.connection.v1.AwsAccessRole"
1622 }
1623}
1624
1625/// Container for connection properties specific to Azure.
1626#[derive(Clone, Default, PartialEq)]
1627#[non_exhaustive]
1628pub struct AzureProperties {
1629 /// Output only. The name of the Azure Active Directory Application.
1630 pub application: std::string::String,
1631
1632 /// Output only. The client id of the Azure Active Directory Application.
1633 pub client_id: std::string::String,
1634
1635 /// Output only. The object id of the Azure Active Directory Application.
1636 pub object_id: std::string::String,
1637
1638 /// The id of customer's directory that host the data.
1639 pub customer_tenant_id: std::string::String,
1640
1641 /// The URL user will be redirected to after granting consent during connection
1642 /// setup.
1643 pub redirect_uri: std::string::String,
1644
1645 /// The client ID of the user's Azure Active Directory Application used for a
1646 /// federated connection.
1647 pub federated_application_client_id: std::string::String,
1648
1649 /// Output only. A unique Google-owned and Google-generated identity for the
1650 /// Connection. This identity will be used to access the user's Azure Active
1651 /// Directory Application.
1652 pub identity: std::string::String,
1653
1654 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1655}
1656
1657impl AzureProperties {
1658 pub fn new() -> Self {
1659 std::default::Default::default()
1660 }
1661
1662 /// Sets the value of [application][crate::model::AzureProperties::application].
1663 ///
1664 /// # Example
1665 /// ```ignore,no_run
1666 /// # use google_cloud_bigquery_connection_v1::model::AzureProperties;
1667 /// let x = AzureProperties::new().set_application("example");
1668 /// ```
1669 pub fn set_application<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1670 self.application = v.into();
1671 self
1672 }
1673
1674 /// Sets the value of [client_id][crate::model::AzureProperties::client_id].
1675 ///
1676 /// # Example
1677 /// ```ignore,no_run
1678 /// # use google_cloud_bigquery_connection_v1::model::AzureProperties;
1679 /// let x = AzureProperties::new().set_client_id("example");
1680 /// ```
1681 pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1682 self.client_id = v.into();
1683 self
1684 }
1685
1686 /// Sets the value of [object_id][crate::model::AzureProperties::object_id].
1687 ///
1688 /// # Example
1689 /// ```ignore,no_run
1690 /// # use google_cloud_bigquery_connection_v1::model::AzureProperties;
1691 /// let x = AzureProperties::new().set_object_id("example");
1692 /// ```
1693 pub fn set_object_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1694 self.object_id = v.into();
1695 self
1696 }
1697
1698 /// Sets the value of [customer_tenant_id][crate::model::AzureProperties::customer_tenant_id].
1699 ///
1700 /// # Example
1701 /// ```ignore,no_run
1702 /// # use google_cloud_bigquery_connection_v1::model::AzureProperties;
1703 /// let x = AzureProperties::new().set_customer_tenant_id("example");
1704 /// ```
1705 pub fn set_customer_tenant_id<T: std::convert::Into<std::string::String>>(
1706 mut self,
1707 v: T,
1708 ) -> Self {
1709 self.customer_tenant_id = v.into();
1710 self
1711 }
1712
1713 /// Sets the value of [redirect_uri][crate::model::AzureProperties::redirect_uri].
1714 ///
1715 /// # Example
1716 /// ```ignore,no_run
1717 /// # use google_cloud_bigquery_connection_v1::model::AzureProperties;
1718 /// let x = AzureProperties::new().set_redirect_uri("example");
1719 /// ```
1720 pub fn set_redirect_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1721 self.redirect_uri = v.into();
1722 self
1723 }
1724
1725 /// Sets the value of [federated_application_client_id][crate::model::AzureProperties::federated_application_client_id].
1726 ///
1727 /// # Example
1728 /// ```ignore,no_run
1729 /// # use google_cloud_bigquery_connection_v1::model::AzureProperties;
1730 /// let x = AzureProperties::new().set_federated_application_client_id("example");
1731 /// ```
1732 pub fn set_federated_application_client_id<T: std::convert::Into<std::string::String>>(
1733 mut self,
1734 v: T,
1735 ) -> Self {
1736 self.federated_application_client_id = v.into();
1737 self
1738 }
1739
1740 /// Sets the value of [identity][crate::model::AzureProperties::identity].
1741 ///
1742 /// # Example
1743 /// ```ignore,no_run
1744 /// # use google_cloud_bigquery_connection_v1::model::AzureProperties;
1745 /// let x = AzureProperties::new().set_identity("example");
1746 /// ```
1747 pub fn set_identity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1748 self.identity = v.into();
1749 self
1750 }
1751}
1752
1753impl wkt::message::Message for AzureProperties {
1754 fn typename() -> &'static str {
1755 "type.googleapis.com/google.cloud.bigquery.connection.v1.AzureProperties"
1756 }
1757}
1758
1759/// Container for connection properties for delegation of access to GCP
1760/// resources.
1761#[derive(Clone, Default, PartialEq)]
1762#[non_exhaustive]
1763pub struct CloudResourceProperties {
1764 /// Output only. The account ID of the service created for the purpose of this
1765 /// connection.
1766 ///
1767 /// The service account does not have any permissions associated with it
1768 /// when it is created. After creation, customers delegate permissions
1769 /// to the service account. When the connection is used in the context of an
1770 /// operation in BigQuery, the service account will be used to connect to the
1771 /// desired resources in GCP.
1772 ///
1773 /// The account ID is in the form of:
1774 /// \<service-1234\>@gcp-sa-bigquery-cloudresource.iam.gserviceaccount.com
1775 pub service_account_id: std::string::String,
1776
1777 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1778}
1779
1780impl CloudResourceProperties {
1781 pub fn new() -> Self {
1782 std::default::Default::default()
1783 }
1784
1785 /// Sets the value of [service_account_id][crate::model::CloudResourceProperties::service_account_id].
1786 ///
1787 /// # Example
1788 /// ```ignore,no_run
1789 /// # use google_cloud_bigquery_connection_v1::model::CloudResourceProperties;
1790 /// let x = CloudResourceProperties::new().set_service_account_id("example");
1791 /// ```
1792 pub fn set_service_account_id<T: std::convert::Into<std::string::String>>(
1793 mut self,
1794 v: T,
1795 ) -> Self {
1796 self.service_account_id = v.into();
1797 self
1798 }
1799}
1800
1801impl wkt::message::Message for CloudResourceProperties {
1802 fn typename() -> &'static str {
1803 "type.googleapis.com/google.cloud.bigquery.connection.v1.CloudResourceProperties"
1804 }
1805}
1806
1807/// Configuration of the Dataproc Metastore Service.
1808#[derive(Clone, Default, PartialEq)]
1809#[non_exhaustive]
1810pub struct MetastoreServiceConfig {
1811 /// Optional. Resource name of an existing Dataproc Metastore service.
1812 ///
1813 /// Example:
1814 ///
1815 /// * `projects/[project_id]/locations/[region]/services/[service_id]`
1816 pub metastore_service: std::string::String,
1817
1818 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1819}
1820
1821impl MetastoreServiceConfig {
1822 pub fn new() -> Self {
1823 std::default::Default::default()
1824 }
1825
1826 /// Sets the value of [metastore_service][crate::model::MetastoreServiceConfig::metastore_service].
1827 ///
1828 /// # Example
1829 /// ```ignore,no_run
1830 /// # use google_cloud_bigquery_connection_v1::model::MetastoreServiceConfig;
1831 /// let x = MetastoreServiceConfig::new().set_metastore_service("example");
1832 /// ```
1833 pub fn set_metastore_service<T: std::convert::Into<std::string::String>>(
1834 mut self,
1835 v: T,
1836 ) -> Self {
1837 self.metastore_service = v.into();
1838 self
1839 }
1840}
1841
1842impl wkt::message::Message for MetastoreServiceConfig {
1843 fn typename() -> &'static str {
1844 "type.googleapis.com/google.cloud.bigquery.connection.v1.MetastoreServiceConfig"
1845 }
1846}
1847
1848/// Configuration of the Spark History Server.
1849#[derive(Clone, Default, PartialEq)]
1850#[non_exhaustive]
1851pub struct SparkHistoryServerConfig {
1852 /// Optional. Resource name of an existing Dataproc Cluster to act as a Spark
1853 /// History Server for the connection.
1854 ///
1855 /// Example:
1856 ///
1857 /// * `projects/[project_id]/regions/[region]/clusters/[cluster_name]`
1858 pub dataproc_cluster: std::string::String,
1859
1860 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1861}
1862
1863impl SparkHistoryServerConfig {
1864 pub fn new() -> Self {
1865 std::default::Default::default()
1866 }
1867
1868 /// Sets the value of [dataproc_cluster][crate::model::SparkHistoryServerConfig::dataproc_cluster].
1869 ///
1870 /// # Example
1871 /// ```ignore,no_run
1872 /// # use google_cloud_bigquery_connection_v1::model::SparkHistoryServerConfig;
1873 /// let x = SparkHistoryServerConfig::new().set_dataproc_cluster("example");
1874 /// ```
1875 pub fn set_dataproc_cluster<T: std::convert::Into<std::string::String>>(
1876 mut self,
1877 v: T,
1878 ) -> Self {
1879 self.dataproc_cluster = v.into();
1880 self
1881 }
1882}
1883
1884impl wkt::message::Message for SparkHistoryServerConfig {
1885 fn typename() -> &'static str {
1886 "type.googleapis.com/google.cloud.bigquery.connection.v1.SparkHistoryServerConfig"
1887 }
1888}
1889
1890/// Container for connection properties to execute stored procedures for Apache
1891/// Spark.
1892#[derive(Clone, Default, PartialEq)]
1893#[non_exhaustive]
1894pub struct SparkProperties {
1895 /// Output only. The account ID of the service created for the purpose of this
1896 /// connection.
1897 ///
1898 /// The service account does not have any permissions associated with it when
1899 /// it is created. After creation, customers delegate permissions to the
1900 /// service account. When the connection is used in the context of a stored
1901 /// procedure for Apache Spark in BigQuery, the service account is used to
1902 /// connect to the desired resources in Google Cloud.
1903 ///
1904 /// The account ID is in the form of:
1905 /// bqcx-\<projectnumber\>-\<uniqueid\>@gcp-sa-bigquery-consp.iam.gserviceaccount.com
1906 pub service_account_id: std::string::String,
1907
1908 /// Optional. Dataproc Metastore Service configuration for the connection.
1909 pub metastore_service_config: std::option::Option<crate::model::MetastoreServiceConfig>,
1910
1911 /// Optional. Spark History Server configuration for the connection.
1912 pub spark_history_server_config: std::option::Option<crate::model::SparkHistoryServerConfig>,
1913
1914 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1915}
1916
1917impl SparkProperties {
1918 pub fn new() -> Self {
1919 std::default::Default::default()
1920 }
1921
1922 /// Sets the value of [service_account_id][crate::model::SparkProperties::service_account_id].
1923 ///
1924 /// # Example
1925 /// ```ignore,no_run
1926 /// # use google_cloud_bigquery_connection_v1::model::SparkProperties;
1927 /// let x = SparkProperties::new().set_service_account_id("example");
1928 /// ```
1929 pub fn set_service_account_id<T: std::convert::Into<std::string::String>>(
1930 mut self,
1931 v: T,
1932 ) -> Self {
1933 self.service_account_id = v.into();
1934 self
1935 }
1936
1937 /// Sets the value of [metastore_service_config][crate::model::SparkProperties::metastore_service_config].
1938 ///
1939 /// # Example
1940 /// ```ignore,no_run
1941 /// # use google_cloud_bigquery_connection_v1::model::SparkProperties;
1942 /// use google_cloud_bigquery_connection_v1::model::MetastoreServiceConfig;
1943 /// let x = SparkProperties::new().set_metastore_service_config(MetastoreServiceConfig::default()/* use setters */);
1944 /// ```
1945 pub fn set_metastore_service_config<T>(mut self, v: T) -> Self
1946 where
1947 T: std::convert::Into<crate::model::MetastoreServiceConfig>,
1948 {
1949 self.metastore_service_config = std::option::Option::Some(v.into());
1950 self
1951 }
1952
1953 /// Sets or clears the value of [metastore_service_config][crate::model::SparkProperties::metastore_service_config].
1954 ///
1955 /// # Example
1956 /// ```ignore,no_run
1957 /// # use google_cloud_bigquery_connection_v1::model::SparkProperties;
1958 /// use google_cloud_bigquery_connection_v1::model::MetastoreServiceConfig;
1959 /// let x = SparkProperties::new().set_or_clear_metastore_service_config(Some(MetastoreServiceConfig::default()/* use setters */));
1960 /// let x = SparkProperties::new().set_or_clear_metastore_service_config(None::<MetastoreServiceConfig>);
1961 /// ```
1962 pub fn set_or_clear_metastore_service_config<T>(mut self, v: std::option::Option<T>) -> Self
1963 where
1964 T: std::convert::Into<crate::model::MetastoreServiceConfig>,
1965 {
1966 self.metastore_service_config = v.map(|x| x.into());
1967 self
1968 }
1969
1970 /// Sets the value of [spark_history_server_config][crate::model::SparkProperties::spark_history_server_config].
1971 ///
1972 /// # Example
1973 /// ```ignore,no_run
1974 /// # use google_cloud_bigquery_connection_v1::model::SparkProperties;
1975 /// use google_cloud_bigquery_connection_v1::model::SparkHistoryServerConfig;
1976 /// let x = SparkProperties::new().set_spark_history_server_config(SparkHistoryServerConfig::default()/* use setters */);
1977 /// ```
1978 pub fn set_spark_history_server_config<T>(mut self, v: T) -> Self
1979 where
1980 T: std::convert::Into<crate::model::SparkHistoryServerConfig>,
1981 {
1982 self.spark_history_server_config = std::option::Option::Some(v.into());
1983 self
1984 }
1985
1986 /// Sets or clears the value of [spark_history_server_config][crate::model::SparkProperties::spark_history_server_config].
1987 ///
1988 /// # Example
1989 /// ```ignore,no_run
1990 /// # use google_cloud_bigquery_connection_v1::model::SparkProperties;
1991 /// use google_cloud_bigquery_connection_v1::model::SparkHistoryServerConfig;
1992 /// let x = SparkProperties::new().set_or_clear_spark_history_server_config(Some(SparkHistoryServerConfig::default()/* use setters */));
1993 /// let x = SparkProperties::new().set_or_clear_spark_history_server_config(None::<SparkHistoryServerConfig>);
1994 /// ```
1995 pub fn set_or_clear_spark_history_server_config<T>(mut self, v: std::option::Option<T>) -> Self
1996 where
1997 T: std::convert::Into<crate::model::SparkHistoryServerConfig>,
1998 {
1999 self.spark_history_server_config = v.map(|x| x.into());
2000 self
2001 }
2002}
2003
2004impl wkt::message::Message for SparkProperties {
2005 fn typename() -> &'static str {
2006 "type.googleapis.com/google.cloud.bigquery.connection.v1.SparkProperties"
2007 }
2008}
2009
2010/// Connection properties specific to Salesforce DataCloud. This is intended for
2011/// use only by Salesforce partner projects.
2012#[derive(Clone, Default, PartialEq)]
2013#[non_exhaustive]
2014pub struct SalesforceDataCloudProperties {
2015 /// The URL to the user's Salesforce DataCloud instance.
2016 pub instance_uri: std::string::String,
2017
2018 /// Output only. A unique Google-owned and Google-generated service account
2019 /// identity for the connection.
2020 pub identity: std::string::String,
2021
2022 /// The ID of the user's Salesforce tenant.
2023 pub tenant_id: std::string::String,
2024
2025 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2026}
2027
2028impl SalesforceDataCloudProperties {
2029 pub fn new() -> Self {
2030 std::default::Default::default()
2031 }
2032
2033 /// Sets the value of [instance_uri][crate::model::SalesforceDataCloudProperties::instance_uri].
2034 ///
2035 /// # Example
2036 /// ```ignore,no_run
2037 /// # use google_cloud_bigquery_connection_v1::model::SalesforceDataCloudProperties;
2038 /// let x = SalesforceDataCloudProperties::new().set_instance_uri("example");
2039 /// ```
2040 pub fn set_instance_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2041 self.instance_uri = v.into();
2042 self
2043 }
2044
2045 /// Sets the value of [identity][crate::model::SalesforceDataCloudProperties::identity].
2046 ///
2047 /// # Example
2048 /// ```ignore,no_run
2049 /// # use google_cloud_bigquery_connection_v1::model::SalesforceDataCloudProperties;
2050 /// let x = SalesforceDataCloudProperties::new().set_identity("example");
2051 /// ```
2052 pub fn set_identity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2053 self.identity = v.into();
2054 self
2055 }
2056
2057 /// Sets the value of [tenant_id][crate::model::SalesforceDataCloudProperties::tenant_id].
2058 ///
2059 /// # Example
2060 /// ```ignore,no_run
2061 /// # use google_cloud_bigquery_connection_v1::model::SalesforceDataCloudProperties;
2062 /// let x = SalesforceDataCloudProperties::new().set_tenant_id("example");
2063 /// ```
2064 pub fn set_tenant_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2065 self.tenant_id = v.into();
2066 self
2067 }
2068}
2069
2070impl wkt::message::Message for SalesforceDataCloudProperties {
2071 fn typename() -> &'static str {
2072 "type.googleapis.com/google.cloud.bigquery.connection.v1.SalesforceDataCloudProperties"
2073 }
2074}