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 lazy_static;
24extern crate location;
25extern crate reqwest;
26extern crate rpc;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34#[serde_with::serde_as]
36#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
37#[serde(default, rename_all = "camelCase")]
38#[non_exhaustive]
39pub struct DataSourceParameter {
40 #[serde(skip_serializing_if = "std::string::String::is_empty")]
42 pub param_id: std::string::String,
43
44 #[serde(skip_serializing_if = "std::string::String::is_empty")]
46 pub display_name: std::string::String,
47
48 #[serde(skip_serializing_if = "std::string::String::is_empty")]
50 pub description: std::string::String,
51
52 #[serde(rename = "type")]
54 pub r#type: crate::model::data_source_parameter::Type,
55
56 pub required: bool,
58
59 pub repeated: bool,
61
62 #[serde(skip_serializing_if = "std::string::String::is_empty")]
64 pub validation_regex: std::string::String,
65
66 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
68 pub allowed_values: std::vec::Vec<std::string::String>,
69
70 #[serde(skip_serializing_if = "std::option::Option::is_none")]
72 pub min_value: std::option::Option<wkt::DoubleValue>,
73
74 #[serde(skip_serializing_if = "std::option::Option::is_none")]
76 pub max_value: std::option::Option<wkt::DoubleValue>,
77
78 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
80 pub fields: std::vec::Vec<crate::model::DataSourceParameter>,
81
82 #[serde(skip_serializing_if = "std::string::String::is_empty")]
85 pub validation_description: std::string::String,
86
87 #[serde(skip_serializing_if = "std::string::String::is_empty")]
89 pub validation_help_url: std::string::String,
90
91 pub immutable: bool,
93
94 pub recurse: bool,
96
97 pub deprecated: bool,
100}
101
102impl DataSourceParameter {
103 pub fn new() -> Self {
104 std::default::Default::default()
105 }
106
107 pub fn set_param_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
109 self.param_id = v.into();
110 self
111 }
112
113 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
115 self.display_name = v.into();
116 self
117 }
118
119 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
121 self.description = v.into();
122 self
123 }
124
125 pub fn set_type<T: std::convert::Into<crate::model::data_source_parameter::Type>>(
127 mut self,
128 v: T,
129 ) -> Self {
130 self.r#type = v.into();
131 self
132 }
133
134 pub fn set_required<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
136 self.required = v.into();
137 self
138 }
139
140 pub fn set_repeated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
142 self.repeated = v.into();
143 self
144 }
145
146 pub fn set_validation_regex<T: std::convert::Into<std::string::String>>(
148 mut self,
149 v: T,
150 ) -> Self {
151 self.validation_regex = v.into();
152 self
153 }
154
155 pub fn set_min_value<T: std::convert::Into<std::option::Option<wkt::DoubleValue>>>(
157 mut self,
158 v: T,
159 ) -> Self {
160 self.min_value = v.into();
161 self
162 }
163
164 pub fn set_max_value<T: std::convert::Into<std::option::Option<wkt::DoubleValue>>>(
166 mut self,
167 v: T,
168 ) -> Self {
169 self.max_value = v.into();
170 self
171 }
172
173 pub fn set_validation_description<T: std::convert::Into<std::string::String>>(
175 mut self,
176 v: T,
177 ) -> Self {
178 self.validation_description = v.into();
179 self
180 }
181
182 pub fn set_validation_help_url<T: std::convert::Into<std::string::String>>(
184 mut self,
185 v: T,
186 ) -> Self {
187 self.validation_help_url = v.into();
188 self
189 }
190
191 pub fn set_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
193 self.immutable = v.into();
194 self
195 }
196
197 pub fn set_recurse<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
199 self.recurse = v.into();
200 self
201 }
202
203 pub fn set_deprecated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
205 self.deprecated = v.into();
206 self
207 }
208
209 pub fn set_allowed_values<T, V>(mut self, v: T) -> Self
211 where
212 T: std::iter::IntoIterator<Item = V>,
213 V: std::convert::Into<std::string::String>,
214 {
215 use std::iter::Iterator;
216 self.allowed_values = v.into_iter().map(|i| i.into()).collect();
217 self
218 }
219
220 pub fn set_fields<T, V>(mut self, v: T) -> Self
222 where
223 T: std::iter::IntoIterator<Item = V>,
224 V: std::convert::Into<crate::model::DataSourceParameter>,
225 {
226 use std::iter::Iterator;
227 self.fields = v.into_iter().map(|i| i.into()).collect();
228 self
229 }
230}
231
232impl wkt::message::Message for DataSourceParameter {
233 fn typename() -> &'static str {
234 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.DataSourceParameter"
235 }
236}
237
238pub mod data_source_parameter {
240 #[allow(unused_imports)]
241 use super::*;
242
243 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
245 pub struct Type(std::borrow::Cow<'static, str>);
246
247 impl Type {
248 pub const fn new(v: &'static str) -> Self {
250 Self(std::borrow::Cow::Borrowed(v))
251 }
252
253 pub fn value(&self) -> &str {
255 &self.0
256 }
257 }
258
259 pub mod r#type {
261 use super::Type;
262
263 pub const TYPE_UNSPECIFIED: Type = Type::new("TYPE_UNSPECIFIED");
265
266 pub const STRING: Type = Type::new("STRING");
268
269 pub const INTEGER: Type = Type::new("INTEGER");
272
273 pub const DOUBLE: Type = Type::new("DOUBLE");
275
276 pub const BOOLEAN: Type = Type::new("BOOLEAN");
278
279 pub const RECORD: Type = Type::new("RECORD");
281
282 pub const PLUS_PAGE: Type = Type::new("PLUS_PAGE");
284
285 pub const LIST: Type = Type::new("LIST");
287 }
288
289 impl std::convert::From<std::string::String> for Type {
290 fn from(value: std::string::String) -> Self {
291 Self(std::borrow::Cow::Owned(value))
292 }
293 }
294}
295
296#[serde_with::serde_as]
298#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
299#[serde(default, rename_all = "camelCase")]
300#[non_exhaustive]
301pub struct DataSource {
302 #[serde(skip_serializing_if = "std::string::String::is_empty")]
304 pub name: std::string::String,
305
306 #[serde(skip_serializing_if = "std::string::String::is_empty")]
308 pub data_source_id: std::string::String,
309
310 #[serde(skip_serializing_if = "std::string::String::is_empty")]
312 pub display_name: std::string::String,
313
314 #[serde(skip_serializing_if = "std::string::String::is_empty")]
316 pub description: std::string::String,
317
318 #[serde(skip_serializing_if = "std::string::String::is_empty")]
320 pub client_id: std::string::String,
321
322 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
326 pub scopes: std::vec::Vec<std::string::String>,
327
328 pub transfer_type: crate::model::TransferType,
330
331 pub supports_multiple_transfers: bool,
333
334 pub update_deadline_seconds: i32,
337
338 #[serde(skip_serializing_if = "std::string::String::is_empty")]
344 pub default_schedule: std::string::String,
345
346 pub supports_custom_schedule: bool,
350
351 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
353 pub parameters: std::vec::Vec<crate::model::DataSourceParameter>,
354
355 #[serde(skip_serializing_if = "std::string::String::is_empty")]
357 pub help_url: std::string::String,
358
359 pub authorization_type: crate::model::data_source::AuthorizationType,
361
362 pub data_refresh_type: crate::model::data_source::DataRefreshType,
367
368 pub default_data_refresh_window_days: i32,
371
372 pub manual_runs_disabled: bool,
375
376 #[serde(skip_serializing_if = "std::option::Option::is_none")]
378 pub minimum_schedule_interval: std::option::Option<wkt::Duration>,
379}
380
381impl DataSource {
382 pub fn new() -> Self {
383 std::default::Default::default()
384 }
385
386 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
388 self.name = v.into();
389 self
390 }
391
392 pub fn set_data_source_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
394 self.data_source_id = v.into();
395 self
396 }
397
398 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
400 self.display_name = v.into();
401 self
402 }
403
404 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
406 self.description = v.into();
407 self
408 }
409
410 pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
412 self.client_id = v.into();
413 self
414 }
415
416 pub fn set_transfer_type<T: std::convert::Into<crate::model::TransferType>>(
418 mut self,
419 v: T,
420 ) -> Self {
421 self.transfer_type = v.into();
422 self
423 }
424
425 pub fn set_supports_multiple_transfers<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
427 self.supports_multiple_transfers = v.into();
428 self
429 }
430
431 pub fn set_update_deadline_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
433 self.update_deadline_seconds = v.into();
434 self
435 }
436
437 pub fn set_default_schedule<T: std::convert::Into<std::string::String>>(
439 mut self,
440 v: T,
441 ) -> Self {
442 self.default_schedule = v.into();
443 self
444 }
445
446 pub fn set_supports_custom_schedule<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
448 self.supports_custom_schedule = v.into();
449 self
450 }
451
452 pub fn set_help_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
454 self.help_url = v.into();
455 self
456 }
457
458 pub fn set_authorization_type<
460 T: std::convert::Into<crate::model::data_source::AuthorizationType>,
461 >(
462 mut self,
463 v: T,
464 ) -> Self {
465 self.authorization_type = v.into();
466 self
467 }
468
469 pub fn set_data_refresh_type<
471 T: std::convert::Into<crate::model::data_source::DataRefreshType>,
472 >(
473 mut self,
474 v: T,
475 ) -> Self {
476 self.data_refresh_type = v.into();
477 self
478 }
479
480 pub fn set_default_data_refresh_window_days<T: std::convert::Into<i32>>(
482 mut self,
483 v: T,
484 ) -> Self {
485 self.default_data_refresh_window_days = v.into();
486 self
487 }
488
489 pub fn set_manual_runs_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
491 self.manual_runs_disabled = v.into();
492 self
493 }
494
495 pub fn set_minimum_schedule_interval<
497 T: std::convert::Into<std::option::Option<wkt::Duration>>,
498 >(
499 mut self,
500 v: T,
501 ) -> Self {
502 self.minimum_schedule_interval = v.into();
503 self
504 }
505
506 pub fn set_scopes<T, V>(mut self, v: T) -> Self
508 where
509 T: std::iter::IntoIterator<Item = V>,
510 V: std::convert::Into<std::string::String>,
511 {
512 use std::iter::Iterator;
513 self.scopes = v.into_iter().map(|i| i.into()).collect();
514 self
515 }
516
517 pub fn set_parameters<T, V>(mut self, v: T) -> Self
519 where
520 T: std::iter::IntoIterator<Item = V>,
521 V: std::convert::Into<crate::model::DataSourceParameter>,
522 {
523 use std::iter::Iterator;
524 self.parameters = v.into_iter().map(|i| i.into()).collect();
525 self
526 }
527}
528
529impl wkt::message::Message for DataSource {
530 fn typename() -> &'static str {
531 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.DataSource"
532 }
533}
534
535pub mod data_source {
537 #[allow(unused_imports)]
538 use super::*;
539
540 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
542 pub struct AuthorizationType(std::borrow::Cow<'static, str>);
543
544 impl AuthorizationType {
545 pub const fn new(v: &'static str) -> Self {
547 Self(std::borrow::Cow::Borrowed(v))
548 }
549
550 pub fn value(&self) -> &str {
552 &self.0
553 }
554 }
555
556 pub mod authorization_type {
558 use super::AuthorizationType;
559
560 pub const AUTHORIZATION_TYPE_UNSPECIFIED: AuthorizationType =
562 AuthorizationType::new("AUTHORIZATION_TYPE_UNSPECIFIED");
563
564 pub const AUTHORIZATION_CODE: AuthorizationType =
567 AuthorizationType::new("AUTHORIZATION_CODE");
568
569 pub const GOOGLE_PLUS_AUTHORIZATION_CODE: AuthorizationType =
572 AuthorizationType::new("GOOGLE_PLUS_AUTHORIZATION_CODE");
573
574 pub const FIRST_PARTY_OAUTH: AuthorizationType =
576 AuthorizationType::new("FIRST_PARTY_OAUTH");
577 }
578
579 impl std::convert::From<std::string::String> for AuthorizationType {
580 fn from(value: std::string::String) -> Self {
581 Self(std::borrow::Cow::Owned(value))
582 }
583 }
584
585 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
587 pub struct DataRefreshType(std::borrow::Cow<'static, str>);
588
589 impl DataRefreshType {
590 pub const fn new(v: &'static str) -> Self {
592 Self(std::borrow::Cow::Borrowed(v))
593 }
594
595 pub fn value(&self) -> &str {
597 &self.0
598 }
599 }
600
601 pub mod data_refresh_type {
603 use super::DataRefreshType;
604
605 pub const DATA_REFRESH_TYPE_UNSPECIFIED: DataRefreshType =
607 DataRefreshType::new("DATA_REFRESH_TYPE_UNSPECIFIED");
608
609 pub const SLIDING_WINDOW: DataRefreshType = DataRefreshType::new("SLIDING_WINDOW");
613
614 pub const CUSTOM_SLIDING_WINDOW: DataRefreshType =
618 DataRefreshType::new("CUSTOM_SLIDING_WINDOW");
619 }
620
621 impl std::convert::From<std::string::String> for DataRefreshType {
622 fn from(value: std::string::String) -> Self {
623 Self(std::borrow::Cow::Owned(value))
624 }
625 }
626}
627
628#[serde_with::serde_as]
630#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
631#[serde(default, rename_all = "camelCase")]
632#[non_exhaustive]
633pub struct GetDataSourceRequest {
634 #[serde(skip_serializing_if = "std::string::String::is_empty")]
638 pub name: std::string::String,
639}
640
641impl GetDataSourceRequest {
642 pub fn new() -> Self {
643 std::default::Default::default()
644 }
645
646 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
648 self.name = v.into();
649 self
650 }
651}
652
653impl wkt::message::Message for GetDataSourceRequest {
654 fn typename() -> &'static str {
655 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest"
656 }
657}
658
659#[serde_with::serde_as]
661#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
662#[serde(default, rename_all = "camelCase")]
663#[non_exhaustive]
664pub struct ListDataSourcesRequest {
665 #[serde(skip_serializing_if = "std::string::String::is_empty")]
669 pub parent: std::string::String,
670
671 #[serde(skip_serializing_if = "std::string::String::is_empty")]
677 pub page_token: std::string::String,
678
679 pub page_size: i32,
681}
682
683impl ListDataSourcesRequest {
684 pub fn new() -> Self {
685 std::default::Default::default()
686 }
687
688 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
690 self.parent = v.into();
691 self
692 }
693
694 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
696 self.page_token = v.into();
697 self
698 }
699
700 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
702 self.page_size = v.into();
703 self
704 }
705}
706
707impl wkt::message::Message for ListDataSourcesRequest {
708 fn typename() -> &'static str {
709 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest"
710 }
711}
712
713#[serde_with::serde_as]
715#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
716#[serde(default, rename_all = "camelCase")]
717#[non_exhaustive]
718pub struct ListDataSourcesResponse {
719 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
721 pub data_sources: std::vec::Vec<crate::model::DataSource>,
722
723 #[serde(skip_serializing_if = "std::string::String::is_empty")]
728 pub next_page_token: std::string::String,
729}
730
731impl ListDataSourcesResponse {
732 pub fn new() -> Self {
733 std::default::Default::default()
734 }
735
736 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
738 self.next_page_token = v.into();
739 self
740 }
741
742 pub fn set_data_sources<T, V>(mut self, v: T) -> Self
744 where
745 T: std::iter::IntoIterator<Item = V>,
746 V: std::convert::Into<crate::model::DataSource>,
747 {
748 use std::iter::Iterator;
749 self.data_sources = v.into_iter().map(|i| i.into()).collect();
750 self
751 }
752}
753
754impl wkt::message::Message for ListDataSourcesResponse {
755 fn typename() -> &'static str {
756 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse"
757 }
758}
759
760#[cfg(feature = "unstable-stream")]
761impl gax::paginator::PageableResponse for ListDataSourcesResponse {
762 type PageItem = crate::model::DataSource;
763
764 fn items(self) -> std::vec::Vec<Self::PageItem> {
765 self.data_sources
766 }
767
768 fn next_page_token(&self) -> std::string::String {
769 gax::paginator::extract_token(&self.next_page_token)
770 }
771}
772
773#[serde_with::serde_as]
785#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
786#[serde(default, rename_all = "camelCase")]
787#[non_exhaustive]
788pub struct CreateTransferConfigRequest {
789 #[serde(skip_serializing_if = "std::string::String::is_empty")]
795 pub parent: std::string::String,
796
797 #[serde(skip_serializing_if = "std::option::Option::is_none")]
799 pub transfer_config: std::option::Option<crate::model::TransferConfig>,
800
801 #[serde(skip_serializing_if = "std::string::String::is_empty")]
818 pub authorization_code: std::string::String,
819
820 #[serde(skip_serializing_if = "std::string::String::is_empty")]
834 pub version_info: std::string::String,
835
836 #[serde(skip_serializing_if = "std::string::String::is_empty")]
846 pub service_account_name: std::string::String,
847}
848
849impl CreateTransferConfigRequest {
850 pub fn new() -> Self {
851 std::default::Default::default()
852 }
853
854 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
856 self.parent = v.into();
857 self
858 }
859
860 pub fn set_transfer_config<
862 T: std::convert::Into<std::option::Option<crate::model::TransferConfig>>,
863 >(
864 mut self,
865 v: T,
866 ) -> Self {
867 self.transfer_config = v.into();
868 self
869 }
870
871 pub fn set_authorization_code<T: std::convert::Into<std::string::String>>(
873 mut self,
874 v: T,
875 ) -> Self {
876 self.authorization_code = v.into();
877 self
878 }
879
880 pub fn set_version_info<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
882 self.version_info = v.into();
883 self
884 }
885
886 pub fn set_service_account_name<T: std::convert::Into<std::string::String>>(
888 mut self,
889 v: T,
890 ) -> Self {
891 self.service_account_name = v.into();
892 self
893 }
894}
895
896impl wkt::message::Message for CreateTransferConfigRequest {
897 fn typename() -> &'static str {
898 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest"
899 }
900}
901
902#[serde_with::serde_as]
910#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
911#[serde(default, rename_all = "camelCase")]
912#[non_exhaustive]
913pub struct UpdateTransferConfigRequest {
914 #[serde(skip_serializing_if = "std::option::Option::is_none")]
916 pub transfer_config: std::option::Option<crate::model::TransferConfig>,
917
918 #[serde(skip_serializing_if = "std::string::String::is_empty")]
935 pub authorization_code: std::string::String,
936
937 #[serde(skip_serializing_if = "std::option::Option::is_none")]
939 pub update_mask: std::option::Option<wkt::FieldMask>,
940
941 #[serde(skip_serializing_if = "std::string::String::is_empty")]
955 pub version_info: std::string::String,
956
957 #[serde(skip_serializing_if = "std::string::String::is_empty")]
967 pub service_account_name: std::string::String,
968}
969
970impl UpdateTransferConfigRequest {
971 pub fn new() -> Self {
972 std::default::Default::default()
973 }
974
975 pub fn set_transfer_config<
977 T: std::convert::Into<std::option::Option<crate::model::TransferConfig>>,
978 >(
979 mut self,
980 v: T,
981 ) -> Self {
982 self.transfer_config = v.into();
983 self
984 }
985
986 pub fn set_authorization_code<T: std::convert::Into<std::string::String>>(
988 mut self,
989 v: T,
990 ) -> Self {
991 self.authorization_code = v.into();
992 self
993 }
994
995 pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
997 mut self,
998 v: T,
999 ) -> Self {
1000 self.update_mask = v.into();
1001 self
1002 }
1003
1004 pub fn set_version_info<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1006 self.version_info = v.into();
1007 self
1008 }
1009
1010 pub fn set_service_account_name<T: std::convert::Into<std::string::String>>(
1012 mut self,
1013 v: T,
1014 ) -> Self {
1015 self.service_account_name = v.into();
1016 self
1017 }
1018}
1019
1020impl wkt::message::Message for UpdateTransferConfigRequest {
1021 fn typename() -> &'static str {
1022 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest"
1023 }
1024}
1025
1026#[serde_with::serde_as]
1028#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1029#[serde(default, rename_all = "camelCase")]
1030#[non_exhaustive]
1031pub struct GetTransferConfigRequest {
1032 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1036 pub name: std::string::String,
1037}
1038
1039impl GetTransferConfigRequest {
1040 pub fn new() -> Self {
1041 std::default::Default::default()
1042 }
1043
1044 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1046 self.name = v.into();
1047 self
1048 }
1049}
1050
1051impl wkt::message::Message for GetTransferConfigRequest {
1052 fn typename() -> &'static str {
1053 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest"
1054 }
1055}
1056
1057#[serde_with::serde_as]
1060#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1061#[serde(default, rename_all = "camelCase")]
1062#[non_exhaustive]
1063pub struct DeleteTransferConfigRequest {
1064 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1068 pub name: std::string::String,
1069}
1070
1071impl DeleteTransferConfigRequest {
1072 pub fn new() -> Self {
1073 std::default::Default::default()
1074 }
1075
1076 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1078 self.name = v.into();
1079 self
1080 }
1081}
1082
1083impl wkt::message::Message for DeleteTransferConfigRequest {
1084 fn typename() -> &'static str {
1085 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest"
1086 }
1087}
1088
1089#[serde_with::serde_as]
1091#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1092#[serde(default, rename_all = "camelCase")]
1093#[non_exhaustive]
1094pub struct GetTransferRunRequest {
1095 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1100 pub name: std::string::String,
1101}
1102
1103impl GetTransferRunRequest {
1104 pub fn new() -> Self {
1105 std::default::Default::default()
1106 }
1107
1108 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1110 self.name = v.into();
1111 self
1112 }
1113}
1114
1115impl wkt::message::Message for GetTransferRunRequest {
1116 fn typename() -> &'static str {
1117 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest"
1118 }
1119}
1120
1121#[serde_with::serde_as]
1123#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1124#[serde(default, rename_all = "camelCase")]
1125#[non_exhaustive]
1126pub struct DeleteTransferRunRequest {
1127 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1132 pub name: std::string::String,
1133}
1134
1135impl DeleteTransferRunRequest {
1136 pub fn new() -> Self {
1137 std::default::Default::default()
1138 }
1139
1140 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1142 self.name = v.into();
1143 self
1144 }
1145}
1146
1147impl wkt::message::Message for DeleteTransferRunRequest {
1148 fn typename() -> &'static str {
1149 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest"
1150 }
1151}
1152
1153#[serde_with::serde_as]
1155#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1156#[serde(default, rename_all = "camelCase")]
1157#[non_exhaustive]
1158pub struct ListTransferConfigsRequest {
1159 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1163 pub parent: std::string::String,
1164
1165 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1167 pub data_source_ids: std::vec::Vec<std::string::String>,
1168
1169 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1175 pub page_token: std::string::String,
1176
1177 pub page_size: i32,
1179}
1180
1181impl ListTransferConfigsRequest {
1182 pub fn new() -> Self {
1183 std::default::Default::default()
1184 }
1185
1186 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1188 self.parent = v.into();
1189 self
1190 }
1191
1192 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1194 self.page_token = v.into();
1195 self
1196 }
1197
1198 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1200 self.page_size = v.into();
1201 self
1202 }
1203
1204 pub fn set_data_source_ids<T, V>(mut self, v: T) -> Self
1206 where
1207 T: std::iter::IntoIterator<Item = V>,
1208 V: std::convert::Into<std::string::String>,
1209 {
1210 use std::iter::Iterator;
1211 self.data_source_ids = v.into_iter().map(|i| i.into()).collect();
1212 self
1213 }
1214}
1215
1216impl wkt::message::Message for ListTransferConfigsRequest {
1217 fn typename() -> &'static str {
1218 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest"
1219 }
1220}
1221
1222#[serde_with::serde_as]
1224#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1225#[serde(default, rename_all = "camelCase")]
1226#[non_exhaustive]
1227pub struct ListTransferConfigsResponse {
1228 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1230 pub transfer_configs: std::vec::Vec<crate::model::TransferConfig>,
1231
1232 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1237 pub next_page_token: std::string::String,
1238}
1239
1240impl ListTransferConfigsResponse {
1241 pub fn new() -> Self {
1242 std::default::Default::default()
1243 }
1244
1245 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1247 self.next_page_token = v.into();
1248 self
1249 }
1250
1251 pub fn set_transfer_configs<T, V>(mut self, v: T) -> Self
1253 where
1254 T: std::iter::IntoIterator<Item = V>,
1255 V: std::convert::Into<crate::model::TransferConfig>,
1256 {
1257 use std::iter::Iterator;
1258 self.transfer_configs = v.into_iter().map(|i| i.into()).collect();
1259 self
1260 }
1261}
1262
1263impl wkt::message::Message for ListTransferConfigsResponse {
1264 fn typename() -> &'static str {
1265 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse"
1266 }
1267}
1268
1269#[cfg(feature = "unstable-stream")]
1270impl gax::paginator::PageableResponse for ListTransferConfigsResponse {
1271 type PageItem = crate::model::TransferConfig;
1272
1273 fn items(self) -> std::vec::Vec<Self::PageItem> {
1274 self.transfer_configs
1275 }
1276
1277 fn next_page_token(&self) -> std::string::String {
1278 gax::paginator::extract_token(&self.next_page_token)
1279 }
1280}
1281
1282#[serde_with::serde_as]
1284#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1285#[serde(default, rename_all = "camelCase")]
1286#[non_exhaustive]
1287pub struct ListTransferRunsRequest {
1288 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1293 pub parent: std::string::String,
1294
1295 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1297 pub states: std::vec::Vec<crate::model::TransferState>,
1298
1299 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1305 pub page_token: std::string::String,
1306
1307 pub page_size: i32,
1309
1310 pub run_attempt: crate::model::list_transfer_runs_request::RunAttempt,
1312}
1313
1314impl ListTransferRunsRequest {
1315 pub fn new() -> Self {
1316 std::default::Default::default()
1317 }
1318
1319 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1321 self.parent = v.into();
1322 self
1323 }
1324
1325 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1327 self.page_token = v.into();
1328 self
1329 }
1330
1331 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1333 self.page_size = v.into();
1334 self
1335 }
1336
1337 pub fn set_run_attempt<
1339 T: std::convert::Into<crate::model::list_transfer_runs_request::RunAttempt>,
1340 >(
1341 mut self,
1342 v: T,
1343 ) -> Self {
1344 self.run_attempt = v.into();
1345 self
1346 }
1347
1348 pub fn set_states<T, V>(mut self, v: T) -> Self
1350 where
1351 T: std::iter::IntoIterator<Item = V>,
1352 V: std::convert::Into<crate::model::TransferState>,
1353 {
1354 use std::iter::Iterator;
1355 self.states = v.into_iter().map(|i| i.into()).collect();
1356 self
1357 }
1358}
1359
1360impl wkt::message::Message for ListTransferRunsRequest {
1361 fn typename() -> &'static str {
1362 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest"
1363 }
1364}
1365
1366pub mod list_transfer_runs_request {
1368 #[allow(unused_imports)]
1369 use super::*;
1370
1371 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1373 pub struct RunAttempt(std::borrow::Cow<'static, str>);
1374
1375 impl RunAttempt {
1376 pub const fn new(v: &'static str) -> Self {
1378 Self(std::borrow::Cow::Borrowed(v))
1379 }
1380
1381 pub fn value(&self) -> &str {
1383 &self.0
1384 }
1385 }
1386
1387 pub mod run_attempt {
1389 use super::RunAttempt;
1390
1391 pub const RUN_ATTEMPT_UNSPECIFIED: RunAttempt = RunAttempt::new("RUN_ATTEMPT_UNSPECIFIED");
1393
1394 pub const LATEST: RunAttempt = RunAttempt::new("LATEST");
1396 }
1397
1398 impl std::convert::From<std::string::String> for RunAttempt {
1399 fn from(value: std::string::String) -> Self {
1400 Self(std::borrow::Cow::Owned(value))
1401 }
1402 }
1403}
1404
1405#[serde_with::serde_as]
1407#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1408#[serde(default, rename_all = "camelCase")]
1409#[non_exhaustive]
1410pub struct ListTransferRunsResponse {
1411 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1413 pub transfer_runs: std::vec::Vec<crate::model::TransferRun>,
1414
1415 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1420 pub next_page_token: std::string::String,
1421}
1422
1423impl ListTransferRunsResponse {
1424 pub fn new() -> Self {
1425 std::default::Default::default()
1426 }
1427
1428 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1430 self.next_page_token = v.into();
1431 self
1432 }
1433
1434 pub fn set_transfer_runs<T, V>(mut self, v: T) -> Self
1436 where
1437 T: std::iter::IntoIterator<Item = V>,
1438 V: std::convert::Into<crate::model::TransferRun>,
1439 {
1440 use std::iter::Iterator;
1441 self.transfer_runs = v.into_iter().map(|i| i.into()).collect();
1442 self
1443 }
1444}
1445
1446impl wkt::message::Message for ListTransferRunsResponse {
1447 fn typename() -> &'static str {
1448 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse"
1449 }
1450}
1451
1452#[cfg(feature = "unstable-stream")]
1453impl gax::paginator::PageableResponse for ListTransferRunsResponse {
1454 type PageItem = crate::model::TransferRun;
1455
1456 fn items(self) -> std::vec::Vec<Self::PageItem> {
1457 self.transfer_runs
1458 }
1459
1460 fn next_page_token(&self) -> std::string::String {
1461 gax::paginator::extract_token(&self.next_page_token)
1462 }
1463}
1464
1465#[serde_with::serde_as]
1467#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1468#[serde(default, rename_all = "camelCase")]
1469#[non_exhaustive]
1470pub struct ListTransferLogsRequest {
1471 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1475 pub parent: std::string::String,
1476
1477 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1483 pub page_token: std::string::String,
1484
1485 pub page_size: i32,
1487
1488 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1491 pub message_types: std::vec::Vec<crate::model::transfer_message::MessageSeverity>,
1492}
1493
1494impl ListTransferLogsRequest {
1495 pub fn new() -> Self {
1496 std::default::Default::default()
1497 }
1498
1499 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1501 self.parent = v.into();
1502 self
1503 }
1504
1505 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1507 self.page_token = v.into();
1508 self
1509 }
1510
1511 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1513 self.page_size = v.into();
1514 self
1515 }
1516
1517 pub fn set_message_types<T, V>(mut self, v: T) -> Self
1519 where
1520 T: std::iter::IntoIterator<Item = V>,
1521 V: std::convert::Into<crate::model::transfer_message::MessageSeverity>,
1522 {
1523 use std::iter::Iterator;
1524 self.message_types = v.into_iter().map(|i| i.into()).collect();
1525 self
1526 }
1527}
1528
1529impl wkt::message::Message for ListTransferLogsRequest {
1530 fn typename() -> &'static str {
1531 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest"
1532 }
1533}
1534
1535#[serde_with::serde_as]
1537#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1538#[serde(default, rename_all = "camelCase")]
1539#[non_exhaustive]
1540pub struct ListTransferLogsResponse {
1541 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1543 pub transfer_messages: std::vec::Vec<crate::model::TransferMessage>,
1544
1545 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1550 pub next_page_token: std::string::String,
1551}
1552
1553impl ListTransferLogsResponse {
1554 pub fn new() -> Self {
1555 std::default::Default::default()
1556 }
1557
1558 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1560 self.next_page_token = v.into();
1561 self
1562 }
1563
1564 pub fn set_transfer_messages<T, V>(mut self, v: T) -> Self
1566 where
1567 T: std::iter::IntoIterator<Item = V>,
1568 V: std::convert::Into<crate::model::TransferMessage>,
1569 {
1570 use std::iter::Iterator;
1571 self.transfer_messages = v.into_iter().map(|i| i.into()).collect();
1572 self
1573 }
1574}
1575
1576impl wkt::message::Message for ListTransferLogsResponse {
1577 fn typename() -> &'static str {
1578 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse"
1579 }
1580}
1581
1582#[cfg(feature = "unstable-stream")]
1583impl gax::paginator::PageableResponse for ListTransferLogsResponse {
1584 type PageItem = crate::model::TransferMessage;
1585
1586 fn items(self) -> std::vec::Vec<Self::PageItem> {
1587 self.transfer_messages
1588 }
1589
1590 fn next_page_token(&self) -> std::string::String {
1591 gax::paginator::extract_token(&self.next_page_token)
1592 }
1593}
1594
1595#[serde_with::serde_as]
1602#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1603#[serde(default, rename_all = "camelCase")]
1604#[non_exhaustive]
1605pub struct CheckValidCredsRequest {
1606 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1610 pub name: std::string::String,
1611}
1612
1613impl CheckValidCredsRequest {
1614 pub fn new() -> Self {
1615 std::default::Default::default()
1616 }
1617
1618 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1620 self.name = v.into();
1621 self
1622 }
1623}
1624
1625impl wkt::message::Message for CheckValidCredsRequest {
1626 fn typename() -> &'static str {
1627 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest"
1628 }
1629}
1630
1631#[serde_with::serde_as]
1633#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1634#[serde(default, rename_all = "camelCase")]
1635#[non_exhaustive]
1636pub struct CheckValidCredsResponse {
1637 pub has_valid_creds: bool,
1639}
1640
1641impl CheckValidCredsResponse {
1642 pub fn new() -> Self {
1643 std::default::Default::default()
1644 }
1645
1646 pub fn set_has_valid_creds<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1648 self.has_valid_creds = v.into();
1649 self
1650 }
1651}
1652
1653impl wkt::message::Message for CheckValidCredsResponse {
1654 fn typename() -> &'static str {
1655 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse"
1656 }
1657}
1658
1659#[serde_with::serde_as]
1661#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1662#[serde(default, rename_all = "camelCase")]
1663#[non_exhaustive]
1664pub struct ScheduleTransferRunsRequest {
1665 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1669 pub parent: std::string::String,
1670
1671 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1674 pub start_time: std::option::Option<wkt::Timestamp>,
1675
1676 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1679 pub end_time: std::option::Option<wkt::Timestamp>,
1680}
1681
1682impl ScheduleTransferRunsRequest {
1683 pub fn new() -> Self {
1684 std::default::Default::default()
1685 }
1686
1687 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1689 self.parent = v.into();
1690 self
1691 }
1692
1693 pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1695 mut self,
1696 v: T,
1697 ) -> Self {
1698 self.start_time = v.into();
1699 self
1700 }
1701
1702 pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1704 mut self,
1705 v: T,
1706 ) -> Self {
1707 self.end_time = v.into();
1708 self
1709 }
1710}
1711
1712impl wkt::message::Message for ScheduleTransferRunsRequest {
1713 fn typename() -> &'static str {
1714 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest"
1715 }
1716}
1717
1718#[serde_with::serde_as]
1720#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1721#[serde(default, rename_all = "camelCase")]
1722#[non_exhaustive]
1723pub struct ScheduleTransferRunsResponse {
1724 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1726 pub runs: std::vec::Vec<crate::model::TransferRun>,
1727}
1728
1729impl ScheduleTransferRunsResponse {
1730 pub fn new() -> Self {
1731 std::default::Default::default()
1732 }
1733
1734 pub fn set_runs<T, V>(mut self, v: T) -> Self
1736 where
1737 T: std::iter::IntoIterator<Item = V>,
1738 V: std::convert::Into<crate::model::TransferRun>,
1739 {
1740 use std::iter::Iterator;
1741 self.runs = v.into_iter().map(|i| i.into()).collect();
1742 self
1743 }
1744}
1745
1746impl wkt::message::Message for ScheduleTransferRunsResponse {
1747 fn typename() -> &'static str {
1748 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse"
1749 }
1750}
1751
1752#[serde_with::serde_as]
1754#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1755#[serde(default, rename_all = "camelCase")]
1756#[non_exhaustive]
1757pub struct StartManualTransferRunsRequest {
1758 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1762 pub parent: std::string::String,
1763
1764 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
1767 pub time: std::option::Option<crate::model::start_manual_transfer_runs_request::Time>,
1768}
1769
1770impl StartManualTransferRunsRequest {
1771 pub fn new() -> Self {
1772 std::default::Default::default()
1773 }
1774
1775 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1777 self.parent = v.into();
1778 self
1779 }
1780
1781 pub fn set_time<
1783 T: std::convert::Into<
1784 std::option::Option<crate::model::start_manual_transfer_runs_request::Time>,
1785 >,
1786 >(
1787 mut self,
1788 v: T,
1789 ) -> Self {
1790 self.time = v.into();
1791 self
1792 }
1793
1794 pub fn get_requested_time_range(
1798 &self,
1799 ) -> std::option::Option<
1800 &std::boxed::Box<crate::model::start_manual_transfer_runs_request::TimeRange>,
1801 > {
1802 #[allow(unreachable_patterns)]
1803 self.time.as_ref().and_then(|v| match v {
1804 crate::model::start_manual_transfer_runs_request::Time::RequestedTimeRange(v) => {
1805 std::option::Option::Some(v)
1806 }
1807 _ => std::option::Option::None,
1808 })
1809 }
1810
1811 pub fn get_requested_run_time(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
1815 #[allow(unreachable_patterns)]
1816 self.time.as_ref().and_then(|v| match v {
1817 crate::model::start_manual_transfer_runs_request::Time::RequestedRunTime(v) => {
1818 std::option::Option::Some(v)
1819 }
1820 _ => std::option::Option::None,
1821 })
1822 }
1823
1824 pub fn set_requested_time_range<
1830 T: std::convert::Into<
1831 std::boxed::Box<crate::model::start_manual_transfer_runs_request::TimeRange>,
1832 >,
1833 >(
1834 mut self,
1835 v: T,
1836 ) -> Self {
1837 self.time = std::option::Option::Some(
1838 crate::model::start_manual_transfer_runs_request::Time::RequestedTimeRange(v.into()),
1839 );
1840 self
1841 }
1842
1843 pub fn set_requested_run_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
1849 mut self,
1850 v: T,
1851 ) -> Self {
1852 self.time = std::option::Option::Some(
1853 crate::model::start_manual_transfer_runs_request::Time::RequestedRunTime(v.into()),
1854 );
1855 self
1856 }
1857}
1858
1859impl wkt::message::Message for StartManualTransferRunsRequest {
1860 fn typename() -> &'static str {
1861 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest"
1862 }
1863}
1864
1865pub mod start_manual_transfer_runs_request {
1867 #[allow(unused_imports)]
1868 use super::*;
1869
1870 #[serde_with::serde_as]
1873 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1874 #[serde(default, rename_all = "camelCase")]
1875 #[non_exhaustive]
1876 pub struct TimeRange {
1877 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1882 pub start_time: std::option::Option<wkt::Timestamp>,
1883
1884 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1889 pub end_time: std::option::Option<wkt::Timestamp>,
1890 }
1891
1892 impl TimeRange {
1893 pub fn new() -> Self {
1894 std::default::Default::default()
1895 }
1896
1897 pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1899 mut self,
1900 v: T,
1901 ) -> Self {
1902 self.start_time = v.into();
1903 self
1904 }
1905
1906 pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1908 mut self,
1909 v: T,
1910 ) -> Self {
1911 self.end_time = v.into();
1912 self
1913 }
1914 }
1915
1916 impl wkt::message::Message for TimeRange {
1917 fn typename() -> &'static str {
1918 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange"
1919 }
1920 }
1921
1922 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1925 #[serde(rename_all = "camelCase")]
1926 #[non_exhaustive]
1927 pub enum Time {
1928 RequestedTimeRange(
1933 std::boxed::Box<crate::model::start_manual_transfer_runs_request::TimeRange>,
1934 ),
1935 RequestedRunTime(std::boxed::Box<wkt::Timestamp>),
1940 }
1941}
1942
1943#[serde_with::serde_as]
1945#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1946#[serde(default, rename_all = "camelCase")]
1947#[non_exhaustive]
1948pub struct StartManualTransferRunsResponse {
1949 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1951 pub runs: std::vec::Vec<crate::model::TransferRun>,
1952}
1953
1954impl StartManualTransferRunsResponse {
1955 pub fn new() -> Self {
1956 std::default::Default::default()
1957 }
1958
1959 pub fn set_runs<T, V>(mut self, v: T) -> Self
1961 where
1962 T: std::iter::IntoIterator<Item = V>,
1963 V: std::convert::Into<crate::model::TransferRun>,
1964 {
1965 use std::iter::Iterator;
1966 self.runs = v.into_iter().map(|i| i.into()).collect();
1967 self
1968 }
1969}
1970
1971impl wkt::message::Message for StartManualTransferRunsResponse {
1972 fn typename() -> &'static str {
1973 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse"
1974 }
1975}
1976
1977#[serde_with::serde_as]
1980#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1981#[serde(default, rename_all = "camelCase")]
1982#[non_exhaustive]
1983pub struct EnrollDataSourcesRequest {
1984 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1987 pub name: std::string::String,
1988
1989 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1992 pub data_source_ids: std::vec::Vec<std::string::String>,
1993}
1994
1995impl EnrollDataSourcesRequest {
1996 pub fn new() -> Self {
1997 std::default::Default::default()
1998 }
1999
2000 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2002 self.name = v.into();
2003 self
2004 }
2005
2006 pub fn set_data_source_ids<T, V>(mut self, v: T) -> Self
2008 where
2009 T: std::iter::IntoIterator<Item = V>,
2010 V: std::convert::Into<std::string::String>,
2011 {
2012 use std::iter::Iterator;
2013 self.data_source_ids = v.into_iter().map(|i| i.into()).collect();
2014 self
2015 }
2016}
2017
2018impl wkt::message::Message for EnrollDataSourcesRequest {
2019 fn typename() -> &'static str {
2020 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest"
2021 }
2022}
2023
2024#[serde_with::serde_as]
2027#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2028#[serde(default, rename_all = "camelCase")]
2029#[non_exhaustive]
2030pub struct UnenrollDataSourcesRequest {
2031 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2034 pub name: std::string::String,
2035
2036 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2039 pub data_source_ids: std::vec::Vec<std::string::String>,
2040}
2041
2042impl UnenrollDataSourcesRequest {
2043 pub fn new() -> Self {
2044 std::default::Default::default()
2045 }
2046
2047 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2049 self.name = v.into();
2050 self
2051 }
2052
2053 pub fn set_data_source_ids<T, V>(mut self, v: T) -> Self
2055 where
2056 T: std::iter::IntoIterator<Item = V>,
2057 V: std::convert::Into<std::string::String>,
2058 {
2059 use std::iter::Iterator;
2060 self.data_source_ids = v.into_iter().map(|i| i.into()).collect();
2061 self
2062 }
2063}
2064
2065impl wkt::message::Message for UnenrollDataSourcesRequest {
2066 fn typename() -> &'static str {
2067 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.UnenrollDataSourcesRequest"
2068 }
2069}
2070
2071#[serde_with::serde_as]
2074#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2075#[serde(default, rename_all = "camelCase")]
2076#[non_exhaustive]
2077pub struct EmailPreferences {
2078 pub enable_failure_email: bool,
2080}
2081
2082impl EmailPreferences {
2083 pub fn new() -> Self {
2084 std::default::Default::default()
2085 }
2086
2087 pub fn set_enable_failure_email<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2089 self.enable_failure_email = v.into();
2090 self
2091 }
2092}
2093
2094impl wkt::message::Message for EmailPreferences {
2095 fn typename() -> &'static str {
2096 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.EmailPreferences"
2097 }
2098}
2099
2100#[serde_with::serde_as]
2102#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2103#[serde(default, rename_all = "camelCase")]
2104#[non_exhaustive]
2105pub struct ScheduleOptions {
2106 pub disable_auto_scheduling: bool,
2111
2112 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2118 pub start_time: std::option::Option<wkt::Timestamp>,
2119
2120 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2125 pub end_time: std::option::Option<wkt::Timestamp>,
2126}
2127
2128impl ScheduleOptions {
2129 pub fn new() -> Self {
2130 std::default::Default::default()
2131 }
2132
2133 pub fn set_disable_auto_scheduling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2135 self.disable_auto_scheduling = v.into();
2136 self
2137 }
2138
2139 pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2141 mut self,
2142 v: T,
2143 ) -> Self {
2144 self.start_time = v.into();
2145 self
2146 }
2147
2148 pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2150 mut self,
2151 v: T,
2152 ) -> Self {
2153 self.end_time = v.into();
2154 self
2155 }
2156}
2157
2158impl wkt::message::Message for ScheduleOptions {
2159 fn typename() -> &'static str {
2160 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ScheduleOptions"
2161 }
2162}
2163
2164#[serde_with::serde_as]
2169#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2170#[serde(default, rename_all = "camelCase")]
2171#[non_exhaustive]
2172pub struct ScheduleOptionsV2 {
2173 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
2175 pub schedule: std::option::Option<crate::model::schedule_options_v_2::Schedule>,
2176}
2177
2178impl ScheduleOptionsV2 {
2179 pub fn new() -> Self {
2180 std::default::Default::default()
2181 }
2182
2183 pub fn set_schedule<
2185 T: std::convert::Into<std::option::Option<crate::model::schedule_options_v_2::Schedule>>,
2186 >(
2187 mut self,
2188 v: T,
2189 ) -> Self {
2190 self.schedule = v.into();
2191 self
2192 }
2193
2194 pub fn get_time_based_schedule(
2198 &self,
2199 ) -> std::option::Option<&std::boxed::Box<crate::model::TimeBasedSchedule>> {
2200 #[allow(unreachable_patterns)]
2201 self.schedule.as_ref().and_then(|v| match v {
2202 crate::model::schedule_options_v_2::Schedule::TimeBasedSchedule(v) => {
2203 std::option::Option::Some(v)
2204 }
2205 _ => std::option::Option::None,
2206 })
2207 }
2208
2209 pub fn get_manual_schedule(
2213 &self,
2214 ) -> std::option::Option<&std::boxed::Box<crate::model::ManualSchedule>> {
2215 #[allow(unreachable_patterns)]
2216 self.schedule.as_ref().and_then(|v| match v {
2217 crate::model::schedule_options_v_2::Schedule::ManualSchedule(v) => {
2218 std::option::Option::Some(v)
2219 }
2220 _ => std::option::Option::None,
2221 })
2222 }
2223
2224 pub fn get_event_driven_schedule(
2228 &self,
2229 ) -> std::option::Option<&std::boxed::Box<crate::model::EventDrivenSchedule>> {
2230 #[allow(unreachable_patterns)]
2231 self.schedule.as_ref().and_then(|v| match v {
2232 crate::model::schedule_options_v_2::Schedule::EventDrivenSchedule(v) => {
2233 std::option::Option::Some(v)
2234 }
2235 _ => std::option::Option::None,
2236 })
2237 }
2238
2239 pub fn set_time_based_schedule<
2245 T: std::convert::Into<std::boxed::Box<crate::model::TimeBasedSchedule>>,
2246 >(
2247 mut self,
2248 v: T,
2249 ) -> Self {
2250 self.schedule = std::option::Option::Some(
2251 crate::model::schedule_options_v_2::Schedule::TimeBasedSchedule(v.into()),
2252 );
2253 self
2254 }
2255
2256 pub fn set_manual_schedule<
2262 T: std::convert::Into<std::boxed::Box<crate::model::ManualSchedule>>,
2263 >(
2264 mut self,
2265 v: T,
2266 ) -> Self {
2267 self.schedule = std::option::Option::Some(
2268 crate::model::schedule_options_v_2::Schedule::ManualSchedule(v.into()),
2269 );
2270 self
2271 }
2272
2273 pub fn set_event_driven_schedule<
2279 T: std::convert::Into<std::boxed::Box<crate::model::EventDrivenSchedule>>,
2280 >(
2281 mut self,
2282 v: T,
2283 ) -> Self {
2284 self.schedule = std::option::Option::Some(
2285 crate::model::schedule_options_v_2::Schedule::EventDrivenSchedule(v.into()),
2286 );
2287 self
2288 }
2289}
2290
2291impl wkt::message::Message for ScheduleOptionsV2 {
2292 fn typename() -> &'static str {
2293 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ScheduleOptionsV2"
2294 }
2295}
2296
2297pub mod schedule_options_v_2 {
2299 #[allow(unused_imports)]
2300 use super::*;
2301
2302 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
2304 #[serde(rename_all = "camelCase")]
2305 #[non_exhaustive]
2306 pub enum Schedule {
2307 TimeBasedSchedule(std::boxed::Box<crate::model::TimeBasedSchedule>),
2310 ManualSchedule(std::boxed::Box<crate::model::ManualSchedule>),
2315 EventDrivenSchedule(std::boxed::Box<crate::model::EventDrivenSchedule>),
2318 }
2319}
2320
2321#[serde_with::serde_as]
2324#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2325#[serde(default, rename_all = "camelCase")]
2326#[non_exhaustive]
2327pub struct TimeBasedSchedule {
2328 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2342 pub schedule: std::string::String,
2343
2344 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2349 pub start_time: std::option::Option<wkt::Timestamp>,
2350
2351 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2355 pub end_time: std::option::Option<wkt::Timestamp>,
2356}
2357
2358impl TimeBasedSchedule {
2359 pub fn new() -> Self {
2360 std::default::Default::default()
2361 }
2362
2363 pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2365 self.schedule = v.into();
2366 self
2367 }
2368
2369 pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2371 mut self,
2372 v: T,
2373 ) -> Self {
2374 self.start_time = v.into();
2375 self
2376 }
2377
2378 pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2380 mut self,
2381 v: T,
2382 ) -> Self {
2383 self.end_time = v.into();
2384 self
2385 }
2386}
2387
2388impl wkt::message::Message for TimeBasedSchedule {
2389 fn typename() -> &'static str {
2390 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.TimeBasedSchedule"
2391 }
2392}
2393
2394#[serde_with::serde_as]
2396#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2397#[serde(default, rename_all = "camelCase")]
2398#[non_exhaustive]
2399pub struct ManualSchedule {}
2400
2401impl ManualSchedule {
2402 pub fn new() -> Self {
2403 std::default::Default::default()
2404 }
2405}
2406
2407impl wkt::message::Message for ManualSchedule {
2408 fn typename() -> &'static str {
2409 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ManualSchedule"
2410 }
2411}
2412
2413#[serde_with::serde_as]
2415#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2416#[serde(default, rename_all = "camelCase")]
2417#[non_exhaustive]
2418pub struct EventDrivenSchedule {
2419 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2423 pub pubsub_subscription: std::string::String,
2424}
2425
2426impl EventDrivenSchedule {
2427 pub fn new() -> Self {
2428 std::default::Default::default()
2429 }
2430
2431 pub fn set_pubsub_subscription<T: std::convert::Into<std::string::String>>(
2433 mut self,
2434 v: T,
2435 ) -> Self {
2436 self.pubsub_subscription = v.into();
2437 self
2438 }
2439}
2440
2441impl wkt::message::Message for EventDrivenSchedule {
2442 fn typename() -> &'static str {
2443 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.EventDrivenSchedule"
2444 }
2445}
2446
2447#[serde_with::serde_as]
2449#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2450#[serde(default, rename_all = "camelCase")]
2451#[non_exhaustive]
2452pub struct UserInfo {
2453 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2455 pub email: std::option::Option<std::string::String>,
2456}
2457
2458impl UserInfo {
2459 pub fn new() -> Self {
2460 std::default::Default::default()
2461 }
2462
2463 pub fn set_email<T: std::convert::Into<std::option::Option<std::string::String>>>(
2465 mut self,
2466 v: T,
2467 ) -> Self {
2468 self.email = v.into();
2469 self
2470 }
2471}
2472
2473impl wkt::message::Message for UserInfo {
2474 fn typename() -> &'static str {
2475 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.UserInfo"
2476 }
2477}
2478
2479#[serde_with::serde_as]
2486#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2487#[serde(default, rename_all = "camelCase")]
2488#[non_exhaustive]
2489pub struct TransferConfig {
2490 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2498 pub name: std::string::String,
2499
2500 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2502 pub display_name: std::string::String,
2503
2504 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2508 pub data_source_id: std::string::String,
2509
2510 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2515 pub params: std::option::Option<wkt::Struct>,
2516
2517 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2531 pub schedule: std::string::String,
2532
2533 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2535 pub schedule_options: std::option::Option<crate::model::ScheduleOptions>,
2536
2537 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2541 pub schedule_options_v2: std::option::Option<crate::model::ScheduleOptionsV2>,
2542
2543 pub data_refresh_window_days: i32,
2550
2551 pub disabled: bool,
2554
2555 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2557 pub update_time: std::option::Option<wkt::Timestamp>,
2558
2559 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2561 pub next_run_time: std::option::Option<wkt::Timestamp>,
2562
2563 pub state: crate::model::TransferState,
2565
2566 #[serde_as(as = "serde_with::DisplayFromStr")]
2568 pub user_id: i64,
2569
2570 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2572 pub dataset_region: std::string::String,
2573
2574 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2580 pub notification_pubsub_topic: std::string::String,
2581
2582 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2585 pub email_preferences: std::option::Option<crate::model::EmailPreferences>,
2586
2587 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2591 pub owner_info: std::option::Option<crate::model::UserInfo>,
2592
2593 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2599 pub encryption_configuration: std::option::Option<crate::model::EncryptionConfiguration>,
2600
2601 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2604 pub error: std::option::Option<rpc::model::Status>,
2605
2606 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
2608 pub destination: std::option::Option<crate::model::transfer_config::Destination>,
2609}
2610
2611impl TransferConfig {
2612 pub fn new() -> Self {
2613 std::default::Default::default()
2614 }
2615
2616 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2618 self.name = v.into();
2619 self
2620 }
2621
2622 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2624 self.display_name = v.into();
2625 self
2626 }
2627
2628 pub fn set_data_source_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2630 self.data_source_id = v.into();
2631 self
2632 }
2633
2634 pub fn set_params<T: std::convert::Into<std::option::Option<wkt::Struct>>>(
2636 mut self,
2637 v: T,
2638 ) -> Self {
2639 self.params = v.into();
2640 self
2641 }
2642
2643 pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2645 self.schedule = v.into();
2646 self
2647 }
2648
2649 pub fn set_schedule_options<
2651 T: std::convert::Into<std::option::Option<crate::model::ScheduleOptions>>,
2652 >(
2653 mut self,
2654 v: T,
2655 ) -> Self {
2656 self.schedule_options = v.into();
2657 self
2658 }
2659
2660 pub fn set_schedule_options_v2<
2662 T: std::convert::Into<std::option::Option<crate::model::ScheduleOptionsV2>>,
2663 >(
2664 mut self,
2665 v: T,
2666 ) -> Self {
2667 self.schedule_options_v2 = v.into();
2668 self
2669 }
2670
2671 pub fn set_data_refresh_window_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2673 self.data_refresh_window_days = v.into();
2674 self
2675 }
2676
2677 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2679 self.disabled = v.into();
2680 self
2681 }
2682
2683 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2685 mut self,
2686 v: T,
2687 ) -> Self {
2688 self.update_time = v.into();
2689 self
2690 }
2691
2692 pub fn set_next_run_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2694 mut self,
2695 v: T,
2696 ) -> Self {
2697 self.next_run_time = v.into();
2698 self
2699 }
2700
2701 pub fn set_state<T: std::convert::Into<crate::model::TransferState>>(mut self, v: T) -> Self {
2703 self.state = v.into();
2704 self
2705 }
2706
2707 pub fn set_user_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2709 self.user_id = v.into();
2710 self
2711 }
2712
2713 pub fn set_dataset_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2715 self.dataset_region = v.into();
2716 self
2717 }
2718
2719 pub fn set_notification_pubsub_topic<T: std::convert::Into<std::string::String>>(
2721 mut self,
2722 v: T,
2723 ) -> Self {
2724 self.notification_pubsub_topic = v.into();
2725 self
2726 }
2727
2728 pub fn set_email_preferences<
2730 T: std::convert::Into<std::option::Option<crate::model::EmailPreferences>>,
2731 >(
2732 mut self,
2733 v: T,
2734 ) -> Self {
2735 self.email_preferences = v.into();
2736 self
2737 }
2738
2739 pub fn set_owner_info<T: std::convert::Into<std::option::Option<crate::model::UserInfo>>>(
2741 mut self,
2742 v: T,
2743 ) -> Self {
2744 self.owner_info = v.into();
2745 self
2746 }
2747
2748 pub fn set_encryption_configuration<
2750 T: std::convert::Into<std::option::Option<crate::model::EncryptionConfiguration>>,
2751 >(
2752 mut self,
2753 v: T,
2754 ) -> Self {
2755 self.encryption_configuration = v.into();
2756 self
2757 }
2758
2759 pub fn set_error<T: std::convert::Into<std::option::Option<rpc::model::Status>>>(
2761 mut self,
2762 v: T,
2763 ) -> Self {
2764 self.error = v.into();
2765 self
2766 }
2767
2768 pub fn set_destination<
2770 T: std::convert::Into<std::option::Option<crate::model::transfer_config::Destination>>,
2771 >(
2772 mut self,
2773 v: T,
2774 ) -> Self {
2775 self.destination = v.into();
2776 self
2777 }
2778
2779 pub fn get_destination_dataset_id(&self) -> std::option::Option<&std::string::String> {
2783 #[allow(unreachable_patterns)]
2784 self.destination.as_ref().and_then(|v| match v {
2785 crate::model::transfer_config::Destination::DestinationDatasetId(v) => {
2786 std::option::Option::Some(v)
2787 }
2788 _ => std::option::Option::None,
2789 })
2790 }
2791
2792 pub fn set_destination_dataset_id<T: std::convert::Into<std::string::String>>(
2798 mut self,
2799 v: T,
2800 ) -> Self {
2801 self.destination = std::option::Option::Some(
2802 crate::model::transfer_config::Destination::DestinationDatasetId(v.into()),
2803 );
2804 self
2805 }
2806}
2807
2808impl wkt::message::Message for TransferConfig {
2809 fn typename() -> &'static str {
2810 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.TransferConfig"
2811 }
2812}
2813
2814pub mod transfer_config {
2816 #[allow(unused_imports)]
2817 use super::*;
2818
2819 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
2821 #[serde(rename_all = "camelCase")]
2822 #[non_exhaustive]
2823 pub enum Destination {
2824 DestinationDatasetId(std::string::String),
2826 }
2827}
2828
2829#[serde_with::serde_as]
2831#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2832#[serde(default, rename_all = "camelCase")]
2833#[non_exhaustive]
2834pub struct EncryptionConfiguration {
2835 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2837 pub kms_key_name: std::option::Option<wkt::StringValue>,
2838}
2839
2840impl EncryptionConfiguration {
2841 pub fn new() -> Self {
2842 std::default::Default::default()
2843 }
2844
2845 pub fn set_kms_key_name<T: std::convert::Into<std::option::Option<wkt::StringValue>>>(
2847 mut self,
2848 v: T,
2849 ) -> Self {
2850 self.kms_key_name = v.into();
2851 self
2852 }
2853}
2854
2855impl wkt::message::Message for EncryptionConfiguration {
2856 fn typename() -> &'static str {
2857 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.EncryptionConfiguration"
2858 }
2859}
2860
2861#[serde_with::serde_as]
2863#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2864#[serde(default, rename_all = "camelCase")]
2865#[non_exhaustive]
2866pub struct TransferRun {
2867 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2872 pub name: std::string::String,
2873
2874 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2876 pub schedule_time: std::option::Option<wkt::Timestamp>,
2877
2878 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2881 pub run_time: std::option::Option<wkt::Timestamp>,
2882
2883 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2885 pub error_status: std::option::Option<rpc::model::Status>,
2886
2887 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2890 pub start_time: std::option::Option<wkt::Timestamp>,
2891
2892 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2895 pub end_time: std::option::Option<wkt::Timestamp>,
2896
2897 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2899 pub update_time: std::option::Option<wkt::Timestamp>,
2900
2901 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2907 pub params: std::option::Option<wkt::Struct>,
2908
2909 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2911 pub data_source_id: std::string::String,
2912
2913 pub state: crate::model::TransferState,
2915
2916 #[serde_as(as = "serde_with::DisplayFromStr")]
2918 pub user_id: i64,
2919
2920 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2926 pub schedule: std::string::String,
2927
2928 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2934 pub notification_pubsub_topic: std::string::String,
2935
2936 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2940 pub email_preferences: std::option::Option<crate::model::EmailPreferences>,
2941
2942 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
2944 pub destination: std::option::Option<crate::model::transfer_run::Destination>,
2945}
2946
2947impl TransferRun {
2948 pub fn new() -> Self {
2949 std::default::Default::default()
2950 }
2951
2952 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2954 self.name = v.into();
2955 self
2956 }
2957
2958 pub fn set_schedule_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2960 mut self,
2961 v: T,
2962 ) -> Self {
2963 self.schedule_time = v.into();
2964 self
2965 }
2966
2967 pub fn set_run_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2969 mut self,
2970 v: T,
2971 ) -> Self {
2972 self.run_time = v.into();
2973 self
2974 }
2975
2976 pub fn set_error_status<T: std::convert::Into<std::option::Option<rpc::model::Status>>>(
2978 mut self,
2979 v: T,
2980 ) -> Self {
2981 self.error_status = v.into();
2982 self
2983 }
2984
2985 pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2987 mut self,
2988 v: T,
2989 ) -> Self {
2990 self.start_time = v.into();
2991 self
2992 }
2993
2994 pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2996 mut self,
2997 v: T,
2998 ) -> Self {
2999 self.end_time = v.into();
3000 self
3001 }
3002
3003 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3005 mut self,
3006 v: T,
3007 ) -> Self {
3008 self.update_time = v.into();
3009 self
3010 }
3011
3012 pub fn set_params<T: std::convert::Into<std::option::Option<wkt::Struct>>>(
3014 mut self,
3015 v: T,
3016 ) -> Self {
3017 self.params = v.into();
3018 self
3019 }
3020
3021 pub fn set_data_source_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3023 self.data_source_id = v.into();
3024 self
3025 }
3026
3027 pub fn set_state<T: std::convert::Into<crate::model::TransferState>>(mut self, v: T) -> Self {
3029 self.state = v.into();
3030 self
3031 }
3032
3033 pub fn set_user_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3035 self.user_id = v.into();
3036 self
3037 }
3038
3039 pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3041 self.schedule = v.into();
3042 self
3043 }
3044
3045 pub fn set_notification_pubsub_topic<T: std::convert::Into<std::string::String>>(
3047 mut self,
3048 v: T,
3049 ) -> Self {
3050 self.notification_pubsub_topic = v.into();
3051 self
3052 }
3053
3054 pub fn set_email_preferences<
3056 T: std::convert::Into<std::option::Option<crate::model::EmailPreferences>>,
3057 >(
3058 mut self,
3059 v: T,
3060 ) -> Self {
3061 self.email_preferences = v.into();
3062 self
3063 }
3064
3065 pub fn set_destination<
3067 T: std::convert::Into<std::option::Option<crate::model::transfer_run::Destination>>,
3068 >(
3069 mut self,
3070 v: T,
3071 ) -> Self {
3072 self.destination = v.into();
3073 self
3074 }
3075
3076 pub fn get_destination_dataset_id(&self) -> std::option::Option<&std::string::String> {
3080 #[allow(unreachable_patterns)]
3081 self.destination.as_ref().and_then(|v| match v {
3082 crate::model::transfer_run::Destination::DestinationDatasetId(v) => {
3083 std::option::Option::Some(v)
3084 }
3085 _ => std::option::Option::None,
3086 })
3087 }
3088
3089 pub fn set_destination_dataset_id<T: std::convert::Into<std::string::String>>(
3095 mut self,
3096 v: T,
3097 ) -> Self {
3098 self.destination = std::option::Option::Some(
3099 crate::model::transfer_run::Destination::DestinationDatasetId(v.into()),
3100 );
3101 self
3102 }
3103}
3104
3105impl wkt::message::Message for TransferRun {
3106 fn typename() -> &'static str {
3107 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.TransferRun"
3108 }
3109}
3110
3111pub mod transfer_run {
3113 #[allow(unused_imports)]
3114 use super::*;
3115
3116 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3118 #[serde(rename_all = "camelCase")]
3119 #[non_exhaustive]
3120 pub enum Destination {
3121 DestinationDatasetId(std::string::String),
3123 }
3124}
3125
3126#[serde_with::serde_as]
3128#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3129#[serde(default, rename_all = "camelCase")]
3130#[non_exhaustive]
3131pub struct TransferMessage {
3132 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3134 pub message_time: std::option::Option<wkt::Timestamp>,
3135
3136 pub severity: crate::model::transfer_message::MessageSeverity,
3138
3139 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3141 pub message_text: std::string::String,
3142}
3143
3144impl TransferMessage {
3145 pub fn new() -> Self {
3146 std::default::Default::default()
3147 }
3148
3149 pub fn set_message_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3151 mut self,
3152 v: T,
3153 ) -> Self {
3154 self.message_time = v.into();
3155 self
3156 }
3157
3158 pub fn set_severity<T: std::convert::Into<crate::model::transfer_message::MessageSeverity>>(
3160 mut self,
3161 v: T,
3162 ) -> Self {
3163 self.severity = v.into();
3164 self
3165 }
3166
3167 pub fn set_message_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3169 self.message_text = v.into();
3170 self
3171 }
3172}
3173
3174impl wkt::message::Message for TransferMessage {
3175 fn typename() -> &'static str {
3176 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.TransferMessage"
3177 }
3178}
3179
3180pub mod transfer_message {
3182 #[allow(unused_imports)]
3183 use super::*;
3184
3185 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3187 pub struct MessageSeverity(std::borrow::Cow<'static, str>);
3188
3189 impl MessageSeverity {
3190 pub const fn new(v: &'static str) -> Self {
3192 Self(std::borrow::Cow::Borrowed(v))
3193 }
3194
3195 pub fn value(&self) -> &str {
3197 &self.0
3198 }
3199 }
3200
3201 pub mod message_severity {
3203 use super::MessageSeverity;
3204
3205 pub const MESSAGE_SEVERITY_UNSPECIFIED: MessageSeverity =
3207 MessageSeverity::new("MESSAGE_SEVERITY_UNSPECIFIED");
3208
3209 pub const INFO: MessageSeverity = MessageSeverity::new("INFO");
3211
3212 pub const WARNING: MessageSeverity = MessageSeverity::new("WARNING");
3214
3215 pub const ERROR: MessageSeverity = MessageSeverity::new("ERROR");
3217 }
3218
3219 impl std::convert::From<std::string::String> for MessageSeverity {
3220 fn from(value: std::string::String) -> Self {
3221 Self(std::borrow::Cow::Owned(value))
3222 }
3223 }
3224}
3225
3226#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3228pub struct TransferType(std::borrow::Cow<'static, str>);
3229
3230impl TransferType {
3231 pub const fn new(v: &'static str) -> Self {
3233 Self(std::borrow::Cow::Borrowed(v))
3234 }
3235
3236 pub fn value(&self) -> &str {
3238 &self.0
3239 }
3240}
3241
3242pub mod transfer_type {
3244 use super::TransferType;
3245
3246 pub const TRANSFER_TYPE_UNSPECIFIED: TransferType =
3248 TransferType::new("TRANSFER_TYPE_UNSPECIFIED");
3249
3250 pub const BATCH: TransferType = TransferType::new("BATCH");
3252
3253 pub const STREAMING: TransferType = TransferType::new("STREAMING");
3256}
3257
3258impl std::convert::From<std::string::String> for TransferType {
3259 fn from(value: std::string::String) -> Self {
3260 Self(std::borrow::Cow::Owned(value))
3261 }
3262}
3263
3264#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3266pub struct TransferState(std::borrow::Cow<'static, str>);
3267
3268impl TransferState {
3269 pub const fn new(v: &'static str) -> Self {
3271 Self(std::borrow::Cow::Borrowed(v))
3272 }
3273
3274 pub fn value(&self) -> &str {
3276 &self.0
3277 }
3278}
3279
3280pub mod transfer_state {
3282 use super::TransferState;
3283
3284 pub const TRANSFER_STATE_UNSPECIFIED: TransferState =
3286 TransferState::new("TRANSFER_STATE_UNSPECIFIED");
3287
3288 pub const PENDING: TransferState = TransferState::new("PENDING");
3291
3292 pub const RUNNING: TransferState = TransferState::new("RUNNING");
3294
3295 pub const SUCCEEDED: TransferState = TransferState::new("SUCCEEDED");
3297
3298 pub const FAILED: TransferState = TransferState::new("FAILED");
3300
3301 pub const CANCELLED: TransferState = TransferState::new("CANCELLED");
3303}
3304
3305impl std::convert::From<std::string::String> for TransferState {
3306 fn from(value: std::string::String) -> Self {
3307 Self(std::borrow::Cow::Owned(value))
3308 }
3309}