google_cloud_bigquery_datatransfer_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate 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/// A parameter used to define custom fields in a data source definition.
36#[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    /// Parameter identifier.
42    #[serde(skip_serializing_if = "std::string::String::is_empty")]
43    pub param_id: std::string::String,
44
45    /// Parameter display name in the user interface.
46    #[serde(skip_serializing_if = "std::string::String::is_empty")]
47    pub display_name: std::string::String,
48
49    /// Parameter description.
50    #[serde(skip_serializing_if = "std::string::String::is_empty")]
51    pub description: std::string::String,
52
53    /// Parameter type.
54    #[serde(rename = "type")]
55    pub r#type: crate::model::data_source_parameter::Type,
56
57    /// Is parameter required.
58    pub required: bool,
59
60    /// Deprecated. This field has no effect.
61    pub repeated: bool,
62
63    /// Regular expression which can be used for parameter validation.
64    #[serde(skip_serializing_if = "std::string::String::is_empty")]
65    pub validation_regex: std::string::String,
66
67    /// All possible values for the parameter.
68    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
69    pub allowed_values: std::vec::Vec<std::string::String>,
70
71    /// For integer and double values specifies minimum allowed value.
72    #[serde(skip_serializing_if = "std::option::Option::is_none")]
73    pub min_value: std::option::Option<wkt::DoubleValue>,
74
75    /// For integer and double values specifies maximum allowed value.
76    #[serde(skip_serializing_if = "std::option::Option::is_none")]
77    pub max_value: std::option::Option<wkt::DoubleValue>,
78
79    /// Deprecated. This field has no effect.
80    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
81    pub fields: std::vec::Vec<crate::model::DataSourceParameter>,
82
83    /// Description of the requirements for this field, in case the user input does
84    /// not fulfill the regex pattern or min/max values.
85    #[serde(skip_serializing_if = "std::string::String::is_empty")]
86    pub validation_description: std::string::String,
87
88    /// URL to a help document to further explain the naming requirements.
89    #[serde(skip_serializing_if = "std::string::String::is_empty")]
90    pub validation_help_url: std::string::String,
91
92    /// Cannot be changed after initial creation.
93    pub immutable: bool,
94
95    /// Deprecated. This field has no effect.
96    pub recurse: bool,
97
98    /// If true, it should not be used in new transfers, and it should not be
99    /// visible to users.
100    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    /// Sets the value of [param_id][crate::model::DataSourceParameter::param_id].
112    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    /// Sets the value of [display_name][crate::model::DataSourceParameter::display_name].
118    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    /// Sets the value of [description][crate::model::DataSourceParameter::description].
124    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    /// Sets the value of [r#type][crate::model::DataSourceParameter::type].
130    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    /// Sets the value of [required][crate::model::DataSourceParameter::required].
139    pub fn set_required<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
140        self.required = v.into();
141        self
142    }
143
144    /// Sets the value of [repeated][crate::model::DataSourceParameter::repeated].
145    pub fn set_repeated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
146        self.repeated = v.into();
147        self
148    }
149
150    /// Sets the value of [validation_regex][crate::model::DataSourceParameter::validation_regex].
151    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    /// Sets the value of [min_value][crate::model::DataSourceParameter::min_value].
160    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    /// Sets the value of [max_value][crate::model::DataSourceParameter::max_value].
169    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    /// Sets the value of [validation_description][crate::model::DataSourceParameter::validation_description].
178    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    /// Sets the value of [validation_help_url][crate::model::DataSourceParameter::validation_help_url].
187    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    /// Sets the value of [immutable][crate::model::DataSourceParameter::immutable].
196    pub fn set_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
197        self.immutable = v.into();
198        self
199    }
200
201    /// Sets the value of [recurse][crate::model::DataSourceParameter::recurse].
202    pub fn set_recurse<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
203        self.recurse = v.into();
204        self
205    }
206
207    /// Sets the value of [deprecated][crate::model::DataSourceParameter::deprecated].
208    pub fn set_deprecated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
209        self.deprecated = v.into();
210        self
211    }
212
213    /// Sets the value of [allowed_values][crate::model::DataSourceParameter::allowed_values].
214    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    /// Sets the value of [fields][crate::model::DataSourceParameter::fields].
225    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
242/// Defines additional types related to [DataSourceParameter].
243pub mod data_source_parameter {
244    #[allow(unused_imports)]
245    use super::*;
246
247    /// Parameter type.
248    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
249    pub struct Type(i32);
250
251    impl Type {
252        /// Type unspecified.
253        pub const TYPE_UNSPECIFIED: Type = Type::new(0);
254
255        /// String parameter.
256        pub const STRING: Type = Type::new(1);
257
258        /// Integer parameter (64-bits).
259        /// Will be serialized to json as string.
260        pub const INTEGER: Type = Type::new(2);
261
262        /// Double precision floating point parameter.
263        pub const DOUBLE: Type = Type::new(3);
264
265        /// Boolean parameter.
266        pub const BOOLEAN: Type = Type::new(4);
267
268        /// Deprecated. This field has no effect.
269        pub const RECORD: Type = Type::new(5);
270
271        /// Page ID for a Google+ Page.
272        pub const PLUS_PAGE: Type = Type::new(6);
273
274        /// List of strings parameter.
275        pub const LIST: Type = Type::new(7);
276
277        /// Creates a new Type instance.
278        pub(crate) const fn new(value: i32) -> Self {
279            Self(value)
280        }
281
282        /// Gets the enum value.
283        pub fn value(&self) -> i32 {
284            self.0
285        }
286
287        /// Gets the enum value as a string.
288        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        /// Creates an enum value from the value name.
303        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/// Defines the properties and custom parameters for a data source.
332#[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    /// Output only. Data source resource name.
338    #[serde(skip_serializing_if = "std::string::String::is_empty")]
339    pub name: std::string::String,
340
341    /// Data source id.
342    #[serde(skip_serializing_if = "std::string::String::is_empty")]
343    pub data_source_id: std::string::String,
344
345    /// User friendly data source name.
346    #[serde(skip_serializing_if = "std::string::String::is_empty")]
347    pub display_name: std::string::String,
348
349    /// User friendly data source description string.
350    #[serde(skip_serializing_if = "std::string::String::is_empty")]
351    pub description: std::string::String,
352
353    /// Data source client id which should be used to receive refresh token.
354    #[serde(skip_serializing_if = "std::string::String::is_empty")]
355    pub client_id: std::string::String,
356
357    /// Api auth scopes for which refresh token needs to be obtained. These are
358    /// scopes needed by a data source to prepare data and ingest them into
359    /// BigQuery, e.g., <https://www.googleapis.com/auth/bigquery>
360    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
361    pub scopes: std::vec::Vec<std::string::String>,
362
363    /// Deprecated. This field has no effect.
364    pub transfer_type: crate::model::TransferType,
365
366    /// Deprecated. This field has no effect.
367    pub supports_multiple_transfers: bool,
368
369    /// The number of seconds to wait for an update from the data source
370    /// before the Data Transfer Service marks the transfer as FAILED.
371    pub update_deadline_seconds: i32,
372
373    /// Default data transfer schedule.
374    /// Examples of valid schedules include:
375    /// `1st,3rd monday of month 15:30`,
376    /// `every wed,fri of jan,jun 13:15`, and
377    /// `first sunday of quarter 00:00`.
378    #[serde(skip_serializing_if = "std::string::String::is_empty")]
379    pub default_schedule: std::string::String,
380
381    /// Specifies whether the data source supports a user defined schedule, or
382    /// operates on the default schedule.
383    /// When set to `true`, user can override default schedule.
384    pub supports_custom_schedule: bool,
385
386    /// Data source parameters.
387    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
388    pub parameters: std::vec::Vec<crate::model::DataSourceParameter>,
389
390    /// Url for the help document for this data source.
391    #[serde(skip_serializing_if = "std::string::String::is_empty")]
392    pub help_url: std::string::String,
393
394    /// Indicates the type of authorization.
395    pub authorization_type: crate::model::data_source::AuthorizationType,
396
397    /// Specifies whether the data source supports automatic data refresh for the
398    /// past few days, and how it's supported.
399    /// For some data sources, data might not be complete until a few days later,
400    /// so it's useful to refresh data automatically.
401    pub data_refresh_type: crate::model::data_source::DataRefreshType,
402
403    /// Default data refresh window on days.
404    /// Only meaningful when `data_refresh_type` = `SLIDING_WINDOW`.
405    pub default_data_refresh_window_days: i32,
406
407    /// Disables backfilling and manual run scheduling
408    /// for the data source.
409    pub manual_runs_disabled: bool,
410
411    /// The minimum interval for scheduler to schedule runs.
412    #[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    /// Sets the value of [name][crate::model::DataSource::name].
425    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    /// Sets the value of [data_source_id][crate::model::DataSource::data_source_id].
431    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    /// Sets the value of [display_name][crate::model::DataSource::display_name].
437    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    /// Sets the value of [description][crate::model::DataSource::description].
443    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    /// Sets the value of [client_id][crate::model::DataSource::client_id].
449    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    /// Sets the value of [transfer_type][crate::model::DataSource::transfer_type].
455    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    /// Sets the value of [supports_multiple_transfers][crate::model::DataSource::supports_multiple_transfers].
464    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    /// Sets the value of [update_deadline_seconds][crate::model::DataSource::update_deadline_seconds].
470    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    /// Sets the value of [default_schedule][crate::model::DataSource::default_schedule].
476    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    /// Sets the value of [supports_custom_schedule][crate::model::DataSource::supports_custom_schedule].
485    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    /// Sets the value of [help_url][crate::model::DataSource::help_url].
491    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    /// Sets the value of [authorization_type][crate::model::DataSource::authorization_type].
497    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    /// Sets the value of [data_refresh_type][crate::model::DataSource::data_refresh_type].
508    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    /// Sets the value of [default_data_refresh_window_days][crate::model::DataSource::default_data_refresh_window_days].
519    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    /// Sets the value of [manual_runs_disabled][crate::model::DataSource::manual_runs_disabled].
528    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    /// Sets the value of [minimum_schedule_interval][crate::model::DataSource::minimum_schedule_interval].
534    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    /// Sets the value of [scopes][crate::model::DataSource::scopes].
545    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    /// Sets the value of [parameters][crate::model::DataSource::parameters].
556    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
573/// Defines additional types related to [DataSource].
574pub mod data_source {
575    #[allow(unused_imports)]
576    use super::*;
577
578    /// The type of authorization needed for this data source.
579    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
580    pub struct AuthorizationType(i32);
581
582    impl AuthorizationType {
583        /// Type unspecified.
584        pub const AUTHORIZATION_TYPE_UNSPECIFIED: AuthorizationType = AuthorizationType::new(0);
585
586        /// Use OAuth 2 authorization codes that can be exchanged
587        /// for a refresh token on the backend.
588        pub const AUTHORIZATION_CODE: AuthorizationType = AuthorizationType::new(1);
589
590        /// Return an authorization code for a given Google+ page that can then be
591        /// exchanged for a refresh token on the backend.
592        pub const GOOGLE_PLUS_AUTHORIZATION_CODE: AuthorizationType = AuthorizationType::new(2);
593
594        /// Use First Party OAuth.
595        pub const FIRST_PARTY_OAUTH: AuthorizationType = AuthorizationType::new(3);
596
597        /// Creates a new AuthorizationType instance.
598        pub(crate) const fn new(value: i32) -> Self {
599            Self(value)
600        }
601
602        /// Gets the enum value.
603        pub fn value(&self) -> i32 {
604            self.0
605        }
606
607        /// Gets the enum value as a string.
608        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        /// Creates an enum value from the value name.
619        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    /// Represents how the data source supports data auto refresh.
647    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
648    pub struct DataRefreshType(i32);
649
650    impl DataRefreshType {
651        /// The data source won't support data auto refresh, which is default value.
652        pub const DATA_REFRESH_TYPE_UNSPECIFIED: DataRefreshType = DataRefreshType::new(0);
653
654        /// The data source supports data auto refresh, and runs will be scheduled
655        /// for the past few days. Does not allow custom values to be set for each
656        /// transfer config.
657        pub const SLIDING_WINDOW: DataRefreshType = DataRefreshType::new(1);
658
659        /// The data source supports data auto refresh, and runs will be scheduled
660        /// for the past few days. Allows custom values to be set for each transfer
661        /// config.
662        pub const CUSTOM_SLIDING_WINDOW: DataRefreshType = DataRefreshType::new(2);
663
664        /// Creates a new DataRefreshType instance.
665        pub(crate) const fn new(value: i32) -> Self {
666            Self(value)
667        }
668
669        /// Gets the enum value.
670        pub fn value(&self) -> i32 {
671            self.0
672        }
673
674        /// Gets the enum value as a string.
675        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        /// Creates an enum value from the value name.
685        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/// A request to get data source info.
711#[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    /// Required. The field will contain name of the resource requested, for
717    /// example: `projects/{project_id}/dataSources/{data_source_id}` or
718    /// `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`
719    #[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    /// Sets the value of [name][crate::model::GetDataSourceRequest::name].
732    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/// Request to list supported data sources and their data transfer settings.
745#[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    /// Required. The BigQuery project id for which data sources should be
751    /// returned. Must be in the form: `projects/{project_id}` or
752    /// `projects/{project_id}/locations/{location_id}`
753    #[serde(skip_serializing_if = "std::string::String::is_empty")]
754    pub parent: std::string::String,
755
756    /// Pagination token, which can be used to request a specific page
757    /// of `ListDataSourcesRequest` list results. For multiple-page
758    /// results, `ListDataSourcesResponse` outputs
759    /// a `next_page` token, which can be used as the
760    /// `page_token` value to request the next page of list results.
761    #[serde(skip_serializing_if = "std::string::String::is_empty")]
762    pub page_token: std::string::String,
763
764    /// Page size. The default page size is the maximum value of 1000 results.
765    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    /// Sets the value of [parent][crate::model::ListDataSourcesRequest::parent].
777    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    /// Sets the value of [page_token][crate::model::ListDataSourcesRequest::page_token].
783    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    /// Sets the value of [page_size][crate::model::ListDataSourcesRequest::page_size].
789    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/// Returns list of supported data sources and their metadata.
802#[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    /// List of supported data sources and their transfer settings.
808    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
809    pub data_sources: std::vec::Vec<crate::model::DataSource>,
810
811    /// Output only. The next-pagination token. For multiple-page list results,
812    /// this token can be used as the
813    /// `ListDataSourcesRequest.page_token`
814    /// to request the next page of list results.
815    #[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    /// Sets the value of [next_page_token][crate::model::ListDataSourcesResponse::next_page_token].
828    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    /// Sets the value of [data_sources][crate::model::ListDataSourcesResponse::data_sources].
834    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/// A request to create a data transfer configuration. If new credentials are
866/// needed for this transfer configuration, authorization info must be provided.
867/// If authorization info is provided, the transfer configuration will be
868/// associated with the user id corresponding to the authorization info.
869/// Otherwise, the transfer configuration will be associated with the calling
870/// user.
871///
872/// When using a cross project service account for creating a transfer config,
873/// you must enable cross project service account usage. For more information,
874/// see [Disable attachment of service accounts to resources in other
875/// projects](https://cloud.google.com/resource-manager/docs/organization-policy/restricting-service-accounts#disable_cross_project_service_accounts).
876#[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    /// Required. The BigQuery project id where the transfer configuration should
882    /// be created. Must be in the format
883    /// projects/{project_id}/locations/{location_id} or projects/{project_id}. If
884    /// specified location and location of the destination bigquery dataset do not
885    /// match - the request will fail.
886    #[serde(skip_serializing_if = "std::string::String::is_empty")]
887    pub parent: std::string::String,
888
889    /// Required. Data transfer configuration to create.
890    #[serde(skip_serializing_if = "std::option::Option::is_none")]
891    pub transfer_config: std::option::Option<crate::model::TransferConfig>,
892
893    /// Deprecated: Authorization code was required when
894    /// `transferConfig.dataSourceId` is 'youtube_channel' but it is no longer used
895    /// in any data sources. Use `version_info` instead.
896    ///
897    /// Optional OAuth2 authorization code to use with this transfer configuration.
898    /// This is required only if `transferConfig.dataSourceId` is 'youtube_channel'
899    /// and new credentials are needed, as indicated by `CheckValidCreds`. In order
900    /// to obtain authorization_code, make a request to the following URL:
901    ///
902    /// * The \<var\>client_id\</var\> is the OAuth client_id of the data source as
903    ///   returned by ListDataSources method.
904    /// * \<var\>data_source_scopes\</var\> are the scopes returned by ListDataSources
905    ///   method.
906    ///
907    /// Note that this should not be set when `service_account_name` is used to
908    /// create the transfer config.
909    #[serde(skip_serializing_if = "std::string::String::is_empty")]
910    pub authorization_code: std::string::String,
911
912    /// Optional version info. This parameter replaces `authorization_code` which
913    /// is no longer used in any data sources. This is required only if
914    /// `transferConfig.dataSourceId` is 'youtube_channel' *or* new credentials
915    /// are needed, as indicated by `CheckValidCreds`. In order to obtain version
916    /// info, make a request to the following URL:
917    ///
918    /// * The \<var\>client_id\</var\> is the OAuth client_id of the data source as
919    ///   returned by ListDataSources method.
920    /// * \<var\>data_source_scopes\</var\> are the scopes returned by ListDataSources
921    ///   method.
922    ///
923    /// Note that this should not be set when `service_account_name` is used to
924    /// create the transfer config.
925    #[serde(skip_serializing_if = "std::string::String::is_empty")]
926    pub version_info: std::string::String,
927
928    /// Optional service account email. If this field is set, the transfer config
929    /// will be created with this service account's credentials. It requires that
930    /// the requesting user calling this API has permissions to act as this service
931    /// account.
932    ///
933    /// Note that not all data sources support service account credentials when
934    /// creating a transfer config. For the latest list of data sources, read about
935    /// [using service
936    /// accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-accounts).
937    #[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    /// Sets the value of [parent][crate::model::CreateTransferConfigRequest::parent].
950    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    /// Sets the value of [transfer_config][crate::model::CreateTransferConfigRequest::transfer_config].
956    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    /// Sets the value of [authorization_code][crate::model::CreateTransferConfigRequest::authorization_code].
967    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    /// Sets the value of [version_info][crate::model::CreateTransferConfigRequest::version_info].
976    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    /// Sets the value of [service_account_name][crate::model::CreateTransferConfigRequest::service_account_name].
982    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/// A request to update a transfer configuration. To update the user id of the
998/// transfer configuration, authorization info needs to be provided.
999///
1000/// When using a cross project service account for updating a transfer config,
1001/// you must enable cross project service account usage. For more information,
1002/// see [Disable attachment of service accounts to resources in other
1003/// projects](https://cloud.google.com/resource-manager/docs/organization-policy/restricting-service-accounts#disable_cross_project_service_accounts).
1004#[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    /// Required. Data transfer configuration to create.
1010    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1011    pub transfer_config: std::option::Option<crate::model::TransferConfig>,
1012
1013    /// Deprecated: Authorization code was required when
1014    /// `transferConfig.dataSourceId` is 'youtube_channel' but it is no longer used
1015    /// in any data sources. Use `version_info` instead.
1016    ///
1017    /// Optional OAuth2 authorization code to use with this transfer configuration.
1018    /// This is required only if `transferConfig.dataSourceId` is 'youtube_channel'
1019    /// and new credentials are needed, as indicated by `CheckValidCreds`. In order
1020    /// to obtain authorization_code, make a request to the following URL:
1021    ///
1022    /// * The \<var\>client_id\</var\> is the OAuth client_id of the data source as
1023    ///   returned by ListDataSources method.
1024    /// * \<var\>data_source_scopes\</var\> are the scopes returned by ListDataSources
1025    ///   method.
1026    ///
1027    /// Note that this should not be set when `service_account_name` is used to
1028    /// update the transfer config.
1029    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1030    pub authorization_code: std::string::String,
1031
1032    /// Required. Required list of fields to be updated in this request.
1033    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1034    pub update_mask: std::option::Option<wkt::FieldMask>,
1035
1036    /// Optional version info. This parameter replaces `authorization_code` which
1037    /// is no longer used in any data sources. This is required only if
1038    /// `transferConfig.dataSourceId` is 'youtube_channel' *or* new credentials
1039    /// are needed, as indicated by `CheckValidCreds`. In order to obtain version
1040    /// info, make a request to the following URL:
1041    ///
1042    /// * The \<var\>client_id\</var\> is the OAuth client_id of the data source as
1043    ///   returned by ListDataSources method.
1044    /// * \<var\>data_source_scopes\</var\> are the scopes returned by ListDataSources
1045    ///   method.
1046    ///
1047    /// Note that this should not be set when `service_account_name` is used to
1048    /// update the transfer config.
1049    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1050    pub version_info: std::string::String,
1051
1052    /// Optional service account email. If this field is set, the transfer config
1053    /// will be created with this service account's credentials. It requires that
1054    /// the requesting user calling this API has permissions to act as this service
1055    /// account.
1056    ///
1057    /// Note that not all data sources support service account credentials when
1058    /// creating a transfer config. For the latest list of data sources, read about
1059    /// [using service
1060    /// accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-accounts).
1061    #[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    /// Sets the value of [transfer_config][crate::model::UpdateTransferConfigRequest::transfer_config].
1074    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    /// Sets the value of [authorization_code][crate::model::UpdateTransferConfigRequest::authorization_code].
1085    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    /// Sets the value of [update_mask][crate::model::UpdateTransferConfigRequest::update_mask].
1094    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    /// Sets the value of [version_info][crate::model::UpdateTransferConfigRequest::version_info].
1103    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    /// Sets the value of [service_account_name][crate::model::UpdateTransferConfigRequest::service_account_name].
1109    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/// A request to get data transfer information.
1125#[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    /// Required. The field will contain name of the resource requested, for
1131    /// example: `projects/{project_id}/transferConfigs/{config_id}` or
1132    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
1133    #[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    /// Sets the value of [name][crate::model::GetTransferConfigRequest::name].
1146    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/// A request to delete data transfer information. All associated transfer runs
1159/// and log messages will be deleted as well.
1160#[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    /// Required. The field will contain name of the resource requested, for
1166    /// example: `projects/{project_id}/transferConfigs/{config_id}` or
1167    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
1168    #[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    /// Sets the value of [name][crate::model::DeleteTransferConfigRequest::name].
1181    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/// A request to get data transfer run information.
1194#[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    /// Required. The field will contain name of the resource requested, for
1200    /// example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`
1201    /// or
1202    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
1203    #[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    /// Sets the value of [name][crate::model::GetTransferRunRequest::name].
1216    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/// A request to delete data transfer run information.
1229#[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    /// Required. The field will contain name of the resource requested, for
1235    /// example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`
1236    /// or
1237    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
1238    #[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    /// Sets the value of [name][crate::model::DeleteTransferRunRequest::name].
1251    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/// A request to list data transfers configured for a BigQuery project.
1264#[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    /// Required. The BigQuery project id for which transfer configs
1270    /// should be returned: `projects/{project_id}` or
1271    /// `projects/{project_id}/locations/{location_id}`
1272    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1273    pub parent: std::string::String,
1274
1275    /// When specified, only configurations of requested data sources are returned.
1276    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1277    pub data_source_ids: std::vec::Vec<std::string::String>,
1278
1279    /// Pagination token, which can be used to request a specific page
1280    /// of `ListTransfersRequest` list results. For multiple-page
1281    /// results, `ListTransfersResponse` outputs
1282    /// a `next_page` token, which can be used as the
1283    /// `page_token` value to request the next page of list results.
1284    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1285    pub page_token: std::string::String,
1286
1287    /// Page size. The default page size is the maximum value of 1000 results.
1288    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    /// Sets the value of [parent][crate::model::ListTransferConfigsRequest::parent].
1300    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    /// Sets the value of [page_token][crate::model::ListTransferConfigsRequest::page_token].
1306    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    /// Sets the value of [page_size][crate::model::ListTransferConfigsRequest::page_size].
1312    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    /// Sets the value of [data_source_ids][crate::model::ListTransferConfigsRequest::data_source_ids].
1318    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/// The returned list of pipelines in the project.
1336#[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    /// Output only. The stored pipeline transfer configurations.
1342    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1343    pub transfer_configs: std::vec::Vec<crate::model::TransferConfig>,
1344
1345    /// Output only. The next-pagination token. For multiple-page list results,
1346    /// this token can be used as the
1347    /// `ListTransferConfigsRequest.page_token`
1348    /// to request the next page of list results.
1349    #[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    /// Sets the value of [next_page_token][crate::model::ListTransferConfigsResponse::next_page_token].
1362    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    /// Sets the value of [transfer_configs][crate::model::ListTransferConfigsResponse::transfer_configs].
1368    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/// A request to list data transfer runs.
1400#[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    /// Required. Name of transfer configuration for which transfer runs should be
1406    /// retrieved. Format of transfer configuration resource name is:
1407    /// `projects/{project_id}/transferConfigs/{config_id}` or
1408    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
1409    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1410    pub parent: std::string::String,
1411
1412    /// When specified, only transfer runs with requested states are returned.
1413    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1414    pub states: std::vec::Vec<crate::model::TransferState>,
1415
1416    /// Pagination token, which can be used to request a specific page
1417    /// of `ListTransferRunsRequest` list results. For multiple-page
1418    /// results, `ListTransferRunsResponse` outputs
1419    /// a `next_page` token, which can be used as the
1420    /// `page_token` value to request the next page of list results.
1421    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1422    pub page_token: std::string::String,
1423
1424    /// Page size. The default page size is the maximum value of 1000 results.
1425    pub page_size: i32,
1426
1427    /// Indicates how run attempts are to be pulled.
1428    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    /// Sets the value of [parent][crate::model::ListTransferRunsRequest::parent].
1440    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    /// Sets the value of [page_token][crate::model::ListTransferRunsRequest::page_token].
1446    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    /// Sets the value of [page_size][crate::model::ListTransferRunsRequest::page_size].
1452    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    /// Sets the value of [run_attempt][crate::model::ListTransferRunsRequest::run_attempt].
1458    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    /// Sets the value of [states][crate::model::ListTransferRunsRequest::states].
1469    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
1486/// Defines additional types related to [ListTransferRunsRequest].
1487pub mod list_transfer_runs_request {
1488    #[allow(unused_imports)]
1489    use super::*;
1490
1491    /// Represents which runs should be pulled.
1492    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1493    pub struct RunAttempt(i32);
1494
1495    impl RunAttempt {
1496        /// All runs should be returned.
1497        pub const RUN_ATTEMPT_UNSPECIFIED: RunAttempt = RunAttempt::new(0);
1498
1499        /// Only latest run per day should be returned.
1500        pub const LATEST: RunAttempt = RunAttempt::new(1);
1501
1502        /// Creates a new RunAttempt instance.
1503        pub(crate) const fn new(value: i32) -> Self {
1504            Self(value)
1505        }
1506
1507        /// Gets the enum value.
1508        pub fn value(&self) -> i32 {
1509            self.0
1510        }
1511
1512        /// Gets the enum value as a string.
1513        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        /// Creates an enum value from the value name.
1522        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/// The returned list of pipelines in the project.
1547#[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    /// Output only. The stored pipeline transfer runs.
1553    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1554    pub transfer_runs: std::vec::Vec<crate::model::TransferRun>,
1555
1556    /// Output only. The next-pagination token. For multiple-page list results,
1557    /// this token can be used as the
1558    /// `ListTransferRunsRequest.page_token`
1559    /// to request the next page of list results.
1560    #[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    /// Sets the value of [next_page_token][crate::model::ListTransferRunsResponse::next_page_token].
1573    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    /// Sets the value of [transfer_runs][crate::model::ListTransferRunsResponse::transfer_runs].
1579    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/// A request to get user facing log messages associated with data transfer run.
1611#[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    /// Required. Transfer run name in the form:
1617    /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
1618    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
1619    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1620    pub parent: std::string::String,
1621
1622    /// Pagination token, which can be used to request a specific page
1623    /// of `ListTransferLogsRequest` list results. For multiple-page
1624    /// results, `ListTransferLogsResponse` outputs
1625    /// a `next_page` token, which can be used as the
1626    /// `page_token` value to request the next page of list results.
1627    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1628    pub page_token: std::string::String,
1629
1630    /// Page size. The default page size is the maximum value of 1000 results.
1631    pub page_size: i32,
1632
1633    /// Message types to return. If not populated - INFO, WARNING and ERROR
1634    /// messages are returned.
1635    #[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    /// Sets the value of [parent][crate::model::ListTransferLogsRequest::parent].
1648    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    /// Sets the value of [page_token][crate::model::ListTransferLogsRequest::page_token].
1654    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    /// Sets the value of [page_size][crate::model::ListTransferLogsRequest::page_size].
1660    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    /// Sets the value of [message_types][crate::model::ListTransferLogsRequest::message_types].
1666    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/// The returned list transfer run messages.
1684#[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    /// Output only. The stored pipeline transfer messages.
1690    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1691    pub transfer_messages: std::vec::Vec<crate::model::TransferMessage>,
1692
1693    /// Output only. The next-pagination token. For multiple-page list results,
1694    /// this token can be used as the
1695    /// `GetTransferRunLogRequest.page_token`
1696    /// to request the next page of list results.
1697    #[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    /// Sets the value of [next_page_token][crate::model::ListTransferLogsResponse::next_page_token].
1710    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    /// Sets the value of [transfer_messages][crate::model::ListTransferLogsResponse::transfer_messages].
1716    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/// A request to determine whether the user has valid credentials. This method
1748/// is used to limit the number of OAuth popups in the user interface. The
1749/// user id is inferred from the API call context.
1750/// If the data source has the Google+ authorization type, this method
1751/// returns false, as it cannot be determined whether the credentials are
1752/// already valid merely based on the user id.
1753#[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    /// Required. The data source in the form:
1759    /// `projects/{project_id}/dataSources/{data_source_id}` or
1760    /// `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`.
1761    #[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    /// Sets the value of [name][crate::model::CheckValidCredsRequest::name].
1774    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/// A response indicating whether the credentials exist and are valid.
1787#[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    /// If set to `true`, the credentials exist and are valid.
1793    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    /// Sets the value of [has_valid_creds][crate::model::CheckValidCredsResponse::has_valid_creds].
1805    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/// A request to schedule transfer runs for a time range.
1818#[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    /// Required. Transfer configuration name in the form:
1824    /// `projects/{project_id}/transferConfigs/{config_id}` or
1825    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
1826    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1827    pub parent: std::string::String,
1828
1829    /// Required. Start time of the range of transfer runs. For example,
1830    /// `"2017-05-25T00:00:00+00:00"`.
1831    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1832    pub start_time: std::option::Option<wkt::Timestamp>,
1833
1834    /// Required. End time of the range of transfer runs. For example,
1835    /// `"2017-05-30T00:00:00+00:00"`.
1836    #[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    /// Sets the value of [parent][crate::model::ScheduleTransferRunsRequest::parent].
1849    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    /// Sets the value of [start_time][crate::model::ScheduleTransferRunsRequest::start_time].
1855    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    /// Sets the value of [end_time][crate::model::ScheduleTransferRunsRequest::end_time].
1864    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/// A response to schedule transfer runs for a time range.
1880#[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    /// The transfer runs that were scheduled.
1886    #[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    /// Sets the value of [runs][crate::model::ScheduleTransferRunsResponse::runs].
1899    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/// A request to start manual transfer runs.
1917#[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    /// Required. Transfer configuration name in the form:
1923    /// `projects/{project_id}/transferConfigs/{config_id}` or
1924    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
1925    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1926    pub parent: std::string::String,
1927
1928    /// The requested time specification - this can be a time range or a specific
1929    /// run_time.
1930    #[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    /// Sets the value of [parent][crate::model::StartManualTransferRunsRequest::parent].
1943    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    /// Sets the value of [time][crate::model::StartManualTransferRunsRequest::time].
1949    ///
1950    /// Note that all the setters affecting `time` are mutually
1951    /// exclusive.
1952    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    /// The value of [time][crate::model::StartManualTransferRunsRequest::time]
1965    /// if it holds a `RequestedTimeRange`, `None` if the field is not set or
1966    /// holds a different branch.
1967    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    /// The value of [time][crate::model::StartManualTransferRunsRequest::time]
1982    /// if it holds a `RequestedRunTime`, `None` if the field is not set or
1983    /// holds a different branch.
1984    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    /// Sets the value of [time][crate::model::StartManualTransferRunsRequest::time]
1995    /// to hold a `RequestedTimeRange`.
1996    ///
1997    /// Note that all the setters affecting `time` are
1998    /// mutually exclusive.
1999    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    /// Sets the value of [time][crate::model::StartManualTransferRunsRequest::time]
2014    /// to hold a `RequestedRunTime`.
2015    ///
2016    /// Note that all the setters affecting `time` are
2017    /// mutually exclusive.
2018    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
2035/// Defines additional types related to [StartManualTransferRunsRequest].
2036pub mod start_manual_transfer_runs_request {
2037    #[allow(unused_imports)]
2038    use super::*;
2039
2040    /// A specification for a time range, this will request transfer runs with
2041    /// run_time between start_time (inclusive) and end_time (exclusive).
2042    #[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        /// Start time of the range of transfer runs. For example,
2048        /// `"2017-05-25T00:00:00+00:00"`. The start_time must be strictly less than
2049        /// the end_time. Creates transfer runs where run_time is in the range
2050        /// between start_time (inclusive) and end_time (exclusive).
2051        #[serde(skip_serializing_if = "std::option::Option::is_none")]
2052        pub start_time: std::option::Option<wkt::Timestamp>,
2053
2054        /// End time of the range of transfer runs. For example,
2055        /// `"2017-05-30T00:00:00+00:00"`. The end_time must not be in the future.
2056        /// Creates transfer runs where run_time is in the range between start_time
2057        /// (inclusive) and end_time (exclusive).
2058        #[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        /// Sets the value of [start_time][crate::model::start_manual_transfer_runs_request::TimeRange::start_time].
2071        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        /// Sets the value of [end_time][crate::model::start_manual_transfer_runs_request::TimeRange::end_time].
2080        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    /// The requested time specification - this can be a time range or a specific
2096    /// run_time.
2097    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
2098    #[serde(rename_all = "camelCase")]
2099    #[non_exhaustive]
2100    pub enum Time {
2101        /// A time_range start and end timestamp for historical data files or reports
2102        /// that are scheduled to be transferred by the scheduled transfer run.
2103        /// requested_time_range must be a past time and cannot include future time
2104        /// values.
2105        RequestedTimeRange(
2106            std::boxed::Box<crate::model::start_manual_transfer_runs_request::TimeRange>,
2107        ),
2108        /// A run_time timestamp for historical data files or reports
2109        /// that are scheduled to be transferred by the scheduled transfer run.
2110        /// requested_run_time must be a past time and cannot include future time
2111        /// values.
2112        RequestedRunTime(std::boxed::Box<wkt::Timestamp>),
2113    }
2114}
2115
2116/// A response to start manual transfer runs.
2117#[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    /// The transfer runs that were created.
2123    #[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    /// Sets the value of [runs][crate::model::StartManualTransferRunsResponse::runs].
2136    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/// A request to enroll a set of data sources so they are visible in the
2154/// BigQuery UI's `Transfer` tab.
2155#[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    /// Required. The name of the project resource in the form:
2161    /// `projects/{project_id}`
2162    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2163    pub name: std::string::String,
2164
2165    /// Data sources that are enrolled. It is required to provide at least one
2166    /// data source id.
2167    #[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    /// Sets the value of [name][crate::model::EnrollDataSourcesRequest::name].
2180    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    /// Sets the value of [data_source_ids][crate::model::EnrollDataSourcesRequest::data_source_ids].
2186    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/// A request to unenroll a set of data sources so they are no longer visible in
2204/// the BigQuery UI's `Transfer` tab.
2205#[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    /// Required. The name of the project resource in the form:
2211    /// `projects/{project_id}`
2212    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2213    pub name: std::string::String,
2214
2215    /// Data sources that are unenrolled. It is required to provide at least one
2216    /// data source id.
2217    #[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    /// Sets the value of [name][crate::model::UnenrollDataSourcesRequest::name].
2230    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    /// Sets the value of [data_source_ids][crate::model::UnenrollDataSourcesRequest::data_source_ids].
2236    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/// Represents preferences for sending email notifications for transfer run
2254/// events.
2255#[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    /// If true, email notifications will be sent on transfer run failures.
2261    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    /// Sets the value of [enable_failure_email][crate::model::EmailPreferences::enable_failure_email].
2273    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/// Options customizing the data transfer schedule.
2286#[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    /// If true, automatic scheduling of data transfer runs for this configuration
2292    /// will be disabled. The runs can be started on ad-hoc basis using
2293    /// StartManualTransferRuns API. When automatic scheduling is disabled, the
2294    /// TransferConfig.schedule field will be ignored.
2295    pub disable_auto_scheduling: bool,
2296
2297    /// Specifies time to start scheduling transfer runs. The first run will be
2298    /// scheduled at or after the start time according to a recurrence pattern
2299    /// defined in the schedule string. The start time can be changed at any
2300    /// moment. The time when a data transfer can be triggered manually is not
2301    /// limited by this option.
2302    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2303    pub start_time: std::option::Option<wkt::Timestamp>,
2304
2305    /// Defines time to stop scheduling transfer runs. A transfer run cannot be
2306    /// scheduled at or after the end time. The end time can be changed at any
2307    /// moment. The time when a data transfer can be triggered manually is not
2308    /// limited by this option.
2309    #[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    /// Sets the value of [disable_auto_scheduling][crate::model::ScheduleOptions::disable_auto_scheduling].
2322    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    /// Sets the value of [start_time][crate::model::ScheduleOptions::start_time].
2328    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    /// Sets the value of [end_time][crate::model::ScheduleOptions::end_time].
2337    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/// V2 options customizing different types of data transfer schedule.
2353/// This field supports existing time-based and manual transfer schedule. Also
2354/// supports Event-Driven transfer schedule. ScheduleOptionsV2 cannot be used
2355/// together with ScheduleOptions/Schedule.
2356#[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    /// Data transfer schedules.
2362    #[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    /// Sets the value of [schedule][crate::model::ScheduleOptionsV2::schedule].
2375    ///
2376    /// Note that all the setters affecting `schedule` are mutually
2377    /// exclusive.
2378    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    /// The value of [schedule][crate::model::ScheduleOptionsV2::schedule]
2389    /// if it holds a `TimeBasedSchedule`, `None` if the field is not set or
2390    /// holds a different branch.
2391    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    /// The value of [schedule][crate::model::ScheduleOptionsV2::schedule]
2404    /// if it holds a `ManualSchedule`, `None` if the field is not set or
2405    /// holds a different branch.
2406    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    /// The value of [schedule][crate::model::ScheduleOptionsV2::schedule]
2419    /// if it holds a `EventDrivenSchedule`, `None` if the field is not set or
2420    /// holds a different branch.
2421    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    /// Sets the value of [schedule][crate::model::ScheduleOptionsV2::schedule]
2434    /// to hold a `TimeBasedSchedule`.
2435    ///
2436    /// Note that all the setters affecting `schedule` are
2437    /// mutually exclusive.
2438    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    /// Sets the value of [schedule][crate::model::ScheduleOptionsV2::schedule]
2451    /// to hold a `ManualSchedule`.
2452    ///
2453    /// Note that all the setters affecting `schedule` are
2454    /// mutually exclusive.
2455    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    /// Sets the value of [schedule][crate::model::ScheduleOptionsV2::schedule]
2468    /// to hold a `EventDrivenSchedule`.
2469    ///
2470    /// Note that all the setters affecting `schedule` are
2471    /// mutually exclusive.
2472    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
2491/// Defines additional types related to [ScheduleOptionsV2].
2492pub mod schedule_options_v_2 {
2493    #[allow(unused_imports)]
2494    use super::*;
2495
2496    /// Data transfer schedules.
2497    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
2498    #[serde(rename_all = "camelCase")]
2499    #[non_exhaustive]
2500    pub enum Schedule {
2501        /// Time based transfer schedule options. This is the default schedule
2502        /// option.
2503        TimeBasedSchedule(std::boxed::Box<crate::model::TimeBasedSchedule>),
2504        /// Manual transfer schedule. If set, the transfer run will not be
2505        /// auto-scheduled by the system, unless the client invokes
2506        /// StartManualTransferRuns.  This is equivalent to
2507        /// disable_auto_scheduling = true.
2508        ManualSchedule(std::boxed::Box<crate::model::ManualSchedule>),
2509        /// Event driven transfer schedule options. If set, the transfer will be
2510        /// scheduled upon events arrial.
2511        EventDrivenSchedule(std::boxed::Box<crate::model::EventDrivenSchedule>),
2512    }
2513}
2514
2515/// Options customizing the time based transfer schedule.
2516/// Options are migrated from the original ScheduleOptions message.
2517#[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    /// Data transfer schedule.
2523    /// If the data source does not support a custom schedule, this should be
2524    /// empty. If it is empty, the default value for the data source will be used.
2525    /// The specified times are in UTC.
2526    /// Examples of valid format:
2527    /// `1st,3rd monday of month 15:30`,
2528    /// `every wed,fri of jan,jun 13:15`, and
2529    /// `first sunday of quarter 00:00`.
2530    /// See more explanation about the format here:
2531    /// <https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format>
2532    ///
2533    /// NOTE: The minimum interval time between recurring transfers depends on the
2534    /// data source; refer to the documentation for your data source.
2535    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2536    pub schedule: std::string::String,
2537
2538    /// Specifies time to start scheduling transfer runs. The first run will be
2539    /// scheduled at or after the start time according to a recurrence pattern
2540    /// defined in the schedule string. The start time can be changed at any
2541    /// moment.
2542    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2543    pub start_time: std::option::Option<wkt::Timestamp>,
2544
2545    /// Defines time to stop scheduling transfer runs. A transfer run cannot be
2546    /// scheduled at or after the end time. The end time can be changed at any
2547    /// moment.
2548    #[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    /// Sets the value of [schedule][crate::model::TimeBasedSchedule::schedule].
2561    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    /// Sets the value of [start_time][crate::model::TimeBasedSchedule::start_time].
2567    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    /// Sets the value of [end_time][crate::model::TimeBasedSchedule::end_time].
2576    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/// Options customizing manual transfers schedule.
2592#[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/// Options customizing EventDriven transfers schedule.
2614#[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    /// Pub/Sub subscription name used to receive events.
2620    /// Only Google Cloud Storage data source support this option.
2621    /// Format: projects/{project}/subscriptions/{subscription}
2622    #[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    /// Sets the value of [pubsub_subscription][crate::model::EventDrivenSchedule::pubsub_subscription].
2635    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/// Information about a user.
2651#[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    /// E-mail address of the user.
2657    #[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    /// Sets the value of [email][crate::model::UserInfo::email].
2670    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/// Represents a data transfer configuration. A transfer configuration
2686/// contains all metadata needed to perform a data transfer. For example,
2687/// `destination_dataset_id` specifies where data should be stored.
2688/// When a new transfer configuration is created, the specified
2689/// `destination_dataset_id` is created when needed and shared with the
2690/// appropriate data source service account.
2691#[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    /// Identifier. The resource name of the transfer config.
2697    /// Transfer config names have the form either
2698    /// `projects/{project_id}/locations/{region}/transferConfigs/{config_id}` or
2699    /// `projects/{project_id}/transferConfigs/{config_id}`,
2700    /// where `config_id` is usually a UUID, even though it is not
2701    /// guaranteed or required. The name is ignored when creating a transfer
2702    /// config.
2703    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2704    pub name: std::string::String,
2705
2706    /// User specified display name for the data transfer.
2707    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2708    pub display_name: std::string::String,
2709
2710    /// Data source ID. This cannot be changed once data transfer is created. The
2711    /// full list of available data source IDs can be returned through an API call:
2712    /// <https://cloud.google.com/bigquery-transfer/docs/reference/datatransfer/rest/v1/projects.locations.dataSources/list>
2713    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2714    pub data_source_id: std::string::String,
2715
2716    /// Parameters specific to each data source. For more information see the
2717    /// bq tab in the 'Setting up a data transfer' section for each data source.
2718    /// For example the parameters for Cloud Storage transfers are listed here:
2719    /// <https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq>
2720    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2721    pub params: std::option::Option<wkt::Struct>,
2722
2723    /// Data transfer schedule.
2724    /// If the data source does not support a custom schedule, this should be
2725    /// empty. If it is empty, the default value for the data source will be used.
2726    /// The specified times are in UTC.
2727    /// Examples of valid format:
2728    /// `1st,3rd monday of month 15:30`,
2729    /// `every wed,fri of jan,jun 13:15`, and
2730    /// `first sunday of quarter 00:00`.
2731    /// See more explanation about the format here:
2732    /// <https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format>
2733    ///
2734    /// NOTE: The minimum interval time between recurring transfers depends on the
2735    /// data source; refer to the documentation for your data source.
2736    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2737    pub schedule: std::string::String,
2738
2739    /// Options customizing the data transfer schedule.
2740    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2741    pub schedule_options: std::option::Option<crate::model::ScheduleOptions>,
2742
2743    /// Options customizing different types of data transfer schedule.
2744    /// This field replaces "schedule" and "schedule_options" fields.
2745    /// ScheduleOptionsV2 cannot be used together with ScheduleOptions/Schedule.
2746    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2747    pub schedule_options_v2: std::option::Option<crate::model::ScheduleOptionsV2>,
2748
2749    /// The number of days to look back to automatically refresh the data.
2750    /// For example, if `data_refresh_window_days = 10`, then every day
2751    /// BigQuery reingests data for [today-10, today-1], rather than ingesting data
2752    /// for just [today-1].
2753    /// Only valid if the data source supports the feature. Set the value to 0
2754    /// to use the default value.
2755    pub data_refresh_window_days: i32,
2756
2757    /// Is this config disabled. When set to true, no runs will be scheduled for
2758    /// this transfer config.
2759    pub disabled: bool,
2760
2761    /// Output only. Data transfer modification time. Ignored by server on input.
2762    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2763    pub update_time: std::option::Option<wkt::Timestamp>,
2764
2765    /// Output only. Next time when data transfer will run.
2766    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2767    pub next_run_time: std::option::Option<wkt::Timestamp>,
2768
2769    /// Output only. State of the most recently updated transfer run.
2770    pub state: crate::model::TransferState,
2771
2772    /// Deprecated. Unique ID of the user on whose behalf transfer is done.
2773    #[serde_as(as = "serde_with::DisplayFromStr")]
2774    pub user_id: i64,
2775
2776    /// Output only. Region in which BigQuery dataset is located.
2777    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2778    pub dataset_region: std::string::String,
2779
2780    /// Pub/Sub topic where notifications will be sent after transfer runs
2781    /// associated with this transfer config finish.
2782    ///
2783    /// The format for specifying a pubsub topic is:
2784    /// `projects/{project_id}/topics/{topic_id}`
2785    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2786    pub notification_pubsub_topic: std::string::String,
2787
2788    /// Email notifications will be sent according to these preferences
2789    /// to the email address of the user who owns this transfer config.
2790    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2791    pub email_preferences: std::option::Option<crate::model::EmailPreferences>,
2792
2793    /// Output only. Information about the user whose credentials are used to
2794    /// transfer data. Populated only for `transferConfigs.get` requests. In case
2795    /// the user information is not available, this field will not be populated.
2796    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2797    pub owner_info: std::option::Option<crate::model::UserInfo>,
2798
2799    /// The encryption configuration part. Currently, it is only used for the
2800    /// optional KMS key name. The BigQuery service account of your project must be
2801    /// granted permissions to use the key. Read methods will return the key name
2802    /// applied in effect. Write methods will apply the key if it is present, or
2803    /// otherwise try to apply project default keys if it is absent.
2804    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2805    pub encryption_configuration: std::option::Option<crate::model::EncryptionConfiguration>,
2806
2807    /// Output only. Error code with detailed information about reason of the
2808    /// latest config failure.
2809    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2810    pub error: std::option::Option<rpc::model::Status>,
2811
2812    /// The desination of the transfer config.
2813    #[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    /// Sets the value of [name][crate::model::TransferConfig::name].
2826    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    /// Sets the value of [display_name][crate::model::TransferConfig::display_name].
2832    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    /// Sets the value of [data_source_id][crate::model::TransferConfig::data_source_id].
2838    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    /// Sets the value of [params][crate::model::TransferConfig::params].
2844    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    /// Sets the value of [schedule][crate::model::TransferConfig::schedule].
2853    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    /// Sets the value of [schedule_options][crate::model::TransferConfig::schedule_options].
2859    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    /// Sets the value of [schedule_options_v2][crate::model::TransferConfig::schedule_options_v2].
2870    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    /// Sets the value of [data_refresh_window_days][crate::model::TransferConfig::data_refresh_window_days].
2881    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    /// Sets the value of [disabled][crate::model::TransferConfig::disabled].
2887    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2888        self.disabled = v.into();
2889        self
2890    }
2891
2892    /// Sets the value of [update_time][crate::model::TransferConfig::update_time].
2893    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    /// Sets the value of [next_run_time][crate::model::TransferConfig::next_run_time].
2902    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    /// Sets the value of [state][crate::model::TransferConfig::state].
2911    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    /// Sets the value of [user_id][crate::model::TransferConfig::user_id].
2917    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    /// Sets the value of [dataset_region][crate::model::TransferConfig::dataset_region].
2923    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    /// Sets the value of [notification_pubsub_topic][crate::model::TransferConfig::notification_pubsub_topic].
2929    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    /// Sets the value of [email_preferences][crate::model::TransferConfig::email_preferences].
2938    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    /// Sets the value of [owner_info][crate::model::TransferConfig::owner_info].
2949    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    /// Sets the value of [encryption_configuration][crate::model::TransferConfig::encryption_configuration].
2958    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    /// Sets the value of [error][crate::model::TransferConfig::error].
2969    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    /// Sets the value of [destination][crate::model::TransferConfig::destination].
2978    ///
2979    /// Note that all the setters affecting `destination` are mutually
2980    /// exclusive.
2981    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    /// The value of [destination][crate::model::TransferConfig::destination]
2992    /// if it holds a `DestinationDatasetId`, `None` if the field is not set or
2993    /// holds a different branch.
2994    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    /// Sets the value of [destination][crate::model::TransferConfig::destination]
3005    /// to hold a `DestinationDatasetId`.
3006    ///
3007    /// Note that all the setters affecting `destination` are
3008    /// mutually exclusive.
3009    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
3026/// Defines additional types related to [TransferConfig].
3027pub mod transfer_config {
3028    #[allow(unused_imports)]
3029    use super::*;
3030
3031    /// The desination of the transfer config.
3032    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3033    #[serde(rename_all = "camelCase")]
3034    #[non_exhaustive]
3035    pub enum Destination {
3036        /// The BigQuery target dataset id.
3037        DestinationDatasetId(std::string::String),
3038    }
3039}
3040
3041/// Represents the encryption configuration for a transfer.
3042#[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    /// The name of the KMS key used for encrypting BigQuery data.
3048    #[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    /// Sets the value of [kms_key_name][crate::model::EncryptionConfiguration::kms_key_name].
3061    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/// Represents a data transfer run.
3077#[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    /// Identifier. The resource name of the transfer run.
3083    /// Transfer run names have the form
3084    /// `projects/{project_id}/locations/{location}/transferConfigs/{config_id}/runs/{run_id}`.
3085    /// The name is ignored when creating a transfer run.
3086    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3087    pub name: std::string::String,
3088
3089    /// Minimum time after which a transfer run can be started.
3090    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3091    pub schedule_time: std::option::Option<wkt::Timestamp>,
3092
3093    /// For batch transfer runs, specifies the date and time of the data should be
3094    /// ingested.
3095    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3096    pub run_time: std::option::Option<wkt::Timestamp>,
3097
3098    /// Status of the transfer run.
3099    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3100    pub error_status: std::option::Option<rpc::model::Status>,
3101
3102    /// Output only. Time when transfer run was started.
3103    /// Parameter ignored by server for input requests.
3104    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3105    pub start_time: std::option::Option<wkt::Timestamp>,
3106
3107    /// Output only. Time when transfer run ended.
3108    /// Parameter ignored by server for input requests.
3109    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3110    pub end_time: std::option::Option<wkt::Timestamp>,
3111
3112    /// Output only. Last time the data transfer run state was updated.
3113    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3114    pub update_time: std::option::Option<wkt::Timestamp>,
3115
3116    /// Output only. Parameters specific to each data source. For more information
3117    /// see the bq tab in the 'Setting up a data transfer' section for each data
3118    /// source. For example the parameters for Cloud Storage transfers are listed
3119    /// here:
3120    /// <https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq>
3121    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3122    pub params: std::option::Option<wkt::Struct>,
3123
3124    /// Output only. Data source id.
3125    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3126    pub data_source_id: std::string::String,
3127
3128    /// Data transfer run state. Ignored for input requests.
3129    pub state: crate::model::TransferState,
3130
3131    /// Deprecated. Unique ID of the user on whose behalf transfer is done.
3132    #[serde_as(as = "serde_with::DisplayFromStr")]
3133    pub user_id: i64,
3134
3135    /// Output only. Describes the schedule of this transfer run if it was
3136    /// created as part of a regular schedule. For batch transfer runs that are
3137    /// scheduled manually, this is empty.
3138    /// NOTE: the system might choose to delay the schedule depending on the
3139    /// current load, so `schedule_time` doesn't always match this.
3140    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3141    pub schedule: std::string::String,
3142
3143    /// Output only. Pub/Sub topic where a notification will be sent after this
3144    /// transfer run finishes.
3145    ///
3146    /// The format for specifying a pubsub topic is:
3147    /// `projects/{project_id}/topics/{topic_id}`
3148    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3149    pub notification_pubsub_topic: std::string::String,
3150
3151    /// Output only. Email notifications will be sent according to these
3152    /// preferences to the email address of the user who owns the transfer config
3153    /// this run was derived from.
3154    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3155    pub email_preferences: std::option::Option<crate::model::EmailPreferences>,
3156
3157    /// Data transfer destination.
3158    #[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    /// Sets the value of [name][crate::model::TransferRun::name].
3171    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    /// Sets the value of [schedule_time][crate::model::TransferRun::schedule_time].
3177    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    /// Sets the value of [run_time][crate::model::TransferRun::run_time].
3186    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    /// Sets the value of [error_status][crate::model::TransferRun::error_status].
3195    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    /// Sets the value of [start_time][crate::model::TransferRun::start_time].
3204    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    /// Sets the value of [end_time][crate::model::TransferRun::end_time].
3213    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    /// Sets the value of [update_time][crate::model::TransferRun::update_time].
3222    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    /// Sets the value of [params][crate::model::TransferRun::params].
3231    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    /// Sets the value of [data_source_id][crate::model::TransferRun::data_source_id].
3240    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    /// Sets the value of [state][crate::model::TransferRun::state].
3246    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    /// Sets the value of [user_id][crate::model::TransferRun::user_id].
3252    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    /// Sets the value of [schedule][crate::model::TransferRun::schedule].
3258    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    /// Sets the value of [notification_pubsub_topic][crate::model::TransferRun::notification_pubsub_topic].
3264    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    /// Sets the value of [email_preferences][crate::model::TransferRun::email_preferences].
3273    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    /// Sets the value of [destination][crate::model::TransferRun::destination].
3284    ///
3285    /// Note that all the setters affecting `destination` are mutually
3286    /// exclusive.
3287    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    /// The value of [destination][crate::model::TransferRun::destination]
3298    /// if it holds a `DestinationDatasetId`, `None` if the field is not set or
3299    /// holds a different branch.
3300    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    /// Sets the value of [destination][crate::model::TransferRun::destination]
3311    /// to hold a `DestinationDatasetId`.
3312    ///
3313    /// Note that all the setters affecting `destination` are
3314    /// mutually exclusive.
3315    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
3332/// Defines additional types related to [TransferRun].
3333pub mod transfer_run {
3334    #[allow(unused_imports)]
3335    use super::*;
3336
3337    /// Data transfer destination.
3338    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3339    #[serde(rename_all = "camelCase")]
3340    #[non_exhaustive]
3341    pub enum Destination {
3342        /// Output only. The BigQuery target dataset id.
3343        DestinationDatasetId(std::string::String),
3344    }
3345}
3346
3347/// Represents a user facing message for a particular data transfer run.
3348#[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    /// Time when message was logged.
3354    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3355    pub message_time: std::option::Option<wkt::Timestamp>,
3356
3357    /// Message severity.
3358    pub severity: crate::model::transfer_message::MessageSeverity,
3359
3360    /// Message text.
3361    #[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    /// Sets the value of [message_time][crate::model::TransferMessage::message_time].
3374    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    /// Sets the value of [severity][crate::model::TransferMessage::severity].
3383    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    /// Sets the value of [message_text][crate::model::TransferMessage::message_text].
3392    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
3404/// Defines additional types related to [TransferMessage].
3405pub mod transfer_message {
3406    #[allow(unused_imports)]
3407    use super::*;
3408
3409    /// Represents data transfer user facing message severity.
3410    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3411    pub struct MessageSeverity(i32);
3412
3413    impl MessageSeverity {
3414        /// No severity specified.
3415        pub const MESSAGE_SEVERITY_UNSPECIFIED: MessageSeverity = MessageSeverity::new(0);
3416
3417        /// Informational message.
3418        pub const INFO: MessageSeverity = MessageSeverity::new(1);
3419
3420        /// Warning message.
3421        pub const WARNING: MessageSeverity = MessageSeverity::new(2);
3422
3423        /// Error message.
3424        pub const ERROR: MessageSeverity = MessageSeverity::new(3);
3425
3426        /// Creates a new MessageSeverity instance.
3427        pub(crate) const fn new(value: i32) -> Self {
3428            Self(value)
3429        }
3430
3431        /// Gets the enum value.
3432        pub fn value(&self) -> i32 {
3433            self.0
3434        }
3435
3436        /// Gets the enum value as a string.
3437        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        /// Creates an enum value from the value name.
3448        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/// DEPRECATED. Represents data transfer type.
3475#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3476pub struct TransferType(i32);
3477
3478impl TransferType {
3479    /// Invalid or Unknown transfer type placeholder.
3480    pub const TRANSFER_TYPE_UNSPECIFIED: TransferType = TransferType::new(0);
3481
3482    /// Batch data transfer.
3483    pub const BATCH: TransferType = TransferType::new(1);
3484
3485    /// Streaming data transfer. Streaming data source currently doesn't
3486    /// support multiple transfer configs per project.
3487    pub const STREAMING: TransferType = TransferType::new(2);
3488
3489    /// Creates a new TransferType instance.
3490    pub(crate) const fn new(value: i32) -> Self {
3491        Self(value)
3492    }
3493
3494    /// Gets the enum value.
3495    pub fn value(&self) -> i32 {
3496        self.0
3497    }
3498
3499    /// Gets the enum value as a string.
3500    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    /// Creates an enum value from the value name.
3510    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/// Represents data transfer run state.
3535#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3536pub struct TransferState(i32);
3537
3538impl TransferState {
3539    /// State placeholder (0).
3540    pub const TRANSFER_STATE_UNSPECIFIED: TransferState = TransferState::new(0);
3541
3542    /// Data transfer is scheduled and is waiting to be picked up by
3543    /// data transfer backend (2).
3544    pub const PENDING: TransferState = TransferState::new(2);
3545
3546    /// Data transfer is in progress (3).
3547    pub const RUNNING: TransferState = TransferState::new(3);
3548
3549    /// Data transfer completed successfully (4).
3550    pub const SUCCEEDED: TransferState = TransferState::new(4);
3551
3552    /// Data transfer failed (5).
3553    pub const FAILED: TransferState = TransferState::new(5);
3554
3555    /// Data transfer is cancelled (6).
3556    pub const CANCELLED: TransferState = TransferState::new(6);
3557
3558    /// Creates a new TransferState instance.
3559    pub(crate) const fn new(value: i32) -> Self {
3560        Self(value)
3561    }
3562
3563    /// Gets the enum value.
3564    pub fn value(&self) -> i32 {
3565        self.0
3566    }
3567
3568    /// Gets the enum value as a string.
3569    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    /// Creates an enum value from the value name.
3582    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}