1#![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#[derive(Clone, Default, PartialEq)]
43#[non_exhaustive]
44pub struct CreateConnectionRequest {
45 pub parent: std::string::String,
48
49 pub connection_id: std::string::String,
51
52 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 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 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 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 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#[derive(Clone, Default, PartialEq)]
105#[non_exhaustive]
106pub struct GetConnectionRequest {
107 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 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#[derive(Clone, Default, PartialEq)]
137#[non_exhaustive]
138pub struct ListConnectionsRequest {
139 pub parent: std::string::String,
142
143 pub page_size: i32,
145
146 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 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 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 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#[derive(Clone, Default, PartialEq)]
187#[non_exhaustive]
188pub struct ListConnectionsResponse {
189 pub next_page_token: std::string::String,
191
192 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 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 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#[derive(Clone, Default, PartialEq)]
246#[non_exhaustive]
247pub struct UpdateConnectionRequest {
248 pub name: std::string::String,
251
252 pub connection: std::option::Option<crate::model::Connection>,
254
255 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 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 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 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 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 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#[derive(Clone, Default, PartialEq)]
317#[non_exhaustive]
318pub struct DeleteConnectionRequest {
319 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 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#[derive(Clone, Default, PartialEq)]
347#[non_exhaustive]
348pub struct Connection {
349 pub name: std::string::String,
352
353 pub friendly_name: std::string::String,
355
356 pub description: std::string::String,
358
359 pub creation_time: i64,
361
362 pub last_modified_time: i64,
364
365 pub has_credential: bool,
367
368 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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
631pub mod connection {
633 #[allow(unused_imports)]
634 use super::*;
635
636 #[derive(Clone, Debug, PartialEq)]
638 #[non_exhaustive]
639 pub enum Properties {
640 CloudSql(std::boxed::Box<crate::model::CloudSqlProperties>),
642 Aws(std::boxed::Box<crate::model::AwsProperties>),
644 Azure(std::boxed::Box<crate::model::AzureProperties>),
646 CloudSpanner(std::boxed::Box<crate::model::CloudSpannerProperties>),
648 CloudResource(std::boxed::Box<crate::model::CloudResourceProperties>),
650 Spark(std::boxed::Box<crate::model::SparkProperties>),
652 SalesforceDataCloud(std::boxed::Box<crate::model::SalesforceDataCloudProperties>),
656 }
657}
658
659#[derive(Clone, Default, PartialEq)]
661#[non_exhaustive]
662pub struct CloudSqlProperties {
663 pub instance_id: std::string::String,
665
666 pub database: std::string::String,
668
669 pub r#type: crate::model::cloud_sql_properties::DatabaseType,
671
672 pub credential: std::option::Option<crate::model::CloudSqlCredential>,
674
675 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 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 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 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 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 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 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
746pub mod cloud_sql_properties {
748 #[allow(unused_imports)]
749 use super::*;
750
751 #[derive(Clone, Debug, PartialEq)]
767 #[non_exhaustive]
768 pub enum DatabaseType {
769 Unspecified,
771 Postgres,
773 Mysql,
775 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 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 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#[derive(Clone, Default, PartialEq)]
886#[non_exhaustive]
887pub struct CloudSqlCredential {
888 pub username: std::string::String,
890
891 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 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 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#[derive(Clone, Default, PartialEq)]
923#[non_exhaustive]
924pub struct CloudSpannerProperties {
925 pub database: std::string::String,
927
928 pub use_parallelism: bool,
930
931 pub max_parallelism: i32,
940
941 pub use_serverless_analytics: bool,
945
946 pub use_data_boost: bool,
953
954 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 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 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 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 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 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 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#[derive(Clone, Default, PartialEq)]
1019#[non_exhaustive]
1020pub struct AwsProperties {
1021 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 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 #[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 #[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 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 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
1118pub mod aws_properties {
1120 #[allow(unused_imports)]
1121 use super::*;
1122
1123 #[derive(Clone, Debug, PartialEq)]
1125 #[non_exhaustive]
1126 pub enum AuthenticationMethod {
1127 #[deprecated]
1131 CrossAccountRole(std::boxed::Box<crate::model::AwsCrossAccountRole>),
1132 AccessRole(std::boxed::Box<crate::model::AwsAccessRole>),
1135 }
1136}
1137
1138#[derive(Clone, Default, PartialEq)]
1141#[non_exhaustive]
1142pub struct AwsCrossAccountRole {
1143 pub iam_role_id: std::string::String,
1146
1147 pub iam_user_id: std::string::String,
1149
1150 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 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 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 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#[derive(Clone, Default, PartialEq)]
1192#[non_exhaustive]
1193pub struct AwsAccessRole {
1194 pub iam_role_id: std::string::String,
1197
1198 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 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 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#[derive(Clone, Default, PartialEq)]
1231#[non_exhaustive]
1232pub struct AzureProperties {
1233 pub application: std::string::String,
1235
1236 pub client_id: std::string::String,
1238
1239 pub object_id: std::string::String,
1241
1242 pub customer_tenant_id: std::string::String,
1244
1245 pub redirect_uri: std::string::String,
1248
1249 pub federated_application_client_id: std::string::String,
1252
1253 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 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 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 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 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 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 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 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#[derive(Clone, Default, PartialEq)]
1324#[non_exhaustive]
1325pub struct CloudResourceProperties {
1326 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 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#[derive(Clone, Default, PartialEq)]
1365#[non_exhaustive]
1366pub struct MetastoreServiceConfig {
1367 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 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#[derive(Clone, Default, PartialEq)]
1400#[non_exhaustive]
1401pub struct SparkHistoryServerConfig {
1402 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 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#[derive(Clone, Default, PartialEq)]
1437#[non_exhaustive]
1438pub struct SparkProperties {
1439 pub service_account_id: std::string::String,
1451
1452 pub metastore_service_config: std::option::Option<crate::model::MetastoreServiceConfig>,
1454
1455 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 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 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 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 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 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#[derive(Clone, Default, PartialEq)]
1521#[non_exhaustive]
1522pub struct SalesforceDataCloudProperties {
1523 pub instance_uri: std::string::String,
1525
1526 pub identity: std::string::String,
1529
1530 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 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 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 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}