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