google_cloud_bigquery_datatransfer_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate location;
26extern crate reqwest;
27extern crate rpc;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35/// A parameter used to define custom fields in a data source definition.
36#[derive(Clone, Default, PartialEq)]
37#[non_exhaustive]
38pub struct DataSourceParameter {
39    /// Parameter identifier.
40    pub param_id: std::string::String,
41
42    /// Parameter display name in the user interface.
43    pub display_name: std::string::String,
44
45    /// Parameter description.
46    pub description: std::string::String,
47
48    /// Parameter type.
49    pub r#type: crate::model::data_source_parameter::Type,
50
51    /// Is parameter required.
52    pub required: bool,
53
54    /// Deprecated. This field has no effect.
55    pub repeated: bool,
56
57    /// Regular expression which can be used for parameter validation.
58    pub validation_regex: std::string::String,
59
60    /// All possible values for the parameter.
61    pub allowed_values: std::vec::Vec<std::string::String>,
62
63    /// For integer and double values specifies minimum allowed value.
64    pub min_value: std::option::Option<wkt::DoubleValue>,
65
66    /// For integer and double values specifies maximum allowed value.
67    pub max_value: std::option::Option<wkt::DoubleValue>,
68
69    /// Deprecated. This field has no effect.
70    pub fields: std::vec::Vec<crate::model::DataSourceParameter>,
71
72    /// Description of the requirements for this field, in case the user input does
73    /// not fulfill the regex pattern or min/max values.
74    pub validation_description: std::string::String,
75
76    /// URL to a help document to further explain the naming requirements.
77    pub validation_help_url: std::string::String,
78
79    /// Cannot be changed after initial creation.
80    pub immutable: bool,
81
82    /// Deprecated. This field has no effect.
83    pub recurse: bool,
84
85    /// If true, it should not be used in new transfers, and it should not be
86    /// visible to users.
87    pub deprecated: bool,
88
89    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
90}
91
92impl DataSourceParameter {
93    pub fn new() -> Self {
94        std::default::Default::default()
95    }
96
97    /// Sets the value of [param_id][crate::model::DataSourceParameter::param_id].
98    pub fn set_param_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
99        self.param_id = v.into();
100        self
101    }
102
103    /// Sets the value of [display_name][crate::model::DataSourceParameter::display_name].
104    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
105        self.display_name = v.into();
106        self
107    }
108
109    /// Sets the value of [description][crate::model::DataSourceParameter::description].
110    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
111        self.description = v.into();
112        self
113    }
114
115    /// Sets the value of [r#type][crate::model::DataSourceParameter::type].
116    pub fn set_type<T: std::convert::Into<crate::model::data_source_parameter::Type>>(
117        mut self,
118        v: T,
119    ) -> Self {
120        self.r#type = v.into();
121        self
122    }
123
124    /// Sets the value of [required][crate::model::DataSourceParameter::required].
125    pub fn set_required<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
126        self.required = v.into();
127        self
128    }
129
130    /// Sets the value of [repeated][crate::model::DataSourceParameter::repeated].
131    pub fn set_repeated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
132        self.repeated = v.into();
133        self
134    }
135
136    /// Sets the value of [validation_regex][crate::model::DataSourceParameter::validation_regex].
137    pub fn set_validation_regex<T: std::convert::Into<std::string::String>>(
138        mut self,
139        v: T,
140    ) -> Self {
141        self.validation_regex = v.into();
142        self
143    }
144
145    /// Sets the value of [allowed_values][crate::model::DataSourceParameter::allowed_values].
146    pub fn set_allowed_values<T, V>(mut self, v: T) -> Self
147    where
148        T: std::iter::IntoIterator<Item = V>,
149        V: std::convert::Into<std::string::String>,
150    {
151        use std::iter::Iterator;
152        self.allowed_values = v.into_iter().map(|i| i.into()).collect();
153        self
154    }
155
156    /// Sets the value of [min_value][crate::model::DataSourceParameter::min_value].
157    pub fn set_min_value<T>(mut self, v: T) -> Self
158    where
159        T: std::convert::Into<wkt::DoubleValue>,
160    {
161        self.min_value = std::option::Option::Some(v.into());
162        self
163    }
164
165    /// Sets or clears the value of [min_value][crate::model::DataSourceParameter::min_value].
166    pub fn set_or_clear_min_value<T>(mut self, v: std::option::Option<T>) -> Self
167    where
168        T: std::convert::Into<wkt::DoubleValue>,
169    {
170        self.min_value = v.map(|x| x.into());
171        self
172    }
173
174    /// Sets the value of [max_value][crate::model::DataSourceParameter::max_value].
175    pub fn set_max_value<T>(mut self, v: T) -> Self
176    where
177        T: std::convert::Into<wkt::DoubleValue>,
178    {
179        self.max_value = std::option::Option::Some(v.into());
180        self
181    }
182
183    /// Sets or clears the value of [max_value][crate::model::DataSourceParameter::max_value].
184    pub fn set_or_clear_max_value<T>(mut self, v: std::option::Option<T>) -> Self
185    where
186        T: std::convert::Into<wkt::DoubleValue>,
187    {
188        self.max_value = v.map(|x| x.into());
189        self
190    }
191
192    /// Sets the value of [fields][crate::model::DataSourceParameter::fields].
193    pub fn set_fields<T, V>(mut self, v: T) -> Self
194    where
195        T: std::iter::IntoIterator<Item = V>,
196        V: std::convert::Into<crate::model::DataSourceParameter>,
197    {
198        use std::iter::Iterator;
199        self.fields = v.into_iter().map(|i| i.into()).collect();
200        self
201    }
202
203    /// Sets the value of [validation_description][crate::model::DataSourceParameter::validation_description].
204    pub fn set_validation_description<T: std::convert::Into<std::string::String>>(
205        mut self,
206        v: T,
207    ) -> Self {
208        self.validation_description = v.into();
209        self
210    }
211
212    /// Sets the value of [validation_help_url][crate::model::DataSourceParameter::validation_help_url].
213    pub fn set_validation_help_url<T: std::convert::Into<std::string::String>>(
214        mut self,
215        v: T,
216    ) -> Self {
217        self.validation_help_url = v.into();
218        self
219    }
220
221    /// Sets the value of [immutable][crate::model::DataSourceParameter::immutable].
222    pub fn set_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
223        self.immutable = v.into();
224        self
225    }
226
227    /// Sets the value of [recurse][crate::model::DataSourceParameter::recurse].
228    pub fn set_recurse<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
229        self.recurse = v.into();
230        self
231    }
232
233    /// Sets the value of [deprecated][crate::model::DataSourceParameter::deprecated].
234    pub fn set_deprecated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
235        self.deprecated = v.into();
236        self
237    }
238}
239
240impl wkt::message::Message for DataSourceParameter {
241    fn typename() -> &'static str {
242        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.DataSourceParameter"
243    }
244}
245
246#[doc(hidden)]
247impl<'de> serde::de::Deserialize<'de> for DataSourceParameter {
248    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
249    where
250        D: serde::Deserializer<'de>,
251    {
252        #[allow(non_camel_case_types)]
253        #[doc(hidden)]
254        #[derive(PartialEq, Eq, Hash)]
255        enum __FieldTag {
256            __param_id,
257            __display_name,
258            __description,
259            __type,
260            __required,
261            __repeated,
262            __validation_regex,
263            __allowed_values,
264            __min_value,
265            __max_value,
266            __fields,
267            __validation_description,
268            __validation_help_url,
269            __immutable,
270            __recurse,
271            __deprecated,
272            Unknown(std::string::String),
273        }
274        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
275            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
276            where
277                D: serde::Deserializer<'de>,
278            {
279                struct Visitor;
280                impl<'de> serde::de::Visitor<'de> for Visitor {
281                    type Value = __FieldTag;
282                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
283                        formatter.write_str("a field name for DataSourceParameter")
284                    }
285                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
286                    where
287                        E: serde::de::Error,
288                    {
289                        use std::result::Result::Ok;
290                        use std::string::ToString;
291                        match value {
292                            "paramId" => Ok(__FieldTag::__param_id),
293                            "param_id" => Ok(__FieldTag::__param_id),
294                            "displayName" => Ok(__FieldTag::__display_name),
295                            "display_name" => Ok(__FieldTag::__display_name),
296                            "description" => Ok(__FieldTag::__description),
297                            "type" => Ok(__FieldTag::__type),
298                            "required" => Ok(__FieldTag::__required),
299                            "repeated" => Ok(__FieldTag::__repeated),
300                            "validationRegex" => Ok(__FieldTag::__validation_regex),
301                            "validation_regex" => Ok(__FieldTag::__validation_regex),
302                            "allowedValues" => Ok(__FieldTag::__allowed_values),
303                            "allowed_values" => Ok(__FieldTag::__allowed_values),
304                            "minValue" => Ok(__FieldTag::__min_value),
305                            "min_value" => Ok(__FieldTag::__min_value),
306                            "maxValue" => Ok(__FieldTag::__max_value),
307                            "max_value" => Ok(__FieldTag::__max_value),
308                            "fields" => Ok(__FieldTag::__fields),
309                            "validationDescription" => Ok(__FieldTag::__validation_description),
310                            "validation_description" => Ok(__FieldTag::__validation_description),
311                            "validationHelpUrl" => Ok(__FieldTag::__validation_help_url),
312                            "validation_help_url" => Ok(__FieldTag::__validation_help_url),
313                            "immutable" => Ok(__FieldTag::__immutable),
314                            "recurse" => Ok(__FieldTag::__recurse),
315                            "deprecated" => Ok(__FieldTag::__deprecated),
316                            _ => Ok(__FieldTag::Unknown(value.to_string())),
317                        }
318                    }
319                }
320                deserializer.deserialize_identifier(Visitor)
321            }
322        }
323        struct Visitor;
324        impl<'de> serde::de::Visitor<'de> for Visitor {
325            type Value = DataSourceParameter;
326            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
327                formatter.write_str("struct DataSourceParameter")
328            }
329            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
330            where
331                A: serde::de::MapAccess<'de>,
332            {
333                #[allow(unused_imports)]
334                use serde::de::Error;
335                use std::option::Option::Some;
336                let mut fields = std::collections::HashSet::new();
337                let mut result = Self::Value::new();
338                while let Some(tag) = map.next_key::<__FieldTag>()? {
339                    #[allow(clippy::match_single_binding)]
340                    match tag {
341                        __FieldTag::__param_id => {
342                            if !fields.insert(__FieldTag::__param_id) {
343                                return std::result::Result::Err(A::Error::duplicate_field(
344                                    "multiple values for param_id",
345                                ));
346                            }
347                            result.param_id = map
348                                .next_value::<std::option::Option<std::string::String>>()?
349                                .unwrap_or_default();
350                        }
351                        __FieldTag::__display_name => {
352                            if !fields.insert(__FieldTag::__display_name) {
353                                return std::result::Result::Err(A::Error::duplicate_field(
354                                    "multiple values for display_name",
355                                ));
356                            }
357                            result.display_name = map
358                                .next_value::<std::option::Option<std::string::String>>()?
359                                .unwrap_or_default();
360                        }
361                        __FieldTag::__description => {
362                            if !fields.insert(__FieldTag::__description) {
363                                return std::result::Result::Err(A::Error::duplicate_field(
364                                    "multiple values for description",
365                                ));
366                            }
367                            result.description = map
368                                .next_value::<std::option::Option<std::string::String>>()?
369                                .unwrap_or_default();
370                        }
371                        __FieldTag::__type => {
372                            if !fields.insert(__FieldTag::__type) {
373                                return std::result::Result::Err(A::Error::duplicate_field(
374                                    "multiple values for type",
375                                ));
376                            }
377                            result.r#type = map.next_value::<std::option::Option<crate::model::data_source_parameter::Type>>()?.unwrap_or_default();
378                        }
379                        __FieldTag::__required => {
380                            if !fields.insert(__FieldTag::__required) {
381                                return std::result::Result::Err(A::Error::duplicate_field(
382                                    "multiple values for required",
383                                ));
384                            }
385                            result.required = map
386                                .next_value::<std::option::Option<bool>>()?
387                                .unwrap_or_default();
388                        }
389                        __FieldTag::__repeated => {
390                            if !fields.insert(__FieldTag::__repeated) {
391                                return std::result::Result::Err(A::Error::duplicate_field(
392                                    "multiple values for repeated",
393                                ));
394                            }
395                            result.repeated = map
396                                .next_value::<std::option::Option<bool>>()?
397                                .unwrap_or_default();
398                        }
399                        __FieldTag::__validation_regex => {
400                            if !fields.insert(__FieldTag::__validation_regex) {
401                                return std::result::Result::Err(A::Error::duplicate_field(
402                                    "multiple values for validation_regex",
403                                ));
404                            }
405                            result.validation_regex = map
406                                .next_value::<std::option::Option<std::string::String>>()?
407                                .unwrap_or_default();
408                        }
409                        __FieldTag::__allowed_values => {
410                            if !fields.insert(__FieldTag::__allowed_values) {
411                                return std::result::Result::Err(A::Error::duplicate_field(
412                                    "multiple values for allowed_values",
413                                ));
414                            }
415                            result.allowed_values = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
416                        }
417                        __FieldTag::__min_value => {
418                            if !fields.insert(__FieldTag::__min_value) {
419                                return std::result::Result::Err(A::Error::duplicate_field(
420                                    "multiple values for min_value",
421                                ));
422                            }
423                            struct __With(std::option::Option<wkt::DoubleValue>);
424                            impl<'de> serde::de::Deserialize<'de> for __With {
425                                fn deserialize<D>(
426                                    deserializer: D,
427                                ) -> std::result::Result<Self, D::Error>
428                                where
429                                    D: serde::de::Deserializer<'de>,
430                                {
431                                    serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
432                                }
433                            }
434                            result.min_value = map.next_value::<__With>()?.0;
435                        }
436                        __FieldTag::__max_value => {
437                            if !fields.insert(__FieldTag::__max_value) {
438                                return std::result::Result::Err(A::Error::duplicate_field(
439                                    "multiple values for max_value",
440                                ));
441                            }
442                            struct __With(std::option::Option<wkt::DoubleValue>);
443                            impl<'de> serde::de::Deserialize<'de> for __With {
444                                fn deserialize<D>(
445                                    deserializer: D,
446                                ) -> std::result::Result<Self, D::Error>
447                                where
448                                    D: serde::de::Deserializer<'de>,
449                                {
450                                    serde_with::As::< std::option::Option<wkt::internal::F64> >::deserialize(deserializer).map(__With)
451                                }
452                            }
453                            result.max_value = map.next_value::<__With>()?.0;
454                        }
455                        __FieldTag::__fields => {
456                            if !fields.insert(__FieldTag::__fields) {
457                                return std::result::Result::Err(A::Error::duplicate_field(
458                                    "multiple values for fields",
459                                ));
460                            }
461                            result.fields = map
462                                .next_value::<std::option::Option<
463                                    std::vec::Vec<crate::model::DataSourceParameter>,
464                                >>()?
465                                .unwrap_or_default();
466                        }
467                        __FieldTag::__validation_description => {
468                            if !fields.insert(__FieldTag::__validation_description) {
469                                return std::result::Result::Err(A::Error::duplicate_field(
470                                    "multiple values for validation_description",
471                                ));
472                            }
473                            result.validation_description = map
474                                .next_value::<std::option::Option<std::string::String>>()?
475                                .unwrap_or_default();
476                        }
477                        __FieldTag::__validation_help_url => {
478                            if !fields.insert(__FieldTag::__validation_help_url) {
479                                return std::result::Result::Err(A::Error::duplicate_field(
480                                    "multiple values for validation_help_url",
481                                ));
482                            }
483                            result.validation_help_url = map
484                                .next_value::<std::option::Option<std::string::String>>()?
485                                .unwrap_or_default();
486                        }
487                        __FieldTag::__immutable => {
488                            if !fields.insert(__FieldTag::__immutable) {
489                                return std::result::Result::Err(A::Error::duplicate_field(
490                                    "multiple values for immutable",
491                                ));
492                            }
493                            result.immutable = map
494                                .next_value::<std::option::Option<bool>>()?
495                                .unwrap_or_default();
496                        }
497                        __FieldTag::__recurse => {
498                            if !fields.insert(__FieldTag::__recurse) {
499                                return std::result::Result::Err(A::Error::duplicate_field(
500                                    "multiple values for recurse",
501                                ));
502                            }
503                            result.recurse = map
504                                .next_value::<std::option::Option<bool>>()?
505                                .unwrap_or_default();
506                        }
507                        __FieldTag::__deprecated => {
508                            if !fields.insert(__FieldTag::__deprecated) {
509                                return std::result::Result::Err(A::Error::duplicate_field(
510                                    "multiple values for deprecated",
511                                ));
512                            }
513                            result.deprecated = map
514                                .next_value::<std::option::Option<bool>>()?
515                                .unwrap_or_default();
516                        }
517                        __FieldTag::Unknown(key) => {
518                            let value = map.next_value::<serde_json::Value>()?;
519                            result._unknown_fields.insert(key, value);
520                        }
521                    }
522                }
523                std::result::Result::Ok(result)
524            }
525        }
526        deserializer.deserialize_any(Visitor)
527    }
528}
529
530#[doc(hidden)]
531impl serde::ser::Serialize for DataSourceParameter {
532    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
533    where
534        S: serde::ser::Serializer,
535    {
536        use serde::ser::SerializeMap;
537        #[allow(unused_imports)]
538        use std::option::Option::Some;
539        let mut state = serializer.serialize_map(std::option::Option::None)?;
540        if !self.param_id.is_empty() {
541            state.serialize_entry("paramId", &self.param_id)?;
542        }
543        if !self.display_name.is_empty() {
544            state.serialize_entry("displayName", &self.display_name)?;
545        }
546        if !self.description.is_empty() {
547            state.serialize_entry("description", &self.description)?;
548        }
549        if !wkt::internal::is_default(&self.r#type) {
550            state.serialize_entry("type", &self.r#type)?;
551        }
552        if !wkt::internal::is_default(&self.required) {
553            state.serialize_entry("required", &self.required)?;
554        }
555        if !wkt::internal::is_default(&self.repeated) {
556            state.serialize_entry("repeated", &self.repeated)?;
557        }
558        if !self.validation_regex.is_empty() {
559            state.serialize_entry("validationRegex", &self.validation_regex)?;
560        }
561        if !self.allowed_values.is_empty() {
562            state.serialize_entry("allowedValues", &self.allowed_values)?;
563        }
564        if self.min_value.is_some() {
565            struct __With<'a>(&'a std::option::Option<wkt::DoubleValue>);
566            impl<'a> serde::ser::Serialize for __With<'a> {
567                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
568                where
569                    S: serde::ser::Serializer,
570                {
571                    serde_with::As::<std::option::Option<wkt::internal::F64>>::serialize(
572                        self.0, serializer,
573                    )
574                }
575            }
576            state.serialize_entry("minValue", &__With(&self.min_value))?;
577        }
578        if self.max_value.is_some() {
579            struct __With<'a>(&'a std::option::Option<wkt::DoubleValue>);
580            impl<'a> serde::ser::Serialize for __With<'a> {
581                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
582                where
583                    S: serde::ser::Serializer,
584                {
585                    serde_with::As::<std::option::Option<wkt::internal::F64>>::serialize(
586                        self.0, serializer,
587                    )
588                }
589            }
590            state.serialize_entry("maxValue", &__With(&self.max_value))?;
591        }
592        if !self.fields.is_empty() {
593            state.serialize_entry("fields", &self.fields)?;
594        }
595        if !self.validation_description.is_empty() {
596            state.serialize_entry("validationDescription", &self.validation_description)?;
597        }
598        if !self.validation_help_url.is_empty() {
599            state.serialize_entry("validationHelpUrl", &self.validation_help_url)?;
600        }
601        if !wkt::internal::is_default(&self.immutable) {
602            state.serialize_entry("immutable", &self.immutable)?;
603        }
604        if !wkt::internal::is_default(&self.recurse) {
605            state.serialize_entry("recurse", &self.recurse)?;
606        }
607        if !wkt::internal::is_default(&self.deprecated) {
608            state.serialize_entry("deprecated", &self.deprecated)?;
609        }
610        if !self._unknown_fields.is_empty() {
611            for (key, value) in self._unknown_fields.iter() {
612                state.serialize_entry(key, &value)?;
613            }
614        }
615        state.end()
616    }
617}
618
619impl std::fmt::Debug for DataSourceParameter {
620    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
621        let mut debug_struct = f.debug_struct("DataSourceParameter");
622        debug_struct.field("param_id", &self.param_id);
623        debug_struct.field("display_name", &self.display_name);
624        debug_struct.field("description", &self.description);
625        debug_struct.field("r#type", &self.r#type);
626        debug_struct.field("required", &self.required);
627        debug_struct.field("repeated", &self.repeated);
628        debug_struct.field("validation_regex", &self.validation_regex);
629        debug_struct.field("allowed_values", &self.allowed_values);
630        debug_struct.field("min_value", &self.min_value);
631        debug_struct.field("max_value", &self.max_value);
632        debug_struct.field("fields", &self.fields);
633        debug_struct.field("validation_description", &self.validation_description);
634        debug_struct.field("validation_help_url", &self.validation_help_url);
635        debug_struct.field("immutable", &self.immutable);
636        debug_struct.field("recurse", &self.recurse);
637        debug_struct.field("deprecated", &self.deprecated);
638        if !self._unknown_fields.is_empty() {
639            debug_struct.field("_unknown_fields", &self._unknown_fields);
640        }
641        debug_struct.finish()
642    }
643}
644
645/// Defines additional types related to [DataSourceParameter].
646pub mod data_source_parameter {
647    #[allow(unused_imports)]
648    use super::*;
649
650    /// Parameter type.
651    ///
652    /// # Working with unknown values
653    ///
654    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
655    /// additional enum variants at any time. Adding new variants is not considered
656    /// a breaking change. Applications should write their code in anticipation of:
657    ///
658    /// - New values appearing in future releases of the client library, **and**
659    /// - New values received dynamically, without application changes.
660    ///
661    /// Please consult the [Working with enums] section in the user guide for some
662    /// guidelines.
663    ///
664    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
665    #[derive(Clone, Debug, PartialEq)]
666    #[non_exhaustive]
667    pub enum Type {
668        /// Type unspecified.
669        Unspecified,
670        /// String parameter.
671        String,
672        /// Integer parameter (64-bits).
673        /// Will be serialized to json as string.
674        Integer,
675        /// Double precision floating point parameter.
676        Double,
677        /// Boolean parameter.
678        Boolean,
679        /// Deprecated. This field has no effect.
680        Record,
681        /// Page ID for a Google+ Page.
682        PlusPage,
683        /// List of strings parameter.
684        List,
685        /// If set, the enum was initialized with an unknown value.
686        ///
687        /// Applications can examine the value using [Type::value] or
688        /// [Type::name].
689        UnknownValue(r#type::UnknownValue),
690    }
691
692    #[doc(hidden)]
693    pub mod r#type {
694        #[allow(unused_imports)]
695        use super::*;
696        #[derive(Clone, Debug, PartialEq)]
697        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
698    }
699
700    impl Type {
701        /// Gets the enum value.
702        ///
703        /// Returns `None` if the enum contains an unknown value deserialized from
704        /// the string representation of enums.
705        pub fn value(&self) -> std::option::Option<i32> {
706            match self {
707                Self::Unspecified => std::option::Option::Some(0),
708                Self::String => std::option::Option::Some(1),
709                Self::Integer => std::option::Option::Some(2),
710                Self::Double => std::option::Option::Some(3),
711                Self::Boolean => std::option::Option::Some(4),
712                Self::Record => std::option::Option::Some(5),
713                Self::PlusPage => std::option::Option::Some(6),
714                Self::List => std::option::Option::Some(7),
715                Self::UnknownValue(u) => u.0.value(),
716            }
717        }
718
719        /// Gets the enum value as a string.
720        ///
721        /// Returns `None` if the enum contains an unknown value deserialized from
722        /// the integer representation of enums.
723        pub fn name(&self) -> std::option::Option<&str> {
724            match self {
725                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
726                Self::String => std::option::Option::Some("STRING"),
727                Self::Integer => std::option::Option::Some("INTEGER"),
728                Self::Double => std::option::Option::Some("DOUBLE"),
729                Self::Boolean => std::option::Option::Some("BOOLEAN"),
730                Self::Record => std::option::Option::Some("RECORD"),
731                Self::PlusPage => std::option::Option::Some("PLUS_PAGE"),
732                Self::List => std::option::Option::Some("LIST"),
733                Self::UnknownValue(u) => u.0.name(),
734            }
735        }
736    }
737
738    impl std::default::Default for Type {
739        fn default() -> Self {
740            use std::convert::From;
741            Self::from(0)
742        }
743    }
744
745    impl std::fmt::Display for Type {
746        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
747            wkt::internal::display_enum(f, self.name(), self.value())
748        }
749    }
750
751    impl std::convert::From<i32> for Type {
752        fn from(value: i32) -> Self {
753            match value {
754                0 => Self::Unspecified,
755                1 => Self::String,
756                2 => Self::Integer,
757                3 => Self::Double,
758                4 => Self::Boolean,
759                5 => Self::Record,
760                6 => Self::PlusPage,
761                7 => Self::List,
762                _ => Self::UnknownValue(r#type::UnknownValue(
763                    wkt::internal::UnknownEnumValue::Integer(value),
764                )),
765            }
766        }
767    }
768
769    impl std::convert::From<&str> for Type {
770        fn from(value: &str) -> Self {
771            use std::string::ToString;
772            match value {
773                "TYPE_UNSPECIFIED" => Self::Unspecified,
774                "STRING" => Self::String,
775                "INTEGER" => Self::Integer,
776                "DOUBLE" => Self::Double,
777                "BOOLEAN" => Self::Boolean,
778                "RECORD" => Self::Record,
779                "PLUS_PAGE" => Self::PlusPage,
780                "LIST" => Self::List,
781                _ => Self::UnknownValue(r#type::UnknownValue(
782                    wkt::internal::UnknownEnumValue::String(value.to_string()),
783                )),
784            }
785        }
786    }
787
788    impl serde::ser::Serialize for Type {
789        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
790        where
791            S: serde::Serializer,
792        {
793            match self {
794                Self::Unspecified => serializer.serialize_i32(0),
795                Self::String => serializer.serialize_i32(1),
796                Self::Integer => serializer.serialize_i32(2),
797                Self::Double => serializer.serialize_i32(3),
798                Self::Boolean => serializer.serialize_i32(4),
799                Self::Record => serializer.serialize_i32(5),
800                Self::PlusPage => serializer.serialize_i32(6),
801                Self::List => serializer.serialize_i32(7),
802                Self::UnknownValue(u) => u.0.serialize(serializer),
803            }
804        }
805    }
806
807    impl<'de> serde::de::Deserialize<'de> for Type {
808        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
809        where
810            D: serde::Deserializer<'de>,
811        {
812            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
813                ".google.cloud.bigquery.datatransfer.v1.DataSourceParameter.Type",
814            ))
815        }
816    }
817}
818
819/// Defines the properties and custom parameters for a data source.
820#[derive(Clone, Default, PartialEq)]
821#[non_exhaustive]
822pub struct DataSource {
823    /// Output only. Data source resource name.
824    pub name: std::string::String,
825
826    /// Data source id.
827    pub data_source_id: std::string::String,
828
829    /// User friendly data source name.
830    pub display_name: std::string::String,
831
832    /// User friendly data source description string.
833    pub description: std::string::String,
834
835    /// Data source client id which should be used to receive refresh token.
836    pub client_id: std::string::String,
837
838    /// Api auth scopes for which refresh token needs to be obtained. These are
839    /// scopes needed by a data source to prepare data and ingest them into
840    /// BigQuery, e.g., <https://www.googleapis.com/auth/bigquery>
841    pub scopes: std::vec::Vec<std::string::String>,
842
843    /// Deprecated. This field has no effect.
844    #[deprecated]
845    pub transfer_type: crate::model::TransferType,
846
847    /// Deprecated. This field has no effect.
848    #[deprecated]
849    pub supports_multiple_transfers: bool,
850
851    /// The number of seconds to wait for an update from the data source
852    /// before the Data Transfer Service marks the transfer as FAILED.
853    pub update_deadline_seconds: i32,
854
855    /// Default data transfer schedule.
856    /// Examples of valid schedules include:
857    /// `1st,3rd monday of month 15:30`,
858    /// `every wed,fri of jan,jun 13:15`, and
859    /// `first sunday of quarter 00:00`.
860    pub default_schedule: std::string::String,
861
862    /// Specifies whether the data source supports a user defined schedule, or
863    /// operates on the default schedule.
864    /// When set to `true`, user can override default schedule.
865    pub supports_custom_schedule: bool,
866
867    /// Data source parameters.
868    pub parameters: std::vec::Vec<crate::model::DataSourceParameter>,
869
870    /// Url for the help document for this data source.
871    pub help_url: std::string::String,
872
873    /// Indicates the type of authorization.
874    pub authorization_type: crate::model::data_source::AuthorizationType,
875
876    /// Specifies whether the data source supports automatic data refresh for the
877    /// past few days, and how it's supported.
878    /// For some data sources, data might not be complete until a few days later,
879    /// so it's useful to refresh data automatically.
880    pub data_refresh_type: crate::model::data_source::DataRefreshType,
881
882    /// Default data refresh window on days.
883    /// Only meaningful when `data_refresh_type` = `SLIDING_WINDOW`.
884    pub default_data_refresh_window_days: i32,
885
886    /// Disables backfilling and manual run scheduling
887    /// for the data source.
888    pub manual_runs_disabled: bool,
889
890    /// The minimum interval for scheduler to schedule runs.
891    pub minimum_schedule_interval: std::option::Option<wkt::Duration>,
892
893    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
894}
895
896impl DataSource {
897    pub fn new() -> Self {
898        std::default::Default::default()
899    }
900
901    /// Sets the value of [name][crate::model::DataSource::name].
902    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
903        self.name = v.into();
904        self
905    }
906
907    /// Sets the value of [data_source_id][crate::model::DataSource::data_source_id].
908    pub fn set_data_source_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
909        self.data_source_id = v.into();
910        self
911    }
912
913    /// Sets the value of [display_name][crate::model::DataSource::display_name].
914    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
915        self.display_name = v.into();
916        self
917    }
918
919    /// Sets the value of [description][crate::model::DataSource::description].
920    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
921        self.description = v.into();
922        self
923    }
924
925    /// Sets the value of [client_id][crate::model::DataSource::client_id].
926    pub fn set_client_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
927        self.client_id = v.into();
928        self
929    }
930
931    /// Sets the value of [scopes][crate::model::DataSource::scopes].
932    pub fn set_scopes<T, V>(mut self, v: T) -> Self
933    where
934        T: std::iter::IntoIterator<Item = V>,
935        V: std::convert::Into<std::string::String>,
936    {
937        use std::iter::Iterator;
938        self.scopes = v.into_iter().map(|i| i.into()).collect();
939        self
940    }
941
942    /// Sets the value of [transfer_type][crate::model::DataSource::transfer_type].
943    #[deprecated]
944    pub fn set_transfer_type<T: std::convert::Into<crate::model::TransferType>>(
945        mut self,
946        v: T,
947    ) -> Self {
948        self.transfer_type = v.into();
949        self
950    }
951
952    /// Sets the value of [supports_multiple_transfers][crate::model::DataSource::supports_multiple_transfers].
953    #[deprecated]
954    pub fn set_supports_multiple_transfers<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
955        self.supports_multiple_transfers = v.into();
956        self
957    }
958
959    /// Sets the value of [update_deadline_seconds][crate::model::DataSource::update_deadline_seconds].
960    pub fn set_update_deadline_seconds<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
961        self.update_deadline_seconds = v.into();
962        self
963    }
964
965    /// Sets the value of [default_schedule][crate::model::DataSource::default_schedule].
966    pub fn set_default_schedule<T: std::convert::Into<std::string::String>>(
967        mut self,
968        v: T,
969    ) -> Self {
970        self.default_schedule = v.into();
971        self
972    }
973
974    /// Sets the value of [supports_custom_schedule][crate::model::DataSource::supports_custom_schedule].
975    pub fn set_supports_custom_schedule<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
976        self.supports_custom_schedule = v.into();
977        self
978    }
979
980    /// Sets the value of [parameters][crate::model::DataSource::parameters].
981    pub fn set_parameters<T, V>(mut self, v: T) -> Self
982    where
983        T: std::iter::IntoIterator<Item = V>,
984        V: std::convert::Into<crate::model::DataSourceParameter>,
985    {
986        use std::iter::Iterator;
987        self.parameters = v.into_iter().map(|i| i.into()).collect();
988        self
989    }
990
991    /// Sets the value of [help_url][crate::model::DataSource::help_url].
992    pub fn set_help_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
993        self.help_url = v.into();
994        self
995    }
996
997    /// Sets the value of [authorization_type][crate::model::DataSource::authorization_type].
998    pub fn set_authorization_type<
999        T: std::convert::Into<crate::model::data_source::AuthorizationType>,
1000    >(
1001        mut self,
1002        v: T,
1003    ) -> Self {
1004        self.authorization_type = v.into();
1005        self
1006    }
1007
1008    /// Sets the value of [data_refresh_type][crate::model::DataSource::data_refresh_type].
1009    pub fn set_data_refresh_type<
1010        T: std::convert::Into<crate::model::data_source::DataRefreshType>,
1011    >(
1012        mut self,
1013        v: T,
1014    ) -> Self {
1015        self.data_refresh_type = v.into();
1016        self
1017    }
1018
1019    /// Sets the value of [default_data_refresh_window_days][crate::model::DataSource::default_data_refresh_window_days].
1020    pub fn set_default_data_refresh_window_days<T: std::convert::Into<i32>>(
1021        mut self,
1022        v: T,
1023    ) -> Self {
1024        self.default_data_refresh_window_days = v.into();
1025        self
1026    }
1027
1028    /// Sets the value of [manual_runs_disabled][crate::model::DataSource::manual_runs_disabled].
1029    pub fn set_manual_runs_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1030        self.manual_runs_disabled = v.into();
1031        self
1032    }
1033
1034    /// Sets the value of [minimum_schedule_interval][crate::model::DataSource::minimum_schedule_interval].
1035    pub fn set_minimum_schedule_interval<T>(mut self, v: T) -> Self
1036    where
1037        T: std::convert::Into<wkt::Duration>,
1038    {
1039        self.minimum_schedule_interval = std::option::Option::Some(v.into());
1040        self
1041    }
1042
1043    /// Sets or clears the value of [minimum_schedule_interval][crate::model::DataSource::minimum_schedule_interval].
1044    pub fn set_or_clear_minimum_schedule_interval<T>(mut self, v: std::option::Option<T>) -> Self
1045    where
1046        T: std::convert::Into<wkt::Duration>,
1047    {
1048        self.minimum_schedule_interval = v.map(|x| x.into());
1049        self
1050    }
1051}
1052
1053impl wkt::message::Message for DataSource {
1054    fn typename() -> &'static str {
1055        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.DataSource"
1056    }
1057}
1058
1059#[doc(hidden)]
1060impl<'de> serde::de::Deserialize<'de> for DataSource {
1061    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1062    where
1063        D: serde::Deserializer<'de>,
1064    {
1065        #[allow(non_camel_case_types)]
1066        #[doc(hidden)]
1067        #[derive(PartialEq, Eq, Hash)]
1068        enum __FieldTag {
1069            __name,
1070            __data_source_id,
1071            __display_name,
1072            __description,
1073            __client_id,
1074            __scopes,
1075            __transfer_type,
1076            __supports_multiple_transfers,
1077            __update_deadline_seconds,
1078            __default_schedule,
1079            __supports_custom_schedule,
1080            __parameters,
1081            __help_url,
1082            __authorization_type,
1083            __data_refresh_type,
1084            __default_data_refresh_window_days,
1085            __manual_runs_disabled,
1086            __minimum_schedule_interval,
1087            Unknown(std::string::String),
1088        }
1089        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1090            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1091            where
1092                D: serde::Deserializer<'de>,
1093            {
1094                struct Visitor;
1095                impl<'de> serde::de::Visitor<'de> for Visitor {
1096                    type Value = __FieldTag;
1097                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1098                        formatter.write_str("a field name for DataSource")
1099                    }
1100                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1101                    where
1102                        E: serde::de::Error,
1103                    {
1104                        use std::result::Result::Ok;
1105                        use std::string::ToString;
1106                        match value {
1107                            "name" => Ok(__FieldTag::__name),
1108                            "dataSourceId" => Ok(__FieldTag::__data_source_id),
1109                            "data_source_id" => Ok(__FieldTag::__data_source_id),
1110                            "displayName" => Ok(__FieldTag::__display_name),
1111                            "display_name" => Ok(__FieldTag::__display_name),
1112                            "description" => Ok(__FieldTag::__description),
1113                            "clientId" => Ok(__FieldTag::__client_id),
1114                            "client_id" => Ok(__FieldTag::__client_id),
1115                            "scopes" => Ok(__FieldTag::__scopes),
1116                            "transferType" => Ok(__FieldTag::__transfer_type),
1117                            "transfer_type" => Ok(__FieldTag::__transfer_type),
1118                            "supportsMultipleTransfers" => {
1119                                Ok(__FieldTag::__supports_multiple_transfers)
1120                            }
1121                            "supports_multiple_transfers" => {
1122                                Ok(__FieldTag::__supports_multiple_transfers)
1123                            }
1124                            "updateDeadlineSeconds" => Ok(__FieldTag::__update_deadline_seconds),
1125                            "update_deadline_seconds" => Ok(__FieldTag::__update_deadline_seconds),
1126                            "defaultSchedule" => Ok(__FieldTag::__default_schedule),
1127                            "default_schedule" => Ok(__FieldTag::__default_schedule),
1128                            "supportsCustomSchedule" => Ok(__FieldTag::__supports_custom_schedule),
1129                            "supports_custom_schedule" => {
1130                                Ok(__FieldTag::__supports_custom_schedule)
1131                            }
1132                            "parameters" => Ok(__FieldTag::__parameters),
1133                            "helpUrl" => Ok(__FieldTag::__help_url),
1134                            "help_url" => Ok(__FieldTag::__help_url),
1135                            "authorizationType" => Ok(__FieldTag::__authorization_type),
1136                            "authorization_type" => Ok(__FieldTag::__authorization_type),
1137                            "dataRefreshType" => Ok(__FieldTag::__data_refresh_type),
1138                            "data_refresh_type" => Ok(__FieldTag::__data_refresh_type),
1139                            "defaultDataRefreshWindowDays" => {
1140                                Ok(__FieldTag::__default_data_refresh_window_days)
1141                            }
1142                            "default_data_refresh_window_days" => {
1143                                Ok(__FieldTag::__default_data_refresh_window_days)
1144                            }
1145                            "manualRunsDisabled" => Ok(__FieldTag::__manual_runs_disabled),
1146                            "manual_runs_disabled" => Ok(__FieldTag::__manual_runs_disabled),
1147                            "minimumScheduleInterval" => {
1148                                Ok(__FieldTag::__minimum_schedule_interval)
1149                            }
1150                            "minimum_schedule_interval" => {
1151                                Ok(__FieldTag::__minimum_schedule_interval)
1152                            }
1153                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1154                        }
1155                    }
1156                }
1157                deserializer.deserialize_identifier(Visitor)
1158            }
1159        }
1160        struct Visitor;
1161        impl<'de> serde::de::Visitor<'de> for Visitor {
1162            type Value = DataSource;
1163            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1164                formatter.write_str("struct DataSource")
1165            }
1166            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1167            where
1168                A: serde::de::MapAccess<'de>,
1169            {
1170                #[allow(unused_imports)]
1171                use serde::de::Error;
1172                use std::option::Option::Some;
1173                let mut fields = std::collections::HashSet::new();
1174                let mut result = Self::Value::new();
1175                while let Some(tag) = map.next_key::<__FieldTag>()? {
1176                    #[allow(clippy::match_single_binding)]
1177                    match tag {
1178                        __FieldTag::__name => {
1179                            if !fields.insert(__FieldTag::__name) {
1180                                return std::result::Result::Err(A::Error::duplicate_field(
1181                                    "multiple values for name",
1182                                ));
1183                            }
1184                            result.name = map
1185                                .next_value::<std::option::Option<std::string::String>>()?
1186                                .unwrap_or_default();
1187                        }
1188                        __FieldTag::__data_source_id => {
1189                            if !fields.insert(__FieldTag::__data_source_id) {
1190                                return std::result::Result::Err(A::Error::duplicate_field(
1191                                    "multiple values for data_source_id",
1192                                ));
1193                            }
1194                            result.data_source_id = map
1195                                .next_value::<std::option::Option<std::string::String>>()?
1196                                .unwrap_or_default();
1197                        }
1198                        __FieldTag::__display_name => {
1199                            if !fields.insert(__FieldTag::__display_name) {
1200                                return std::result::Result::Err(A::Error::duplicate_field(
1201                                    "multiple values for display_name",
1202                                ));
1203                            }
1204                            result.display_name = map
1205                                .next_value::<std::option::Option<std::string::String>>()?
1206                                .unwrap_or_default();
1207                        }
1208                        __FieldTag::__description => {
1209                            if !fields.insert(__FieldTag::__description) {
1210                                return std::result::Result::Err(A::Error::duplicate_field(
1211                                    "multiple values for description",
1212                                ));
1213                            }
1214                            result.description = map
1215                                .next_value::<std::option::Option<std::string::String>>()?
1216                                .unwrap_or_default();
1217                        }
1218                        __FieldTag::__client_id => {
1219                            if !fields.insert(__FieldTag::__client_id) {
1220                                return std::result::Result::Err(A::Error::duplicate_field(
1221                                    "multiple values for client_id",
1222                                ));
1223                            }
1224                            result.client_id = map
1225                                .next_value::<std::option::Option<std::string::String>>()?
1226                                .unwrap_or_default();
1227                        }
1228                        __FieldTag::__scopes => {
1229                            if !fields.insert(__FieldTag::__scopes) {
1230                                return std::result::Result::Err(A::Error::duplicate_field(
1231                                    "multiple values for scopes",
1232                                ));
1233                            }
1234                            result.scopes = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
1235                        }
1236                        __FieldTag::__transfer_type => {
1237                            if !fields.insert(__FieldTag::__transfer_type) {
1238                                return std::result::Result::Err(A::Error::duplicate_field(
1239                                    "multiple values for transfer_type",
1240                                ));
1241                            }
1242                            result.transfer_type = map
1243                                .next_value::<std::option::Option<crate::model::TransferType>>()?
1244                                .unwrap_or_default();
1245                        }
1246                        __FieldTag::__supports_multiple_transfers => {
1247                            if !fields.insert(__FieldTag::__supports_multiple_transfers) {
1248                                return std::result::Result::Err(A::Error::duplicate_field(
1249                                    "multiple values for supports_multiple_transfers",
1250                                ));
1251                            }
1252                            result.supports_multiple_transfers = map
1253                                .next_value::<std::option::Option<bool>>()?
1254                                .unwrap_or_default();
1255                        }
1256                        __FieldTag::__update_deadline_seconds => {
1257                            if !fields.insert(__FieldTag::__update_deadline_seconds) {
1258                                return std::result::Result::Err(A::Error::duplicate_field(
1259                                    "multiple values for update_deadline_seconds",
1260                                ));
1261                            }
1262                            struct __With(std::option::Option<i32>);
1263                            impl<'de> serde::de::Deserialize<'de> for __With {
1264                                fn deserialize<D>(
1265                                    deserializer: D,
1266                                ) -> std::result::Result<Self, D::Error>
1267                                where
1268                                    D: serde::de::Deserializer<'de>,
1269                                {
1270                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
1271                                }
1272                            }
1273                            result.update_deadline_seconds =
1274                                map.next_value::<__With>()?.0.unwrap_or_default();
1275                        }
1276                        __FieldTag::__default_schedule => {
1277                            if !fields.insert(__FieldTag::__default_schedule) {
1278                                return std::result::Result::Err(A::Error::duplicate_field(
1279                                    "multiple values for default_schedule",
1280                                ));
1281                            }
1282                            result.default_schedule = map
1283                                .next_value::<std::option::Option<std::string::String>>()?
1284                                .unwrap_or_default();
1285                        }
1286                        __FieldTag::__supports_custom_schedule => {
1287                            if !fields.insert(__FieldTag::__supports_custom_schedule) {
1288                                return std::result::Result::Err(A::Error::duplicate_field(
1289                                    "multiple values for supports_custom_schedule",
1290                                ));
1291                            }
1292                            result.supports_custom_schedule = map
1293                                .next_value::<std::option::Option<bool>>()?
1294                                .unwrap_or_default();
1295                        }
1296                        __FieldTag::__parameters => {
1297                            if !fields.insert(__FieldTag::__parameters) {
1298                                return std::result::Result::Err(A::Error::duplicate_field(
1299                                    "multiple values for parameters",
1300                                ));
1301                            }
1302                            result.parameters = map
1303                                .next_value::<std::option::Option<
1304                                    std::vec::Vec<crate::model::DataSourceParameter>,
1305                                >>()?
1306                                .unwrap_or_default();
1307                        }
1308                        __FieldTag::__help_url => {
1309                            if !fields.insert(__FieldTag::__help_url) {
1310                                return std::result::Result::Err(A::Error::duplicate_field(
1311                                    "multiple values for help_url",
1312                                ));
1313                            }
1314                            result.help_url = map
1315                                .next_value::<std::option::Option<std::string::String>>()?
1316                                .unwrap_or_default();
1317                        }
1318                        __FieldTag::__authorization_type => {
1319                            if !fields.insert(__FieldTag::__authorization_type) {
1320                                return std::result::Result::Err(A::Error::duplicate_field(
1321                                    "multiple values for authorization_type",
1322                                ));
1323                            }
1324                            result.authorization_type =
1325                                map.next_value::<std::option::Option<
1326                                    crate::model::data_source::AuthorizationType,
1327                                >>()?
1328                                .unwrap_or_default();
1329                        }
1330                        __FieldTag::__data_refresh_type => {
1331                            if !fields.insert(__FieldTag::__data_refresh_type) {
1332                                return std::result::Result::Err(A::Error::duplicate_field(
1333                                    "multiple values for data_refresh_type",
1334                                ));
1335                            }
1336                            result.data_refresh_type = map.next_value::<std::option::Option<crate::model::data_source::DataRefreshType>>()?.unwrap_or_default();
1337                        }
1338                        __FieldTag::__default_data_refresh_window_days => {
1339                            if !fields.insert(__FieldTag::__default_data_refresh_window_days) {
1340                                return std::result::Result::Err(A::Error::duplicate_field(
1341                                    "multiple values for default_data_refresh_window_days",
1342                                ));
1343                            }
1344                            struct __With(std::option::Option<i32>);
1345                            impl<'de> serde::de::Deserialize<'de> for __With {
1346                                fn deserialize<D>(
1347                                    deserializer: D,
1348                                ) -> std::result::Result<Self, D::Error>
1349                                where
1350                                    D: serde::de::Deserializer<'de>,
1351                                {
1352                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
1353                                }
1354                            }
1355                            result.default_data_refresh_window_days =
1356                                map.next_value::<__With>()?.0.unwrap_or_default();
1357                        }
1358                        __FieldTag::__manual_runs_disabled => {
1359                            if !fields.insert(__FieldTag::__manual_runs_disabled) {
1360                                return std::result::Result::Err(A::Error::duplicate_field(
1361                                    "multiple values for manual_runs_disabled",
1362                                ));
1363                            }
1364                            result.manual_runs_disabled = map
1365                                .next_value::<std::option::Option<bool>>()?
1366                                .unwrap_or_default();
1367                        }
1368                        __FieldTag::__minimum_schedule_interval => {
1369                            if !fields.insert(__FieldTag::__minimum_schedule_interval) {
1370                                return std::result::Result::Err(A::Error::duplicate_field(
1371                                    "multiple values for minimum_schedule_interval",
1372                                ));
1373                            }
1374                            result.minimum_schedule_interval =
1375                                map.next_value::<std::option::Option<wkt::Duration>>()?;
1376                        }
1377                        __FieldTag::Unknown(key) => {
1378                            let value = map.next_value::<serde_json::Value>()?;
1379                            result._unknown_fields.insert(key, value);
1380                        }
1381                    }
1382                }
1383                std::result::Result::Ok(result)
1384            }
1385        }
1386        deserializer.deserialize_any(Visitor)
1387    }
1388}
1389
1390#[doc(hidden)]
1391impl serde::ser::Serialize for DataSource {
1392    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1393    where
1394        S: serde::ser::Serializer,
1395    {
1396        use serde::ser::SerializeMap;
1397        #[allow(unused_imports)]
1398        use std::option::Option::Some;
1399        let mut state = serializer.serialize_map(std::option::Option::None)?;
1400        if !self.name.is_empty() {
1401            state.serialize_entry("name", &self.name)?;
1402        }
1403        if !self.data_source_id.is_empty() {
1404            state.serialize_entry("dataSourceId", &self.data_source_id)?;
1405        }
1406        if !self.display_name.is_empty() {
1407            state.serialize_entry("displayName", &self.display_name)?;
1408        }
1409        if !self.description.is_empty() {
1410            state.serialize_entry("description", &self.description)?;
1411        }
1412        if !self.client_id.is_empty() {
1413            state.serialize_entry("clientId", &self.client_id)?;
1414        }
1415        if !self.scopes.is_empty() {
1416            state.serialize_entry("scopes", &self.scopes)?;
1417        }
1418        if !wkt::internal::is_default(&self.transfer_type) {
1419            state.serialize_entry("transferType", &self.transfer_type)?;
1420        }
1421        if !wkt::internal::is_default(&self.supports_multiple_transfers) {
1422            state.serialize_entry(
1423                "supportsMultipleTransfers",
1424                &self.supports_multiple_transfers,
1425            )?;
1426        }
1427        if !wkt::internal::is_default(&self.update_deadline_seconds) {
1428            struct __With<'a>(&'a i32);
1429            impl<'a> serde::ser::Serialize for __With<'a> {
1430                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1431                where
1432                    S: serde::ser::Serializer,
1433                {
1434                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
1435                }
1436            }
1437            state.serialize_entry(
1438                "updateDeadlineSeconds",
1439                &__With(&self.update_deadline_seconds),
1440            )?;
1441        }
1442        if !self.default_schedule.is_empty() {
1443            state.serialize_entry("defaultSchedule", &self.default_schedule)?;
1444        }
1445        if !wkt::internal::is_default(&self.supports_custom_schedule) {
1446            state.serialize_entry("supportsCustomSchedule", &self.supports_custom_schedule)?;
1447        }
1448        if !self.parameters.is_empty() {
1449            state.serialize_entry("parameters", &self.parameters)?;
1450        }
1451        if !self.help_url.is_empty() {
1452            state.serialize_entry("helpUrl", &self.help_url)?;
1453        }
1454        if !wkt::internal::is_default(&self.authorization_type) {
1455            state.serialize_entry("authorizationType", &self.authorization_type)?;
1456        }
1457        if !wkt::internal::is_default(&self.data_refresh_type) {
1458            state.serialize_entry("dataRefreshType", &self.data_refresh_type)?;
1459        }
1460        if !wkt::internal::is_default(&self.default_data_refresh_window_days) {
1461            struct __With<'a>(&'a i32);
1462            impl<'a> serde::ser::Serialize for __With<'a> {
1463                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1464                where
1465                    S: serde::ser::Serializer,
1466                {
1467                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
1468                }
1469            }
1470            state.serialize_entry(
1471                "defaultDataRefreshWindowDays",
1472                &__With(&self.default_data_refresh_window_days),
1473            )?;
1474        }
1475        if !wkt::internal::is_default(&self.manual_runs_disabled) {
1476            state.serialize_entry("manualRunsDisabled", &self.manual_runs_disabled)?;
1477        }
1478        if self.minimum_schedule_interval.is_some() {
1479            state.serialize_entry("minimumScheduleInterval", &self.minimum_schedule_interval)?;
1480        }
1481        if !self._unknown_fields.is_empty() {
1482            for (key, value) in self._unknown_fields.iter() {
1483                state.serialize_entry(key, &value)?;
1484            }
1485        }
1486        state.end()
1487    }
1488}
1489
1490impl std::fmt::Debug for DataSource {
1491    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1492        let mut debug_struct = f.debug_struct("DataSource");
1493        debug_struct.field("name", &self.name);
1494        debug_struct.field("data_source_id", &self.data_source_id);
1495        debug_struct.field("display_name", &self.display_name);
1496        debug_struct.field("description", &self.description);
1497        debug_struct.field("client_id", &self.client_id);
1498        debug_struct.field("scopes", &self.scopes);
1499        debug_struct.field("transfer_type", &self.transfer_type);
1500        debug_struct.field(
1501            "supports_multiple_transfers",
1502            &self.supports_multiple_transfers,
1503        );
1504        debug_struct.field("update_deadline_seconds", &self.update_deadline_seconds);
1505        debug_struct.field("default_schedule", &self.default_schedule);
1506        debug_struct.field("supports_custom_schedule", &self.supports_custom_schedule);
1507        debug_struct.field("parameters", &self.parameters);
1508        debug_struct.field("help_url", &self.help_url);
1509        debug_struct.field("authorization_type", &self.authorization_type);
1510        debug_struct.field("data_refresh_type", &self.data_refresh_type);
1511        debug_struct.field(
1512            "default_data_refresh_window_days",
1513            &self.default_data_refresh_window_days,
1514        );
1515        debug_struct.field("manual_runs_disabled", &self.manual_runs_disabled);
1516        debug_struct.field("minimum_schedule_interval", &self.minimum_schedule_interval);
1517        if !self._unknown_fields.is_empty() {
1518            debug_struct.field("_unknown_fields", &self._unknown_fields);
1519        }
1520        debug_struct.finish()
1521    }
1522}
1523
1524/// Defines additional types related to [DataSource].
1525pub mod data_source {
1526    #[allow(unused_imports)]
1527    use super::*;
1528
1529    /// The type of authorization needed for this data source.
1530    ///
1531    /// # Working with unknown values
1532    ///
1533    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1534    /// additional enum variants at any time. Adding new variants is not considered
1535    /// a breaking change. Applications should write their code in anticipation of:
1536    ///
1537    /// - New values appearing in future releases of the client library, **and**
1538    /// - New values received dynamically, without application changes.
1539    ///
1540    /// Please consult the [Working with enums] section in the user guide for some
1541    /// guidelines.
1542    ///
1543    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1544    #[derive(Clone, Debug, PartialEq)]
1545    #[non_exhaustive]
1546    pub enum AuthorizationType {
1547        /// Type unspecified.
1548        Unspecified,
1549        /// Use OAuth 2 authorization codes that can be exchanged
1550        /// for a refresh token on the backend.
1551        AuthorizationCode,
1552        /// Return an authorization code for a given Google+ page that can then be
1553        /// exchanged for a refresh token on the backend.
1554        GooglePlusAuthorizationCode,
1555        /// Use First Party OAuth.
1556        FirstPartyOauth,
1557        /// If set, the enum was initialized with an unknown value.
1558        ///
1559        /// Applications can examine the value using [AuthorizationType::value] or
1560        /// [AuthorizationType::name].
1561        UnknownValue(authorization_type::UnknownValue),
1562    }
1563
1564    #[doc(hidden)]
1565    pub mod authorization_type {
1566        #[allow(unused_imports)]
1567        use super::*;
1568        #[derive(Clone, Debug, PartialEq)]
1569        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1570    }
1571
1572    impl AuthorizationType {
1573        /// Gets the enum value.
1574        ///
1575        /// Returns `None` if the enum contains an unknown value deserialized from
1576        /// the string representation of enums.
1577        pub fn value(&self) -> std::option::Option<i32> {
1578            match self {
1579                Self::Unspecified => std::option::Option::Some(0),
1580                Self::AuthorizationCode => std::option::Option::Some(1),
1581                Self::GooglePlusAuthorizationCode => std::option::Option::Some(2),
1582                Self::FirstPartyOauth => std::option::Option::Some(3),
1583                Self::UnknownValue(u) => u.0.value(),
1584            }
1585        }
1586
1587        /// Gets the enum value as a string.
1588        ///
1589        /// Returns `None` if the enum contains an unknown value deserialized from
1590        /// the integer representation of enums.
1591        pub fn name(&self) -> std::option::Option<&str> {
1592            match self {
1593                Self::Unspecified => std::option::Option::Some("AUTHORIZATION_TYPE_UNSPECIFIED"),
1594                Self::AuthorizationCode => std::option::Option::Some("AUTHORIZATION_CODE"),
1595                Self::GooglePlusAuthorizationCode => {
1596                    std::option::Option::Some("GOOGLE_PLUS_AUTHORIZATION_CODE")
1597                }
1598                Self::FirstPartyOauth => std::option::Option::Some("FIRST_PARTY_OAUTH"),
1599                Self::UnknownValue(u) => u.0.name(),
1600            }
1601        }
1602    }
1603
1604    impl std::default::Default for AuthorizationType {
1605        fn default() -> Self {
1606            use std::convert::From;
1607            Self::from(0)
1608        }
1609    }
1610
1611    impl std::fmt::Display for AuthorizationType {
1612        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1613            wkt::internal::display_enum(f, self.name(), self.value())
1614        }
1615    }
1616
1617    impl std::convert::From<i32> for AuthorizationType {
1618        fn from(value: i32) -> Self {
1619            match value {
1620                0 => Self::Unspecified,
1621                1 => Self::AuthorizationCode,
1622                2 => Self::GooglePlusAuthorizationCode,
1623                3 => Self::FirstPartyOauth,
1624                _ => Self::UnknownValue(authorization_type::UnknownValue(
1625                    wkt::internal::UnknownEnumValue::Integer(value),
1626                )),
1627            }
1628        }
1629    }
1630
1631    impl std::convert::From<&str> for AuthorizationType {
1632        fn from(value: &str) -> Self {
1633            use std::string::ToString;
1634            match value {
1635                "AUTHORIZATION_TYPE_UNSPECIFIED" => Self::Unspecified,
1636                "AUTHORIZATION_CODE" => Self::AuthorizationCode,
1637                "GOOGLE_PLUS_AUTHORIZATION_CODE" => Self::GooglePlusAuthorizationCode,
1638                "FIRST_PARTY_OAUTH" => Self::FirstPartyOauth,
1639                _ => Self::UnknownValue(authorization_type::UnknownValue(
1640                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1641                )),
1642            }
1643        }
1644    }
1645
1646    impl serde::ser::Serialize for AuthorizationType {
1647        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1648        where
1649            S: serde::Serializer,
1650        {
1651            match self {
1652                Self::Unspecified => serializer.serialize_i32(0),
1653                Self::AuthorizationCode => serializer.serialize_i32(1),
1654                Self::GooglePlusAuthorizationCode => serializer.serialize_i32(2),
1655                Self::FirstPartyOauth => serializer.serialize_i32(3),
1656                Self::UnknownValue(u) => u.0.serialize(serializer),
1657            }
1658        }
1659    }
1660
1661    impl<'de> serde::de::Deserialize<'de> for AuthorizationType {
1662        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1663        where
1664            D: serde::Deserializer<'de>,
1665        {
1666            deserializer.deserialize_any(wkt::internal::EnumVisitor::<AuthorizationType>::new(
1667                ".google.cloud.bigquery.datatransfer.v1.DataSource.AuthorizationType",
1668            ))
1669        }
1670    }
1671
1672    /// Represents how the data source supports data auto refresh.
1673    ///
1674    /// # Working with unknown values
1675    ///
1676    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1677    /// additional enum variants at any time. Adding new variants is not considered
1678    /// a breaking change. Applications should write their code in anticipation of:
1679    ///
1680    /// - New values appearing in future releases of the client library, **and**
1681    /// - New values received dynamically, without application changes.
1682    ///
1683    /// Please consult the [Working with enums] section in the user guide for some
1684    /// guidelines.
1685    ///
1686    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1687    #[derive(Clone, Debug, PartialEq)]
1688    #[non_exhaustive]
1689    pub enum DataRefreshType {
1690        /// The data source won't support data auto refresh, which is default value.
1691        Unspecified,
1692        /// The data source supports data auto refresh, and runs will be scheduled
1693        /// for the past few days. Does not allow custom values to be set for each
1694        /// transfer config.
1695        SlidingWindow,
1696        /// The data source supports data auto refresh, and runs will be scheduled
1697        /// for the past few days. Allows custom values to be set for each transfer
1698        /// config.
1699        CustomSlidingWindow,
1700        /// If set, the enum was initialized with an unknown value.
1701        ///
1702        /// Applications can examine the value using [DataRefreshType::value] or
1703        /// [DataRefreshType::name].
1704        UnknownValue(data_refresh_type::UnknownValue),
1705    }
1706
1707    #[doc(hidden)]
1708    pub mod data_refresh_type {
1709        #[allow(unused_imports)]
1710        use super::*;
1711        #[derive(Clone, Debug, PartialEq)]
1712        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1713    }
1714
1715    impl DataRefreshType {
1716        /// Gets the enum value.
1717        ///
1718        /// Returns `None` if the enum contains an unknown value deserialized from
1719        /// the string representation of enums.
1720        pub fn value(&self) -> std::option::Option<i32> {
1721            match self {
1722                Self::Unspecified => std::option::Option::Some(0),
1723                Self::SlidingWindow => std::option::Option::Some(1),
1724                Self::CustomSlidingWindow => std::option::Option::Some(2),
1725                Self::UnknownValue(u) => u.0.value(),
1726            }
1727        }
1728
1729        /// Gets the enum value as a string.
1730        ///
1731        /// Returns `None` if the enum contains an unknown value deserialized from
1732        /// the integer representation of enums.
1733        pub fn name(&self) -> std::option::Option<&str> {
1734            match self {
1735                Self::Unspecified => std::option::Option::Some("DATA_REFRESH_TYPE_UNSPECIFIED"),
1736                Self::SlidingWindow => std::option::Option::Some("SLIDING_WINDOW"),
1737                Self::CustomSlidingWindow => std::option::Option::Some("CUSTOM_SLIDING_WINDOW"),
1738                Self::UnknownValue(u) => u.0.name(),
1739            }
1740        }
1741    }
1742
1743    impl std::default::Default for DataRefreshType {
1744        fn default() -> Self {
1745            use std::convert::From;
1746            Self::from(0)
1747        }
1748    }
1749
1750    impl std::fmt::Display for DataRefreshType {
1751        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1752            wkt::internal::display_enum(f, self.name(), self.value())
1753        }
1754    }
1755
1756    impl std::convert::From<i32> for DataRefreshType {
1757        fn from(value: i32) -> Self {
1758            match value {
1759                0 => Self::Unspecified,
1760                1 => Self::SlidingWindow,
1761                2 => Self::CustomSlidingWindow,
1762                _ => Self::UnknownValue(data_refresh_type::UnknownValue(
1763                    wkt::internal::UnknownEnumValue::Integer(value),
1764                )),
1765            }
1766        }
1767    }
1768
1769    impl std::convert::From<&str> for DataRefreshType {
1770        fn from(value: &str) -> Self {
1771            use std::string::ToString;
1772            match value {
1773                "DATA_REFRESH_TYPE_UNSPECIFIED" => Self::Unspecified,
1774                "SLIDING_WINDOW" => Self::SlidingWindow,
1775                "CUSTOM_SLIDING_WINDOW" => Self::CustomSlidingWindow,
1776                _ => Self::UnknownValue(data_refresh_type::UnknownValue(
1777                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1778                )),
1779            }
1780        }
1781    }
1782
1783    impl serde::ser::Serialize for DataRefreshType {
1784        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1785        where
1786            S: serde::Serializer,
1787        {
1788            match self {
1789                Self::Unspecified => serializer.serialize_i32(0),
1790                Self::SlidingWindow => serializer.serialize_i32(1),
1791                Self::CustomSlidingWindow => serializer.serialize_i32(2),
1792                Self::UnknownValue(u) => u.0.serialize(serializer),
1793            }
1794        }
1795    }
1796
1797    impl<'de> serde::de::Deserialize<'de> for DataRefreshType {
1798        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1799        where
1800            D: serde::Deserializer<'de>,
1801        {
1802            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataRefreshType>::new(
1803                ".google.cloud.bigquery.datatransfer.v1.DataSource.DataRefreshType",
1804            ))
1805        }
1806    }
1807}
1808
1809/// A request to get data source info.
1810#[derive(Clone, Default, PartialEq)]
1811#[non_exhaustive]
1812pub struct GetDataSourceRequest {
1813    /// Required. The field will contain name of the resource requested, for
1814    /// example: `projects/{project_id}/dataSources/{data_source_id}` or
1815    /// `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`
1816    pub name: std::string::String,
1817
1818    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1819}
1820
1821impl GetDataSourceRequest {
1822    pub fn new() -> Self {
1823        std::default::Default::default()
1824    }
1825
1826    /// Sets the value of [name][crate::model::GetDataSourceRequest::name].
1827    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1828        self.name = v.into();
1829        self
1830    }
1831}
1832
1833impl wkt::message::Message for GetDataSourceRequest {
1834    fn typename() -> &'static str {
1835        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.GetDataSourceRequest"
1836    }
1837}
1838
1839#[doc(hidden)]
1840impl<'de> serde::de::Deserialize<'de> for GetDataSourceRequest {
1841    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1842    where
1843        D: serde::Deserializer<'de>,
1844    {
1845        #[allow(non_camel_case_types)]
1846        #[doc(hidden)]
1847        #[derive(PartialEq, Eq, Hash)]
1848        enum __FieldTag {
1849            __name,
1850            Unknown(std::string::String),
1851        }
1852        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1853            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1854            where
1855                D: serde::Deserializer<'de>,
1856            {
1857                struct Visitor;
1858                impl<'de> serde::de::Visitor<'de> for Visitor {
1859                    type Value = __FieldTag;
1860                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1861                        formatter.write_str("a field name for GetDataSourceRequest")
1862                    }
1863                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1864                    where
1865                        E: serde::de::Error,
1866                    {
1867                        use std::result::Result::Ok;
1868                        use std::string::ToString;
1869                        match value {
1870                            "name" => Ok(__FieldTag::__name),
1871                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1872                        }
1873                    }
1874                }
1875                deserializer.deserialize_identifier(Visitor)
1876            }
1877        }
1878        struct Visitor;
1879        impl<'de> serde::de::Visitor<'de> for Visitor {
1880            type Value = GetDataSourceRequest;
1881            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1882                formatter.write_str("struct GetDataSourceRequest")
1883            }
1884            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1885            where
1886                A: serde::de::MapAccess<'de>,
1887            {
1888                #[allow(unused_imports)]
1889                use serde::de::Error;
1890                use std::option::Option::Some;
1891                let mut fields = std::collections::HashSet::new();
1892                let mut result = Self::Value::new();
1893                while let Some(tag) = map.next_key::<__FieldTag>()? {
1894                    #[allow(clippy::match_single_binding)]
1895                    match tag {
1896                        __FieldTag::__name => {
1897                            if !fields.insert(__FieldTag::__name) {
1898                                return std::result::Result::Err(A::Error::duplicate_field(
1899                                    "multiple values for name",
1900                                ));
1901                            }
1902                            result.name = map
1903                                .next_value::<std::option::Option<std::string::String>>()?
1904                                .unwrap_or_default();
1905                        }
1906                        __FieldTag::Unknown(key) => {
1907                            let value = map.next_value::<serde_json::Value>()?;
1908                            result._unknown_fields.insert(key, value);
1909                        }
1910                    }
1911                }
1912                std::result::Result::Ok(result)
1913            }
1914        }
1915        deserializer.deserialize_any(Visitor)
1916    }
1917}
1918
1919#[doc(hidden)]
1920impl serde::ser::Serialize for GetDataSourceRequest {
1921    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1922    where
1923        S: serde::ser::Serializer,
1924    {
1925        use serde::ser::SerializeMap;
1926        #[allow(unused_imports)]
1927        use std::option::Option::Some;
1928        let mut state = serializer.serialize_map(std::option::Option::None)?;
1929        if !self.name.is_empty() {
1930            state.serialize_entry("name", &self.name)?;
1931        }
1932        if !self._unknown_fields.is_empty() {
1933            for (key, value) in self._unknown_fields.iter() {
1934                state.serialize_entry(key, &value)?;
1935            }
1936        }
1937        state.end()
1938    }
1939}
1940
1941impl std::fmt::Debug for GetDataSourceRequest {
1942    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1943        let mut debug_struct = f.debug_struct("GetDataSourceRequest");
1944        debug_struct.field("name", &self.name);
1945        if !self._unknown_fields.is_empty() {
1946            debug_struct.field("_unknown_fields", &self._unknown_fields);
1947        }
1948        debug_struct.finish()
1949    }
1950}
1951
1952/// Request to list supported data sources and their data transfer settings.
1953#[derive(Clone, Default, PartialEq)]
1954#[non_exhaustive]
1955pub struct ListDataSourcesRequest {
1956    /// Required. The BigQuery project id for which data sources should be
1957    /// returned. Must be in the form: `projects/{project_id}` or
1958    /// `projects/{project_id}/locations/{location_id}`
1959    pub parent: std::string::String,
1960
1961    /// Pagination token, which can be used to request a specific page
1962    /// of `ListDataSourcesRequest` list results. For multiple-page
1963    /// results, `ListDataSourcesResponse` outputs
1964    /// a `next_page` token, which can be used as the
1965    /// `page_token` value to request the next page of list results.
1966    pub page_token: std::string::String,
1967
1968    /// Page size. The default page size is the maximum value of 1000 results.
1969    pub page_size: i32,
1970
1971    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1972}
1973
1974impl ListDataSourcesRequest {
1975    pub fn new() -> Self {
1976        std::default::Default::default()
1977    }
1978
1979    /// Sets the value of [parent][crate::model::ListDataSourcesRequest::parent].
1980    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1981        self.parent = v.into();
1982        self
1983    }
1984
1985    /// Sets the value of [page_token][crate::model::ListDataSourcesRequest::page_token].
1986    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1987        self.page_token = v.into();
1988        self
1989    }
1990
1991    /// Sets the value of [page_size][crate::model::ListDataSourcesRequest::page_size].
1992    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1993        self.page_size = v.into();
1994        self
1995    }
1996}
1997
1998impl wkt::message::Message for ListDataSourcesRequest {
1999    fn typename() -> &'static str {
2000        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest"
2001    }
2002}
2003
2004#[doc(hidden)]
2005impl<'de> serde::de::Deserialize<'de> for ListDataSourcesRequest {
2006    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2007    where
2008        D: serde::Deserializer<'de>,
2009    {
2010        #[allow(non_camel_case_types)]
2011        #[doc(hidden)]
2012        #[derive(PartialEq, Eq, Hash)]
2013        enum __FieldTag {
2014            __parent,
2015            __page_token,
2016            __page_size,
2017            Unknown(std::string::String),
2018        }
2019        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2020            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2021            where
2022                D: serde::Deserializer<'de>,
2023            {
2024                struct Visitor;
2025                impl<'de> serde::de::Visitor<'de> for Visitor {
2026                    type Value = __FieldTag;
2027                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2028                        formatter.write_str("a field name for ListDataSourcesRequest")
2029                    }
2030                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2031                    where
2032                        E: serde::de::Error,
2033                    {
2034                        use std::result::Result::Ok;
2035                        use std::string::ToString;
2036                        match value {
2037                            "parent" => Ok(__FieldTag::__parent),
2038                            "pageToken" => Ok(__FieldTag::__page_token),
2039                            "page_token" => Ok(__FieldTag::__page_token),
2040                            "pageSize" => Ok(__FieldTag::__page_size),
2041                            "page_size" => Ok(__FieldTag::__page_size),
2042                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2043                        }
2044                    }
2045                }
2046                deserializer.deserialize_identifier(Visitor)
2047            }
2048        }
2049        struct Visitor;
2050        impl<'de> serde::de::Visitor<'de> for Visitor {
2051            type Value = ListDataSourcesRequest;
2052            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2053                formatter.write_str("struct ListDataSourcesRequest")
2054            }
2055            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2056            where
2057                A: serde::de::MapAccess<'de>,
2058            {
2059                #[allow(unused_imports)]
2060                use serde::de::Error;
2061                use std::option::Option::Some;
2062                let mut fields = std::collections::HashSet::new();
2063                let mut result = Self::Value::new();
2064                while let Some(tag) = map.next_key::<__FieldTag>()? {
2065                    #[allow(clippy::match_single_binding)]
2066                    match tag {
2067                        __FieldTag::__parent => {
2068                            if !fields.insert(__FieldTag::__parent) {
2069                                return std::result::Result::Err(A::Error::duplicate_field(
2070                                    "multiple values for parent",
2071                                ));
2072                            }
2073                            result.parent = map
2074                                .next_value::<std::option::Option<std::string::String>>()?
2075                                .unwrap_or_default();
2076                        }
2077                        __FieldTag::__page_token => {
2078                            if !fields.insert(__FieldTag::__page_token) {
2079                                return std::result::Result::Err(A::Error::duplicate_field(
2080                                    "multiple values for page_token",
2081                                ));
2082                            }
2083                            result.page_token = map
2084                                .next_value::<std::option::Option<std::string::String>>()?
2085                                .unwrap_or_default();
2086                        }
2087                        __FieldTag::__page_size => {
2088                            if !fields.insert(__FieldTag::__page_size) {
2089                                return std::result::Result::Err(A::Error::duplicate_field(
2090                                    "multiple values for page_size",
2091                                ));
2092                            }
2093                            struct __With(std::option::Option<i32>);
2094                            impl<'de> serde::de::Deserialize<'de> for __With {
2095                                fn deserialize<D>(
2096                                    deserializer: D,
2097                                ) -> std::result::Result<Self, D::Error>
2098                                where
2099                                    D: serde::de::Deserializer<'de>,
2100                                {
2101                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
2102                                }
2103                            }
2104                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
2105                        }
2106                        __FieldTag::Unknown(key) => {
2107                            let value = map.next_value::<serde_json::Value>()?;
2108                            result._unknown_fields.insert(key, value);
2109                        }
2110                    }
2111                }
2112                std::result::Result::Ok(result)
2113            }
2114        }
2115        deserializer.deserialize_any(Visitor)
2116    }
2117}
2118
2119#[doc(hidden)]
2120impl serde::ser::Serialize for ListDataSourcesRequest {
2121    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2122    where
2123        S: serde::ser::Serializer,
2124    {
2125        use serde::ser::SerializeMap;
2126        #[allow(unused_imports)]
2127        use std::option::Option::Some;
2128        let mut state = serializer.serialize_map(std::option::Option::None)?;
2129        if !self.parent.is_empty() {
2130            state.serialize_entry("parent", &self.parent)?;
2131        }
2132        if !self.page_token.is_empty() {
2133            state.serialize_entry("pageToken", &self.page_token)?;
2134        }
2135        if !wkt::internal::is_default(&self.page_size) {
2136            struct __With<'a>(&'a i32);
2137            impl<'a> serde::ser::Serialize for __With<'a> {
2138                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2139                where
2140                    S: serde::ser::Serializer,
2141                {
2142                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
2143                }
2144            }
2145            state.serialize_entry("pageSize", &__With(&self.page_size))?;
2146        }
2147        if !self._unknown_fields.is_empty() {
2148            for (key, value) in self._unknown_fields.iter() {
2149                state.serialize_entry(key, &value)?;
2150            }
2151        }
2152        state.end()
2153    }
2154}
2155
2156impl std::fmt::Debug for ListDataSourcesRequest {
2157    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2158        let mut debug_struct = f.debug_struct("ListDataSourcesRequest");
2159        debug_struct.field("parent", &self.parent);
2160        debug_struct.field("page_token", &self.page_token);
2161        debug_struct.field("page_size", &self.page_size);
2162        if !self._unknown_fields.is_empty() {
2163            debug_struct.field("_unknown_fields", &self._unknown_fields);
2164        }
2165        debug_struct.finish()
2166    }
2167}
2168
2169/// Returns list of supported data sources and their metadata.
2170#[derive(Clone, Default, PartialEq)]
2171#[non_exhaustive]
2172pub struct ListDataSourcesResponse {
2173    /// List of supported data sources and their transfer settings.
2174    pub data_sources: std::vec::Vec<crate::model::DataSource>,
2175
2176    /// Output only. The next-pagination token. For multiple-page list results,
2177    /// this token can be used as the
2178    /// `ListDataSourcesRequest.page_token`
2179    /// to request the next page of list results.
2180    pub next_page_token: std::string::String,
2181
2182    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2183}
2184
2185impl ListDataSourcesResponse {
2186    pub fn new() -> Self {
2187        std::default::Default::default()
2188    }
2189
2190    /// Sets the value of [data_sources][crate::model::ListDataSourcesResponse::data_sources].
2191    pub fn set_data_sources<T, V>(mut self, v: T) -> Self
2192    where
2193        T: std::iter::IntoIterator<Item = V>,
2194        V: std::convert::Into<crate::model::DataSource>,
2195    {
2196        use std::iter::Iterator;
2197        self.data_sources = v.into_iter().map(|i| i.into()).collect();
2198        self
2199    }
2200
2201    /// Sets the value of [next_page_token][crate::model::ListDataSourcesResponse::next_page_token].
2202    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2203        self.next_page_token = v.into();
2204        self
2205    }
2206}
2207
2208impl wkt::message::Message for ListDataSourcesResponse {
2209    fn typename() -> &'static str {
2210        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListDataSourcesResponse"
2211    }
2212}
2213
2214#[doc(hidden)]
2215impl gax::paginator::internal::PageableResponse for ListDataSourcesResponse {
2216    type PageItem = crate::model::DataSource;
2217
2218    fn items(self) -> std::vec::Vec<Self::PageItem> {
2219        self.data_sources
2220    }
2221
2222    fn next_page_token(&self) -> std::string::String {
2223        use std::clone::Clone;
2224        self.next_page_token.clone()
2225    }
2226}
2227
2228#[doc(hidden)]
2229impl<'de> serde::de::Deserialize<'de> for ListDataSourcesResponse {
2230    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2231    where
2232        D: serde::Deserializer<'de>,
2233    {
2234        #[allow(non_camel_case_types)]
2235        #[doc(hidden)]
2236        #[derive(PartialEq, Eq, Hash)]
2237        enum __FieldTag {
2238            __data_sources,
2239            __next_page_token,
2240            Unknown(std::string::String),
2241        }
2242        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2243            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2244            where
2245                D: serde::Deserializer<'de>,
2246            {
2247                struct Visitor;
2248                impl<'de> serde::de::Visitor<'de> for Visitor {
2249                    type Value = __FieldTag;
2250                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2251                        formatter.write_str("a field name for ListDataSourcesResponse")
2252                    }
2253                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2254                    where
2255                        E: serde::de::Error,
2256                    {
2257                        use std::result::Result::Ok;
2258                        use std::string::ToString;
2259                        match value {
2260                            "dataSources" => Ok(__FieldTag::__data_sources),
2261                            "data_sources" => Ok(__FieldTag::__data_sources),
2262                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
2263                            "next_page_token" => Ok(__FieldTag::__next_page_token),
2264                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2265                        }
2266                    }
2267                }
2268                deserializer.deserialize_identifier(Visitor)
2269            }
2270        }
2271        struct Visitor;
2272        impl<'de> serde::de::Visitor<'de> for Visitor {
2273            type Value = ListDataSourcesResponse;
2274            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2275                formatter.write_str("struct ListDataSourcesResponse")
2276            }
2277            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2278            where
2279                A: serde::de::MapAccess<'de>,
2280            {
2281                #[allow(unused_imports)]
2282                use serde::de::Error;
2283                use std::option::Option::Some;
2284                let mut fields = std::collections::HashSet::new();
2285                let mut result = Self::Value::new();
2286                while let Some(tag) = map.next_key::<__FieldTag>()? {
2287                    #[allow(clippy::match_single_binding)]
2288                    match tag {
2289                        __FieldTag::__data_sources => {
2290                            if !fields.insert(__FieldTag::__data_sources) {
2291                                return std::result::Result::Err(A::Error::duplicate_field(
2292                                    "multiple values for data_sources",
2293                                ));
2294                            }
2295                            result.data_sources = map.next_value::<std::option::Option<std::vec::Vec<crate::model::DataSource>>>()?.unwrap_or_default();
2296                        }
2297                        __FieldTag::__next_page_token => {
2298                            if !fields.insert(__FieldTag::__next_page_token) {
2299                                return std::result::Result::Err(A::Error::duplicate_field(
2300                                    "multiple values for next_page_token",
2301                                ));
2302                            }
2303                            result.next_page_token = map
2304                                .next_value::<std::option::Option<std::string::String>>()?
2305                                .unwrap_or_default();
2306                        }
2307                        __FieldTag::Unknown(key) => {
2308                            let value = map.next_value::<serde_json::Value>()?;
2309                            result._unknown_fields.insert(key, value);
2310                        }
2311                    }
2312                }
2313                std::result::Result::Ok(result)
2314            }
2315        }
2316        deserializer.deserialize_any(Visitor)
2317    }
2318}
2319
2320#[doc(hidden)]
2321impl serde::ser::Serialize for ListDataSourcesResponse {
2322    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2323    where
2324        S: serde::ser::Serializer,
2325    {
2326        use serde::ser::SerializeMap;
2327        #[allow(unused_imports)]
2328        use std::option::Option::Some;
2329        let mut state = serializer.serialize_map(std::option::Option::None)?;
2330        if !self.data_sources.is_empty() {
2331            state.serialize_entry("dataSources", &self.data_sources)?;
2332        }
2333        if !self.next_page_token.is_empty() {
2334            state.serialize_entry("nextPageToken", &self.next_page_token)?;
2335        }
2336        if !self._unknown_fields.is_empty() {
2337            for (key, value) in self._unknown_fields.iter() {
2338                state.serialize_entry(key, &value)?;
2339            }
2340        }
2341        state.end()
2342    }
2343}
2344
2345impl std::fmt::Debug for ListDataSourcesResponse {
2346    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2347        let mut debug_struct = f.debug_struct("ListDataSourcesResponse");
2348        debug_struct.field("data_sources", &self.data_sources);
2349        debug_struct.field("next_page_token", &self.next_page_token);
2350        if !self._unknown_fields.is_empty() {
2351            debug_struct.field("_unknown_fields", &self._unknown_fields);
2352        }
2353        debug_struct.finish()
2354    }
2355}
2356
2357/// A request to create a data transfer configuration. If new credentials are
2358/// needed for this transfer configuration, authorization info must be provided.
2359/// If authorization info is provided, the transfer configuration will be
2360/// associated with the user id corresponding to the authorization info.
2361/// Otherwise, the transfer configuration will be associated with the calling
2362/// user.
2363///
2364/// When using a cross project service account for creating a transfer config,
2365/// you must enable cross project service account usage. For more information,
2366/// see [Disable attachment of service accounts to resources in other
2367/// projects](https://cloud.google.com/resource-manager/docs/organization-policy/restricting-service-accounts#disable_cross_project_service_accounts).
2368#[derive(Clone, Default, PartialEq)]
2369#[non_exhaustive]
2370pub struct CreateTransferConfigRequest {
2371    /// Required. The BigQuery project id where the transfer configuration should
2372    /// be created. Must be in the format
2373    /// projects/{project_id}/locations/{location_id} or projects/{project_id}. If
2374    /// specified location and location of the destination bigquery dataset do not
2375    /// match - the request will fail.
2376    pub parent: std::string::String,
2377
2378    /// Required. Data transfer configuration to create.
2379    pub transfer_config: std::option::Option<crate::model::TransferConfig>,
2380
2381    /// Deprecated: Authorization code was required when
2382    /// `transferConfig.dataSourceId` is 'youtube_channel' but it is no longer used
2383    /// in any data sources. Use `version_info` instead.
2384    ///
2385    /// Optional OAuth2 authorization code to use with this transfer configuration.
2386    /// This is required only if `transferConfig.dataSourceId` is 'youtube_channel'
2387    /// and new credentials are needed, as indicated by `CheckValidCreds`. In order
2388    /// to obtain authorization_code, make a request to the following URL:
2389    ///
2390    /// * The \<var\>client_id\</var\> is the OAuth client_id of the data source as
2391    ///   returned by ListDataSources method.
2392    /// * \<var\>data_source_scopes\</var\> are the scopes returned by ListDataSources
2393    ///   method.
2394    ///
2395    /// Note that this should not be set when `service_account_name` is used to
2396    /// create the transfer config.
2397    #[deprecated]
2398    pub authorization_code: std::string::String,
2399
2400    /// Optional version info. This parameter replaces `authorization_code` which
2401    /// is no longer used in any data sources. This is required only if
2402    /// `transferConfig.dataSourceId` is 'youtube_channel' *or* new credentials
2403    /// are needed, as indicated by `CheckValidCreds`. In order to obtain version
2404    /// info, make a request to the following URL:
2405    ///
2406    /// * The \<var\>client_id\</var\> is the OAuth client_id of the data source as
2407    ///   returned by ListDataSources method.
2408    /// * \<var\>data_source_scopes\</var\> are the scopes returned by ListDataSources
2409    ///   method.
2410    ///
2411    /// Note that this should not be set when `service_account_name` is used to
2412    /// create the transfer config.
2413    pub version_info: std::string::String,
2414
2415    /// Optional service account email. If this field is set, the transfer config
2416    /// will be created with this service account's credentials. It requires that
2417    /// the requesting user calling this API has permissions to act as this service
2418    /// account.
2419    ///
2420    /// Note that not all data sources support service account credentials when
2421    /// creating a transfer config. For the latest list of data sources, read about
2422    /// [using service
2423    /// accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-accounts).
2424    pub service_account_name: std::string::String,
2425
2426    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2427}
2428
2429impl CreateTransferConfigRequest {
2430    pub fn new() -> Self {
2431        std::default::Default::default()
2432    }
2433
2434    /// Sets the value of [parent][crate::model::CreateTransferConfigRequest::parent].
2435    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2436        self.parent = v.into();
2437        self
2438    }
2439
2440    /// Sets the value of [transfer_config][crate::model::CreateTransferConfigRequest::transfer_config].
2441    pub fn set_transfer_config<T>(mut self, v: T) -> Self
2442    where
2443        T: std::convert::Into<crate::model::TransferConfig>,
2444    {
2445        self.transfer_config = std::option::Option::Some(v.into());
2446        self
2447    }
2448
2449    /// Sets or clears the value of [transfer_config][crate::model::CreateTransferConfigRequest::transfer_config].
2450    pub fn set_or_clear_transfer_config<T>(mut self, v: std::option::Option<T>) -> Self
2451    where
2452        T: std::convert::Into<crate::model::TransferConfig>,
2453    {
2454        self.transfer_config = v.map(|x| x.into());
2455        self
2456    }
2457
2458    /// Sets the value of [authorization_code][crate::model::CreateTransferConfigRequest::authorization_code].
2459    #[deprecated]
2460    pub fn set_authorization_code<T: std::convert::Into<std::string::String>>(
2461        mut self,
2462        v: T,
2463    ) -> Self {
2464        self.authorization_code = v.into();
2465        self
2466    }
2467
2468    /// Sets the value of [version_info][crate::model::CreateTransferConfigRequest::version_info].
2469    pub fn set_version_info<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2470        self.version_info = v.into();
2471        self
2472    }
2473
2474    /// Sets the value of [service_account_name][crate::model::CreateTransferConfigRequest::service_account_name].
2475    pub fn set_service_account_name<T: std::convert::Into<std::string::String>>(
2476        mut self,
2477        v: T,
2478    ) -> Self {
2479        self.service_account_name = v.into();
2480        self
2481    }
2482}
2483
2484impl wkt::message::Message for CreateTransferConfigRequest {
2485    fn typename() -> &'static str {
2486        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.CreateTransferConfigRequest"
2487    }
2488}
2489
2490#[doc(hidden)]
2491impl<'de> serde::de::Deserialize<'de> for CreateTransferConfigRequest {
2492    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2493    where
2494        D: serde::Deserializer<'de>,
2495    {
2496        #[allow(non_camel_case_types)]
2497        #[doc(hidden)]
2498        #[derive(PartialEq, Eq, Hash)]
2499        enum __FieldTag {
2500            __parent,
2501            __transfer_config,
2502            __authorization_code,
2503            __version_info,
2504            __service_account_name,
2505            Unknown(std::string::String),
2506        }
2507        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2508            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2509            where
2510                D: serde::Deserializer<'de>,
2511            {
2512                struct Visitor;
2513                impl<'de> serde::de::Visitor<'de> for Visitor {
2514                    type Value = __FieldTag;
2515                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2516                        formatter.write_str("a field name for CreateTransferConfigRequest")
2517                    }
2518                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2519                    where
2520                        E: serde::de::Error,
2521                    {
2522                        use std::result::Result::Ok;
2523                        use std::string::ToString;
2524                        match value {
2525                            "parent" => Ok(__FieldTag::__parent),
2526                            "transferConfig" => Ok(__FieldTag::__transfer_config),
2527                            "transfer_config" => Ok(__FieldTag::__transfer_config),
2528                            "authorizationCode" => Ok(__FieldTag::__authorization_code),
2529                            "authorization_code" => Ok(__FieldTag::__authorization_code),
2530                            "versionInfo" => Ok(__FieldTag::__version_info),
2531                            "version_info" => Ok(__FieldTag::__version_info),
2532                            "serviceAccountName" => Ok(__FieldTag::__service_account_name),
2533                            "service_account_name" => Ok(__FieldTag::__service_account_name),
2534                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2535                        }
2536                    }
2537                }
2538                deserializer.deserialize_identifier(Visitor)
2539            }
2540        }
2541        struct Visitor;
2542        impl<'de> serde::de::Visitor<'de> for Visitor {
2543            type Value = CreateTransferConfigRequest;
2544            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2545                formatter.write_str("struct CreateTransferConfigRequest")
2546            }
2547            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2548            where
2549                A: serde::de::MapAccess<'de>,
2550            {
2551                #[allow(unused_imports)]
2552                use serde::de::Error;
2553                use std::option::Option::Some;
2554                let mut fields = std::collections::HashSet::new();
2555                let mut result = Self::Value::new();
2556                while let Some(tag) = map.next_key::<__FieldTag>()? {
2557                    #[allow(clippy::match_single_binding)]
2558                    match tag {
2559                        __FieldTag::__parent => {
2560                            if !fields.insert(__FieldTag::__parent) {
2561                                return std::result::Result::Err(A::Error::duplicate_field(
2562                                    "multiple values for parent",
2563                                ));
2564                            }
2565                            result.parent = map
2566                                .next_value::<std::option::Option<std::string::String>>()?
2567                                .unwrap_or_default();
2568                        }
2569                        __FieldTag::__transfer_config => {
2570                            if !fields.insert(__FieldTag::__transfer_config) {
2571                                return std::result::Result::Err(A::Error::duplicate_field(
2572                                    "multiple values for transfer_config",
2573                                ));
2574                            }
2575                            result.transfer_config = map
2576                                .next_value::<std::option::Option<crate::model::TransferConfig>>(
2577                                )?;
2578                        }
2579                        __FieldTag::__authorization_code => {
2580                            if !fields.insert(__FieldTag::__authorization_code) {
2581                                return std::result::Result::Err(A::Error::duplicate_field(
2582                                    "multiple values for authorization_code",
2583                                ));
2584                            }
2585                            result.authorization_code = map
2586                                .next_value::<std::option::Option<std::string::String>>()?
2587                                .unwrap_or_default();
2588                        }
2589                        __FieldTag::__version_info => {
2590                            if !fields.insert(__FieldTag::__version_info) {
2591                                return std::result::Result::Err(A::Error::duplicate_field(
2592                                    "multiple values for version_info",
2593                                ));
2594                            }
2595                            result.version_info = map
2596                                .next_value::<std::option::Option<std::string::String>>()?
2597                                .unwrap_or_default();
2598                        }
2599                        __FieldTag::__service_account_name => {
2600                            if !fields.insert(__FieldTag::__service_account_name) {
2601                                return std::result::Result::Err(A::Error::duplicate_field(
2602                                    "multiple values for service_account_name",
2603                                ));
2604                            }
2605                            result.service_account_name = map
2606                                .next_value::<std::option::Option<std::string::String>>()?
2607                                .unwrap_or_default();
2608                        }
2609                        __FieldTag::Unknown(key) => {
2610                            let value = map.next_value::<serde_json::Value>()?;
2611                            result._unknown_fields.insert(key, value);
2612                        }
2613                    }
2614                }
2615                std::result::Result::Ok(result)
2616            }
2617        }
2618        deserializer.deserialize_any(Visitor)
2619    }
2620}
2621
2622#[doc(hidden)]
2623impl serde::ser::Serialize for CreateTransferConfigRequest {
2624    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2625    where
2626        S: serde::ser::Serializer,
2627    {
2628        use serde::ser::SerializeMap;
2629        #[allow(unused_imports)]
2630        use std::option::Option::Some;
2631        let mut state = serializer.serialize_map(std::option::Option::None)?;
2632        if !self.parent.is_empty() {
2633            state.serialize_entry("parent", &self.parent)?;
2634        }
2635        if self.transfer_config.is_some() {
2636            state.serialize_entry("transferConfig", &self.transfer_config)?;
2637        }
2638        if !self.authorization_code.is_empty() {
2639            state.serialize_entry("authorizationCode", &self.authorization_code)?;
2640        }
2641        if !self.version_info.is_empty() {
2642            state.serialize_entry("versionInfo", &self.version_info)?;
2643        }
2644        if !self.service_account_name.is_empty() {
2645            state.serialize_entry("serviceAccountName", &self.service_account_name)?;
2646        }
2647        if !self._unknown_fields.is_empty() {
2648            for (key, value) in self._unknown_fields.iter() {
2649                state.serialize_entry(key, &value)?;
2650            }
2651        }
2652        state.end()
2653    }
2654}
2655
2656impl std::fmt::Debug for CreateTransferConfigRequest {
2657    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2658        let mut debug_struct = f.debug_struct("CreateTransferConfigRequest");
2659        debug_struct.field("parent", &self.parent);
2660        debug_struct.field("transfer_config", &self.transfer_config);
2661        debug_struct.field("authorization_code", &self.authorization_code);
2662        debug_struct.field("version_info", &self.version_info);
2663        debug_struct.field("service_account_name", &self.service_account_name);
2664        if !self._unknown_fields.is_empty() {
2665            debug_struct.field("_unknown_fields", &self._unknown_fields);
2666        }
2667        debug_struct.finish()
2668    }
2669}
2670
2671/// A request to update a transfer configuration. To update the user id of the
2672/// transfer configuration, authorization info needs to be provided.
2673///
2674/// When using a cross project service account for updating a transfer config,
2675/// you must enable cross project service account usage. For more information,
2676/// see [Disable attachment of service accounts to resources in other
2677/// projects](https://cloud.google.com/resource-manager/docs/organization-policy/restricting-service-accounts#disable_cross_project_service_accounts).
2678#[derive(Clone, Default, PartialEq)]
2679#[non_exhaustive]
2680pub struct UpdateTransferConfigRequest {
2681    /// Required. Data transfer configuration to create.
2682    pub transfer_config: std::option::Option<crate::model::TransferConfig>,
2683
2684    /// Deprecated: Authorization code was required when
2685    /// `transferConfig.dataSourceId` is 'youtube_channel' but it is no longer used
2686    /// in any data sources. Use `version_info` instead.
2687    ///
2688    /// Optional OAuth2 authorization code to use with this transfer configuration.
2689    /// This is required only if `transferConfig.dataSourceId` is 'youtube_channel'
2690    /// and new credentials are needed, as indicated by `CheckValidCreds`. In order
2691    /// to obtain authorization_code, make a request to the following URL:
2692    ///
2693    /// * The \<var\>client_id\</var\> is the OAuth client_id of the data source as
2694    ///   returned by ListDataSources method.
2695    /// * \<var\>data_source_scopes\</var\> are the scopes returned by ListDataSources
2696    ///   method.
2697    ///
2698    /// Note that this should not be set when `service_account_name` is used to
2699    /// update the transfer config.
2700    #[deprecated]
2701    pub authorization_code: std::string::String,
2702
2703    /// Required. Required list of fields to be updated in this request.
2704    pub update_mask: std::option::Option<wkt::FieldMask>,
2705
2706    /// Optional version info. This parameter replaces `authorization_code` which
2707    /// is no longer used in any data sources. This is required only if
2708    /// `transferConfig.dataSourceId` is 'youtube_channel' *or* new credentials
2709    /// are needed, as indicated by `CheckValidCreds`. In order to obtain version
2710    /// info, make a request to the following URL:
2711    ///
2712    /// * The \<var\>client_id\</var\> is the OAuth client_id of the data source as
2713    ///   returned by ListDataSources method.
2714    /// * \<var\>data_source_scopes\</var\> are the scopes returned by ListDataSources
2715    ///   method.
2716    ///
2717    /// Note that this should not be set when `service_account_name` is used to
2718    /// update the transfer config.
2719    pub version_info: std::string::String,
2720
2721    /// Optional service account email. If this field is set, the transfer config
2722    /// will be created with this service account's credentials. It requires that
2723    /// the requesting user calling this API has permissions to act as this service
2724    /// account.
2725    ///
2726    /// Note that not all data sources support service account credentials when
2727    /// creating a transfer config. For the latest list of data sources, read about
2728    /// [using service
2729    /// accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-accounts).
2730    pub service_account_name: std::string::String,
2731
2732    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2733}
2734
2735impl UpdateTransferConfigRequest {
2736    pub fn new() -> Self {
2737        std::default::Default::default()
2738    }
2739
2740    /// Sets the value of [transfer_config][crate::model::UpdateTransferConfigRequest::transfer_config].
2741    pub fn set_transfer_config<T>(mut self, v: T) -> Self
2742    where
2743        T: std::convert::Into<crate::model::TransferConfig>,
2744    {
2745        self.transfer_config = std::option::Option::Some(v.into());
2746        self
2747    }
2748
2749    /// Sets or clears the value of [transfer_config][crate::model::UpdateTransferConfigRequest::transfer_config].
2750    pub fn set_or_clear_transfer_config<T>(mut self, v: std::option::Option<T>) -> Self
2751    where
2752        T: std::convert::Into<crate::model::TransferConfig>,
2753    {
2754        self.transfer_config = v.map(|x| x.into());
2755        self
2756    }
2757
2758    /// Sets the value of [authorization_code][crate::model::UpdateTransferConfigRequest::authorization_code].
2759    #[deprecated]
2760    pub fn set_authorization_code<T: std::convert::Into<std::string::String>>(
2761        mut self,
2762        v: T,
2763    ) -> Self {
2764        self.authorization_code = v.into();
2765        self
2766    }
2767
2768    /// Sets the value of [update_mask][crate::model::UpdateTransferConfigRequest::update_mask].
2769    pub fn set_update_mask<T>(mut self, v: T) -> Self
2770    where
2771        T: std::convert::Into<wkt::FieldMask>,
2772    {
2773        self.update_mask = std::option::Option::Some(v.into());
2774        self
2775    }
2776
2777    /// Sets or clears the value of [update_mask][crate::model::UpdateTransferConfigRequest::update_mask].
2778    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2779    where
2780        T: std::convert::Into<wkt::FieldMask>,
2781    {
2782        self.update_mask = v.map(|x| x.into());
2783        self
2784    }
2785
2786    /// Sets the value of [version_info][crate::model::UpdateTransferConfigRequest::version_info].
2787    pub fn set_version_info<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2788        self.version_info = v.into();
2789        self
2790    }
2791
2792    /// Sets the value of [service_account_name][crate::model::UpdateTransferConfigRequest::service_account_name].
2793    pub fn set_service_account_name<T: std::convert::Into<std::string::String>>(
2794        mut self,
2795        v: T,
2796    ) -> Self {
2797        self.service_account_name = v.into();
2798        self
2799    }
2800}
2801
2802impl wkt::message::Message for UpdateTransferConfigRequest {
2803    fn typename() -> &'static str {
2804        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.UpdateTransferConfigRequest"
2805    }
2806}
2807
2808#[doc(hidden)]
2809impl<'de> serde::de::Deserialize<'de> for UpdateTransferConfigRequest {
2810    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2811    where
2812        D: serde::Deserializer<'de>,
2813    {
2814        #[allow(non_camel_case_types)]
2815        #[doc(hidden)]
2816        #[derive(PartialEq, Eq, Hash)]
2817        enum __FieldTag {
2818            __transfer_config,
2819            __authorization_code,
2820            __update_mask,
2821            __version_info,
2822            __service_account_name,
2823            Unknown(std::string::String),
2824        }
2825        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2826            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2827            where
2828                D: serde::Deserializer<'de>,
2829            {
2830                struct Visitor;
2831                impl<'de> serde::de::Visitor<'de> for Visitor {
2832                    type Value = __FieldTag;
2833                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2834                        formatter.write_str("a field name for UpdateTransferConfigRequest")
2835                    }
2836                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2837                    where
2838                        E: serde::de::Error,
2839                    {
2840                        use std::result::Result::Ok;
2841                        use std::string::ToString;
2842                        match value {
2843                            "transferConfig" => Ok(__FieldTag::__transfer_config),
2844                            "transfer_config" => Ok(__FieldTag::__transfer_config),
2845                            "authorizationCode" => Ok(__FieldTag::__authorization_code),
2846                            "authorization_code" => Ok(__FieldTag::__authorization_code),
2847                            "updateMask" => Ok(__FieldTag::__update_mask),
2848                            "update_mask" => Ok(__FieldTag::__update_mask),
2849                            "versionInfo" => Ok(__FieldTag::__version_info),
2850                            "version_info" => Ok(__FieldTag::__version_info),
2851                            "serviceAccountName" => Ok(__FieldTag::__service_account_name),
2852                            "service_account_name" => Ok(__FieldTag::__service_account_name),
2853                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2854                        }
2855                    }
2856                }
2857                deserializer.deserialize_identifier(Visitor)
2858            }
2859        }
2860        struct Visitor;
2861        impl<'de> serde::de::Visitor<'de> for Visitor {
2862            type Value = UpdateTransferConfigRequest;
2863            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2864                formatter.write_str("struct UpdateTransferConfigRequest")
2865            }
2866            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2867            where
2868                A: serde::de::MapAccess<'de>,
2869            {
2870                #[allow(unused_imports)]
2871                use serde::de::Error;
2872                use std::option::Option::Some;
2873                let mut fields = std::collections::HashSet::new();
2874                let mut result = Self::Value::new();
2875                while let Some(tag) = map.next_key::<__FieldTag>()? {
2876                    #[allow(clippy::match_single_binding)]
2877                    match tag {
2878                        __FieldTag::__transfer_config => {
2879                            if !fields.insert(__FieldTag::__transfer_config) {
2880                                return std::result::Result::Err(A::Error::duplicate_field(
2881                                    "multiple values for transfer_config",
2882                                ));
2883                            }
2884                            result.transfer_config = map
2885                                .next_value::<std::option::Option<crate::model::TransferConfig>>(
2886                                )?;
2887                        }
2888                        __FieldTag::__authorization_code => {
2889                            if !fields.insert(__FieldTag::__authorization_code) {
2890                                return std::result::Result::Err(A::Error::duplicate_field(
2891                                    "multiple values for authorization_code",
2892                                ));
2893                            }
2894                            result.authorization_code = map
2895                                .next_value::<std::option::Option<std::string::String>>()?
2896                                .unwrap_or_default();
2897                        }
2898                        __FieldTag::__update_mask => {
2899                            if !fields.insert(__FieldTag::__update_mask) {
2900                                return std::result::Result::Err(A::Error::duplicate_field(
2901                                    "multiple values for update_mask",
2902                                ));
2903                            }
2904                            result.update_mask =
2905                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
2906                        }
2907                        __FieldTag::__version_info => {
2908                            if !fields.insert(__FieldTag::__version_info) {
2909                                return std::result::Result::Err(A::Error::duplicate_field(
2910                                    "multiple values for version_info",
2911                                ));
2912                            }
2913                            result.version_info = map
2914                                .next_value::<std::option::Option<std::string::String>>()?
2915                                .unwrap_or_default();
2916                        }
2917                        __FieldTag::__service_account_name => {
2918                            if !fields.insert(__FieldTag::__service_account_name) {
2919                                return std::result::Result::Err(A::Error::duplicate_field(
2920                                    "multiple values for service_account_name",
2921                                ));
2922                            }
2923                            result.service_account_name = map
2924                                .next_value::<std::option::Option<std::string::String>>()?
2925                                .unwrap_or_default();
2926                        }
2927                        __FieldTag::Unknown(key) => {
2928                            let value = map.next_value::<serde_json::Value>()?;
2929                            result._unknown_fields.insert(key, value);
2930                        }
2931                    }
2932                }
2933                std::result::Result::Ok(result)
2934            }
2935        }
2936        deserializer.deserialize_any(Visitor)
2937    }
2938}
2939
2940#[doc(hidden)]
2941impl serde::ser::Serialize for UpdateTransferConfigRequest {
2942    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2943    where
2944        S: serde::ser::Serializer,
2945    {
2946        use serde::ser::SerializeMap;
2947        #[allow(unused_imports)]
2948        use std::option::Option::Some;
2949        let mut state = serializer.serialize_map(std::option::Option::None)?;
2950        if self.transfer_config.is_some() {
2951            state.serialize_entry("transferConfig", &self.transfer_config)?;
2952        }
2953        if !self.authorization_code.is_empty() {
2954            state.serialize_entry("authorizationCode", &self.authorization_code)?;
2955        }
2956        if self.update_mask.is_some() {
2957            state.serialize_entry("updateMask", &self.update_mask)?;
2958        }
2959        if !self.version_info.is_empty() {
2960            state.serialize_entry("versionInfo", &self.version_info)?;
2961        }
2962        if !self.service_account_name.is_empty() {
2963            state.serialize_entry("serviceAccountName", &self.service_account_name)?;
2964        }
2965        if !self._unknown_fields.is_empty() {
2966            for (key, value) in self._unknown_fields.iter() {
2967                state.serialize_entry(key, &value)?;
2968            }
2969        }
2970        state.end()
2971    }
2972}
2973
2974impl std::fmt::Debug for UpdateTransferConfigRequest {
2975    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2976        let mut debug_struct = f.debug_struct("UpdateTransferConfigRequest");
2977        debug_struct.field("transfer_config", &self.transfer_config);
2978        debug_struct.field("authorization_code", &self.authorization_code);
2979        debug_struct.field("update_mask", &self.update_mask);
2980        debug_struct.field("version_info", &self.version_info);
2981        debug_struct.field("service_account_name", &self.service_account_name);
2982        if !self._unknown_fields.is_empty() {
2983            debug_struct.field("_unknown_fields", &self._unknown_fields);
2984        }
2985        debug_struct.finish()
2986    }
2987}
2988
2989/// A request to get data transfer information.
2990#[derive(Clone, Default, PartialEq)]
2991#[non_exhaustive]
2992pub struct GetTransferConfigRequest {
2993    /// Required. The field will contain name of the resource requested, for
2994    /// example: `projects/{project_id}/transferConfigs/{config_id}` or
2995    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
2996    pub name: std::string::String,
2997
2998    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2999}
3000
3001impl GetTransferConfigRequest {
3002    pub fn new() -> Self {
3003        std::default::Default::default()
3004    }
3005
3006    /// Sets the value of [name][crate::model::GetTransferConfigRequest::name].
3007    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3008        self.name = v.into();
3009        self
3010    }
3011}
3012
3013impl wkt::message::Message for GetTransferConfigRequest {
3014    fn typename() -> &'static str {
3015        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest"
3016    }
3017}
3018
3019#[doc(hidden)]
3020impl<'de> serde::de::Deserialize<'de> for GetTransferConfigRequest {
3021    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3022    where
3023        D: serde::Deserializer<'de>,
3024    {
3025        #[allow(non_camel_case_types)]
3026        #[doc(hidden)]
3027        #[derive(PartialEq, Eq, Hash)]
3028        enum __FieldTag {
3029            __name,
3030            Unknown(std::string::String),
3031        }
3032        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3033            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3034            where
3035                D: serde::Deserializer<'de>,
3036            {
3037                struct Visitor;
3038                impl<'de> serde::de::Visitor<'de> for Visitor {
3039                    type Value = __FieldTag;
3040                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3041                        formatter.write_str("a field name for GetTransferConfigRequest")
3042                    }
3043                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3044                    where
3045                        E: serde::de::Error,
3046                    {
3047                        use std::result::Result::Ok;
3048                        use std::string::ToString;
3049                        match value {
3050                            "name" => Ok(__FieldTag::__name),
3051                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3052                        }
3053                    }
3054                }
3055                deserializer.deserialize_identifier(Visitor)
3056            }
3057        }
3058        struct Visitor;
3059        impl<'de> serde::de::Visitor<'de> for Visitor {
3060            type Value = GetTransferConfigRequest;
3061            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3062                formatter.write_str("struct GetTransferConfigRequest")
3063            }
3064            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3065            where
3066                A: serde::de::MapAccess<'de>,
3067            {
3068                #[allow(unused_imports)]
3069                use serde::de::Error;
3070                use std::option::Option::Some;
3071                let mut fields = std::collections::HashSet::new();
3072                let mut result = Self::Value::new();
3073                while let Some(tag) = map.next_key::<__FieldTag>()? {
3074                    #[allow(clippy::match_single_binding)]
3075                    match tag {
3076                        __FieldTag::__name => {
3077                            if !fields.insert(__FieldTag::__name) {
3078                                return std::result::Result::Err(A::Error::duplicate_field(
3079                                    "multiple values for name",
3080                                ));
3081                            }
3082                            result.name = map
3083                                .next_value::<std::option::Option<std::string::String>>()?
3084                                .unwrap_or_default();
3085                        }
3086                        __FieldTag::Unknown(key) => {
3087                            let value = map.next_value::<serde_json::Value>()?;
3088                            result._unknown_fields.insert(key, value);
3089                        }
3090                    }
3091                }
3092                std::result::Result::Ok(result)
3093            }
3094        }
3095        deserializer.deserialize_any(Visitor)
3096    }
3097}
3098
3099#[doc(hidden)]
3100impl serde::ser::Serialize for GetTransferConfigRequest {
3101    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3102    where
3103        S: serde::ser::Serializer,
3104    {
3105        use serde::ser::SerializeMap;
3106        #[allow(unused_imports)]
3107        use std::option::Option::Some;
3108        let mut state = serializer.serialize_map(std::option::Option::None)?;
3109        if !self.name.is_empty() {
3110            state.serialize_entry("name", &self.name)?;
3111        }
3112        if !self._unknown_fields.is_empty() {
3113            for (key, value) in self._unknown_fields.iter() {
3114                state.serialize_entry(key, &value)?;
3115            }
3116        }
3117        state.end()
3118    }
3119}
3120
3121impl std::fmt::Debug for GetTransferConfigRequest {
3122    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3123        let mut debug_struct = f.debug_struct("GetTransferConfigRequest");
3124        debug_struct.field("name", &self.name);
3125        if !self._unknown_fields.is_empty() {
3126            debug_struct.field("_unknown_fields", &self._unknown_fields);
3127        }
3128        debug_struct.finish()
3129    }
3130}
3131
3132/// A request to delete data transfer information. All associated transfer runs
3133/// and log messages will be deleted as well.
3134#[derive(Clone, Default, PartialEq)]
3135#[non_exhaustive]
3136pub struct DeleteTransferConfigRequest {
3137    /// Required. The field will contain name of the resource requested, for
3138    /// example: `projects/{project_id}/transferConfigs/{config_id}` or
3139    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`
3140    pub name: std::string::String,
3141
3142    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3143}
3144
3145impl DeleteTransferConfigRequest {
3146    pub fn new() -> Self {
3147        std::default::Default::default()
3148    }
3149
3150    /// Sets the value of [name][crate::model::DeleteTransferConfigRequest::name].
3151    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3152        self.name = v.into();
3153        self
3154    }
3155}
3156
3157impl wkt::message::Message for DeleteTransferConfigRequest {
3158    fn typename() -> &'static str {
3159        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest"
3160    }
3161}
3162
3163#[doc(hidden)]
3164impl<'de> serde::de::Deserialize<'de> for DeleteTransferConfigRequest {
3165    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3166    where
3167        D: serde::Deserializer<'de>,
3168    {
3169        #[allow(non_camel_case_types)]
3170        #[doc(hidden)]
3171        #[derive(PartialEq, Eq, Hash)]
3172        enum __FieldTag {
3173            __name,
3174            Unknown(std::string::String),
3175        }
3176        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3177            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3178            where
3179                D: serde::Deserializer<'de>,
3180            {
3181                struct Visitor;
3182                impl<'de> serde::de::Visitor<'de> for Visitor {
3183                    type Value = __FieldTag;
3184                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3185                        formatter.write_str("a field name for DeleteTransferConfigRequest")
3186                    }
3187                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3188                    where
3189                        E: serde::de::Error,
3190                    {
3191                        use std::result::Result::Ok;
3192                        use std::string::ToString;
3193                        match value {
3194                            "name" => Ok(__FieldTag::__name),
3195                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3196                        }
3197                    }
3198                }
3199                deserializer.deserialize_identifier(Visitor)
3200            }
3201        }
3202        struct Visitor;
3203        impl<'de> serde::de::Visitor<'de> for Visitor {
3204            type Value = DeleteTransferConfigRequest;
3205            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3206                formatter.write_str("struct DeleteTransferConfigRequest")
3207            }
3208            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3209            where
3210                A: serde::de::MapAccess<'de>,
3211            {
3212                #[allow(unused_imports)]
3213                use serde::de::Error;
3214                use std::option::Option::Some;
3215                let mut fields = std::collections::HashSet::new();
3216                let mut result = Self::Value::new();
3217                while let Some(tag) = map.next_key::<__FieldTag>()? {
3218                    #[allow(clippy::match_single_binding)]
3219                    match tag {
3220                        __FieldTag::__name => {
3221                            if !fields.insert(__FieldTag::__name) {
3222                                return std::result::Result::Err(A::Error::duplicate_field(
3223                                    "multiple values for name",
3224                                ));
3225                            }
3226                            result.name = map
3227                                .next_value::<std::option::Option<std::string::String>>()?
3228                                .unwrap_or_default();
3229                        }
3230                        __FieldTag::Unknown(key) => {
3231                            let value = map.next_value::<serde_json::Value>()?;
3232                            result._unknown_fields.insert(key, value);
3233                        }
3234                    }
3235                }
3236                std::result::Result::Ok(result)
3237            }
3238        }
3239        deserializer.deserialize_any(Visitor)
3240    }
3241}
3242
3243#[doc(hidden)]
3244impl serde::ser::Serialize for DeleteTransferConfigRequest {
3245    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3246    where
3247        S: serde::ser::Serializer,
3248    {
3249        use serde::ser::SerializeMap;
3250        #[allow(unused_imports)]
3251        use std::option::Option::Some;
3252        let mut state = serializer.serialize_map(std::option::Option::None)?;
3253        if !self.name.is_empty() {
3254            state.serialize_entry("name", &self.name)?;
3255        }
3256        if !self._unknown_fields.is_empty() {
3257            for (key, value) in self._unknown_fields.iter() {
3258                state.serialize_entry(key, &value)?;
3259            }
3260        }
3261        state.end()
3262    }
3263}
3264
3265impl std::fmt::Debug for DeleteTransferConfigRequest {
3266    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3267        let mut debug_struct = f.debug_struct("DeleteTransferConfigRequest");
3268        debug_struct.field("name", &self.name);
3269        if !self._unknown_fields.is_empty() {
3270            debug_struct.field("_unknown_fields", &self._unknown_fields);
3271        }
3272        debug_struct.finish()
3273    }
3274}
3275
3276/// A request to get data transfer run information.
3277#[derive(Clone, Default, PartialEq)]
3278#[non_exhaustive]
3279pub struct GetTransferRunRequest {
3280    /// Required. The field will contain name of the resource requested, for
3281    /// example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`
3282    /// or
3283    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
3284    pub name: std::string::String,
3285
3286    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3287}
3288
3289impl GetTransferRunRequest {
3290    pub fn new() -> Self {
3291        std::default::Default::default()
3292    }
3293
3294    /// Sets the value of [name][crate::model::GetTransferRunRequest::name].
3295    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3296        self.name = v.into();
3297        self
3298    }
3299}
3300
3301impl wkt::message::Message for GetTransferRunRequest {
3302    fn typename() -> &'static str {
3303        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.GetTransferRunRequest"
3304    }
3305}
3306
3307#[doc(hidden)]
3308impl<'de> serde::de::Deserialize<'de> for GetTransferRunRequest {
3309    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3310    where
3311        D: serde::Deserializer<'de>,
3312    {
3313        #[allow(non_camel_case_types)]
3314        #[doc(hidden)]
3315        #[derive(PartialEq, Eq, Hash)]
3316        enum __FieldTag {
3317            __name,
3318            Unknown(std::string::String),
3319        }
3320        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3321            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3322            where
3323                D: serde::Deserializer<'de>,
3324            {
3325                struct Visitor;
3326                impl<'de> serde::de::Visitor<'de> for Visitor {
3327                    type Value = __FieldTag;
3328                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3329                        formatter.write_str("a field name for GetTransferRunRequest")
3330                    }
3331                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3332                    where
3333                        E: serde::de::Error,
3334                    {
3335                        use std::result::Result::Ok;
3336                        use std::string::ToString;
3337                        match value {
3338                            "name" => Ok(__FieldTag::__name),
3339                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3340                        }
3341                    }
3342                }
3343                deserializer.deserialize_identifier(Visitor)
3344            }
3345        }
3346        struct Visitor;
3347        impl<'de> serde::de::Visitor<'de> for Visitor {
3348            type Value = GetTransferRunRequest;
3349            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3350                formatter.write_str("struct GetTransferRunRequest")
3351            }
3352            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3353            where
3354                A: serde::de::MapAccess<'de>,
3355            {
3356                #[allow(unused_imports)]
3357                use serde::de::Error;
3358                use std::option::Option::Some;
3359                let mut fields = std::collections::HashSet::new();
3360                let mut result = Self::Value::new();
3361                while let Some(tag) = map.next_key::<__FieldTag>()? {
3362                    #[allow(clippy::match_single_binding)]
3363                    match tag {
3364                        __FieldTag::__name => {
3365                            if !fields.insert(__FieldTag::__name) {
3366                                return std::result::Result::Err(A::Error::duplicate_field(
3367                                    "multiple values for name",
3368                                ));
3369                            }
3370                            result.name = map
3371                                .next_value::<std::option::Option<std::string::String>>()?
3372                                .unwrap_or_default();
3373                        }
3374                        __FieldTag::Unknown(key) => {
3375                            let value = map.next_value::<serde_json::Value>()?;
3376                            result._unknown_fields.insert(key, value);
3377                        }
3378                    }
3379                }
3380                std::result::Result::Ok(result)
3381            }
3382        }
3383        deserializer.deserialize_any(Visitor)
3384    }
3385}
3386
3387#[doc(hidden)]
3388impl serde::ser::Serialize for GetTransferRunRequest {
3389    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3390    where
3391        S: serde::ser::Serializer,
3392    {
3393        use serde::ser::SerializeMap;
3394        #[allow(unused_imports)]
3395        use std::option::Option::Some;
3396        let mut state = serializer.serialize_map(std::option::Option::None)?;
3397        if !self.name.is_empty() {
3398            state.serialize_entry("name", &self.name)?;
3399        }
3400        if !self._unknown_fields.is_empty() {
3401            for (key, value) in self._unknown_fields.iter() {
3402                state.serialize_entry(key, &value)?;
3403            }
3404        }
3405        state.end()
3406    }
3407}
3408
3409impl std::fmt::Debug for GetTransferRunRequest {
3410    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3411        let mut debug_struct = f.debug_struct("GetTransferRunRequest");
3412        debug_struct.field("name", &self.name);
3413        if !self._unknown_fields.is_empty() {
3414            debug_struct.field("_unknown_fields", &self._unknown_fields);
3415        }
3416        debug_struct.finish()
3417    }
3418}
3419
3420/// A request to delete data transfer run information.
3421#[derive(Clone, Default, PartialEq)]
3422#[non_exhaustive]
3423pub struct DeleteTransferRunRequest {
3424    /// Required. The field will contain name of the resource requested, for
3425    /// example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}`
3426    /// or
3427    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
3428    pub name: std::string::String,
3429
3430    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3431}
3432
3433impl DeleteTransferRunRequest {
3434    pub fn new() -> Self {
3435        std::default::Default::default()
3436    }
3437
3438    /// Sets the value of [name][crate::model::DeleteTransferRunRequest::name].
3439    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3440        self.name = v.into();
3441        self
3442    }
3443}
3444
3445impl wkt::message::Message for DeleteTransferRunRequest {
3446    fn typename() -> &'static str {
3447        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.DeleteTransferRunRequest"
3448    }
3449}
3450
3451#[doc(hidden)]
3452impl<'de> serde::de::Deserialize<'de> for DeleteTransferRunRequest {
3453    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3454    where
3455        D: serde::Deserializer<'de>,
3456    {
3457        #[allow(non_camel_case_types)]
3458        #[doc(hidden)]
3459        #[derive(PartialEq, Eq, Hash)]
3460        enum __FieldTag {
3461            __name,
3462            Unknown(std::string::String),
3463        }
3464        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3465            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3466            where
3467                D: serde::Deserializer<'de>,
3468            {
3469                struct Visitor;
3470                impl<'de> serde::de::Visitor<'de> for Visitor {
3471                    type Value = __FieldTag;
3472                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3473                        formatter.write_str("a field name for DeleteTransferRunRequest")
3474                    }
3475                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3476                    where
3477                        E: serde::de::Error,
3478                    {
3479                        use std::result::Result::Ok;
3480                        use std::string::ToString;
3481                        match value {
3482                            "name" => Ok(__FieldTag::__name),
3483                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3484                        }
3485                    }
3486                }
3487                deserializer.deserialize_identifier(Visitor)
3488            }
3489        }
3490        struct Visitor;
3491        impl<'de> serde::de::Visitor<'de> for Visitor {
3492            type Value = DeleteTransferRunRequest;
3493            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3494                formatter.write_str("struct DeleteTransferRunRequest")
3495            }
3496            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3497            where
3498                A: serde::de::MapAccess<'de>,
3499            {
3500                #[allow(unused_imports)]
3501                use serde::de::Error;
3502                use std::option::Option::Some;
3503                let mut fields = std::collections::HashSet::new();
3504                let mut result = Self::Value::new();
3505                while let Some(tag) = map.next_key::<__FieldTag>()? {
3506                    #[allow(clippy::match_single_binding)]
3507                    match tag {
3508                        __FieldTag::__name => {
3509                            if !fields.insert(__FieldTag::__name) {
3510                                return std::result::Result::Err(A::Error::duplicate_field(
3511                                    "multiple values for name",
3512                                ));
3513                            }
3514                            result.name = map
3515                                .next_value::<std::option::Option<std::string::String>>()?
3516                                .unwrap_or_default();
3517                        }
3518                        __FieldTag::Unknown(key) => {
3519                            let value = map.next_value::<serde_json::Value>()?;
3520                            result._unknown_fields.insert(key, value);
3521                        }
3522                    }
3523                }
3524                std::result::Result::Ok(result)
3525            }
3526        }
3527        deserializer.deserialize_any(Visitor)
3528    }
3529}
3530
3531#[doc(hidden)]
3532impl serde::ser::Serialize for DeleteTransferRunRequest {
3533    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3534    where
3535        S: serde::ser::Serializer,
3536    {
3537        use serde::ser::SerializeMap;
3538        #[allow(unused_imports)]
3539        use std::option::Option::Some;
3540        let mut state = serializer.serialize_map(std::option::Option::None)?;
3541        if !self.name.is_empty() {
3542            state.serialize_entry("name", &self.name)?;
3543        }
3544        if !self._unknown_fields.is_empty() {
3545            for (key, value) in self._unknown_fields.iter() {
3546                state.serialize_entry(key, &value)?;
3547            }
3548        }
3549        state.end()
3550    }
3551}
3552
3553impl std::fmt::Debug for DeleteTransferRunRequest {
3554    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3555        let mut debug_struct = f.debug_struct("DeleteTransferRunRequest");
3556        debug_struct.field("name", &self.name);
3557        if !self._unknown_fields.is_empty() {
3558            debug_struct.field("_unknown_fields", &self._unknown_fields);
3559        }
3560        debug_struct.finish()
3561    }
3562}
3563
3564/// A request to list data transfers configured for a BigQuery project.
3565#[derive(Clone, Default, PartialEq)]
3566#[non_exhaustive]
3567pub struct ListTransferConfigsRequest {
3568    /// Required. The BigQuery project id for which transfer configs
3569    /// should be returned: `projects/{project_id}` or
3570    /// `projects/{project_id}/locations/{location_id}`
3571    pub parent: std::string::String,
3572
3573    /// When specified, only configurations of requested data sources are returned.
3574    pub data_source_ids: std::vec::Vec<std::string::String>,
3575
3576    /// Pagination token, which can be used to request a specific page
3577    /// of `ListTransfersRequest` list results. For multiple-page
3578    /// results, `ListTransfersResponse` outputs
3579    /// a `next_page` token, which can be used as the
3580    /// `page_token` value to request the next page of list results.
3581    pub page_token: std::string::String,
3582
3583    /// Page size. The default page size is the maximum value of 1000 results.
3584    pub page_size: i32,
3585
3586    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3587}
3588
3589impl ListTransferConfigsRequest {
3590    pub fn new() -> Self {
3591        std::default::Default::default()
3592    }
3593
3594    /// Sets the value of [parent][crate::model::ListTransferConfigsRequest::parent].
3595    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3596        self.parent = v.into();
3597        self
3598    }
3599
3600    /// Sets the value of [data_source_ids][crate::model::ListTransferConfigsRequest::data_source_ids].
3601    pub fn set_data_source_ids<T, V>(mut self, v: T) -> Self
3602    where
3603        T: std::iter::IntoIterator<Item = V>,
3604        V: std::convert::Into<std::string::String>,
3605    {
3606        use std::iter::Iterator;
3607        self.data_source_ids = v.into_iter().map(|i| i.into()).collect();
3608        self
3609    }
3610
3611    /// Sets the value of [page_token][crate::model::ListTransferConfigsRequest::page_token].
3612    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3613        self.page_token = v.into();
3614        self
3615    }
3616
3617    /// Sets the value of [page_size][crate::model::ListTransferConfigsRequest::page_size].
3618    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3619        self.page_size = v.into();
3620        self
3621    }
3622}
3623
3624impl wkt::message::Message for ListTransferConfigsRequest {
3625    fn typename() -> &'static str {
3626        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferConfigsRequest"
3627    }
3628}
3629
3630#[doc(hidden)]
3631impl<'de> serde::de::Deserialize<'de> for ListTransferConfigsRequest {
3632    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3633    where
3634        D: serde::Deserializer<'de>,
3635    {
3636        #[allow(non_camel_case_types)]
3637        #[doc(hidden)]
3638        #[derive(PartialEq, Eq, Hash)]
3639        enum __FieldTag {
3640            __parent,
3641            __data_source_ids,
3642            __page_token,
3643            __page_size,
3644            Unknown(std::string::String),
3645        }
3646        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3647            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3648            where
3649                D: serde::Deserializer<'de>,
3650            {
3651                struct Visitor;
3652                impl<'de> serde::de::Visitor<'de> for Visitor {
3653                    type Value = __FieldTag;
3654                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3655                        formatter.write_str("a field name for ListTransferConfigsRequest")
3656                    }
3657                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3658                    where
3659                        E: serde::de::Error,
3660                    {
3661                        use std::result::Result::Ok;
3662                        use std::string::ToString;
3663                        match value {
3664                            "parent" => Ok(__FieldTag::__parent),
3665                            "dataSourceIds" => Ok(__FieldTag::__data_source_ids),
3666                            "data_source_ids" => Ok(__FieldTag::__data_source_ids),
3667                            "pageToken" => Ok(__FieldTag::__page_token),
3668                            "page_token" => Ok(__FieldTag::__page_token),
3669                            "pageSize" => Ok(__FieldTag::__page_size),
3670                            "page_size" => Ok(__FieldTag::__page_size),
3671                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3672                        }
3673                    }
3674                }
3675                deserializer.deserialize_identifier(Visitor)
3676            }
3677        }
3678        struct Visitor;
3679        impl<'de> serde::de::Visitor<'de> for Visitor {
3680            type Value = ListTransferConfigsRequest;
3681            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3682                formatter.write_str("struct ListTransferConfigsRequest")
3683            }
3684            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3685            where
3686                A: serde::de::MapAccess<'de>,
3687            {
3688                #[allow(unused_imports)]
3689                use serde::de::Error;
3690                use std::option::Option::Some;
3691                let mut fields = std::collections::HashSet::new();
3692                let mut result = Self::Value::new();
3693                while let Some(tag) = map.next_key::<__FieldTag>()? {
3694                    #[allow(clippy::match_single_binding)]
3695                    match tag {
3696                        __FieldTag::__parent => {
3697                            if !fields.insert(__FieldTag::__parent) {
3698                                return std::result::Result::Err(A::Error::duplicate_field(
3699                                    "multiple values for parent",
3700                                ));
3701                            }
3702                            result.parent = map
3703                                .next_value::<std::option::Option<std::string::String>>()?
3704                                .unwrap_or_default();
3705                        }
3706                        __FieldTag::__data_source_ids => {
3707                            if !fields.insert(__FieldTag::__data_source_ids) {
3708                                return std::result::Result::Err(A::Error::duplicate_field(
3709                                    "multiple values for data_source_ids",
3710                                ));
3711                            }
3712                            result.data_source_ids = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
3713                        }
3714                        __FieldTag::__page_token => {
3715                            if !fields.insert(__FieldTag::__page_token) {
3716                                return std::result::Result::Err(A::Error::duplicate_field(
3717                                    "multiple values for page_token",
3718                                ));
3719                            }
3720                            result.page_token = map
3721                                .next_value::<std::option::Option<std::string::String>>()?
3722                                .unwrap_or_default();
3723                        }
3724                        __FieldTag::__page_size => {
3725                            if !fields.insert(__FieldTag::__page_size) {
3726                                return std::result::Result::Err(A::Error::duplicate_field(
3727                                    "multiple values for page_size",
3728                                ));
3729                            }
3730                            struct __With(std::option::Option<i32>);
3731                            impl<'de> serde::de::Deserialize<'de> for __With {
3732                                fn deserialize<D>(
3733                                    deserializer: D,
3734                                ) -> std::result::Result<Self, D::Error>
3735                                where
3736                                    D: serde::de::Deserializer<'de>,
3737                                {
3738                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
3739                                }
3740                            }
3741                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
3742                        }
3743                        __FieldTag::Unknown(key) => {
3744                            let value = map.next_value::<serde_json::Value>()?;
3745                            result._unknown_fields.insert(key, value);
3746                        }
3747                    }
3748                }
3749                std::result::Result::Ok(result)
3750            }
3751        }
3752        deserializer.deserialize_any(Visitor)
3753    }
3754}
3755
3756#[doc(hidden)]
3757impl serde::ser::Serialize for ListTransferConfigsRequest {
3758    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3759    where
3760        S: serde::ser::Serializer,
3761    {
3762        use serde::ser::SerializeMap;
3763        #[allow(unused_imports)]
3764        use std::option::Option::Some;
3765        let mut state = serializer.serialize_map(std::option::Option::None)?;
3766        if !self.parent.is_empty() {
3767            state.serialize_entry("parent", &self.parent)?;
3768        }
3769        if !self.data_source_ids.is_empty() {
3770            state.serialize_entry("dataSourceIds", &self.data_source_ids)?;
3771        }
3772        if !self.page_token.is_empty() {
3773            state.serialize_entry("pageToken", &self.page_token)?;
3774        }
3775        if !wkt::internal::is_default(&self.page_size) {
3776            struct __With<'a>(&'a i32);
3777            impl<'a> serde::ser::Serialize for __With<'a> {
3778                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3779                where
3780                    S: serde::ser::Serializer,
3781                {
3782                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
3783                }
3784            }
3785            state.serialize_entry("pageSize", &__With(&self.page_size))?;
3786        }
3787        if !self._unknown_fields.is_empty() {
3788            for (key, value) in self._unknown_fields.iter() {
3789                state.serialize_entry(key, &value)?;
3790            }
3791        }
3792        state.end()
3793    }
3794}
3795
3796impl std::fmt::Debug for ListTransferConfigsRequest {
3797    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3798        let mut debug_struct = f.debug_struct("ListTransferConfigsRequest");
3799        debug_struct.field("parent", &self.parent);
3800        debug_struct.field("data_source_ids", &self.data_source_ids);
3801        debug_struct.field("page_token", &self.page_token);
3802        debug_struct.field("page_size", &self.page_size);
3803        if !self._unknown_fields.is_empty() {
3804            debug_struct.field("_unknown_fields", &self._unknown_fields);
3805        }
3806        debug_struct.finish()
3807    }
3808}
3809
3810/// The returned list of pipelines in the project.
3811#[derive(Clone, Default, PartialEq)]
3812#[non_exhaustive]
3813pub struct ListTransferConfigsResponse {
3814    /// Output only. The stored pipeline transfer configurations.
3815    pub transfer_configs: std::vec::Vec<crate::model::TransferConfig>,
3816
3817    /// Output only. The next-pagination token. For multiple-page list results,
3818    /// this token can be used as the
3819    /// `ListTransferConfigsRequest.page_token`
3820    /// to request the next page of list results.
3821    pub next_page_token: std::string::String,
3822
3823    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3824}
3825
3826impl ListTransferConfigsResponse {
3827    pub fn new() -> Self {
3828        std::default::Default::default()
3829    }
3830
3831    /// Sets the value of [transfer_configs][crate::model::ListTransferConfigsResponse::transfer_configs].
3832    pub fn set_transfer_configs<T, V>(mut self, v: T) -> Self
3833    where
3834        T: std::iter::IntoIterator<Item = V>,
3835        V: std::convert::Into<crate::model::TransferConfig>,
3836    {
3837        use std::iter::Iterator;
3838        self.transfer_configs = v.into_iter().map(|i| i.into()).collect();
3839        self
3840    }
3841
3842    /// Sets the value of [next_page_token][crate::model::ListTransferConfigsResponse::next_page_token].
3843    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3844        self.next_page_token = v.into();
3845        self
3846    }
3847}
3848
3849impl wkt::message::Message for ListTransferConfigsResponse {
3850    fn typename() -> &'static str {
3851        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferConfigsResponse"
3852    }
3853}
3854
3855#[doc(hidden)]
3856impl gax::paginator::internal::PageableResponse for ListTransferConfigsResponse {
3857    type PageItem = crate::model::TransferConfig;
3858
3859    fn items(self) -> std::vec::Vec<Self::PageItem> {
3860        self.transfer_configs
3861    }
3862
3863    fn next_page_token(&self) -> std::string::String {
3864        use std::clone::Clone;
3865        self.next_page_token.clone()
3866    }
3867}
3868
3869#[doc(hidden)]
3870impl<'de> serde::de::Deserialize<'de> for ListTransferConfigsResponse {
3871    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3872    where
3873        D: serde::Deserializer<'de>,
3874    {
3875        #[allow(non_camel_case_types)]
3876        #[doc(hidden)]
3877        #[derive(PartialEq, Eq, Hash)]
3878        enum __FieldTag {
3879            __transfer_configs,
3880            __next_page_token,
3881            Unknown(std::string::String),
3882        }
3883        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3884            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3885            where
3886                D: serde::Deserializer<'de>,
3887            {
3888                struct Visitor;
3889                impl<'de> serde::de::Visitor<'de> for Visitor {
3890                    type Value = __FieldTag;
3891                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3892                        formatter.write_str("a field name for ListTransferConfigsResponse")
3893                    }
3894                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3895                    where
3896                        E: serde::de::Error,
3897                    {
3898                        use std::result::Result::Ok;
3899                        use std::string::ToString;
3900                        match value {
3901                            "transferConfigs" => Ok(__FieldTag::__transfer_configs),
3902                            "transfer_configs" => Ok(__FieldTag::__transfer_configs),
3903                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
3904                            "next_page_token" => Ok(__FieldTag::__next_page_token),
3905                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3906                        }
3907                    }
3908                }
3909                deserializer.deserialize_identifier(Visitor)
3910            }
3911        }
3912        struct Visitor;
3913        impl<'de> serde::de::Visitor<'de> for Visitor {
3914            type Value = ListTransferConfigsResponse;
3915            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3916                formatter.write_str("struct ListTransferConfigsResponse")
3917            }
3918            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3919            where
3920                A: serde::de::MapAccess<'de>,
3921            {
3922                #[allow(unused_imports)]
3923                use serde::de::Error;
3924                use std::option::Option::Some;
3925                let mut fields = std::collections::HashSet::new();
3926                let mut result = Self::Value::new();
3927                while let Some(tag) = map.next_key::<__FieldTag>()? {
3928                    #[allow(clippy::match_single_binding)]
3929                    match tag {
3930                        __FieldTag::__transfer_configs => {
3931                            if !fields.insert(__FieldTag::__transfer_configs) {
3932                                return std::result::Result::Err(A::Error::duplicate_field(
3933                                    "multiple values for transfer_configs",
3934                                ));
3935                            }
3936                            result.transfer_configs =
3937                                map.next_value::<std::option::Option<
3938                                    std::vec::Vec<crate::model::TransferConfig>,
3939                                >>()?
3940                                .unwrap_or_default();
3941                        }
3942                        __FieldTag::__next_page_token => {
3943                            if !fields.insert(__FieldTag::__next_page_token) {
3944                                return std::result::Result::Err(A::Error::duplicate_field(
3945                                    "multiple values for next_page_token",
3946                                ));
3947                            }
3948                            result.next_page_token = map
3949                                .next_value::<std::option::Option<std::string::String>>()?
3950                                .unwrap_or_default();
3951                        }
3952                        __FieldTag::Unknown(key) => {
3953                            let value = map.next_value::<serde_json::Value>()?;
3954                            result._unknown_fields.insert(key, value);
3955                        }
3956                    }
3957                }
3958                std::result::Result::Ok(result)
3959            }
3960        }
3961        deserializer.deserialize_any(Visitor)
3962    }
3963}
3964
3965#[doc(hidden)]
3966impl serde::ser::Serialize for ListTransferConfigsResponse {
3967    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3968    where
3969        S: serde::ser::Serializer,
3970    {
3971        use serde::ser::SerializeMap;
3972        #[allow(unused_imports)]
3973        use std::option::Option::Some;
3974        let mut state = serializer.serialize_map(std::option::Option::None)?;
3975        if !self.transfer_configs.is_empty() {
3976            state.serialize_entry("transferConfigs", &self.transfer_configs)?;
3977        }
3978        if !self.next_page_token.is_empty() {
3979            state.serialize_entry("nextPageToken", &self.next_page_token)?;
3980        }
3981        if !self._unknown_fields.is_empty() {
3982            for (key, value) in self._unknown_fields.iter() {
3983                state.serialize_entry(key, &value)?;
3984            }
3985        }
3986        state.end()
3987    }
3988}
3989
3990impl std::fmt::Debug for ListTransferConfigsResponse {
3991    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3992        let mut debug_struct = f.debug_struct("ListTransferConfigsResponse");
3993        debug_struct.field("transfer_configs", &self.transfer_configs);
3994        debug_struct.field("next_page_token", &self.next_page_token);
3995        if !self._unknown_fields.is_empty() {
3996            debug_struct.field("_unknown_fields", &self._unknown_fields);
3997        }
3998        debug_struct.finish()
3999    }
4000}
4001
4002/// A request to list data transfer runs.
4003#[derive(Clone, Default, PartialEq)]
4004#[non_exhaustive]
4005pub struct ListTransferRunsRequest {
4006    /// Required. Name of transfer configuration for which transfer runs should be
4007    /// retrieved. Format of transfer configuration resource name is:
4008    /// `projects/{project_id}/transferConfigs/{config_id}` or
4009    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
4010    pub parent: std::string::String,
4011
4012    /// When specified, only transfer runs with requested states are returned.
4013    pub states: std::vec::Vec<crate::model::TransferState>,
4014
4015    /// Pagination token, which can be used to request a specific page
4016    /// of `ListTransferRunsRequest` list results. For multiple-page
4017    /// results, `ListTransferRunsResponse` outputs
4018    /// a `next_page` token, which can be used as the
4019    /// `page_token` value to request the next page of list results.
4020    pub page_token: std::string::String,
4021
4022    /// Page size. The default page size is the maximum value of 1000 results.
4023    pub page_size: i32,
4024
4025    /// Indicates how run attempts are to be pulled.
4026    pub run_attempt: crate::model::list_transfer_runs_request::RunAttempt,
4027
4028    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4029}
4030
4031impl ListTransferRunsRequest {
4032    pub fn new() -> Self {
4033        std::default::Default::default()
4034    }
4035
4036    /// Sets the value of [parent][crate::model::ListTransferRunsRequest::parent].
4037    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4038        self.parent = v.into();
4039        self
4040    }
4041
4042    /// Sets the value of [states][crate::model::ListTransferRunsRequest::states].
4043    pub fn set_states<T, V>(mut self, v: T) -> Self
4044    where
4045        T: std::iter::IntoIterator<Item = V>,
4046        V: std::convert::Into<crate::model::TransferState>,
4047    {
4048        use std::iter::Iterator;
4049        self.states = v.into_iter().map(|i| i.into()).collect();
4050        self
4051    }
4052
4053    /// Sets the value of [page_token][crate::model::ListTransferRunsRequest::page_token].
4054    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4055        self.page_token = v.into();
4056        self
4057    }
4058
4059    /// Sets the value of [page_size][crate::model::ListTransferRunsRequest::page_size].
4060    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4061        self.page_size = v.into();
4062        self
4063    }
4064
4065    /// Sets the value of [run_attempt][crate::model::ListTransferRunsRequest::run_attempt].
4066    pub fn set_run_attempt<
4067        T: std::convert::Into<crate::model::list_transfer_runs_request::RunAttempt>,
4068    >(
4069        mut self,
4070        v: T,
4071    ) -> Self {
4072        self.run_attempt = v.into();
4073        self
4074    }
4075}
4076
4077impl wkt::message::Message for ListTransferRunsRequest {
4078    fn typename() -> &'static str {
4079        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest"
4080    }
4081}
4082
4083#[doc(hidden)]
4084impl<'de> serde::de::Deserialize<'de> for ListTransferRunsRequest {
4085    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4086    where
4087        D: serde::Deserializer<'de>,
4088    {
4089        #[allow(non_camel_case_types)]
4090        #[doc(hidden)]
4091        #[derive(PartialEq, Eq, Hash)]
4092        enum __FieldTag {
4093            __parent,
4094            __states,
4095            __page_token,
4096            __page_size,
4097            __run_attempt,
4098            Unknown(std::string::String),
4099        }
4100        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4101            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4102            where
4103                D: serde::Deserializer<'de>,
4104            {
4105                struct Visitor;
4106                impl<'de> serde::de::Visitor<'de> for Visitor {
4107                    type Value = __FieldTag;
4108                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4109                        formatter.write_str("a field name for ListTransferRunsRequest")
4110                    }
4111                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4112                    where
4113                        E: serde::de::Error,
4114                    {
4115                        use std::result::Result::Ok;
4116                        use std::string::ToString;
4117                        match value {
4118                            "parent" => Ok(__FieldTag::__parent),
4119                            "states" => Ok(__FieldTag::__states),
4120                            "pageToken" => Ok(__FieldTag::__page_token),
4121                            "page_token" => Ok(__FieldTag::__page_token),
4122                            "pageSize" => Ok(__FieldTag::__page_size),
4123                            "page_size" => Ok(__FieldTag::__page_size),
4124                            "runAttempt" => Ok(__FieldTag::__run_attempt),
4125                            "run_attempt" => Ok(__FieldTag::__run_attempt),
4126                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4127                        }
4128                    }
4129                }
4130                deserializer.deserialize_identifier(Visitor)
4131            }
4132        }
4133        struct Visitor;
4134        impl<'de> serde::de::Visitor<'de> for Visitor {
4135            type Value = ListTransferRunsRequest;
4136            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4137                formatter.write_str("struct ListTransferRunsRequest")
4138            }
4139            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4140            where
4141                A: serde::de::MapAccess<'de>,
4142            {
4143                #[allow(unused_imports)]
4144                use serde::de::Error;
4145                use std::option::Option::Some;
4146                let mut fields = std::collections::HashSet::new();
4147                let mut result = Self::Value::new();
4148                while let Some(tag) = map.next_key::<__FieldTag>()? {
4149                    #[allow(clippy::match_single_binding)]
4150                    match tag {
4151                        __FieldTag::__parent => {
4152                            if !fields.insert(__FieldTag::__parent) {
4153                                return std::result::Result::Err(A::Error::duplicate_field(
4154                                    "multiple values for parent",
4155                                ));
4156                            }
4157                            result.parent = map
4158                                .next_value::<std::option::Option<std::string::String>>()?
4159                                .unwrap_or_default();
4160                        }
4161                        __FieldTag::__states => {
4162                            if !fields.insert(__FieldTag::__states) {
4163                                return std::result::Result::Err(A::Error::duplicate_field(
4164                                    "multiple values for states",
4165                                ));
4166                            }
4167                            result.states = map.next_value::<std::option::Option<std::vec::Vec<crate::model::TransferState>>>()?.unwrap_or_default();
4168                        }
4169                        __FieldTag::__page_token => {
4170                            if !fields.insert(__FieldTag::__page_token) {
4171                                return std::result::Result::Err(A::Error::duplicate_field(
4172                                    "multiple values for page_token",
4173                                ));
4174                            }
4175                            result.page_token = map
4176                                .next_value::<std::option::Option<std::string::String>>()?
4177                                .unwrap_or_default();
4178                        }
4179                        __FieldTag::__page_size => {
4180                            if !fields.insert(__FieldTag::__page_size) {
4181                                return std::result::Result::Err(A::Error::duplicate_field(
4182                                    "multiple values for page_size",
4183                                ));
4184                            }
4185                            struct __With(std::option::Option<i32>);
4186                            impl<'de> serde::de::Deserialize<'de> for __With {
4187                                fn deserialize<D>(
4188                                    deserializer: D,
4189                                ) -> std::result::Result<Self, D::Error>
4190                                where
4191                                    D: serde::de::Deserializer<'de>,
4192                                {
4193                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4194                                }
4195                            }
4196                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
4197                        }
4198                        __FieldTag::__run_attempt => {
4199                            if !fields.insert(__FieldTag::__run_attempt) {
4200                                return std::result::Result::Err(A::Error::duplicate_field(
4201                                    "multiple values for run_attempt",
4202                                ));
4203                            }
4204                            result.run_attempt = map
4205                                .next_value::<std::option::Option<
4206                                    crate::model::list_transfer_runs_request::RunAttempt,
4207                                >>()?
4208                                .unwrap_or_default();
4209                        }
4210                        __FieldTag::Unknown(key) => {
4211                            let value = map.next_value::<serde_json::Value>()?;
4212                            result._unknown_fields.insert(key, value);
4213                        }
4214                    }
4215                }
4216                std::result::Result::Ok(result)
4217            }
4218        }
4219        deserializer.deserialize_any(Visitor)
4220    }
4221}
4222
4223#[doc(hidden)]
4224impl serde::ser::Serialize for ListTransferRunsRequest {
4225    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4226    where
4227        S: serde::ser::Serializer,
4228    {
4229        use serde::ser::SerializeMap;
4230        #[allow(unused_imports)]
4231        use std::option::Option::Some;
4232        let mut state = serializer.serialize_map(std::option::Option::None)?;
4233        if !self.parent.is_empty() {
4234            state.serialize_entry("parent", &self.parent)?;
4235        }
4236        if !self.states.is_empty() {
4237            state.serialize_entry("states", &self.states)?;
4238        }
4239        if !self.page_token.is_empty() {
4240            state.serialize_entry("pageToken", &self.page_token)?;
4241        }
4242        if !wkt::internal::is_default(&self.page_size) {
4243            struct __With<'a>(&'a i32);
4244            impl<'a> serde::ser::Serialize for __With<'a> {
4245                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4246                where
4247                    S: serde::ser::Serializer,
4248                {
4249                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
4250                }
4251            }
4252            state.serialize_entry("pageSize", &__With(&self.page_size))?;
4253        }
4254        if !wkt::internal::is_default(&self.run_attempt) {
4255            state.serialize_entry("runAttempt", &self.run_attempt)?;
4256        }
4257        if !self._unknown_fields.is_empty() {
4258            for (key, value) in self._unknown_fields.iter() {
4259                state.serialize_entry(key, &value)?;
4260            }
4261        }
4262        state.end()
4263    }
4264}
4265
4266impl std::fmt::Debug for ListTransferRunsRequest {
4267    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4268        let mut debug_struct = f.debug_struct("ListTransferRunsRequest");
4269        debug_struct.field("parent", &self.parent);
4270        debug_struct.field("states", &self.states);
4271        debug_struct.field("page_token", &self.page_token);
4272        debug_struct.field("page_size", &self.page_size);
4273        debug_struct.field("run_attempt", &self.run_attempt);
4274        if !self._unknown_fields.is_empty() {
4275            debug_struct.field("_unknown_fields", &self._unknown_fields);
4276        }
4277        debug_struct.finish()
4278    }
4279}
4280
4281/// Defines additional types related to [ListTransferRunsRequest].
4282pub mod list_transfer_runs_request {
4283    #[allow(unused_imports)]
4284    use super::*;
4285
4286    /// Represents which runs should be pulled.
4287    ///
4288    /// # Working with unknown values
4289    ///
4290    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4291    /// additional enum variants at any time. Adding new variants is not considered
4292    /// a breaking change. Applications should write their code in anticipation of:
4293    ///
4294    /// - New values appearing in future releases of the client library, **and**
4295    /// - New values received dynamically, without application changes.
4296    ///
4297    /// Please consult the [Working with enums] section in the user guide for some
4298    /// guidelines.
4299    ///
4300    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4301    #[derive(Clone, Debug, PartialEq)]
4302    #[non_exhaustive]
4303    pub enum RunAttempt {
4304        /// All runs should be returned.
4305        Unspecified,
4306        /// Only latest run per day should be returned.
4307        Latest,
4308        /// If set, the enum was initialized with an unknown value.
4309        ///
4310        /// Applications can examine the value using [RunAttempt::value] or
4311        /// [RunAttempt::name].
4312        UnknownValue(run_attempt::UnknownValue),
4313    }
4314
4315    #[doc(hidden)]
4316    pub mod run_attempt {
4317        #[allow(unused_imports)]
4318        use super::*;
4319        #[derive(Clone, Debug, PartialEq)]
4320        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4321    }
4322
4323    impl RunAttempt {
4324        /// Gets the enum value.
4325        ///
4326        /// Returns `None` if the enum contains an unknown value deserialized from
4327        /// the string representation of enums.
4328        pub fn value(&self) -> std::option::Option<i32> {
4329            match self {
4330                Self::Unspecified => std::option::Option::Some(0),
4331                Self::Latest => std::option::Option::Some(1),
4332                Self::UnknownValue(u) => u.0.value(),
4333            }
4334        }
4335
4336        /// Gets the enum value as a string.
4337        ///
4338        /// Returns `None` if the enum contains an unknown value deserialized from
4339        /// the integer representation of enums.
4340        pub fn name(&self) -> std::option::Option<&str> {
4341            match self {
4342                Self::Unspecified => std::option::Option::Some("RUN_ATTEMPT_UNSPECIFIED"),
4343                Self::Latest => std::option::Option::Some("LATEST"),
4344                Self::UnknownValue(u) => u.0.name(),
4345            }
4346        }
4347    }
4348
4349    impl std::default::Default for RunAttempt {
4350        fn default() -> Self {
4351            use std::convert::From;
4352            Self::from(0)
4353        }
4354    }
4355
4356    impl std::fmt::Display for RunAttempt {
4357        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4358            wkt::internal::display_enum(f, self.name(), self.value())
4359        }
4360    }
4361
4362    impl std::convert::From<i32> for RunAttempt {
4363        fn from(value: i32) -> Self {
4364            match value {
4365                0 => Self::Unspecified,
4366                1 => Self::Latest,
4367                _ => Self::UnknownValue(run_attempt::UnknownValue(
4368                    wkt::internal::UnknownEnumValue::Integer(value),
4369                )),
4370            }
4371        }
4372    }
4373
4374    impl std::convert::From<&str> for RunAttempt {
4375        fn from(value: &str) -> Self {
4376            use std::string::ToString;
4377            match value {
4378                "RUN_ATTEMPT_UNSPECIFIED" => Self::Unspecified,
4379                "LATEST" => Self::Latest,
4380                _ => Self::UnknownValue(run_attempt::UnknownValue(
4381                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4382                )),
4383            }
4384        }
4385    }
4386
4387    impl serde::ser::Serialize for RunAttempt {
4388        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4389        where
4390            S: serde::Serializer,
4391        {
4392            match self {
4393                Self::Unspecified => serializer.serialize_i32(0),
4394                Self::Latest => serializer.serialize_i32(1),
4395                Self::UnknownValue(u) => u.0.serialize(serializer),
4396            }
4397        }
4398    }
4399
4400    impl<'de> serde::de::Deserialize<'de> for RunAttempt {
4401        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4402        where
4403            D: serde::Deserializer<'de>,
4404        {
4405            deserializer.deserialize_any(wkt::internal::EnumVisitor::<RunAttempt>::new(
4406                ".google.cloud.bigquery.datatransfer.v1.ListTransferRunsRequest.RunAttempt",
4407            ))
4408        }
4409    }
4410}
4411
4412/// The returned list of pipelines in the project.
4413#[derive(Clone, Default, PartialEq)]
4414#[non_exhaustive]
4415pub struct ListTransferRunsResponse {
4416    /// Output only. The stored pipeline transfer runs.
4417    pub transfer_runs: std::vec::Vec<crate::model::TransferRun>,
4418
4419    /// Output only. The next-pagination token. For multiple-page list results,
4420    /// this token can be used as the
4421    /// `ListTransferRunsRequest.page_token`
4422    /// to request the next page of list results.
4423    pub next_page_token: std::string::String,
4424
4425    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4426}
4427
4428impl ListTransferRunsResponse {
4429    pub fn new() -> Self {
4430        std::default::Default::default()
4431    }
4432
4433    /// Sets the value of [transfer_runs][crate::model::ListTransferRunsResponse::transfer_runs].
4434    pub fn set_transfer_runs<T, V>(mut self, v: T) -> Self
4435    where
4436        T: std::iter::IntoIterator<Item = V>,
4437        V: std::convert::Into<crate::model::TransferRun>,
4438    {
4439        use std::iter::Iterator;
4440        self.transfer_runs = v.into_iter().map(|i| i.into()).collect();
4441        self
4442    }
4443
4444    /// Sets the value of [next_page_token][crate::model::ListTransferRunsResponse::next_page_token].
4445    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4446        self.next_page_token = v.into();
4447        self
4448    }
4449}
4450
4451impl wkt::message::Message for ListTransferRunsResponse {
4452    fn typename() -> &'static str {
4453        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferRunsResponse"
4454    }
4455}
4456
4457#[doc(hidden)]
4458impl gax::paginator::internal::PageableResponse for ListTransferRunsResponse {
4459    type PageItem = crate::model::TransferRun;
4460
4461    fn items(self) -> std::vec::Vec<Self::PageItem> {
4462        self.transfer_runs
4463    }
4464
4465    fn next_page_token(&self) -> std::string::String {
4466        use std::clone::Clone;
4467        self.next_page_token.clone()
4468    }
4469}
4470
4471#[doc(hidden)]
4472impl<'de> serde::de::Deserialize<'de> for ListTransferRunsResponse {
4473    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4474    where
4475        D: serde::Deserializer<'de>,
4476    {
4477        #[allow(non_camel_case_types)]
4478        #[doc(hidden)]
4479        #[derive(PartialEq, Eq, Hash)]
4480        enum __FieldTag {
4481            __transfer_runs,
4482            __next_page_token,
4483            Unknown(std::string::String),
4484        }
4485        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4486            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4487            where
4488                D: serde::Deserializer<'de>,
4489            {
4490                struct Visitor;
4491                impl<'de> serde::de::Visitor<'de> for Visitor {
4492                    type Value = __FieldTag;
4493                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4494                        formatter.write_str("a field name for ListTransferRunsResponse")
4495                    }
4496                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4497                    where
4498                        E: serde::de::Error,
4499                    {
4500                        use std::result::Result::Ok;
4501                        use std::string::ToString;
4502                        match value {
4503                            "transferRuns" => Ok(__FieldTag::__transfer_runs),
4504                            "transfer_runs" => Ok(__FieldTag::__transfer_runs),
4505                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
4506                            "next_page_token" => Ok(__FieldTag::__next_page_token),
4507                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4508                        }
4509                    }
4510                }
4511                deserializer.deserialize_identifier(Visitor)
4512            }
4513        }
4514        struct Visitor;
4515        impl<'de> serde::de::Visitor<'de> for Visitor {
4516            type Value = ListTransferRunsResponse;
4517            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4518                formatter.write_str("struct ListTransferRunsResponse")
4519            }
4520            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4521            where
4522                A: serde::de::MapAccess<'de>,
4523            {
4524                #[allow(unused_imports)]
4525                use serde::de::Error;
4526                use std::option::Option::Some;
4527                let mut fields = std::collections::HashSet::new();
4528                let mut result = Self::Value::new();
4529                while let Some(tag) = map.next_key::<__FieldTag>()? {
4530                    #[allow(clippy::match_single_binding)]
4531                    match tag {
4532                        __FieldTag::__transfer_runs => {
4533                            if !fields.insert(__FieldTag::__transfer_runs) {
4534                                return std::result::Result::Err(A::Error::duplicate_field(
4535                                    "multiple values for transfer_runs",
4536                                ));
4537                            }
4538                            result.transfer_runs = map.next_value::<std::option::Option<std::vec::Vec<crate::model::TransferRun>>>()?.unwrap_or_default();
4539                        }
4540                        __FieldTag::__next_page_token => {
4541                            if !fields.insert(__FieldTag::__next_page_token) {
4542                                return std::result::Result::Err(A::Error::duplicate_field(
4543                                    "multiple values for next_page_token",
4544                                ));
4545                            }
4546                            result.next_page_token = map
4547                                .next_value::<std::option::Option<std::string::String>>()?
4548                                .unwrap_or_default();
4549                        }
4550                        __FieldTag::Unknown(key) => {
4551                            let value = map.next_value::<serde_json::Value>()?;
4552                            result._unknown_fields.insert(key, value);
4553                        }
4554                    }
4555                }
4556                std::result::Result::Ok(result)
4557            }
4558        }
4559        deserializer.deserialize_any(Visitor)
4560    }
4561}
4562
4563#[doc(hidden)]
4564impl serde::ser::Serialize for ListTransferRunsResponse {
4565    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4566    where
4567        S: serde::ser::Serializer,
4568    {
4569        use serde::ser::SerializeMap;
4570        #[allow(unused_imports)]
4571        use std::option::Option::Some;
4572        let mut state = serializer.serialize_map(std::option::Option::None)?;
4573        if !self.transfer_runs.is_empty() {
4574            state.serialize_entry("transferRuns", &self.transfer_runs)?;
4575        }
4576        if !self.next_page_token.is_empty() {
4577            state.serialize_entry("nextPageToken", &self.next_page_token)?;
4578        }
4579        if !self._unknown_fields.is_empty() {
4580            for (key, value) in self._unknown_fields.iter() {
4581                state.serialize_entry(key, &value)?;
4582            }
4583        }
4584        state.end()
4585    }
4586}
4587
4588impl std::fmt::Debug for ListTransferRunsResponse {
4589    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4590        let mut debug_struct = f.debug_struct("ListTransferRunsResponse");
4591        debug_struct.field("transfer_runs", &self.transfer_runs);
4592        debug_struct.field("next_page_token", &self.next_page_token);
4593        if !self._unknown_fields.is_empty() {
4594            debug_struct.field("_unknown_fields", &self._unknown_fields);
4595        }
4596        debug_struct.finish()
4597    }
4598}
4599
4600/// A request to get user facing log messages associated with data transfer run.
4601#[derive(Clone, Default, PartialEq)]
4602#[non_exhaustive]
4603pub struct ListTransferLogsRequest {
4604    /// Required. Transfer run name in the form:
4605    /// `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
4606    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
4607    pub parent: std::string::String,
4608
4609    /// Pagination token, which can be used to request a specific page
4610    /// of `ListTransferLogsRequest` list results. For multiple-page
4611    /// results, `ListTransferLogsResponse` outputs
4612    /// a `next_page` token, which can be used as the
4613    /// `page_token` value to request the next page of list results.
4614    pub page_token: std::string::String,
4615
4616    /// Page size. The default page size is the maximum value of 1000 results.
4617    pub page_size: i32,
4618
4619    /// Message types to return. If not populated - INFO, WARNING and ERROR
4620    /// messages are returned.
4621    pub message_types: std::vec::Vec<crate::model::transfer_message::MessageSeverity>,
4622
4623    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4624}
4625
4626impl ListTransferLogsRequest {
4627    pub fn new() -> Self {
4628        std::default::Default::default()
4629    }
4630
4631    /// Sets the value of [parent][crate::model::ListTransferLogsRequest::parent].
4632    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4633        self.parent = v.into();
4634        self
4635    }
4636
4637    /// Sets the value of [page_token][crate::model::ListTransferLogsRequest::page_token].
4638    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4639        self.page_token = v.into();
4640        self
4641    }
4642
4643    /// Sets the value of [page_size][crate::model::ListTransferLogsRequest::page_size].
4644    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4645        self.page_size = v.into();
4646        self
4647    }
4648
4649    /// Sets the value of [message_types][crate::model::ListTransferLogsRequest::message_types].
4650    pub fn set_message_types<T, V>(mut self, v: T) -> Self
4651    where
4652        T: std::iter::IntoIterator<Item = V>,
4653        V: std::convert::Into<crate::model::transfer_message::MessageSeverity>,
4654    {
4655        use std::iter::Iterator;
4656        self.message_types = v.into_iter().map(|i| i.into()).collect();
4657        self
4658    }
4659}
4660
4661impl wkt::message::Message for ListTransferLogsRequest {
4662    fn typename() -> &'static str {
4663        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferLogsRequest"
4664    }
4665}
4666
4667#[doc(hidden)]
4668impl<'de> serde::de::Deserialize<'de> for ListTransferLogsRequest {
4669    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4670    where
4671        D: serde::Deserializer<'de>,
4672    {
4673        #[allow(non_camel_case_types)]
4674        #[doc(hidden)]
4675        #[derive(PartialEq, Eq, Hash)]
4676        enum __FieldTag {
4677            __parent,
4678            __page_token,
4679            __page_size,
4680            __message_types,
4681            Unknown(std::string::String),
4682        }
4683        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4684            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4685            where
4686                D: serde::Deserializer<'de>,
4687            {
4688                struct Visitor;
4689                impl<'de> serde::de::Visitor<'de> for Visitor {
4690                    type Value = __FieldTag;
4691                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4692                        formatter.write_str("a field name for ListTransferLogsRequest")
4693                    }
4694                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4695                    where
4696                        E: serde::de::Error,
4697                    {
4698                        use std::result::Result::Ok;
4699                        use std::string::ToString;
4700                        match value {
4701                            "parent" => Ok(__FieldTag::__parent),
4702                            "pageToken" => Ok(__FieldTag::__page_token),
4703                            "page_token" => Ok(__FieldTag::__page_token),
4704                            "pageSize" => Ok(__FieldTag::__page_size),
4705                            "page_size" => Ok(__FieldTag::__page_size),
4706                            "messageTypes" => Ok(__FieldTag::__message_types),
4707                            "message_types" => Ok(__FieldTag::__message_types),
4708                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4709                        }
4710                    }
4711                }
4712                deserializer.deserialize_identifier(Visitor)
4713            }
4714        }
4715        struct Visitor;
4716        impl<'de> serde::de::Visitor<'de> for Visitor {
4717            type Value = ListTransferLogsRequest;
4718            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4719                formatter.write_str("struct ListTransferLogsRequest")
4720            }
4721            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4722            where
4723                A: serde::de::MapAccess<'de>,
4724            {
4725                #[allow(unused_imports)]
4726                use serde::de::Error;
4727                use std::option::Option::Some;
4728                let mut fields = std::collections::HashSet::new();
4729                let mut result = Self::Value::new();
4730                while let Some(tag) = map.next_key::<__FieldTag>()? {
4731                    #[allow(clippy::match_single_binding)]
4732                    match tag {
4733                        __FieldTag::__parent => {
4734                            if !fields.insert(__FieldTag::__parent) {
4735                                return std::result::Result::Err(A::Error::duplicate_field(
4736                                    "multiple values for parent",
4737                                ));
4738                            }
4739                            result.parent = map
4740                                .next_value::<std::option::Option<std::string::String>>()?
4741                                .unwrap_or_default();
4742                        }
4743                        __FieldTag::__page_token => {
4744                            if !fields.insert(__FieldTag::__page_token) {
4745                                return std::result::Result::Err(A::Error::duplicate_field(
4746                                    "multiple values for page_token",
4747                                ));
4748                            }
4749                            result.page_token = map
4750                                .next_value::<std::option::Option<std::string::String>>()?
4751                                .unwrap_or_default();
4752                        }
4753                        __FieldTag::__page_size => {
4754                            if !fields.insert(__FieldTag::__page_size) {
4755                                return std::result::Result::Err(A::Error::duplicate_field(
4756                                    "multiple values for page_size",
4757                                ));
4758                            }
4759                            struct __With(std::option::Option<i32>);
4760                            impl<'de> serde::de::Deserialize<'de> for __With {
4761                                fn deserialize<D>(
4762                                    deserializer: D,
4763                                ) -> std::result::Result<Self, D::Error>
4764                                where
4765                                    D: serde::de::Deserializer<'de>,
4766                                {
4767                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4768                                }
4769                            }
4770                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
4771                        }
4772                        __FieldTag::__message_types => {
4773                            if !fields.insert(__FieldTag::__message_types) {
4774                                return std::result::Result::Err(A::Error::duplicate_field(
4775                                    "multiple values for message_types",
4776                                ));
4777                            }
4778                            result.message_types = map
4779                                .next_value::<std::option::Option<
4780                                    std::vec::Vec<crate::model::transfer_message::MessageSeverity>,
4781                                >>()?
4782                                .unwrap_or_default();
4783                        }
4784                        __FieldTag::Unknown(key) => {
4785                            let value = map.next_value::<serde_json::Value>()?;
4786                            result._unknown_fields.insert(key, value);
4787                        }
4788                    }
4789                }
4790                std::result::Result::Ok(result)
4791            }
4792        }
4793        deserializer.deserialize_any(Visitor)
4794    }
4795}
4796
4797#[doc(hidden)]
4798impl serde::ser::Serialize for ListTransferLogsRequest {
4799    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4800    where
4801        S: serde::ser::Serializer,
4802    {
4803        use serde::ser::SerializeMap;
4804        #[allow(unused_imports)]
4805        use std::option::Option::Some;
4806        let mut state = serializer.serialize_map(std::option::Option::None)?;
4807        if !self.parent.is_empty() {
4808            state.serialize_entry("parent", &self.parent)?;
4809        }
4810        if !self.page_token.is_empty() {
4811            state.serialize_entry("pageToken", &self.page_token)?;
4812        }
4813        if !wkt::internal::is_default(&self.page_size) {
4814            struct __With<'a>(&'a i32);
4815            impl<'a> serde::ser::Serialize for __With<'a> {
4816                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4817                where
4818                    S: serde::ser::Serializer,
4819                {
4820                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
4821                }
4822            }
4823            state.serialize_entry("pageSize", &__With(&self.page_size))?;
4824        }
4825        if !self.message_types.is_empty() {
4826            state.serialize_entry("messageTypes", &self.message_types)?;
4827        }
4828        if !self._unknown_fields.is_empty() {
4829            for (key, value) in self._unknown_fields.iter() {
4830                state.serialize_entry(key, &value)?;
4831            }
4832        }
4833        state.end()
4834    }
4835}
4836
4837impl std::fmt::Debug for ListTransferLogsRequest {
4838    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4839        let mut debug_struct = f.debug_struct("ListTransferLogsRequest");
4840        debug_struct.field("parent", &self.parent);
4841        debug_struct.field("page_token", &self.page_token);
4842        debug_struct.field("page_size", &self.page_size);
4843        debug_struct.field("message_types", &self.message_types);
4844        if !self._unknown_fields.is_empty() {
4845            debug_struct.field("_unknown_fields", &self._unknown_fields);
4846        }
4847        debug_struct.finish()
4848    }
4849}
4850
4851/// The returned list transfer run messages.
4852#[derive(Clone, Default, PartialEq)]
4853#[non_exhaustive]
4854pub struct ListTransferLogsResponse {
4855    /// Output only. The stored pipeline transfer messages.
4856    pub transfer_messages: std::vec::Vec<crate::model::TransferMessage>,
4857
4858    /// Output only. The next-pagination token. For multiple-page list results,
4859    /// this token can be used as the
4860    /// `GetTransferRunLogRequest.page_token`
4861    /// to request the next page of list results.
4862    pub next_page_token: std::string::String,
4863
4864    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4865}
4866
4867impl ListTransferLogsResponse {
4868    pub fn new() -> Self {
4869        std::default::Default::default()
4870    }
4871
4872    /// Sets the value of [transfer_messages][crate::model::ListTransferLogsResponse::transfer_messages].
4873    pub fn set_transfer_messages<T, V>(mut self, v: T) -> Self
4874    where
4875        T: std::iter::IntoIterator<Item = V>,
4876        V: std::convert::Into<crate::model::TransferMessage>,
4877    {
4878        use std::iter::Iterator;
4879        self.transfer_messages = v.into_iter().map(|i| i.into()).collect();
4880        self
4881    }
4882
4883    /// Sets the value of [next_page_token][crate::model::ListTransferLogsResponse::next_page_token].
4884    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4885        self.next_page_token = v.into();
4886        self
4887    }
4888}
4889
4890impl wkt::message::Message for ListTransferLogsResponse {
4891    fn typename() -> &'static str {
4892        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ListTransferLogsResponse"
4893    }
4894}
4895
4896#[doc(hidden)]
4897impl gax::paginator::internal::PageableResponse for ListTransferLogsResponse {
4898    type PageItem = crate::model::TransferMessage;
4899
4900    fn items(self) -> std::vec::Vec<Self::PageItem> {
4901        self.transfer_messages
4902    }
4903
4904    fn next_page_token(&self) -> std::string::String {
4905        use std::clone::Clone;
4906        self.next_page_token.clone()
4907    }
4908}
4909
4910#[doc(hidden)]
4911impl<'de> serde::de::Deserialize<'de> for ListTransferLogsResponse {
4912    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4913    where
4914        D: serde::Deserializer<'de>,
4915    {
4916        #[allow(non_camel_case_types)]
4917        #[doc(hidden)]
4918        #[derive(PartialEq, Eq, Hash)]
4919        enum __FieldTag {
4920            __transfer_messages,
4921            __next_page_token,
4922            Unknown(std::string::String),
4923        }
4924        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4925            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4926            where
4927                D: serde::Deserializer<'de>,
4928            {
4929                struct Visitor;
4930                impl<'de> serde::de::Visitor<'de> for Visitor {
4931                    type Value = __FieldTag;
4932                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4933                        formatter.write_str("a field name for ListTransferLogsResponse")
4934                    }
4935                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4936                    where
4937                        E: serde::de::Error,
4938                    {
4939                        use std::result::Result::Ok;
4940                        use std::string::ToString;
4941                        match value {
4942                            "transferMessages" => Ok(__FieldTag::__transfer_messages),
4943                            "transfer_messages" => Ok(__FieldTag::__transfer_messages),
4944                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
4945                            "next_page_token" => Ok(__FieldTag::__next_page_token),
4946                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4947                        }
4948                    }
4949                }
4950                deserializer.deserialize_identifier(Visitor)
4951            }
4952        }
4953        struct Visitor;
4954        impl<'de> serde::de::Visitor<'de> for Visitor {
4955            type Value = ListTransferLogsResponse;
4956            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4957                formatter.write_str("struct ListTransferLogsResponse")
4958            }
4959            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4960            where
4961                A: serde::de::MapAccess<'de>,
4962            {
4963                #[allow(unused_imports)]
4964                use serde::de::Error;
4965                use std::option::Option::Some;
4966                let mut fields = std::collections::HashSet::new();
4967                let mut result = Self::Value::new();
4968                while let Some(tag) = map.next_key::<__FieldTag>()? {
4969                    #[allow(clippy::match_single_binding)]
4970                    match tag {
4971                        __FieldTag::__transfer_messages => {
4972                            if !fields.insert(__FieldTag::__transfer_messages) {
4973                                return std::result::Result::Err(A::Error::duplicate_field(
4974                                    "multiple values for transfer_messages",
4975                                ));
4976                            }
4977                            result.transfer_messages =
4978                                map.next_value::<std::option::Option<
4979                                    std::vec::Vec<crate::model::TransferMessage>,
4980                                >>()?
4981                                .unwrap_or_default();
4982                        }
4983                        __FieldTag::__next_page_token => {
4984                            if !fields.insert(__FieldTag::__next_page_token) {
4985                                return std::result::Result::Err(A::Error::duplicate_field(
4986                                    "multiple values for next_page_token",
4987                                ));
4988                            }
4989                            result.next_page_token = map
4990                                .next_value::<std::option::Option<std::string::String>>()?
4991                                .unwrap_or_default();
4992                        }
4993                        __FieldTag::Unknown(key) => {
4994                            let value = map.next_value::<serde_json::Value>()?;
4995                            result._unknown_fields.insert(key, value);
4996                        }
4997                    }
4998                }
4999                std::result::Result::Ok(result)
5000            }
5001        }
5002        deserializer.deserialize_any(Visitor)
5003    }
5004}
5005
5006#[doc(hidden)]
5007impl serde::ser::Serialize for ListTransferLogsResponse {
5008    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5009    where
5010        S: serde::ser::Serializer,
5011    {
5012        use serde::ser::SerializeMap;
5013        #[allow(unused_imports)]
5014        use std::option::Option::Some;
5015        let mut state = serializer.serialize_map(std::option::Option::None)?;
5016        if !self.transfer_messages.is_empty() {
5017            state.serialize_entry("transferMessages", &self.transfer_messages)?;
5018        }
5019        if !self.next_page_token.is_empty() {
5020            state.serialize_entry("nextPageToken", &self.next_page_token)?;
5021        }
5022        if !self._unknown_fields.is_empty() {
5023            for (key, value) in self._unknown_fields.iter() {
5024                state.serialize_entry(key, &value)?;
5025            }
5026        }
5027        state.end()
5028    }
5029}
5030
5031impl std::fmt::Debug for ListTransferLogsResponse {
5032    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5033        let mut debug_struct = f.debug_struct("ListTransferLogsResponse");
5034        debug_struct.field("transfer_messages", &self.transfer_messages);
5035        debug_struct.field("next_page_token", &self.next_page_token);
5036        if !self._unknown_fields.is_empty() {
5037            debug_struct.field("_unknown_fields", &self._unknown_fields);
5038        }
5039        debug_struct.finish()
5040    }
5041}
5042
5043/// A request to determine whether the user has valid credentials. This method
5044/// is used to limit the number of OAuth popups in the user interface. The
5045/// user id is inferred from the API call context.
5046/// If the data source has the Google+ authorization type, this method
5047/// returns false, as it cannot be determined whether the credentials are
5048/// already valid merely based on the user id.
5049#[derive(Clone, Default, PartialEq)]
5050#[non_exhaustive]
5051pub struct CheckValidCredsRequest {
5052    /// Required. The data source in the form:
5053    /// `projects/{project_id}/dataSources/{data_source_id}` or
5054    /// `projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}`.
5055    pub name: std::string::String,
5056
5057    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5058}
5059
5060impl CheckValidCredsRequest {
5061    pub fn new() -> Self {
5062        std::default::Default::default()
5063    }
5064
5065    /// Sets the value of [name][crate::model::CheckValidCredsRequest::name].
5066    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5067        self.name = v.into();
5068        self
5069    }
5070}
5071
5072impl wkt::message::Message for CheckValidCredsRequest {
5073    fn typename() -> &'static str {
5074        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.CheckValidCredsRequest"
5075    }
5076}
5077
5078#[doc(hidden)]
5079impl<'de> serde::de::Deserialize<'de> for CheckValidCredsRequest {
5080    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5081    where
5082        D: serde::Deserializer<'de>,
5083    {
5084        #[allow(non_camel_case_types)]
5085        #[doc(hidden)]
5086        #[derive(PartialEq, Eq, Hash)]
5087        enum __FieldTag {
5088            __name,
5089            Unknown(std::string::String),
5090        }
5091        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5092            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5093            where
5094                D: serde::Deserializer<'de>,
5095            {
5096                struct Visitor;
5097                impl<'de> serde::de::Visitor<'de> for Visitor {
5098                    type Value = __FieldTag;
5099                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5100                        formatter.write_str("a field name for CheckValidCredsRequest")
5101                    }
5102                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5103                    where
5104                        E: serde::de::Error,
5105                    {
5106                        use std::result::Result::Ok;
5107                        use std::string::ToString;
5108                        match value {
5109                            "name" => Ok(__FieldTag::__name),
5110                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5111                        }
5112                    }
5113                }
5114                deserializer.deserialize_identifier(Visitor)
5115            }
5116        }
5117        struct Visitor;
5118        impl<'de> serde::de::Visitor<'de> for Visitor {
5119            type Value = CheckValidCredsRequest;
5120            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5121                formatter.write_str("struct CheckValidCredsRequest")
5122            }
5123            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5124            where
5125                A: serde::de::MapAccess<'de>,
5126            {
5127                #[allow(unused_imports)]
5128                use serde::de::Error;
5129                use std::option::Option::Some;
5130                let mut fields = std::collections::HashSet::new();
5131                let mut result = Self::Value::new();
5132                while let Some(tag) = map.next_key::<__FieldTag>()? {
5133                    #[allow(clippy::match_single_binding)]
5134                    match tag {
5135                        __FieldTag::__name => {
5136                            if !fields.insert(__FieldTag::__name) {
5137                                return std::result::Result::Err(A::Error::duplicate_field(
5138                                    "multiple values for name",
5139                                ));
5140                            }
5141                            result.name = map
5142                                .next_value::<std::option::Option<std::string::String>>()?
5143                                .unwrap_or_default();
5144                        }
5145                        __FieldTag::Unknown(key) => {
5146                            let value = map.next_value::<serde_json::Value>()?;
5147                            result._unknown_fields.insert(key, value);
5148                        }
5149                    }
5150                }
5151                std::result::Result::Ok(result)
5152            }
5153        }
5154        deserializer.deserialize_any(Visitor)
5155    }
5156}
5157
5158#[doc(hidden)]
5159impl serde::ser::Serialize for CheckValidCredsRequest {
5160    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5161    where
5162        S: serde::ser::Serializer,
5163    {
5164        use serde::ser::SerializeMap;
5165        #[allow(unused_imports)]
5166        use std::option::Option::Some;
5167        let mut state = serializer.serialize_map(std::option::Option::None)?;
5168        if !self.name.is_empty() {
5169            state.serialize_entry("name", &self.name)?;
5170        }
5171        if !self._unknown_fields.is_empty() {
5172            for (key, value) in self._unknown_fields.iter() {
5173                state.serialize_entry(key, &value)?;
5174            }
5175        }
5176        state.end()
5177    }
5178}
5179
5180impl std::fmt::Debug for CheckValidCredsRequest {
5181    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5182        let mut debug_struct = f.debug_struct("CheckValidCredsRequest");
5183        debug_struct.field("name", &self.name);
5184        if !self._unknown_fields.is_empty() {
5185            debug_struct.field("_unknown_fields", &self._unknown_fields);
5186        }
5187        debug_struct.finish()
5188    }
5189}
5190
5191/// A response indicating whether the credentials exist and are valid.
5192#[derive(Clone, Default, PartialEq)]
5193#[non_exhaustive]
5194pub struct CheckValidCredsResponse {
5195    /// If set to `true`, the credentials exist and are valid.
5196    pub has_valid_creds: bool,
5197
5198    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5199}
5200
5201impl CheckValidCredsResponse {
5202    pub fn new() -> Self {
5203        std::default::Default::default()
5204    }
5205
5206    /// Sets the value of [has_valid_creds][crate::model::CheckValidCredsResponse::has_valid_creds].
5207    pub fn set_has_valid_creds<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5208        self.has_valid_creds = v.into();
5209        self
5210    }
5211}
5212
5213impl wkt::message::Message for CheckValidCredsResponse {
5214    fn typename() -> &'static str {
5215        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse"
5216    }
5217}
5218
5219#[doc(hidden)]
5220impl<'de> serde::de::Deserialize<'de> for CheckValidCredsResponse {
5221    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5222    where
5223        D: serde::Deserializer<'de>,
5224    {
5225        #[allow(non_camel_case_types)]
5226        #[doc(hidden)]
5227        #[derive(PartialEq, Eq, Hash)]
5228        enum __FieldTag {
5229            __has_valid_creds,
5230            Unknown(std::string::String),
5231        }
5232        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5233            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5234            where
5235                D: serde::Deserializer<'de>,
5236            {
5237                struct Visitor;
5238                impl<'de> serde::de::Visitor<'de> for Visitor {
5239                    type Value = __FieldTag;
5240                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5241                        formatter.write_str("a field name for CheckValidCredsResponse")
5242                    }
5243                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5244                    where
5245                        E: serde::de::Error,
5246                    {
5247                        use std::result::Result::Ok;
5248                        use std::string::ToString;
5249                        match value {
5250                            "hasValidCreds" => Ok(__FieldTag::__has_valid_creds),
5251                            "has_valid_creds" => Ok(__FieldTag::__has_valid_creds),
5252                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5253                        }
5254                    }
5255                }
5256                deserializer.deserialize_identifier(Visitor)
5257            }
5258        }
5259        struct Visitor;
5260        impl<'de> serde::de::Visitor<'de> for Visitor {
5261            type Value = CheckValidCredsResponse;
5262            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5263                formatter.write_str("struct CheckValidCredsResponse")
5264            }
5265            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5266            where
5267                A: serde::de::MapAccess<'de>,
5268            {
5269                #[allow(unused_imports)]
5270                use serde::de::Error;
5271                use std::option::Option::Some;
5272                let mut fields = std::collections::HashSet::new();
5273                let mut result = Self::Value::new();
5274                while let Some(tag) = map.next_key::<__FieldTag>()? {
5275                    #[allow(clippy::match_single_binding)]
5276                    match tag {
5277                        __FieldTag::__has_valid_creds => {
5278                            if !fields.insert(__FieldTag::__has_valid_creds) {
5279                                return std::result::Result::Err(A::Error::duplicate_field(
5280                                    "multiple values for has_valid_creds",
5281                                ));
5282                            }
5283                            result.has_valid_creds = map
5284                                .next_value::<std::option::Option<bool>>()?
5285                                .unwrap_or_default();
5286                        }
5287                        __FieldTag::Unknown(key) => {
5288                            let value = map.next_value::<serde_json::Value>()?;
5289                            result._unknown_fields.insert(key, value);
5290                        }
5291                    }
5292                }
5293                std::result::Result::Ok(result)
5294            }
5295        }
5296        deserializer.deserialize_any(Visitor)
5297    }
5298}
5299
5300#[doc(hidden)]
5301impl serde::ser::Serialize for CheckValidCredsResponse {
5302    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5303    where
5304        S: serde::ser::Serializer,
5305    {
5306        use serde::ser::SerializeMap;
5307        #[allow(unused_imports)]
5308        use std::option::Option::Some;
5309        let mut state = serializer.serialize_map(std::option::Option::None)?;
5310        if !wkt::internal::is_default(&self.has_valid_creds) {
5311            state.serialize_entry("hasValidCreds", &self.has_valid_creds)?;
5312        }
5313        if !self._unknown_fields.is_empty() {
5314            for (key, value) in self._unknown_fields.iter() {
5315                state.serialize_entry(key, &value)?;
5316            }
5317        }
5318        state.end()
5319    }
5320}
5321
5322impl std::fmt::Debug for CheckValidCredsResponse {
5323    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5324        let mut debug_struct = f.debug_struct("CheckValidCredsResponse");
5325        debug_struct.field("has_valid_creds", &self.has_valid_creds);
5326        if !self._unknown_fields.is_empty() {
5327            debug_struct.field("_unknown_fields", &self._unknown_fields);
5328        }
5329        debug_struct.finish()
5330    }
5331}
5332
5333/// A request to schedule transfer runs for a time range.
5334#[derive(Clone, Default, PartialEq)]
5335#[non_exhaustive]
5336pub struct ScheduleTransferRunsRequest {
5337    /// Required. Transfer configuration name in the form:
5338    /// `projects/{project_id}/transferConfigs/{config_id}` or
5339    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
5340    pub parent: std::string::String,
5341
5342    /// Required. Start time of the range of transfer runs. For example,
5343    /// `"2017-05-25T00:00:00+00:00"`.
5344    pub start_time: std::option::Option<wkt::Timestamp>,
5345
5346    /// Required. End time of the range of transfer runs. For example,
5347    /// `"2017-05-30T00:00:00+00:00"`.
5348    pub end_time: std::option::Option<wkt::Timestamp>,
5349
5350    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5351}
5352
5353impl ScheduleTransferRunsRequest {
5354    pub fn new() -> Self {
5355        std::default::Default::default()
5356    }
5357
5358    /// Sets the value of [parent][crate::model::ScheduleTransferRunsRequest::parent].
5359    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5360        self.parent = v.into();
5361        self
5362    }
5363
5364    /// Sets the value of [start_time][crate::model::ScheduleTransferRunsRequest::start_time].
5365    pub fn set_start_time<T>(mut self, v: T) -> Self
5366    where
5367        T: std::convert::Into<wkt::Timestamp>,
5368    {
5369        self.start_time = std::option::Option::Some(v.into());
5370        self
5371    }
5372
5373    /// Sets or clears the value of [start_time][crate::model::ScheduleTransferRunsRequest::start_time].
5374    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
5375    where
5376        T: std::convert::Into<wkt::Timestamp>,
5377    {
5378        self.start_time = v.map(|x| x.into());
5379        self
5380    }
5381
5382    /// Sets the value of [end_time][crate::model::ScheduleTransferRunsRequest::end_time].
5383    pub fn set_end_time<T>(mut self, v: T) -> Self
5384    where
5385        T: std::convert::Into<wkt::Timestamp>,
5386    {
5387        self.end_time = std::option::Option::Some(v.into());
5388        self
5389    }
5390
5391    /// Sets or clears the value of [end_time][crate::model::ScheduleTransferRunsRequest::end_time].
5392    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
5393    where
5394        T: std::convert::Into<wkt::Timestamp>,
5395    {
5396        self.end_time = v.map(|x| x.into());
5397        self
5398    }
5399}
5400
5401impl wkt::message::Message for ScheduleTransferRunsRequest {
5402    fn typename() -> &'static str {
5403        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsRequest"
5404    }
5405}
5406
5407#[doc(hidden)]
5408impl<'de> serde::de::Deserialize<'de> for ScheduleTransferRunsRequest {
5409    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5410    where
5411        D: serde::Deserializer<'de>,
5412    {
5413        #[allow(non_camel_case_types)]
5414        #[doc(hidden)]
5415        #[derive(PartialEq, Eq, Hash)]
5416        enum __FieldTag {
5417            __parent,
5418            __start_time,
5419            __end_time,
5420            Unknown(std::string::String),
5421        }
5422        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5423            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5424            where
5425                D: serde::Deserializer<'de>,
5426            {
5427                struct Visitor;
5428                impl<'de> serde::de::Visitor<'de> for Visitor {
5429                    type Value = __FieldTag;
5430                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5431                        formatter.write_str("a field name for ScheduleTransferRunsRequest")
5432                    }
5433                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5434                    where
5435                        E: serde::de::Error,
5436                    {
5437                        use std::result::Result::Ok;
5438                        use std::string::ToString;
5439                        match value {
5440                            "parent" => Ok(__FieldTag::__parent),
5441                            "startTime" => Ok(__FieldTag::__start_time),
5442                            "start_time" => Ok(__FieldTag::__start_time),
5443                            "endTime" => Ok(__FieldTag::__end_time),
5444                            "end_time" => Ok(__FieldTag::__end_time),
5445                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5446                        }
5447                    }
5448                }
5449                deserializer.deserialize_identifier(Visitor)
5450            }
5451        }
5452        struct Visitor;
5453        impl<'de> serde::de::Visitor<'de> for Visitor {
5454            type Value = ScheduleTransferRunsRequest;
5455            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5456                formatter.write_str("struct ScheduleTransferRunsRequest")
5457            }
5458            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5459            where
5460                A: serde::de::MapAccess<'de>,
5461            {
5462                #[allow(unused_imports)]
5463                use serde::de::Error;
5464                use std::option::Option::Some;
5465                let mut fields = std::collections::HashSet::new();
5466                let mut result = Self::Value::new();
5467                while let Some(tag) = map.next_key::<__FieldTag>()? {
5468                    #[allow(clippy::match_single_binding)]
5469                    match tag {
5470                        __FieldTag::__parent => {
5471                            if !fields.insert(__FieldTag::__parent) {
5472                                return std::result::Result::Err(A::Error::duplicate_field(
5473                                    "multiple values for parent",
5474                                ));
5475                            }
5476                            result.parent = map
5477                                .next_value::<std::option::Option<std::string::String>>()?
5478                                .unwrap_or_default();
5479                        }
5480                        __FieldTag::__start_time => {
5481                            if !fields.insert(__FieldTag::__start_time) {
5482                                return std::result::Result::Err(A::Error::duplicate_field(
5483                                    "multiple values for start_time",
5484                                ));
5485                            }
5486                            result.start_time =
5487                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
5488                        }
5489                        __FieldTag::__end_time => {
5490                            if !fields.insert(__FieldTag::__end_time) {
5491                                return std::result::Result::Err(A::Error::duplicate_field(
5492                                    "multiple values for end_time",
5493                                ));
5494                            }
5495                            result.end_time =
5496                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
5497                        }
5498                        __FieldTag::Unknown(key) => {
5499                            let value = map.next_value::<serde_json::Value>()?;
5500                            result._unknown_fields.insert(key, value);
5501                        }
5502                    }
5503                }
5504                std::result::Result::Ok(result)
5505            }
5506        }
5507        deserializer.deserialize_any(Visitor)
5508    }
5509}
5510
5511#[doc(hidden)]
5512impl serde::ser::Serialize for ScheduleTransferRunsRequest {
5513    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5514    where
5515        S: serde::ser::Serializer,
5516    {
5517        use serde::ser::SerializeMap;
5518        #[allow(unused_imports)]
5519        use std::option::Option::Some;
5520        let mut state = serializer.serialize_map(std::option::Option::None)?;
5521        if !self.parent.is_empty() {
5522            state.serialize_entry("parent", &self.parent)?;
5523        }
5524        if self.start_time.is_some() {
5525            state.serialize_entry("startTime", &self.start_time)?;
5526        }
5527        if self.end_time.is_some() {
5528            state.serialize_entry("endTime", &self.end_time)?;
5529        }
5530        if !self._unknown_fields.is_empty() {
5531            for (key, value) in self._unknown_fields.iter() {
5532                state.serialize_entry(key, &value)?;
5533            }
5534        }
5535        state.end()
5536    }
5537}
5538
5539impl std::fmt::Debug for ScheduleTransferRunsRequest {
5540    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5541        let mut debug_struct = f.debug_struct("ScheduleTransferRunsRequest");
5542        debug_struct.field("parent", &self.parent);
5543        debug_struct.field("start_time", &self.start_time);
5544        debug_struct.field("end_time", &self.end_time);
5545        if !self._unknown_fields.is_empty() {
5546            debug_struct.field("_unknown_fields", &self._unknown_fields);
5547        }
5548        debug_struct.finish()
5549    }
5550}
5551
5552/// A response to schedule transfer runs for a time range.
5553#[derive(Clone, Default, PartialEq)]
5554#[non_exhaustive]
5555pub struct ScheduleTransferRunsResponse {
5556    /// The transfer runs that were scheduled.
5557    pub runs: std::vec::Vec<crate::model::TransferRun>,
5558
5559    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5560}
5561
5562impl ScheduleTransferRunsResponse {
5563    pub fn new() -> Self {
5564        std::default::Default::default()
5565    }
5566
5567    /// Sets the value of [runs][crate::model::ScheduleTransferRunsResponse::runs].
5568    pub fn set_runs<T, V>(mut self, v: T) -> Self
5569    where
5570        T: std::iter::IntoIterator<Item = V>,
5571        V: std::convert::Into<crate::model::TransferRun>,
5572    {
5573        use std::iter::Iterator;
5574        self.runs = v.into_iter().map(|i| i.into()).collect();
5575        self
5576    }
5577}
5578
5579impl wkt::message::Message for ScheduleTransferRunsResponse {
5580    fn typename() -> &'static str {
5581        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse"
5582    }
5583}
5584
5585#[doc(hidden)]
5586impl<'de> serde::de::Deserialize<'de> for ScheduleTransferRunsResponse {
5587    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5588    where
5589        D: serde::Deserializer<'de>,
5590    {
5591        #[allow(non_camel_case_types)]
5592        #[doc(hidden)]
5593        #[derive(PartialEq, Eq, Hash)]
5594        enum __FieldTag {
5595            __runs,
5596            Unknown(std::string::String),
5597        }
5598        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5599            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5600            where
5601                D: serde::Deserializer<'de>,
5602            {
5603                struct Visitor;
5604                impl<'de> serde::de::Visitor<'de> for Visitor {
5605                    type Value = __FieldTag;
5606                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5607                        formatter.write_str("a field name for ScheduleTransferRunsResponse")
5608                    }
5609                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5610                    where
5611                        E: serde::de::Error,
5612                    {
5613                        use std::result::Result::Ok;
5614                        use std::string::ToString;
5615                        match value {
5616                            "runs" => Ok(__FieldTag::__runs),
5617                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5618                        }
5619                    }
5620                }
5621                deserializer.deserialize_identifier(Visitor)
5622            }
5623        }
5624        struct Visitor;
5625        impl<'de> serde::de::Visitor<'de> for Visitor {
5626            type Value = ScheduleTransferRunsResponse;
5627            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5628                formatter.write_str("struct ScheduleTransferRunsResponse")
5629            }
5630            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5631            where
5632                A: serde::de::MapAccess<'de>,
5633            {
5634                #[allow(unused_imports)]
5635                use serde::de::Error;
5636                use std::option::Option::Some;
5637                let mut fields = std::collections::HashSet::new();
5638                let mut result = Self::Value::new();
5639                while let Some(tag) = map.next_key::<__FieldTag>()? {
5640                    #[allow(clippy::match_single_binding)]
5641                    match tag {
5642                        __FieldTag::__runs => {
5643                            if !fields.insert(__FieldTag::__runs) {
5644                                return std::result::Result::Err(A::Error::duplicate_field(
5645                                    "multiple values for runs",
5646                                ));
5647                            }
5648                            result.runs = map.next_value::<std::option::Option<std::vec::Vec<crate::model::TransferRun>>>()?.unwrap_or_default();
5649                        }
5650                        __FieldTag::Unknown(key) => {
5651                            let value = map.next_value::<serde_json::Value>()?;
5652                            result._unknown_fields.insert(key, value);
5653                        }
5654                    }
5655                }
5656                std::result::Result::Ok(result)
5657            }
5658        }
5659        deserializer.deserialize_any(Visitor)
5660    }
5661}
5662
5663#[doc(hidden)]
5664impl serde::ser::Serialize for ScheduleTransferRunsResponse {
5665    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5666    where
5667        S: serde::ser::Serializer,
5668    {
5669        use serde::ser::SerializeMap;
5670        #[allow(unused_imports)]
5671        use std::option::Option::Some;
5672        let mut state = serializer.serialize_map(std::option::Option::None)?;
5673        if !self.runs.is_empty() {
5674            state.serialize_entry("runs", &self.runs)?;
5675        }
5676        if !self._unknown_fields.is_empty() {
5677            for (key, value) in self._unknown_fields.iter() {
5678                state.serialize_entry(key, &value)?;
5679            }
5680        }
5681        state.end()
5682    }
5683}
5684
5685impl std::fmt::Debug for ScheduleTransferRunsResponse {
5686    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5687        let mut debug_struct = f.debug_struct("ScheduleTransferRunsResponse");
5688        debug_struct.field("runs", &self.runs);
5689        if !self._unknown_fields.is_empty() {
5690            debug_struct.field("_unknown_fields", &self._unknown_fields);
5691        }
5692        debug_struct.finish()
5693    }
5694}
5695
5696/// A request to start manual transfer runs.
5697#[derive(Clone, Default, PartialEq)]
5698#[non_exhaustive]
5699pub struct StartManualTransferRunsRequest {
5700    /// Required. Transfer configuration name in the form:
5701    /// `projects/{project_id}/transferConfigs/{config_id}` or
5702    /// `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
5703    pub parent: std::string::String,
5704
5705    /// The requested time specification - this can be a time range or a specific
5706    /// run_time.
5707    pub time: std::option::Option<crate::model::start_manual_transfer_runs_request::Time>,
5708
5709    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5710}
5711
5712impl StartManualTransferRunsRequest {
5713    pub fn new() -> Self {
5714        std::default::Default::default()
5715    }
5716
5717    /// Sets the value of [parent][crate::model::StartManualTransferRunsRequest::parent].
5718    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5719        self.parent = v.into();
5720        self
5721    }
5722
5723    /// Sets the value of [time][crate::model::StartManualTransferRunsRequest::time].
5724    ///
5725    /// Note that all the setters affecting `time` are mutually
5726    /// exclusive.
5727    pub fn set_time<
5728        T: std::convert::Into<
5729                std::option::Option<crate::model::start_manual_transfer_runs_request::Time>,
5730            >,
5731    >(
5732        mut self,
5733        v: T,
5734    ) -> Self {
5735        self.time = v.into();
5736        self
5737    }
5738
5739    /// The value of [time][crate::model::StartManualTransferRunsRequest::time]
5740    /// if it holds a `RequestedTimeRange`, `None` if the field is not set or
5741    /// holds a different branch.
5742    pub fn requested_time_range(
5743        &self,
5744    ) -> std::option::Option<
5745        &std::boxed::Box<crate::model::start_manual_transfer_runs_request::TimeRange>,
5746    > {
5747        #[allow(unreachable_patterns)]
5748        self.time.as_ref().and_then(|v| match v {
5749            crate::model::start_manual_transfer_runs_request::Time::RequestedTimeRange(v) => {
5750                std::option::Option::Some(v)
5751            }
5752            _ => std::option::Option::None,
5753        })
5754    }
5755
5756    /// Sets the value of [time][crate::model::StartManualTransferRunsRequest::time]
5757    /// to hold a `RequestedTimeRange`.
5758    ///
5759    /// Note that all the setters affecting `time` are
5760    /// mutually exclusive.
5761    pub fn set_requested_time_range<
5762        T: std::convert::Into<
5763                std::boxed::Box<crate::model::start_manual_transfer_runs_request::TimeRange>,
5764            >,
5765    >(
5766        mut self,
5767        v: T,
5768    ) -> Self {
5769        self.time = std::option::Option::Some(
5770            crate::model::start_manual_transfer_runs_request::Time::RequestedTimeRange(v.into()),
5771        );
5772        self
5773    }
5774
5775    /// The value of [time][crate::model::StartManualTransferRunsRequest::time]
5776    /// if it holds a `RequestedRunTime`, `None` if the field is not set or
5777    /// holds a different branch.
5778    pub fn requested_run_time(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
5779        #[allow(unreachable_patterns)]
5780        self.time.as_ref().and_then(|v| match v {
5781            crate::model::start_manual_transfer_runs_request::Time::RequestedRunTime(v) => {
5782                std::option::Option::Some(v)
5783            }
5784            _ => std::option::Option::None,
5785        })
5786    }
5787
5788    /// Sets the value of [time][crate::model::StartManualTransferRunsRequest::time]
5789    /// to hold a `RequestedRunTime`.
5790    ///
5791    /// Note that all the setters affecting `time` are
5792    /// mutually exclusive.
5793    pub fn set_requested_run_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
5794        mut self,
5795        v: T,
5796    ) -> Self {
5797        self.time = std::option::Option::Some(
5798            crate::model::start_manual_transfer_runs_request::Time::RequestedRunTime(v.into()),
5799        );
5800        self
5801    }
5802}
5803
5804impl wkt::message::Message for StartManualTransferRunsRequest {
5805    fn typename() -> &'static str {
5806        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest"
5807    }
5808}
5809
5810#[doc(hidden)]
5811impl<'de> serde::de::Deserialize<'de> for StartManualTransferRunsRequest {
5812    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5813    where
5814        D: serde::Deserializer<'de>,
5815    {
5816        #[allow(non_camel_case_types)]
5817        #[doc(hidden)]
5818        #[derive(PartialEq, Eq, Hash)]
5819        enum __FieldTag {
5820            __parent,
5821            __requested_time_range,
5822            __requested_run_time,
5823            Unknown(std::string::String),
5824        }
5825        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5826            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5827            where
5828                D: serde::Deserializer<'de>,
5829            {
5830                struct Visitor;
5831                impl<'de> serde::de::Visitor<'de> for Visitor {
5832                    type Value = __FieldTag;
5833                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5834                        formatter.write_str("a field name for StartManualTransferRunsRequest")
5835                    }
5836                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5837                    where
5838                        E: serde::de::Error,
5839                    {
5840                        use std::result::Result::Ok;
5841                        use std::string::ToString;
5842                        match value {
5843                            "parent" => Ok(__FieldTag::__parent),
5844                            "requestedTimeRange" => Ok(__FieldTag::__requested_time_range),
5845                            "requested_time_range" => Ok(__FieldTag::__requested_time_range),
5846                            "requestedRunTime" => Ok(__FieldTag::__requested_run_time),
5847                            "requested_run_time" => Ok(__FieldTag::__requested_run_time),
5848                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5849                        }
5850                    }
5851                }
5852                deserializer.deserialize_identifier(Visitor)
5853            }
5854        }
5855        struct Visitor;
5856        impl<'de> serde::de::Visitor<'de> for Visitor {
5857            type Value = StartManualTransferRunsRequest;
5858            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5859                formatter.write_str("struct StartManualTransferRunsRequest")
5860            }
5861            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5862            where
5863                A: serde::de::MapAccess<'de>,
5864            {
5865                #[allow(unused_imports)]
5866                use serde::de::Error;
5867                use std::option::Option::Some;
5868                let mut fields = std::collections::HashSet::new();
5869                let mut result = Self::Value::new();
5870                while let Some(tag) = map.next_key::<__FieldTag>()? {
5871                    #[allow(clippy::match_single_binding)]
5872                    match tag {
5873                        __FieldTag::__parent => {
5874                            if !fields.insert(__FieldTag::__parent) {
5875                                return std::result::Result::Err(A::Error::duplicate_field(
5876                                    "multiple values for parent",
5877                                ));
5878                            }
5879                            result.parent = map
5880                                .next_value::<std::option::Option<std::string::String>>()?
5881                                .unwrap_or_default();
5882                        }
5883                        __FieldTag::__requested_time_range => {
5884                            if !fields.insert(__FieldTag::__requested_time_range) {
5885                                return std::result::Result::Err(A::Error::duplicate_field(
5886                                    "multiple values for requested_time_range",
5887                                ));
5888                            }
5889                            if result.time.is_some() {
5890                                return std::result::Result::Err(A::Error::duplicate_field(
5891                                    "multiple values for `time`, a oneof with full ID .google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.requested_time_range, latest field was requestedTimeRange",
5892                                ));
5893                            }
5894                            result.time = std::option::Option::Some(
5895                                crate::model::start_manual_transfer_runs_request::Time::RequestedTimeRange(
5896                                    map.next_value::<std::option::Option<std::boxed::Box<crate::model::start_manual_transfer_runs_request::TimeRange>>>()?.unwrap_or_default()
5897                                ),
5898                            );
5899                        }
5900                        __FieldTag::__requested_run_time => {
5901                            if !fields.insert(__FieldTag::__requested_run_time) {
5902                                return std::result::Result::Err(A::Error::duplicate_field(
5903                                    "multiple values for requested_run_time",
5904                                ));
5905                            }
5906                            if result.time.is_some() {
5907                                return std::result::Result::Err(A::Error::duplicate_field(
5908                                    "multiple values for `time`, a oneof with full ID .google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.requested_run_time, latest field was requestedRunTime",
5909                                ));
5910                            }
5911                            result.time = std::option::Option::Some(
5912                                crate::model::start_manual_transfer_runs_request::Time::RequestedRunTime(
5913                                    map.next_value::<std::option::Option<std::boxed::Box<wkt::Timestamp>>>()?.unwrap_or_default()
5914                                ),
5915                            );
5916                        }
5917                        __FieldTag::Unknown(key) => {
5918                            let value = map.next_value::<serde_json::Value>()?;
5919                            result._unknown_fields.insert(key, value);
5920                        }
5921                    }
5922                }
5923                std::result::Result::Ok(result)
5924            }
5925        }
5926        deserializer.deserialize_any(Visitor)
5927    }
5928}
5929
5930#[doc(hidden)]
5931impl serde::ser::Serialize for StartManualTransferRunsRequest {
5932    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5933    where
5934        S: serde::ser::Serializer,
5935    {
5936        use serde::ser::SerializeMap;
5937        #[allow(unused_imports)]
5938        use std::option::Option::Some;
5939        let mut state = serializer.serialize_map(std::option::Option::None)?;
5940        if !self.parent.is_empty() {
5941            state.serialize_entry("parent", &self.parent)?;
5942        }
5943        if let Some(value) = self.requested_time_range() {
5944            state.serialize_entry("requestedTimeRange", value)?;
5945        }
5946        if let Some(value) = self.requested_run_time() {
5947            state.serialize_entry("requestedRunTime", value)?;
5948        }
5949        if !self._unknown_fields.is_empty() {
5950            for (key, value) in self._unknown_fields.iter() {
5951                state.serialize_entry(key, &value)?;
5952            }
5953        }
5954        state.end()
5955    }
5956}
5957
5958impl std::fmt::Debug for StartManualTransferRunsRequest {
5959    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5960        let mut debug_struct = f.debug_struct("StartManualTransferRunsRequest");
5961        debug_struct.field("parent", &self.parent);
5962        debug_struct.field("time", &self.time);
5963        if !self._unknown_fields.is_empty() {
5964            debug_struct.field("_unknown_fields", &self._unknown_fields);
5965        }
5966        debug_struct.finish()
5967    }
5968}
5969
5970/// Defines additional types related to [StartManualTransferRunsRequest].
5971pub mod start_manual_transfer_runs_request {
5972    #[allow(unused_imports)]
5973    use super::*;
5974
5975    /// A specification for a time range, this will request transfer runs with
5976    /// run_time between start_time (inclusive) and end_time (exclusive).
5977    #[derive(Clone, Default, PartialEq)]
5978    #[non_exhaustive]
5979    pub struct TimeRange {
5980        /// Start time of the range of transfer runs. For example,
5981        /// `"2017-05-25T00:00:00+00:00"`. The start_time must be strictly less than
5982        /// the end_time. Creates transfer runs where run_time is in the range
5983        /// between start_time (inclusive) and end_time (exclusive).
5984        pub start_time: std::option::Option<wkt::Timestamp>,
5985
5986        /// End time of the range of transfer runs. For example,
5987        /// `"2017-05-30T00:00:00+00:00"`. The end_time must not be in the future.
5988        /// Creates transfer runs where run_time is in the range between start_time
5989        /// (inclusive) and end_time (exclusive).
5990        pub end_time: std::option::Option<wkt::Timestamp>,
5991
5992        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5993    }
5994
5995    impl TimeRange {
5996        pub fn new() -> Self {
5997            std::default::Default::default()
5998        }
5999
6000        /// Sets the value of [start_time][crate::model::start_manual_transfer_runs_request::TimeRange::start_time].
6001        pub fn set_start_time<T>(mut self, v: T) -> Self
6002        where
6003            T: std::convert::Into<wkt::Timestamp>,
6004        {
6005            self.start_time = std::option::Option::Some(v.into());
6006            self
6007        }
6008
6009        /// Sets or clears the value of [start_time][crate::model::start_manual_transfer_runs_request::TimeRange::start_time].
6010        pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
6011        where
6012            T: std::convert::Into<wkt::Timestamp>,
6013        {
6014            self.start_time = v.map(|x| x.into());
6015            self
6016        }
6017
6018        /// Sets the value of [end_time][crate::model::start_manual_transfer_runs_request::TimeRange::end_time].
6019        pub fn set_end_time<T>(mut self, v: T) -> Self
6020        where
6021            T: std::convert::Into<wkt::Timestamp>,
6022        {
6023            self.end_time = std::option::Option::Some(v.into());
6024            self
6025        }
6026
6027        /// Sets or clears the value of [end_time][crate::model::start_manual_transfer_runs_request::TimeRange::end_time].
6028        pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
6029        where
6030            T: std::convert::Into<wkt::Timestamp>,
6031        {
6032            self.end_time = v.map(|x| x.into());
6033            self
6034        }
6035    }
6036
6037    impl wkt::message::Message for TimeRange {
6038        fn typename() -> &'static str {
6039            "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsRequest.TimeRange"
6040        }
6041    }
6042
6043    #[doc(hidden)]
6044    impl<'de> serde::de::Deserialize<'de> for TimeRange {
6045        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6046        where
6047            D: serde::Deserializer<'de>,
6048        {
6049            #[allow(non_camel_case_types)]
6050            #[doc(hidden)]
6051            #[derive(PartialEq, Eq, Hash)]
6052            enum __FieldTag {
6053                __start_time,
6054                __end_time,
6055                Unknown(std::string::String),
6056            }
6057            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6058                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6059                where
6060                    D: serde::Deserializer<'de>,
6061                {
6062                    struct Visitor;
6063                    impl<'de> serde::de::Visitor<'de> for Visitor {
6064                        type Value = __FieldTag;
6065                        fn expecting(
6066                            &self,
6067                            formatter: &mut std::fmt::Formatter,
6068                        ) -> std::fmt::Result {
6069                            formatter.write_str("a field name for TimeRange")
6070                        }
6071                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6072                        where
6073                            E: serde::de::Error,
6074                        {
6075                            use std::result::Result::Ok;
6076                            use std::string::ToString;
6077                            match value {
6078                                "startTime" => Ok(__FieldTag::__start_time),
6079                                "start_time" => Ok(__FieldTag::__start_time),
6080                                "endTime" => Ok(__FieldTag::__end_time),
6081                                "end_time" => Ok(__FieldTag::__end_time),
6082                                _ => Ok(__FieldTag::Unknown(value.to_string())),
6083                            }
6084                        }
6085                    }
6086                    deserializer.deserialize_identifier(Visitor)
6087                }
6088            }
6089            struct Visitor;
6090            impl<'de> serde::de::Visitor<'de> for Visitor {
6091                type Value = TimeRange;
6092                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6093                    formatter.write_str("struct TimeRange")
6094                }
6095                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6096                where
6097                    A: serde::de::MapAccess<'de>,
6098                {
6099                    #[allow(unused_imports)]
6100                    use serde::de::Error;
6101                    use std::option::Option::Some;
6102                    let mut fields = std::collections::HashSet::new();
6103                    let mut result = Self::Value::new();
6104                    while let Some(tag) = map.next_key::<__FieldTag>()? {
6105                        #[allow(clippy::match_single_binding)]
6106                        match tag {
6107                            __FieldTag::__start_time => {
6108                                if !fields.insert(__FieldTag::__start_time) {
6109                                    return std::result::Result::Err(A::Error::duplicate_field(
6110                                        "multiple values for start_time",
6111                                    ));
6112                                }
6113                                result.start_time =
6114                                    map.next_value::<std::option::Option<wkt::Timestamp>>()?;
6115                            }
6116                            __FieldTag::__end_time => {
6117                                if !fields.insert(__FieldTag::__end_time) {
6118                                    return std::result::Result::Err(A::Error::duplicate_field(
6119                                        "multiple values for end_time",
6120                                    ));
6121                                }
6122                                result.end_time =
6123                                    map.next_value::<std::option::Option<wkt::Timestamp>>()?;
6124                            }
6125                            __FieldTag::Unknown(key) => {
6126                                let value = map.next_value::<serde_json::Value>()?;
6127                                result._unknown_fields.insert(key, value);
6128                            }
6129                        }
6130                    }
6131                    std::result::Result::Ok(result)
6132                }
6133            }
6134            deserializer.deserialize_any(Visitor)
6135        }
6136    }
6137
6138    #[doc(hidden)]
6139    impl serde::ser::Serialize for TimeRange {
6140        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6141        where
6142            S: serde::ser::Serializer,
6143        {
6144            use serde::ser::SerializeMap;
6145            #[allow(unused_imports)]
6146            use std::option::Option::Some;
6147            let mut state = serializer.serialize_map(std::option::Option::None)?;
6148            if self.start_time.is_some() {
6149                state.serialize_entry("startTime", &self.start_time)?;
6150            }
6151            if self.end_time.is_some() {
6152                state.serialize_entry("endTime", &self.end_time)?;
6153            }
6154            if !self._unknown_fields.is_empty() {
6155                for (key, value) in self._unknown_fields.iter() {
6156                    state.serialize_entry(key, &value)?;
6157                }
6158            }
6159            state.end()
6160        }
6161    }
6162
6163    impl std::fmt::Debug for TimeRange {
6164        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6165            let mut debug_struct = f.debug_struct("TimeRange");
6166            debug_struct.field("start_time", &self.start_time);
6167            debug_struct.field("end_time", &self.end_time);
6168            if !self._unknown_fields.is_empty() {
6169                debug_struct.field("_unknown_fields", &self._unknown_fields);
6170            }
6171            debug_struct.finish()
6172        }
6173    }
6174
6175    /// The requested time specification - this can be a time range or a specific
6176    /// run_time.
6177    #[derive(Clone, Debug, PartialEq)]
6178    #[non_exhaustive]
6179    pub enum Time {
6180        /// A time_range start and end timestamp for historical data files or reports
6181        /// that are scheduled to be transferred by the scheduled transfer run.
6182        /// requested_time_range must be a past time and cannot include future time
6183        /// values.
6184        RequestedTimeRange(
6185            std::boxed::Box<crate::model::start_manual_transfer_runs_request::TimeRange>,
6186        ),
6187        /// A run_time timestamp for historical data files or reports
6188        /// that are scheduled to be transferred by the scheduled transfer run.
6189        /// requested_run_time must be a past time and cannot include future time
6190        /// values.
6191        RequestedRunTime(std::boxed::Box<wkt::Timestamp>),
6192    }
6193}
6194
6195/// A response to start manual transfer runs.
6196#[derive(Clone, Default, PartialEq)]
6197#[non_exhaustive]
6198pub struct StartManualTransferRunsResponse {
6199    /// The transfer runs that were created.
6200    pub runs: std::vec::Vec<crate::model::TransferRun>,
6201
6202    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6203}
6204
6205impl StartManualTransferRunsResponse {
6206    pub fn new() -> Self {
6207        std::default::Default::default()
6208    }
6209
6210    /// Sets the value of [runs][crate::model::StartManualTransferRunsResponse::runs].
6211    pub fn set_runs<T, V>(mut self, v: T) -> Self
6212    where
6213        T: std::iter::IntoIterator<Item = V>,
6214        V: std::convert::Into<crate::model::TransferRun>,
6215    {
6216        use std::iter::Iterator;
6217        self.runs = v.into_iter().map(|i| i.into()).collect();
6218        self
6219    }
6220}
6221
6222impl wkt::message::Message for StartManualTransferRunsResponse {
6223    fn typename() -> &'static str {
6224        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse"
6225    }
6226}
6227
6228#[doc(hidden)]
6229impl<'de> serde::de::Deserialize<'de> for StartManualTransferRunsResponse {
6230    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6231    where
6232        D: serde::Deserializer<'de>,
6233    {
6234        #[allow(non_camel_case_types)]
6235        #[doc(hidden)]
6236        #[derive(PartialEq, Eq, Hash)]
6237        enum __FieldTag {
6238            __runs,
6239            Unknown(std::string::String),
6240        }
6241        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6242            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6243            where
6244                D: serde::Deserializer<'de>,
6245            {
6246                struct Visitor;
6247                impl<'de> serde::de::Visitor<'de> for Visitor {
6248                    type Value = __FieldTag;
6249                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6250                        formatter.write_str("a field name for StartManualTransferRunsResponse")
6251                    }
6252                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6253                    where
6254                        E: serde::de::Error,
6255                    {
6256                        use std::result::Result::Ok;
6257                        use std::string::ToString;
6258                        match value {
6259                            "runs" => Ok(__FieldTag::__runs),
6260                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6261                        }
6262                    }
6263                }
6264                deserializer.deserialize_identifier(Visitor)
6265            }
6266        }
6267        struct Visitor;
6268        impl<'de> serde::de::Visitor<'de> for Visitor {
6269            type Value = StartManualTransferRunsResponse;
6270            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6271                formatter.write_str("struct StartManualTransferRunsResponse")
6272            }
6273            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6274            where
6275                A: serde::de::MapAccess<'de>,
6276            {
6277                #[allow(unused_imports)]
6278                use serde::de::Error;
6279                use std::option::Option::Some;
6280                let mut fields = std::collections::HashSet::new();
6281                let mut result = Self::Value::new();
6282                while let Some(tag) = map.next_key::<__FieldTag>()? {
6283                    #[allow(clippy::match_single_binding)]
6284                    match tag {
6285                        __FieldTag::__runs => {
6286                            if !fields.insert(__FieldTag::__runs) {
6287                                return std::result::Result::Err(A::Error::duplicate_field(
6288                                    "multiple values for runs",
6289                                ));
6290                            }
6291                            result.runs = map.next_value::<std::option::Option<std::vec::Vec<crate::model::TransferRun>>>()?.unwrap_or_default();
6292                        }
6293                        __FieldTag::Unknown(key) => {
6294                            let value = map.next_value::<serde_json::Value>()?;
6295                            result._unknown_fields.insert(key, value);
6296                        }
6297                    }
6298                }
6299                std::result::Result::Ok(result)
6300            }
6301        }
6302        deserializer.deserialize_any(Visitor)
6303    }
6304}
6305
6306#[doc(hidden)]
6307impl serde::ser::Serialize for StartManualTransferRunsResponse {
6308    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6309    where
6310        S: serde::ser::Serializer,
6311    {
6312        use serde::ser::SerializeMap;
6313        #[allow(unused_imports)]
6314        use std::option::Option::Some;
6315        let mut state = serializer.serialize_map(std::option::Option::None)?;
6316        if !self.runs.is_empty() {
6317            state.serialize_entry("runs", &self.runs)?;
6318        }
6319        if !self._unknown_fields.is_empty() {
6320            for (key, value) in self._unknown_fields.iter() {
6321                state.serialize_entry(key, &value)?;
6322            }
6323        }
6324        state.end()
6325    }
6326}
6327
6328impl std::fmt::Debug for StartManualTransferRunsResponse {
6329    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6330        let mut debug_struct = f.debug_struct("StartManualTransferRunsResponse");
6331        debug_struct.field("runs", &self.runs);
6332        if !self._unknown_fields.is_empty() {
6333            debug_struct.field("_unknown_fields", &self._unknown_fields);
6334        }
6335        debug_struct.finish()
6336    }
6337}
6338
6339/// A request to enroll a set of data sources so they are visible in the
6340/// BigQuery UI's `Transfer` tab.
6341#[derive(Clone, Default, PartialEq)]
6342#[non_exhaustive]
6343pub struct EnrollDataSourcesRequest {
6344    /// Required. The name of the project resource in the form:
6345    /// `projects/{project_id}`
6346    pub name: std::string::String,
6347
6348    /// Data sources that are enrolled. It is required to provide at least one
6349    /// data source id.
6350    pub data_source_ids: std::vec::Vec<std::string::String>,
6351
6352    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6353}
6354
6355impl EnrollDataSourcesRequest {
6356    pub fn new() -> Self {
6357        std::default::Default::default()
6358    }
6359
6360    /// Sets the value of [name][crate::model::EnrollDataSourcesRequest::name].
6361    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6362        self.name = v.into();
6363        self
6364    }
6365
6366    /// Sets the value of [data_source_ids][crate::model::EnrollDataSourcesRequest::data_source_ids].
6367    pub fn set_data_source_ids<T, V>(mut self, v: T) -> Self
6368    where
6369        T: std::iter::IntoIterator<Item = V>,
6370        V: std::convert::Into<std::string::String>,
6371    {
6372        use std::iter::Iterator;
6373        self.data_source_ids = v.into_iter().map(|i| i.into()).collect();
6374        self
6375    }
6376}
6377
6378impl wkt::message::Message for EnrollDataSourcesRequest {
6379    fn typename() -> &'static str {
6380        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.EnrollDataSourcesRequest"
6381    }
6382}
6383
6384#[doc(hidden)]
6385impl<'de> serde::de::Deserialize<'de> for EnrollDataSourcesRequest {
6386    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6387    where
6388        D: serde::Deserializer<'de>,
6389    {
6390        #[allow(non_camel_case_types)]
6391        #[doc(hidden)]
6392        #[derive(PartialEq, Eq, Hash)]
6393        enum __FieldTag {
6394            __name,
6395            __data_source_ids,
6396            Unknown(std::string::String),
6397        }
6398        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6399            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6400            where
6401                D: serde::Deserializer<'de>,
6402            {
6403                struct Visitor;
6404                impl<'de> serde::de::Visitor<'de> for Visitor {
6405                    type Value = __FieldTag;
6406                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6407                        formatter.write_str("a field name for EnrollDataSourcesRequest")
6408                    }
6409                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6410                    where
6411                        E: serde::de::Error,
6412                    {
6413                        use std::result::Result::Ok;
6414                        use std::string::ToString;
6415                        match value {
6416                            "name" => Ok(__FieldTag::__name),
6417                            "dataSourceIds" => Ok(__FieldTag::__data_source_ids),
6418                            "data_source_ids" => Ok(__FieldTag::__data_source_ids),
6419                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6420                        }
6421                    }
6422                }
6423                deserializer.deserialize_identifier(Visitor)
6424            }
6425        }
6426        struct Visitor;
6427        impl<'de> serde::de::Visitor<'de> for Visitor {
6428            type Value = EnrollDataSourcesRequest;
6429            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6430                formatter.write_str("struct EnrollDataSourcesRequest")
6431            }
6432            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6433            where
6434                A: serde::de::MapAccess<'de>,
6435            {
6436                #[allow(unused_imports)]
6437                use serde::de::Error;
6438                use std::option::Option::Some;
6439                let mut fields = std::collections::HashSet::new();
6440                let mut result = Self::Value::new();
6441                while let Some(tag) = map.next_key::<__FieldTag>()? {
6442                    #[allow(clippy::match_single_binding)]
6443                    match tag {
6444                        __FieldTag::__name => {
6445                            if !fields.insert(__FieldTag::__name) {
6446                                return std::result::Result::Err(A::Error::duplicate_field(
6447                                    "multiple values for name",
6448                                ));
6449                            }
6450                            result.name = map
6451                                .next_value::<std::option::Option<std::string::String>>()?
6452                                .unwrap_or_default();
6453                        }
6454                        __FieldTag::__data_source_ids => {
6455                            if !fields.insert(__FieldTag::__data_source_ids) {
6456                                return std::result::Result::Err(A::Error::duplicate_field(
6457                                    "multiple values for data_source_ids",
6458                                ));
6459                            }
6460                            result.data_source_ids = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
6461                        }
6462                        __FieldTag::Unknown(key) => {
6463                            let value = map.next_value::<serde_json::Value>()?;
6464                            result._unknown_fields.insert(key, value);
6465                        }
6466                    }
6467                }
6468                std::result::Result::Ok(result)
6469            }
6470        }
6471        deserializer.deserialize_any(Visitor)
6472    }
6473}
6474
6475#[doc(hidden)]
6476impl serde::ser::Serialize for EnrollDataSourcesRequest {
6477    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6478    where
6479        S: serde::ser::Serializer,
6480    {
6481        use serde::ser::SerializeMap;
6482        #[allow(unused_imports)]
6483        use std::option::Option::Some;
6484        let mut state = serializer.serialize_map(std::option::Option::None)?;
6485        if !self.name.is_empty() {
6486            state.serialize_entry("name", &self.name)?;
6487        }
6488        if !self.data_source_ids.is_empty() {
6489            state.serialize_entry("dataSourceIds", &self.data_source_ids)?;
6490        }
6491        if !self._unknown_fields.is_empty() {
6492            for (key, value) in self._unknown_fields.iter() {
6493                state.serialize_entry(key, &value)?;
6494            }
6495        }
6496        state.end()
6497    }
6498}
6499
6500impl std::fmt::Debug for EnrollDataSourcesRequest {
6501    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6502        let mut debug_struct = f.debug_struct("EnrollDataSourcesRequest");
6503        debug_struct.field("name", &self.name);
6504        debug_struct.field("data_source_ids", &self.data_source_ids);
6505        if !self._unknown_fields.is_empty() {
6506            debug_struct.field("_unknown_fields", &self._unknown_fields);
6507        }
6508        debug_struct.finish()
6509    }
6510}
6511
6512/// A request to unenroll a set of data sources so they are no longer visible in
6513/// the BigQuery UI's `Transfer` tab.
6514#[derive(Clone, Default, PartialEq)]
6515#[non_exhaustive]
6516pub struct UnenrollDataSourcesRequest {
6517    /// Required. The name of the project resource in the form:
6518    /// `projects/{project_id}`
6519    pub name: std::string::String,
6520
6521    /// Data sources that are unenrolled. It is required to provide at least one
6522    /// data source id.
6523    pub data_source_ids: std::vec::Vec<std::string::String>,
6524
6525    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6526}
6527
6528impl UnenrollDataSourcesRequest {
6529    pub fn new() -> Self {
6530        std::default::Default::default()
6531    }
6532
6533    /// Sets the value of [name][crate::model::UnenrollDataSourcesRequest::name].
6534    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6535        self.name = v.into();
6536        self
6537    }
6538
6539    /// Sets the value of [data_source_ids][crate::model::UnenrollDataSourcesRequest::data_source_ids].
6540    pub fn set_data_source_ids<T, V>(mut self, v: T) -> Self
6541    where
6542        T: std::iter::IntoIterator<Item = V>,
6543        V: std::convert::Into<std::string::String>,
6544    {
6545        use std::iter::Iterator;
6546        self.data_source_ids = v.into_iter().map(|i| i.into()).collect();
6547        self
6548    }
6549}
6550
6551impl wkt::message::Message for UnenrollDataSourcesRequest {
6552    fn typename() -> &'static str {
6553        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.UnenrollDataSourcesRequest"
6554    }
6555}
6556
6557#[doc(hidden)]
6558impl<'de> serde::de::Deserialize<'de> for UnenrollDataSourcesRequest {
6559    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6560    where
6561        D: serde::Deserializer<'de>,
6562    {
6563        #[allow(non_camel_case_types)]
6564        #[doc(hidden)]
6565        #[derive(PartialEq, Eq, Hash)]
6566        enum __FieldTag {
6567            __name,
6568            __data_source_ids,
6569            Unknown(std::string::String),
6570        }
6571        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6572            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6573            where
6574                D: serde::Deserializer<'de>,
6575            {
6576                struct Visitor;
6577                impl<'de> serde::de::Visitor<'de> for Visitor {
6578                    type Value = __FieldTag;
6579                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6580                        formatter.write_str("a field name for UnenrollDataSourcesRequest")
6581                    }
6582                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6583                    where
6584                        E: serde::de::Error,
6585                    {
6586                        use std::result::Result::Ok;
6587                        use std::string::ToString;
6588                        match value {
6589                            "name" => Ok(__FieldTag::__name),
6590                            "dataSourceIds" => Ok(__FieldTag::__data_source_ids),
6591                            "data_source_ids" => Ok(__FieldTag::__data_source_ids),
6592                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6593                        }
6594                    }
6595                }
6596                deserializer.deserialize_identifier(Visitor)
6597            }
6598        }
6599        struct Visitor;
6600        impl<'de> serde::de::Visitor<'de> for Visitor {
6601            type Value = UnenrollDataSourcesRequest;
6602            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6603                formatter.write_str("struct UnenrollDataSourcesRequest")
6604            }
6605            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6606            where
6607                A: serde::de::MapAccess<'de>,
6608            {
6609                #[allow(unused_imports)]
6610                use serde::de::Error;
6611                use std::option::Option::Some;
6612                let mut fields = std::collections::HashSet::new();
6613                let mut result = Self::Value::new();
6614                while let Some(tag) = map.next_key::<__FieldTag>()? {
6615                    #[allow(clippy::match_single_binding)]
6616                    match tag {
6617                        __FieldTag::__name => {
6618                            if !fields.insert(__FieldTag::__name) {
6619                                return std::result::Result::Err(A::Error::duplicate_field(
6620                                    "multiple values for name",
6621                                ));
6622                            }
6623                            result.name = map
6624                                .next_value::<std::option::Option<std::string::String>>()?
6625                                .unwrap_or_default();
6626                        }
6627                        __FieldTag::__data_source_ids => {
6628                            if !fields.insert(__FieldTag::__data_source_ids) {
6629                                return std::result::Result::Err(A::Error::duplicate_field(
6630                                    "multiple values for data_source_ids",
6631                                ));
6632                            }
6633                            result.data_source_ids = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
6634                        }
6635                        __FieldTag::Unknown(key) => {
6636                            let value = map.next_value::<serde_json::Value>()?;
6637                            result._unknown_fields.insert(key, value);
6638                        }
6639                    }
6640                }
6641                std::result::Result::Ok(result)
6642            }
6643        }
6644        deserializer.deserialize_any(Visitor)
6645    }
6646}
6647
6648#[doc(hidden)]
6649impl serde::ser::Serialize for UnenrollDataSourcesRequest {
6650    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6651    where
6652        S: serde::ser::Serializer,
6653    {
6654        use serde::ser::SerializeMap;
6655        #[allow(unused_imports)]
6656        use std::option::Option::Some;
6657        let mut state = serializer.serialize_map(std::option::Option::None)?;
6658        if !self.name.is_empty() {
6659            state.serialize_entry("name", &self.name)?;
6660        }
6661        if !self.data_source_ids.is_empty() {
6662            state.serialize_entry("dataSourceIds", &self.data_source_ids)?;
6663        }
6664        if !self._unknown_fields.is_empty() {
6665            for (key, value) in self._unknown_fields.iter() {
6666                state.serialize_entry(key, &value)?;
6667            }
6668        }
6669        state.end()
6670    }
6671}
6672
6673impl std::fmt::Debug for UnenrollDataSourcesRequest {
6674    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6675        let mut debug_struct = f.debug_struct("UnenrollDataSourcesRequest");
6676        debug_struct.field("name", &self.name);
6677        debug_struct.field("data_source_ids", &self.data_source_ids);
6678        if !self._unknown_fields.is_empty() {
6679            debug_struct.field("_unknown_fields", &self._unknown_fields);
6680        }
6681        debug_struct.finish()
6682    }
6683}
6684
6685/// Represents preferences for sending email notifications for transfer run
6686/// events.
6687#[derive(Clone, Default, PartialEq)]
6688#[non_exhaustive]
6689pub struct EmailPreferences {
6690    /// If true, email notifications will be sent on transfer run failures.
6691    pub enable_failure_email: bool,
6692
6693    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6694}
6695
6696impl EmailPreferences {
6697    pub fn new() -> Self {
6698        std::default::Default::default()
6699    }
6700
6701    /// Sets the value of [enable_failure_email][crate::model::EmailPreferences::enable_failure_email].
6702    pub fn set_enable_failure_email<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6703        self.enable_failure_email = v.into();
6704        self
6705    }
6706}
6707
6708impl wkt::message::Message for EmailPreferences {
6709    fn typename() -> &'static str {
6710        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.EmailPreferences"
6711    }
6712}
6713
6714#[doc(hidden)]
6715impl<'de> serde::de::Deserialize<'de> for EmailPreferences {
6716    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6717    where
6718        D: serde::Deserializer<'de>,
6719    {
6720        #[allow(non_camel_case_types)]
6721        #[doc(hidden)]
6722        #[derive(PartialEq, Eq, Hash)]
6723        enum __FieldTag {
6724            __enable_failure_email,
6725            Unknown(std::string::String),
6726        }
6727        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6728            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6729            where
6730                D: serde::Deserializer<'de>,
6731            {
6732                struct Visitor;
6733                impl<'de> serde::de::Visitor<'de> for Visitor {
6734                    type Value = __FieldTag;
6735                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6736                        formatter.write_str("a field name for EmailPreferences")
6737                    }
6738                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6739                    where
6740                        E: serde::de::Error,
6741                    {
6742                        use std::result::Result::Ok;
6743                        use std::string::ToString;
6744                        match value {
6745                            "enableFailureEmail" => Ok(__FieldTag::__enable_failure_email),
6746                            "enable_failure_email" => Ok(__FieldTag::__enable_failure_email),
6747                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6748                        }
6749                    }
6750                }
6751                deserializer.deserialize_identifier(Visitor)
6752            }
6753        }
6754        struct Visitor;
6755        impl<'de> serde::de::Visitor<'de> for Visitor {
6756            type Value = EmailPreferences;
6757            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6758                formatter.write_str("struct EmailPreferences")
6759            }
6760            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6761            where
6762                A: serde::de::MapAccess<'de>,
6763            {
6764                #[allow(unused_imports)]
6765                use serde::de::Error;
6766                use std::option::Option::Some;
6767                let mut fields = std::collections::HashSet::new();
6768                let mut result = Self::Value::new();
6769                while let Some(tag) = map.next_key::<__FieldTag>()? {
6770                    #[allow(clippy::match_single_binding)]
6771                    match tag {
6772                        __FieldTag::__enable_failure_email => {
6773                            if !fields.insert(__FieldTag::__enable_failure_email) {
6774                                return std::result::Result::Err(A::Error::duplicate_field(
6775                                    "multiple values for enable_failure_email",
6776                                ));
6777                            }
6778                            result.enable_failure_email = map
6779                                .next_value::<std::option::Option<bool>>()?
6780                                .unwrap_or_default();
6781                        }
6782                        __FieldTag::Unknown(key) => {
6783                            let value = map.next_value::<serde_json::Value>()?;
6784                            result._unknown_fields.insert(key, value);
6785                        }
6786                    }
6787                }
6788                std::result::Result::Ok(result)
6789            }
6790        }
6791        deserializer.deserialize_any(Visitor)
6792    }
6793}
6794
6795#[doc(hidden)]
6796impl serde::ser::Serialize for EmailPreferences {
6797    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6798    where
6799        S: serde::ser::Serializer,
6800    {
6801        use serde::ser::SerializeMap;
6802        #[allow(unused_imports)]
6803        use std::option::Option::Some;
6804        let mut state = serializer.serialize_map(std::option::Option::None)?;
6805        if !wkt::internal::is_default(&self.enable_failure_email) {
6806            state.serialize_entry("enableFailureEmail", &self.enable_failure_email)?;
6807        }
6808        if !self._unknown_fields.is_empty() {
6809            for (key, value) in self._unknown_fields.iter() {
6810                state.serialize_entry(key, &value)?;
6811            }
6812        }
6813        state.end()
6814    }
6815}
6816
6817impl std::fmt::Debug for EmailPreferences {
6818    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6819        let mut debug_struct = f.debug_struct("EmailPreferences");
6820        debug_struct.field("enable_failure_email", &self.enable_failure_email);
6821        if !self._unknown_fields.is_empty() {
6822            debug_struct.field("_unknown_fields", &self._unknown_fields);
6823        }
6824        debug_struct.finish()
6825    }
6826}
6827
6828/// Options customizing the data transfer schedule.
6829#[derive(Clone, Default, PartialEq)]
6830#[non_exhaustive]
6831pub struct ScheduleOptions {
6832    /// If true, automatic scheduling of data transfer runs for this configuration
6833    /// will be disabled. The runs can be started on ad-hoc basis using
6834    /// StartManualTransferRuns API. When automatic scheduling is disabled, the
6835    /// TransferConfig.schedule field will be ignored.
6836    pub disable_auto_scheduling: bool,
6837
6838    /// Specifies time to start scheduling transfer runs. The first run will be
6839    /// scheduled at or after the start time according to a recurrence pattern
6840    /// defined in the schedule string. The start time can be changed at any
6841    /// moment. The time when a data transfer can be triggered manually is not
6842    /// limited by this option.
6843    pub start_time: std::option::Option<wkt::Timestamp>,
6844
6845    /// Defines time to stop scheduling transfer runs. A transfer run cannot be
6846    /// scheduled at or after the end time. The end time can be changed at any
6847    /// moment. The time when a data transfer can be triggered manually is not
6848    /// limited by this option.
6849    pub end_time: std::option::Option<wkt::Timestamp>,
6850
6851    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6852}
6853
6854impl ScheduleOptions {
6855    pub fn new() -> Self {
6856        std::default::Default::default()
6857    }
6858
6859    /// Sets the value of [disable_auto_scheduling][crate::model::ScheduleOptions::disable_auto_scheduling].
6860    pub fn set_disable_auto_scheduling<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6861        self.disable_auto_scheduling = v.into();
6862        self
6863    }
6864
6865    /// Sets the value of [start_time][crate::model::ScheduleOptions::start_time].
6866    pub fn set_start_time<T>(mut self, v: T) -> Self
6867    where
6868        T: std::convert::Into<wkt::Timestamp>,
6869    {
6870        self.start_time = std::option::Option::Some(v.into());
6871        self
6872    }
6873
6874    /// Sets or clears the value of [start_time][crate::model::ScheduleOptions::start_time].
6875    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
6876    where
6877        T: std::convert::Into<wkt::Timestamp>,
6878    {
6879        self.start_time = v.map(|x| x.into());
6880        self
6881    }
6882
6883    /// Sets the value of [end_time][crate::model::ScheduleOptions::end_time].
6884    pub fn set_end_time<T>(mut self, v: T) -> Self
6885    where
6886        T: std::convert::Into<wkt::Timestamp>,
6887    {
6888        self.end_time = std::option::Option::Some(v.into());
6889        self
6890    }
6891
6892    /// Sets or clears the value of [end_time][crate::model::ScheduleOptions::end_time].
6893    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
6894    where
6895        T: std::convert::Into<wkt::Timestamp>,
6896    {
6897        self.end_time = v.map(|x| x.into());
6898        self
6899    }
6900}
6901
6902impl wkt::message::Message for ScheduleOptions {
6903    fn typename() -> &'static str {
6904        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ScheduleOptions"
6905    }
6906}
6907
6908#[doc(hidden)]
6909impl<'de> serde::de::Deserialize<'de> for ScheduleOptions {
6910    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6911    where
6912        D: serde::Deserializer<'de>,
6913    {
6914        #[allow(non_camel_case_types)]
6915        #[doc(hidden)]
6916        #[derive(PartialEq, Eq, Hash)]
6917        enum __FieldTag {
6918            __disable_auto_scheduling,
6919            __start_time,
6920            __end_time,
6921            Unknown(std::string::String),
6922        }
6923        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6924            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6925            where
6926                D: serde::Deserializer<'de>,
6927            {
6928                struct Visitor;
6929                impl<'de> serde::de::Visitor<'de> for Visitor {
6930                    type Value = __FieldTag;
6931                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6932                        formatter.write_str("a field name for ScheduleOptions")
6933                    }
6934                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6935                    where
6936                        E: serde::de::Error,
6937                    {
6938                        use std::result::Result::Ok;
6939                        use std::string::ToString;
6940                        match value {
6941                            "disableAutoScheduling" => Ok(__FieldTag::__disable_auto_scheduling),
6942                            "disable_auto_scheduling" => Ok(__FieldTag::__disable_auto_scheduling),
6943                            "startTime" => Ok(__FieldTag::__start_time),
6944                            "start_time" => Ok(__FieldTag::__start_time),
6945                            "endTime" => Ok(__FieldTag::__end_time),
6946                            "end_time" => Ok(__FieldTag::__end_time),
6947                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6948                        }
6949                    }
6950                }
6951                deserializer.deserialize_identifier(Visitor)
6952            }
6953        }
6954        struct Visitor;
6955        impl<'de> serde::de::Visitor<'de> for Visitor {
6956            type Value = ScheduleOptions;
6957            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6958                formatter.write_str("struct ScheduleOptions")
6959            }
6960            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6961            where
6962                A: serde::de::MapAccess<'de>,
6963            {
6964                #[allow(unused_imports)]
6965                use serde::de::Error;
6966                use std::option::Option::Some;
6967                let mut fields = std::collections::HashSet::new();
6968                let mut result = Self::Value::new();
6969                while let Some(tag) = map.next_key::<__FieldTag>()? {
6970                    #[allow(clippy::match_single_binding)]
6971                    match tag {
6972                        __FieldTag::__disable_auto_scheduling => {
6973                            if !fields.insert(__FieldTag::__disable_auto_scheduling) {
6974                                return std::result::Result::Err(A::Error::duplicate_field(
6975                                    "multiple values for disable_auto_scheduling",
6976                                ));
6977                            }
6978                            result.disable_auto_scheduling = map
6979                                .next_value::<std::option::Option<bool>>()?
6980                                .unwrap_or_default();
6981                        }
6982                        __FieldTag::__start_time => {
6983                            if !fields.insert(__FieldTag::__start_time) {
6984                                return std::result::Result::Err(A::Error::duplicate_field(
6985                                    "multiple values for start_time",
6986                                ));
6987                            }
6988                            result.start_time =
6989                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
6990                        }
6991                        __FieldTag::__end_time => {
6992                            if !fields.insert(__FieldTag::__end_time) {
6993                                return std::result::Result::Err(A::Error::duplicate_field(
6994                                    "multiple values for end_time",
6995                                ));
6996                            }
6997                            result.end_time =
6998                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
6999                        }
7000                        __FieldTag::Unknown(key) => {
7001                            let value = map.next_value::<serde_json::Value>()?;
7002                            result._unknown_fields.insert(key, value);
7003                        }
7004                    }
7005                }
7006                std::result::Result::Ok(result)
7007            }
7008        }
7009        deserializer.deserialize_any(Visitor)
7010    }
7011}
7012
7013#[doc(hidden)]
7014impl serde::ser::Serialize for ScheduleOptions {
7015    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7016    where
7017        S: serde::ser::Serializer,
7018    {
7019        use serde::ser::SerializeMap;
7020        #[allow(unused_imports)]
7021        use std::option::Option::Some;
7022        let mut state = serializer.serialize_map(std::option::Option::None)?;
7023        if !wkt::internal::is_default(&self.disable_auto_scheduling) {
7024            state.serialize_entry("disableAutoScheduling", &self.disable_auto_scheduling)?;
7025        }
7026        if self.start_time.is_some() {
7027            state.serialize_entry("startTime", &self.start_time)?;
7028        }
7029        if self.end_time.is_some() {
7030            state.serialize_entry("endTime", &self.end_time)?;
7031        }
7032        if !self._unknown_fields.is_empty() {
7033            for (key, value) in self._unknown_fields.iter() {
7034                state.serialize_entry(key, &value)?;
7035            }
7036        }
7037        state.end()
7038    }
7039}
7040
7041impl std::fmt::Debug for ScheduleOptions {
7042    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7043        let mut debug_struct = f.debug_struct("ScheduleOptions");
7044        debug_struct.field("disable_auto_scheduling", &self.disable_auto_scheduling);
7045        debug_struct.field("start_time", &self.start_time);
7046        debug_struct.field("end_time", &self.end_time);
7047        if !self._unknown_fields.is_empty() {
7048            debug_struct.field("_unknown_fields", &self._unknown_fields);
7049        }
7050        debug_struct.finish()
7051    }
7052}
7053
7054/// V2 options customizing different types of data transfer schedule.
7055/// This field supports existing time-based and manual transfer schedule. Also
7056/// supports Event-Driven transfer schedule. ScheduleOptionsV2 cannot be used
7057/// together with ScheduleOptions/Schedule.
7058#[derive(Clone, Default, PartialEq)]
7059#[non_exhaustive]
7060pub struct ScheduleOptionsV2 {
7061    /// Data transfer schedules.
7062    pub schedule: std::option::Option<crate::model::schedule_options_v_2::Schedule>,
7063
7064    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7065}
7066
7067impl ScheduleOptionsV2 {
7068    pub fn new() -> Self {
7069        std::default::Default::default()
7070    }
7071
7072    /// Sets the value of [schedule][crate::model::ScheduleOptionsV2::schedule].
7073    ///
7074    /// Note that all the setters affecting `schedule` are mutually
7075    /// exclusive.
7076    pub fn set_schedule<
7077        T: std::convert::Into<std::option::Option<crate::model::schedule_options_v_2::Schedule>>,
7078    >(
7079        mut self,
7080        v: T,
7081    ) -> Self {
7082        self.schedule = v.into();
7083        self
7084    }
7085
7086    /// The value of [schedule][crate::model::ScheduleOptionsV2::schedule]
7087    /// if it holds a `TimeBasedSchedule`, `None` if the field is not set or
7088    /// holds a different branch.
7089    pub fn time_based_schedule(
7090        &self,
7091    ) -> std::option::Option<&std::boxed::Box<crate::model::TimeBasedSchedule>> {
7092        #[allow(unreachable_patterns)]
7093        self.schedule.as_ref().and_then(|v| match v {
7094            crate::model::schedule_options_v_2::Schedule::TimeBasedSchedule(v) => {
7095                std::option::Option::Some(v)
7096            }
7097            _ => std::option::Option::None,
7098        })
7099    }
7100
7101    /// Sets the value of [schedule][crate::model::ScheduleOptionsV2::schedule]
7102    /// to hold a `TimeBasedSchedule`.
7103    ///
7104    /// Note that all the setters affecting `schedule` are
7105    /// mutually exclusive.
7106    pub fn set_time_based_schedule<
7107        T: std::convert::Into<std::boxed::Box<crate::model::TimeBasedSchedule>>,
7108    >(
7109        mut self,
7110        v: T,
7111    ) -> Self {
7112        self.schedule = std::option::Option::Some(
7113            crate::model::schedule_options_v_2::Schedule::TimeBasedSchedule(v.into()),
7114        );
7115        self
7116    }
7117
7118    /// The value of [schedule][crate::model::ScheduleOptionsV2::schedule]
7119    /// if it holds a `ManualSchedule`, `None` if the field is not set or
7120    /// holds a different branch.
7121    pub fn manual_schedule(
7122        &self,
7123    ) -> std::option::Option<&std::boxed::Box<crate::model::ManualSchedule>> {
7124        #[allow(unreachable_patterns)]
7125        self.schedule.as_ref().and_then(|v| match v {
7126            crate::model::schedule_options_v_2::Schedule::ManualSchedule(v) => {
7127                std::option::Option::Some(v)
7128            }
7129            _ => std::option::Option::None,
7130        })
7131    }
7132
7133    /// Sets the value of [schedule][crate::model::ScheduleOptionsV2::schedule]
7134    /// to hold a `ManualSchedule`.
7135    ///
7136    /// Note that all the setters affecting `schedule` are
7137    /// mutually exclusive.
7138    pub fn set_manual_schedule<
7139        T: std::convert::Into<std::boxed::Box<crate::model::ManualSchedule>>,
7140    >(
7141        mut self,
7142        v: T,
7143    ) -> Self {
7144        self.schedule = std::option::Option::Some(
7145            crate::model::schedule_options_v_2::Schedule::ManualSchedule(v.into()),
7146        );
7147        self
7148    }
7149
7150    /// The value of [schedule][crate::model::ScheduleOptionsV2::schedule]
7151    /// if it holds a `EventDrivenSchedule`, `None` if the field is not set or
7152    /// holds a different branch.
7153    pub fn event_driven_schedule(
7154        &self,
7155    ) -> std::option::Option<&std::boxed::Box<crate::model::EventDrivenSchedule>> {
7156        #[allow(unreachable_patterns)]
7157        self.schedule.as_ref().and_then(|v| match v {
7158            crate::model::schedule_options_v_2::Schedule::EventDrivenSchedule(v) => {
7159                std::option::Option::Some(v)
7160            }
7161            _ => std::option::Option::None,
7162        })
7163    }
7164
7165    /// Sets the value of [schedule][crate::model::ScheduleOptionsV2::schedule]
7166    /// to hold a `EventDrivenSchedule`.
7167    ///
7168    /// Note that all the setters affecting `schedule` are
7169    /// mutually exclusive.
7170    pub fn set_event_driven_schedule<
7171        T: std::convert::Into<std::boxed::Box<crate::model::EventDrivenSchedule>>,
7172    >(
7173        mut self,
7174        v: T,
7175    ) -> Self {
7176        self.schedule = std::option::Option::Some(
7177            crate::model::schedule_options_v_2::Schedule::EventDrivenSchedule(v.into()),
7178        );
7179        self
7180    }
7181}
7182
7183impl wkt::message::Message for ScheduleOptionsV2 {
7184    fn typename() -> &'static str {
7185        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ScheduleOptionsV2"
7186    }
7187}
7188
7189#[doc(hidden)]
7190impl<'de> serde::de::Deserialize<'de> for ScheduleOptionsV2 {
7191    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7192    where
7193        D: serde::Deserializer<'de>,
7194    {
7195        #[allow(non_camel_case_types)]
7196        #[doc(hidden)]
7197        #[derive(PartialEq, Eq, Hash)]
7198        enum __FieldTag {
7199            __time_based_schedule,
7200            __manual_schedule,
7201            __event_driven_schedule,
7202            Unknown(std::string::String),
7203        }
7204        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7205            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7206            where
7207                D: serde::Deserializer<'de>,
7208            {
7209                struct Visitor;
7210                impl<'de> serde::de::Visitor<'de> for Visitor {
7211                    type Value = __FieldTag;
7212                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7213                        formatter.write_str("a field name for ScheduleOptionsV2")
7214                    }
7215                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7216                    where
7217                        E: serde::de::Error,
7218                    {
7219                        use std::result::Result::Ok;
7220                        use std::string::ToString;
7221                        match value {
7222                            "timeBasedSchedule" => Ok(__FieldTag::__time_based_schedule),
7223                            "time_based_schedule" => Ok(__FieldTag::__time_based_schedule),
7224                            "manualSchedule" => Ok(__FieldTag::__manual_schedule),
7225                            "manual_schedule" => Ok(__FieldTag::__manual_schedule),
7226                            "eventDrivenSchedule" => Ok(__FieldTag::__event_driven_schedule),
7227                            "event_driven_schedule" => Ok(__FieldTag::__event_driven_schedule),
7228                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7229                        }
7230                    }
7231                }
7232                deserializer.deserialize_identifier(Visitor)
7233            }
7234        }
7235        struct Visitor;
7236        impl<'de> serde::de::Visitor<'de> for Visitor {
7237            type Value = ScheduleOptionsV2;
7238            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7239                formatter.write_str("struct ScheduleOptionsV2")
7240            }
7241            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7242            where
7243                A: serde::de::MapAccess<'de>,
7244            {
7245                #[allow(unused_imports)]
7246                use serde::de::Error;
7247                use std::option::Option::Some;
7248                let mut fields = std::collections::HashSet::new();
7249                let mut result = Self::Value::new();
7250                while let Some(tag) = map.next_key::<__FieldTag>()? {
7251                    #[allow(clippy::match_single_binding)]
7252                    match tag {
7253                        __FieldTag::__time_based_schedule => {
7254                            if !fields.insert(__FieldTag::__time_based_schedule) {
7255                                return std::result::Result::Err(A::Error::duplicate_field(
7256                                    "multiple values for time_based_schedule",
7257                                ));
7258                            }
7259                            if result.schedule.is_some() {
7260                                return std::result::Result::Err(A::Error::duplicate_field(
7261                                    "multiple values for `schedule`, a oneof with full ID .google.cloud.bigquery.datatransfer.v1.ScheduleOptionsV2.time_based_schedule, latest field was timeBasedSchedule",
7262                                ));
7263                            }
7264                            result.schedule = std::option::Option::Some(
7265                                crate::model::schedule_options_v_2::Schedule::TimeBasedSchedule(
7266                                    map.next_value::<std::option::Option<
7267                                        std::boxed::Box<crate::model::TimeBasedSchedule>,
7268                                    >>()?
7269                                    .unwrap_or_default(),
7270                                ),
7271                            );
7272                        }
7273                        __FieldTag::__manual_schedule => {
7274                            if !fields.insert(__FieldTag::__manual_schedule) {
7275                                return std::result::Result::Err(A::Error::duplicate_field(
7276                                    "multiple values for manual_schedule",
7277                                ));
7278                            }
7279                            if result.schedule.is_some() {
7280                                return std::result::Result::Err(A::Error::duplicate_field(
7281                                    "multiple values for `schedule`, a oneof with full ID .google.cloud.bigquery.datatransfer.v1.ScheduleOptionsV2.manual_schedule, latest field was manualSchedule",
7282                                ));
7283                            }
7284                            result.schedule = std::option::Option::Some(
7285                                crate::model::schedule_options_v_2::Schedule::ManualSchedule(
7286                                    map.next_value::<std::option::Option<
7287                                        std::boxed::Box<crate::model::ManualSchedule>,
7288                                    >>()?
7289                                    .unwrap_or_default(),
7290                                ),
7291                            );
7292                        }
7293                        __FieldTag::__event_driven_schedule => {
7294                            if !fields.insert(__FieldTag::__event_driven_schedule) {
7295                                return std::result::Result::Err(A::Error::duplicate_field(
7296                                    "multiple values for event_driven_schedule",
7297                                ));
7298                            }
7299                            if result.schedule.is_some() {
7300                                return std::result::Result::Err(A::Error::duplicate_field(
7301                                    "multiple values for `schedule`, a oneof with full ID .google.cloud.bigquery.datatransfer.v1.ScheduleOptionsV2.event_driven_schedule, latest field was eventDrivenSchedule",
7302                                ));
7303                            }
7304                            result.schedule = std::option::Option::Some(
7305                                crate::model::schedule_options_v_2::Schedule::EventDrivenSchedule(
7306                                    map.next_value::<std::option::Option<
7307                                        std::boxed::Box<crate::model::EventDrivenSchedule>,
7308                                    >>()?
7309                                    .unwrap_or_default(),
7310                                ),
7311                            );
7312                        }
7313                        __FieldTag::Unknown(key) => {
7314                            let value = map.next_value::<serde_json::Value>()?;
7315                            result._unknown_fields.insert(key, value);
7316                        }
7317                    }
7318                }
7319                std::result::Result::Ok(result)
7320            }
7321        }
7322        deserializer.deserialize_any(Visitor)
7323    }
7324}
7325
7326#[doc(hidden)]
7327impl serde::ser::Serialize for ScheduleOptionsV2 {
7328    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7329    where
7330        S: serde::ser::Serializer,
7331    {
7332        use serde::ser::SerializeMap;
7333        #[allow(unused_imports)]
7334        use std::option::Option::Some;
7335        let mut state = serializer.serialize_map(std::option::Option::None)?;
7336        if let Some(value) = self.time_based_schedule() {
7337            state.serialize_entry("timeBasedSchedule", value)?;
7338        }
7339        if let Some(value) = self.manual_schedule() {
7340            state.serialize_entry("manualSchedule", value)?;
7341        }
7342        if let Some(value) = self.event_driven_schedule() {
7343            state.serialize_entry("eventDrivenSchedule", value)?;
7344        }
7345        if !self._unknown_fields.is_empty() {
7346            for (key, value) in self._unknown_fields.iter() {
7347                state.serialize_entry(key, &value)?;
7348            }
7349        }
7350        state.end()
7351    }
7352}
7353
7354impl std::fmt::Debug for ScheduleOptionsV2 {
7355    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7356        let mut debug_struct = f.debug_struct("ScheduleOptionsV2");
7357        debug_struct.field("schedule", &self.schedule);
7358        if !self._unknown_fields.is_empty() {
7359            debug_struct.field("_unknown_fields", &self._unknown_fields);
7360        }
7361        debug_struct.finish()
7362    }
7363}
7364
7365/// Defines additional types related to [ScheduleOptionsV2].
7366pub mod schedule_options_v_2 {
7367    #[allow(unused_imports)]
7368    use super::*;
7369
7370    /// Data transfer schedules.
7371    #[derive(Clone, Debug, PartialEq)]
7372    #[non_exhaustive]
7373    pub enum Schedule {
7374        /// Time based transfer schedule options. This is the default schedule
7375        /// option.
7376        TimeBasedSchedule(std::boxed::Box<crate::model::TimeBasedSchedule>),
7377        /// Manual transfer schedule. If set, the transfer run will not be
7378        /// auto-scheduled by the system, unless the client invokes
7379        /// StartManualTransferRuns.  This is equivalent to
7380        /// disable_auto_scheduling = true.
7381        ManualSchedule(std::boxed::Box<crate::model::ManualSchedule>),
7382        /// Event driven transfer schedule options. If set, the transfer will be
7383        /// scheduled upon events arrial.
7384        EventDrivenSchedule(std::boxed::Box<crate::model::EventDrivenSchedule>),
7385    }
7386}
7387
7388/// Options customizing the time based transfer schedule.
7389/// Options are migrated from the original ScheduleOptions message.
7390#[derive(Clone, Default, PartialEq)]
7391#[non_exhaustive]
7392pub struct TimeBasedSchedule {
7393    /// Data transfer schedule.
7394    /// If the data source does not support a custom schedule, this should be
7395    /// empty. If it is empty, the default value for the data source will be used.
7396    /// The specified times are in UTC.
7397    /// Examples of valid format:
7398    /// `1st,3rd monday of month 15:30`,
7399    /// `every wed,fri of jan,jun 13:15`, and
7400    /// `first sunday of quarter 00:00`.
7401    /// See more explanation about the format here:
7402    /// <https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format>
7403    ///
7404    /// NOTE: The minimum interval time between recurring transfers depends on the
7405    /// data source; refer to the documentation for your data source.
7406    pub schedule: std::string::String,
7407
7408    /// Specifies time to start scheduling transfer runs. The first run will be
7409    /// scheduled at or after the start time according to a recurrence pattern
7410    /// defined in the schedule string. The start time can be changed at any
7411    /// moment.
7412    pub start_time: std::option::Option<wkt::Timestamp>,
7413
7414    /// Defines time to stop scheduling transfer runs. A transfer run cannot be
7415    /// scheduled at or after the end time. The end time can be changed at any
7416    /// moment.
7417    pub end_time: std::option::Option<wkt::Timestamp>,
7418
7419    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7420}
7421
7422impl TimeBasedSchedule {
7423    pub fn new() -> Self {
7424        std::default::Default::default()
7425    }
7426
7427    /// Sets the value of [schedule][crate::model::TimeBasedSchedule::schedule].
7428    pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7429        self.schedule = v.into();
7430        self
7431    }
7432
7433    /// Sets the value of [start_time][crate::model::TimeBasedSchedule::start_time].
7434    pub fn set_start_time<T>(mut self, v: T) -> Self
7435    where
7436        T: std::convert::Into<wkt::Timestamp>,
7437    {
7438        self.start_time = std::option::Option::Some(v.into());
7439        self
7440    }
7441
7442    /// Sets or clears the value of [start_time][crate::model::TimeBasedSchedule::start_time].
7443    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
7444    where
7445        T: std::convert::Into<wkt::Timestamp>,
7446    {
7447        self.start_time = v.map(|x| x.into());
7448        self
7449    }
7450
7451    /// Sets the value of [end_time][crate::model::TimeBasedSchedule::end_time].
7452    pub fn set_end_time<T>(mut self, v: T) -> Self
7453    where
7454        T: std::convert::Into<wkt::Timestamp>,
7455    {
7456        self.end_time = std::option::Option::Some(v.into());
7457        self
7458    }
7459
7460    /// Sets or clears the value of [end_time][crate::model::TimeBasedSchedule::end_time].
7461    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7462    where
7463        T: std::convert::Into<wkt::Timestamp>,
7464    {
7465        self.end_time = v.map(|x| x.into());
7466        self
7467    }
7468}
7469
7470impl wkt::message::Message for TimeBasedSchedule {
7471    fn typename() -> &'static str {
7472        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.TimeBasedSchedule"
7473    }
7474}
7475
7476#[doc(hidden)]
7477impl<'de> serde::de::Deserialize<'de> for TimeBasedSchedule {
7478    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7479    where
7480        D: serde::Deserializer<'de>,
7481    {
7482        #[allow(non_camel_case_types)]
7483        #[doc(hidden)]
7484        #[derive(PartialEq, Eq, Hash)]
7485        enum __FieldTag {
7486            __schedule,
7487            __start_time,
7488            __end_time,
7489            Unknown(std::string::String),
7490        }
7491        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7492            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7493            where
7494                D: serde::Deserializer<'de>,
7495            {
7496                struct Visitor;
7497                impl<'de> serde::de::Visitor<'de> for Visitor {
7498                    type Value = __FieldTag;
7499                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7500                        formatter.write_str("a field name for TimeBasedSchedule")
7501                    }
7502                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7503                    where
7504                        E: serde::de::Error,
7505                    {
7506                        use std::result::Result::Ok;
7507                        use std::string::ToString;
7508                        match value {
7509                            "schedule" => Ok(__FieldTag::__schedule),
7510                            "startTime" => Ok(__FieldTag::__start_time),
7511                            "start_time" => Ok(__FieldTag::__start_time),
7512                            "endTime" => Ok(__FieldTag::__end_time),
7513                            "end_time" => Ok(__FieldTag::__end_time),
7514                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7515                        }
7516                    }
7517                }
7518                deserializer.deserialize_identifier(Visitor)
7519            }
7520        }
7521        struct Visitor;
7522        impl<'de> serde::de::Visitor<'de> for Visitor {
7523            type Value = TimeBasedSchedule;
7524            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7525                formatter.write_str("struct TimeBasedSchedule")
7526            }
7527            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7528            where
7529                A: serde::de::MapAccess<'de>,
7530            {
7531                #[allow(unused_imports)]
7532                use serde::de::Error;
7533                use std::option::Option::Some;
7534                let mut fields = std::collections::HashSet::new();
7535                let mut result = Self::Value::new();
7536                while let Some(tag) = map.next_key::<__FieldTag>()? {
7537                    #[allow(clippy::match_single_binding)]
7538                    match tag {
7539                        __FieldTag::__schedule => {
7540                            if !fields.insert(__FieldTag::__schedule) {
7541                                return std::result::Result::Err(A::Error::duplicate_field(
7542                                    "multiple values for schedule",
7543                                ));
7544                            }
7545                            result.schedule = map
7546                                .next_value::<std::option::Option<std::string::String>>()?
7547                                .unwrap_or_default();
7548                        }
7549                        __FieldTag::__start_time => {
7550                            if !fields.insert(__FieldTag::__start_time) {
7551                                return std::result::Result::Err(A::Error::duplicate_field(
7552                                    "multiple values for start_time",
7553                                ));
7554                            }
7555                            result.start_time =
7556                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
7557                        }
7558                        __FieldTag::__end_time => {
7559                            if !fields.insert(__FieldTag::__end_time) {
7560                                return std::result::Result::Err(A::Error::duplicate_field(
7561                                    "multiple values for end_time",
7562                                ));
7563                            }
7564                            result.end_time =
7565                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
7566                        }
7567                        __FieldTag::Unknown(key) => {
7568                            let value = map.next_value::<serde_json::Value>()?;
7569                            result._unknown_fields.insert(key, value);
7570                        }
7571                    }
7572                }
7573                std::result::Result::Ok(result)
7574            }
7575        }
7576        deserializer.deserialize_any(Visitor)
7577    }
7578}
7579
7580#[doc(hidden)]
7581impl serde::ser::Serialize for TimeBasedSchedule {
7582    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7583    where
7584        S: serde::ser::Serializer,
7585    {
7586        use serde::ser::SerializeMap;
7587        #[allow(unused_imports)]
7588        use std::option::Option::Some;
7589        let mut state = serializer.serialize_map(std::option::Option::None)?;
7590        if !self.schedule.is_empty() {
7591            state.serialize_entry("schedule", &self.schedule)?;
7592        }
7593        if self.start_time.is_some() {
7594            state.serialize_entry("startTime", &self.start_time)?;
7595        }
7596        if self.end_time.is_some() {
7597            state.serialize_entry("endTime", &self.end_time)?;
7598        }
7599        if !self._unknown_fields.is_empty() {
7600            for (key, value) in self._unknown_fields.iter() {
7601                state.serialize_entry(key, &value)?;
7602            }
7603        }
7604        state.end()
7605    }
7606}
7607
7608impl std::fmt::Debug for TimeBasedSchedule {
7609    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7610        let mut debug_struct = f.debug_struct("TimeBasedSchedule");
7611        debug_struct.field("schedule", &self.schedule);
7612        debug_struct.field("start_time", &self.start_time);
7613        debug_struct.field("end_time", &self.end_time);
7614        if !self._unknown_fields.is_empty() {
7615            debug_struct.field("_unknown_fields", &self._unknown_fields);
7616        }
7617        debug_struct.finish()
7618    }
7619}
7620
7621/// Options customizing manual transfers schedule.
7622#[derive(Clone, Default, PartialEq)]
7623#[non_exhaustive]
7624pub struct ManualSchedule {
7625    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7626}
7627
7628impl ManualSchedule {
7629    pub fn new() -> Self {
7630        std::default::Default::default()
7631    }
7632}
7633
7634impl wkt::message::Message for ManualSchedule {
7635    fn typename() -> &'static str {
7636        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.ManualSchedule"
7637    }
7638}
7639
7640#[doc(hidden)]
7641impl<'de> serde::de::Deserialize<'de> for ManualSchedule {
7642    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7643    where
7644        D: serde::Deserializer<'de>,
7645    {
7646        #[allow(non_camel_case_types)]
7647        #[doc(hidden)]
7648        #[derive(PartialEq, Eq, Hash)]
7649        enum __FieldTag {
7650            Unknown(std::string::String),
7651        }
7652        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7653            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7654            where
7655                D: serde::Deserializer<'de>,
7656            {
7657                struct Visitor;
7658                impl<'de> serde::de::Visitor<'de> for Visitor {
7659                    type Value = __FieldTag;
7660                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7661                        formatter.write_str("a field name for ManualSchedule")
7662                    }
7663                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7664                    where
7665                        E: serde::de::Error,
7666                    {
7667                        use std::result::Result::Ok;
7668                        use std::string::ToString;
7669                        Ok(__FieldTag::Unknown(value.to_string()))
7670                    }
7671                }
7672                deserializer.deserialize_identifier(Visitor)
7673            }
7674        }
7675        struct Visitor;
7676        impl<'de> serde::de::Visitor<'de> for Visitor {
7677            type Value = ManualSchedule;
7678            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7679                formatter.write_str("struct ManualSchedule")
7680            }
7681            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7682            where
7683                A: serde::de::MapAccess<'de>,
7684            {
7685                #[allow(unused_imports)]
7686                use serde::de::Error;
7687                use std::option::Option::Some;
7688                let mut result = Self::Value::new();
7689                while let Some(tag) = map.next_key::<__FieldTag>()? {
7690                    #[allow(clippy::match_single_binding)]
7691                    match tag {
7692                        __FieldTag::Unknown(key) => {
7693                            let value = map.next_value::<serde_json::Value>()?;
7694                            result._unknown_fields.insert(key, value);
7695                        }
7696                    }
7697                }
7698                std::result::Result::Ok(result)
7699            }
7700        }
7701        deserializer.deserialize_any(Visitor)
7702    }
7703}
7704
7705#[doc(hidden)]
7706impl serde::ser::Serialize for ManualSchedule {
7707    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7708    where
7709        S: serde::ser::Serializer,
7710    {
7711        use serde::ser::SerializeMap;
7712        #[allow(unused_imports)]
7713        use std::option::Option::Some;
7714        let mut state = serializer.serialize_map(std::option::Option::None)?;
7715        if !self._unknown_fields.is_empty() {
7716            for (key, value) in self._unknown_fields.iter() {
7717                state.serialize_entry(key, &value)?;
7718            }
7719        }
7720        state.end()
7721    }
7722}
7723
7724impl std::fmt::Debug for ManualSchedule {
7725    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7726        let mut debug_struct = f.debug_struct("ManualSchedule");
7727        if !self._unknown_fields.is_empty() {
7728            debug_struct.field("_unknown_fields", &self._unknown_fields);
7729        }
7730        debug_struct.finish()
7731    }
7732}
7733
7734/// Options customizing EventDriven transfers schedule.
7735#[derive(Clone, Default, PartialEq)]
7736#[non_exhaustive]
7737pub struct EventDrivenSchedule {
7738    /// Pub/Sub subscription name used to receive events.
7739    /// Only Google Cloud Storage data source support this option.
7740    /// Format: projects/{project}/subscriptions/{subscription}
7741    pub pubsub_subscription: std::string::String,
7742
7743    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7744}
7745
7746impl EventDrivenSchedule {
7747    pub fn new() -> Self {
7748        std::default::Default::default()
7749    }
7750
7751    /// Sets the value of [pubsub_subscription][crate::model::EventDrivenSchedule::pubsub_subscription].
7752    pub fn set_pubsub_subscription<T: std::convert::Into<std::string::String>>(
7753        mut self,
7754        v: T,
7755    ) -> Self {
7756        self.pubsub_subscription = v.into();
7757        self
7758    }
7759}
7760
7761impl wkt::message::Message for EventDrivenSchedule {
7762    fn typename() -> &'static str {
7763        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.EventDrivenSchedule"
7764    }
7765}
7766
7767#[doc(hidden)]
7768impl<'de> serde::de::Deserialize<'de> for EventDrivenSchedule {
7769    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7770    where
7771        D: serde::Deserializer<'de>,
7772    {
7773        #[allow(non_camel_case_types)]
7774        #[doc(hidden)]
7775        #[derive(PartialEq, Eq, Hash)]
7776        enum __FieldTag {
7777            __pubsub_subscription,
7778            Unknown(std::string::String),
7779        }
7780        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7781            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7782            where
7783                D: serde::Deserializer<'de>,
7784            {
7785                struct Visitor;
7786                impl<'de> serde::de::Visitor<'de> for Visitor {
7787                    type Value = __FieldTag;
7788                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7789                        formatter.write_str("a field name for EventDrivenSchedule")
7790                    }
7791                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7792                    where
7793                        E: serde::de::Error,
7794                    {
7795                        use std::result::Result::Ok;
7796                        use std::string::ToString;
7797                        match value {
7798                            "pubsubSubscription" => Ok(__FieldTag::__pubsub_subscription),
7799                            "pubsub_subscription" => Ok(__FieldTag::__pubsub_subscription),
7800                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7801                        }
7802                    }
7803                }
7804                deserializer.deserialize_identifier(Visitor)
7805            }
7806        }
7807        struct Visitor;
7808        impl<'de> serde::de::Visitor<'de> for Visitor {
7809            type Value = EventDrivenSchedule;
7810            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7811                formatter.write_str("struct EventDrivenSchedule")
7812            }
7813            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7814            where
7815                A: serde::de::MapAccess<'de>,
7816            {
7817                #[allow(unused_imports)]
7818                use serde::de::Error;
7819                use std::option::Option::Some;
7820                let mut fields = std::collections::HashSet::new();
7821                let mut result = Self::Value::new();
7822                while let Some(tag) = map.next_key::<__FieldTag>()? {
7823                    #[allow(clippy::match_single_binding)]
7824                    match tag {
7825                        __FieldTag::__pubsub_subscription => {
7826                            if !fields.insert(__FieldTag::__pubsub_subscription) {
7827                                return std::result::Result::Err(A::Error::duplicate_field(
7828                                    "multiple values for pubsub_subscription",
7829                                ));
7830                            }
7831                            result.pubsub_subscription = map
7832                                .next_value::<std::option::Option<std::string::String>>()?
7833                                .unwrap_or_default();
7834                        }
7835                        __FieldTag::Unknown(key) => {
7836                            let value = map.next_value::<serde_json::Value>()?;
7837                            result._unknown_fields.insert(key, value);
7838                        }
7839                    }
7840                }
7841                std::result::Result::Ok(result)
7842            }
7843        }
7844        deserializer.deserialize_any(Visitor)
7845    }
7846}
7847
7848#[doc(hidden)]
7849impl serde::ser::Serialize for EventDrivenSchedule {
7850    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7851    where
7852        S: serde::ser::Serializer,
7853    {
7854        use serde::ser::SerializeMap;
7855        #[allow(unused_imports)]
7856        use std::option::Option::Some;
7857        let mut state = serializer.serialize_map(std::option::Option::None)?;
7858        if !self.pubsub_subscription.is_empty() {
7859            state.serialize_entry("pubsubSubscription", &self.pubsub_subscription)?;
7860        }
7861        if !self._unknown_fields.is_empty() {
7862            for (key, value) in self._unknown_fields.iter() {
7863                state.serialize_entry(key, &value)?;
7864            }
7865        }
7866        state.end()
7867    }
7868}
7869
7870impl std::fmt::Debug for EventDrivenSchedule {
7871    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7872        let mut debug_struct = f.debug_struct("EventDrivenSchedule");
7873        debug_struct.field("pubsub_subscription", &self.pubsub_subscription);
7874        if !self._unknown_fields.is_empty() {
7875            debug_struct.field("_unknown_fields", &self._unknown_fields);
7876        }
7877        debug_struct.finish()
7878    }
7879}
7880
7881/// Information about a user.
7882#[derive(Clone, Default, PartialEq)]
7883#[non_exhaustive]
7884pub struct UserInfo {
7885    /// E-mail address of the user.
7886    pub email: std::option::Option<std::string::String>,
7887
7888    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7889}
7890
7891impl UserInfo {
7892    pub fn new() -> Self {
7893        std::default::Default::default()
7894    }
7895
7896    /// Sets the value of [email][crate::model::UserInfo::email].
7897    pub fn set_email<T>(mut self, v: T) -> Self
7898    where
7899        T: std::convert::Into<std::string::String>,
7900    {
7901        self.email = std::option::Option::Some(v.into());
7902        self
7903    }
7904
7905    /// Sets or clears the value of [email][crate::model::UserInfo::email].
7906    pub fn set_or_clear_email<T>(mut self, v: std::option::Option<T>) -> Self
7907    where
7908        T: std::convert::Into<std::string::String>,
7909    {
7910        self.email = v.map(|x| x.into());
7911        self
7912    }
7913}
7914
7915impl wkt::message::Message for UserInfo {
7916    fn typename() -> &'static str {
7917        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.UserInfo"
7918    }
7919}
7920
7921#[doc(hidden)]
7922impl<'de> serde::de::Deserialize<'de> for UserInfo {
7923    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7924    where
7925        D: serde::Deserializer<'de>,
7926    {
7927        #[allow(non_camel_case_types)]
7928        #[doc(hidden)]
7929        #[derive(PartialEq, Eq, Hash)]
7930        enum __FieldTag {
7931            __email,
7932            Unknown(std::string::String),
7933        }
7934        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7935            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7936            where
7937                D: serde::Deserializer<'de>,
7938            {
7939                struct Visitor;
7940                impl<'de> serde::de::Visitor<'de> for Visitor {
7941                    type Value = __FieldTag;
7942                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7943                        formatter.write_str("a field name for UserInfo")
7944                    }
7945                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7946                    where
7947                        E: serde::de::Error,
7948                    {
7949                        use std::result::Result::Ok;
7950                        use std::string::ToString;
7951                        match value {
7952                            "email" => Ok(__FieldTag::__email),
7953                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7954                        }
7955                    }
7956                }
7957                deserializer.deserialize_identifier(Visitor)
7958            }
7959        }
7960        struct Visitor;
7961        impl<'de> serde::de::Visitor<'de> for Visitor {
7962            type Value = UserInfo;
7963            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7964                formatter.write_str("struct UserInfo")
7965            }
7966            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7967            where
7968                A: serde::de::MapAccess<'de>,
7969            {
7970                #[allow(unused_imports)]
7971                use serde::de::Error;
7972                use std::option::Option::Some;
7973                let mut fields = std::collections::HashSet::new();
7974                let mut result = Self::Value::new();
7975                while let Some(tag) = map.next_key::<__FieldTag>()? {
7976                    #[allow(clippy::match_single_binding)]
7977                    match tag {
7978                        __FieldTag::__email => {
7979                            if !fields.insert(__FieldTag::__email) {
7980                                return std::result::Result::Err(A::Error::duplicate_field(
7981                                    "multiple values for email",
7982                                ));
7983                            }
7984                            result.email =
7985                                map.next_value::<std::option::Option<std::string::String>>()?;
7986                        }
7987                        __FieldTag::Unknown(key) => {
7988                            let value = map.next_value::<serde_json::Value>()?;
7989                            result._unknown_fields.insert(key, value);
7990                        }
7991                    }
7992                }
7993                std::result::Result::Ok(result)
7994            }
7995        }
7996        deserializer.deserialize_any(Visitor)
7997    }
7998}
7999
8000#[doc(hidden)]
8001impl serde::ser::Serialize for UserInfo {
8002    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8003    where
8004        S: serde::ser::Serializer,
8005    {
8006        use serde::ser::SerializeMap;
8007        #[allow(unused_imports)]
8008        use std::option::Option::Some;
8009        let mut state = serializer.serialize_map(std::option::Option::None)?;
8010        if self.email.is_some() {
8011            state.serialize_entry("email", &self.email)?;
8012        }
8013        if !self._unknown_fields.is_empty() {
8014            for (key, value) in self._unknown_fields.iter() {
8015                state.serialize_entry(key, &value)?;
8016            }
8017        }
8018        state.end()
8019    }
8020}
8021
8022impl std::fmt::Debug for UserInfo {
8023    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8024        let mut debug_struct = f.debug_struct("UserInfo");
8025        debug_struct.field("email", &self.email);
8026        if !self._unknown_fields.is_empty() {
8027            debug_struct.field("_unknown_fields", &self._unknown_fields);
8028        }
8029        debug_struct.finish()
8030    }
8031}
8032
8033/// Represents a data transfer configuration. A transfer configuration
8034/// contains all metadata needed to perform a data transfer. For example,
8035/// `destination_dataset_id` specifies where data should be stored.
8036/// When a new transfer configuration is created, the specified
8037/// `destination_dataset_id` is created when needed and shared with the
8038/// appropriate data source service account.
8039#[derive(Clone, Default, PartialEq)]
8040#[non_exhaustive]
8041pub struct TransferConfig {
8042    /// Identifier. The resource name of the transfer config.
8043    /// Transfer config names have the form either
8044    /// `projects/{project_id}/locations/{region}/transferConfigs/{config_id}` or
8045    /// `projects/{project_id}/transferConfigs/{config_id}`,
8046    /// where `config_id` is usually a UUID, even though it is not
8047    /// guaranteed or required. The name is ignored when creating a transfer
8048    /// config.
8049    pub name: std::string::String,
8050
8051    /// User specified display name for the data transfer.
8052    pub display_name: std::string::String,
8053
8054    /// Data source ID. This cannot be changed once data transfer is created. The
8055    /// full list of available data source IDs can be returned through an API call:
8056    /// <https://cloud.google.com/bigquery-transfer/docs/reference/datatransfer/rest/v1/projects.locations.dataSources/list>
8057    pub data_source_id: std::string::String,
8058
8059    /// Parameters specific to each data source. For more information see the
8060    /// bq tab in the 'Setting up a data transfer' section for each data source.
8061    /// For example the parameters for Cloud Storage transfers are listed here:
8062    /// <https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq>
8063    pub params: std::option::Option<wkt::Struct>,
8064
8065    /// Data transfer schedule.
8066    /// If the data source does not support a custom schedule, this should be
8067    /// empty. If it is empty, the default value for the data source will be used.
8068    /// The specified times are in UTC.
8069    /// Examples of valid format:
8070    /// `1st,3rd monday of month 15:30`,
8071    /// `every wed,fri of jan,jun 13:15`, and
8072    /// `first sunday of quarter 00:00`.
8073    /// See more explanation about the format here:
8074    /// <https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format>
8075    ///
8076    /// NOTE: The minimum interval time between recurring transfers depends on the
8077    /// data source; refer to the documentation for your data source.
8078    pub schedule: std::string::String,
8079
8080    /// Options customizing the data transfer schedule.
8081    pub schedule_options: std::option::Option<crate::model::ScheduleOptions>,
8082
8083    /// Options customizing different types of data transfer schedule.
8084    /// This field replaces "schedule" and "schedule_options" fields.
8085    /// ScheduleOptionsV2 cannot be used together with ScheduleOptions/Schedule.
8086    pub schedule_options_v2: std::option::Option<crate::model::ScheduleOptionsV2>,
8087
8088    /// The number of days to look back to automatically refresh the data.
8089    /// For example, if `data_refresh_window_days = 10`, then every day
8090    /// BigQuery reingests data for [today-10, today-1], rather than ingesting data
8091    /// for just [today-1].
8092    /// Only valid if the data source supports the feature. Set the value to 0
8093    /// to use the default value.
8094    pub data_refresh_window_days: i32,
8095
8096    /// Is this config disabled. When set to true, no runs will be scheduled for
8097    /// this transfer config.
8098    pub disabled: bool,
8099
8100    /// Output only. Data transfer modification time. Ignored by server on input.
8101    pub update_time: std::option::Option<wkt::Timestamp>,
8102
8103    /// Output only. Next time when data transfer will run.
8104    pub next_run_time: std::option::Option<wkt::Timestamp>,
8105
8106    /// Output only. State of the most recently updated transfer run.
8107    pub state: crate::model::TransferState,
8108
8109    /// Deprecated. Unique ID of the user on whose behalf transfer is done.
8110    pub user_id: i64,
8111
8112    /// Output only. Region in which BigQuery dataset is located.
8113    pub dataset_region: std::string::String,
8114
8115    /// Pub/Sub topic where notifications will be sent after transfer runs
8116    /// associated with this transfer config finish.
8117    ///
8118    /// The format for specifying a pubsub topic is:
8119    /// `projects/{project_id}/topics/{topic_id}`
8120    pub notification_pubsub_topic: std::string::String,
8121
8122    /// Email notifications will be sent according to these preferences
8123    /// to the email address of the user who owns this transfer config.
8124    pub email_preferences: std::option::Option<crate::model::EmailPreferences>,
8125
8126    /// Output only. Information about the user whose credentials are used to
8127    /// transfer data. Populated only for `transferConfigs.get` requests. In case
8128    /// the user information is not available, this field will not be populated.
8129    pub owner_info: std::option::Option<crate::model::UserInfo>,
8130
8131    /// The encryption configuration part. Currently, it is only used for the
8132    /// optional KMS key name. The BigQuery service account of your project must be
8133    /// granted permissions to use the key. Read methods will return the key name
8134    /// applied in effect. Write methods will apply the key if it is present, or
8135    /// otherwise try to apply project default keys if it is absent.
8136    pub encryption_configuration: std::option::Option<crate::model::EncryptionConfiguration>,
8137
8138    /// Output only. Error code with detailed information about reason of the
8139    /// latest config failure.
8140    pub error: std::option::Option<rpc::model::Status>,
8141
8142    /// The desination of the transfer config.
8143    pub destination: std::option::Option<crate::model::transfer_config::Destination>,
8144
8145    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8146}
8147
8148impl TransferConfig {
8149    pub fn new() -> Self {
8150        std::default::Default::default()
8151    }
8152
8153    /// Sets the value of [name][crate::model::TransferConfig::name].
8154    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8155        self.name = v.into();
8156        self
8157    }
8158
8159    /// Sets the value of [display_name][crate::model::TransferConfig::display_name].
8160    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8161        self.display_name = v.into();
8162        self
8163    }
8164
8165    /// Sets the value of [data_source_id][crate::model::TransferConfig::data_source_id].
8166    pub fn set_data_source_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8167        self.data_source_id = v.into();
8168        self
8169    }
8170
8171    /// Sets the value of [params][crate::model::TransferConfig::params].
8172    pub fn set_params<T>(mut self, v: T) -> Self
8173    where
8174        T: std::convert::Into<wkt::Struct>,
8175    {
8176        self.params = std::option::Option::Some(v.into());
8177        self
8178    }
8179
8180    /// Sets or clears the value of [params][crate::model::TransferConfig::params].
8181    pub fn set_or_clear_params<T>(mut self, v: std::option::Option<T>) -> Self
8182    where
8183        T: std::convert::Into<wkt::Struct>,
8184    {
8185        self.params = v.map(|x| x.into());
8186        self
8187    }
8188
8189    /// Sets the value of [schedule][crate::model::TransferConfig::schedule].
8190    pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8191        self.schedule = v.into();
8192        self
8193    }
8194
8195    /// Sets the value of [schedule_options][crate::model::TransferConfig::schedule_options].
8196    pub fn set_schedule_options<T>(mut self, v: T) -> Self
8197    where
8198        T: std::convert::Into<crate::model::ScheduleOptions>,
8199    {
8200        self.schedule_options = std::option::Option::Some(v.into());
8201        self
8202    }
8203
8204    /// Sets or clears the value of [schedule_options][crate::model::TransferConfig::schedule_options].
8205    pub fn set_or_clear_schedule_options<T>(mut self, v: std::option::Option<T>) -> Self
8206    where
8207        T: std::convert::Into<crate::model::ScheduleOptions>,
8208    {
8209        self.schedule_options = v.map(|x| x.into());
8210        self
8211    }
8212
8213    /// Sets the value of [schedule_options_v2][crate::model::TransferConfig::schedule_options_v2].
8214    pub fn set_schedule_options_v2<T>(mut self, v: T) -> Self
8215    where
8216        T: std::convert::Into<crate::model::ScheduleOptionsV2>,
8217    {
8218        self.schedule_options_v2 = std::option::Option::Some(v.into());
8219        self
8220    }
8221
8222    /// Sets or clears the value of [schedule_options_v2][crate::model::TransferConfig::schedule_options_v2].
8223    pub fn set_or_clear_schedule_options_v2<T>(mut self, v: std::option::Option<T>) -> Self
8224    where
8225        T: std::convert::Into<crate::model::ScheduleOptionsV2>,
8226    {
8227        self.schedule_options_v2 = v.map(|x| x.into());
8228        self
8229    }
8230
8231    /// Sets the value of [data_refresh_window_days][crate::model::TransferConfig::data_refresh_window_days].
8232    pub fn set_data_refresh_window_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8233        self.data_refresh_window_days = v.into();
8234        self
8235    }
8236
8237    /// Sets the value of [disabled][crate::model::TransferConfig::disabled].
8238    pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8239        self.disabled = v.into();
8240        self
8241    }
8242
8243    /// Sets the value of [update_time][crate::model::TransferConfig::update_time].
8244    pub fn set_update_time<T>(mut self, v: T) -> Self
8245    where
8246        T: std::convert::Into<wkt::Timestamp>,
8247    {
8248        self.update_time = std::option::Option::Some(v.into());
8249        self
8250    }
8251
8252    /// Sets or clears the value of [update_time][crate::model::TransferConfig::update_time].
8253    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8254    where
8255        T: std::convert::Into<wkt::Timestamp>,
8256    {
8257        self.update_time = v.map(|x| x.into());
8258        self
8259    }
8260
8261    /// Sets the value of [next_run_time][crate::model::TransferConfig::next_run_time].
8262    pub fn set_next_run_time<T>(mut self, v: T) -> Self
8263    where
8264        T: std::convert::Into<wkt::Timestamp>,
8265    {
8266        self.next_run_time = std::option::Option::Some(v.into());
8267        self
8268    }
8269
8270    /// Sets or clears the value of [next_run_time][crate::model::TransferConfig::next_run_time].
8271    pub fn set_or_clear_next_run_time<T>(mut self, v: std::option::Option<T>) -> Self
8272    where
8273        T: std::convert::Into<wkt::Timestamp>,
8274    {
8275        self.next_run_time = v.map(|x| x.into());
8276        self
8277    }
8278
8279    /// Sets the value of [state][crate::model::TransferConfig::state].
8280    pub fn set_state<T: std::convert::Into<crate::model::TransferState>>(mut self, v: T) -> Self {
8281        self.state = v.into();
8282        self
8283    }
8284
8285    /// Sets the value of [user_id][crate::model::TransferConfig::user_id].
8286    pub fn set_user_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
8287        self.user_id = v.into();
8288        self
8289    }
8290
8291    /// Sets the value of [dataset_region][crate::model::TransferConfig::dataset_region].
8292    pub fn set_dataset_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8293        self.dataset_region = v.into();
8294        self
8295    }
8296
8297    /// Sets the value of [notification_pubsub_topic][crate::model::TransferConfig::notification_pubsub_topic].
8298    pub fn set_notification_pubsub_topic<T: std::convert::Into<std::string::String>>(
8299        mut self,
8300        v: T,
8301    ) -> Self {
8302        self.notification_pubsub_topic = v.into();
8303        self
8304    }
8305
8306    /// Sets the value of [email_preferences][crate::model::TransferConfig::email_preferences].
8307    pub fn set_email_preferences<T>(mut self, v: T) -> Self
8308    where
8309        T: std::convert::Into<crate::model::EmailPreferences>,
8310    {
8311        self.email_preferences = std::option::Option::Some(v.into());
8312        self
8313    }
8314
8315    /// Sets or clears the value of [email_preferences][crate::model::TransferConfig::email_preferences].
8316    pub fn set_or_clear_email_preferences<T>(mut self, v: std::option::Option<T>) -> Self
8317    where
8318        T: std::convert::Into<crate::model::EmailPreferences>,
8319    {
8320        self.email_preferences = v.map(|x| x.into());
8321        self
8322    }
8323
8324    /// Sets the value of [owner_info][crate::model::TransferConfig::owner_info].
8325    pub fn set_owner_info<T>(mut self, v: T) -> Self
8326    where
8327        T: std::convert::Into<crate::model::UserInfo>,
8328    {
8329        self.owner_info = std::option::Option::Some(v.into());
8330        self
8331    }
8332
8333    /// Sets or clears the value of [owner_info][crate::model::TransferConfig::owner_info].
8334    pub fn set_or_clear_owner_info<T>(mut self, v: std::option::Option<T>) -> Self
8335    where
8336        T: std::convert::Into<crate::model::UserInfo>,
8337    {
8338        self.owner_info = v.map(|x| x.into());
8339        self
8340    }
8341
8342    /// Sets the value of [encryption_configuration][crate::model::TransferConfig::encryption_configuration].
8343    pub fn set_encryption_configuration<T>(mut self, v: T) -> Self
8344    where
8345        T: std::convert::Into<crate::model::EncryptionConfiguration>,
8346    {
8347        self.encryption_configuration = std::option::Option::Some(v.into());
8348        self
8349    }
8350
8351    /// Sets or clears the value of [encryption_configuration][crate::model::TransferConfig::encryption_configuration].
8352    pub fn set_or_clear_encryption_configuration<T>(mut self, v: std::option::Option<T>) -> Self
8353    where
8354        T: std::convert::Into<crate::model::EncryptionConfiguration>,
8355    {
8356        self.encryption_configuration = v.map(|x| x.into());
8357        self
8358    }
8359
8360    /// Sets the value of [error][crate::model::TransferConfig::error].
8361    pub fn set_error<T>(mut self, v: T) -> Self
8362    where
8363        T: std::convert::Into<rpc::model::Status>,
8364    {
8365        self.error = std::option::Option::Some(v.into());
8366        self
8367    }
8368
8369    /// Sets or clears the value of [error][crate::model::TransferConfig::error].
8370    pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
8371    where
8372        T: std::convert::Into<rpc::model::Status>,
8373    {
8374        self.error = v.map(|x| x.into());
8375        self
8376    }
8377
8378    /// Sets the value of [destination][crate::model::TransferConfig::destination].
8379    ///
8380    /// Note that all the setters affecting `destination` are mutually
8381    /// exclusive.
8382    pub fn set_destination<
8383        T: std::convert::Into<std::option::Option<crate::model::transfer_config::Destination>>,
8384    >(
8385        mut self,
8386        v: T,
8387    ) -> Self {
8388        self.destination = v.into();
8389        self
8390    }
8391
8392    /// The value of [destination][crate::model::TransferConfig::destination]
8393    /// if it holds a `DestinationDatasetId`, `None` if the field is not set or
8394    /// holds a different branch.
8395    pub fn destination_dataset_id(&self) -> std::option::Option<&std::string::String> {
8396        #[allow(unreachable_patterns)]
8397        self.destination.as_ref().and_then(|v| match v {
8398            crate::model::transfer_config::Destination::DestinationDatasetId(v) => {
8399                std::option::Option::Some(v)
8400            }
8401            _ => std::option::Option::None,
8402        })
8403    }
8404
8405    /// Sets the value of [destination][crate::model::TransferConfig::destination]
8406    /// to hold a `DestinationDatasetId`.
8407    ///
8408    /// Note that all the setters affecting `destination` are
8409    /// mutually exclusive.
8410    pub fn set_destination_dataset_id<T: std::convert::Into<std::string::String>>(
8411        mut self,
8412        v: T,
8413    ) -> Self {
8414        self.destination = std::option::Option::Some(
8415            crate::model::transfer_config::Destination::DestinationDatasetId(v.into()),
8416        );
8417        self
8418    }
8419}
8420
8421impl wkt::message::Message for TransferConfig {
8422    fn typename() -> &'static str {
8423        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.TransferConfig"
8424    }
8425}
8426
8427#[doc(hidden)]
8428impl<'de> serde::de::Deserialize<'de> for TransferConfig {
8429    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8430    where
8431        D: serde::Deserializer<'de>,
8432    {
8433        #[allow(non_camel_case_types)]
8434        #[doc(hidden)]
8435        #[derive(PartialEq, Eq, Hash)]
8436        enum __FieldTag {
8437            __name,
8438            __destination_dataset_id,
8439            __display_name,
8440            __data_source_id,
8441            __params,
8442            __schedule,
8443            __schedule_options,
8444            __schedule_options_v2,
8445            __data_refresh_window_days,
8446            __disabled,
8447            __update_time,
8448            __next_run_time,
8449            __state,
8450            __user_id,
8451            __dataset_region,
8452            __notification_pubsub_topic,
8453            __email_preferences,
8454            __owner_info,
8455            __encryption_configuration,
8456            __error,
8457            Unknown(std::string::String),
8458        }
8459        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8460            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8461            where
8462                D: serde::Deserializer<'de>,
8463            {
8464                struct Visitor;
8465                impl<'de> serde::de::Visitor<'de> for Visitor {
8466                    type Value = __FieldTag;
8467                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8468                        formatter.write_str("a field name for TransferConfig")
8469                    }
8470                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8471                    where
8472                        E: serde::de::Error,
8473                    {
8474                        use std::result::Result::Ok;
8475                        use std::string::ToString;
8476                        match value {
8477                            "name" => Ok(__FieldTag::__name),
8478                            "destinationDatasetId" => Ok(__FieldTag::__destination_dataset_id),
8479                            "destination_dataset_id" => Ok(__FieldTag::__destination_dataset_id),
8480                            "displayName" => Ok(__FieldTag::__display_name),
8481                            "display_name" => Ok(__FieldTag::__display_name),
8482                            "dataSourceId" => Ok(__FieldTag::__data_source_id),
8483                            "data_source_id" => Ok(__FieldTag::__data_source_id),
8484                            "params" => Ok(__FieldTag::__params),
8485                            "schedule" => Ok(__FieldTag::__schedule),
8486                            "scheduleOptions" => Ok(__FieldTag::__schedule_options),
8487                            "schedule_options" => Ok(__FieldTag::__schedule_options),
8488                            "scheduleOptionsV2" => Ok(__FieldTag::__schedule_options_v2),
8489                            "schedule_options_v2" => Ok(__FieldTag::__schedule_options_v2),
8490                            "dataRefreshWindowDays" => Ok(__FieldTag::__data_refresh_window_days),
8491                            "data_refresh_window_days" => {
8492                                Ok(__FieldTag::__data_refresh_window_days)
8493                            }
8494                            "disabled" => Ok(__FieldTag::__disabled),
8495                            "updateTime" => Ok(__FieldTag::__update_time),
8496                            "update_time" => Ok(__FieldTag::__update_time),
8497                            "nextRunTime" => Ok(__FieldTag::__next_run_time),
8498                            "next_run_time" => Ok(__FieldTag::__next_run_time),
8499                            "state" => Ok(__FieldTag::__state),
8500                            "userId" => Ok(__FieldTag::__user_id),
8501                            "user_id" => Ok(__FieldTag::__user_id),
8502                            "datasetRegion" => Ok(__FieldTag::__dataset_region),
8503                            "dataset_region" => Ok(__FieldTag::__dataset_region),
8504                            "notificationPubsubTopic" => {
8505                                Ok(__FieldTag::__notification_pubsub_topic)
8506                            }
8507                            "notification_pubsub_topic" => {
8508                                Ok(__FieldTag::__notification_pubsub_topic)
8509                            }
8510                            "emailPreferences" => Ok(__FieldTag::__email_preferences),
8511                            "email_preferences" => Ok(__FieldTag::__email_preferences),
8512                            "ownerInfo" => Ok(__FieldTag::__owner_info),
8513                            "owner_info" => Ok(__FieldTag::__owner_info),
8514                            "encryptionConfiguration" => Ok(__FieldTag::__encryption_configuration),
8515                            "encryption_configuration" => {
8516                                Ok(__FieldTag::__encryption_configuration)
8517                            }
8518                            "error" => Ok(__FieldTag::__error),
8519                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8520                        }
8521                    }
8522                }
8523                deserializer.deserialize_identifier(Visitor)
8524            }
8525        }
8526        struct Visitor;
8527        impl<'de> serde::de::Visitor<'de> for Visitor {
8528            type Value = TransferConfig;
8529            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8530                formatter.write_str("struct TransferConfig")
8531            }
8532            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8533            where
8534                A: serde::de::MapAccess<'de>,
8535            {
8536                #[allow(unused_imports)]
8537                use serde::de::Error;
8538                use std::option::Option::Some;
8539                let mut fields = std::collections::HashSet::new();
8540                let mut result = Self::Value::new();
8541                while let Some(tag) = map.next_key::<__FieldTag>()? {
8542                    #[allow(clippy::match_single_binding)]
8543                    match tag {
8544                        __FieldTag::__name => {
8545                            if !fields.insert(__FieldTag::__name) {
8546                                return std::result::Result::Err(A::Error::duplicate_field(
8547                                    "multiple values for name",
8548                                ));
8549                            }
8550                            result.name = map
8551                                .next_value::<std::option::Option<std::string::String>>()?
8552                                .unwrap_or_default();
8553                        }
8554                        __FieldTag::__destination_dataset_id => {
8555                            if !fields.insert(__FieldTag::__destination_dataset_id) {
8556                                return std::result::Result::Err(A::Error::duplicate_field(
8557                                    "multiple values for destination_dataset_id",
8558                                ));
8559                            }
8560                            if result.destination.is_some() {
8561                                return std::result::Result::Err(A::Error::duplicate_field(
8562                                    "multiple values for `destination`, a oneof with full ID .google.cloud.bigquery.datatransfer.v1.TransferConfig.destination_dataset_id, latest field was destinationDatasetId",
8563                                ));
8564                            }
8565                            result.destination = std::option::Option::Some(
8566                                crate::model::transfer_config::Destination::DestinationDatasetId(
8567                                    map.next_value::<std::option::Option<std::string::String>>()?
8568                                        .unwrap_or_default(),
8569                                ),
8570                            );
8571                        }
8572                        __FieldTag::__display_name => {
8573                            if !fields.insert(__FieldTag::__display_name) {
8574                                return std::result::Result::Err(A::Error::duplicate_field(
8575                                    "multiple values for display_name",
8576                                ));
8577                            }
8578                            result.display_name = map
8579                                .next_value::<std::option::Option<std::string::String>>()?
8580                                .unwrap_or_default();
8581                        }
8582                        __FieldTag::__data_source_id => {
8583                            if !fields.insert(__FieldTag::__data_source_id) {
8584                                return std::result::Result::Err(A::Error::duplicate_field(
8585                                    "multiple values for data_source_id",
8586                                ));
8587                            }
8588                            result.data_source_id = map
8589                                .next_value::<std::option::Option<std::string::String>>()?
8590                                .unwrap_or_default();
8591                        }
8592                        __FieldTag::__params => {
8593                            if !fields.insert(__FieldTag::__params) {
8594                                return std::result::Result::Err(A::Error::duplicate_field(
8595                                    "multiple values for params",
8596                                ));
8597                            }
8598                            result.params = map.next_value::<std::option::Option<wkt::Struct>>()?;
8599                        }
8600                        __FieldTag::__schedule => {
8601                            if !fields.insert(__FieldTag::__schedule) {
8602                                return std::result::Result::Err(A::Error::duplicate_field(
8603                                    "multiple values for schedule",
8604                                ));
8605                            }
8606                            result.schedule = map
8607                                .next_value::<std::option::Option<std::string::String>>()?
8608                                .unwrap_or_default();
8609                        }
8610                        __FieldTag::__schedule_options => {
8611                            if !fields.insert(__FieldTag::__schedule_options) {
8612                                return std::result::Result::Err(A::Error::duplicate_field(
8613                                    "multiple values for schedule_options",
8614                                ));
8615                            }
8616                            result.schedule_options = map
8617                                .next_value::<std::option::Option<crate::model::ScheduleOptions>>(
8618                                )?;
8619                        }
8620                        __FieldTag::__schedule_options_v2 => {
8621                            if !fields.insert(__FieldTag::__schedule_options_v2) {
8622                                return std::result::Result::Err(A::Error::duplicate_field(
8623                                    "multiple values for schedule_options_v2",
8624                                ));
8625                            }
8626                            result.schedule_options_v2 = map
8627                                .next_value::<std::option::Option<crate::model::ScheduleOptionsV2>>(
8628                                )?;
8629                        }
8630                        __FieldTag::__data_refresh_window_days => {
8631                            if !fields.insert(__FieldTag::__data_refresh_window_days) {
8632                                return std::result::Result::Err(A::Error::duplicate_field(
8633                                    "multiple values for data_refresh_window_days",
8634                                ));
8635                            }
8636                            struct __With(std::option::Option<i32>);
8637                            impl<'de> serde::de::Deserialize<'de> for __With {
8638                                fn deserialize<D>(
8639                                    deserializer: D,
8640                                ) -> std::result::Result<Self, D::Error>
8641                                where
8642                                    D: serde::de::Deserializer<'de>,
8643                                {
8644                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
8645                                }
8646                            }
8647                            result.data_refresh_window_days =
8648                                map.next_value::<__With>()?.0.unwrap_or_default();
8649                        }
8650                        __FieldTag::__disabled => {
8651                            if !fields.insert(__FieldTag::__disabled) {
8652                                return std::result::Result::Err(A::Error::duplicate_field(
8653                                    "multiple values for disabled",
8654                                ));
8655                            }
8656                            result.disabled = map
8657                                .next_value::<std::option::Option<bool>>()?
8658                                .unwrap_or_default();
8659                        }
8660                        __FieldTag::__update_time => {
8661                            if !fields.insert(__FieldTag::__update_time) {
8662                                return std::result::Result::Err(A::Error::duplicate_field(
8663                                    "multiple values for update_time",
8664                                ));
8665                            }
8666                            result.update_time =
8667                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
8668                        }
8669                        __FieldTag::__next_run_time => {
8670                            if !fields.insert(__FieldTag::__next_run_time) {
8671                                return std::result::Result::Err(A::Error::duplicate_field(
8672                                    "multiple values for next_run_time",
8673                                ));
8674                            }
8675                            result.next_run_time =
8676                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
8677                        }
8678                        __FieldTag::__state => {
8679                            if !fields.insert(__FieldTag::__state) {
8680                                return std::result::Result::Err(A::Error::duplicate_field(
8681                                    "multiple values for state",
8682                                ));
8683                            }
8684                            result.state = map
8685                                .next_value::<std::option::Option<crate::model::TransferState>>()?
8686                                .unwrap_or_default();
8687                        }
8688                        __FieldTag::__user_id => {
8689                            if !fields.insert(__FieldTag::__user_id) {
8690                                return std::result::Result::Err(A::Error::duplicate_field(
8691                                    "multiple values for user_id",
8692                                ));
8693                            }
8694                            struct __With(std::option::Option<i64>);
8695                            impl<'de> serde::de::Deserialize<'de> for __With {
8696                                fn deserialize<D>(
8697                                    deserializer: D,
8698                                ) -> std::result::Result<Self, D::Error>
8699                                where
8700                                    D: serde::de::Deserializer<'de>,
8701                                {
8702                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
8703                                }
8704                            }
8705                            result.user_id = map.next_value::<__With>()?.0.unwrap_or_default();
8706                        }
8707                        __FieldTag::__dataset_region => {
8708                            if !fields.insert(__FieldTag::__dataset_region) {
8709                                return std::result::Result::Err(A::Error::duplicate_field(
8710                                    "multiple values for dataset_region",
8711                                ));
8712                            }
8713                            result.dataset_region = map
8714                                .next_value::<std::option::Option<std::string::String>>()?
8715                                .unwrap_or_default();
8716                        }
8717                        __FieldTag::__notification_pubsub_topic => {
8718                            if !fields.insert(__FieldTag::__notification_pubsub_topic) {
8719                                return std::result::Result::Err(A::Error::duplicate_field(
8720                                    "multiple values for notification_pubsub_topic",
8721                                ));
8722                            }
8723                            result.notification_pubsub_topic = map
8724                                .next_value::<std::option::Option<std::string::String>>()?
8725                                .unwrap_or_default();
8726                        }
8727                        __FieldTag::__email_preferences => {
8728                            if !fields.insert(__FieldTag::__email_preferences) {
8729                                return std::result::Result::Err(A::Error::duplicate_field(
8730                                    "multiple values for email_preferences",
8731                                ));
8732                            }
8733                            result.email_preferences = map
8734                                .next_value::<std::option::Option<crate::model::EmailPreferences>>(
8735                                )?;
8736                        }
8737                        __FieldTag::__owner_info => {
8738                            if !fields.insert(__FieldTag::__owner_info) {
8739                                return std::result::Result::Err(A::Error::duplicate_field(
8740                                    "multiple values for owner_info",
8741                                ));
8742                            }
8743                            result.owner_info =
8744                                map.next_value::<std::option::Option<crate::model::UserInfo>>()?;
8745                        }
8746                        __FieldTag::__encryption_configuration => {
8747                            if !fields.insert(__FieldTag::__encryption_configuration) {
8748                                return std::result::Result::Err(A::Error::duplicate_field(
8749                                    "multiple values for encryption_configuration",
8750                                ));
8751                            }
8752                            result.encryption_configuration = map.next_value::<std::option::Option<crate::model::EncryptionConfiguration>>()?
8753                                ;
8754                        }
8755                        __FieldTag::__error => {
8756                            if !fields.insert(__FieldTag::__error) {
8757                                return std::result::Result::Err(A::Error::duplicate_field(
8758                                    "multiple values for error",
8759                                ));
8760                            }
8761                            result.error =
8762                                map.next_value::<std::option::Option<rpc::model::Status>>()?;
8763                        }
8764                        __FieldTag::Unknown(key) => {
8765                            let value = map.next_value::<serde_json::Value>()?;
8766                            result._unknown_fields.insert(key, value);
8767                        }
8768                    }
8769                }
8770                std::result::Result::Ok(result)
8771            }
8772        }
8773        deserializer.deserialize_any(Visitor)
8774    }
8775}
8776
8777#[doc(hidden)]
8778impl serde::ser::Serialize for TransferConfig {
8779    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8780    where
8781        S: serde::ser::Serializer,
8782    {
8783        use serde::ser::SerializeMap;
8784        #[allow(unused_imports)]
8785        use std::option::Option::Some;
8786        let mut state = serializer.serialize_map(std::option::Option::None)?;
8787        if !self.name.is_empty() {
8788            state.serialize_entry("name", &self.name)?;
8789        }
8790        if let Some(value) = self.destination_dataset_id() {
8791            state.serialize_entry("destinationDatasetId", value)?;
8792        }
8793        if !self.display_name.is_empty() {
8794            state.serialize_entry("displayName", &self.display_name)?;
8795        }
8796        if !self.data_source_id.is_empty() {
8797            state.serialize_entry("dataSourceId", &self.data_source_id)?;
8798        }
8799        if self.params.is_some() {
8800            state.serialize_entry("params", &self.params)?;
8801        }
8802        if !self.schedule.is_empty() {
8803            state.serialize_entry("schedule", &self.schedule)?;
8804        }
8805        if self.schedule_options.is_some() {
8806            state.serialize_entry("scheduleOptions", &self.schedule_options)?;
8807        }
8808        if self.schedule_options_v2.is_some() {
8809            state.serialize_entry("scheduleOptionsV2", &self.schedule_options_v2)?;
8810        }
8811        if !wkt::internal::is_default(&self.data_refresh_window_days) {
8812            struct __With<'a>(&'a i32);
8813            impl<'a> serde::ser::Serialize for __With<'a> {
8814                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8815                where
8816                    S: serde::ser::Serializer,
8817                {
8818                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
8819                }
8820            }
8821            state.serialize_entry(
8822                "dataRefreshWindowDays",
8823                &__With(&self.data_refresh_window_days),
8824            )?;
8825        }
8826        if !wkt::internal::is_default(&self.disabled) {
8827            state.serialize_entry("disabled", &self.disabled)?;
8828        }
8829        if self.update_time.is_some() {
8830            state.serialize_entry("updateTime", &self.update_time)?;
8831        }
8832        if self.next_run_time.is_some() {
8833            state.serialize_entry("nextRunTime", &self.next_run_time)?;
8834        }
8835        if !wkt::internal::is_default(&self.state) {
8836            state.serialize_entry("state", &self.state)?;
8837        }
8838        if !wkt::internal::is_default(&self.user_id) {
8839            struct __With<'a>(&'a i64);
8840            impl<'a> serde::ser::Serialize for __With<'a> {
8841                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8842                where
8843                    S: serde::ser::Serializer,
8844                {
8845                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
8846                }
8847            }
8848            state.serialize_entry("userId", &__With(&self.user_id))?;
8849        }
8850        if !self.dataset_region.is_empty() {
8851            state.serialize_entry("datasetRegion", &self.dataset_region)?;
8852        }
8853        if !self.notification_pubsub_topic.is_empty() {
8854            state.serialize_entry("notificationPubsubTopic", &self.notification_pubsub_topic)?;
8855        }
8856        if self.email_preferences.is_some() {
8857            state.serialize_entry("emailPreferences", &self.email_preferences)?;
8858        }
8859        if self.owner_info.is_some() {
8860            state.serialize_entry("ownerInfo", &self.owner_info)?;
8861        }
8862        if self.encryption_configuration.is_some() {
8863            state.serialize_entry("encryptionConfiguration", &self.encryption_configuration)?;
8864        }
8865        if self.error.is_some() {
8866            state.serialize_entry("error", &self.error)?;
8867        }
8868        if !self._unknown_fields.is_empty() {
8869            for (key, value) in self._unknown_fields.iter() {
8870                state.serialize_entry(key, &value)?;
8871            }
8872        }
8873        state.end()
8874    }
8875}
8876
8877impl std::fmt::Debug for TransferConfig {
8878    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8879        let mut debug_struct = f.debug_struct("TransferConfig");
8880        debug_struct.field("name", &self.name);
8881        debug_struct.field("display_name", &self.display_name);
8882        debug_struct.field("data_source_id", &self.data_source_id);
8883        debug_struct.field("params", &self.params);
8884        debug_struct.field("schedule", &self.schedule);
8885        debug_struct.field("schedule_options", &self.schedule_options);
8886        debug_struct.field("schedule_options_v2", &self.schedule_options_v2);
8887        debug_struct.field("data_refresh_window_days", &self.data_refresh_window_days);
8888        debug_struct.field("disabled", &self.disabled);
8889        debug_struct.field("update_time", &self.update_time);
8890        debug_struct.field("next_run_time", &self.next_run_time);
8891        debug_struct.field("state", &self.state);
8892        debug_struct.field("user_id", &self.user_id);
8893        debug_struct.field("dataset_region", &self.dataset_region);
8894        debug_struct.field("notification_pubsub_topic", &self.notification_pubsub_topic);
8895        debug_struct.field("email_preferences", &self.email_preferences);
8896        debug_struct.field("owner_info", &self.owner_info);
8897        debug_struct.field("encryption_configuration", &self.encryption_configuration);
8898        debug_struct.field("error", &self.error);
8899        debug_struct.field("destination", &self.destination);
8900        if !self._unknown_fields.is_empty() {
8901            debug_struct.field("_unknown_fields", &self._unknown_fields);
8902        }
8903        debug_struct.finish()
8904    }
8905}
8906
8907/// Defines additional types related to [TransferConfig].
8908pub mod transfer_config {
8909    #[allow(unused_imports)]
8910    use super::*;
8911
8912    /// The desination of the transfer config.
8913    #[derive(Clone, Debug, PartialEq)]
8914    #[non_exhaustive]
8915    pub enum Destination {
8916        /// The BigQuery target dataset id.
8917        DestinationDatasetId(std::string::String),
8918    }
8919}
8920
8921/// Represents the encryption configuration for a transfer.
8922#[derive(Clone, Default, PartialEq)]
8923#[non_exhaustive]
8924pub struct EncryptionConfiguration {
8925    /// The name of the KMS key used for encrypting BigQuery data.
8926    pub kms_key_name: std::option::Option<wkt::StringValue>,
8927
8928    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8929}
8930
8931impl EncryptionConfiguration {
8932    pub fn new() -> Self {
8933        std::default::Default::default()
8934    }
8935
8936    /// Sets the value of [kms_key_name][crate::model::EncryptionConfiguration::kms_key_name].
8937    pub fn set_kms_key_name<T>(mut self, v: T) -> Self
8938    where
8939        T: std::convert::Into<wkt::StringValue>,
8940    {
8941        self.kms_key_name = std::option::Option::Some(v.into());
8942        self
8943    }
8944
8945    /// Sets or clears the value of [kms_key_name][crate::model::EncryptionConfiguration::kms_key_name].
8946    pub fn set_or_clear_kms_key_name<T>(mut self, v: std::option::Option<T>) -> Self
8947    where
8948        T: std::convert::Into<wkt::StringValue>,
8949    {
8950        self.kms_key_name = v.map(|x| x.into());
8951        self
8952    }
8953}
8954
8955impl wkt::message::Message for EncryptionConfiguration {
8956    fn typename() -> &'static str {
8957        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.EncryptionConfiguration"
8958    }
8959}
8960
8961#[doc(hidden)]
8962impl<'de> serde::de::Deserialize<'de> for EncryptionConfiguration {
8963    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8964    where
8965        D: serde::Deserializer<'de>,
8966    {
8967        #[allow(non_camel_case_types)]
8968        #[doc(hidden)]
8969        #[derive(PartialEq, Eq, Hash)]
8970        enum __FieldTag {
8971            __kms_key_name,
8972            Unknown(std::string::String),
8973        }
8974        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8975            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8976            where
8977                D: serde::Deserializer<'de>,
8978            {
8979                struct Visitor;
8980                impl<'de> serde::de::Visitor<'de> for Visitor {
8981                    type Value = __FieldTag;
8982                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8983                        formatter.write_str("a field name for EncryptionConfiguration")
8984                    }
8985                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8986                    where
8987                        E: serde::de::Error,
8988                    {
8989                        use std::result::Result::Ok;
8990                        use std::string::ToString;
8991                        match value {
8992                            "kmsKeyName" => Ok(__FieldTag::__kms_key_name),
8993                            "kms_key_name" => Ok(__FieldTag::__kms_key_name),
8994                            _ => Ok(__FieldTag::Unknown(value.to_string())),
8995                        }
8996                    }
8997                }
8998                deserializer.deserialize_identifier(Visitor)
8999            }
9000        }
9001        struct Visitor;
9002        impl<'de> serde::de::Visitor<'de> for Visitor {
9003            type Value = EncryptionConfiguration;
9004            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9005                formatter.write_str("struct EncryptionConfiguration")
9006            }
9007            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9008            where
9009                A: serde::de::MapAccess<'de>,
9010            {
9011                #[allow(unused_imports)]
9012                use serde::de::Error;
9013                use std::option::Option::Some;
9014                let mut fields = std::collections::HashSet::new();
9015                let mut result = Self::Value::new();
9016                while let Some(tag) = map.next_key::<__FieldTag>()? {
9017                    #[allow(clippy::match_single_binding)]
9018                    match tag {
9019                        __FieldTag::__kms_key_name => {
9020                            if !fields.insert(__FieldTag::__kms_key_name) {
9021                                return std::result::Result::Err(A::Error::duplicate_field(
9022                                    "multiple values for kms_key_name",
9023                                ));
9024                            }
9025                            result.kms_key_name =
9026                                map.next_value::<std::option::Option<wkt::StringValue>>()?;
9027                        }
9028                        __FieldTag::Unknown(key) => {
9029                            let value = map.next_value::<serde_json::Value>()?;
9030                            result._unknown_fields.insert(key, value);
9031                        }
9032                    }
9033                }
9034                std::result::Result::Ok(result)
9035            }
9036        }
9037        deserializer.deserialize_any(Visitor)
9038    }
9039}
9040
9041#[doc(hidden)]
9042impl serde::ser::Serialize for EncryptionConfiguration {
9043    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9044    where
9045        S: serde::ser::Serializer,
9046    {
9047        use serde::ser::SerializeMap;
9048        #[allow(unused_imports)]
9049        use std::option::Option::Some;
9050        let mut state = serializer.serialize_map(std::option::Option::None)?;
9051        if self.kms_key_name.is_some() {
9052            state.serialize_entry("kmsKeyName", &self.kms_key_name)?;
9053        }
9054        if !self._unknown_fields.is_empty() {
9055            for (key, value) in self._unknown_fields.iter() {
9056                state.serialize_entry(key, &value)?;
9057            }
9058        }
9059        state.end()
9060    }
9061}
9062
9063impl std::fmt::Debug for EncryptionConfiguration {
9064    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9065        let mut debug_struct = f.debug_struct("EncryptionConfiguration");
9066        debug_struct.field("kms_key_name", &self.kms_key_name);
9067        if !self._unknown_fields.is_empty() {
9068            debug_struct.field("_unknown_fields", &self._unknown_fields);
9069        }
9070        debug_struct.finish()
9071    }
9072}
9073
9074/// Represents a data transfer run.
9075#[derive(Clone, Default, PartialEq)]
9076#[non_exhaustive]
9077pub struct TransferRun {
9078    /// Identifier. The resource name of the transfer run.
9079    /// Transfer run names have the form
9080    /// `projects/{project_id}/locations/{location}/transferConfigs/{config_id}/runs/{run_id}`.
9081    /// The name is ignored when creating a transfer run.
9082    pub name: std::string::String,
9083
9084    /// Minimum time after which a transfer run can be started.
9085    pub schedule_time: std::option::Option<wkt::Timestamp>,
9086
9087    /// For batch transfer runs, specifies the date and time of the data should be
9088    /// ingested.
9089    pub run_time: std::option::Option<wkt::Timestamp>,
9090
9091    /// Status of the transfer run.
9092    pub error_status: std::option::Option<rpc::model::Status>,
9093
9094    /// Output only. Time when transfer run was started.
9095    /// Parameter ignored by server for input requests.
9096    pub start_time: std::option::Option<wkt::Timestamp>,
9097
9098    /// Output only. Time when transfer run ended.
9099    /// Parameter ignored by server for input requests.
9100    pub end_time: std::option::Option<wkt::Timestamp>,
9101
9102    /// Output only. Last time the data transfer run state was updated.
9103    pub update_time: std::option::Option<wkt::Timestamp>,
9104
9105    /// Output only. Parameters specific to each data source. For more information
9106    /// see the bq tab in the 'Setting up a data transfer' section for each data
9107    /// source. For example the parameters for Cloud Storage transfers are listed
9108    /// here:
9109    /// <https://cloud.google.com/bigquery-transfer/docs/cloud-storage-transfer#bq>
9110    pub params: std::option::Option<wkt::Struct>,
9111
9112    /// Output only. Data source id.
9113    pub data_source_id: std::string::String,
9114
9115    /// Data transfer run state. Ignored for input requests.
9116    pub state: crate::model::TransferState,
9117
9118    /// Deprecated. Unique ID of the user on whose behalf transfer is done.
9119    pub user_id: i64,
9120
9121    /// Output only. Describes the schedule of this transfer run if it was
9122    /// created as part of a regular schedule. For batch transfer runs that are
9123    /// scheduled manually, this is empty.
9124    /// NOTE: the system might choose to delay the schedule depending on the
9125    /// current load, so `schedule_time` doesn't always match this.
9126    pub schedule: std::string::String,
9127
9128    /// Output only. Pub/Sub topic where a notification will be sent after this
9129    /// transfer run finishes.
9130    ///
9131    /// The format for specifying a pubsub topic is:
9132    /// `projects/{project_id}/topics/{topic_id}`
9133    pub notification_pubsub_topic: std::string::String,
9134
9135    /// Output only. Email notifications will be sent according to these
9136    /// preferences to the email address of the user who owns the transfer config
9137    /// this run was derived from.
9138    pub email_preferences: std::option::Option<crate::model::EmailPreferences>,
9139
9140    /// Data transfer destination.
9141    pub destination: std::option::Option<crate::model::transfer_run::Destination>,
9142
9143    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9144}
9145
9146impl TransferRun {
9147    pub fn new() -> Self {
9148        std::default::Default::default()
9149    }
9150
9151    /// Sets the value of [name][crate::model::TransferRun::name].
9152    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9153        self.name = v.into();
9154        self
9155    }
9156
9157    /// Sets the value of [schedule_time][crate::model::TransferRun::schedule_time].
9158    pub fn set_schedule_time<T>(mut self, v: T) -> Self
9159    where
9160        T: std::convert::Into<wkt::Timestamp>,
9161    {
9162        self.schedule_time = std::option::Option::Some(v.into());
9163        self
9164    }
9165
9166    /// Sets or clears the value of [schedule_time][crate::model::TransferRun::schedule_time].
9167    pub fn set_or_clear_schedule_time<T>(mut self, v: std::option::Option<T>) -> Self
9168    where
9169        T: std::convert::Into<wkt::Timestamp>,
9170    {
9171        self.schedule_time = v.map(|x| x.into());
9172        self
9173    }
9174
9175    /// Sets the value of [run_time][crate::model::TransferRun::run_time].
9176    pub fn set_run_time<T>(mut self, v: T) -> Self
9177    where
9178        T: std::convert::Into<wkt::Timestamp>,
9179    {
9180        self.run_time = std::option::Option::Some(v.into());
9181        self
9182    }
9183
9184    /// Sets or clears the value of [run_time][crate::model::TransferRun::run_time].
9185    pub fn set_or_clear_run_time<T>(mut self, v: std::option::Option<T>) -> Self
9186    where
9187        T: std::convert::Into<wkt::Timestamp>,
9188    {
9189        self.run_time = v.map(|x| x.into());
9190        self
9191    }
9192
9193    /// Sets the value of [error_status][crate::model::TransferRun::error_status].
9194    pub fn set_error_status<T>(mut self, v: T) -> Self
9195    where
9196        T: std::convert::Into<rpc::model::Status>,
9197    {
9198        self.error_status = std::option::Option::Some(v.into());
9199        self
9200    }
9201
9202    /// Sets or clears the value of [error_status][crate::model::TransferRun::error_status].
9203    pub fn set_or_clear_error_status<T>(mut self, v: std::option::Option<T>) -> Self
9204    where
9205        T: std::convert::Into<rpc::model::Status>,
9206    {
9207        self.error_status = v.map(|x| x.into());
9208        self
9209    }
9210
9211    /// Sets the value of [start_time][crate::model::TransferRun::start_time].
9212    pub fn set_start_time<T>(mut self, v: T) -> Self
9213    where
9214        T: std::convert::Into<wkt::Timestamp>,
9215    {
9216        self.start_time = std::option::Option::Some(v.into());
9217        self
9218    }
9219
9220    /// Sets or clears the value of [start_time][crate::model::TransferRun::start_time].
9221    pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
9222    where
9223        T: std::convert::Into<wkt::Timestamp>,
9224    {
9225        self.start_time = v.map(|x| x.into());
9226        self
9227    }
9228
9229    /// Sets the value of [end_time][crate::model::TransferRun::end_time].
9230    pub fn set_end_time<T>(mut self, v: T) -> Self
9231    where
9232        T: std::convert::Into<wkt::Timestamp>,
9233    {
9234        self.end_time = std::option::Option::Some(v.into());
9235        self
9236    }
9237
9238    /// Sets or clears the value of [end_time][crate::model::TransferRun::end_time].
9239    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
9240    where
9241        T: std::convert::Into<wkt::Timestamp>,
9242    {
9243        self.end_time = v.map(|x| x.into());
9244        self
9245    }
9246
9247    /// Sets the value of [update_time][crate::model::TransferRun::update_time].
9248    pub fn set_update_time<T>(mut self, v: T) -> Self
9249    where
9250        T: std::convert::Into<wkt::Timestamp>,
9251    {
9252        self.update_time = std::option::Option::Some(v.into());
9253        self
9254    }
9255
9256    /// Sets or clears the value of [update_time][crate::model::TransferRun::update_time].
9257    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
9258    where
9259        T: std::convert::Into<wkt::Timestamp>,
9260    {
9261        self.update_time = v.map(|x| x.into());
9262        self
9263    }
9264
9265    /// Sets the value of [params][crate::model::TransferRun::params].
9266    pub fn set_params<T>(mut self, v: T) -> Self
9267    where
9268        T: std::convert::Into<wkt::Struct>,
9269    {
9270        self.params = std::option::Option::Some(v.into());
9271        self
9272    }
9273
9274    /// Sets or clears the value of [params][crate::model::TransferRun::params].
9275    pub fn set_or_clear_params<T>(mut self, v: std::option::Option<T>) -> Self
9276    where
9277        T: std::convert::Into<wkt::Struct>,
9278    {
9279        self.params = v.map(|x| x.into());
9280        self
9281    }
9282
9283    /// Sets the value of [data_source_id][crate::model::TransferRun::data_source_id].
9284    pub fn set_data_source_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9285        self.data_source_id = v.into();
9286        self
9287    }
9288
9289    /// Sets the value of [state][crate::model::TransferRun::state].
9290    pub fn set_state<T: std::convert::Into<crate::model::TransferState>>(mut self, v: T) -> Self {
9291        self.state = v.into();
9292        self
9293    }
9294
9295    /// Sets the value of [user_id][crate::model::TransferRun::user_id].
9296    pub fn set_user_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
9297        self.user_id = v.into();
9298        self
9299    }
9300
9301    /// Sets the value of [schedule][crate::model::TransferRun::schedule].
9302    pub fn set_schedule<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9303        self.schedule = v.into();
9304        self
9305    }
9306
9307    /// Sets the value of [notification_pubsub_topic][crate::model::TransferRun::notification_pubsub_topic].
9308    pub fn set_notification_pubsub_topic<T: std::convert::Into<std::string::String>>(
9309        mut self,
9310        v: T,
9311    ) -> Self {
9312        self.notification_pubsub_topic = v.into();
9313        self
9314    }
9315
9316    /// Sets the value of [email_preferences][crate::model::TransferRun::email_preferences].
9317    pub fn set_email_preferences<T>(mut self, v: T) -> Self
9318    where
9319        T: std::convert::Into<crate::model::EmailPreferences>,
9320    {
9321        self.email_preferences = std::option::Option::Some(v.into());
9322        self
9323    }
9324
9325    /// Sets or clears the value of [email_preferences][crate::model::TransferRun::email_preferences].
9326    pub fn set_or_clear_email_preferences<T>(mut self, v: std::option::Option<T>) -> Self
9327    where
9328        T: std::convert::Into<crate::model::EmailPreferences>,
9329    {
9330        self.email_preferences = v.map(|x| x.into());
9331        self
9332    }
9333
9334    /// Sets the value of [destination][crate::model::TransferRun::destination].
9335    ///
9336    /// Note that all the setters affecting `destination` are mutually
9337    /// exclusive.
9338    pub fn set_destination<
9339        T: std::convert::Into<std::option::Option<crate::model::transfer_run::Destination>>,
9340    >(
9341        mut self,
9342        v: T,
9343    ) -> Self {
9344        self.destination = v.into();
9345        self
9346    }
9347
9348    /// The value of [destination][crate::model::TransferRun::destination]
9349    /// if it holds a `DestinationDatasetId`, `None` if the field is not set or
9350    /// holds a different branch.
9351    pub fn destination_dataset_id(&self) -> std::option::Option<&std::string::String> {
9352        #[allow(unreachable_patterns)]
9353        self.destination.as_ref().and_then(|v| match v {
9354            crate::model::transfer_run::Destination::DestinationDatasetId(v) => {
9355                std::option::Option::Some(v)
9356            }
9357            _ => std::option::Option::None,
9358        })
9359    }
9360
9361    /// Sets the value of [destination][crate::model::TransferRun::destination]
9362    /// to hold a `DestinationDatasetId`.
9363    ///
9364    /// Note that all the setters affecting `destination` are
9365    /// mutually exclusive.
9366    pub fn set_destination_dataset_id<T: std::convert::Into<std::string::String>>(
9367        mut self,
9368        v: T,
9369    ) -> Self {
9370        self.destination = std::option::Option::Some(
9371            crate::model::transfer_run::Destination::DestinationDatasetId(v.into()),
9372        );
9373        self
9374    }
9375}
9376
9377impl wkt::message::Message for TransferRun {
9378    fn typename() -> &'static str {
9379        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.TransferRun"
9380    }
9381}
9382
9383#[doc(hidden)]
9384impl<'de> serde::de::Deserialize<'de> for TransferRun {
9385    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9386    where
9387        D: serde::Deserializer<'de>,
9388    {
9389        #[allow(non_camel_case_types)]
9390        #[doc(hidden)]
9391        #[derive(PartialEq, Eq, Hash)]
9392        enum __FieldTag {
9393            __name,
9394            __schedule_time,
9395            __run_time,
9396            __error_status,
9397            __start_time,
9398            __end_time,
9399            __update_time,
9400            __params,
9401            __destination_dataset_id,
9402            __data_source_id,
9403            __state,
9404            __user_id,
9405            __schedule,
9406            __notification_pubsub_topic,
9407            __email_preferences,
9408            Unknown(std::string::String),
9409        }
9410        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9411            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9412            where
9413                D: serde::Deserializer<'de>,
9414            {
9415                struct Visitor;
9416                impl<'de> serde::de::Visitor<'de> for Visitor {
9417                    type Value = __FieldTag;
9418                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9419                        formatter.write_str("a field name for TransferRun")
9420                    }
9421                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9422                    where
9423                        E: serde::de::Error,
9424                    {
9425                        use std::result::Result::Ok;
9426                        use std::string::ToString;
9427                        match value {
9428                            "name" => Ok(__FieldTag::__name),
9429                            "scheduleTime" => Ok(__FieldTag::__schedule_time),
9430                            "schedule_time" => Ok(__FieldTag::__schedule_time),
9431                            "runTime" => Ok(__FieldTag::__run_time),
9432                            "run_time" => Ok(__FieldTag::__run_time),
9433                            "errorStatus" => Ok(__FieldTag::__error_status),
9434                            "error_status" => Ok(__FieldTag::__error_status),
9435                            "startTime" => Ok(__FieldTag::__start_time),
9436                            "start_time" => Ok(__FieldTag::__start_time),
9437                            "endTime" => Ok(__FieldTag::__end_time),
9438                            "end_time" => Ok(__FieldTag::__end_time),
9439                            "updateTime" => Ok(__FieldTag::__update_time),
9440                            "update_time" => Ok(__FieldTag::__update_time),
9441                            "params" => Ok(__FieldTag::__params),
9442                            "destinationDatasetId" => Ok(__FieldTag::__destination_dataset_id),
9443                            "destination_dataset_id" => Ok(__FieldTag::__destination_dataset_id),
9444                            "dataSourceId" => Ok(__FieldTag::__data_source_id),
9445                            "data_source_id" => Ok(__FieldTag::__data_source_id),
9446                            "state" => Ok(__FieldTag::__state),
9447                            "userId" => Ok(__FieldTag::__user_id),
9448                            "user_id" => Ok(__FieldTag::__user_id),
9449                            "schedule" => Ok(__FieldTag::__schedule),
9450                            "notificationPubsubTopic" => {
9451                                Ok(__FieldTag::__notification_pubsub_topic)
9452                            }
9453                            "notification_pubsub_topic" => {
9454                                Ok(__FieldTag::__notification_pubsub_topic)
9455                            }
9456                            "emailPreferences" => Ok(__FieldTag::__email_preferences),
9457                            "email_preferences" => Ok(__FieldTag::__email_preferences),
9458                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9459                        }
9460                    }
9461                }
9462                deserializer.deserialize_identifier(Visitor)
9463            }
9464        }
9465        struct Visitor;
9466        impl<'de> serde::de::Visitor<'de> for Visitor {
9467            type Value = TransferRun;
9468            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9469                formatter.write_str("struct TransferRun")
9470            }
9471            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9472            where
9473                A: serde::de::MapAccess<'de>,
9474            {
9475                #[allow(unused_imports)]
9476                use serde::de::Error;
9477                use std::option::Option::Some;
9478                let mut fields = std::collections::HashSet::new();
9479                let mut result = Self::Value::new();
9480                while let Some(tag) = map.next_key::<__FieldTag>()? {
9481                    #[allow(clippy::match_single_binding)]
9482                    match tag {
9483                        __FieldTag::__name => {
9484                            if !fields.insert(__FieldTag::__name) {
9485                                return std::result::Result::Err(A::Error::duplicate_field(
9486                                    "multiple values for name",
9487                                ));
9488                            }
9489                            result.name = map
9490                                .next_value::<std::option::Option<std::string::String>>()?
9491                                .unwrap_or_default();
9492                        }
9493                        __FieldTag::__schedule_time => {
9494                            if !fields.insert(__FieldTag::__schedule_time) {
9495                                return std::result::Result::Err(A::Error::duplicate_field(
9496                                    "multiple values for schedule_time",
9497                                ));
9498                            }
9499                            result.schedule_time =
9500                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
9501                        }
9502                        __FieldTag::__run_time => {
9503                            if !fields.insert(__FieldTag::__run_time) {
9504                                return std::result::Result::Err(A::Error::duplicate_field(
9505                                    "multiple values for run_time",
9506                                ));
9507                            }
9508                            result.run_time =
9509                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
9510                        }
9511                        __FieldTag::__error_status => {
9512                            if !fields.insert(__FieldTag::__error_status) {
9513                                return std::result::Result::Err(A::Error::duplicate_field(
9514                                    "multiple values for error_status",
9515                                ));
9516                            }
9517                            result.error_status =
9518                                map.next_value::<std::option::Option<rpc::model::Status>>()?;
9519                        }
9520                        __FieldTag::__start_time => {
9521                            if !fields.insert(__FieldTag::__start_time) {
9522                                return std::result::Result::Err(A::Error::duplicate_field(
9523                                    "multiple values for start_time",
9524                                ));
9525                            }
9526                            result.start_time =
9527                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
9528                        }
9529                        __FieldTag::__end_time => {
9530                            if !fields.insert(__FieldTag::__end_time) {
9531                                return std::result::Result::Err(A::Error::duplicate_field(
9532                                    "multiple values for end_time",
9533                                ));
9534                            }
9535                            result.end_time =
9536                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
9537                        }
9538                        __FieldTag::__update_time => {
9539                            if !fields.insert(__FieldTag::__update_time) {
9540                                return std::result::Result::Err(A::Error::duplicate_field(
9541                                    "multiple values for update_time",
9542                                ));
9543                            }
9544                            result.update_time =
9545                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
9546                        }
9547                        __FieldTag::__params => {
9548                            if !fields.insert(__FieldTag::__params) {
9549                                return std::result::Result::Err(A::Error::duplicate_field(
9550                                    "multiple values for params",
9551                                ));
9552                            }
9553                            result.params = map.next_value::<std::option::Option<wkt::Struct>>()?;
9554                        }
9555                        __FieldTag::__destination_dataset_id => {
9556                            if !fields.insert(__FieldTag::__destination_dataset_id) {
9557                                return std::result::Result::Err(A::Error::duplicate_field(
9558                                    "multiple values for destination_dataset_id",
9559                                ));
9560                            }
9561                            if result.destination.is_some() {
9562                                return std::result::Result::Err(A::Error::duplicate_field(
9563                                    "multiple values for `destination`, a oneof with full ID .google.cloud.bigquery.datatransfer.v1.TransferRun.destination_dataset_id, latest field was destinationDatasetId",
9564                                ));
9565                            }
9566                            result.destination = std::option::Option::Some(
9567                                crate::model::transfer_run::Destination::DestinationDatasetId(
9568                                    map.next_value::<std::option::Option<std::string::String>>()?
9569                                        .unwrap_or_default(),
9570                                ),
9571                            );
9572                        }
9573                        __FieldTag::__data_source_id => {
9574                            if !fields.insert(__FieldTag::__data_source_id) {
9575                                return std::result::Result::Err(A::Error::duplicate_field(
9576                                    "multiple values for data_source_id",
9577                                ));
9578                            }
9579                            result.data_source_id = map
9580                                .next_value::<std::option::Option<std::string::String>>()?
9581                                .unwrap_or_default();
9582                        }
9583                        __FieldTag::__state => {
9584                            if !fields.insert(__FieldTag::__state) {
9585                                return std::result::Result::Err(A::Error::duplicate_field(
9586                                    "multiple values for state",
9587                                ));
9588                            }
9589                            result.state = map
9590                                .next_value::<std::option::Option<crate::model::TransferState>>()?
9591                                .unwrap_or_default();
9592                        }
9593                        __FieldTag::__user_id => {
9594                            if !fields.insert(__FieldTag::__user_id) {
9595                                return std::result::Result::Err(A::Error::duplicate_field(
9596                                    "multiple values for user_id",
9597                                ));
9598                            }
9599                            struct __With(std::option::Option<i64>);
9600                            impl<'de> serde::de::Deserialize<'de> for __With {
9601                                fn deserialize<D>(
9602                                    deserializer: D,
9603                                ) -> std::result::Result<Self, D::Error>
9604                                where
9605                                    D: serde::de::Deserializer<'de>,
9606                                {
9607                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
9608                                }
9609                            }
9610                            result.user_id = map.next_value::<__With>()?.0.unwrap_or_default();
9611                        }
9612                        __FieldTag::__schedule => {
9613                            if !fields.insert(__FieldTag::__schedule) {
9614                                return std::result::Result::Err(A::Error::duplicate_field(
9615                                    "multiple values for schedule",
9616                                ));
9617                            }
9618                            result.schedule = map
9619                                .next_value::<std::option::Option<std::string::String>>()?
9620                                .unwrap_or_default();
9621                        }
9622                        __FieldTag::__notification_pubsub_topic => {
9623                            if !fields.insert(__FieldTag::__notification_pubsub_topic) {
9624                                return std::result::Result::Err(A::Error::duplicate_field(
9625                                    "multiple values for notification_pubsub_topic",
9626                                ));
9627                            }
9628                            result.notification_pubsub_topic = map
9629                                .next_value::<std::option::Option<std::string::String>>()?
9630                                .unwrap_or_default();
9631                        }
9632                        __FieldTag::__email_preferences => {
9633                            if !fields.insert(__FieldTag::__email_preferences) {
9634                                return std::result::Result::Err(A::Error::duplicate_field(
9635                                    "multiple values for email_preferences",
9636                                ));
9637                            }
9638                            result.email_preferences = map
9639                                .next_value::<std::option::Option<crate::model::EmailPreferences>>(
9640                                )?;
9641                        }
9642                        __FieldTag::Unknown(key) => {
9643                            let value = map.next_value::<serde_json::Value>()?;
9644                            result._unknown_fields.insert(key, value);
9645                        }
9646                    }
9647                }
9648                std::result::Result::Ok(result)
9649            }
9650        }
9651        deserializer.deserialize_any(Visitor)
9652    }
9653}
9654
9655#[doc(hidden)]
9656impl serde::ser::Serialize for TransferRun {
9657    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9658    where
9659        S: serde::ser::Serializer,
9660    {
9661        use serde::ser::SerializeMap;
9662        #[allow(unused_imports)]
9663        use std::option::Option::Some;
9664        let mut state = serializer.serialize_map(std::option::Option::None)?;
9665        if !self.name.is_empty() {
9666            state.serialize_entry("name", &self.name)?;
9667        }
9668        if self.schedule_time.is_some() {
9669            state.serialize_entry("scheduleTime", &self.schedule_time)?;
9670        }
9671        if self.run_time.is_some() {
9672            state.serialize_entry("runTime", &self.run_time)?;
9673        }
9674        if self.error_status.is_some() {
9675            state.serialize_entry("errorStatus", &self.error_status)?;
9676        }
9677        if self.start_time.is_some() {
9678            state.serialize_entry("startTime", &self.start_time)?;
9679        }
9680        if self.end_time.is_some() {
9681            state.serialize_entry("endTime", &self.end_time)?;
9682        }
9683        if self.update_time.is_some() {
9684            state.serialize_entry("updateTime", &self.update_time)?;
9685        }
9686        if self.params.is_some() {
9687            state.serialize_entry("params", &self.params)?;
9688        }
9689        if let Some(value) = self.destination_dataset_id() {
9690            state.serialize_entry("destinationDatasetId", value)?;
9691        }
9692        if !self.data_source_id.is_empty() {
9693            state.serialize_entry("dataSourceId", &self.data_source_id)?;
9694        }
9695        if !wkt::internal::is_default(&self.state) {
9696            state.serialize_entry("state", &self.state)?;
9697        }
9698        if !wkt::internal::is_default(&self.user_id) {
9699            struct __With<'a>(&'a i64);
9700            impl<'a> serde::ser::Serialize for __With<'a> {
9701                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9702                where
9703                    S: serde::ser::Serializer,
9704                {
9705                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
9706                }
9707            }
9708            state.serialize_entry("userId", &__With(&self.user_id))?;
9709        }
9710        if !self.schedule.is_empty() {
9711            state.serialize_entry("schedule", &self.schedule)?;
9712        }
9713        if !self.notification_pubsub_topic.is_empty() {
9714            state.serialize_entry("notificationPubsubTopic", &self.notification_pubsub_topic)?;
9715        }
9716        if self.email_preferences.is_some() {
9717            state.serialize_entry("emailPreferences", &self.email_preferences)?;
9718        }
9719        if !self._unknown_fields.is_empty() {
9720            for (key, value) in self._unknown_fields.iter() {
9721                state.serialize_entry(key, &value)?;
9722            }
9723        }
9724        state.end()
9725    }
9726}
9727
9728impl std::fmt::Debug for TransferRun {
9729    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9730        let mut debug_struct = f.debug_struct("TransferRun");
9731        debug_struct.field("name", &self.name);
9732        debug_struct.field("schedule_time", &self.schedule_time);
9733        debug_struct.field("run_time", &self.run_time);
9734        debug_struct.field("error_status", &self.error_status);
9735        debug_struct.field("start_time", &self.start_time);
9736        debug_struct.field("end_time", &self.end_time);
9737        debug_struct.field("update_time", &self.update_time);
9738        debug_struct.field("params", &self.params);
9739        debug_struct.field("data_source_id", &self.data_source_id);
9740        debug_struct.field("state", &self.state);
9741        debug_struct.field("user_id", &self.user_id);
9742        debug_struct.field("schedule", &self.schedule);
9743        debug_struct.field("notification_pubsub_topic", &self.notification_pubsub_topic);
9744        debug_struct.field("email_preferences", &self.email_preferences);
9745        debug_struct.field("destination", &self.destination);
9746        if !self._unknown_fields.is_empty() {
9747            debug_struct.field("_unknown_fields", &self._unknown_fields);
9748        }
9749        debug_struct.finish()
9750    }
9751}
9752
9753/// Defines additional types related to [TransferRun].
9754pub mod transfer_run {
9755    #[allow(unused_imports)]
9756    use super::*;
9757
9758    /// Data transfer destination.
9759    #[derive(Clone, Debug, PartialEq)]
9760    #[non_exhaustive]
9761    pub enum Destination {
9762        /// Output only. The BigQuery target dataset id.
9763        DestinationDatasetId(std::string::String),
9764    }
9765}
9766
9767/// Represents a user facing message for a particular data transfer run.
9768#[derive(Clone, Default, PartialEq)]
9769#[non_exhaustive]
9770pub struct TransferMessage {
9771    /// Time when message was logged.
9772    pub message_time: std::option::Option<wkt::Timestamp>,
9773
9774    /// Message severity.
9775    pub severity: crate::model::transfer_message::MessageSeverity,
9776
9777    /// Message text.
9778    pub message_text: std::string::String,
9779
9780    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9781}
9782
9783impl TransferMessage {
9784    pub fn new() -> Self {
9785        std::default::Default::default()
9786    }
9787
9788    /// Sets the value of [message_time][crate::model::TransferMessage::message_time].
9789    pub fn set_message_time<T>(mut self, v: T) -> Self
9790    where
9791        T: std::convert::Into<wkt::Timestamp>,
9792    {
9793        self.message_time = std::option::Option::Some(v.into());
9794        self
9795    }
9796
9797    /// Sets or clears the value of [message_time][crate::model::TransferMessage::message_time].
9798    pub fn set_or_clear_message_time<T>(mut self, v: std::option::Option<T>) -> Self
9799    where
9800        T: std::convert::Into<wkt::Timestamp>,
9801    {
9802        self.message_time = v.map(|x| x.into());
9803        self
9804    }
9805
9806    /// Sets the value of [severity][crate::model::TransferMessage::severity].
9807    pub fn set_severity<T: std::convert::Into<crate::model::transfer_message::MessageSeverity>>(
9808        mut self,
9809        v: T,
9810    ) -> Self {
9811        self.severity = v.into();
9812        self
9813    }
9814
9815    /// Sets the value of [message_text][crate::model::TransferMessage::message_text].
9816    pub fn set_message_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9817        self.message_text = v.into();
9818        self
9819    }
9820}
9821
9822impl wkt::message::Message for TransferMessage {
9823    fn typename() -> &'static str {
9824        "type.googleapis.com/google.cloud.bigquery.datatransfer.v1.TransferMessage"
9825    }
9826}
9827
9828#[doc(hidden)]
9829impl<'de> serde::de::Deserialize<'de> for TransferMessage {
9830    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9831    where
9832        D: serde::Deserializer<'de>,
9833    {
9834        #[allow(non_camel_case_types)]
9835        #[doc(hidden)]
9836        #[derive(PartialEq, Eq, Hash)]
9837        enum __FieldTag {
9838            __message_time,
9839            __severity,
9840            __message_text,
9841            Unknown(std::string::String),
9842        }
9843        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9844            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9845            where
9846                D: serde::Deserializer<'de>,
9847            {
9848                struct Visitor;
9849                impl<'de> serde::de::Visitor<'de> for Visitor {
9850                    type Value = __FieldTag;
9851                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9852                        formatter.write_str("a field name for TransferMessage")
9853                    }
9854                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9855                    where
9856                        E: serde::de::Error,
9857                    {
9858                        use std::result::Result::Ok;
9859                        use std::string::ToString;
9860                        match value {
9861                            "messageTime" => Ok(__FieldTag::__message_time),
9862                            "message_time" => Ok(__FieldTag::__message_time),
9863                            "severity" => Ok(__FieldTag::__severity),
9864                            "messageText" => Ok(__FieldTag::__message_text),
9865                            "message_text" => Ok(__FieldTag::__message_text),
9866                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9867                        }
9868                    }
9869                }
9870                deserializer.deserialize_identifier(Visitor)
9871            }
9872        }
9873        struct Visitor;
9874        impl<'de> serde::de::Visitor<'de> for Visitor {
9875            type Value = TransferMessage;
9876            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9877                formatter.write_str("struct TransferMessage")
9878            }
9879            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9880            where
9881                A: serde::de::MapAccess<'de>,
9882            {
9883                #[allow(unused_imports)]
9884                use serde::de::Error;
9885                use std::option::Option::Some;
9886                let mut fields = std::collections::HashSet::new();
9887                let mut result = Self::Value::new();
9888                while let Some(tag) = map.next_key::<__FieldTag>()? {
9889                    #[allow(clippy::match_single_binding)]
9890                    match tag {
9891                        __FieldTag::__message_time => {
9892                            if !fields.insert(__FieldTag::__message_time) {
9893                                return std::result::Result::Err(A::Error::duplicate_field(
9894                                    "multiple values for message_time",
9895                                ));
9896                            }
9897                            result.message_time =
9898                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
9899                        }
9900                        __FieldTag::__severity => {
9901                            if !fields.insert(__FieldTag::__severity) {
9902                                return std::result::Result::Err(A::Error::duplicate_field(
9903                                    "multiple values for severity",
9904                                ));
9905                            }
9906                            result.severity = map
9907                                .next_value::<std::option::Option<
9908                                    crate::model::transfer_message::MessageSeverity,
9909                                >>()?
9910                                .unwrap_or_default();
9911                        }
9912                        __FieldTag::__message_text => {
9913                            if !fields.insert(__FieldTag::__message_text) {
9914                                return std::result::Result::Err(A::Error::duplicate_field(
9915                                    "multiple values for message_text",
9916                                ));
9917                            }
9918                            result.message_text = map
9919                                .next_value::<std::option::Option<std::string::String>>()?
9920                                .unwrap_or_default();
9921                        }
9922                        __FieldTag::Unknown(key) => {
9923                            let value = map.next_value::<serde_json::Value>()?;
9924                            result._unknown_fields.insert(key, value);
9925                        }
9926                    }
9927                }
9928                std::result::Result::Ok(result)
9929            }
9930        }
9931        deserializer.deserialize_any(Visitor)
9932    }
9933}
9934
9935#[doc(hidden)]
9936impl serde::ser::Serialize for TransferMessage {
9937    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9938    where
9939        S: serde::ser::Serializer,
9940    {
9941        use serde::ser::SerializeMap;
9942        #[allow(unused_imports)]
9943        use std::option::Option::Some;
9944        let mut state = serializer.serialize_map(std::option::Option::None)?;
9945        if self.message_time.is_some() {
9946            state.serialize_entry("messageTime", &self.message_time)?;
9947        }
9948        if !wkt::internal::is_default(&self.severity) {
9949            state.serialize_entry("severity", &self.severity)?;
9950        }
9951        if !self.message_text.is_empty() {
9952            state.serialize_entry("messageText", &self.message_text)?;
9953        }
9954        if !self._unknown_fields.is_empty() {
9955            for (key, value) in self._unknown_fields.iter() {
9956                state.serialize_entry(key, &value)?;
9957            }
9958        }
9959        state.end()
9960    }
9961}
9962
9963impl std::fmt::Debug for TransferMessage {
9964    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9965        let mut debug_struct = f.debug_struct("TransferMessage");
9966        debug_struct.field("message_time", &self.message_time);
9967        debug_struct.field("severity", &self.severity);
9968        debug_struct.field("message_text", &self.message_text);
9969        if !self._unknown_fields.is_empty() {
9970            debug_struct.field("_unknown_fields", &self._unknown_fields);
9971        }
9972        debug_struct.finish()
9973    }
9974}
9975
9976/// Defines additional types related to [TransferMessage].
9977pub mod transfer_message {
9978    #[allow(unused_imports)]
9979    use super::*;
9980
9981    /// Represents data transfer user facing message severity.
9982    ///
9983    /// # Working with unknown values
9984    ///
9985    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9986    /// additional enum variants at any time. Adding new variants is not considered
9987    /// a breaking change. Applications should write their code in anticipation of:
9988    ///
9989    /// - New values appearing in future releases of the client library, **and**
9990    /// - New values received dynamically, without application changes.
9991    ///
9992    /// Please consult the [Working with enums] section in the user guide for some
9993    /// guidelines.
9994    ///
9995    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9996    #[derive(Clone, Debug, PartialEq)]
9997    #[non_exhaustive]
9998    pub enum MessageSeverity {
9999        /// No severity specified.
10000        Unspecified,
10001        /// Informational message.
10002        Info,
10003        /// Warning message.
10004        Warning,
10005        /// Error message.
10006        Error,
10007        /// If set, the enum was initialized with an unknown value.
10008        ///
10009        /// Applications can examine the value using [MessageSeverity::value] or
10010        /// [MessageSeverity::name].
10011        UnknownValue(message_severity::UnknownValue),
10012    }
10013
10014    #[doc(hidden)]
10015    pub mod message_severity {
10016        #[allow(unused_imports)]
10017        use super::*;
10018        #[derive(Clone, Debug, PartialEq)]
10019        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10020    }
10021
10022    impl MessageSeverity {
10023        /// Gets the enum value.
10024        ///
10025        /// Returns `None` if the enum contains an unknown value deserialized from
10026        /// the string representation of enums.
10027        pub fn value(&self) -> std::option::Option<i32> {
10028            match self {
10029                Self::Unspecified => std::option::Option::Some(0),
10030                Self::Info => std::option::Option::Some(1),
10031                Self::Warning => std::option::Option::Some(2),
10032                Self::Error => std::option::Option::Some(3),
10033                Self::UnknownValue(u) => u.0.value(),
10034            }
10035        }
10036
10037        /// Gets the enum value as a string.
10038        ///
10039        /// Returns `None` if the enum contains an unknown value deserialized from
10040        /// the integer representation of enums.
10041        pub fn name(&self) -> std::option::Option<&str> {
10042            match self {
10043                Self::Unspecified => std::option::Option::Some("MESSAGE_SEVERITY_UNSPECIFIED"),
10044                Self::Info => std::option::Option::Some("INFO"),
10045                Self::Warning => std::option::Option::Some("WARNING"),
10046                Self::Error => std::option::Option::Some("ERROR"),
10047                Self::UnknownValue(u) => u.0.name(),
10048            }
10049        }
10050    }
10051
10052    impl std::default::Default for MessageSeverity {
10053        fn default() -> Self {
10054            use std::convert::From;
10055            Self::from(0)
10056        }
10057    }
10058
10059    impl std::fmt::Display for MessageSeverity {
10060        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10061            wkt::internal::display_enum(f, self.name(), self.value())
10062        }
10063    }
10064
10065    impl std::convert::From<i32> for MessageSeverity {
10066        fn from(value: i32) -> Self {
10067            match value {
10068                0 => Self::Unspecified,
10069                1 => Self::Info,
10070                2 => Self::Warning,
10071                3 => Self::Error,
10072                _ => Self::UnknownValue(message_severity::UnknownValue(
10073                    wkt::internal::UnknownEnumValue::Integer(value),
10074                )),
10075            }
10076        }
10077    }
10078
10079    impl std::convert::From<&str> for MessageSeverity {
10080        fn from(value: &str) -> Self {
10081            use std::string::ToString;
10082            match value {
10083                "MESSAGE_SEVERITY_UNSPECIFIED" => Self::Unspecified,
10084                "INFO" => Self::Info,
10085                "WARNING" => Self::Warning,
10086                "ERROR" => Self::Error,
10087                _ => Self::UnknownValue(message_severity::UnknownValue(
10088                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10089                )),
10090            }
10091        }
10092    }
10093
10094    impl serde::ser::Serialize for MessageSeverity {
10095        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10096        where
10097            S: serde::Serializer,
10098        {
10099            match self {
10100                Self::Unspecified => serializer.serialize_i32(0),
10101                Self::Info => serializer.serialize_i32(1),
10102                Self::Warning => serializer.serialize_i32(2),
10103                Self::Error => serializer.serialize_i32(3),
10104                Self::UnknownValue(u) => u.0.serialize(serializer),
10105            }
10106        }
10107    }
10108
10109    impl<'de> serde::de::Deserialize<'de> for MessageSeverity {
10110        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10111        where
10112            D: serde::Deserializer<'de>,
10113        {
10114            deserializer.deserialize_any(wkt::internal::EnumVisitor::<MessageSeverity>::new(
10115                ".google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity",
10116            ))
10117        }
10118    }
10119}
10120
10121/// DEPRECATED. Represents data transfer type.
10122///
10123/// # Working with unknown values
10124///
10125/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10126/// additional enum variants at any time. Adding new variants is not considered
10127/// a breaking change. Applications should write their code in anticipation of:
10128///
10129/// - New values appearing in future releases of the client library, **and**
10130/// - New values received dynamically, without application changes.
10131///
10132/// Please consult the [Working with enums] section in the user guide for some
10133/// guidelines.
10134///
10135/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10136#[derive(Clone, Debug, PartialEq)]
10137#[non_exhaustive]
10138#[deprecated]
10139pub enum TransferType {
10140    /// Invalid or Unknown transfer type placeholder.
10141    Unspecified,
10142    /// Batch data transfer.
10143    Batch,
10144    /// Streaming data transfer. Streaming data source currently doesn't
10145    /// support multiple transfer configs per project.
10146    Streaming,
10147    /// If set, the enum was initialized with an unknown value.
10148    ///
10149    /// Applications can examine the value using [TransferType::value] or
10150    /// [TransferType::name].
10151    UnknownValue(transfer_type::UnknownValue),
10152}
10153
10154#[doc(hidden)]
10155pub mod transfer_type {
10156    #[allow(unused_imports)]
10157    use super::*;
10158    #[derive(Clone, Debug, PartialEq)]
10159    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10160}
10161
10162impl TransferType {
10163    /// Gets the enum value.
10164    ///
10165    /// Returns `None` if the enum contains an unknown value deserialized from
10166    /// the string representation of enums.
10167    pub fn value(&self) -> std::option::Option<i32> {
10168        match self {
10169            Self::Unspecified => std::option::Option::Some(0),
10170            Self::Batch => std::option::Option::Some(1),
10171            Self::Streaming => std::option::Option::Some(2),
10172            Self::UnknownValue(u) => u.0.value(),
10173        }
10174    }
10175
10176    /// Gets the enum value as a string.
10177    ///
10178    /// Returns `None` if the enum contains an unknown value deserialized from
10179    /// the integer representation of enums.
10180    pub fn name(&self) -> std::option::Option<&str> {
10181        match self {
10182            Self::Unspecified => std::option::Option::Some("TRANSFER_TYPE_UNSPECIFIED"),
10183            Self::Batch => std::option::Option::Some("BATCH"),
10184            Self::Streaming => std::option::Option::Some("STREAMING"),
10185            Self::UnknownValue(u) => u.0.name(),
10186        }
10187    }
10188}
10189
10190impl std::default::Default for TransferType {
10191    fn default() -> Self {
10192        use std::convert::From;
10193        Self::from(0)
10194    }
10195}
10196
10197impl std::fmt::Display for TransferType {
10198    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10199        wkt::internal::display_enum(f, self.name(), self.value())
10200    }
10201}
10202
10203impl std::convert::From<i32> for TransferType {
10204    fn from(value: i32) -> Self {
10205        match value {
10206            0 => Self::Unspecified,
10207            1 => Self::Batch,
10208            2 => Self::Streaming,
10209            _ => Self::UnknownValue(transfer_type::UnknownValue(
10210                wkt::internal::UnknownEnumValue::Integer(value),
10211            )),
10212        }
10213    }
10214}
10215
10216impl std::convert::From<&str> for TransferType {
10217    fn from(value: &str) -> Self {
10218        use std::string::ToString;
10219        match value {
10220            "TRANSFER_TYPE_UNSPECIFIED" => Self::Unspecified,
10221            "BATCH" => Self::Batch,
10222            "STREAMING" => Self::Streaming,
10223            _ => Self::UnknownValue(transfer_type::UnknownValue(
10224                wkt::internal::UnknownEnumValue::String(value.to_string()),
10225            )),
10226        }
10227    }
10228}
10229
10230impl serde::ser::Serialize for TransferType {
10231    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10232    where
10233        S: serde::Serializer,
10234    {
10235        match self {
10236            Self::Unspecified => serializer.serialize_i32(0),
10237            Self::Batch => serializer.serialize_i32(1),
10238            Self::Streaming => serializer.serialize_i32(2),
10239            Self::UnknownValue(u) => u.0.serialize(serializer),
10240        }
10241    }
10242}
10243
10244impl<'de> serde::de::Deserialize<'de> for TransferType {
10245    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10246    where
10247        D: serde::Deserializer<'de>,
10248    {
10249        deserializer.deserialize_any(wkt::internal::EnumVisitor::<TransferType>::new(
10250            ".google.cloud.bigquery.datatransfer.v1.TransferType",
10251        ))
10252    }
10253}
10254
10255/// Represents data transfer run state.
10256///
10257/// # Working with unknown values
10258///
10259/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10260/// additional enum variants at any time. Adding new variants is not considered
10261/// a breaking change. Applications should write their code in anticipation of:
10262///
10263/// - New values appearing in future releases of the client library, **and**
10264/// - New values received dynamically, without application changes.
10265///
10266/// Please consult the [Working with enums] section in the user guide for some
10267/// guidelines.
10268///
10269/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10270#[derive(Clone, Debug, PartialEq)]
10271#[non_exhaustive]
10272pub enum TransferState {
10273    /// State placeholder (0).
10274    Unspecified,
10275    /// Data transfer is scheduled and is waiting to be picked up by
10276    /// data transfer backend (2).
10277    Pending,
10278    /// Data transfer is in progress (3).
10279    Running,
10280    /// Data transfer completed successfully (4).
10281    Succeeded,
10282    /// Data transfer failed (5).
10283    Failed,
10284    /// Data transfer is cancelled (6).
10285    Cancelled,
10286    /// If set, the enum was initialized with an unknown value.
10287    ///
10288    /// Applications can examine the value using [TransferState::value] or
10289    /// [TransferState::name].
10290    UnknownValue(transfer_state::UnknownValue),
10291}
10292
10293#[doc(hidden)]
10294pub mod transfer_state {
10295    #[allow(unused_imports)]
10296    use super::*;
10297    #[derive(Clone, Debug, PartialEq)]
10298    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10299}
10300
10301impl TransferState {
10302    /// Gets the enum value.
10303    ///
10304    /// Returns `None` if the enum contains an unknown value deserialized from
10305    /// the string representation of enums.
10306    pub fn value(&self) -> std::option::Option<i32> {
10307        match self {
10308            Self::Unspecified => std::option::Option::Some(0),
10309            Self::Pending => std::option::Option::Some(2),
10310            Self::Running => std::option::Option::Some(3),
10311            Self::Succeeded => std::option::Option::Some(4),
10312            Self::Failed => std::option::Option::Some(5),
10313            Self::Cancelled => std::option::Option::Some(6),
10314            Self::UnknownValue(u) => u.0.value(),
10315        }
10316    }
10317
10318    /// Gets the enum value as a string.
10319    ///
10320    /// Returns `None` if the enum contains an unknown value deserialized from
10321    /// the integer representation of enums.
10322    pub fn name(&self) -> std::option::Option<&str> {
10323        match self {
10324            Self::Unspecified => std::option::Option::Some("TRANSFER_STATE_UNSPECIFIED"),
10325            Self::Pending => std::option::Option::Some("PENDING"),
10326            Self::Running => std::option::Option::Some("RUNNING"),
10327            Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
10328            Self::Failed => std::option::Option::Some("FAILED"),
10329            Self::Cancelled => std::option::Option::Some("CANCELLED"),
10330            Self::UnknownValue(u) => u.0.name(),
10331        }
10332    }
10333}
10334
10335impl std::default::Default for TransferState {
10336    fn default() -> Self {
10337        use std::convert::From;
10338        Self::from(0)
10339    }
10340}
10341
10342impl std::fmt::Display for TransferState {
10343    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10344        wkt::internal::display_enum(f, self.name(), self.value())
10345    }
10346}
10347
10348impl std::convert::From<i32> for TransferState {
10349    fn from(value: i32) -> Self {
10350        match value {
10351            0 => Self::Unspecified,
10352            2 => Self::Pending,
10353            3 => Self::Running,
10354            4 => Self::Succeeded,
10355            5 => Self::Failed,
10356            6 => Self::Cancelled,
10357            _ => Self::UnknownValue(transfer_state::UnknownValue(
10358                wkt::internal::UnknownEnumValue::Integer(value),
10359            )),
10360        }
10361    }
10362}
10363
10364impl std::convert::From<&str> for TransferState {
10365    fn from(value: &str) -> Self {
10366        use std::string::ToString;
10367        match value {
10368            "TRANSFER_STATE_UNSPECIFIED" => Self::Unspecified,
10369            "PENDING" => Self::Pending,
10370            "RUNNING" => Self::Running,
10371            "SUCCEEDED" => Self::Succeeded,
10372            "FAILED" => Self::Failed,
10373            "CANCELLED" => Self::Cancelled,
10374            _ => Self::UnknownValue(transfer_state::UnknownValue(
10375                wkt::internal::UnknownEnumValue::String(value.to_string()),
10376            )),
10377        }
10378    }
10379}
10380
10381impl serde::ser::Serialize for TransferState {
10382    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10383    where
10384        S: serde::Serializer,
10385    {
10386        match self {
10387            Self::Unspecified => serializer.serialize_i32(0),
10388            Self::Pending => serializer.serialize_i32(2),
10389            Self::Running => serializer.serialize_i32(3),
10390            Self::Succeeded => serializer.serialize_i32(4),
10391            Self::Failed => serializer.serialize_i32(5),
10392            Self::Cancelled => serializer.serialize_i32(6),
10393            Self::UnknownValue(u) => u.0.serialize(serializer),
10394        }
10395    }
10396}
10397
10398impl<'de> serde::de::Deserialize<'de> for TransferState {
10399    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10400    where
10401        D: serde::Deserializer<'de>,
10402    {
10403        deserializer.deserialize_any(wkt::internal::EnumVisitor::<TransferState>::new(
10404            ".google.cloud.bigquery.datatransfer.v1.TransferState",
10405        ))
10406    }
10407}