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 lazy_static;
24extern crate location;
25extern crate reqwest;
26extern crate rpc;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34/// A parameter used to define custom fields in a data source definition.
35#[serde_with::serde_as]
36#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
37#[serde(default, rename_all = "camelCase")]
38#[non_exhaustive]
39pub struct DataSourceParameter {
40    /// Parameter identifier.
41    #[serde(skip_serializing_if = "std::string::String::is_empty")]
42    pub param_id: std::string::String,
43
44    /// Parameter display name in the user interface.
45    #[serde(skip_serializing_if = "std::string::String::is_empty")]
46    pub display_name: std::string::String,
47
48    /// Parameter description.
49    #[serde(skip_serializing_if = "std::string::String::is_empty")]
50    pub description: std::string::String,
51
52    /// Parameter type.
53    #[serde(rename = "type")]
54    pub r#type: crate::model::data_source_parameter::Type,
55
56    /// Is parameter required.
57    pub required: bool,
58
59    /// Deprecated. This field has no effect.
60    pub repeated: bool,
61
62    /// Regular expression which can be used for parameter validation.
63    #[serde(skip_serializing_if = "std::string::String::is_empty")]
64    pub validation_regex: std::string::String,
65
66    /// All possible values for the parameter.
67    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
68    pub allowed_values: std::vec::Vec<std::string::String>,
69
70    /// For integer and double values specifies minimum allowed value.
71    #[serde(skip_serializing_if = "std::option::Option::is_none")]
72    pub min_value: std::option::Option<wkt::DoubleValue>,
73
74    /// For integer and double values specifies maximum allowed value.
75    #[serde(skip_serializing_if = "std::option::Option::is_none")]
76    pub max_value: std::option::Option<wkt::DoubleValue>,
77
78    /// Deprecated. This field has no effect.
79    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
80    pub fields: std::vec::Vec<crate::model::DataSourceParameter>,
81
82    /// Description of the requirements for this field, in case the user input does
83    /// not fulfill the regex pattern or min/max values.
84    #[serde(skip_serializing_if = "std::string::String::is_empty")]
85    pub validation_description: std::string::String,
86
87    /// URL to a help document to further explain the naming requirements.
88    #[serde(skip_serializing_if = "std::string::String::is_empty")]
89    pub validation_help_url: std::string::String,
90
91    /// Cannot be changed after initial creation.
92    pub immutable: bool,
93
94    /// Deprecated. This field has no effect.
95    pub recurse: bool,
96
97    /// If true, it should not be used in new transfers, and it should not be
98    /// visible to users.
99    pub deprecated: bool,
100}
101
102impl DataSourceParameter {
103    pub fn new() -> Self {
104        std::default::Default::default()
105    }
106
107    /// Sets the value of [param_id][crate::model::DataSourceParameter::param_id].
108    pub fn set_param_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
109        self.param_id = v.into();
110        self
111    }
112
113    /// Sets the value of [display_name][crate::model::DataSourceParameter::display_name].
114    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
115        self.display_name = v.into();
116        self
117    }
118
119    /// Sets the value of [description][crate::model::DataSourceParameter::description].
120    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
121        self.description = v.into();
122        self
123    }
124
125    /// Sets the value of [r#type][crate::model::DataSourceParameter::type].
126    pub fn set_type<T: std::convert::Into<crate::model::data_source_parameter::Type>>(
127        mut self,
128        v: T,
129    ) -> Self {
130        self.r#type = v.into();
131        self
132    }
133
134    /// Sets the value of [required][crate::model::DataSourceParameter::required].
135    pub fn set_required<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
136        self.required = v.into();
137        self
138    }
139
140    /// Sets the value of [repeated][crate::model::DataSourceParameter::repeated].
141    pub fn set_repeated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
142        self.repeated = v.into();
143        self
144    }
145
146    /// Sets the value of [validation_regex][crate::model::DataSourceParameter::validation_regex].
147    pub fn set_validation_regex<T: std::convert::Into<std::string::String>>(
148        mut self,
149        v: T,
150    ) -> Self {
151        self.validation_regex = v.into();
152        self
153    }
154
155    /// Sets the value of [min_value][crate::model::DataSourceParameter::min_value].
156    pub fn set_min_value<T: std::convert::Into<std::option::Option<wkt::DoubleValue>>>(
157        mut self,
158        v: T,
159    ) -> Self {
160        self.min_value = v.into();
161        self
162    }
163
164    /// Sets the value of [max_value][crate::model::DataSourceParameter::max_value].
165    pub fn set_max_value<T: std::convert::Into<std::option::Option<wkt::DoubleValue>>>(
166        mut self,
167        v: T,
168    ) -> Self {
169        self.max_value = v.into();
170        self
171    }
172
173    /// Sets the value of [validation_description][crate::model::DataSourceParameter::validation_description].
174    pub fn set_validation_description<T: std::convert::Into<std::string::String>>(
175        mut self,
176        v: T,
177    ) -> Self {
178        self.validation_description = v.into();
179        self
180    }
181
182    /// Sets the value of [validation_help_url][crate::model::DataSourceParameter::validation_help_url].
183    pub fn set_validation_help_url<T: std::convert::Into<std::string::String>>(
184        mut self,
185        v: T,
186    ) -> Self {
187        self.validation_help_url = v.into();
188        self
189    }
190
191    /// Sets the value of [immutable][crate::model::DataSourceParameter::immutable].
192    pub fn set_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
193        self.immutable = v.into();
194        self
195    }
196
197    /// Sets the value of [recurse][crate::model::DataSourceParameter::recurse].
198    pub fn set_recurse<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
199        self.recurse = v.into();
200        self
201    }
202
203    /// Sets the value of [deprecated][crate::model::DataSourceParameter::deprecated].
204    pub fn set_deprecated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
205        self.deprecated = v.into();
206        self
207    }
208
209    /// Sets the value of [allowed_values][crate::model::DataSourceParameter::allowed_values].
210    pub fn set_allowed_values<T, V>(mut self, v: T) -> Self
211    where
212        T: std::iter::IntoIterator<Item = V>,
213        V: std::convert::Into<std::string::String>,
214    {
215        use std::iter::Iterator;
216        self.allowed_values = v.into_iter().map(|i| i.into()).collect();
217        self
218    }
219
220    /// Sets the value of [fields][crate::model::DataSourceParameter::fields].
221    pub fn set_fields<T, V>(mut self, v: T) -> Self
222    where
223        T: std::iter::IntoIterator<Item = V>,
224        V: std::convert::Into<crate::model::DataSourceParameter>,
225    {
226        use std::iter::Iterator;
227        self.fields = v.into_iter().map(|i| i.into()).collect();
228        self
229    }
230}
231
232impl wkt::message::Message for DataSourceParameter {
233    fn typename() -> &'static str {
234        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.DataSourceParameter"
235    }
236}
237
238/// Defines additional types related to DataSourceParameter
239pub mod data_source_parameter {
240    #[allow(unused_imports)]
241    use super::*;
242
243    /// Parameter type.
244    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
245    pub struct Type(std::borrow::Cow<'static, str>);
246
247    impl Type {
248        /// Creates a new Type instance.
249        pub const fn new(v: &'static str) -> Self {
250            Self(std::borrow::Cow::Borrowed(v))
251        }
252
253        /// Gets the enum value.
254        pub fn value(&self) -> &str {
255            &self.0
256        }
257    }
258
259    /// Useful constants to work with [Type](Type)
260    pub mod r#type {
261        use super::Type;
262
263        /// Type unspecified.
264        pub const TYPE_UNSPECIFIED: Type = Type::new("TYPE_UNSPECIFIED");
265
266        /// String parameter.
267        pub const STRING: Type = Type::new("STRING");
268
269        /// Integer parameter (64-bits).
270        /// Will be serialized to json as string.
271        pub const INTEGER: Type = Type::new("INTEGER");
272
273        /// Double precision floating point parameter.
274        pub const DOUBLE: Type = Type::new("DOUBLE");
275
276        /// Boolean parameter.
277        pub const BOOLEAN: Type = Type::new("BOOLEAN");
278
279        /// Deprecated. This field has no effect.
280        pub const RECORD: Type = Type::new("RECORD");
281
282        /// Page ID for a Google+ Page.
283        pub const PLUS_PAGE: Type = Type::new("PLUS_PAGE");
284
285        /// List of strings parameter.
286        pub const LIST: Type = Type::new("LIST");
287    }
288
289    impl std::convert::From<std::string::String> for Type {
290        fn from(value: std::string::String) -> Self {
291            Self(std::borrow::Cow::Owned(value))
292        }
293    }
294}
295
296/// Defines the properties and custom parameters for a data source.
297#[serde_with::serde_as]
298#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
299#[serde(default, rename_all = "camelCase")]
300#[non_exhaustive]
301pub struct DataSource {
302    /// Output only. Data source resource name.
303    #[serde(skip_serializing_if = "std::string::String::is_empty")]
304    pub name: std::string::String,
305
306    /// Data source id.
307    #[serde(skip_serializing_if = "std::string::String::is_empty")]
308    pub data_source_id: std::string::String,
309
310    /// User friendly data source name.
311    #[serde(skip_serializing_if = "std::string::String::is_empty")]
312    pub display_name: std::string::String,
313
314    /// User friendly data source description string.
315    #[serde(skip_serializing_if = "std::string::String::is_empty")]
316    pub description: std::string::String,
317
318    /// Data source client id which should be used to receive refresh token.
319    #[serde(skip_serializing_if = "std::string::String::is_empty")]
320    pub client_id: std::string::String,
321
322    /// Api auth scopes for which refresh token needs to be obtained. These are
323    /// scopes needed by a data source to prepare data and ingest them into
324    /// BigQuery, e.g., <https://www.googleapis.com/auth/bigquery>
325    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
326    pub scopes: std::vec::Vec<std::string::String>,
327
328    /// Deprecated. This field has no effect.
329    pub transfer_type: crate::model::TransferType,
330
331    /// Deprecated. This field has no effect.
332    pub supports_multiple_transfers: bool,
333
334    /// The number of seconds to wait for an update from the data source
335    /// before the Data Transfer Service marks the transfer as FAILED.
336    pub update_deadline_seconds: i32,
337
338    /// Default data transfer schedule.
339    /// Examples of valid schedules include:
340    /// `1st,3rd monday of month 15:30`,
341    /// `every wed,fri of jan,jun 13:15`, and
342    /// `first sunday of quarter 00:00`.
343    #[serde(skip_serializing_if = "std::string::String::is_empty")]
344    pub default_schedule: std::string::String,
345
346    /// Specifies whether the data source supports a user defined schedule, or
347    /// operates on the default schedule.
348    /// When set to `true`, user can override default schedule.
349    pub supports_custom_schedule: bool,
350
351    /// Data source parameters.
352    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
353    pub parameters: std::vec::Vec<crate::model::DataSourceParameter>,
354
355    /// Url for the help document for this data source.
356    #[serde(skip_serializing_if = "std::string::String::is_empty")]
357    pub help_url: std::string::String,
358
359    /// Indicates the type of authorization.
360    pub authorization_type: crate::model::data_source::AuthorizationType,
361
362    /// Specifies whether the data source supports automatic data refresh for the
363    /// past few days, and how it's supported.
364    /// For some data sources, data might not be complete until a few days later,
365    /// so it's useful to refresh data automatically.
366    pub data_refresh_type: crate::model::data_source::DataRefreshType,
367
368    /// Default data refresh window on days.
369    /// Only meaningful when `data_refresh_type` = `SLIDING_WINDOW`.
370    pub default_data_refresh_window_days: i32,
371
372    /// Disables backfilling and manual run scheduling
373    /// for the data source.
374    pub manual_runs_disabled: bool,
375
376    /// The minimum interval for scheduler to schedule runs.
377    #[serde(skip_serializing_if = "std::option::Option::is_none")]
378    pub minimum_schedule_interval: std::option::Option<wkt::Duration>,
379}
380
381impl DataSource {
382    pub fn new() -> Self {
383        std::default::Default::default()
384    }
385
386    /// Sets the value of [name][crate::model::DataSource::name].
387    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
388        self.name = v.into();
389        self
390    }
391
392    /// Sets the value of [data_source_id][crate::model::DataSource::data_source_id].
393    pub fn set_data_source_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
394        self.data_source_id = v.into();
395        self
396    }
397
398    /// Sets the value of [display_name][crate::model::DataSource::display_name].
399    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
400        self.display_name = v.into();
401        self
402    }
403
404    /// Sets the value of [description][crate::model::DataSource::description].
405    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
406        self.description = v.into();
407        self
408    }
409
410    /// Sets the value of [client_id][crate::model::DataSource::client_id].
411    pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
412        self.client_id = v.into();
413        self
414    }
415
416    /// Sets the value of [transfer_type][crate::model::DataSource::transfer_type].
417    pub fn set_transfer_type<T: std::convert::Into<crate::model::TransferType>>(
418        mut self,
419        v: T,
420    ) -> Self {
421        self.transfer_type = v.into();
422        self
423    }
424
425    /// Sets the value of [supports_multiple_transfers][crate::model::DataSource::supports_multiple_transfers].
426    pub fn set_supports_multiple_transfers<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
427        self.supports_multiple_transfers = v.into();
428        self
429    }
430
431    /// Sets the value of [update_deadline_seconds][crate::model::DataSource::update_deadline_seconds].
432    pub fn set_update_deadline_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
433        self.update_deadline_seconds = v.into();
434        self
435    }
436
437    /// Sets the value of [default_schedule][crate::model::DataSource::default_schedule].
438    pub fn set_default_schedule<T: std::convert::Into<std::string::String>>(
439        mut self,
440        v: T,
441    ) -> Self {
442        self.default_schedule = v.into();
443        self
444    }
445
446    /// Sets the value of [supports_custom_schedule][crate::model::DataSource::supports_custom_schedule].
447    pub fn set_supports_custom_schedule<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
448        self.supports_custom_schedule = v.into();
449        self
450    }
451
452    /// Sets the value of [help_url][crate::model::DataSource::help_url].
453    pub fn set_help_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
454        self.help_url = v.into();
455        self
456    }
457
458    /// Sets the value of [authorization_type][crate::model::DataSource::authorization_type].
459    pub fn set_authorization_type<
460        T: std::convert::Into<crate::model::data_source::AuthorizationType>,
461    >(
462        mut self,
463        v: T,
464    ) -> Self {
465        self.authorization_type = v.into();
466        self
467    }
468
469    /// Sets the value of [data_refresh_type][crate::model::DataSource::data_refresh_type].
470    pub fn set_data_refresh_type<
471        T: std::convert::Into<crate::model::data_source::DataRefreshType>,
472    >(
473        mut self,
474        v: T,
475    ) -> Self {
476        self.data_refresh_type = v.into();
477        self
478    }
479
480    /// Sets the value of [default_data_refresh_window_days][crate::model::DataSource::default_data_refresh_window_days].
481    pub fn set_default_data_refresh_window_days<T: std::convert::Into<i32>>(
482        mut self,
483        v: T,
484    ) -> Self {
485        self.default_data_refresh_window_days = v.into();
486        self
487    }
488
489    /// Sets the value of [manual_runs_disabled][crate::model::DataSource::manual_runs_disabled].
490    pub fn set_manual_runs_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
491        self.manual_runs_disabled = v.into();
492        self
493    }
494
495    /// Sets the value of [minimum_schedule_interval][crate::model::DataSource::minimum_schedule_interval].
496    pub fn set_minimum_schedule_interval<
497        T: std::convert::Into<std::option::Option<wkt::Duration>>,
498    >(
499        mut self,
500        v: T,
501    ) -> Self {
502        self.minimum_schedule_interval = v.into();
503        self
504    }
505
506    /// Sets the value of [scopes][crate::model::DataSource::scopes].
507    pub fn set_scopes<T, V>(mut self, v: T) -> Self
508    where
509        T: std::iter::IntoIterator<Item = V>,
510        V: std::convert::Into<std::string::String>,
511    {
512        use std::iter::Iterator;
513        self.scopes = v.into_iter().map(|i| i.into()).collect();
514        self
515    }
516
517    /// Sets the value of [parameters][crate::model::DataSource::parameters].
518    pub fn set_parameters<T, V>(mut self, v: T) -> Self
519    where
520        T: std::iter::IntoIterator<Item = V>,
521        V: std::convert::Into<crate::model::DataSourceParameter>,
522    {
523        use std::iter::Iterator;
524        self.parameters = v.into_iter().map(|i| i.into()).collect();
525        self
526    }
527}
528
529impl wkt::message::Message for DataSource {
530    fn typename() -> &'static str {
531        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.DataSource"
532    }
533}
534
535/// Defines additional types related to DataSource
536pub mod data_source {
537    #[allow(unused_imports)]
538    use super::*;
539
540    /// The type of authorization needed for this data source.
541    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
542    pub struct AuthorizationType(std::borrow::Cow<'static, str>);
543
544    impl AuthorizationType {
545        /// Creates a new AuthorizationType instance.
546        pub const fn new(v: &'static str) -> Self {
547            Self(std::borrow::Cow::Borrowed(v))
548        }
549
550        /// Gets the enum value.
551        pub fn value(&self) -> &str {
552            &self.0
553        }
554    }
555
556    /// Useful constants to work with [AuthorizationType](AuthorizationType)
557    pub mod authorization_type {
558        use super::AuthorizationType;
559
560        /// Type unspecified.
561        pub const AUTHORIZATION_TYPE_UNSPECIFIED: AuthorizationType =
562            AuthorizationType::new("AUTHORIZATION_TYPE_UNSPECIFIED");
563
564        /// Use OAuth 2 authorization codes that can be exchanged
565        /// for a refresh token on the backend.
566        pub const AUTHORIZATION_CODE: AuthorizationType =
567            AuthorizationType::new("AUTHORIZATION_CODE");
568
569        /// Return an authorization code for a given Google+ page that can then be
570        /// exchanged for a refresh token on the backend.
571        pub const GOOGLE_PLUS_AUTHORIZATION_CODE: AuthorizationType =
572            AuthorizationType::new("GOOGLE_PLUS_AUTHORIZATION_CODE");
573
574        /// Use First Party OAuth.
575        pub const FIRST_PARTY_OAUTH: AuthorizationType =
576            AuthorizationType::new("FIRST_PARTY_OAUTH");
577    }
578
579    impl std::convert::From<std::string::String> for AuthorizationType {
580        fn from(value: std::string::String) -> Self {
581            Self(std::borrow::Cow::Owned(value))
582        }
583    }
584
585    /// Represents how the data source supports data auto refresh.
586    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
587    pub struct DataRefreshType(std::borrow::Cow<'static, str>);
588
589    impl DataRefreshType {
590        /// Creates a new DataRefreshType instance.
591        pub const fn new(v: &'static str) -> Self {
592            Self(std::borrow::Cow::Borrowed(v))
593        }
594
595        /// Gets the enum value.
596        pub fn value(&self) -> &str {
597            &self.0
598        }
599    }
600
601    /// Useful constants to work with [DataRefreshType](DataRefreshType)
602    pub mod data_refresh_type {
603        use super::DataRefreshType;
604
605        /// The data source won't support data auto refresh, which is default value.
606        pub const DATA_REFRESH_TYPE_UNSPECIFIED: DataRefreshType =
607            DataRefreshType::new("DATA_REFRESH_TYPE_UNSPECIFIED");
608
609        /// The data source supports data auto refresh, and runs will be scheduled
610        /// for the past few days. Does not allow custom values to be set for each
611        /// transfer config.
612        pub const SLIDING_WINDOW: DataRefreshType = DataRefreshType::new("SLIDING_WINDOW");
613
614        /// The data source supports data auto refresh, and runs will be scheduled
615        /// for the past few days. Allows custom values to be set for each transfer
616        /// config.
617        pub const CUSTOM_SLIDING_WINDOW: DataRefreshType =
618            DataRefreshType::new("CUSTOM_SLIDING_WINDOW");
619    }
620
621    impl std::convert::From<std::string::String> for DataRefreshType {
622        fn from(value: std::string::String) -> Self {
623            Self(std::borrow::Cow::Owned(value))
624        }
625    }
626}
627
628/// A request to get data source info.
629#[serde_with::serde_as]
630#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
631#[serde(default, rename_all = "camelCase")]
632#[non_exhaustive]
633pub struct GetDataSourceRequest {
634    /// Required. The field will contain name of the resource requested, for
635    /// example: `projects/{project_id}/dataSources/{data_source_id}` or
636    /// `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`
637    #[serde(skip_serializing_if = "std::string::String::is_empty")]
638    pub name: std::string::String,
639}
640
641impl GetDataSourceRequest {
642    pub fn new() -> Self {
643        std::default::Default::default()
644    }
645
646    /// Sets the value of [name][crate::model::GetDataSourceRequest::name].
647    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
648        self.name = v.into();
649        self
650    }
651}
652
653impl wkt::message::Message for GetDataSourceRequest {
654    fn typename() -> &'static str {
655        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest"
656    }
657}
658
659/// Request to list supported data sources and their data transfer settings.
660#[serde_with::serde_as]
661#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
662#[serde(default, rename_all = "camelCase")]
663#[non_exhaustive]
664pub struct ListDataSourcesRequest {
665    /// Required. The BigQuery project id for which data sources should be
666    /// returned. Must be in the form: `projects/{project_id}` or
667    /// `projects/{project_id}/locations/{location_id}`
668    #[serde(skip_serializing_if = "std::string::String::is_empty")]
669    pub parent: std::string::String,
670
671    /// Pagination token, which can be used to request a specific page
672    /// of `ListDataSourcesRequest` list results. For multiple-page
673    /// results, `ListDataSourcesResponse` outputs
674    /// a `next_page` token, which can be used as the
675    /// `page_token` value to request the next page of list results.
676    #[serde(skip_serializing_if = "std::string::String::is_empty")]
677    pub page_token: std::string::String,
678
679    /// Page size. The default page size is the maximum value of 1000 results.
680    pub page_size: i32,
681}
682
683impl ListDataSourcesRequest {
684    pub fn new() -> Self {
685        std::default::Default::default()
686    }
687
688    /// Sets the value of [parent][crate::model::ListDataSourcesRequest::parent].
689    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
690        self.parent = v.into();
691        self
692    }
693
694    /// Sets the value of [page_token][crate::model::ListDataSourcesRequest::page_token].
695    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
696        self.page_token = v.into();
697        self
698    }
699
700    /// Sets the value of [page_size][crate::model::ListDataSourcesRequest::page_size].
701    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
702        self.page_size = v.into();
703        self
704    }
705}
706
707impl wkt::message::Message for ListDataSourcesRequest {
708    fn typename() -> &'static str {
709        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest"
710    }
711}
712
713/// Returns list of supported data sources and their metadata.
714#[serde_with::serde_as]
715#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
716#[serde(default, rename_all = "camelCase")]
717#[non_exhaustive]
718pub struct ListDataSourcesResponse {
719    /// List of supported data sources and their transfer settings.
720    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
721    pub data_sources: std::vec::Vec<crate::model::DataSource>,
722
723    /// Output only. The next-pagination token. For multiple-page list results,
724    /// this token can be used as the
725    /// `ListDataSourcesRequest.page_token`
726    /// to request the next page of list results.
727    #[serde(skip_serializing_if = "std::string::String::is_empty")]
728    pub next_page_token: std::string::String,
729}
730
731impl ListDataSourcesResponse {
732    pub fn new() -> Self {
733        std::default::Default::default()
734    }
735
736    /// Sets the value of [next_page_token][crate::model::ListDataSourcesResponse::next_page_token].
737    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
738        self.next_page_token = v.into();
739        self
740    }
741
742    /// Sets the value of [data_sources][crate::model::ListDataSourcesResponse::data_sources].
743    pub fn set_data_sources<T, V>(mut self, v: T) -> Self
744    where
745        T: std::iter::IntoIterator<Item = V>,
746        V: std::convert::Into<crate::model::DataSource>,
747    {
748        use std::iter::Iterator;
749        self.data_sources = v.into_iter().map(|i| i.into()).collect();
750        self
751    }
752}
753
754impl wkt::message::Message for ListDataSourcesResponse {
755    fn typename() -> &'static str {
756        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse"
757    }
758}
759
760#[cfg(feature = "unstable-stream")]
761impl gax::paginator::PageableResponse for ListDataSourcesResponse {
762    type PageItem = crate::model::DataSource;
763
764    fn items(self) -> std::vec::Vec<Self::PageItem> {
765        self.data_sources
766    }
767
768    fn next_page_token(&self) -> std::string::String {
769        gax::paginator::extract_token(&self.next_page_token)
770    }
771}
772
773/// A request to create a data transfer configuration. If new credentials are
774/// needed for this transfer configuration, authorization info must be provided.
775/// If authorization info is provided, the transfer configuration will be
776/// associated with the user id corresponding to the authorization info.
777/// Otherwise, the transfer configuration will be associated with the calling
778/// user.
779///
780/// When using a cross project service account for creating a transfer config,
781/// you must enable cross project service account usage. For more information,
782/// see [Disable attachment of service accounts to resources in other
783/// projects](https://cloud.google.com/resource-manager/docs/organization-policy/restricting-service-accounts#disable_cross_project_service_accounts).
784#[serde_with::serde_as]
785#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
786#[serde(default, rename_all = "camelCase")]
787#[non_exhaustive]
788pub struct CreateTransferConfigRequest {
789    /// Required. The BigQuery project id where the transfer configuration should
790    /// be created. Must be in the format
791    /// projects/{project_id}/locations/{location_id} or projects/{project_id}. If
792    /// specified location and location of the destination bigquery dataset do not
793    /// match - the request will fail.
794    #[serde(skip_serializing_if = "std::string::String::is_empty")]
795    pub parent: std::string::String,
796
797    /// Required. Data transfer configuration to create.
798    #[serde(skip_serializing_if = "std::option::Option::is_none")]
799    pub transfer_config: std::option::Option<crate::model::TransferConfig>,
800
801    /// Deprecated: Authorization code was required when
802    /// `transferConfig.dataSourceId` is 'youtube_channel' but it is no longer used
803    /// in any data sources. Use `version_info` instead.
804    ///
805    /// Optional OAuth2 authorization code to use with this transfer configuration.
806    /// This is required only if `transferConfig.dataSourceId` is 'youtube_channel'
807    /// and new credentials are needed, as indicated by `CheckValidCreds`. In order
808    /// to obtain authorization_code, make a request to the following URL:
809    ///
810    /// * The \<var\>client_id\</var\> is the OAuth client_id of the data source as
811    ///   returned by ListDataSources method.
812    /// * \<var\>data_source_scopes\</var\> are the scopes returned by ListDataSources
813    ///   method.
814    ///
815    /// Note that this should not be set when `service_account_name` is used to
816    /// create the transfer config.
817    #[serde(skip_serializing_if = "std::string::String::is_empty")]
818    pub authorization_code: std::string::String,
819
820    /// Optional version info. This parameter replaces `authorization_code` which
821    /// is no longer used in any data sources. This is required only if
822    /// `transferConfig.dataSourceId` is 'youtube_channel' *or* new credentials
823    /// are needed, as indicated by `CheckValidCreds`. In order to obtain version
824    /// info, make a request to the following URL:
825    ///
826    /// * The \<var\>client_id\</var\> is the OAuth client_id of the data source as
827    ///   returned by ListDataSources method.
828    /// * \<var\>data_source_scopes\</var\> are the scopes returned by ListDataSources
829    ///   method.
830    ///
831    /// Note that this should not be set when `service_account_name` is used to
832    /// create the transfer config.
833    #[serde(skip_serializing_if = "std::string::String::is_empty")]
834    pub version_info: std::string::String,
835
836    /// Optional service account email. If this field is set, the transfer config
837    /// will be created with this service account's credentials. It requires that
838    /// the requesting user calling this API has permissions to act as this service
839    /// account.
840    ///
841    /// Note that not all data sources support service account credentials when
842    /// creating a transfer config. For the latest list of data sources, read about
843    /// [using service
844    /// accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-accounts).
845    #[serde(skip_serializing_if = "std::string::String::is_empty")]
846    pub service_account_name: std::string::String,
847}
848
849impl CreateTransferConfigRequest {
850    pub fn new() -> Self {
851        std::default::Default::default()
852    }
853
854    /// Sets the value of [parent][crate::model::CreateTransferConfigRequest::parent].
855    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
856        self.parent = v.into();
857        self
858    }
859
860    /// Sets the value of [transfer_config][crate::model::CreateTransferConfigRequest::transfer_config].
861    pub fn set_transfer_config<
862        T: std::convert::Into<std::option::Option<crate::model::TransferConfig>>,
863    >(
864        mut self,
865        v: T,
866    ) -> Self {
867        self.transfer_config = v.into();
868        self
869    }
870
871    /// Sets the value of [authorization_code][crate::model::CreateTransferConfigRequest::authorization_code].
872    pub fn set_authorization_code<T: std::convert::Into<std::string::String>>(
873        mut self,
874        v: T,
875    ) -> Self {
876        self.authorization_code = v.into();
877        self
878    }
879
880    /// Sets the value of [version_info][crate::model::CreateTransferConfigRequest::version_info].
881    pub fn set_version_info<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
882        self.version_info = v.into();
883        self
884    }
885
886    /// Sets the value of [service_account_name][crate::model::CreateTransferConfigRequest::service_account_name].
887    pub fn set_service_account_name<T: std::convert::Into<std::string::String>>(
888        mut self,
889        v: T,
890    ) -> Self {
891        self.service_account_name = v.into();
892        self
893    }
894}
895
896impl wkt::message::Message for CreateTransferConfigRequest {
897    fn typename() -> &'static str {
898        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest"
899    }
900}
901
902/// A request to update a transfer configuration. To update the user id of the
903/// transfer configuration, authorization info needs to be provided.
904///
905/// When using a cross project service account for updating a transfer config,
906/// you must enable cross project service account usage. For more information,
907/// see [Disable attachment of service accounts to resources in other
908/// projects](https://cloud.google.com/resource-manager/docs/organization-policy/restricting-service-accounts#disable_cross_project_service_accounts).
909#[serde_with::serde_as]
910#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
911#[serde(default, rename_all = "camelCase")]
912#[non_exhaustive]
913pub struct UpdateTransferConfigRequest {
914    /// Required. Data transfer configuration to create.
915    #[serde(skip_serializing_if = "std::option::Option::is_none")]
916    pub transfer_config: std::option::Option<crate::model::TransferConfig>,
917
918    /// Deprecated: Authorization code was required when
919    /// `transferConfig.dataSourceId` is 'youtube_channel' but it is no longer used
920    /// in any data sources. Use `version_info` instead.
921    ///
922    /// Optional OAuth2 authorization code to use with this transfer configuration.
923    /// This is required only if `transferConfig.dataSourceId` is 'youtube_channel'
924    /// and new credentials are needed, as indicated by `CheckValidCreds`. In order
925    /// to obtain authorization_code, make a request to the following URL:
926    ///
927    /// * The \<var\>client_id\</var\> is the OAuth client_id of the data source as
928    ///   returned by ListDataSources method.
929    /// * \<var\>data_source_scopes\</var\> are the scopes returned by ListDataSources
930    ///   method.
931    ///
932    /// Note that this should not be set when `service_account_name` is used to
933    /// update the transfer config.
934    #[serde(skip_serializing_if = "std::string::String::is_empty")]
935    pub authorization_code: std::string::String,
936
937    /// Required. Required list of fields to be updated in this request.
938    #[serde(skip_serializing_if = "std::option::Option::is_none")]
939    pub update_mask: std::option::Option<wkt::FieldMask>,
940
941    /// Optional version info. This parameter replaces `authorization_code` which
942    /// is no longer used in any data sources. This is required only if
943    /// `transferConfig.dataSourceId` is 'youtube_channel' *or* new credentials
944    /// are needed, as indicated by `CheckValidCreds`. In order to obtain version
945    /// info, make a request to the following URL:
946    ///
947    /// * The \<var\>client_id\</var\> is the OAuth client_id of the data source as
948    ///   returned by ListDataSources method.
949    /// * \<var\>data_source_scopes\</var\> are the scopes returned by ListDataSources
950    ///   method.
951    ///
952    /// Note that this should not be set when `service_account_name` is used to
953    /// update the transfer config.
954    #[serde(skip_serializing_if = "std::string::String::is_empty")]
955    pub version_info: std::string::String,
956
957    /// Optional service account email. If this field is set, the transfer config
958    /// will be created with this service account's credentials. It requires that
959    /// the requesting user calling this API has permissions to act as this service
960    /// account.
961    ///
962    /// Note that not all data sources support service account credentials when
963    /// creating a transfer config. For the latest list of data sources, read about
964    /// [using service
965    /// accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-accounts).
966    #[serde(skip_serializing_if = "std::string::String::is_empty")]
967    pub service_account_name: std::string::String,
968}
969
970impl UpdateTransferConfigRequest {
971    pub fn new() -> Self {
972        std::default::Default::default()
973    }
974
975    /// Sets the value of [transfer_config][crate::model::UpdateTransferConfigRequest::transfer_config].
976    pub fn set_transfer_config<
977        T: std::convert::Into<std::option::Option<crate::model::TransferConfig>>,
978    >(
979        mut self,
980        v: T,
981    ) -> Self {
982        self.transfer_config = v.into();
983        self
984    }
985
986    /// Sets the value of [authorization_code][crate::model::UpdateTransferConfigRequest::authorization_code].
987    pub fn set_authorization_code<T: std::convert::Into<std::string::String>>(
988        mut self,
989        v: T,
990    ) -> Self {
991        self.authorization_code = v.into();
992        self
993    }
994
995    /// Sets the value of [update_mask][crate::model::UpdateTransferConfigRequest::update_mask].
996    pub fn set_update_mask<T: std::convert::Into<std::option::Option<wkt::FieldMask>>>(
997        mut self,
998        v: T,
999    ) -> Self {
1000        self.update_mask = v.into();
1001        self
1002    }
1003
1004    /// Sets the value of [version_info][crate::model::UpdateTransferConfigRequest::version_info].
1005    pub fn set_version_info<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1006        self.version_info = v.into();
1007        self
1008    }
1009
1010    /// Sets the value of [service_account_name][crate::model::UpdateTransferConfigRequest::service_account_name].
1011    pub fn set_service_account_name<T: std::convert::Into<std::string::String>>(
1012        mut self,
1013        v: T,
1014    ) -> Self {
1015        self.service_account_name = v.into();
1016        self
1017    }
1018}
1019
1020impl wkt::message::Message for UpdateTransferConfigRequest {
1021    fn typename() -> &'static str {
1022        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest"
1023    }
1024}
1025
1026/// A request to get data transfer information.
1027#[serde_with::serde_as]
1028#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1029#[serde(default, rename_all = "camelCase")]
1030#[non_exhaustive]
1031pub struct GetTransferConfigRequest {
1032    /// Required. The field will contain name of the resource requested, for
1033    /// example: `projects/{project_id}/transferConfigs/{config_id}` or
1034    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
1035    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1036    pub name: std::string::String,
1037}
1038
1039impl GetTransferConfigRequest {
1040    pub fn new() -> Self {
1041        std::default::Default::default()
1042    }
1043
1044    /// Sets the value of [name][crate::model::GetTransferConfigRequest::name].
1045    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1046        self.name = v.into();
1047        self
1048    }
1049}
1050
1051impl wkt::message::Message for GetTransferConfigRequest {
1052    fn typename() -> &'static str {
1053        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest"
1054    }
1055}
1056
1057/// A request to delete data transfer information. All associated transfer runs
1058/// and log messages will be deleted as well.
1059#[serde_with::serde_as]
1060#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1061#[serde(default, rename_all = "camelCase")]
1062#[non_exhaustive]
1063pub struct DeleteTransferConfigRequest {
1064    /// Required. The field will contain name of the resource requested, for
1065    /// example: `projects/{project_id}/transferConfigs/{config_id}` or
1066    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
1067    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1068    pub name: std::string::String,
1069}
1070
1071impl DeleteTransferConfigRequest {
1072    pub fn new() -> Self {
1073        std::default::Default::default()
1074    }
1075
1076    /// Sets the value of [name][crate::model::DeleteTransferConfigRequest::name].
1077    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1078        self.name = v.into();
1079        self
1080    }
1081}
1082
1083impl wkt::message::Message for DeleteTransferConfigRequest {
1084    fn typename() -> &'static str {
1085        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest"
1086    }
1087}
1088
1089/// A request to get data transfer run information.
1090#[serde_with::serde_as]
1091#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1092#[serde(default, rename_all = "camelCase")]
1093#[non_exhaustive]
1094pub struct GetTransferRunRequest {
1095    /// Required. The field will contain name of the resource requested, for
1096    /// example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`
1097    /// or
1098    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
1099    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1100    pub name: std::string::String,
1101}
1102
1103impl GetTransferRunRequest {
1104    pub fn new() -> Self {
1105        std::default::Default::default()
1106    }
1107
1108    /// Sets the value of [name][crate::model::GetTransferRunRequest::name].
1109    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1110        self.name = v.into();
1111        self
1112    }
1113}
1114
1115impl wkt::message::Message for GetTransferRunRequest {
1116    fn typename() -> &'static str {
1117        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest"
1118    }
1119}
1120
1121/// A request to delete data transfer run information.
1122#[serde_with::serde_as]
1123#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1124#[serde(default, rename_all = "camelCase")]
1125#[non_exhaustive]
1126pub struct DeleteTransferRunRequest {
1127    /// Required. The field will contain name of the resource requested, for
1128    /// example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`
1129    /// or
1130    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
1131    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1132    pub name: std::string::String,
1133}
1134
1135impl DeleteTransferRunRequest {
1136    pub fn new() -> Self {
1137        std::default::Default::default()
1138    }
1139
1140    /// Sets the value of [name][crate::model::DeleteTransferRunRequest::name].
1141    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1142        self.name = v.into();
1143        self
1144    }
1145}
1146
1147impl wkt::message::Message for DeleteTransferRunRequest {
1148    fn typename() -> &'static str {
1149        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest"
1150    }
1151}
1152
1153/// A request to list data transfers configured for a BigQuery project.
1154#[serde_with::serde_as]
1155#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1156#[serde(default, rename_all = "camelCase")]
1157#[non_exhaustive]
1158pub struct ListTransferConfigsRequest {
1159    /// Required. The BigQuery project id for which transfer configs
1160    /// should be returned: `projects/{project_id}` or
1161    /// `projects/{project_id}/locations/{location_id}`
1162    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1163    pub parent: std::string::String,
1164
1165    /// When specified, only configurations of requested data sources are returned.
1166    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1167    pub data_source_ids: std::vec::Vec<std::string::String>,
1168
1169    /// Pagination token, which can be used to request a specific page
1170    /// of `ListTransfersRequest` list results. For multiple-page
1171    /// results, `ListTransfersResponse` outputs
1172    /// a `next_page` token, which can be used as the
1173    /// `page_token` value to request the next page of list results.
1174    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1175    pub page_token: std::string::String,
1176
1177    /// Page size. The default page size is the maximum value of 1000 results.
1178    pub page_size: i32,
1179}
1180
1181impl ListTransferConfigsRequest {
1182    pub fn new() -> Self {
1183        std::default::Default::default()
1184    }
1185
1186    /// Sets the value of [parent][crate::model::ListTransferConfigsRequest::parent].
1187    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1188        self.parent = v.into();
1189        self
1190    }
1191
1192    /// Sets the value of [page_token][crate::model::ListTransferConfigsRequest::page_token].
1193    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1194        self.page_token = v.into();
1195        self
1196    }
1197
1198    /// Sets the value of [page_size][crate::model::ListTransferConfigsRequest::page_size].
1199    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1200        self.page_size = v.into();
1201        self
1202    }
1203
1204    /// Sets the value of [data_source_ids][crate::model::ListTransferConfigsRequest::data_source_ids].
1205    pub fn set_data_source_ids<T, V>(mut self, v: T) -> Self
1206    where
1207        T: std::iter::IntoIterator<Item = V>,
1208        V: std::convert::Into<std::string::String>,
1209    {
1210        use std::iter::Iterator;
1211        self.data_source_ids = v.into_iter().map(|i| i.into()).collect();
1212        self
1213    }
1214}
1215
1216impl wkt::message::Message for ListTransferConfigsRequest {
1217    fn typename() -> &'static str {
1218        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest"
1219    }
1220}
1221
1222/// The returned list of pipelines in the project.
1223#[serde_with::serde_as]
1224#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1225#[serde(default, rename_all = "camelCase")]
1226#[non_exhaustive]
1227pub struct ListTransferConfigsResponse {
1228    /// Output only. The stored pipeline transfer configurations.
1229    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1230    pub transfer_configs: std::vec::Vec<crate::model::TransferConfig>,
1231
1232    /// Output only. The next-pagination token. For multiple-page list results,
1233    /// this token can be used as the
1234    /// `ListTransferConfigsRequest.page_token`
1235    /// to request the next page of list results.
1236    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1237    pub next_page_token: std::string::String,
1238}
1239
1240impl ListTransferConfigsResponse {
1241    pub fn new() -> Self {
1242        std::default::Default::default()
1243    }
1244
1245    /// Sets the value of [next_page_token][crate::model::ListTransferConfigsResponse::next_page_token].
1246    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1247        self.next_page_token = v.into();
1248        self
1249    }
1250
1251    /// Sets the value of [transfer_configs][crate::model::ListTransferConfigsResponse::transfer_configs].
1252    pub fn set_transfer_configs<T, V>(mut self, v: T) -> Self
1253    where
1254        T: std::iter::IntoIterator<Item = V>,
1255        V: std::convert::Into<crate::model::TransferConfig>,
1256    {
1257        use std::iter::Iterator;
1258        self.transfer_configs = v.into_iter().map(|i| i.into()).collect();
1259        self
1260    }
1261}
1262
1263impl wkt::message::Message for ListTransferConfigsResponse {
1264    fn typename() -> &'static str {
1265        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse"
1266    }
1267}
1268
1269#[cfg(feature = "unstable-stream")]
1270impl gax::paginator::PageableResponse for ListTransferConfigsResponse {
1271    type PageItem = crate::model::TransferConfig;
1272
1273    fn items(self) -> std::vec::Vec<Self::PageItem> {
1274        self.transfer_configs
1275    }
1276
1277    fn next_page_token(&self) -> std::string::String {
1278        gax::paginator::extract_token(&self.next_page_token)
1279    }
1280}
1281
1282/// A request to list data transfer runs.
1283#[serde_with::serde_as]
1284#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1285#[serde(default, rename_all = "camelCase")]
1286#[non_exhaustive]
1287pub struct ListTransferRunsRequest {
1288    /// Required. Name of transfer configuration for which transfer runs should be
1289    /// retrieved. Format of transfer configuration resource name is:
1290    /// `projects/{project_id}/transferConfigs/{config_id}` or
1291    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
1292    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1293    pub parent: std::string::String,
1294
1295    /// When specified, only transfer runs with requested states are returned.
1296    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1297    pub states: std::vec::Vec<crate::model::TransferState>,
1298
1299    /// Pagination token, which can be used to request a specific page
1300    /// of `ListTransferRunsRequest` list results. For multiple-page
1301    /// results, `ListTransferRunsResponse` outputs
1302    /// a `next_page` token, which can be used as the
1303    /// `page_token` value to request the next page of list results.
1304    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1305    pub page_token: std::string::String,
1306
1307    /// Page size. The default page size is the maximum value of 1000 results.
1308    pub page_size: i32,
1309
1310    /// Indicates how run attempts are to be pulled.
1311    pub run_attempt: crate::model::list_transfer_runs_request::RunAttempt,
1312}
1313
1314impl ListTransferRunsRequest {
1315    pub fn new() -> Self {
1316        std::default::Default::default()
1317    }
1318
1319    /// Sets the value of [parent][crate::model::ListTransferRunsRequest::parent].
1320    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1321        self.parent = v.into();
1322        self
1323    }
1324
1325    /// Sets the value of [page_token][crate::model::ListTransferRunsRequest::page_token].
1326    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1327        self.page_token = v.into();
1328        self
1329    }
1330
1331    /// Sets the value of [page_size][crate::model::ListTransferRunsRequest::page_size].
1332    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1333        self.page_size = v.into();
1334        self
1335    }
1336
1337    /// Sets the value of [run_attempt][crate::model::ListTransferRunsRequest::run_attempt].
1338    pub fn set_run_attempt<
1339        T: std::convert::Into<crate::model::list_transfer_runs_request::RunAttempt>,
1340    >(
1341        mut self,
1342        v: T,
1343    ) -> Self {
1344        self.run_attempt = v.into();
1345        self
1346    }
1347
1348    /// Sets the value of [states][crate::model::ListTransferRunsRequest::states].
1349    pub fn set_states<T, V>(mut self, v: T) -> Self
1350    where
1351        T: std::iter::IntoIterator<Item = V>,
1352        V: std::convert::Into<crate::model::TransferState>,
1353    {
1354        use std::iter::Iterator;
1355        self.states = v.into_iter().map(|i| i.into()).collect();
1356        self
1357    }
1358}
1359
1360impl wkt::message::Message for ListTransferRunsRequest {
1361    fn typename() -> &'static str {
1362        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest"
1363    }
1364}
1365
1366/// Defines additional types related to ListTransferRunsRequest
1367pub mod list_transfer_runs_request {
1368    #[allow(unused_imports)]
1369    use super::*;
1370
1371    /// Represents which runs should be pulled.
1372    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1373    pub struct RunAttempt(std::borrow::Cow<'static, str>);
1374
1375    impl RunAttempt {
1376        /// Creates a new RunAttempt instance.
1377        pub const fn new(v: &'static str) -> Self {
1378            Self(std::borrow::Cow::Borrowed(v))
1379        }
1380
1381        /// Gets the enum value.
1382        pub fn value(&self) -> &str {
1383            &self.0
1384        }
1385    }
1386
1387    /// Useful constants to work with [RunAttempt](RunAttempt)
1388    pub mod run_attempt {
1389        use super::RunAttempt;
1390
1391        /// All runs should be returned.
1392        pub const RUN_ATTEMPT_UNSPECIFIED: RunAttempt = RunAttempt::new("RUN_ATTEMPT_UNSPECIFIED");
1393
1394        /// Only latest run per day should be returned.
1395        pub const LATEST: RunAttempt = RunAttempt::new("LATEST");
1396    }
1397
1398    impl std::convert::From<std::string::String> for RunAttempt {
1399        fn from(value: std::string::String) -> Self {
1400            Self(std::borrow::Cow::Owned(value))
1401        }
1402    }
1403}
1404
1405/// The returned list of pipelines in the project.
1406#[serde_with::serde_as]
1407#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1408#[serde(default, rename_all = "camelCase")]
1409#[non_exhaustive]
1410pub struct ListTransferRunsResponse {
1411    /// Output only. The stored pipeline transfer runs.
1412    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1413    pub transfer_runs: std::vec::Vec<crate::model::TransferRun>,
1414
1415    /// Output only. The next-pagination token. For multiple-page list results,
1416    /// this token can be used as the
1417    /// `ListTransferRunsRequest.page_token`
1418    /// to request the next page of list results.
1419    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1420    pub next_page_token: std::string::String,
1421}
1422
1423impl ListTransferRunsResponse {
1424    pub fn new() -> Self {
1425        std::default::Default::default()
1426    }
1427
1428    /// Sets the value of [next_page_token][crate::model::ListTransferRunsResponse::next_page_token].
1429    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1430        self.next_page_token = v.into();
1431        self
1432    }
1433
1434    /// Sets the value of [transfer_runs][crate::model::ListTransferRunsResponse::transfer_runs].
1435    pub fn set_transfer_runs<T, V>(mut self, v: T) -> Self
1436    where
1437        T: std::iter::IntoIterator<Item = V>,
1438        V: std::convert::Into<crate::model::TransferRun>,
1439    {
1440        use std::iter::Iterator;
1441        self.transfer_runs = v.into_iter().map(|i| i.into()).collect();
1442        self
1443    }
1444}
1445
1446impl wkt::message::Message for ListTransferRunsResponse {
1447    fn typename() -> &'static str {
1448        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse"
1449    }
1450}
1451
1452#[cfg(feature = "unstable-stream")]
1453impl gax::paginator::PageableResponse for ListTransferRunsResponse {
1454    type PageItem = crate::model::TransferRun;
1455
1456    fn items(self) -> std::vec::Vec<Self::PageItem> {
1457        self.transfer_runs
1458    }
1459
1460    fn next_page_token(&self) -> std::string::String {
1461        gax::paginator::extract_token(&self.next_page_token)
1462    }
1463}
1464
1465/// A request to get user facing log messages associated with data transfer run.
1466#[serde_with::serde_as]
1467#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1468#[serde(default, rename_all = "camelCase")]
1469#[non_exhaustive]
1470pub struct ListTransferLogsRequest {
1471    /// Required. Transfer run name in the form:
1472    /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
1473    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
1474    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1475    pub parent: std::string::String,
1476
1477    /// Pagination token, which can be used to request a specific page
1478    /// of `ListTransferLogsRequest` list results. For multiple-page
1479    /// results, `ListTransferLogsResponse` outputs
1480    /// a `next_page` token, which can be used as the
1481    /// `page_token` value to request the next page of list results.
1482    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1483    pub page_token: std::string::String,
1484
1485    /// Page size. The default page size is the maximum value of 1000 results.
1486    pub page_size: i32,
1487
1488    /// Message types to return. If not populated - INFO, WARNING and ERROR
1489    /// messages are returned.
1490    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1491    pub message_types: std::vec::Vec<crate::model::transfer_message::MessageSeverity>,
1492}
1493
1494impl ListTransferLogsRequest {
1495    pub fn new() -> Self {
1496        std::default::Default::default()
1497    }
1498
1499    /// Sets the value of [parent][crate::model::ListTransferLogsRequest::parent].
1500    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1501        self.parent = v.into();
1502        self
1503    }
1504
1505    /// Sets the value of [page_token][crate::model::ListTransferLogsRequest::page_token].
1506    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1507        self.page_token = v.into();
1508        self
1509    }
1510
1511    /// Sets the value of [page_size][crate::model::ListTransferLogsRequest::page_size].
1512    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1513        self.page_size = v.into();
1514        self
1515    }
1516
1517    /// Sets the value of [message_types][crate::model::ListTransferLogsRequest::message_types].
1518    pub fn set_message_types<T, V>(mut self, v: T) -> Self
1519    where
1520        T: std::iter::IntoIterator<Item = V>,
1521        V: std::convert::Into<crate::model::transfer_message::MessageSeverity>,
1522    {
1523        use std::iter::Iterator;
1524        self.message_types = v.into_iter().map(|i| i.into()).collect();
1525        self
1526    }
1527}
1528
1529impl wkt::message::Message for ListTransferLogsRequest {
1530    fn typename() -> &'static str {
1531        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest"
1532    }
1533}
1534
1535/// The returned list transfer run messages.
1536#[serde_with::serde_as]
1537#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1538#[serde(default, rename_all = "camelCase")]
1539#[non_exhaustive]
1540pub struct ListTransferLogsResponse {
1541    /// Output only. The stored pipeline transfer messages.
1542    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1543    pub transfer_messages: std::vec::Vec<crate::model::TransferMessage>,
1544
1545    /// Output only. The next-pagination token. For multiple-page list results,
1546    /// this token can be used as the
1547    /// `GetTransferRunLogRequest.page_token`
1548    /// to request the next page of list results.
1549    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1550    pub next_page_token: std::string::String,
1551}
1552
1553impl ListTransferLogsResponse {
1554    pub fn new() -> Self {
1555        std::default::Default::default()
1556    }
1557
1558    /// Sets the value of [next_page_token][crate::model::ListTransferLogsResponse::next_page_token].
1559    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1560        self.next_page_token = v.into();
1561        self
1562    }
1563
1564    /// Sets the value of [transfer_messages][crate::model::ListTransferLogsResponse::transfer_messages].
1565    pub fn set_transfer_messages<T, V>(mut self, v: T) -> Self
1566    where
1567        T: std::iter::IntoIterator<Item = V>,
1568        V: std::convert::Into<crate::model::TransferMessage>,
1569    {
1570        use std::iter::Iterator;
1571        self.transfer_messages = v.into_iter().map(|i| i.into()).collect();
1572        self
1573    }
1574}
1575
1576impl wkt::message::Message for ListTransferLogsResponse {
1577    fn typename() -> &'static str {
1578        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse"
1579    }
1580}
1581
1582#[cfg(feature = "unstable-stream")]
1583impl gax::paginator::PageableResponse for ListTransferLogsResponse {
1584    type PageItem = crate::model::TransferMessage;
1585
1586    fn items(self) -> std::vec::Vec<Self::PageItem> {
1587        self.transfer_messages
1588    }
1589
1590    fn next_page_token(&self) -> std::string::String {
1591        gax::paginator::extract_token(&self.next_page_token)
1592    }
1593}
1594
1595/// A request to determine whether the user has valid credentials. This method
1596/// is used to limit the number of OAuth popups in the user interface. The
1597/// user id is inferred from the API call context.
1598/// If the data source has the Google+ authorization type, this method
1599/// returns false, as it cannot be determined whether the credentials are
1600/// already valid merely based on the user id.
1601#[serde_with::serde_as]
1602#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1603#[serde(default, rename_all = "camelCase")]
1604#[non_exhaustive]
1605pub struct CheckValidCredsRequest {
1606    /// Required. The data source in the form:
1607    /// `projects/{project_id}/dataSources/{data_source_id}` or
1608    /// `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`.
1609    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1610    pub name: std::string::String,
1611}
1612
1613impl CheckValidCredsRequest {
1614    pub fn new() -> Self {
1615        std::default::Default::default()
1616    }
1617
1618    /// Sets the value of [name][crate::model::CheckValidCredsRequest::name].
1619    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1620        self.name = v.into();
1621        self
1622    }
1623}
1624
1625impl wkt::message::Message for CheckValidCredsRequest {
1626    fn typename() -> &'static str {
1627        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest"
1628    }
1629}
1630
1631/// A response indicating whether the credentials exist and are valid.
1632#[serde_with::serde_as]
1633#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1634#[serde(default, rename_all = "camelCase")]
1635#[non_exhaustive]
1636pub struct CheckValidCredsResponse {
1637    /// If set to `true`, the credentials exist and are valid.
1638    pub has_valid_creds: bool,
1639}
1640
1641impl CheckValidCredsResponse {
1642    pub fn new() -> Self {
1643        std::default::Default::default()
1644    }
1645
1646    /// Sets the value of [has_valid_creds][crate::model::CheckValidCredsResponse::has_valid_creds].
1647    pub fn set_has_valid_creds<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1648        self.has_valid_creds = v.into();
1649        self
1650    }
1651}
1652
1653impl wkt::message::Message for CheckValidCredsResponse {
1654    fn typename() -> &'static str {
1655        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse"
1656    }
1657}
1658
1659/// A request to schedule transfer runs for a time range.
1660#[serde_with::serde_as]
1661#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1662#[serde(default, rename_all = "camelCase")]
1663#[non_exhaustive]
1664pub struct ScheduleTransferRunsRequest {
1665    /// Required. Transfer configuration name in the form:
1666    /// `projects/{project_id}/transferConfigs/{config_id}` or
1667    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
1668    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1669    pub parent: std::string::String,
1670
1671    /// Required. Start time of the range of transfer runs. For example,
1672    /// `"2017-05-25T00:00:00+00:00"`.
1673    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1674    pub start_time: std::option::Option<wkt::Timestamp>,
1675
1676    /// Required. End time of the range of transfer runs. For example,
1677    /// `"2017-05-30T00:00:00+00:00"`.
1678    #[serde(skip_serializing_if = "std::option::Option::is_none")]
1679    pub end_time: std::option::Option<wkt::Timestamp>,
1680}
1681
1682impl ScheduleTransferRunsRequest {
1683    pub fn new() -> Self {
1684        std::default::Default::default()
1685    }
1686
1687    /// Sets the value of [parent][crate::model::ScheduleTransferRunsRequest::parent].
1688    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1689        self.parent = v.into();
1690        self
1691    }
1692
1693    /// Sets the value of [start_time][crate::model::ScheduleTransferRunsRequest::start_time].
1694    pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1695        mut self,
1696        v: T,
1697    ) -> Self {
1698        self.start_time = v.into();
1699        self
1700    }
1701
1702    /// Sets the value of [end_time][crate::model::ScheduleTransferRunsRequest::end_time].
1703    pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1704        mut self,
1705        v: T,
1706    ) -> Self {
1707        self.end_time = v.into();
1708        self
1709    }
1710}
1711
1712impl wkt::message::Message for ScheduleTransferRunsRequest {
1713    fn typename() -> &'static str {
1714        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest"
1715    }
1716}
1717
1718/// A response to schedule transfer runs for a time range.
1719#[serde_with::serde_as]
1720#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1721#[serde(default, rename_all = "camelCase")]
1722#[non_exhaustive]
1723pub struct ScheduleTransferRunsResponse {
1724    /// The transfer runs that were scheduled.
1725    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1726    pub runs: std::vec::Vec<crate::model::TransferRun>,
1727}
1728
1729impl ScheduleTransferRunsResponse {
1730    pub fn new() -> Self {
1731        std::default::Default::default()
1732    }
1733
1734    /// Sets the value of [runs][crate::model::ScheduleTransferRunsResponse::runs].
1735    pub fn set_runs<T, V>(mut self, v: T) -> Self
1736    where
1737        T: std::iter::IntoIterator<Item = V>,
1738        V: std::convert::Into<crate::model::TransferRun>,
1739    {
1740        use std::iter::Iterator;
1741        self.runs = v.into_iter().map(|i| i.into()).collect();
1742        self
1743    }
1744}
1745
1746impl wkt::message::Message for ScheduleTransferRunsResponse {
1747    fn typename() -> &'static str {
1748        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse"
1749    }
1750}
1751
1752/// A request to start manual transfer runs.
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 StartManualTransferRunsRequest {
1758    /// Required. Transfer configuration name in the form:
1759    /// `projects/{project_id}/transferConfigs/{config_id}` or
1760    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
1761    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1762    pub parent: std::string::String,
1763
1764    /// The requested time specification - this can be a time range or a specific
1765    /// run_time.
1766    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
1767    pub time: std::option::Option<crate::model::start_manual_transfer_runs_request::Time>,
1768}
1769
1770impl StartManualTransferRunsRequest {
1771    pub fn new() -> Self {
1772        std::default::Default::default()
1773    }
1774
1775    /// Sets the value of [parent][crate::model::StartManualTransferRunsRequest::parent].
1776    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1777        self.parent = v.into();
1778        self
1779    }
1780
1781    /// Sets the value of `time`.
1782    pub fn set_time<
1783        T: std::convert::Into<
1784            std::option::Option<crate::model::start_manual_transfer_runs_request::Time>,
1785        >,
1786    >(
1787        mut self,
1788        v: T,
1789    ) -> Self {
1790        self.time = v.into();
1791        self
1792    }
1793
1794    /// The value of [time][crate::model::StartManualTransferRunsRequest::time]
1795    /// if it holds a `RequestedTimeRange`, `None` if the field is not set or
1796    /// holds a different branch.
1797    pub fn get_requested_time_range(
1798        &self,
1799    ) -> std::option::Option<
1800        &std::boxed::Box<crate::model::start_manual_transfer_runs_request::TimeRange>,
1801    > {
1802        #[allow(unreachable_patterns)]
1803        self.time.as_ref().and_then(|v| match v {
1804            crate::model::start_manual_transfer_runs_request::Time::RequestedTimeRange(v) => {
1805                std::option::Option::Some(v)
1806            }
1807            _ => std::option::Option::None,
1808        })
1809    }
1810
1811    /// The value of [time][crate::model::StartManualTransferRunsRequest::time]
1812    /// if it holds a `RequestedRunTime`, `None` if the field is not set or
1813    /// holds a different branch.
1814    pub fn get_requested_run_time(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
1815        #[allow(unreachable_patterns)]
1816        self.time.as_ref().and_then(|v| match v {
1817            crate::model::start_manual_transfer_runs_request::Time::RequestedRunTime(v) => {
1818                std::option::Option::Some(v)
1819            }
1820            _ => std::option::Option::None,
1821        })
1822    }
1823
1824    /// Sets the value of [time][crate::model::StartManualTransferRunsRequest::time]
1825    /// to hold a `RequestedTimeRange`.
1826    ///
1827    /// Note that all the setters affecting `time` are
1828    /// mutually exclusive.
1829    pub fn set_requested_time_range<
1830        T: std::convert::Into<
1831            std::boxed::Box<crate::model::start_manual_transfer_runs_request::TimeRange>,
1832        >,
1833    >(
1834        mut self,
1835        v: T,
1836    ) -> Self {
1837        self.time = std::option::Option::Some(
1838            crate::model::start_manual_transfer_runs_request::Time::RequestedTimeRange(v.into()),
1839        );
1840        self
1841    }
1842
1843    /// Sets the value of [time][crate::model::StartManualTransferRunsRequest::time]
1844    /// to hold a `RequestedRunTime`.
1845    ///
1846    /// Note that all the setters affecting `time` are
1847    /// mutually exclusive.
1848    pub fn set_requested_run_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
1849        mut self,
1850        v: T,
1851    ) -> Self {
1852        self.time = std::option::Option::Some(
1853            crate::model::start_manual_transfer_runs_request::Time::RequestedRunTime(v.into()),
1854        );
1855        self
1856    }
1857}
1858
1859impl wkt::message::Message for StartManualTransferRunsRequest {
1860    fn typename() -> &'static str {
1861        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest"
1862    }
1863}
1864
1865/// Defines additional types related to StartManualTransferRunsRequest
1866pub mod start_manual_transfer_runs_request {
1867    #[allow(unused_imports)]
1868    use super::*;
1869
1870    /// A specification for a time range, this will request transfer runs with
1871    /// run_time between start_time (inclusive) and end_time (exclusive).
1872    #[serde_with::serde_as]
1873    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1874    #[serde(default, rename_all = "camelCase")]
1875    #[non_exhaustive]
1876    pub struct TimeRange {
1877        /// Start time of the range of transfer runs. For example,
1878        /// `"2017-05-25T00:00:00+00:00"`. The start_time must be strictly less than
1879        /// the end_time. Creates transfer runs where run_time is in the range
1880        /// between start_time (inclusive) and end_time (exclusive).
1881        #[serde(skip_serializing_if = "std::option::Option::is_none")]
1882        pub start_time: std::option::Option<wkt::Timestamp>,
1883
1884        /// End time of the range of transfer runs. For example,
1885        /// `"2017-05-30T00:00:00+00:00"`. The end_time must not be in the future.
1886        /// Creates transfer runs where run_time is in the range between start_time
1887        /// (inclusive) and end_time (exclusive).
1888        #[serde(skip_serializing_if = "std::option::Option::is_none")]
1889        pub end_time: std::option::Option<wkt::Timestamp>,
1890    }
1891
1892    impl TimeRange {
1893        pub fn new() -> Self {
1894            std::default::Default::default()
1895        }
1896
1897        /// Sets the value of [start_time][crate::model::start_manual_transfer_runs_request::TimeRange::start_time].
1898        pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1899            mut self,
1900            v: T,
1901        ) -> Self {
1902            self.start_time = v.into();
1903            self
1904        }
1905
1906        /// Sets the value of [end_time][crate::model::start_manual_transfer_runs_request::TimeRange::end_time].
1907        pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
1908            mut self,
1909            v: T,
1910        ) -> Self {
1911            self.end_time = v.into();
1912            self
1913        }
1914    }
1915
1916    impl wkt::message::Message for TimeRange {
1917        fn typename() -> &'static str {
1918            "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange"
1919        }
1920    }
1921
1922    /// The requested time specification - this can be a time range or a specific
1923    /// run_time.
1924    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
1925    #[serde(rename_all = "camelCase")]
1926    #[non_exhaustive]
1927    pub enum Time {
1928        /// A time_range start and end timestamp for historical data files or reports
1929        /// that are scheduled to be transferred by the scheduled transfer run.
1930        /// requested_time_range must be a past time and cannot include future time
1931        /// values.
1932        RequestedTimeRange(
1933            std::boxed::Box<crate::model::start_manual_transfer_runs_request::TimeRange>,
1934        ),
1935        /// A run_time timestamp for historical data files or reports
1936        /// that are scheduled to be transferred by the scheduled transfer run.
1937        /// requested_run_time must be a past time and cannot include future time
1938        /// values.
1939        RequestedRunTime(std::boxed::Box<wkt::Timestamp>),
1940    }
1941}
1942
1943/// A response to start manual transfer runs.
1944#[serde_with::serde_as]
1945#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1946#[serde(default, rename_all = "camelCase")]
1947#[non_exhaustive]
1948pub struct StartManualTransferRunsResponse {
1949    /// The transfer runs that were created.
1950    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1951    pub runs: std::vec::Vec<crate::model::TransferRun>,
1952}
1953
1954impl StartManualTransferRunsResponse {
1955    pub fn new() -> Self {
1956        std::default::Default::default()
1957    }
1958
1959    /// Sets the value of [runs][crate::model::StartManualTransferRunsResponse::runs].
1960    pub fn set_runs<T, V>(mut self, v: T) -> Self
1961    where
1962        T: std::iter::IntoIterator<Item = V>,
1963        V: std::convert::Into<crate::model::TransferRun>,
1964    {
1965        use std::iter::Iterator;
1966        self.runs = v.into_iter().map(|i| i.into()).collect();
1967        self
1968    }
1969}
1970
1971impl wkt::message::Message for StartManualTransferRunsResponse {
1972    fn typename() -> &'static str {
1973        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse"
1974    }
1975}
1976
1977/// A request to enroll a set of data sources so they are visible in the
1978/// BigQuery UI's `Transfer` tab.
1979#[serde_with::serde_as]
1980#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
1981#[serde(default, rename_all = "camelCase")]
1982#[non_exhaustive]
1983pub struct EnrollDataSourcesRequest {
1984    /// Required. The name of the project resource in the form:
1985    /// `projects/{project_id}`
1986    #[serde(skip_serializing_if = "std::string::String::is_empty")]
1987    pub name: std::string::String,
1988
1989    /// Data sources that are enrolled. It is required to provide at least one
1990    /// data source id.
1991    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
1992    pub data_source_ids: std::vec::Vec<std::string::String>,
1993}
1994
1995impl EnrollDataSourcesRequest {
1996    pub fn new() -> Self {
1997        std::default::Default::default()
1998    }
1999
2000    /// Sets the value of [name][crate::model::EnrollDataSourcesRequest::name].
2001    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2002        self.name = v.into();
2003        self
2004    }
2005
2006    /// Sets the value of [data_source_ids][crate::model::EnrollDataSourcesRequest::data_source_ids].
2007    pub fn set_data_source_ids<T, V>(mut self, v: T) -> Self
2008    where
2009        T: std::iter::IntoIterator<Item = V>,
2010        V: std::convert::Into<std::string::String>,
2011    {
2012        use std::iter::Iterator;
2013        self.data_source_ids = v.into_iter().map(|i| i.into()).collect();
2014        self
2015    }
2016}
2017
2018impl wkt::message::Message for EnrollDataSourcesRequest {
2019    fn typename() -> &'static str {
2020        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest"
2021    }
2022}
2023
2024/// A request to unenroll a set of data sources so they are no longer visible in
2025/// the BigQuery UI's `Transfer` tab.
2026#[serde_with::serde_as]
2027#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2028#[serde(default, rename_all = "camelCase")]
2029#[non_exhaustive]
2030pub struct UnenrollDataSourcesRequest {
2031    /// Required. The name of the project resource in the form:
2032    /// `projects/{project_id}`
2033    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2034    pub name: std::string::String,
2035
2036    /// Data sources that are unenrolled. It is required to provide at least one
2037    /// data source id.
2038    #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
2039    pub data_source_ids: std::vec::Vec<std::string::String>,
2040}
2041
2042impl UnenrollDataSourcesRequest {
2043    pub fn new() -> Self {
2044        std::default::Default::default()
2045    }
2046
2047    /// Sets the value of [name][crate::model::UnenrollDataSourcesRequest::name].
2048    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2049        self.name = v.into();
2050        self
2051    }
2052
2053    /// Sets the value of [data_source_ids][crate::model::UnenrollDataSourcesRequest::data_source_ids].
2054    pub fn set_data_source_ids<T, V>(mut self, v: T) -> Self
2055    where
2056        T: std::iter::IntoIterator<Item = V>,
2057        V: std::convert::Into<std::string::String>,
2058    {
2059        use std::iter::Iterator;
2060        self.data_source_ids = v.into_iter().map(|i| i.into()).collect();
2061        self
2062    }
2063}
2064
2065impl wkt::message::Message for UnenrollDataSourcesRequest {
2066    fn typename() -> &'static str {
2067        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.UnenrollDataSourcesRequest"
2068    }
2069}
2070
2071/// Represents preferences for sending email notifications for transfer run
2072/// events.
2073#[serde_with::serde_as]
2074#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2075#[serde(default, rename_all = "camelCase")]
2076#[non_exhaustive]
2077pub struct EmailPreferences {
2078    /// If true, email notifications will be sent on transfer run failures.
2079    pub enable_failure_email: bool,
2080}
2081
2082impl EmailPreferences {
2083    pub fn new() -> Self {
2084        std::default::Default::default()
2085    }
2086
2087    /// Sets the value of [enable_failure_email][crate::model::EmailPreferences::enable_failure_email].
2088    pub fn set_enable_failure_email<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2089        self.enable_failure_email = v.into();
2090        self
2091    }
2092}
2093
2094impl wkt::message::Message for EmailPreferences {
2095    fn typename() -> &'static str {
2096        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.EmailPreferences"
2097    }
2098}
2099
2100/// Options customizing the data transfer schedule.
2101#[serde_with::serde_as]
2102#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2103#[serde(default, rename_all = "camelCase")]
2104#[non_exhaustive]
2105pub struct ScheduleOptions {
2106    /// If true, automatic scheduling of data transfer runs for this configuration
2107    /// will be disabled. The runs can be started on ad-hoc basis using
2108    /// StartManualTransferRuns API. When automatic scheduling is disabled, the
2109    /// TransferConfig.schedule field will be ignored.
2110    pub disable_auto_scheduling: bool,
2111
2112    /// Specifies time to start scheduling transfer runs. The first run will be
2113    /// scheduled at or after the start time according to a recurrence pattern
2114    /// defined in the schedule string. The start time can be changed at any
2115    /// moment. The time when a data transfer can be triggered manually is not
2116    /// limited by this option.
2117    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2118    pub start_time: std::option::Option<wkt::Timestamp>,
2119
2120    /// Defines time to stop scheduling transfer runs. A transfer run cannot be
2121    /// scheduled at or after the end time. The end time can be changed at any
2122    /// moment. The time when a data transfer can be triggered manually is not
2123    /// limited by this option.
2124    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2125    pub end_time: std::option::Option<wkt::Timestamp>,
2126}
2127
2128impl ScheduleOptions {
2129    pub fn new() -> Self {
2130        std::default::Default::default()
2131    }
2132
2133    /// Sets the value of [disable_auto_scheduling][crate::model::ScheduleOptions::disable_auto_scheduling].
2134    pub fn set_disable_auto_scheduling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2135        self.disable_auto_scheduling = v.into();
2136        self
2137    }
2138
2139    /// Sets the value of [start_time][crate::model::ScheduleOptions::start_time].
2140    pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2141        mut self,
2142        v: T,
2143    ) -> Self {
2144        self.start_time = v.into();
2145        self
2146    }
2147
2148    /// Sets the value of [end_time][crate::model::ScheduleOptions::end_time].
2149    pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2150        mut self,
2151        v: T,
2152    ) -> Self {
2153        self.end_time = v.into();
2154        self
2155    }
2156}
2157
2158impl wkt::message::Message for ScheduleOptions {
2159    fn typename() -> &'static str {
2160        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ScheduleOptions"
2161    }
2162}
2163
2164/// V2 options customizing different types of data transfer schedule.
2165/// This field supports existing time-based and manual transfer schedule. Also
2166/// supports Event-Driven transfer schedule. ScheduleOptionsV2 cannot be used
2167/// together with ScheduleOptions/Schedule.
2168#[serde_with::serde_as]
2169#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2170#[serde(default, rename_all = "camelCase")]
2171#[non_exhaustive]
2172pub struct ScheduleOptionsV2 {
2173    /// Data transfer schedules.
2174    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
2175    pub schedule: std::option::Option<crate::model::schedule_options_v_2::Schedule>,
2176}
2177
2178impl ScheduleOptionsV2 {
2179    pub fn new() -> Self {
2180        std::default::Default::default()
2181    }
2182
2183    /// Sets the value of `schedule`.
2184    pub fn set_schedule<
2185        T: std::convert::Into<std::option::Option<crate::model::schedule_options_v_2::Schedule>>,
2186    >(
2187        mut self,
2188        v: T,
2189    ) -> Self {
2190        self.schedule = v.into();
2191        self
2192    }
2193
2194    /// The value of [schedule][crate::model::ScheduleOptionsV2::schedule]
2195    /// if it holds a `TimeBasedSchedule`, `None` if the field is not set or
2196    /// holds a different branch.
2197    pub fn get_time_based_schedule(
2198        &self,
2199    ) -> std::option::Option<&std::boxed::Box<crate::model::TimeBasedSchedule>> {
2200        #[allow(unreachable_patterns)]
2201        self.schedule.as_ref().and_then(|v| match v {
2202            crate::model::schedule_options_v_2::Schedule::TimeBasedSchedule(v) => {
2203                std::option::Option::Some(v)
2204            }
2205            _ => std::option::Option::None,
2206        })
2207    }
2208
2209    /// The value of [schedule][crate::model::ScheduleOptionsV2::schedule]
2210    /// if it holds a `ManualSchedule`, `None` if the field is not set or
2211    /// holds a different branch.
2212    pub fn get_manual_schedule(
2213        &self,
2214    ) -> std::option::Option<&std::boxed::Box<crate::model::ManualSchedule>> {
2215        #[allow(unreachable_patterns)]
2216        self.schedule.as_ref().and_then(|v| match v {
2217            crate::model::schedule_options_v_2::Schedule::ManualSchedule(v) => {
2218                std::option::Option::Some(v)
2219            }
2220            _ => std::option::Option::None,
2221        })
2222    }
2223
2224    /// The value of [schedule][crate::model::ScheduleOptionsV2::schedule]
2225    /// if it holds a `EventDrivenSchedule`, `None` if the field is not set or
2226    /// holds a different branch.
2227    pub fn get_event_driven_schedule(
2228        &self,
2229    ) -> std::option::Option<&std::boxed::Box<crate::model::EventDrivenSchedule>> {
2230        #[allow(unreachable_patterns)]
2231        self.schedule.as_ref().and_then(|v| match v {
2232            crate::model::schedule_options_v_2::Schedule::EventDrivenSchedule(v) => {
2233                std::option::Option::Some(v)
2234            }
2235            _ => std::option::Option::None,
2236        })
2237    }
2238
2239    /// Sets the value of [schedule][crate::model::ScheduleOptionsV2::schedule]
2240    /// to hold a `TimeBasedSchedule`.
2241    ///
2242    /// Note that all the setters affecting `schedule` are
2243    /// mutually exclusive.
2244    pub fn set_time_based_schedule<
2245        T: std::convert::Into<std::boxed::Box<crate::model::TimeBasedSchedule>>,
2246    >(
2247        mut self,
2248        v: T,
2249    ) -> Self {
2250        self.schedule = std::option::Option::Some(
2251            crate::model::schedule_options_v_2::Schedule::TimeBasedSchedule(v.into()),
2252        );
2253        self
2254    }
2255
2256    /// Sets the value of [schedule][crate::model::ScheduleOptionsV2::schedule]
2257    /// to hold a `ManualSchedule`.
2258    ///
2259    /// Note that all the setters affecting `schedule` are
2260    /// mutually exclusive.
2261    pub fn set_manual_schedule<
2262        T: std::convert::Into<std::boxed::Box<crate::model::ManualSchedule>>,
2263    >(
2264        mut self,
2265        v: T,
2266    ) -> Self {
2267        self.schedule = std::option::Option::Some(
2268            crate::model::schedule_options_v_2::Schedule::ManualSchedule(v.into()),
2269        );
2270        self
2271    }
2272
2273    /// Sets the value of [schedule][crate::model::ScheduleOptionsV2::schedule]
2274    /// to hold a `EventDrivenSchedule`.
2275    ///
2276    /// Note that all the setters affecting `schedule` are
2277    /// mutually exclusive.
2278    pub fn set_event_driven_schedule<
2279        T: std::convert::Into<std::boxed::Box<crate::model::EventDrivenSchedule>>,
2280    >(
2281        mut self,
2282        v: T,
2283    ) -> Self {
2284        self.schedule = std::option::Option::Some(
2285            crate::model::schedule_options_v_2::Schedule::EventDrivenSchedule(v.into()),
2286        );
2287        self
2288    }
2289}
2290
2291impl wkt::message::Message for ScheduleOptionsV2 {
2292    fn typename() -> &'static str {
2293        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ScheduleOptionsV2"
2294    }
2295}
2296
2297/// Defines additional types related to ScheduleOptionsV2
2298pub mod schedule_options_v_2 {
2299    #[allow(unused_imports)]
2300    use super::*;
2301
2302    /// Data transfer schedules.
2303    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
2304    #[serde(rename_all = "camelCase")]
2305    #[non_exhaustive]
2306    pub enum Schedule {
2307        /// Time based transfer schedule options. This is the default schedule
2308        /// option.
2309        TimeBasedSchedule(std::boxed::Box<crate::model::TimeBasedSchedule>),
2310        /// Manual transfer schedule. If set, the transfer run will not be
2311        /// auto-scheduled by the system, unless the client invokes
2312        /// StartManualTransferRuns.  This is equivalent to
2313        /// disable_auto_scheduling = true.
2314        ManualSchedule(std::boxed::Box<crate::model::ManualSchedule>),
2315        /// Event driven transfer schedule options. If set, the transfer will be
2316        /// scheduled upon events arrial.
2317        EventDrivenSchedule(std::boxed::Box<crate::model::EventDrivenSchedule>),
2318    }
2319}
2320
2321/// Options customizing the time based transfer schedule.
2322/// Options are migrated from the original ScheduleOptions message.
2323#[serde_with::serde_as]
2324#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2325#[serde(default, rename_all = "camelCase")]
2326#[non_exhaustive]
2327pub struct TimeBasedSchedule {
2328    /// Data transfer schedule.
2329    /// If the data source does not support a custom schedule, this should be
2330    /// empty. If it is empty, the default value for the data source will be used.
2331    /// The specified times are in UTC.
2332    /// Examples of valid format:
2333    /// `1st,3rd monday of month 15:30`,
2334    /// `every wed,fri of jan,jun 13:15`, and
2335    /// `first sunday of quarter 00:00`.
2336    /// See more explanation about the format here:
2337    /// <https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format>
2338    ///
2339    /// NOTE: The minimum interval time between recurring transfers depends on the
2340    /// data source; refer to the documentation for your data source.
2341    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2342    pub schedule: std::string::String,
2343
2344    /// Specifies time to start scheduling transfer runs. The first run will be
2345    /// scheduled at or after the start time according to a recurrence pattern
2346    /// defined in the schedule string. The start time can be changed at any
2347    /// moment.
2348    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2349    pub start_time: std::option::Option<wkt::Timestamp>,
2350
2351    /// Defines time to stop scheduling transfer runs. A transfer run cannot be
2352    /// scheduled at or after the end time. The end time can be changed at any
2353    /// moment.
2354    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2355    pub end_time: std::option::Option<wkt::Timestamp>,
2356}
2357
2358impl TimeBasedSchedule {
2359    pub fn new() -> Self {
2360        std::default::Default::default()
2361    }
2362
2363    /// Sets the value of [schedule][crate::model::TimeBasedSchedule::schedule].
2364    pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2365        self.schedule = v.into();
2366        self
2367    }
2368
2369    /// Sets the value of [start_time][crate::model::TimeBasedSchedule::start_time].
2370    pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2371        mut self,
2372        v: T,
2373    ) -> Self {
2374        self.start_time = v.into();
2375        self
2376    }
2377
2378    /// Sets the value of [end_time][crate::model::TimeBasedSchedule::end_time].
2379    pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2380        mut self,
2381        v: T,
2382    ) -> Self {
2383        self.end_time = v.into();
2384        self
2385    }
2386}
2387
2388impl wkt::message::Message for TimeBasedSchedule {
2389    fn typename() -> &'static str {
2390        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.TimeBasedSchedule"
2391    }
2392}
2393
2394/// Options customizing manual transfers schedule.
2395#[serde_with::serde_as]
2396#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2397#[serde(default, rename_all = "camelCase")]
2398#[non_exhaustive]
2399pub struct ManualSchedule {}
2400
2401impl ManualSchedule {
2402    pub fn new() -> Self {
2403        std::default::Default::default()
2404    }
2405}
2406
2407impl wkt::message::Message for ManualSchedule {
2408    fn typename() -> &'static str {
2409        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ManualSchedule"
2410    }
2411}
2412
2413/// Options customizing EventDriven transfers schedule.
2414#[serde_with::serde_as]
2415#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2416#[serde(default, rename_all = "camelCase")]
2417#[non_exhaustive]
2418pub struct EventDrivenSchedule {
2419    /// Pub/Sub subscription name used to receive events.
2420    /// Only Google Cloud Storage data source support this option.
2421    /// Format: projects/{project}/subscriptions/{subscription}
2422    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2423    pub pubsub_subscription: std::string::String,
2424}
2425
2426impl EventDrivenSchedule {
2427    pub fn new() -> Self {
2428        std::default::Default::default()
2429    }
2430
2431    /// Sets the value of [pubsub_subscription][crate::model::EventDrivenSchedule::pubsub_subscription].
2432    pub fn set_pubsub_subscription<T: std::convert::Into<std::string::String>>(
2433        mut self,
2434        v: T,
2435    ) -> Self {
2436        self.pubsub_subscription = v.into();
2437        self
2438    }
2439}
2440
2441impl wkt::message::Message for EventDrivenSchedule {
2442    fn typename() -> &'static str {
2443        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.EventDrivenSchedule"
2444    }
2445}
2446
2447/// Information about a user.
2448#[serde_with::serde_as]
2449#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2450#[serde(default, rename_all = "camelCase")]
2451#[non_exhaustive]
2452pub struct UserInfo {
2453    /// E-mail address of the user.
2454    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2455    pub email: std::option::Option<std::string::String>,
2456}
2457
2458impl UserInfo {
2459    pub fn new() -> Self {
2460        std::default::Default::default()
2461    }
2462
2463    /// Sets the value of [email][crate::model::UserInfo::email].
2464    pub fn set_email<T: std::convert::Into<std::option::Option<std::string::String>>>(
2465        mut self,
2466        v: T,
2467    ) -> Self {
2468        self.email = v.into();
2469        self
2470    }
2471}
2472
2473impl wkt::message::Message for UserInfo {
2474    fn typename() -> &'static str {
2475        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.UserInfo"
2476    }
2477}
2478
2479/// Represents a data transfer configuration. A transfer configuration
2480/// contains all metadata needed to perform a data transfer. For example,
2481/// `destination_dataset_id` specifies where data should be stored.
2482/// When a new transfer configuration is created, the specified
2483/// `destination_dataset_id` is created when needed and shared with the
2484/// appropriate data source service account.
2485#[serde_with::serde_as]
2486#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2487#[serde(default, rename_all = "camelCase")]
2488#[non_exhaustive]
2489pub struct TransferConfig {
2490    /// Identifier. The resource name of the transfer config.
2491    /// Transfer config names have the form either
2492    /// `projects/{project_id}/locations/{region}/transferConfigs/{config_id}` or
2493    /// `projects/{project_id}/transferConfigs/{config_id}`,
2494    /// where `config_id` is usually a UUID, even though it is not
2495    /// guaranteed or required. The name is ignored when creating a transfer
2496    /// config.
2497    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2498    pub name: std::string::String,
2499
2500    /// User specified display name for the data transfer.
2501    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2502    pub display_name: std::string::String,
2503
2504    /// Data source ID. This cannot be changed once data transfer is created. The
2505    /// full list of available data source IDs can be returned through an API call:
2506    /// <https://cloud.google.com/bigquery-transfer/docs/reference/datatransfer/rest/v1/projects.locations.dataSources/list>
2507    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2508    pub data_source_id: std::string::String,
2509
2510    /// Parameters specific to each data source. For more information see the
2511    /// bq tab in the 'Setting up a data transfer' section for each data source.
2512    /// For example the parameters for Cloud Storage transfers are listed here:
2513    /// <https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq>
2514    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2515    pub params: std::option::Option<wkt::Struct>,
2516
2517    /// Data transfer schedule.
2518    /// If the data source does not support a custom schedule, this should be
2519    /// empty. If it is empty, the default value for the data source will be used.
2520    /// The specified times are in UTC.
2521    /// Examples of valid format:
2522    /// `1st,3rd monday of month 15:30`,
2523    /// `every wed,fri of jan,jun 13:15`, and
2524    /// `first sunday of quarter 00:00`.
2525    /// See more explanation about the format here:
2526    /// <https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format>
2527    ///
2528    /// NOTE: The minimum interval time between recurring transfers depends on the
2529    /// data source; refer to the documentation for your data source.
2530    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2531    pub schedule: std::string::String,
2532
2533    /// Options customizing the data transfer schedule.
2534    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2535    pub schedule_options: std::option::Option<crate::model::ScheduleOptions>,
2536
2537    /// Options customizing different types of data transfer schedule.
2538    /// This field replaces "schedule" and "schedule_options" fields.
2539    /// ScheduleOptionsV2 cannot be used together with ScheduleOptions/Schedule.
2540    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2541    pub schedule_options_v2: std::option::Option<crate::model::ScheduleOptionsV2>,
2542
2543    /// The number of days to look back to automatically refresh the data.
2544    /// For example, if `data_refresh_window_days = 10`, then every day
2545    /// BigQuery reingests data for [today-10, today-1], rather than ingesting data
2546    /// for just [today-1].
2547    /// Only valid if the data source supports the feature. Set the value to 0
2548    /// to use the default value.
2549    pub data_refresh_window_days: i32,
2550
2551    /// Is this config disabled. When set to true, no runs will be scheduled for
2552    /// this transfer config.
2553    pub disabled: bool,
2554
2555    /// Output only. Data transfer modification time. Ignored by server on input.
2556    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2557    pub update_time: std::option::Option<wkt::Timestamp>,
2558
2559    /// Output only. Next time when data transfer will run.
2560    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2561    pub next_run_time: std::option::Option<wkt::Timestamp>,
2562
2563    /// Output only. State of the most recently updated transfer run.
2564    pub state: crate::model::TransferState,
2565
2566    /// Deprecated. Unique ID of the user on whose behalf transfer is done.
2567    #[serde_as(as = "serde_with::DisplayFromStr")]
2568    pub user_id: i64,
2569
2570    /// Output only. Region in which BigQuery dataset is located.
2571    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2572    pub dataset_region: std::string::String,
2573
2574    /// Pub/Sub topic where notifications will be sent after transfer runs
2575    /// associated with this transfer config finish.
2576    ///
2577    /// The format for specifying a pubsub topic is:
2578    /// `projects/{project_id}/topics/{topic_id}`
2579    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2580    pub notification_pubsub_topic: std::string::String,
2581
2582    /// Email notifications will be sent according to these preferences
2583    /// to the email address of the user who owns this transfer config.
2584    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2585    pub email_preferences: std::option::Option<crate::model::EmailPreferences>,
2586
2587    /// Output only. Information about the user whose credentials are used to
2588    /// transfer data. Populated only for `transferConfigs.get` requests. In case
2589    /// the user information is not available, this field will not be populated.
2590    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2591    pub owner_info: std::option::Option<crate::model::UserInfo>,
2592
2593    /// The encryption configuration part. Currently, it is only used for the
2594    /// optional KMS key name. The BigQuery service account of your project must be
2595    /// granted permissions to use the key. Read methods will return the key name
2596    /// applied in effect. Write methods will apply the key if it is present, or
2597    /// otherwise try to apply project default keys if it is absent.
2598    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2599    pub encryption_configuration: std::option::Option<crate::model::EncryptionConfiguration>,
2600
2601    /// Output only. Error code with detailed information about reason of the
2602    /// latest config failure.
2603    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2604    pub error: std::option::Option<rpc::model::Status>,
2605
2606    /// The desination of the transfer config.
2607    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
2608    pub destination: std::option::Option<crate::model::transfer_config::Destination>,
2609}
2610
2611impl TransferConfig {
2612    pub fn new() -> Self {
2613        std::default::Default::default()
2614    }
2615
2616    /// Sets the value of [name][crate::model::TransferConfig::name].
2617    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2618        self.name = v.into();
2619        self
2620    }
2621
2622    /// Sets the value of [display_name][crate::model::TransferConfig::display_name].
2623    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2624        self.display_name = v.into();
2625        self
2626    }
2627
2628    /// Sets the value of [data_source_id][crate::model::TransferConfig::data_source_id].
2629    pub fn set_data_source_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2630        self.data_source_id = v.into();
2631        self
2632    }
2633
2634    /// Sets the value of [params][crate::model::TransferConfig::params].
2635    pub fn set_params<T: std::convert::Into<std::option::Option<wkt::Struct>>>(
2636        mut self,
2637        v: T,
2638    ) -> Self {
2639        self.params = v.into();
2640        self
2641    }
2642
2643    /// Sets the value of [schedule][crate::model::TransferConfig::schedule].
2644    pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2645        self.schedule = v.into();
2646        self
2647    }
2648
2649    /// Sets the value of [schedule_options][crate::model::TransferConfig::schedule_options].
2650    pub fn set_schedule_options<
2651        T: std::convert::Into<std::option::Option<crate::model::ScheduleOptions>>,
2652    >(
2653        mut self,
2654        v: T,
2655    ) -> Self {
2656        self.schedule_options = v.into();
2657        self
2658    }
2659
2660    /// Sets the value of [schedule_options_v2][crate::model::TransferConfig::schedule_options_v2].
2661    pub fn set_schedule_options_v2<
2662        T: std::convert::Into<std::option::Option<crate::model::ScheduleOptionsV2>>,
2663    >(
2664        mut self,
2665        v: T,
2666    ) -> Self {
2667        self.schedule_options_v2 = v.into();
2668        self
2669    }
2670
2671    /// Sets the value of [data_refresh_window_days][crate::model::TransferConfig::data_refresh_window_days].
2672    pub fn set_data_refresh_window_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2673        self.data_refresh_window_days = v.into();
2674        self
2675    }
2676
2677    /// Sets the value of [disabled][crate::model::TransferConfig::disabled].
2678    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2679        self.disabled = v.into();
2680        self
2681    }
2682
2683    /// Sets the value of [update_time][crate::model::TransferConfig::update_time].
2684    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2685        mut self,
2686        v: T,
2687    ) -> Self {
2688        self.update_time = v.into();
2689        self
2690    }
2691
2692    /// Sets the value of [next_run_time][crate::model::TransferConfig::next_run_time].
2693    pub fn set_next_run_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2694        mut self,
2695        v: T,
2696    ) -> Self {
2697        self.next_run_time = v.into();
2698        self
2699    }
2700
2701    /// Sets the value of [state][crate::model::TransferConfig::state].
2702    pub fn set_state<T: std::convert::Into<crate::model::TransferState>>(mut self, v: T) -> Self {
2703        self.state = v.into();
2704        self
2705    }
2706
2707    /// Sets the value of [user_id][crate::model::TransferConfig::user_id].
2708    pub fn set_user_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2709        self.user_id = v.into();
2710        self
2711    }
2712
2713    /// Sets the value of [dataset_region][crate::model::TransferConfig::dataset_region].
2714    pub fn set_dataset_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2715        self.dataset_region = v.into();
2716        self
2717    }
2718
2719    /// Sets the value of [notification_pubsub_topic][crate::model::TransferConfig::notification_pubsub_topic].
2720    pub fn set_notification_pubsub_topic<T: std::convert::Into<std::string::String>>(
2721        mut self,
2722        v: T,
2723    ) -> Self {
2724        self.notification_pubsub_topic = v.into();
2725        self
2726    }
2727
2728    /// Sets the value of [email_preferences][crate::model::TransferConfig::email_preferences].
2729    pub fn set_email_preferences<
2730        T: std::convert::Into<std::option::Option<crate::model::EmailPreferences>>,
2731    >(
2732        mut self,
2733        v: T,
2734    ) -> Self {
2735        self.email_preferences = v.into();
2736        self
2737    }
2738
2739    /// Sets the value of [owner_info][crate::model::TransferConfig::owner_info].
2740    pub fn set_owner_info<T: std::convert::Into<std::option::Option<crate::model::UserInfo>>>(
2741        mut self,
2742        v: T,
2743    ) -> Self {
2744        self.owner_info = v.into();
2745        self
2746    }
2747
2748    /// Sets the value of [encryption_configuration][crate::model::TransferConfig::encryption_configuration].
2749    pub fn set_encryption_configuration<
2750        T: std::convert::Into<std::option::Option<crate::model::EncryptionConfiguration>>,
2751    >(
2752        mut self,
2753        v: T,
2754    ) -> Self {
2755        self.encryption_configuration = v.into();
2756        self
2757    }
2758
2759    /// Sets the value of [error][crate::model::TransferConfig::error].
2760    pub fn set_error<T: std::convert::Into<std::option::Option<rpc::model::Status>>>(
2761        mut self,
2762        v: T,
2763    ) -> Self {
2764        self.error = v.into();
2765        self
2766    }
2767
2768    /// Sets the value of `destination`.
2769    pub fn set_destination<
2770        T: std::convert::Into<std::option::Option<crate::model::transfer_config::Destination>>,
2771    >(
2772        mut self,
2773        v: T,
2774    ) -> Self {
2775        self.destination = v.into();
2776        self
2777    }
2778
2779    /// The value of [destination][crate::model::TransferConfig::destination]
2780    /// if it holds a `DestinationDatasetId`, `None` if the field is not set or
2781    /// holds a different branch.
2782    pub fn get_destination_dataset_id(&self) -> std::option::Option<&std::string::String> {
2783        #[allow(unreachable_patterns)]
2784        self.destination.as_ref().and_then(|v| match v {
2785            crate::model::transfer_config::Destination::DestinationDatasetId(v) => {
2786                std::option::Option::Some(v)
2787            }
2788            _ => std::option::Option::None,
2789        })
2790    }
2791
2792    /// Sets the value of [destination][crate::model::TransferConfig::destination]
2793    /// to hold a `DestinationDatasetId`.
2794    ///
2795    /// Note that all the setters affecting `destination` are
2796    /// mutually exclusive.
2797    pub fn set_destination_dataset_id<T: std::convert::Into<std::string::String>>(
2798        mut self,
2799        v: T,
2800    ) -> Self {
2801        self.destination = std::option::Option::Some(
2802            crate::model::transfer_config::Destination::DestinationDatasetId(v.into()),
2803        );
2804        self
2805    }
2806}
2807
2808impl wkt::message::Message for TransferConfig {
2809    fn typename() -> &'static str {
2810        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.TransferConfig"
2811    }
2812}
2813
2814/// Defines additional types related to TransferConfig
2815pub mod transfer_config {
2816    #[allow(unused_imports)]
2817    use super::*;
2818
2819    /// The desination of the transfer config.
2820    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
2821    #[serde(rename_all = "camelCase")]
2822    #[non_exhaustive]
2823    pub enum Destination {
2824        /// The BigQuery target dataset id.
2825        DestinationDatasetId(std::string::String),
2826    }
2827}
2828
2829/// Represents the encryption configuration for a transfer.
2830#[serde_with::serde_as]
2831#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2832#[serde(default, rename_all = "camelCase")]
2833#[non_exhaustive]
2834pub struct EncryptionConfiguration {
2835    /// The name of the KMS key used for encrypting BigQuery data.
2836    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2837    pub kms_key_name: std::option::Option<wkt::StringValue>,
2838}
2839
2840impl EncryptionConfiguration {
2841    pub fn new() -> Self {
2842        std::default::Default::default()
2843    }
2844
2845    /// Sets the value of [kms_key_name][crate::model::EncryptionConfiguration::kms_key_name].
2846    pub fn set_kms_key_name<T: std::convert::Into<std::option::Option<wkt::StringValue>>>(
2847        mut self,
2848        v: T,
2849    ) -> Self {
2850        self.kms_key_name = v.into();
2851        self
2852    }
2853}
2854
2855impl wkt::message::Message for EncryptionConfiguration {
2856    fn typename() -> &'static str {
2857        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.EncryptionConfiguration"
2858    }
2859}
2860
2861/// Represents a data transfer run.
2862#[serde_with::serde_as]
2863#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
2864#[serde(default, rename_all = "camelCase")]
2865#[non_exhaustive]
2866pub struct TransferRun {
2867    /// Identifier. The resource name of the transfer run.
2868    /// Transfer run names have the form
2869    /// `projects/{project_id}/locations/{location}/transferConfigs/{config_id}/runs/{run_id}`.
2870    /// The name is ignored when creating a transfer run.
2871    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2872    pub name: std::string::String,
2873
2874    /// Minimum time after which a transfer run can be started.
2875    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2876    pub schedule_time: std::option::Option<wkt::Timestamp>,
2877
2878    /// For batch transfer runs, specifies the date and time of the data should be
2879    /// ingested.
2880    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2881    pub run_time: std::option::Option<wkt::Timestamp>,
2882
2883    /// Status of the transfer run.
2884    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2885    pub error_status: std::option::Option<rpc::model::Status>,
2886
2887    /// Output only. Time when transfer run was started.
2888    /// Parameter ignored by server for input requests.
2889    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2890    pub start_time: std::option::Option<wkt::Timestamp>,
2891
2892    /// Output only. Time when transfer run ended.
2893    /// Parameter ignored by server for input requests.
2894    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2895    pub end_time: std::option::Option<wkt::Timestamp>,
2896
2897    /// Output only. Last time the data transfer run state was updated.
2898    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2899    pub update_time: std::option::Option<wkt::Timestamp>,
2900
2901    /// Output only. Parameters specific to each data source. For more information
2902    /// see the bq tab in the 'Setting up a data transfer' section for each data
2903    /// source. For example the parameters for Cloud Storage transfers are listed
2904    /// here:
2905    /// <https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq>
2906    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2907    pub params: std::option::Option<wkt::Struct>,
2908
2909    /// Output only. Data source id.
2910    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2911    pub data_source_id: std::string::String,
2912
2913    /// Data transfer run state. Ignored for input requests.
2914    pub state: crate::model::TransferState,
2915
2916    /// Deprecated. Unique ID of the user on whose behalf transfer is done.
2917    #[serde_as(as = "serde_with::DisplayFromStr")]
2918    pub user_id: i64,
2919
2920    /// Output only. Describes the schedule of this transfer run if it was
2921    /// created as part of a regular schedule. For batch transfer runs that are
2922    /// scheduled manually, this is empty.
2923    /// NOTE: the system might choose to delay the schedule depending on the
2924    /// current load, so `schedule_time` doesn't always match this.
2925    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2926    pub schedule: std::string::String,
2927
2928    /// Output only. Pub/Sub topic where a notification will be sent after this
2929    /// transfer run finishes.
2930    ///
2931    /// The format for specifying a pubsub topic is:
2932    /// `projects/{project_id}/topics/{topic_id}`
2933    #[serde(skip_serializing_if = "std::string::String::is_empty")]
2934    pub notification_pubsub_topic: std::string::String,
2935
2936    /// Output only. Email notifications will be sent according to these
2937    /// preferences to the email address of the user who owns the transfer config
2938    /// this run was derived from.
2939    #[serde(skip_serializing_if = "std::option::Option::is_none")]
2940    pub email_preferences: std::option::Option<crate::model::EmailPreferences>,
2941
2942    /// Data transfer destination.
2943    #[serde(flatten, skip_serializing_if = "std::option::Option::is_none")]
2944    pub destination: std::option::Option<crate::model::transfer_run::Destination>,
2945}
2946
2947impl TransferRun {
2948    pub fn new() -> Self {
2949        std::default::Default::default()
2950    }
2951
2952    /// Sets the value of [name][crate::model::TransferRun::name].
2953    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2954        self.name = v.into();
2955        self
2956    }
2957
2958    /// Sets the value of [schedule_time][crate::model::TransferRun::schedule_time].
2959    pub fn set_schedule_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2960        mut self,
2961        v: T,
2962    ) -> Self {
2963        self.schedule_time = v.into();
2964        self
2965    }
2966
2967    /// Sets the value of [run_time][crate::model::TransferRun::run_time].
2968    pub fn set_run_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2969        mut self,
2970        v: T,
2971    ) -> Self {
2972        self.run_time = v.into();
2973        self
2974    }
2975
2976    /// Sets the value of [error_status][crate::model::TransferRun::error_status].
2977    pub fn set_error_status<T: std::convert::Into<std::option::Option<rpc::model::Status>>>(
2978        mut self,
2979        v: T,
2980    ) -> Self {
2981        self.error_status = v.into();
2982        self
2983    }
2984
2985    /// Sets the value of [start_time][crate::model::TransferRun::start_time].
2986    pub fn set_start_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2987        mut self,
2988        v: T,
2989    ) -> Self {
2990        self.start_time = v.into();
2991        self
2992    }
2993
2994    /// Sets the value of [end_time][crate::model::TransferRun::end_time].
2995    pub fn set_end_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
2996        mut self,
2997        v: T,
2998    ) -> Self {
2999        self.end_time = v.into();
3000        self
3001    }
3002
3003    /// Sets the value of [update_time][crate::model::TransferRun::update_time].
3004    pub fn set_update_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3005        mut self,
3006        v: T,
3007    ) -> Self {
3008        self.update_time = v.into();
3009        self
3010    }
3011
3012    /// Sets the value of [params][crate::model::TransferRun::params].
3013    pub fn set_params<T: std::convert::Into<std::option::Option<wkt::Struct>>>(
3014        mut self,
3015        v: T,
3016    ) -> Self {
3017        self.params = v.into();
3018        self
3019    }
3020
3021    /// Sets the value of [data_source_id][crate::model::TransferRun::data_source_id].
3022    pub fn set_data_source_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3023        self.data_source_id = v.into();
3024        self
3025    }
3026
3027    /// Sets the value of [state][crate::model::TransferRun::state].
3028    pub fn set_state<T: std::convert::Into<crate::model::TransferState>>(mut self, v: T) -> Self {
3029        self.state = v.into();
3030        self
3031    }
3032
3033    /// Sets the value of [user_id][crate::model::TransferRun::user_id].
3034    pub fn set_user_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3035        self.user_id = v.into();
3036        self
3037    }
3038
3039    /// Sets the value of [schedule][crate::model::TransferRun::schedule].
3040    pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3041        self.schedule = v.into();
3042        self
3043    }
3044
3045    /// Sets the value of [notification_pubsub_topic][crate::model::TransferRun::notification_pubsub_topic].
3046    pub fn set_notification_pubsub_topic<T: std::convert::Into<std::string::String>>(
3047        mut self,
3048        v: T,
3049    ) -> Self {
3050        self.notification_pubsub_topic = v.into();
3051        self
3052    }
3053
3054    /// Sets the value of [email_preferences][crate::model::TransferRun::email_preferences].
3055    pub fn set_email_preferences<
3056        T: std::convert::Into<std::option::Option<crate::model::EmailPreferences>>,
3057    >(
3058        mut self,
3059        v: T,
3060    ) -> Self {
3061        self.email_preferences = v.into();
3062        self
3063    }
3064
3065    /// Sets the value of `destination`.
3066    pub fn set_destination<
3067        T: std::convert::Into<std::option::Option<crate::model::transfer_run::Destination>>,
3068    >(
3069        mut self,
3070        v: T,
3071    ) -> Self {
3072        self.destination = v.into();
3073        self
3074    }
3075
3076    /// The value of [destination][crate::model::TransferRun::destination]
3077    /// if it holds a `DestinationDatasetId`, `None` if the field is not set or
3078    /// holds a different branch.
3079    pub fn get_destination_dataset_id(&self) -> std::option::Option<&std::string::String> {
3080        #[allow(unreachable_patterns)]
3081        self.destination.as_ref().and_then(|v| match v {
3082            crate::model::transfer_run::Destination::DestinationDatasetId(v) => {
3083                std::option::Option::Some(v)
3084            }
3085            _ => std::option::Option::None,
3086        })
3087    }
3088
3089    /// Sets the value of [destination][crate::model::TransferRun::destination]
3090    /// to hold a `DestinationDatasetId`.
3091    ///
3092    /// Note that all the setters affecting `destination` are
3093    /// mutually exclusive.
3094    pub fn set_destination_dataset_id<T: std::convert::Into<std::string::String>>(
3095        mut self,
3096        v: T,
3097    ) -> Self {
3098        self.destination = std::option::Option::Some(
3099            crate::model::transfer_run::Destination::DestinationDatasetId(v.into()),
3100        );
3101        self
3102    }
3103}
3104
3105impl wkt::message::Message for TransferRun {
3106    fn typename() -> &'static str {
3107        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.TransferRun"
3108    }
3109}
3110
3111/// Defines additional types related to TransferRun
3112pub mod transfer_run {
3113    #[allow(unused_imports)]
3114    use super::*;
3115
3116    /// Data transfer destination.
3117    #[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
3118    #[serde(rename_all = "camelCase")]
3119    #[non_exhaustive]
3120    pub enum Destination {
3121        /// Output only. The BigQuery target dataset id.
3122        DestinationDatasetId(std::string::String),
3123    }
3124}
3125
3126/// Represents a user facing message for a particular data transfer run.
3127#[serde_with::serde_as]
3128#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3129#[serde(default, rename_all = "camelCase")]
3130#[non_exhaustive]
3131pub struct TransferMessage {
3132    /// Time when message was logged.
3133    #[serde(skip_serializing_if = "std::option::Option::is_none")]
3134    pub message_time: std::option::Option<wkt::Timestamp>,
3135
3136    /// Message severity.
3137    pub severity: crate::model::transfer_message::MessageSeverity,
3138
3139    /// Message text.
3140    #[serde(skip_serializing_if = "std::string::String::is_empty")]
3141    pub message_text: std::string::String,
3142}
3143
3144impl TransferMessage {
3145    pub fn new() -> Self {
3146        std::default::Default::default()
3147    }
3148
3149    /// Sets the value of [message_time][crate::model::TransferMessage::message_time].
3150    pub fn set_message_time<T: std::convert::Into<std::option::Option<wkt::Timestamp>>>(
3151        mut self,
3152        v: T,
3153    ) -> Self {
3154        self.message_time = v.into();
3155        self
3156    }
3157
3158    /// Sets the value of [severity][crate::model::TransferMessage::severity].
3159    pub fn set_severity<T: std::convert::Into<crate::model::transfer_message::MessageSeverity>>(
3160        mut self,
3161        v: T,
3162    ) -> Self {
3163        self.severity = v.into();
3164        self
3165    }
3166
3167    /// Sets the value of [message_text][crate::model::TransferMessage::message_text].
3168    pub fn set_message_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3169        self.message_text = v.into();
3170        self
3171    }
3172}
3173
3174impl wkt::message::Message for TransferMessage {
3175    fn typename() -> &'static str {
3176        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.TransferMessage"
3177    }
3178}
3179
3180/// Defines additional types related to TransferMessage
3181pub mod transfer_message {
3182    #[allow(unused_imports)]
3183    use super::*;
3184
3185    /// Represents data transfer user facing message severity.
3186    #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3187    pub struct MessageSeverity(std::borrow::Cow<'static, str>);
3188
3189    impl MessageSeverity {
3190        /// Creates a new MessageSeverity instance.
3191        pub const fn new(v: &'static str) -> Self {
3192            Self(std::borrow::Cow::Borrowed(v))
3193        }
3194
3195        /// Gets the enum value.
3196        pub fn value(&self) -> &str {
3197            &self.0
3198        }
3199    }
3200
3201    /// Useful constants to work with [MessageSeverity](MessageSeverity)
3202    pub mod message_severity {
3203        use super::MessageSeverity;
3204
3205        /// No severity specified.
3206        pub const MESSAGE_SEVERITY_UNSPECIFIED: MessageSeverity =
3207            MessageSeverity::new("MESSAGE_SEVERITY_UNSPECIFIED");
3208
3209        /// Informational message.
3210        pub const INFO: MessageSeverity = MessageSeverity::new("INFO");
3211
3212        /// Warning message.
3213        pub const WARNING: MessageSeverity = MessageSeverity::new("WARNING");
3214
3215        /// Error message.
3216        pub const ERROR: MessageSeverity = MessageSeverity::new("ERROR");
3217    }
3218
3219    impl std::convert::From<std::string::String> for MessageSeverity {
3220        fn from(value: std::string::String) -> Self {
3221            Self(std::borrow::Cow::Owned(value))
3222        }
3223    }
3224}
3225
3226/// DEPRECATED. Represents data transfer type.
3227#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3228pub struct TransferType(std::borrow::Cow<'static, str>);
3229
3230impl TransferType {
3231    /// Creates a new TransferType instance.
3232    pub const fn new(v: &'static str) -> Self {
3233        Self(std::borrow::Cow::Borrowed(v))
3234    }
3235
3236    /// Gets the enum value.
3237    pub fn value(&self) -> &str {
3238        &self.0
3239    }
3240}
3241
3242/// Useful constants to work with [TransferType](TransferType)
3243pub mod transfer_type {
3244    use super::TransferType;
3245
3246    /// Invalid or Unknown transfer type placeholder.
3247    pub const TRANSFER_TYPE_UNSPECIFIED: TransferType =
3248        TransferType::new("TRANSFER_TYPE_UNSPECIFIED");
3249
3250    /// Batch data transfer.
3251    pub const BATCH: TransferType = TransferType::new("BATCH");
3252
3253    /// Streaming data transfer. Streaming data source currently doesn't
3254    /// support multiple transfer configs per project.
3255    pub const STREAMING: TransferType = TransferType::new("STREAMING");
3256}
3257
3258impl std::convert::From<std::string::String> for TransferType {
3259    fn from(value: std::string::String) -> Self {
3260        Self(std::borrow::Cow::Owned(value))
3261    }
3262}
3263
3264/// Represents data transfer run state.
3265#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
3266pub struct TransferState(std::borrow::Cow<'static, str>);
3267
3268impl TransferState {
3269    /// Creates a new TransferState instance.
3270    pub const fn new(v: &'static str) -> Self {
3271        Self(std::borrow::Cow::Borrowed(v))
3272    }
3273
3274    /// Gets the enum value.
3275    pub fn value(&self) -> &str {
3276        &self.0
3277    }
3278}
3279
3280/// Useful constants to work with [TransferState](TransferState)
3281pub mod transfer_state {
3282    use super::TransferState;
3283
3284    /// State placeholder (0).
3285    pub const TRANSFER_STATE_UNSPECIFIED: TransferState =
3286        TransferState::new("TRANSFER_STATE_UNSPECIFIED");
3287
3288    /// Data transfer is scheduled and is waiting to be picked up by
3289    /// data transfer backend (2).
3290    pub const PENDING: TransferState = TransferState::new("PENDING");
3291
3292    /// Data transfer is in progress (3).
3293    pub const RUNNING: TransferState = TransferState::new("RUNNING");
3294
3295    /// Data transfer completed successfully (4).
3296    pub const SUCCEEDED: TransferState = TransferState::new("SUCCEEDED");
3297
3298    /// Data transfer failed (5).
3299    pub const FAILED: TransferState = TransferState::new("FAILED");
3300
3301    /// Data transfer is cancelled (6).
3302    pub const CANCELLED: TransferState = TransferState::new("CANCELLED");
3303}
3304
3305impl std::convert::From<std::string::String> for TransferState {
3306    fn from(value: std::string::String) -> Self {
3307        Self(std::borrow::Cow::Owned(value))
3308    }
3309}