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    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
65        self.parent = v.into();
66        self
67    }
68
69    /// Sets the value of [connection_id][crate::model::CreateConnectionRequest::connection_id].
70    pub fn set_connection_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
71        self.connection_id = v.into();
72        self
73    }
74
75    /// Sets the value of [connection][crate::model::CreateConnectionRequest::connection].
76    pub fn set_connection<T>(mut self, v: T) -> Self
77    where
78        T: std::convert::Into<crate::model::Connection>,
79    {
80        self.connection = std::option::Option::Some(v.into());
81        self
82    }
83
84    /// Sets or clears the value of [connection][crate::model::CreateConnectionRequest::connection].
85    pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
86    where
87        T: std::convert::Into<crate::model::Connection>,
88    {
89        self.connection = v.map(|x| x.into());
90        self
91    }
92}
93
94impl wkt::message::Message for CreateConnectionRequest {
95    fn typename() -> &'static str {
96        "type.googleapis.com/google.cloud.bigquery.connection.v1.CreateConnectionRequest"
97    }
98}
99
100/// The request for
101/// [ConnectionService.GetConnection][google.cloud.bigquery.connection.v1.ConnectionService.GetConnection].
102///
103/// [google.cloud.bigquery.connection.v1.ConnectionService.GetConnection]: crate::client::ConnectionService::get_connection
104#[derive(Clone, Default, PartialEq)]
105#[non_exhaustive]
106pub struct GetConnectionRequest {
107    /// Required. Name of the requested connection, for example:
108    /// `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
109    pub name: std::string::String,
110
111    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
112}
113
114impl GetConnectionRequest {
115    pub fn new() -> Self {
116        std::default::Default::default()
117    }
118
119    /// Sets the value of [name][crate::model::GetConnectionRequest::name].
120    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
121        self.name = v.into();
122        self
123    }
124}
125
126impl wkt::message::Message for GetConnectionRequest {
127    fn typename() -> &'static str {
128        "type.googleapis.com/google.cloud.bigquery.connection.v1.GetConnectionRequest"
129    }
130}
131
132/// The request for
133/// [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1.ConnectionService.ListConnections].
134///
135/// [google.cloud.bigquery.connection.v1.ConnectionService.ListConnections]: crate::client::ConnectionService::list_connections
136#[derive(Clone, Default, PartialEq)]
137#[non_exhaustive]
138pub struct ListConnectionsRequest {
139    /// Required. Parent resource name.
140    /// Must be in the form: `projects/{project_id}/locations/{location_id}`
141    pub parent: std::string::String,
142
143    /// Required. Page size.
144    pub page_size: i32,
145
146    /// Page token.
147    pub page_token: std::string::String,
148
149    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
150}
151
152impl ListConnectionsRequest {
153    pub fn new() -> Self {
154        std::default::Default::default()
155    }
156
157    /// Sets the value of [parent][crate::model::ListConnectionsRequest::parent].
158    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
159        self.parent = v.into();
160        self
161    }
162
163    /// Sets the value of [page_size][crate::model::ListConnectionsRequest::page_size].
164    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
165        self.page_size = v.into();
166        self
167    }
168
169    /// Sets the value of [page_token][crate::model::ListConnectionsRequest::page_token].
170    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
171        self.page_token = v.into();
172        self
173    }
174}
175
176impl wkt::message::Message for ListConnectionsRequest {
177    fn typename() -> &'static str {
178        "type.googleapis.com/google.cloud.bigquery.connection.v1.ListConnectionsRequest"
179    }
180}
181
182/// The response for
183/// [ConnectionService.ListConnections][google.cloud.bigquery.connection.v1.ConnectionService.ListConnections].
184///
185/// [google.cloud.bigquery.connection.v1.ConnectionService.ListConnections]: crate::client::ConnectionService::list_connections
186#[derive(Clone, Default, PartialEq)]
187#[non_exhaustive]
188pub struct ListConnectionsResponse {
189    /// Next page token.
190    pub next_page_token: std::string::String,
191
192    /// List of connections.
193    pub connections: std::vec::Vec<crate::model::Connection>,
194
195    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
196}
197
198impl ListConnectionsResponse {
199    pub fn new() -> Self {
200        std::default::Default::default()
201    }
202
203    /// Sets the value of [next_page_token][crate::model::ListConnectionsResponse::next_page_token].
204    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
205        self.next_page_token = v.into();
206        self
207    }
208
209    /// Sets the value of [connections][crate::model::ListConnectionsResponse::connections].
210    pub fn set_connections<T, V>(mut self, v: T) -> Self
211    where
212        T: std::iter::IntoIterator<Item = V>,
213        V: std::convert::Into<crate::model::Connection>,
214    {
215        use std::iter::Iterator;
216        self.connections = v.into_iter().map(|i| i.into()).collect();
217        self
218    }
219}
220
221impl wkt::message::Message for ListConnectionsResponse {
222    fn typename() -> &'static str {
223        "type.googleapis.com/google.cloud.bigquery.connection.v1.ListConnectionsResponse"
224    }
225}
226
227#[doc(hidden)]
228impl gax::paginator::internal::PageableResponse for ListConnectionsResponse {
229    type PageItem = crate::model::Connection;
230
231    fn items(self) -> std::vec::Vec<Self::PageItem> {
232        self.connections
233    }
234
235    fn next_page_token(&self) -> std::string::String {
236        use std::clone::Clone;
237        self.next_page_token.clone()
238    }
239}
240
241/// The request for
242/// [ConnectionService.UpdateConnection][google.cloud.bigquery.connection.v1.ConnectionService.UpdateConnection].
243///
244/// [google.cloud.bigquery.connection.v1.ConnectionService.UpdateConnection]: crate::client::ConnectionService::update_connection
245#[derive(Clone, Default, PartialEq)]
246#[non_exhaustive]
247pub struct UpdateConnectionRequest {
248    /// Required. Name of the connection to update, for example:
249    /// `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
250    pub name: std::string::String,
251
252    /// Required. Connection containing the updated fields.
253    pub connection: std::option::Option<crate::model::Connection>,
254
255    /// Required. Update mask for the connection fields to be updated.
256    pub update_mask: std::option::Option<wkt::FieldMask>,
257
258    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
259}
260
261impl UpdateConnectionRequest {
262    pub fn new() -> Self {
263        std::default::Default::default()
264    }
265
266    /// Sets the value of [name][crate::model::UpdateConnectionRequest::name].
267    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
268        self.name = v.into();
269        self
270    }
271
272    /// Sets the value of [connection][crate::model::UpdateConnectionRequest::connection].
273    pub fn set_connection<T>(mut self, v: T) -> Self
274    where
275        T: std::convert::Into<crate::model::Connection>,
276    {
277        self.connection = std::option::Option::Some(v.into());
278        self
279    }
280
281    /// Sets or clears the value of [connection][crate::model::UpdateConnectionRequest::connection].
282    pub fn set_or_clear_connection<T>(mut self, v: std::option::Option<T>) -> Self
283    where
284        T: std::convert::Into<crate::model::Connection>,
285    {
286        self.connection = v.map(|x| x.into());
287        self
288    }
289
290    /// Sets the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
291    pub fn set_update_mask<T>(mut self, v: T) -> Self
292    where
293        T: std::convert::Into<wkt::FieldMask>,
294    {
295        self.update_mask = std::option::Option::Some(v.into());
296        self
297    }
298
299    /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionRequest::update_mask].
300    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
301    where
302        T: std::convert::Into<wkt::FieldMask>,
303    {
304        self.update_mask = v.map(|x| x.into());
305        self
306    }
307}
308
309impl wkt::message::Message for UpdateConnectionRequest {
310    fn typename() -> &'static str {
311        "type.googleapis.com/google.cloud.bigquery.connection.v1.UpdateConnectionRequest"
312    }
313}
314
315/// The request for [ConnectionService.DeleteConnectionRequest][].
316#[derive(Clone, Default, PartialEq)]
317#[non_exhaustive]
318pub struct DeleteConnectionRequest {
319    /// Required. Name of the deleted connection, for example:
320    /// `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
321    pub name: std::string::String,
322
323    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
324}
325
326impl DeleteConnectionRequest {
327    pub fn new() -> Self {
328        std::default::Default::default()
329    }
330
331    /// Sets the value of [name][crate::model::DeleteConnectionRequest::name].
332    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
333        self.name = v.into();
334        self
335    }
336}
337
338impl wkt::message::Message for DeleteConnectionRequest {
339    fn typename() -> &'static str {
340        "type.googleapis.com/google.cloud.bigquery.connection.v1.DeleteConnectionRequest"
341    }
342}
343
344/// Configuration parameters to establish connection with an external data
345/// source, except the credential attributes.
346#[derive(Clone, Default, PartialEq)]
347#[non_exhaustive]
348pub struct Connection {
349    /// The resource name of the connection in the form of:
350    /// `projects/{project_id}/locations/{location_id}/connections/{connection_id}`
351    pub name: std::string::String,
352
353    /// User provided display name for the connection.
354    pub friendly_name: std::string::String,
355
356    /// User provided description.
357    pub description: std::string::String,
358
359    /// Output only. The creation timestamp of the connection.
360    pub creation_time: i64,
361
362    /// Output only. The last update timestamp of the connection.
363    pub last_modified_time: i64,
364
365    /// Output only. True, if credential is configured for this connection.
366    pub has_credential: bool,
367
368    /// Properties specific to the underlying data source.
369    pub properties: std::option::Option<crate::model::connection::Properties>,
370
371    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
372}
373
374impl Connection {
375    pub fn new() -> Self {
376        std::default::Default::default()
377    }
378
379    /// Sets the value of [name][crate::model::Connection::name].
380    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
381        self.name = v.into();
382        self
383    }
384
385    /// Sets the value of [friendly_name][crate::model::Connection::friendly_name].
386    pub fn set_friendly_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
387        self.friendly_name = v.into();
388        self
389    }
390
391    /// Sets the value of [description][crate::model::Connection::description].
392    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
393        self.description = v.into();
394        self
395    }
396
397    /// Sets the value of [creation_time][crate::model::Connection::creation_time].
398    pub fn set_creation_time<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
399        self.creation_time = v.into();
400        self
401    }
402
403    /// Sets the value of [last_modified_time][crate::model::Connection::last_modified_time].
404    pub fn set_last_modified_time<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
405        self.last_modified_time = v.into();
406        self
407    }
408
409    /// Sets the value of [has_credential][crate::model::Connection::has_credential].
410    pub fn set_has_credential<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
411        self.has_credential = v.into();
412        self
413    }
414
415    /// Sets the value of [properties][crate::model::Connection::properties].
416    ///
417    /// Note that all the setters affecting `properties` are mutually
418    /// exclusive.
419    pub fn set_properties<
420        T: std::convert::Into<std::option::Option<crate::model::connection::Properties>>,
421    >(
422        mut self,
423        v: T,
424    ) -> Self {
425        self.properties = v.into();
426        self
427    }
428
429    /// The value of [properties][crate::model::Connection::properties]
430    /// if it holds a `CloudSql`, `None` if the field is not set or
431    /// holds a different branch.
432    pub fn cloud_sql(
433        &self,
434    ) -> std::option::Option<&std::boxed::Box<crate::model::CloudSqlProperties>> {
435        #[allow(unreachable_patterns)]
436        self.properties.as_ref().and_then(|v| match v {
437            crate::model::connection::Properties::CloudSql(v) => std::option::Option::Some(v),
438            _ => std::option::Option::None,
439        })
440    }
441
442    /// Sets the value of [properties][crate::model::Connection::properties]
443    /// to hold a `CloudSql`.
444    ///
445    /// Note that all the setters affecting `properties` are
446    /// mutually exclusive.
447    pub fn set_cloud_sql<
448        T: std::convert::Into<std::boxed::Box<crate::model::CloudSqlProperties>>,
449    >(
450        mut self,
451        v: T,
452    ) -> Self {
453        self.properties =
454            std::option::Option::Some(crate::model::connection::Properties::CloudSql(v.into()));
455        self
456    }
457
458    /// The value of [properties][crate::model::Connection::properties]
459    /// if it holds a `Aws`, `None` if the field is not set or
460    /// holds a different branch.
461    pub fn aws(&self) -> std::option::Option<&std::boxed::Box<crate::model::AwsProperties>> {
462        #[allow(unreachable_patterns)]
463        self.properties.as_ref().and_then(|v| match v {
464            crate::model::connection::Properties::Aws(v) => std::option::Option::Some(v),
465            _ => std::option::Option::None,
466        })
467    }
468
469    /// Sets the value of [properties][crate::model::Connection::properties]
470    /// to hold a `Aws`.
471    ///
472    /// Note that all the setters affecting `properties` are
473    /// mutually exclusive.
474    pub fn set_aws<T: std::convert::Into<std::boxed::Box<crate::model::AwsProperties>>>(
475        mut self,
476        v: T,
477    ) -> Self {
478        self.properties =
479            std::option::Option::Some(crate::model::connection::Properties::Aws(v.into()));
480        self
481    }
482
483    /// The value of [properties][crate::model::Connection::properties]
484    /// if it holds a `Azure`, `None` if the field is not set or
485    /// holds a different branch.
486    pub fn azure(&self) -> std::option::Option<&std::boxed::Box<crate::model::AzureProperties>> {
487        #[allow(unreachable_patterns)]
488        self.properties.as_ref().and_then(|v| match v {
489            crate::model::connection::Properties::Azure(v) => std::option::Option::Some(v),
490            _ => std::option::Option::None,
491        })
492    }
493
494    /// Sets the value of [properties][crate::model::Connection::properties]
495    /// to hold a `Azure`.
496    ///
497    /// Note that all the setters affecting `properties` are
498    /// mutually exclusive.
499    pub fn set_azure<T: std::convert::Into<std::boxed::Box<crate::model::AzureProperties>>>(
500        mut self,
501        v: T,
502    ) -> Self {
503        self.properties =
504            std::option::Option::Some(crate::model::connection::Properties::Azure(v.into()));
505        self
506    }
507
508    /// The value of [properties][crate::model::Connection::properties]
509    /// if it holds a `CloudSpanner`, `None` if the field is not set or
510    /// holds a different branch.
511    pub fn cloud_spanner(
512        &self,
513    ) -> std::option::Option<&std::boxed::Box<crate::model::CloudSpannerProperties>> {
514        #[allow(unreachable_patterns)]
515        self.properties.as_ref().and_then(|v| match v {
516            crate::model::connection::Properties::CloudSpanner(v) => std::option::Option::Some(v),
517            _ => std::option::Option::None,
518        })
519    }
520
521    /// Sets the value of [properties][crate::model::Connection::properties]
522    /// to hold a `CloudSpanner`.
523    ///
524    /// Note that all the setters affecting `properties` are
525    /// mutually exclusive.
526    pub fn set_cloud_spanner<
527        T: std::convert::Into<std::boxed::Box<crate::model::CloudSpannerProperties>>,
528    >(
529        mut self,
530        v: T,
531    ) -> Self {
532        self.properties =
533            std::option::Option::Some(crate::model::connection::Properties::CloudSpanner(v.into()));
534        self
535    }
536
537    /// The value of [properties][crate::model::Connection::properties]
538    /// if it holds a `CloudResource`, `None` if the field is not set or
539    /// holds a different branch.
540    pub fn cloud_resource(
541        &self,
542    ) -> std::option::Option<&std::boxed::Box<crate::model::CloudResourceProperties>> {
543        #[allow(unreachable_patterns)]
544        self.properties.as_ref().and_then(|v| match v {
545            crate::model::connection::Properties::CloudResource(v) => std::option::Option::Some(v),
546            _ => std::option::Option::None,
547        })
548    }
549
550    /// Sets the value of [properties][crate::model::Connection::properties]
551    /// to hold a `CloudResource`.
552    ///
553    /// Note that all the setters affecting `properties` are
554    /// mutually exclusive.
555    pub fn set_cloud_resource<
556        T: std::convert::Into<std::boxed::Box<crate::model::CloudResourceProperties>>,
557    >(
558        mut self,
559        v: T,
560    ) -> Self {
561        self.properties = std::option::Option::Some(
562            crate::model::connection::Properties::CloudResource(v.into()),
563        );
564        self
565    }
566
567    /// The value of [properties][crate::model::Connection::properties]
568    /// if it holds a `Spark`, `None` if the field is not set or
569    /// holds a different branch.
570    pub fn spark(&self) -> std::option::Option<&std::boxed::Box<crate::model::SparkProperties>> {
571        #[allow(unreachable_patterns)]
572        self.properties.as_ref().and_then(|v| match v {
573            crate::model::connection::Properties::Spark(v) => std::option::Option::Some(v),
574            _ => std::option::Option::None,
575        })
576    }
577
578    /// Sets the value of [properties][crate::model::Connection::properties]
579    /// to hold a `Spark`.
580    ///
581    /// Note that all the setters affecting `properties` are
582    /// mutually exclusive.
583    pub fn set_spark<T: std::convert::Into<std::boxed::Box<crate::model::SparkProperties>>>(
584        mut self,
585        v: T,
586    ) -> Self {
587        self.properties =
588            std::option::Option::Some(crate::model::connection::Properties::Spark(v.into()));
589        self
590    }
591
592    /// The value of [properties][crate::model::Connection::properties]
593    /// if it holds a `SalesforceDataCloud`, `None` if the field is not set or
594    /// holds a different branch.
595    pub fn salesforce_data_cloud(
596        &self,
597    ) -> std::option::Option<&std::boxed::Box<crate::model::SalesforceDataCloudProperties>> {
598        #[allow(unreachable_patterns)]
599        self.properties.as_ref().and_then(|v| match v {
600            crate::model::connection::Properties::SalesforceDataCloud(v) => {
601                std::option::Option::Some(v)
602            }
603            _ => std::option::Option::None,
604        })
605    }
606
607    /// Sets the value of [properties][crate::model::Connection::properties]
608    /// to hold a `SalesforceDataCloud`.
609    ///
610    /// Note that all the setters affecting `properties` are
611    /// mutually exclusive.
612    pub fn set_salesforce_data_cloud<
613        T: std::convert::Into<std::boxed::Box<crate::model::SalesforceDataCloudProperties>>,
614    >(
615        mut self,
616        v: T,
617    ) -> Self {
618        self.properties = std::option::Option::Some(
619            crate::model::connection::Properties::SalesforceDataCloud(v.into()),
620        );
621        self
622    }
623}
624
625impl wkt::message::Message for Connection {
626    fn typename() -> &'static str {
627        "type.googleapis.com/google.cloud.bigquery.connection.v1.Connection"
628    }
629}
630
631/// Defines additional types related to [Connection].
632pub mod connection {
633    #[allow(unused_imports)]
634    use super::*;
635
636    /// Properties specific to the underlying data source.
637    #[derive(Clone, Debug, PartialEq)]
638    #[non_exhaustive]
639    pub enum Properties {
640        /// Cloud SQL properties.
641        CloudSql(std::boxed::Box<crate::model::CloudSqlProperties>),
642        /// Amazon Web Services (AWS) properties.
643        Aws(std::boxed::Box<crate::model::AwsProperties>),
644        /// Azure properties.
645        Azure(std::boxed::Box<crate::model::AzureProperties>),
646        /// Cloud Spanner properties.
647        CloudSpanner(std::boxed::Box<crate::model::CloudSpannerProperties>),
648        /// Cloud Resource properties.
649        CloudResource(std::boxed::Box<crate::model::CloudResourceProperties>),
650        /// Spark properties.
651        Spark(std::boxed::Box<crate::model::SparkProperties>),
652        /// Optional. Salesforce DataCloud properties. This field is intended for
653        /// use only by Salesforce partner projects. This field contains properties
654        /// for your Salesforce DataCloud connection.
655        SalesforceDataCloud(std::boxed::Box<crate::model::SalesforceDataCloudProperties>),
656    }
657}
658
659/// Connection properties specific to the Cloud SQL.
660#[derive(Clone, Default, PartialEq)]
661#[non_exhaustive]
662pub struct CloudSqlProperties {
663    /// Cloud SQL instance ID in the form `project:location:instance`.
664    pub instance_id: std::string::String,
665
666    /// Database name.
667    pub database: std::string::String,
668
669    /// Type of the Cloud SQL database.
670    pub r#type: crate::model::cloud_sql_properties::DatabaseType,
671
672    /// Input only. Cloud SQL credential.
673    pub credential: std::option::Option<crate::model::CloudSqlCredential>,
674
675    /// Output only. The account ID of the service used for the purpose of this
676    /// connection.
677    ///
678    /// When the connection is used in the context of an operation in
679    /// BigQuery, this service account will serve as the identity being used for
680    /// connecting to the CloudSQL instance specified in this connection.
681    pub service_account_id: std::string::String,
682
683    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
684}
685
686impl CloudSqlProperties {
687    pub fn new() -> Self {
688        std::default::Default::default()
689    }
690
691    /// Sets the value of [instance_id][crate::model::CloudSqlProperties::instance_id].
692    pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
693        self.instance_id = v.into();
694        self
695    }
696
697    /// Sets the value of [database][crate::model::CloudSqlProperties::database].
698    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
699        self.database = v.into();
700        self
701    }
702
703    /// Sets the value of [r#type][crate::model::CloudSqlProperties::type].
704    pub fn set_type<T: std::convert::Into<crate::model::cloud_sql_properties::DatabaseType>>(
705        mut self,
706        v: T,
707    ) -> Self {
708        self.r#type = v.into();
709        self
710    }
711
712    /// Sets the value of [credential][crate::model::CloudSqlProperties::credential].
713    pub fn set_credential<T>(mut self, v: T) -> Self
714    where
715        T: std::convert::Into<crate::model::CloudSqlCredential>,
716    {
717        self.credential = std::option::Option::Some(v.into());
718        self
719    }
720
721    /// Sets or clears the value of [credential][crate::model::CloudSqlProperties::credential].
722    pub fn set_or_clear_credential<T>(mut self, v: std::option::Option<T>) -> Self
723    where
724        T: std::convert::Into<crate::model::CloudSqlCredential>,
725    {
726        self.credential = v.map(|x| x.into());
727        self
728    }
729
730    /// Sets the value of [service_account_id][crate::model::CloudSqlProperties::service_account_id].
731    pub fn set_service_account_id<T: std::convert::Into<std::string::String>>(
732        mut self,
733        v: T,
734    ) -> Self {
735        self.service_account_id = v.into();
736        self
737    }
738}
739
740impl wkt::message::Message for CloudSqlProperties {
741    fn typename() -> &'static str {
742        "type.googleapis.com/google.cloud.bigquery.connection.v1.CloudSqlProperties"
743    }
744}
745
746/// Defines additional types related to [CloudSqlProperties].
747pub mod cloud_sql_properties {
748    #[allow(unused_imports)]
749    use super::*;
750
751    /// Supported Cloud SQL database types.
752    ///
753    /// # Working with unknown values
754    ///
755    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
756    /// additional enum variants at any time. Adding new variants is not considered
757    /// a breaking change. Applications should write their code in anticipation of:
758    ///
759    /// - New values appearing in future releases of the client library, **and**
760    /// - New values received dynamically, without application changes.
761    ///
762    /// Please consult the [Working with enums] section in the user guide for some
763    /// guidelines.
764    ///
765    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
766    #[derive(Clone, Debug, PartialEq)]
767    #[non_exhaustive]
768    pub enum DatabaseType {
769        /// Unspecified database type.
770        Unspecified,
771        /// Cloud SQL for PostgreSQL.
772        Postgres,
773        /// Cloud SQL for MySQL.
774        Mysql,
775        /// If set, the enum was initialized with an unknown value.
776        ///
777        /// Applications can examine the value using [DatabaseType::value] or
778        /// [DatabaseType::name].
779        UnknownValue(database_type::UnknownValue),
780    }
781
782    #[doc(hidden)]
783    pub mod database_type {
784        #[allow(unused_imports)]
785        use super::*;
786        #[derive(Clone, Debug, PartialEq)]
787        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
788    }
789
790    impl DatabaseType {
791        /// Gets the enum value.
792        ///
793        /// Returns `None` if the enum contains an unknown value deserialized from
794        /// the string representation of enums.
795        pub fn value(&self) -> std::option::Option<i32> {
796            match self {
797                Self::Unspecified => std::option::Option::Some(0),
798                Self::Postgres => std::option::Option::Some(1),
799                Self::Mysql => std::option::Option::Some(2),
800                Self::UnknownValue(u) => u.0.value(),
801            }
802        }
803
804        /// Gets the enum value as a string.
805        ///
806        /// Returns `None` if the enum contains an unknown value deserialized from
807        /// the integer representation of enums.
808        pub fn name(&self) -> std::option::Option<&str> {
809            match self {
810                Self::Unspecified => std::option::Option::Some("DATABASE_TYPE_UNSPECIFIED"),
811                Self::Postgres => std::option::Option::Some("POSTGRES"),
812                Self::Mysql => std::option::Option::Some("MYSQL"),
813                Self::UnknownValue(u) => u.0.name(),
814            }
815        }
816    }
817
818    impl std::default::Default for DatabaseType {
819        fn default() -> Self {
820            use std::convert::From;
821            Self::from(0)
822        }
823    }
824
825    impl std::fmt::Display for DatabaseType {
826        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
827            wkt::internal::display_enum(f, self.name(), self.value())
828        }
829    }
830
831    impl std::convert::From<i32> for DatabaseType {
832        fn from(value: i32) -> Self {
833            match value {
834                0 => Self::Unspecified,
835                1 => Self::Postgres,
836                2 => Self::Mysql,
837                _ => Self::UnknownValue(database_type::UnknownValue(
838                    wkt::internal::UnknownEnumValue::Integer(value),
839                )),
840            }
841        }
842    }
843
844    impl std::convert::From<&str> for DatabaseType {
845        fn from(value: &str) -> Self {
846            use std::string::ToString;
847            match value {
848                "DATABASE_TYPE_UNSPECIFIED" => Self::Unspecified,
849                "POSTGRES" => Self::Postgres,
850                "MYSQL" => Self::Mysql,
851                _ => Self::UnknownValue(database_type::UnknownValue(
852                    wkt::internal::UnknownEnumValue::String(value.to_string()),
853                )),
854            }
855        }
856    }
857
858    impl serde::ser::Serialize for DatabaseType {
859        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
860        where
861            S: serde::Serializer,
862        {
863            match self {
864                Self::Unspecified => serializer.serialize_i32(0),
865                Self::Postgres => serializer.serialize_i32(1),
866                Self::Mysql => serializer.serialize_i32(2),
867                Self::UnknownValue(u) => u.0.serialize(serializer),
868            }
869        }
870    }
871
872    impl<'de> serde::de::Deserialize<'de> for DatabaseType {
873        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
874        where
875            D: serde::Deserializer<'de>,
876        {
877            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DatabaseType>::new(
878                ".google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType",
879            ))
880        }
881    }
882}
883
884/// Credential info for the Cloud SQL.
885#[derive(Clone, Default, PartialEq)]
886#[non_exhaustive]
887pub struct CloudSqlCredential {
888    /// The username for the credential.
889    pub username: std::string::String,
890
891    /// The password for the credential.
892    pub password: std::string::String,
893
894    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
895}
896
897impl CloudSqlCredential {
898    pub fn new() -> Self {
899        std::default::Default::default()
900    }
901
902    /// Sets the value of [username][crate::model::CloudSqlCredential::username].
903    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
904        self.username = v.into();
905        self
906    }
907
908    /// Sets the value of [password][crate::model::CloudSqlCredential::password].
909    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
910        self.password = v.into();
911        self
912    }
913}
914
915impl wkt::message::Message for CloudSqlCredential {
916    fn typename() -> &'static str {
917        "type.googleapis.com/google.cloud.bigquery.connection.v1.CloudSqlCredential"
918    }
919}
920
921/// Connection properties specific to Cloud Spanner.
922#[derive(Clone, Default, PartialEq)]
923#[non_exhaustive]
924pub struct CloudSpannerProperties {
925    /// Cloud Spanner database in the form `project/instance/database'
926    pub database: std::string::String,
927
928    /// If parallelism should be used when reading from Cloud Spanner
929    pub use_parallelism: bool,
930
931    /// Allows setting max parallelism per query when executing on Spanner
932    /// independent compute resources. If unspecified, default values of
933    /// parallelism are chosen that are dependent on the Cloud Spanner instance
934    /// configuration.
935    ///
936    /// REQUIRES: `use_parallelism` must be set.
937    /// REQUIRES: Either `use_data_boost` or `use_serverless_analytics` must be
938    /// set.
939    pub max_parallelism: i32,
940
941    /// If the serverless analytics service should be used to read data from Cloud
942    /// Spanner.
943    /// Note: `use_parallelism` must be set when using serverless analytics.
944    pub use_serverless_analytics: bool,
945
946    /// If set, the request will be executed via Spanner independent compute
947    /// resources.
948    /// REQUIRES: `use_parallelism` must be set.
949    ///
950    /// NOTE: `use_serverless_analytics` will be deprecated. Prefer
951    /// `use_data_boost` over `use_serverless_analytics`.
952    pub use_data_boost: bool,
953
954    /// Optional. Cloud Spanner database role for fine-grained access control.
955    /// The Cloud Spanner admin should have provisioned the database role with
956    /// appropriate permissions, such as `SELECT` and `INSERT`. Other users should
957    /// only use roles provided by their Cloud Spanner admins.
958    ///
959    /// For more details, see [About fine-grained access control]
960    /// (<https://cloud.google.com/spanner/docs/fgac-about>).
961    ///
962    /// REQUIRES: The database role name must start with a letter, and can only
963    /// contain letters, numbers, and underscores.
964    pub database_role: std::string::String,
965
966    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
967}
968
969impl CloudSpannerProperties {
970    pub fn new() -> Self {
971        std::default::Default::default()
972    }
973
974    /// Sets the value of [database][crate::model::CloudSpannerProperties::database].
975    pub fn set_database<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
976        self.database = v.into();
977        self
978    }
979
980    /// Sets the value of [use_parallelism][crate::model::CloudSpannerProperties::use_parallelism].
981    pub fn set_use_parallelism<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
982        self.use_parallelism = v.into();
983        self
984    }
985
986    /// Sets the value of [max_parallelism][crate::model::CloudSpannerProperties::max_parallelism].
987    pub fn set_max_parallelism<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
988        self.max_parallelism = v.into();
989        self
990    }
991
992    /// Sets the value of [use_serverless_analytics][crate::model::CloudSpannerProperties::use_serverless_analytics].
993    pub fn set_use_serverless_analytics<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
994        self.use_serverless_analytics = v.into();
995        self
996    }
997
998    /// Sets the value of [use_data_boost][crate::model::CloudSpannerProperties::use_data_boost].
999    pub fn set_use_data_boost<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1000        self.use_data_boost = v.into();
1001        self
1002    }
1003
1004    /// Sets the value of [database_role][crate::model::CloudSpannerProperties::database_role].
1005    pub fn set_database_role<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1006        self.database_role = v.into();
1007        self
1008    }
1009}
1010
1011impl wkt::message::Message for CloudSpannerProperties {
1012    fn typename() -> &'static str {
1013        "type.googleapis.com/google.cloud.bigquery.connection.v1.CloudSpannerProperties"
1014    }
1015}
1016
1017/// Connection properties specific to Amazon Web Services (AWS).
1018#[derive(Clone, Default, PartialEq)]
1019#[non_exhaustive]
1020pub struct AwsProperties {
1021    /// Authentication method chosen at connection creation.
1022    pub authentication_method:
1023        std::option::Option<crate::model::aws_properties::AuthenticationMethod>,
1024
1025    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1026}
1027
1028impl AwsProperties {
1029    pub fn new() -> Self {
1030        std::default::Default::default()
1031    }
1032
1033    /// Sets the value of [authentication_method][crate::model::AwsProperties::authentication_method].
1034    ///
1035    /// Note that all the setters affecting `authentication_method` are mutually
1036    /// exclusive.
1037    pub fn set_authentication_method<
1038        T: std::convert::Into<std::option::Option<crate::model::aws_properties::AuthenticationMethod>>,
1039    >(
1040        mut self,
1041        v: T,
1042    ) -> Self {
1043        self.authentication_method = v.into();
1044        self
1045    }
1046
1047    /// The value of [authentication_method][crate::model::AwsProperties::authentication_method]
1048    /// if it holds a `CrossAccountRole`, `None` if the field is not set or
1049    /// holds a different branch.
1050    #[deprecated]
1051    pub fn cross_account_role(
1052        &self,
1053    ) -> std::option::Option<&std::boxed::Box<crate::model::AwsCrossAccountRole>> {
1054        #[allow(unreachable_patterns)]
1055        self.authentication_method.as_ref().and_then(|v| match v {
1056            crate::model::aws_properties::AuthenticationMethod::CrossAccountRole(v) => {
1057                std::option::Option::Some(v)
1058            }
1059            _ => std::option::Option::None,
1060        })
1061    }
1062
1063    /// Sets the value of [authentication_method][crate::model::AwsProperties::authentication_method]
1064    /// to hold a `CrossAccountRole`.
1065    ///
1066    /// Note that all the setters affecting `authentication_method` are
1067    /// mutually exclusive.
1068    #[deprecated]
1069    pub fn set_cross_account_role<
1070        T: std::convert::Into<std::boxed::Box<crate::model::AwsCrossAccountRole>>,
1071    >(
1072        mut self,
1073        v: T,
1074    ) -> Self {
1075        self.authentication_method = std::option::Option::Some(
1076            crate::model::aws_properties::AuthenticationMethod::CrossAccountRole(v.into()),
1077        );
1078        self
1079    }
1080
1081    /// The value of [authentication_method][crate::model::AwsProperties::authentication_method]
1082    /// if it holds a `AccessRole`, `None` if the field is not set or
1083    /// holds a different branch.
1084    pub fn access_role(
1085        &self,
1086    ) -> std::option::Option<&std::boxed::Box<crate::model::AwsAccessRole>> {
1087        #[allow(unreachable_patterns)]
1088        self.authentication_method.as_ref().and_then(|v| match v {
1089            crate::model::aws_properties::AuthenticationMethod::AccessRole(v) => {
1090                std::option::Option::Some(v)
1091            }
1092            _ => std::option::Option::None,
1093        })
1094    }
1095
1096    /// Sets the value of [authentication_method][crate::model::AwsProperties::authentication_method]
1097    /// to hold a `AccessRole`.
1098    ///
1099    /// Note that all the setters affecting `authentication_method` are
1100    /// mutually exclusive.
1101    pub fn set_access_role<T: std::convert::Into<std::boxed::Box<crate::model::AwsAccessRole>>>(
1102        mut self,
1103        v: T,
1104    ) -> Self {
1105        self.authentication_method = std::option::Option::Some(
1106            crate::model::aws_properties::AuthenticationMethod::AccessRole(v.into()),
1107        );
1108        self
1109    }
1110}
1111
1112impl wkt::message::Message for AwsProperties {
1113    fn typename() -> &'static str {
1114        "type.googleapis.com/google.cloud.bigquery.connection.v1.AwsProperties"
1115    }
1116}
1117
1118/// Defines additional types related to [AwsProperties].
1119pub mod aws_properties {
1120    #[allow(unused_imports)]
1121    use super::*;
1122
1123    /// Authentication method chosen at connection creation.
1124    #[derive(Clone, Debug, PartialEq)]
1125    #[non_exhaustive]
1126    pub enum AuthenticationMethod {
1127        /// Authentication using Google owned AWS IAM user's access key to assume
1128        /// into customer's AWS IAM Role.
1129        /// Deprecated, do not use.
1130        #[deprecated]
1131        CrossAccountRole(std::boxed::Box<crate::model::AwsCrossAccountRole>),
1132        /// Authentication using Google owned service account to assume into
1133        /// customer's AWS IAM Role.
1134        AccessRole(std::boxed::Box<crate::model::AwsAccessRole>),
1135    }
1136}
1137
1138/// Authentication method for Amazon Web Services (AWS) that uses Google owned
1139/// AWS IAM user's access key to assume into customer's AWS IAM Role.
1140#[derive(Clone, Default, PartialEq)]
1141#[non_exhaustive]
1142pub struct AwsCrossAccountRole {
1143    /// The user’s AWS IAM Role that trusts the Google-owned AWS IAM user
1144    /// Connection.
1145    pub iam_role_id: std::string::String,
1146
1147    /// Output only. Google-owned AWS IAM User for a Connection.
1148    pub iam_user_id: std::string::String,
1149
1150    /// Output only. A Google-generated id for representing Connection’s identity
1151    /// in AWS. External Id is also used for preventing the Confused Deputy
1152    /// Problem. See
1153    /// <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html>
1154    pub external_id: std::string::String,
1155
1156    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1157}
1158
1159impl AwsCrossAccountRole {
1160    pub fn new() -> Self {
1161        std::default::Default::default()
1162    }
1163
1164    /// Sets the value of [iam_role_id][crate::model::AwsCrossAccountRole::iam_role_id].
1165    pub fn set_iam_role_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1166        self.iam_role_id = v.into();
1167        self
1168    }
1169
1170    /// Sets the value of [iam_user_id][crate::model::AwsCrossAccountRole::iam_user_id].
1171    pub fn set_iam_user_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1172        self.iam_user_id = v.into();
1173        self
1174    }
1175
1176    /// Sets the value of [external_id][crate::model::AwsCrossAccountRole::external_id].
1177    pub fn set_external_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1178        self.external_id = v.into();
1179        self
1180    }
1181}
1182
1183impl wkt::message::Message for AwsCrossAccountRole {
1184    fn typename() -> &'static str {
1185        "type.googleapis.com/google.cloud.bigquery.connection.v1.AwsCrossAccountRole"
1186    }
1187}
1188
1189/// Authentication method for Amazon Web Services (AWS) that uses Google owned
1190/// Google service account to assume into customer's AWS IAM Role.
1191#[derive(Clone, Default, PartialEq)]
1192#[non_exhaustive]
1193pub struct AwsAccessRole {
1194    /// The user’s AWS IAM Role that trusts the Google-owned AWS IAM user
1195    /// Connection.
1196    pub iam_role_id: std::string::String,
1197
1198    /// A unique Google-owned and Google-generated identity for the Connection.
1199    /// This identity will be used to access the user's AWS IAM Role.
1200    pub identity: std::string::String,
1201
1202    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1203}
1204
1205impl AwsAccessRole {
1206    pub fn new() -> Self {
1207        std::default::Default::default()
1208    }
1209
1210    /// Sets the value of [iam_role_id][crate::model::AwsAccessRole::iam_role_id].
1211    pub fn set_iam_role_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1212        self.iam_role_id = v.into();
1213        self
1214    }
1215
1216    /// Sets the value of [identity][crate::model::AwsAccessRole::identity].
1217    pub fn set_identity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1218        self.identity = v.into();
1219        self
1220    }
1221}
1222
1223impl wkt::message::Message for AwsAccessRole {
1224    fn typename() -> &'static str {
1225        "type.googleapis.com/google.cloud.bigquery.connection.v1.AwsAccessRole"
1226    }
1227}
1228
1229/// Container for connection properties specific to Azure.
1230#[derive(Clone, Default, PartialEq)]
1231#[non_exhaustive]
1232pub struct AzureProperties {
1233    /// Output only. The name of the Azure Active Directory Application.
1234    pub application: std::string::String,
1235
1236    /// Output only. The client id of the Azure Active Directory Application.
1237    pub client_id: std::string::String,
1238
1239    /// Output only. The object id of the Azure Active Directory Application.
1240    pub object_id: std::string::String,
1241
1242    /// The id of customer's directory that host the data.
1243    pub customer_tenant_id: std::string::String,
1244
1245    /// The URL user will be redirected to after granting consent during connection
1246    /// setup.
1247    pub redirect_uri: std::string::String,
1248
1249    /// The client ID of the user's Azure Active Directory Application used for a
1250    /// federated connection.
1251    pub federated_application_client_id: std::string::String,
1252
1253    /// Output only. A unique Google-owned and Google-generated identity for the
1254    /// Connection. This identity will be used to access the user's Azure Active
1255    /// Directory Application.
1256    pub identity: std::string::String,
1257
1258    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1259}
1260
1261impl AzureProperties {
1262    pub fn new() -> Self {
1263        std::default::Default::default()
1264    }
1265
1266    /// Sets the value of [application][crate::model::AzureProperties::application].
1267    pub fn set_application<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1268        self.application = v.into();
1269        self
1270    }
1271
1272    /// Sets the value of [client_id][crate::model::AzureProperties::client_id].
1273    pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1274        self.client_id = v.into();
1275        self
1276    }
1277
1278    /// Sets the value of [object_id][crate::model::AzureProperties::object_id].
1279    pub fn set_object_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1280        self.object_id = v.into();
1281        self
1282    }
1283
1284    /// Sets the value of [customer_tenant_id][crate::model::AzureProperties::customer_tenant_id].
1285    pub fn set_customer_tenant_id<T: std::convert::Into<std::string::String>>(
1286        mut self,
1287        v: T,
1288    ) -> Self {
1289        self.customer_tenant_id = v.into();
1290        self
1291    }
1292
1293    /// Sets the value of [redirect_uri][crate::model::AzureProperties::redirect_uri].
1294    pub fn set_redirect_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1295        self.redirect_uri = v.into();
1296        self
1297    }
1298
1299    /// Sets the value of [federated_application_client_id][crate::model::AzureProperties::federated_application_client_id].
1300    pub fn set_federated_application_client_id<T: std::convert::Into<std::string::String>>(
1301        mut self,
1302        v: T,
1303    ) -> Self {
1304        self.federated_application_client_id = v.into();
1305        self
1306    }
1307
1308    /// Sets the value of [identity][crate::model::AzureProperties::identity].
1309    pub fn set_identity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1310        self.identity = v.into();
1311        self
1312    }
1313}
1314
1315impl wkt::message::Message for AzureProperties {
1316    fn typename() -> &'static str {
1317        "type.googleapis.com/google.cloud.bigquery.connection.v1.AzureProperties"
1318    }
1319}
1320
1321/// Container for connection properties for delegation of access to GCP
1322/// resources.
1323#[derive(Clone, Default, PartialEq)]
1324#[non_exhaustive]
1325pub struct CloudResourceProperties {
1326    /// Output only. The account ID of the service created for the purpose of this
1327    /// connection.
1328    ///
1329    /// The service account does not have any permissions associated with it
1330    /// when it is created. After creation, customers delegate permissions
1331    /// to the service account. When the connection is used in the context of an
1332    /// operation in BigQuery, the service account will be used to connect to the
1333    /// desired resources in GCP.
1334    ///
1335    /// The account ID is in the form of:
1336    /// \<service-1234\>@gcp-sa-bigquery-cloudresource.iam.gserviceaccount.com
1337    pub service_account_id: std::string::String,
1338
1339    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1340}
1341
1342impl CloudResourceProperties {
1343    pub fn new() -> Self {
1344        std::default::Default::default()
1345    }
1346
1347    /// Sets the value of [service_account_id][crate::model::CloudResourceProperties::service_account_id].
1348    pub fn set_service_account_id<T: std::convert::Into<std::string::String>>(
1349        mut self,
1350        v: T,
1351    ) -> Self {
1352        self.service_account_id = v.into();
1353        self
1354    }
1355}
1356
1357impl wkt::message::Message for CloudResourceProperties {
1358    fn typename() -> &'static str {
1359        "type.googleapis.com/google.cloud.bigquery.connection.v1.CloudResourceProperties"
1360    }
1361}
1362
1363/// Configuration of the Dataproc Metastore Service.
1364#[derive(Clone, Default, PartialEq)]
1365#[non_exhaustive]
1366pub struct MetastoreServiceConfig {
1367    /// Optional. Resource name of an existing Dataproc Metastore service.
1368    ///
1369    /// Example:
1370    ///
1371    /// * `projects/[project_id]/locations/[region]/services/[service_id]`
1372    pub metastore_service: std::string::String,
1373
1374    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1375}
1376
1377impl MetastoreServiceConfig {
1378    pub fn new() -> Self {
1379        std::default::Default::default()
1380    }
1381
1382    /// Sets the value of [metastore_service][crate::model::MetastoreServiceConfig::metastore_service].
1383    pub fn set_metastore_service<T: std::convert::Into<std::string::String>>(
1384        mut self,
1385        v: T,
1386    ) -> Self {
1387        self.metastore_service = v.into();
1388        self
1389    }
1390}
1391
1392impl wkt::message::Message for MetastoreServiceConfig {
1393    fn typename() -> &'static str {
1394        "type.googleapis.com/google.cloud.bigquery.connection.v1.MetastoreServiceConfig"
1395    }
1396}
1397
1398/// Configuration of the Spark History Server.
1399#[derive(Clone, Default, PartialEq)]
1400#[non_exhaustive]
1401pub struct SparkHistoryServerConfig {
1402    /// Optional. Resource name of an existing Dataproc Cluster to act as a Spark
1403    /// History Server for the connection.
1404    ///
1405    /// Example:
1406    ///
1407    /// * `projects/[project_id]/regions/[region]/clusters/[cluster_name]`
1408    pub dataproc_cluster: std::string::String,
1409
1410    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1411}
1412
1413impl SparkHistoryServerConfig {
1414    pub fn new() -> Self {
1415        std::default::Default::default()
1416    }
1417
1418    /// Sets the value of [dataproc_cluster][crate::model::SparkHistoryServerConfig::dataproc_cluster].
1419    pub fn set_dataproc_cluster<T: std::convert::Into<std::string::String>>(
1420        mut self,
1421        v: T,
1422    ) -> Self {
1423        self.dataproc_cluster = v.into();
1424        self
1425    }
1426}
1427
1428impl wkt::message::Message for SparkHistoryServerConfig {
1429    fn typename() -> &'static str {
1430        "type.googleapis.com/google.cloud.bigquery.connection.v1.SparkHistoryServerConfig"
1431    }
1432}
1433
1434/// Container for connection properties to execute stored procedures for Apache
1435/// Spark.
1436#[derive(Clone, Default, PartialEq)]
1437#[non_exhaustive]
1438pub struct SparkProperties {
1439    /// Output only. The account ID of the service created for the purpose of this
1440    /// connection.
1441    ///
1442    /// The service account does not have any permissions associated with it when
1443    /// it is created. After creation, customers delegate permissions to the
1444    /// service account. When the connection is used in the context of a stored
1445    /// procedure for Apache Spark in BigQuery, the service account is used to
1446    /// connect to the desired resources in Google Cloud.
1447    ///
1448    /// The account ID is in the form of:
1449    /// bqcx-\<projectnumber\>-\<uniqueid\>@gcp-sa-bigquery-consp.iam.gserviceaccount.com
1450    pub service_account_id: std::string::String,
1451
1452    /// Optional. Dataproc Metastore Service configuration for the connection.
1453    pub metastore_service_config: std::option::Option<crate::model::MetastoreServiceConfig>,
1454
1455    /// Optional. Spark History Server configuration for the connection.
1456    pub spark_history_server_config: std::option::Option<crate::model::SparkHistoryServerConfig>,
1457
1458    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1459}
1460
1461impl SparkProperties {
1462    pub fn new() -> Self {
1463        std::default::Default::default()
1464    }
1465
1466    /// Sets the value of [service_account_id][crate::model::SparkProperties::service_account_id].
1467    pub fn set_service_account_id<T: std::convert::Into<std::string::String>>(
1468        mut self,
1469        v: T,
1470    ) -> Self {
1471        self.service_account_id = v.into();
1472        self
1473    }
1474
1475    /// Sets the value of [metastore_service_config][crate::model::SparkProperties::metastore_service_config].
1476    pub fn set_metastore_service_config<T>(mut self, v: T) -> Self
1477    where
1478        T: std::convert::Into<crate::model::MetastoreServiceConfig>,
1479    {
1480        self.metastore_service_config = std::option::Option::Some(v.into());
1481        self
1482    }
1483
1484    /// Sets or clears the value of [metastore_service_config][crate::model::SparkProperties::metastore_service_config].
1485    pub fn set_or_clear_metastore_service_config<T>(mut self, v: std::option::Option<T>) -> Self
1486    where
1487        T: std::convert::Into<crate::model::MetastoreServiceConfig>,
1488    {
1489        self.metastore_service_config = v.map(|x| x.into());
1490        self
1491    }
1492
1493    /// Sets the value of [spark_history_server_config][crate::model::SparkProperties::spark_history_server_config].
1494    pub fn set_spark_history_server_config<T>(mut self, v: T) -> Self
1495    where
1496        T: std::convert::Into<crate::model::SparkHistoryServerConfig>,
1497    {
1498        self.spark_history_server_config = std::option::Option::Some(v.into());
1499        self
1500    }
1501
1502    /// Sets or clears the value of [spark_history_server_config][crate::model::SparkProperties::spark_history_server_config].
1503    pub fn set_or_clear_spark_history_server_config<T>(mut self, v: std::option::Option<T>) -> Self
1504    where
1505        T: std::convert::Into<crate::model::SparkHistoryServerConfig>,
1506    {
1507        self.spark_history_server_config = v.map(|x| x.into());
1508        self
1509    }
1510}
1511
1512impl wkt::message::Message for SparkProperties {
1513    fn typename() -> &'static str {
1514        "type.googleapis.com/google.cloud.bigquery.connection.v1.SparkProperties"
1515    }
1516}
1517
1518/// Connection properties specific to Salesforce DataCloud. This is intended for
1519/// use only by Salesforce partner projects.
1520#[derive(Clone, Default, PartialEq)]
1521#[non_exhaustive]
1522pub struct SalesforceDataCloudProperties {
1523    /// The URL to the user's Salesforce DataCloud instance.
1524    pub instance_uri: std::string::String,
1525
1526    /// Output only. A unique Google-owned and Google-generated service account
1527    /// identity for the connection.
1528    pub identity: std::string::String,
1529
1530    /// The ID of the user's Salesforce tenant.
1531    pub tenant_id: std::string::String,
1532
1533    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1534}
1535
1536impl SalesforceDataCloudProperties {
1537    pub fn new() -> Self {
1538        std::default::Default::default()
1539    }
1540
1541    /// Sets the value of [instance_uri][crate::model::SalesforceDataCloudProperties::instance_uri].
1542    pub fn set_instance_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1543        self.instance_uri = v.into();
1544        self
1545    }
1546
1547    /// Sets the value of [identity][crate::model::SalesforceDataCloudProperties::identity].
1548    pub fn set_identity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1549        self.identity = v.into();
1550        self
1551    }
1552
1553    /// Sets the value of [tenant_id][crate::model::SalesforceDataCloudProperties::tenant_id].
1554    pub fn set_tenant_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1555        self.tenant_id = v.into();
1556        self
1557    }
1558}
1559
1560impl wkt::message::Message for SalesforceDataCloudProperties {
1561    fn typename() -> &'static str {
1562        "type.googleapis.com/google.cloud.bigquery.connection.v1.SalesforceDataCloudProperties"
1563    }
1564}