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 lazy_static;
25extern crate location;
26extern crate reqwest;
27extern crate rpc;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35#[serde_with::serde_as]
37#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
38#[serde(default, rename_all = "camelCase")]
39#[non_exhaustive]
40pub struct DataSourceParameter {
41 #[serde(skip_serializing_if = "std::string::String::is_empty")]
43 pub param_id: std::string::String,
44
45 #[serde(skip_serializing_if = "std::string::String::is_empty")]
47 pub display_name: std::string::String,
48
49 #[serde(skip_serializing_if = "std::string::String::is_empty")]
51 pub description: std::string::String,
52
53 #[serde(rename = "type")]
55 pub r#type: crate::model::data_source_parameter::Type,
56
57 pub required: bool,
59
60 pub repeated: bool,
62
63 #[serde(skip_serializing_if = "std::string::String::is_empty")]
65 pub validation_regex: std::string::String,
66
67 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
69 pub allowed_values: std::vec::Vec<std::string::String>,
70
71 #[serde(skip_serializing_if = "std::option::Option::is_none")]
73 pub min_value: std::option::Option<wkt::DoubleValue>,
74
75 #[serde(skip_serializing_if = "std::option::Option::is_none")]
77 pub max_value: std::option::Option<wkt::DoubleValue>,
78
79 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
81 pub fields: std::vec::Vec<crate::model::DataSourceParameter>,
82
83 #[serde(skip_serializing_if = "std::string::String::is_empty")]
86 pub validation_description: std::string::String,
87
88 #[serde(skip_serializing_if = "std::string::String::is_empty")]
90 pub validation_help_url: std::string::String,
91
92 pub immutable: bool,
94
95 pub recurse: bool,
97
98 pub deprecated: bool,
101
102 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
103 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
104}
105
106impl DataSourceParameter {
107 pub fn new() -> Self {
108 std::default::Default::default()
109 }
110
111 pub fn set_param_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
113 self.param_id = v.into();
114 self
115 }
116
117 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
119 self.display_name = v.into();
120 self
121 }
122
123 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
125 self.description = v.into();
126 self
127 }
128
129 pub fn set_type<T: std::convert::Into<crate::model::data_source_parameter::Type>>(
131 mut self,
132 v: T,
133 ) -> Self {
134 self.r#type = v.into();
135 self
136 }
137
138 pub fn set_required<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
140 self.required = v.into();
141 self
142 }
143
144 pub fn set_repeated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
146 self.repeated = v.into();
147 self
148 }
149
150 pub fn set_validation_regex<T: std::convert::Into<std::string::String>>(
152 mut self,
153 v: T,
154 ) -> Self {
155 self.validation_regex = v.into();
156 self
157 }
158
159 pub fn set_min_value<T: std::convert::Into<std::option::Option<wkt::DoubleValue>>>(
161 mut self,
162 v: T,
163 ) -> Self {
164 self.min_value = v.into();
165 self
166 }
167
168 pub fn set_max_value<T: std::convert::Into<std::option::Option<wkt::DoubleValue>>>(
170 mut self,
171 v: T,
172 ) -> Self {
173 self.max_value = v.into();
174 self
175 }
176
177 pub fn set_validation_description<T: std::convert::Into<std::string::String>>(
179 mut self,
180 v: T,
181 ) -> Self {
182 self.validation_description = v.into();
183 self
184 }
185
186 pub fn set_validation_help_url<T: std::convert::Into<std::string::String>>(
188 mut self,
189 v: T,
190 ) -> Self {
191 self.validation_help_url = v.into();
192 self
193 }
194
195 pub fn set_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
197 self.immutable = v.into();
198 self
199 }
200
201 pub fn set_recurse<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
203 self.recurse = v.into();
204 self
205 }
206
207 pub fn set_deprecated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
209 self.deprecated = v.into();
210 self
211 }
212
213 pub fn set_allowed_values<T, V>(mut self, v: T) -> Self
215 where
216 T: std::iter::IntoIterator<Item = V>,
217 V: std::convert::Into<std::string::String>,
218 {
219 use std::iter::Iterator;
220 self.allowed_values = v.into_iter().map(|i| i.into()).collect();
221 self
222 }
223
224 pub fn set_fields<T, V>(mut self, v: T) -> Self
226 where
227 T: std::iter::IntoIterator<Item = V>,
228 V: std::convert::Into<crate::model::DataSourceParameter>,
229 {
230 use std::iter::Iterator;
231 self.fields = v.into_iter().map(|i| i.into()).collect();
232 self
233 }
234}
235
236impl wkt::message::Message for DataSourceParameter {
237 fn typename() -> &'static str {
238 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.DataSourceParameter"
239 }
240}
241
242pub mod data_source_parameter {
244 #[allow(unused_imports)]
245 use super::*;
246
247 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
249 pub struct Type(i32);
250
251 impl Type {
252 pub const TYPE_UNSPECIFIED: Type = Type::new(0);
254
255 pub const STRING: Type = Type::new(1);
257
258 pub const INTEGER: Type = Type::new(2);
261
262 pub const DOUBLE: Type = Type::new(3);
264
265 pub const BOOLEAN: Type = Type::new(4);
267
268 pub const RECORD: Type = Type::new(5);
270
271 pub const PLUS_PAGE: Type = Type::new(6);
273
274 pub const LIST: Type = Type::new(7);
276
277 pub(crate) const fn new(value: i32) -> Self {
279 Self(value)
280 }
281
282 pub fn value(&self) -> i32 {
284 self.0
285 }
286
287 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
289 match self.0 {
290 0 => std::borrow::Cow::Borrowed("TYPE_UNSPECIFIED"),
291 1 => std::borrow::Cow::Borrowed("STRING"),
292 2 => std::borrow::Cow::Borrowed("INTEGER"),
293 3 => std::borrow::Cow::Borrowed("DOUBLE"),
294 4 => std::borrow::Cow::Borrowed("BOOLEAN"),
295 5 => std::borrow::Cow::Borrowed("RECORD"),
296 6 => std::borrow::Cow::Borrowed("PLUS_PAGE"),
297 7 => std::borrow::Cow::Borrowed("LIST"),
298 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
299 }
300 }
301
302 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
304 match name {
305 "TYPE_UNSPECIFIED" => std::option::Option::Some(Self::TYPE_UNSPECIFIED),
306 "STRING" => std::option::Option::Some(Self::STRING),
307 "INTEGER" => std::option::Option::Some(Self::INTEGER),
308 "DOUBLE" => std::option::Option::Some(Self::DOUBLE),
309 "BOOLEAN" => std::option::Option::Some(Self::BOOLEAN),
310 "RECORD" => std::option::Option::Some(Self::RECORD),
311 "PLUS_PAGE" => std::option::Option::Some(Self::PLUS_PAGE),
312 "LIST" => std::option::Option::Some(Self::LIST),
313 _ => std::option::Option::None,
314 }
315 }
316 }
317
318 impl std::convert::From<i32> for Type {
319 fn from(value: i32) -> Self {
320 Self::new(value)
321 }
322 }
323
324 impl std::default::Default for Type {
325 fn default() -> Self {
326 Self::new(0)
327 }
328 }
329}
330
331#[serde_with::serde_as]
333#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
334#[serde(default, rename_all = "camelCase")]
335#[non_exhaustive]
336pub struct DataSource {
337 #[serde(skip_serializing_if = "std::string::String::is_empty")]
339 pub name: std::string::String,
340
341 #[serde(skip_serializing_if = "std::string::String::is_empty")]
343 pub data_source_id: std::string::String,
344
345 #[serde(skip_serializing_if = "std::string::String::is_empty")]
347 pub display_name: std::string::String,
348
349 #[serde(skip_serializing_if = "std::string::String::is_empty")]
351 pub description: std::string::String,
352
353 #[serde(skip_serializing_if = "std::string::String::is_empty")]
355 pub client_id: std::string::String,
356
357 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
361 pub scopes: std::vec::Vec<std::string::String>,
362
363 pub transfer_type: crate::model::TransferType,
365
366 pub supports_multiple_transfers: bool,
368
369 pub update_deadline_seconds: i32,
372
373 #[serde(skip_serializing_if = "std::string::String::is_empty")]
379 pub default_schedule: std::string::String,
380
381 pub supports_custom_schedule: bool,
385
386 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
388 pub parameters: std::vec::Vec<crate::model::DataSourceParameter>,
389
390 #[serde(skip_serializing_if = "std::string::String::is_empty")]
392 pub help_url: std::string::String,
393
394 pub authorization_type: crate::model::data_source::AuthorizationType,
396
397 pub data_refresh_type: crate::model::data_source::DataRefreshType,
402
403 pub default_data_refresh_window_days: i32,
406
407 pub manual_runs_disabled: bool,
410
411 #[serde(skip_serializing_if = "std::option::Option::is_none")]
413 pub minimum_schedule_interval: std::option::Option<wkt::Duration>,
414
415 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
416 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
417}
418
419impl DataSource {
420 pub fn new() -> Self {
421 std::default::Default::default()
422 }
423
424 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
426 self.name = v.into();
427 self
428 }
429
430 pub fn set_data_source_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
432 self.data_source_id = v.into();
433 self
434 }
435
436 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
438 self.display_name = v.into();
439 self
440 }
441
442 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
444 self.description = v.into();
445 self
446 }
447
448 pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
450 self.client_id = v.into();
451 self
452 }
453
454 pub fn set_transfer_type<T: std::convert::Into<crate::model::TransferType>>(
456 mut self,
457 v: T,
458 ) -> Self {
459 self.transfer_type = v.into();
460 self
461 }
462
463 pub fn set_supports_multiple_transfers<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
465 self.supports_multiple_transfers = v.into();
466 self
467 }
468
469 pub fn set_update_deadline_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
471 self.update_deadline_seconds = v.into();
472 self
473 }
474
475 pub fn set_default_schedule<T: std::convert::Into<std::string::String>>(
477 mut self,
478 v: T,
479 ) -> Self {
480 self.default_schedule = v.into();
481 self
482 }
483
484 pub fn set_supports_custom_schedule<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
486 self.supports_custom_schedule = v.into();
487 self
488 }
489
490 pub fn set_help_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
492 self.help_url = v.into();
493 self
494 }
495
496 pub fn set_authorization_type<
498 T: std::convert::Into<crate::model::data_source::AuthorizationType>,
499 >(
500 mut self,
501 v: T,
502 ) -> Self {
503 self.authorization_type = v.into();
504 self
505 }
506
507 pub fn set_data_refresh_type<
509 T: std::convert::Into<crate::model::data_source::DataRefreshType>,
510 >(
511 mut self,
512 v: T,
513 ) -> Self {
514 self.data_refresh_type = v.into();
515 self
516 }
517
518 pub fn set_default_data_refresh_window_days<T: std::convert::Into<i32>>(
520 mut self,
521 v: T,
522 ) -> Self {
523 self.default_data_refresh_window_days = v.into();
524 self
525 }
526
527 pub fn set_manual_runs_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
529 self.manual_runs_disabled = v.into();
530 self
531 }
532
533 pub fn set_minimum_schedule_interval<
535 T: std::convert::Into<std::option::Option<wkt::Duration>>,
536 >(
537 mut self,
538 v: T,
539 ) -> Self {
540 self.minimum_schedule_interval = v.into();
541 self
542 }
543
544 pub fn set_scopes<T, V>(mut self, v: T) -> Self
546 where
547 T: std::iter::IntoIterator<Item = V>,
548 V: std::convert::Into<std::string::String>,
549 {
550 use std::iter::Iterator;
551 self.scopes = v.into_iter().map(|i| i.into()).collect();
552 self
553 }
554
555 pub fn set_parameters<T, V>(mut self, v: T) -> Self
557 where
558 T: std::iter::IntoIterator<Item = V>,
559 V: std::convert::Into<crate::model::DataSourceParameter>,
560 {
561 use std::iter::Iterator;
562 self.parameters = v.into_iter().map(|i| i.into()).collect();
563 self
564 }
565}
566
567impl wkt::message::Message for DataSource {
568 fn typename() -> &'static str {
569 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.DataSource"
570 }
571}
572
573pub mod data_source {
575 #[allow(unused_imports)]
576 use super::*;
577
578 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
580 pub struct AuthorizationType(i32);
581
582 impl AuthorizationType {
583 pub const AUTHORIZATION_TYPE_UNSPECIFIED: AuthorizationType = AuthorizationType::new(0);
585
586 pub const AUTHORIZATION_CODE: AuthorizationType = AuthorizationType::new(1);
589
590 pub const GOOGLE_PLUS_AUTHORIZATION_CODE: AuthorizationType = AuthorizationType::new(2);
593
594 pub const FIRST_PARTY_OAUTH: AuthorizationType = AuthorizationType::new(3);
596
597 pub(crate) const fn new(value: i32) -> Self {
599 Self(value)
600 }
601
602 pub fn value(&self) -> i32 {
604 self.0
605 }
606
607 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
609 match self.0 {
610 0 => std::borrow::Cow::Borrowed("AUTHORIZATION_TYPE_UNSPECIFIED"),
611 1 => std::borrow::Cow::Borrowed("AUTHORIZATION_CODE"),
612 2 => std::borrow::Cow::Borrowed("GOOGLE_PLUS_AUTHORIZATION_CODE"),
613 3 => std::borrow::Cow::Borrowed("FIRST_PARTY_OAUTH"),
614 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
615 }
616 }
617
618 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
620 match name {
621 "AUTHORIZATION_TYPE_UNSPECIFIED" => {
622 std::option::Option::Some(Self::AUTHORIZATION_TYPE_UNSPECIFIED)
623 }
624 "AUTHORIZATION_CODE" => std::option::Option::Some(Self::AUTHORIZATION_CODE),
625 "GOOGLE_PLUS_AUTHORIZATION_CODE" => {
626 std::option::Option::Some(Self::GOOGLE_PLUS_AUTHORIZATION_CODE)
627 }
628 "FIRST_PARTY_OAUTH" => std::option::Option::Some(Self::FIRST_PARTY_OAUTH),
629 _ => std::option::Option::None,
630 }
631 }
632 }
633
634 impl std::convert::From<i32> for AuthorizationType {
635 fn from(value: i32) -> Self {
636 Self::new(value)
637 }
638 }
639
640 impl std::default::Default for AuthorizationType {
641 fn default() -> Self {
642 Self::new(0)
643 }
644 }
645
646 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
648 pub struct DataRefreshType(i32);
649
650 impl DataRefreshType {
651 pub const DATA_REFRESH_TYPE_UNSPECIFIED: DataRefreshType = DataRefreshType::new(0);
653
654 pub const SLIDING_WINDOW: DataRefreshType = DataRefreshType::new(1);
658
659 pub const CUSTOM_SLIDING_WINDOW: DataRefreshType = DataRefreshType::new(2);
663
664 pub(crate) const fn new(value: i32) -> Self {
666 Self(value)
667 }
668
669 pub fn value(&self) -> i32 {
671 self.0
672 }
673
674 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
676 match self.0 {
677 0 => std::borrow::Cow::Borrowed("DATA_REFRESH_TYPE_UNSPECIFIED"),
678 1 => std::borrow::Cow::Borrowed("SLIDING_WINDOW"),
679 2 => std::borrow::Cow::Borrowed("CUSTOM_SLIDING_WINDOW"),
680 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
681 }
682 }
683
684 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
686 match name {
687 "DATA_REFRESH_TYPE_UNSPECIFIED" => {
688 std::option::Option::Some(Self::DATA_REFRESH_TYPE_UNSPECIFIED)
689 }
690 "SLIDING_WINDOW" => std::option::Option::Some(Self::SLIDING_WINDOW),
691 "CUSTOM_SLIDING_WINDOW" => std::option::Option::Some(Self::CUSTOM_SLIDING_WINDOW),
692 _ => std::option::Option::None,
693 }
694 }
695 }
696
697 impl std::convert::From<i32> for DataRefreshType {
698 fn from(value: i32) -> Self {
699 Self::new(value)
700 }
701 }
702
703 impl std::default::Default for DataRefreshType {
704 fn default() -> Self {
705 Self::new(0)
706 }
707 }
708}
709
710#[serde_with::serde_as]
712#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
713#[serde(default, rename_all = "camelCase")]
714#[non_exhaustive]
715pub struct GetDataSourceRequest {
716 #[serde(skip_serializing_if = "std::string::String::is_empty")]
720 pub name: std::string::String,
721
722 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
723 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
724}
725
726impl GetDataSourceRequest {
727 pub fn new() -> Self {
728 std::default::Default::default()
729 }
730
731 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
733 self.name = v.into();
734 self
735 }
736}
737
738impl wkt::message::Message for GetDataSourceRequest {
739 fn typename() -> &'static str {
740 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest"
741 }
742}
743
744#[serde_with::serde_as]
746#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
747#[serde(default, rename_all = "camelCase")]
748#[non_exhaustive]
749pub struct ListDataSourcesRequest {
750 #[serde(skip_serializing_if = "std::string::String::is_empty")]
754 pub parent: std::string::String,
755
756 #[serde(skip_serializing_if = "std::string::String::is_empty")]
762 pub page_token: std::string::String,
763
764 pub page_size: i32,
766
767 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
768 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
769}
770
771impl ListDataSourcesRequest {
772 pub fn new() -> Self {
773 std::default::Default::default()
774 }
775
776 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
778 self.parent = v.into();
779 self
780 }
781
782 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
784 self.page_token = v.into();
785 self
786 }
787
788 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
790 self.page_size = v.into();
791 self
792 }
793}
794
795impl wkt::message::Message for ListDataSourcesRequest {
796 fn typename() -> &'static str {
797 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest"
798 }
799}
800
801#[serde_with::serde_as]
803#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
804#[serde(default, rename_all = "camelCase")]
805#[non_exhaustive]
806pub struct ListDataSourcesResponse {
807 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
809 pub data_sources: std::vec::Vec<crate::model::DataSource>,
810
811 #[serde(skip_serializing_if = "std::string::String::is_empty")]
816 pub next_page_token: std::string::String,
817
818 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
819 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
820}
821
822impl ListDataSourcesResponse {
823 pub fn new() -> Self {
824 std::default::Default::default()
825 }
826
827 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
829 self.next_page_token = v.into();
830 self
831 }
832
833 pub fn set_data_sources<T, V>(mut self, v: T) -> Self
835 where
836 T: std::iter::IntoIterator<Item = V>,
837 V: std::convert::Into<crate::model::DataSource>,
838 {
839 use std::iter::Iterator;
840 self.data_sources = v.into_iter().map(|i| i.into()).collect();
841 self
842 }
843}
844
845impl wkt::message::Message for ListDataSourcesResponse {
846 fn typename() -> &'static str {
847 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse"
848 }
849}
850
851#[doc(hidden)]
852impl gax::paginator::internal::PageableResponse for ListDataSourcesResponse {
853 type PageItem = crate::model::DataSource;
854
855 fn items(self) -> std::vec::Vec<Self::PageItem> {
856 self.data_sources
857 }
858
859 fn next_page_token(&self) -> std::string::String {
860 use std::clone::Clone;
861 self.next_page_token.clone()
862 }
863}
864
865#[serde_with::serde_as]
877#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
878#[serde(default, rename_all = "camelCase")]
879#[non_exhaustive]
880pub struct CreateTransferConfigRequest {
881 #[serde(skip_serializing_if = "std::string::String::is_empty")]
887 pub parent: std::string::String,
888
889 #[serde(skip_serializing_if = "std::option::Option::is_none")]
891 pub transfer_config: std::option::Option<crate::model::TransferConfig>,
892
893 #[serde(skip_serializing_if = "std::string::String::is_empty")]
910 pub authorization_code: std::string::String,
911
912 #[serde(skip_serializing_if = "std::string::String::is_empty")]
926 pub version_info: std::string::String,
927
928 #[serde(skip_serializing_if = "std::string::String::is_empty")]
938 pub service_account_name: std::string::String,
939
940 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
941 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
942}
943
944impl CreateTransferConfigRequest {
945 pub fn new() -> Self {
946 std::default::Default::default()
947 }
948
949 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
951 self.parent = v.into();
952 self
953 }
954
955 pub fn set_transfer_config<
957 T: std::convert::Into<std::option::Option<crate::model::TransferConfig>>,
958 >(
959 mut self,
960 v: T,
961 ) -> Self {
962 self.transfer_config = v.into();
963 self
964 }
965
966 pub fn set_authorization_code<T: std::convert::Into<std::string::String>>(
968 mut self,
969 v: T,
970 ) -> Self {
971 self.authorization_code = v.into();
972 self
973 }
974
975 pub fn set_version_info<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
977 self.version_info = v.into();
978 self
979 }
980
981 pub fn set_service_account_name<T: std::convert::Into<std::string::String>>(
983 mut self,
984 v: T,
985 ) -> Self {
986 self.service_account_name = v.into();
987 self
988 }
989}
990
991impl wkt::message::Message for CreateTransferConfigRequest {
992 fn typename() -> &'static str {
993 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest"
994 }
995}
996
997#[serde_with::serde_as]
1005#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1006#[serde(default, rename_all = "camelCase")]
1007#[non_exhaustive]
1008pub struct UpdateTransferConfigRequest {
1009 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1011 pub transfer_config: std::option::Option<crate::model::TransferConfig>,
1012
1013 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1030 pub authorization_code: std::string::String,
1031
1032 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1034 pub update_mask: std::option::Option<wkt::FieldMask>,
1035
1036 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1050 pub version_info: std::string::String,
1051
1052 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1062 pub service_account_name: std::string::String,
1063
1064 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1065 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1066}
1067
1068impl UpdateTransferConfigRequest {
1069 pub fn new() -> Self {
1070 std::default::Default::default()
1071 }
1072
1073 pub fn set_transfer_config<
1075 T: std::convert::Into<std::option::Option<crate::model::TransferConfig>>,
1076 >(
1077 mut self,
1078 v: T,
1079 ) -> Self {
1080 self.transfer_config = v.into();
1081 self
1082 }
1083
1084 pub fn set_authorization_code<T: std::convert::Into<std::string::String>>(
1086 mut self,
1087 v: T,
1088 ) -> Self {
1089 self.authorization_code = v.into();
1090 self
1091 }
1092
1093 pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
1095 mut self,
1096 v: T,
1097 ) -> Self {
1098 self.update_mask = v.into();
1099 self
1100 }
1101
1102 pub fn set_version_info<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1104 self.version_info = v.into();
1105 self
1106 }
1107
1108 pub fn set_service_account_name<T: std::convert::Into<std::string::String>>(
1110 mut self,
1111 v: T,
1112 ) -> Self {
1113 self.service_account_name = v.into();
1114 self
1115 }
1116}
1117
1118impl wkt::message::Message for UpdateTransferConfigRequest {
1119 fn typename() -> &'static str {
1120 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest"
1121 }
1122}
1123
1124#[serde_with::serde_as]
1126#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1127#[serde(default, rename_all = "camelCase")]
1128#[non_exhaustive]
1129pub struct GetTransferConfigRequest {
1130 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1134 pub name: std::string::String,
1135
1136 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1137 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1138}
1139
1140impl GetTransferConfigRequest {
1141 pub fn new() -> Self {
1142 std::default::Default::default()
1143 }
1144
1145 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1147 self.name = v.into();
1148 self
1149 }
1150}
1151
1152impl wkt::message::Message for GetTransferConfigRequest {
1153 fn typename() -> &'static str {
1154 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest"
1155 }
1156}
1157
1158#[serde_with::serde_as]
1161#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1162#[serde(default, rename_all = "camelCase")]
1163#[non_exhaustive]
1164pub struct DeleteTransferConfigRequest {
1165 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1169 pub name: std::string::String,
1170
1171 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1172 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1173}
1174
1175impl DeleteTransferConfigRequest {
1176 pub fn new() -> Self {
1177 std::default::Default::default()
1178 }
1179
1180 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1182 self.name = v.into();
1183 self
1184 }
1185}
1186
1187impl wkt::message::Message for DeleteTransferConfigRequest {
1188 fn typename() -> &'static str {
1189 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest"
1190 }
1191}
1192
1193#[serde_with::serde_as]
1195#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1196#[serde(default, rename_all = "camelCase")]
1197#[non_exhaustive]
1198pub struct GetTransferRunRequest {
1199 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1204 pub name: std::string::String,
1205
1206 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1207 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1208}
1209
1210impl GetTransferRunRequest {
1211 pub fn new() -> Self {
1212 std::default::Default::default()
1213 }
1214
1215 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1217 self.name = v.into();
1218 self
1219 }
1220}
1221
1222impl wkt::message::Message for GetTransferRunRequest {
1223 fn typename() -> &'static str {
1224 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest"
1225 }
1226}
1227
1228#[serde_with::serde_as]
1230#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1231#[serde(default, rename_all = "camelCase")]
1232#[non_exhaustive]
1233pub struct DeleteTransferRunRequest {
1234 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1239 pub name: std::string::String,
1240
1241 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1242 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1243}
1244
1245impl DeleteTransferRunRequest {
1246 pub fn new() -> Self {
1247 std::default::Default::default()
1248 }
1249
1250 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1252 self.name = v.into();
1253 self
1254 }
1255}
1256
1257impl wkt::message::Message for DeleteTransferRunRequest {
1258 fn typename() -> &'static str {
1259 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest"
1260 }
1261}
1262
1263#[serde_with::serde_as]
1265#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1266#[serde(default, rename_all = "camelCase")]
1267#[non_exhaustive]
1268pub struct ListTransferConfigsRequest {
1269 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1273 pub parent: std::string::String,
1274
1275 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1277 pub data_source_ids: std::vec::Vec<std::string::String>,
1278
1279 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1285 pub page_token: std::string::String,
1286
1287 pub page_size: i32,
1289
1290 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1291 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1292}
1293
1294impl ListTransferConfigsRequest {
1295 pub fn new() -> Self {
1296 std::default::Default::default()
1297 }
1298
1299 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1301 self.parent = v.into();
1302 self
1303 }
1304
1305 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1307 self.page_token = v.into();
1308 self
1309 }
1310
1311 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1313 self.page_size = v.into();
1314 self
1315 }
1316
1317 pub fn set_data_source_ids<T, V>(mut self, v: T) -> Self
1319 where
1320 T: std::iter::IntoIterator<Item = V>,
1321 V: std::convert::Into<std::string::String>,
1322 {
1323 use std::iter::Iterator;
1324 self.data_source_ids = v.into_iter().map(|i| i.into()).collect();
1325 self
1326 }
1327}
1328
1329impl wkt::message::Message for ListTransferConfigsRequest {
1330 fn typename() -> &'static str {
1331 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest"
1332 }
1333}
1334
1335#[serde_with::serde_as]
1337#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1338#[serde(default, rename_all = "camelCase")]
1339#[non_exhaustive]
1340pub struct ListTransferConfigsResponse {
1341 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1343 pub transfer_configs: std::vec::Vec<crate::model::TransferConfig>,
1344
1345 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1350 pub next_page_token: std::string::String,
1351
1352 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1353 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1354}
1355
1356impl ListTransferConfigsResponse {
1357 pub fn new() -> Self {
1358 std::default::Default::default()
1359 }
1360
1361 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1363 self.next_page_token = v.into();
1364 self
1365 }
1366
1367 pub fn set_transfer_configs<T, V>(mut self, v: T) -> Self
1369 where
1370 T: std::iter::IntoIterator<Item = V>,
1371 V: std::convert::Into<crate::model::TransferConfig>,
1372 {
1373 use std::iter::Iterator;
1374 self.transfer_configs = v.into_iter().map(|i| i.into()).collect();
1375 self
1376 }
1377}
1378
1379impl wkt::message::Message for ListTransferConfigsResponse {
1380 fn typename() -> &'static str {
1381 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse"
1382 }
1383}
1384
1385#[doc(hidden)]
1386impl gax::paginator::internal::PageableResponse for ListTransferConfigsResponse {
1387 type PageItem = crate::model::TransferConfig;
1388
1389 fn items(self) -> std::vec::Vec<Self::PageItem> {
1390 self.transfer_configs
1391 }
1392
1393 fn next_page_token(&self) -> std::string::String {
1394 use std::clone::Clone;
1395 self.next_page_token.clone()
1396 }
1397}
1398
1399#[serde_with::serde_as]
1401#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1402#[serde(default, rename_all = "camelCase")]
1403#[non_exhaustive]
1404pub struct ListTransferRunsRequest {
1405 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1410 pub parent: std::string::String,
1411
1412 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1414 pub states: std::vec::Vec<crate::model::TransferState>,
1415
1416 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1422 pub page_token: std::string::String,
1423
1424 pub page_size: i32,
1426
1427 pub run_attempt: crate::model::list_transfer_runs_request::RunAttempt,
1429
1430 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1431 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1432}
1433
1434impl ListTransferRunsRequest {
1435 pub fn new() -> Self {
1436 std::default::Default::default()
1437 }
1438
1439 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1441 self.parent = v.into();
1442 self
1443 }
1444
1445 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1447 self.page_token = v.into();
1448 self
1449 }
1450
1451 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1453 self.page_size = v.into();
1454 self
1455 }
1456
1457 pub fn set_run_attempt<
1459 T: std::convert::Into<crate::model::list_transfer_runs_request::RunAttempt>,
1460 >(
1461 mut self,
1462 v: T,
1463 ) -> Self {
1464 self.run_attempt = v.into();
1465 self
1466 }
1467
1468 pub fn set_states<T, V>(mut self, v: T) -> Self
1470 where
1471 T: std::iter::IntoIterator<Item = V>,
1472 V: std::convert::Into<crate::model::TransferState>,
1473 {
1474 use std::iter::Iterator;
1475 self.states = v.into_iter().map(|i| i.into()).collect();
1476 self
1477 }
1478}
1479
1480impl wkt::message::Message for ListTransferRunsRequest {
1481 fn typename() -> &'static str {
1482 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest"
1483 }
1484}
1485
1486pub mod list_transfer_runs_request {
1488 #[allow(unused_imports)]
1489 use super::*;
1490
1491 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1493 pub struct RunAttempt(i32);
1494
1495 impl RunAttempt {
1496 pub const RUN_ATTEMPT_UNSPECIFIED: RunAttempt = RunAttempt::new(0);
1498
1499 pub const LATEST: RunAttempt = RunAttempt::new(1);
1501
1502 pub(crate) const fn new(value: i32) -> Self {
1504 Self(value)
1505 }
1506
1507 pub fn value(&self) -> i32 {
1509 self.0
1510 }
1511
1512 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
1514 match self.0 {
1515 0 => std::borrow::Cow::Borrowed("RUN_ATTEMPT_UNSPECIFIED"),
1516 1 => std::borrow::Cow::Borrowed("LATEST"),
1517 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
1518 }
1519 }
1520
1521 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
1523 match name {
1524 "RUN_ATTEMPT_UNSPECIFIED" => {
1525 std::option::Option::Some(Self::RUN_ATTEMPT_UNSPECIFIED)
1526 }
1527 "LATEST" => std::option::Option::Some(Self::LATEST),
1528 _ => std::option::Option::None,
1529 }
1530 }
1531 }
1532
1533 impl std::convert::From<i32> for RunAttempt {
1534 fn from(value: i32) -> Self {
1535 Self::new(value)
1536 }
1537 }
1538
1539 impl std::default::Default for RunAttempt {
1540 fn default() -> Self {
1541 Self::new(0)
1542 }
1543 }
1544}
1545
1546#[serde_with::serde_as]
1548#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1549#[serde(default, rename_all = "camelCase")]
1550#[non_exhaustive]
1551pub struct ListTransferRunsResponse {
1552 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1554 pub transfer_runs: std::vec::Vec<crate::model::TransferRun>,
1555
1556 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1561 pub next_page_token: std::string::String,
1562
1563 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1564 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1565}
1566
1567impl ListTransferRunsResponse {
1568 pub fn new() -> Self {
1569 std::default::Default::default()
1570 }
1571
1572 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1574 self.next_page_token = v.into();
1575 self
1576 }
1577
1578 pub fn set_transfer_runs<T, V>(mut self, v: T) -> Self
1580 where
1581 T: std::iter::IntoIterator<Item = V>,
1582 V: std::convert::Into<crate::model::TransferRun>,
1583 {
1584 use std::iter::Iterator;
1585 self.transfer_runs = v.into_iter().map(|i| i.into()).collect();
1586 self
1587 }
1588}
1589
1590impl wkt::message::Message for ListTransferRunsResponse {
1591 fn typename() -> &'static str {
1592 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse"
1593 }
1594}
1595
1596#[doc(hidden)]
1597impl gax::paginator::internal::PageableResponse for ListTransferRunsResponse {
1598 type PageItem = crate::model::TransferRun;
1599
1600 fn items(self) -> std::vec::Vec<Self::PageItem> {
1601 self.transfer_runs
1602 }
1603
1604 fn next_page_token(&self) -> std::string::String {
1605 use std::clone::Clone;
1606 self.next_page_token.clone()
1607 }
1608}
1609
1610#[serde_with::serde_as]
1612#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1613#[serde(default, rename_all = "camelCase")]
1614#[non_exhaustive]
1615pub struct ListTransferLogsRequest {
1616 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1620 pub parent: std::string::String,
1621
1622 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1628 pub page_token: std::string::String,
1629
1630 pub page_size: i32,
1632
1633 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1636 pub message_types: std::vec::Vec<crate::model::transfer_message::MessageSeverity>,
1637
1638 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1639 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1640}
1641
1642impl ListTransferLogsRequest {
1643 pub fn new() -> Self {
1644 std::default::Default::default()
1645 }
1646
1647 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1649 self.parent = v.into();
1650 self
1651 }
1652
1653 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1655 self.page_token = v.into();
1656 self
1657 }
1658
1659 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1661 self.page_size = v.into();
1662 self
1663 }
1664
1665 pub fn set_message_types<T, V>(mut self, v: T) -> Self
1667 where
1668 T: std::iter::IntoIterator<Item = V>,
1669 V: std::convert::Into<crate::model::transfer_message::MessageSeverity>,
1670 {
1671 use std::iter::Iterator;
1672 self.message_types = v.into_iter().map(|i| i.into()).collect();
1673 self
1674 }
1675}
1676
1677impl wkt::message::Message for ListTransferLogsRequest {
1678 fn typename() -> &'static str {
1679 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest"
1680 }
1681}
1682
1683#[serde_with::serde_as]
1685#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1686#[serde(default, rename_all = "camelCase")]
1687#[non_exhaustive]
1688pub struct ListTransferLogsResponse {
1689 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1691 pub transfer_messages: std::vec::Vec<crate::model::TransferMessage>,
1692
1693 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1698 pub next_page_token: std::string::String,
1699
1700 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1701 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1702}
1703
1704impl ListTransferLogsResponse {
1705 pub fn new() -> Self {
1706 std::default::Default::default()
1707 }
1708
1709 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1711 self.next_page_token = v.into();
1712 self
1713 }
1714
1715 pub fn set_transfer_messages<T, V>(mut self, v: T) -> Self
1717 where
1718 T: std::iter::IntoIterator<Item = V>,
1719 V: std::convert::Into<crate::model::TransferMessage>,
1720 {
1721 use std::iter::Iterator;
1722 self.transfer_messages = v.into_iter().map(|i| i.into()).collect();
1723 self
1724 }
1725}
1726
1727impl wkt::message::Message for ListTransferLogsResponse {
1728 fn typename() -> &'static str {
1729 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse"
1730 }
1731}
1732
1733#[doc(hidden)]
1734impl gax::paginator::internal::PageableResponse for ListTransferLogsResponse {
1735 type PageItem = crate::model::TransferMessage;
1736
1737 fn items(self) -> std::vec::Vec<Self::PageItem> {
1738 self.transfer_messages
1739 }
1740
1741 fn next_page_token(&self) -> std::string::String {
1742 use std::clone::Clone;
1743 self.next_page_token.clone()
1744 }
1745}
1746
1747#[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 CheckValidCredsRequest {
1758 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1762 pub name: std::string::String,
1763
1764 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1765 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1766}
1767
1768impl CheckValidCredsRequest {
1769 pub fn new() -> Self {
1770 std::default::Default::default()
1771 }
1772
1773 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1775 self.name = v.into();
1776 self
1777 }
1778}
1779
1780impl wkt::message::Message for CheckValidCredsRequest {
1781 fn typename() -> &'static str {
1782 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest"
1783 }
1784}
1785
1786#[serde_with::serde_as]
1788#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1789#[serde(default, rename_all = "camelCase")]
1790#[non_exhaustive]
1791pub struct CheckValidCredsResponse {
1792 pub has_valid_creds: bool,
1794
1795 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1796 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1797}
1798
1799impl CheckValidCredsResponse {
1800 pub fn new() -> Self {
1801 std::default::Default::default()
1802 }
1803
1804 pub fn set_has_valid_creds<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1806 self.has_valid_creds = v.into();
1807 self
1808 }
1809}
1810
1811impl wkt::message::Message for CheckValidCredsResponse {
1812 fn typename() -> &'static str {
1813 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse"
1814 }
1815}
1816
1817#[serde_with::serde_as]
1819#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1820#[serde(default, rename_all = "camelCase")]
1821#[non_exhaustive]
1822pub struct ScheduleTransferRunsRequest {
1823 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1827 pub parent: std::string::String,
1828
1829 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1832 pub start_time: std::option::Option<wkt::Timestamp>,
1833
1834 #[serde(skip_serializing_if = "std::option::Option::is_none")]
1837 pub end_time: std::option::Option<wkt::Timestamp>,
1838
1839 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1840 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1841}
1842
1843impl ScheduleTransferRunsRequest {
1844 pub fn new() -> Self {
1845 std::default::Default::default()
1846 }
1847
1848 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1850 self.parent = v.into();
1851 self
1852 }
1853
1854 pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1856 mut self,
1857 v: T,
1858 ) -> Self {
1859 self.start_time = v.into();
1860 self
1861 }
1862
1863 pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1865 mut self,
1866 v: T,
1867 ) -> Self {
1868 self.end_time = v.into();
1869 self
1870 }
1871}
1872
1873impl wkt::message::Message for ScheduleTransferRunsRequest {
1874 fn typename() -> &'static str {
1875 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest"
1876 }
1877}
1878
1879#[serde_with::serde_as]
1881#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1882#[serde(default, rename_all = "camelCase")]
1883#[non_exhaustive]
1884pub struct ScheduleTransferRunsResponse {
1885 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1887 pub runs: std::vec::Vec<crate::model::TransferRun>,
1888
1889 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1890 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1891}
1892
1893impl ScheduleTransferRunsResponse {
1894 pub fn new() -> Self {
1895 std::default::Default::default()
1896 }
1897
1898 pub fn set_runs<T, V>(mut self, v: T) -> Self
1900 where
1901 T: std::iter::IntoIterator<Item = V>,
1902 V: std::convert::Into<crate::model::TransferRun>,
1903 {
1904 use std::iter::Iterator;
1905 self.runs = v.into_iter().map(|i| i.into()).collect();
1906 self
1907 }
1908}
1909
1910impl wkt::message::Message for ScheduleTransferRunsResponse {
1911 fn typename() -> &'static str {
1912 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse"
1913 }
1914}
1915
1916#[serde_with::serde_as]
1918#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1919#[serde(default, rename_all = "camelCase")]
1920#[non_exhaustive]
1921pub struct StartManualTransferRunsRequest {
1922 #[serde(skip_serializing_if = "std::string::String::is_empty")]
1926 pub parent: std::string::String,
1927
1928 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
1931 pub time: std::option::Option<crate::model::start_manual_transfer_runs_request::Time>,
1932
1933 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
1934 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1935}
1936
1937impl StartManualTransferRunsRequest {
1938 pub fn new() -> Self {
1939 std::default::Default::default()
1940 }
1941
1942 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1944 self.parent = v.into();
1945 self
1946 }
1947
1948 pub fn set_time<
1953 T: std::convert::Into<
1954 std::option::Option<crate::model::start_manual_transfer_runs_request::Time>,
1955 >,
1956 >(
1957 mut self,
1958 v: T,
1959 ) -> Self {
1960 self.time = v.into();
1961 self
1962 }
1963
1964 pub fn requested_time_range(
1968 &self,
1969 ) -> std::option::Option<
1970 &std::boxed::Box<crate::model::start_manual_transfer_runs_request::TimeRange>,
1971 > {
1972 #[allow(unreachable_patterns)]
1973 self.time.as_ref().and_then(|v| match v {
1974 crate::model::start_manual_transfer_runs_request::Time::RequestedTimeRange(v) => {
1975 std::option::Option::Some(v)
1976 }
1977 _ => std::option::Option::None,
1978 })
1979 }
1980
1981 pub fn requested_run_time(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
1985 #[allow(unreachable_patterns)]
1986 self.time.as_ref().and_then(|v| match v {
1987 crate::model::start_manual_transfer_runs_request::Time::RequestedRunTime(v) => {
1988 std::option::Option::Some(v)
1989 }
1990 _ => std::option::Option::None,
1991 })
1992 }
1993
1994 pub fn set_requested_time_range<
2000 T: std::convert::Into<
2001 std::boxed::Box<crate::model::start_manual_transfer_runs_request::TimeRange>,
2002 >,
2003 >(
2004 mut self,
2005 v: T,
2006 ) -> Self {
2007 self.time = std::option::Option::Some(
2008 crate::model::start_manual_transfer_runs_request::Time::RequestedTimeRange(v.into()),
2009 );
2010 self
2011 }
2012
2013 pub fn set_requested_run_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
2019 mut self,
2020 v: T,
2021 ) -> Self {
2022 self.time = std::option::Option::Some(
2023 crate::model::start_manual_transfer_runs_request::Time::RequestedRunTime(v.into()),
2024 );
2025 self
2026 }
2027}
2028
2029impl wkt::message::Message for StartManualTransferRunsRequest {
2030 fn typename() -> &'static str {
2031 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest"
2032 }
2033}
2034
2035pub mod start_manual_transfer_runs_request {
2037 #[allow(unused_imports)]
2038 use super::*;
2039
2040 #[serde_with::serde_as]
2043 #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2044 #[serde(default, rename_all = "camelCase")]
2045 #[non_exhaustive]
2046 pub struct TimeRange {
2047 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2052 pub start_time: std::option::Option<wkt::Timestamp>,
2053
2054 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2059 pub end_time: std::option::Option<wkt::Timestamp>,
2060
2061 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2062 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2063 }
2064
2065 impl TimeRange {
2066 pub fn new() -> Self {
2067 std::default::Default::default()
2068 }
2069
2070 pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2072 mut self,
2073 v: T,
2074 ) -> Self {
2075 self.start_time = v.into();
2076 self
2077 }
2078
2079 pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2081 mut self,
2082 v: T,
2083 ) -> Self {
2084 self.end_time = v.into();
2085 self
2086 }
2087 }
2088
2089 impl wkt::message::Message for TimeRange {
2090 fn typename() -> &'static str {
2091 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange"
2092 }
2093 }
2094
2095 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
2098 #[serde(rename_all = "camelCase")]
2099 #[non_exhaustive]
2100 pub enum Time {
2101 RequestedTimeRange(
2106 std::boxed::Box<crate::model::start_manual_transfer_runs_request::TimeRange>,
2107 ),
2108 RequestedRunTime(std::boxed::Box<wkt::Timestamp>),
2113 }
2114}
2115
2116#[serde_with::serde_as]
2118#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2119#[serde(default, rename_all = "camelCase")]
2120#[non_exhaustive]
2121pub struct StartManualTransferRunsResponse {
2122 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2124 pub runs: std::vec::Vec<crate::model::TransferRun>,
2125
2126 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2127 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2128}
2129
2130impl StartManualTransferRunsResponse {
2131 pub fn new() -> Self {
2132 std::default::Default::default()
2133 }
2134
2135 pub fn set_runs<T, V>(mut self, v: T) -> Self
2137 where
2138 T: std::iter::IntoIterator<Item = V>,
2139 V: std::convert::Into<crate::model::TransferRun>,
2140 {
2141 use std::iter::Iterator;
2142 self.runs = v.into_iter().map(|i| i.into()).collect();
2143 self
2144 }
2145}
2146
2147impl wkt::message::Message for StartManualTransferRunsResponse {
2148 fn typename() -> &'static str {
2149 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse"
2150 }
2151}
2152
2153#[serde_with::serde_as]
2156#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2157#[serde(default, rename_all = "camelCase")]
2158#[non_exhaustive]
2159pub struct EnrollDataSourcesRequest {
2160 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2163 pub name: std::string::String,
2164
2165 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2168 pub data_source_ids: std::vec::Vec<std::string::String>,
2169
2170 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2171 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2172}
2173
2174impl EnrollDataSourcesRequest {
2175 pub fn new() -> Self {
2176 std::default::Default::default()
2177 }
2178
2179 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2181 self.name = v.into();
2182 self
2183 }
2184
2185 pub fn set_data_source_ids<T, V>(mut self, v: T) -> Self
2187 where
2188 T: std::iter::IntoIterator<Item = V>,
2189 V: std::convert::Into<std::string::String>,
2190 {
2191 use std::iter::Iterator;
2192 self.data_source_ids = v.into_iter().map(|i| i.into()).collect();
2193 self
2194 }
2195}
2196
2197impl wkt::message::Message for EnrollDataSourcesRequest {
2198 fn typename() -> &'static str {
2199 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest"
2200 }
2201}
2202
2203#[serde_with::serde_as]
2206#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2207#[serde(default, rename_all = "camelCase")]
2208#[non_exhaustive]
2209pub struct UnenrollDataSourcesRequest {
2210 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2213 pub name: std::string::String,
2214
2215 #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2218 pub data_source_ids: std::vec::Vec<std::string::String>,
2219
2220 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2221 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2222}
2223
2224impl UnenrollDataSourcesRequest {
2225 pub fn new() -> Self {
2226 std::default::Default::default()
2227 }
2228
2229 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2231 self.name = v.into();
2232 self
2233 }
2234
2235 pub fn set_data_source_ids<T, V>(mut self, v: T) -> Self
2237 where
2238 T: std::iter::IntoIterator<Item = V>,
2239 V: std::convert::Into<std::string::String>,
2240 {
2241 use std::iter::Iterator;
2242 self.data_source_ids = v.into_iter().map(|i| i.into()).collect();
2243 self
2244 }
2245}
2246
2247impl wkt::message::Message for UnenrollDataSourcesRequest {
2248 fn typename() -> &'static str {
2249 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.UnenrollDataSourcesRequest"
2250 }
2251}
2252
2253#[serde_with::serde_as]
2256#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2257#[serde(default, rename_all = "camelCase")]
2258#[non_exhaustive]
2259pub struct EmailPreferences {
2260 pub enable_failure_email: bool,
2262
2263 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2264 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2265}
2266
2267impl EmailPreferences {
2268 pub fn new() -> Self {
2269 std::default::Default::default()
2270 }
2271
2272 pub fn set_enable_failure_email<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2274 self.enable_failure_email = v.into();
2275 self
2276 }
2277}
2278
2279impl wkt::message::Message for EmailPreferences {
2280 fn typename() -> &'static str {
2281 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.EmailPreferences"
2282 }
2283}
2284
2285#[serde_with::serde_as]
2287#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2288#[serde(default, rename_all = "camelCase")]
2289#[non_exhaustive]
2290pub struct ScheduleOptions {
2291 pub disable_auto_scheduling: bool,
2296
2297 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2303 pub start_time: std::option::Option<wkt::Timestamp>,
2304
2305 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2310 pub end_time: std::option::Option<wkt::Timestamp>,
2311
2312 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2313 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2314}
2315
2316impl ScheduleOptions {
2317 pub fn new() -> Self {
2318 std::default::Default::default()
2319 }
2320
2321 pub fn set_disable_auto_scheduling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2323 self.disable_auto_scheduling = v.into();
2324 self
2325 }
2326
2327 pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2329 mut self,
2330 v: T,
2331 ) -> Self {
2332 self.start_time = v.into();
2333 self
2334 }
2335
2336 pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2338 mut self,
2339 v: T,
2340 ) -> Self {
2341 self.end_time = v.into();
2342 self
2343 }
2344}
2345
2346impl wkt::message::Message for ScheduleOptions {
2347 fn typename() -> &'static str {
2348 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ScheduleOptions"
2349 }
2350}
2351
2352#[serde_with::serde_as]
2357#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2358#[serde(default, rename_all = "camelCase")]
2359#[non_exhaustive]
2360pub struct ScheduleOptionsV2 {
2361 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
2363 pub schedule: std::option::Option<crate::model::schedule_options_v_2::Schedule>,
2364
2365 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2366 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2367}
2368
2369impl ScheduleOptionsV2 {
2370 pub fn new() -> Self {
2371 std::default::Default::default()
2372 }
2373
2374 pub fn set_schedule<
2379 T: std::convert::Into<std::option::Option<crate::model::schedule_options_v_2::Schedule>>,
2380 >(
2381 mut self,
2382 v: T,
2383 ) -> Self {
2384 self.schedule = v.into();
2385 self
2386 }
2387
2388 pub fn time_based_schedule(
2392 &self,
2393 ) -> std::option::Option<&std::boxed::Box<crate::model::TimeBasedSchedule>> {
2394 #[allow(unreachable_patterns)]
2395 self.schedule.as_ref().and_then(|v| match v {
2396 crate::model::schedule_options_v_2::Schedule::TimeBasedSchedule(v) => {
2397 std::option::Option::Some(v)
2398 }
2399 _ => std::option::Option::None,
2400 })
2401 }
2402
2403 pub fn manual_schedule(
2407 &self,
2408 ) -> std::option::Option<&std::boxed::Box<crate::model::ManualSchedule>> {
2409 #[allow(unreachable_patterns)]
2410 self.schedule.as_ref().and_then(|v| match v {
2411 crate::model::schedule_options_v_2::Schedule::ManualSchedule(v) => {
2412 std::option::Option::Some(v)
2413 }
2414 _ => std::option::Option::None,
2415 })
2416 }
2417
2418 pub fn event_driven_schedule(
2422 &self,
2423 ) -> std::option::Option<&std::boxed::Box<crate::model::EventDrivenSchedule>> {
2424 #[allow(unreachable_patterns)]
2425 self.schedule.as_ref().and_then(|v| match v {
2426 crate::model::schedule_options_v_2::Schedule::EventDrivenSchedule(v) => {
2427 std::option::Option::Some(v)
2428 }
2429 _ => std::option::Option::None,
2430 })
2431 }
2432
2433 pub fn set_time_based_schedule<
2439 T: std::convert::Into<std::boxed::Box<crate::model::TimeBasedSchedule>>,
2440 >(
2441 mut self,
2442 v: T,
2443 ) -> Self {
2444 self.schedule = std::option::Option::Some(
2445 crate::model::schedule_options_v_2::Schedule::TimeBasedSchedule(v.into()),
2446 );
2447 self
2448 }
2449
2450 pub fn set_manual_schedule<
2456 T: std::convert::Into<std::boxed::Box<crate::model::ManualSchedule>>,
2457 >(
2458 mut self,
2459 v: T,
2460 ) -> Self {
2461 self.schedule = std::option::Option::Some(
2462 crate::model::schedule_options_v_2::Schedule::ManualSchedule(v.into()),
2463 );
2464 self
2465 }
2466
2467 pub fn set_event_driven_schedule<
2473 T: std::convert::Into<std::boxed::Box<crate::model::EventDrivenSchedule>>,
2474 >(
2475 mut self,
2476 v: T,
2477 ) -> Self {
2478 self.schedule = std::option::Option::Some(
2479 crate::model::schedule_options_v_2::Schedule::EventDrivenSchedule(v.into()),
2480 );
2481 self
2482 }
2483}
2484
2485impl wkt::message::Message for ScheduleOptionsV2 {
2486 fn typename() -> &'static str {
2487 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ScheduleOptionsV2"
2488 }
2489}
2490
2491pub mod schedule_options_v_2 {
2493 #[allow(unused_imports)]
2494 use super::*;
2495
2496 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
2498 #[serde(rename_all = "camelCase")]
2499 #[non_exhaustive]
2500 pub enum Schedule {
2501 TimeBasedSchedule(std::boxed::Box<crate::model::TimeBasedSchedule>),
2504 ManualSchedule(std::boxed::Box<crate::model::ManualSchedule>),
2509 EventDrivenSchedule(std::boxed::Box<crate::model::EventDrivenSchedule>),
2512 }
2513}
2514
2515#[serde_with::serde_as]
2518#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2519#[serde(default, rename_all = "camelCase")]
2520#[non_exhaustive]
2521pub struct TimeBasedSchedule {
2522 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2536 pub schedule: std::string::String,
2537
2538 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2543 pub start_time: std::option::Option<wkt::Timestamp>,
2544
2545 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2549 pub end_time: std::option::Option<wkt::Timestamp>,
2550
2551 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2552 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2553}
2554
2555impl TimeBasedSchedule {
2556 pub fn new() -> Self {
2557 std::default::Default::default()
2558 }
2559
2560 pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2562 self.schedule = v.into();
2563 self
2564 }
2565
2566 pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2568 mut self,
2569 v: T,
2570 ) -> Self {
2571 self.start_time = v.into();
2572 self
2573 }
2574
2575 pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2577 mut self,
2578 v: T,
2579 ) -> Self {
2580 self.end_time = v.into();
2581 self
2582 }
2583}
2584
2585impl wkt::message::Message for TimeBasedSchedule {
2586 fn typename() -> &'static str {
2587 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.TimeBasedSchedule"
2588 }
2589}
2590
2591#[serde_with::serde_as]
2593#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2594#[serde(default, rename_all = "camelCase")]
2595#[non_exhaustive]
2596pub struct ManualSchedule {
2597 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2598 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2599}
2600
2601impl ManualSchedule {
2602 pub fn new() -> Self {
2603 std::default::Default::default()
2604 }
2605}
2606
2607impl wkt::message::Message for ManualSchedule {
2608 fn typename() -> &'static str {
2609 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ManualSchedule"
2610 }
2611}
2612
2613#[serde_with::serde_as]
2615#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2616#[serde(default, rename_all = "camelCase")]
2617#[non_exhaustive]
2618pub struct EventDrivenSchedule {
2619 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2623 pub pubsub_subscription: std::string::String,
2624
2625 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2626 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2627}
2628
2629impl EventDrivenSchedule {
2630 pub fn new() -> Self {
2631 std::default::Default::default()
2632 }
2633
2634 pub fn set_pubsub_subscription<T: std::convert::Into<std::string::String>>(
2636 mut self,
2637 v: T,
2638 ) -> Self {
2639 self.pubsub_subscription = v.into();
2640 self
2641 }
2642}
2643
2644impl wkt::message::Message for EventDrivenSchedule {
2645 fn typename() -> &'static str {
2646 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.EventDrivenSchedule"
2647 }
2648}
2649
2650#[serde_with::serde_as]
2652#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2653#[serde(default, rename_all = "camelCase")]
2654#[non_exhaustive]
2655pub struct UserInfo {
2656 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2658 pub email: std::option::Option<std::string::String>,
2659
2660 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2661 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2662}
2663
2664impl UserInfo {
2665 pub fn new() -> Self {
2666 std::default::Default::default()
2667 }
2668
2669 pub fn set_email<T: std::convert::Into<std::option::Option<std::string::String>>>(
2671 mut self,
2672 v: T,
2673 ) -> Self {
2674 self.email = v.into();
2675 self
2676 }
2677}
2678
2679impl wkt::message::Message for UserInfo {
2680 fn typename() -> &'static str {
2681 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.UserInfo"
2682 }
2683}
2684
2685#[serde_with::serde_as]
2692#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2693#[serde(default, rename_all = "camelCase")]
2694#[non_exhaustive]
2695pub struct TransferConfig {
2696 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2704 pub name: std::string::String,
2705
2706 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2708 pub display_name: std::string::String,
2709
2710 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2714 pub data_source_id: std::string::String,
2715
2716 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2721 pub params: std::option::Option<wkt::Struct>,
2722
2723 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2737 pub schedule: std::string::String,
2738
2739 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2741 pub schedule_options: std::option::Option<crate::model::ScheduleOptions>,
2742
2743 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2747 pub schedule_options_v2: std::option::Option<crate::model::ScheduleOptionsV2>,
2748
2749 pub data_refresh_window_days: i32,
2756
2757 pub disabled: bool,
2760
2761 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2763 pub update_time: std::option::Option<wkt::Timestamp>,
2764
2765 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2767 pub next_run_time: std::option::Option<wkt::Timestamp>,
2768
2769 pub state: crate::model::TransferState,
2771
2772 #[serde_as(as = "serde_with::DisplayFromStr")]
2774 pub user_id: i64,
2775
2776 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2778 pub dataset_region: std::string::String,
2779
2780 #[serde(skip_serializing_if = "std::string::String::is_empty")]
2786 pub notification_pubsub_topic: std::string::String,
2787
2788 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2791 pub email_preferences: std::option::Option<crate::model::EmailPreferences>,
2792
2793 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2797 pub owner_info: std::option::Option<crate::model::UserInfo>,
2798
2799 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2805 pub encryption_configuration: std::option::Option<crate::model::EncryptionConfiguration>,
2806
2807 #[serde(skip_serializing_if = "std::option::Option::is_none")]
2810 pub error: std::option::Option<rpc::model::Status>,
2811
2812 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
2814 pub destination: std::option::Option<crate::model::transfer_config::Destination>,
2815
2816 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
2817 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2818}
2819
2820impl TransferConfig {
2821 pub fn new() -> Self {
2822 std::default::Default::default()
2823 }
2824
2825 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2827 self.name = v.into();
2828 self
2829 }
2830
2831 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2833 self.display_name = v.into();
2834 self
2835 }
2836
2837 pub fn set_data_source_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2839 self.data_source_id = v.into();
2840 self
2841 }
2842
2843 pub fn set_params<T: std::convert::Into<std::option::Option<wkt::Struct>>>(
2845 mut self,
2846 v: T,
2847 ) -> Self {
2848 self.params = v.into();
2849 self
2850 }
2851
2852 pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2854 self.schedule = v.into();
2855 self
2856 }
2857
2858 pub fn set_schedule_options<
2860 T: std::convert::Into<std::option::Option<crate::model::ScheduleOptions>>,
2861 >(
2862 mut self,
2863 v: T,
2864 ) -> Self {
2865 self.schedule_options = v.into();
2866 self
2867 }
2868
2869 pub fn set_schedule_options_v2<
2871 T: std::convert::Into<std::option::Option<crate::model::ScheduleOptionsV2>>,
2872 >(
2873 mut self,
2874 v: T,
2875 ) -> Self {
2876 self.schedule_options_v2 = v.into();
2877 self
2878 }
2879
2880 pub fn set_data_refresh_window_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2882 self.data_refresh_window_days = v.into();
2883 self
2884 }
2885
2886 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2888 self.disabled = v.into();
2889 self
2890 }
2891
2892 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2894 mut self,
2895 v: T,
2896 ) -> Self {
2897 self.update_time = v.into();
2898 self
2899 }
2900
2901 pub fn set_next_run_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2903 mut self,
2904 v: T,
2905 ) -> Self {
2906 self.next_run_time = v.into();
2907 self
2908 }
2909
2910 pub fn set_state<T: std::convert::Into<crate::model::TransferState>>(mut self, v: T) -> Self {
2912 self.state = v.into();
2913 self
2914 }
2915
2916 pub fn set_user_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2918 self.user_id = v.into();
2919 self
2920 }
2921
2922 pub fn set_dataset_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2924 self.dataset_region = v.into();
2925 self
2926 }
2927
2928 pub fn set_notification_pubsub_topic<T: std::convert::Into<std::string::String>>(
2930 mut self,
2931 v: T,
2932 ) -> Self {
2933 self.notification_pubsub_topic = v.into();
2934 self
2935 }
2936
2937 pub fn set_email_preferences<
2939 T: std::convert::Into<std::option::Option<crate::model::EmailPreferences>>,
2940 >(
2941 mut self,
2942 v: T,
2943 ) -> Self {
2944 self.email_preferences = v.into();
2945 self
2946 }
2947
2948 pub fn set_owner_info<T: std::convert::Into<std::option::Option<crate::model::UserInfo>>>(
2950 mut self,
2951 v: T,
2952 ) -> Self {
2953 self.owner_info = v.into();
2954 self
2955 }
2956
2957 pub fn set_encryption_configuration<
2959 T: std::convert::Into<std::option::Option<crate::model::EncryptionConfiguration>>,
2960 >(
2961 mut self,
2962 v: T,
2963 ) -> Self {
2964 self.encryption_configuration = v.into();
2965 self
2966 }
2967
2968 pub fn set_error<T: std::convert::Into<std::option::Option<rpc::model::Status>>>(
2970 mut self,
2971 v: T,
2972 ) -> Self {
2973 self.error = v.into();
2974 self
2975 }
2976
2977 pub fn set_destination<
2982 T: std::convert::Into<std::option::Option<crate::model::transfer_config::Destination>>,
2983 >(
2984 mut self,
2985 v: T,
2986 ) -> Self {
2987 self.destination = v.into();
2988 self
2989 }
2990
2991 pub fn destination_dataset_id(&self) -> std::option::Option<&std::string::String> {
2995 #[allow(unreachable_patterns)]
2996 self.destination.as_ref().and_then(|v| match v {
2997 crate::model::transfer_config::Destination::DestinationDatasetId(v) => {
2998 std::option::Option::Some(v)
2999 }
3000 _ => std::option::Option::None,
3001 })
3002 }
3003
3004 pub fn set_destination_dataset_id<T: std::convert::Into<std::string::String>>(
3010 mut self,
3011 v: T,
3012 ) -> Self {
3013 self.destination = std::option::Option::Some(
3014 crate::model::transfer_config::Destination::DestinationDatasetId(v.into()),
3015 );
3016 self
3017 }
3018}
3019
3020impl wkt::message::Message for TransferConfig {
3021 fn typename() -> &'static str {
3022 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.TransferConfig"
3023 }
3024}
3025
3026pub mod transfer_config {
3028 #[allow(unused_imports)]
3029 use super::*;
3030
3031 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3033 #[serde(rename_all = "camelCase")]
3034 #[non_exhaustive]
3035 pub enum Destination {
3036 DestinationDatasetId(std::string::String),
3038 }
3039}
3040
3041#[serde_with::serde_as]
3043#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3044#[serde(default, rename_all = "camelCase")]
3045#[non_exhaustive]
3046pub struct EncryptionConfiguration {
3047 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3049 pub kms_key_name: std::option::Option<wkt::StringValue>,
3050
3051 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3052 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3053}
3054
3055impl EncryptionConfiguration {
3056 pub fn new() -> Self {
3057 std::default::Default::default()
3058 }
3059
3060 pub fn set_kms_key_name<T: std::convert::Into<std::option::Option<wkt::StringValue>>>(
3062 mut self,
3063 v: T,
3064 ) -> Self {
3065 self.kms_key_name = v.into();
3066 self
3067 }
3068}
3069
3070impl wkt::message::Message for EncryptionConfiguration {
3071 fn typename() -> &'static str {
3072 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.EncryptionConfiguration"
3073 }
3074}
3075
3076#[serde_with::serde_as]
3078#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3079#[serde(default, rename_all = "camelCase")]
3080#[non_exhaustive]
3081pub struct TransferRun {
3082 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3087 pub name: std::string::String,
3088
3089 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3091 pub schedule_time: std::option::Option<wkt::Timestamp>,
3092
3093 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3096 pub run_time: std::option::Option<wkt::Timestamp>,
3097
3098 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3100 pub error_status: std::option::Option<rpc::model::Status>,
3101
3102 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3105 pub start_time: std::option::Option<wkt::Timestamp>,
3106
3107 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3110 pub end_time: std::option::Option<wkt::Timestamp>,
3111
3112 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3114 pub update_time: std::option::Option<wkt::Timestamp>,
3115
3116 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3122 pub params: std::option::Option<wkt::Struct>,
3123
3124 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3126 pub data_source_id: std::string::String,
3127
3128 pub state: crate::model::TransferState,
3130
3131 #[serde_as(as = "serde_with::DisplayFromStr")]
3133 pub user_id: i64,
3134
3135 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3141 pub schedule: std::string::String,
3142
3143 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3149 pub notification_pubsub_topic: std::string::String,
3150
3151 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3155 pub email_preferences: std::option::Option<crate::model::EmailPreferences>,
3156
3157 #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
3159 pub destination: std::option::Option<crate::model::transfer_run::Destination>,
3160
3161 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3162 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3163}
3164
3165impl TransferRun {
3166 pub fn new() -> Self {
3167 std::default::Default::default()
3168 }
3169
3170 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3172 self.name = v.into();
3173 self
3174 }
3175
3176 pub fn set_schedule_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3178 mut self,
3179 v: T,
3180 ) -> Self {
3181 self.schedule_time = v.into();
3182 self
3183 }
3184
3185 pub fn set_run_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3187 mut self,
3188 v: T,
3189 ) -> Self {
3190 self.run_time = v.into();
3191 self
3192 }
3193
3194 pub fn set_error_status<T: std::convert::Into<std::option::Option<rpc::model::Status>>>(
3196 mut self,
3197 v: T,
3198 ) -> Self {
3199 self.error_status = v.into();
3200 self
3201 }
3202
3203 pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3205 mut self,
3206 v: T,
3207 ) -> Self {
3208 self.start_time = v.into();
3209 self
3210 }
3211
3212 pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3214 mut self,
3215 v: T,
3216 ) -> Self {
3217 self.end_time = v.into();
3218 self
3219 }
3220
3221 pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3223 mut self,
3224 v: T,
3225 ) -> Self {
3226 self.update_time = v.into();
3227 self
3228 }
3229
3230 pub fn set_params<T: std::convert::Into<std::option::Option<wkt::Struct>>>(
3232 mut self,
3233 v: T,
3234 ) -> Self {
3235 self.params = v.into();
3236 self
3237 }
3238
3239 pub fn set_data_source_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3241 self.data_source_id = v.into();
3242 self
3243 }
3244
3245 pub fn set_state<T: std::convert::Into<crate::model::TransferState>>(mut self, v: T) -> Self {
3247 self.state = v.into();
3248 self
3249 }
3250
3251 pub fn set_user_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3253 self.user_id = v.into();
3254 self
3255 }
3256
3257 pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3259 self.schedule = v.into();
3260 self
3261 }
3262
3263 pub fn set_notification_pubsub_topic<T: std::convert::Into<std::string::String>>(
3265 mut self,
3266 v: T,
3267 ) -> Self {
3268 self.notification_pubsub_topic = v.into();
3269 self
3270 }
3271
3272 pub fn set_email_preferences<
3274 T: std::convert::Into<std::option::Option<crate::model::EmailPreferences>>,
3275 >(
3276 mut self,
3277 v: T,
3278 ) -> Self {
3279 self.email_preferences = v.into();
3280 self
3281 }
3282
3283 pub fn set_destination<
3288 T: std::convert::Into<std::option::Option<crate::model::transfer_run::Destination>>,
3289 >(
3290 mut self,
3291 v: T,
3292 ) -> Self {
3293 self.destination = v.into();
3294 self
3295 }
3296
3297 pub fn destination_dataset_id(&self) -> std::option::Option<&std::string::String> {
3301 #[allow(unreachable_patterns)]
3302 self.destination.as_ref().and_then(|v| match v {
3303 crate::model::transfer_run::Destination::DestinationDatasetId(v) => {
3304 std::option::Option::Some(v)
3305 }
3306 _ => std::option::Option::None,
3307 })
3308 }
3309
3310 pub fn set_destination_dataset_id<T: std::convert::Into<std::string::String>>(
3316 mut self,
3317 v: T,
3318 ) -> Self {
3319 self.destination = std::option::Option::Some(
3320 crate::model::transfer_run::Destination::DestinationDatasetId(v.into()),
3321 );
3322 self
3323 }
3324}
3325
3326impl wkt::message::Message for TransferRun {
3327 fn typename() -> &'static str {
3328 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.TransferRun"
3329 }
3330}
3331
3332pub mod transfer_run {
3334 #[allow(unused_imports)]
3335 use super::*;
3336
3337 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3339 #[serde(rename_all = "camelCase")]
3340 #[non_exhaustive]
3341 pub enum Destination {
3342 DestinationDatasetId(std::string::String),
3344 }
3345}
3346
3347#[serde_with::serde_as]
3349#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3350#[serde(default, rename_all = "camelCase")]
3351#[non_exhaustive]
3352pub struct TransferMessage {
3353 #[serde(skip_serializing_if = "std::option::Option::is_none")]
3355 pub message_time: std::option::Option<wkt::Timestamp>,
3356
3357 pub severity: crate::model::transfer_message::MessageSeverity,
3359
3360 #[serde(skip_serializing_if = "std::string::String::is_empty")]
3362 pub message_text: std::string::String,
3363
3364 #[serde(flatten, skip_serializing_if = "serde_json::Map::is_empty")]
3365 _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3366}
3367
3368impl TransferMessage {
3369 pub fn new() -> Self {
3370 std::default::Default::default()
3371 }
3372
3373 pub fn set_message_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3375 mut self,
3376 v: T,
3377 ) -> Self {
3378 self.message_time = v.into();
3379 self
3380 }
3381
3382 pub fn set_severity<T: std::convert::Into<crate::model::transfer_message::MessageSeverity>>(
3384 mut self,
3385 v: T,
3386 ) -> Self {
3387 self.severity = v.into();
3388 self
3389 }
3390
3391 pub fn set_message_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3393 self.message_text = v.into();
3394 self
3395 }
3396}
3397
3398impl wkt::message::Message for TransferMessage {
3399 fn typename() -> &'static str {
3400 "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.TransferMessage"
3401 }
3402}
3403
3404pub mod transfer_message {
3406 #[allow(unused_imports)]
3407 use super::*;
3408
3409 #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3411 pub struct MessageSeverity(i32);
3412
3413 impl MessageSeverity {
3414 pub const MESSAGE_SEVERITY_UNSPECIFIED: MessageSeverity = MessageSeverity::new(0);
3416
3417 pub const INFO: MessageSeverity = MessageSeverity::new(1);
3419
3420 pub const WARNING: MessageSeverity = MessageSeverity::new(2);
3422
3423 pub const ERROR: MessageSeverity = MessageSeverity::new(3);
3425
3426 pub(crate) const fn new(value: i32) -> Self {
3428 Self(value)
3429 }
3430
3431 pub fn value(&self) -> i32 {
3433 self.0
3434 }
3435
3436 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
3438 match self.0 {
3439 0 => std::borrow::Cow::Borrowed("MESSAGE_SEVERITY_UNSPECIFIED"),
3440 1 => std::borrow::Cow::Borrowed("INFO"),
3441 2 => std::borrow::Cow::Borrowed("WARNING"),
3442 3 => std::borrow::Cow::Borrowed("ERROR"),
3443 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
3444 }
3445 }
3446
3447 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
3449 match name {
3450 "MESSAGE_SEVERITY_UNSPECIFIED" => {
3451 std::option::Option::Some(Self::MESSAGE_SEVERITY_UNSPECIFIED)
3452 }
3453 "INFO" => std::option::Option::Some(Self::INFO),
3454 "WARNING" => std::option::Option::Some(Self::WARNING),
3455 "ERROR" => std::option::Option::Some(Self::ERROR),
3456 _ => std::option::Option::None,
3457 }
3458 }
3459 }
3460
3461 impl std::convert::From<i32> for MessageSeverity {
3462 fn from(value: i32) -> Self {
3463 Self::new(value)
3464 }
3465 }
3466
3467 impl std::default::Default for MessageSeverity {
3468 fn default() -> Self {
3469 Self::new(0)
3470 }
3471 }
3472}
3473
3474#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3476pub struct TransferType(i32);
3477
3478impl TransferType {
3479 pub const TRANSFER_TYPE_UNSPECIFIED: TransferType = TransferType::new(0);
3481
3482 pub const BATCH: TransferType = TransferType::new(1);
3484
3485 pub const STREAMING: TransferType = TransferType::new(2);
3488
3489 pub(crate) const fn new(value: i32) -> Self {
3491 Self(value)
3492 }
3493
3494 pub fn value(&self) -> i32 {
3496 self.0
3497 }
3498
3499 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
3501 match self.0 {
3502 0 => std::borrow::Cow::Borrowed("TRANSFER_TYPE_UNSPECIFIED"),
3503 1 => std::borrow::Cow::Borrowed("BATCH"),
3504 2 => std::borrow::Cow::Borrowed("STREAMING"),
3505 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
3506 }
3507 }
3508
3509 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
3511 match name {
3512 "TRANSFER_TYPE_UNSPECIFIED" => {
3513 std::option::Option::Some(Self::TRANSFER_TYPE_UNSPECIFIED)
3514 }
3515 "BATCH" => std::option::Option::Some(Self::BATCH),
3516 "STREAMING" => std::option::Option::Some(Self::STREAMING),
3517 _ => std::option::Option::None,
3518 }
3519 }
3520}
3521
3522impl std::convert::From<i32> for TransferType {
3523 fn from(value: i32) -> Self {
3524 Self::new(value)
3525 }
3526}
3527
3528impl std::default::Default for TransferType {
3529 fn default() -> Self {
3530 Self::new(0)
3531 }
3532}
3533
3534#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3536pub struct TransferState(i32);
3537
3538impl TransferState {
3539 pub const TRANSFER_STATE_UNSPECIFIED: TransferState = TransferState::new(0);
3541
3542 pub const PENDING: TransferState = TransferState::new(2);
3545
3546 pub const RUNNING: TransferState = TransferState::new(3);
3548
3549 pub const SUCCEEDED: TransferState = TransferState::new(4);
3551
3552 pub const FAILED: TransferState = TransferState::new(5);
3554
3555 pub const CANCELLED: TransferState = TransferState::new(6);
3557
3558 pub(crate) const fn new(value: i32) -> Self {
3560 Self(value)
3561 }
3562
3563 pub fn value(&self) -> i32 {
3565 self.0
3566 }
3567
3568 pub fn as_str_name(&self) -> std::borrow::Cow<'static, str> {
3570 match self.0 {
3571 0 => std::borrow::Cow::Borrowed("TRANSFER_STATE_UNSPECIFIED"),
3572 2 => std::borrow::Cow::Borrowed("PENDING"),
3573 3 => std::borrow::Cow::Borrowed("RUNNING"),
3574 4 => std::borrow::Cow::Borrowed("SUCCEEDED"),
3575 5 => std::borrow::Cow::Borrowed("FAILED"),
3576 6 => std::borrow::Cow::Borrowed("CANCELLED"),
3577 _ => std::borrow::Cow::Owned(std::format!("UNKNOWN-VALUE:{}", self.0)),
3578 }
3579 }
3580
3581 pub fn from_str_name(name: &str) -> std::option::Option<Self> {
3583 match name {
3584 "TRANSFER_STATE_UNSPECIFIED" => {
3585 std::option::Option::Some(Self::TRANSFER_STATE_UNSPECIFIED)
3586 }
3587 "PENDING" => std::option::Option::Some(Self::PENDING),
3588 "RUNNING" => std::option::Option::Some(Self::RUNNING),
3589 "SUCCEEDED" => std::option::Option::Some(Self::SUCCEEDED),
3590 "FAILED" => std::option::Option::Some(Self::FAILED),
3591 "CANCELLED" => std::option::Option::Some(Self::CANCELLED),
3592 _ => std::option::Option::None,
3593 }
3594 }
3595}
3596
3597impl std::convert::From<i32> for TransferState {
3598 fn from(value: i32) -> Self {
3599 Self::new(value)
3600 }
3601}
3602
3603impl std::default::Default for TransferState {
3604 fn default() -> Self {
3605 Self::new(0)
3606 }
3607}