google_cloud_datafusion_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 longrunning;
26extern crate lro;
27extern crate reqwest;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// Network configuration for a Data Fusion instance. These configurations
40/// are used for peering with the customer network. Configurations are optional
41/// when a public Data Fusion instance is to be created. However, providing
42/// these configurations allows several benefits, such as reduced network latency
43/// while accessing the customer resources from managed Data Fusion instance
44/// nodes, as well as access to the customer on-prem resources.
45#[derive(Clone, Default, PartialEq)]
46#[non_exhaustive]
47pub struct NetworkConfig {
48    /// Name of the network in the customer project with which the Tenant Project
49    /// will be peered for executing pipelines. In case of shared VPC where the
50    /// network resides in another host project the network should specified in
51    /// the form of projects/{host-project-id}/global/networks/{network}
52    pub network: std::string::String,
53
54    /// The IP range in CIDR notation to use for the managed Data Fusion instance
55    /// nodes. This range must not overlap with any other ranges used in the
56    /// customer network.
57    pub ip_allocation: std::string::String,
58
59    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
60}
61
62impl NetworkConfig {
63    pub fn new() -> Self {
64        std::default::Default::default()
65    }
66
67    /// Sets the value of [network][crate::model::NetworkConfig::network].
68    ///
69    /// # Example
70    /// ```ignore,no_run
71    /// # use google_cloud_datafusion_v1::model::NetworkConfig;
72    /// let x = NetworkConfig::new().set_network("example");
73    /// ```
74    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
75        self.network = v.into();
76        self
77    }
78
79    /// Sets the value of [ip_allocation][crate::model::NetworkConfig::ip_allocation].
80    ///
81    /// # Example
82    /// ```ignore,no_run
83    /// # use google_cloud_datafusion_v1::model::NetworkConfig;
84    /// let x = NetworkConfig::new().set_ip_allocation("example");
85    /// ```
86    pub fn set_ip_allocation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
87        self.ip_allocation = v.into();
88        self
89    }
90}
91
92impl wkt::message::Message for NetworkConfig {
93    fn typename() -> &'static str {
94        "type.googleapis.com/google.cloud.datafusion.v1.NetworkConfig"
95    }
96}
97
98/// The Data Fusion version. This proto message stores information about certain
99/// Data Fusion version, which is used for Data Fusion version upgrade.
100#[derive(Clone, Default, PartialEq)]
101#[non_exhaustive]
102pub struct Version {
103    /// The version number of the Data Fusion instance, such as '6.0.1.0'.
104    pub version_number: std::string::String,
105
106    /// Whether this is currently the default version for Cloud Data Fusion
107    pub default_version: bool,
108
109    /// Represents a list of available feature names for a given version.
110    pub available_features: std::vec::Vec<std::string::String>,
111
112    /// Type represents the release availability of the version
113    pub r#type: crate::model::version::Type,
114
115    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
116}
117
118impl Version {
119    pub fn new() -> Self {
120        std::default::Default::default()
121    }
122
123    /// Sets the value of [version_number][crate::model::Version::version_number].
124    ///
125    /// # Example
126    /// ```ignore,no_run
127    /// # use google_cloud_datafusion_v1::model::Version;
128    /// let x = Version::new().set_version_number("example");
129    /// ```
130    pub fn set_version_number<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
131        self.version_number = v.into();
132        self
133    }
134
135    /// Sets the value of [default_version][crate::model::Version::default_version].
136    ///
137    /// # Example
138    /// ```ignore,no_run
139    /// # use google_cloud_datafusion_v1::model::Version;
140    /// let x = Version::new().set_default_version(true);
141    /// ```
142    pub fn set_default_version<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
143        self.default_version = v.into();
144        self
145    }
146
147    /// Sets the value of [available_features][crate::model::Version::available_features].
148    ///
149    /// # Example
150    /// ```ignore,no_run
151    /// # use google_cloud_datafusion_v1::model::Version;
152    /// let x = Version::new().set_available_features(["a", "b", "c"]);
153    /// ```
154    pub fn set_available_features<T, V>(mut self, v: T) -> Self
155    where
156        T: std::iter::IntoIterator<Item = V>,
157        V: std::convert::Into<std::string::String>,
158    {
159        use std::iter::Iterator;
160        self.available_features = v.into_iter().map(|i| i.into()).collect();
161        self
162    }
163
164    /// Sets the value of [r#type][crate::model::Version::type].
165    ///
166    /// # Example
167    /// ```ignore,no_run
168    /// # use google_cloud_datafusion_v1::model::Version;
169    /// use google_cloud_datafusion_v1::model::version::Type;
170    /// let x0 = Version::new().set_type(Type::Preview);
171    /// let x1 = Version::new().set_type(Type::GeneralAvailability);
172    /// ```
173    pub fn set_type<T: std::convert::Into<crate::model::version::Type>>(mut self, v: T) -> Self {
174        self.r#type = v.into();
175        self
176    }
177}
178
179impl wkt::message::Message for Version {
180    fn typename() -> &'static str {
181        "type.googleapis.com/google.cloud.datafusion.v1.Version"
182    }
183}
184
185/// Defines additional types related to [Version].
186pub mod version {
187    #[allow(unused_imports)]
188    use super::*;
189
190    /// Each type represents the release availability of a CDF version
191    ///
192    /// # Working with unknown values
193    ///
194    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
195    /// additional enum variants at any time. Adding new variants is not considered
196    /// a breaking change. Applications should write their code in anticipation of:
197    ///
198    /// - New values appearing in future releases of the client library, **and**
199    /// - New values received dynamically, without application changes.
200    ///
201    /// Please consult the [Working with enums] section in the user guide for some
202    /// guidelines.
203    ///
204    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
205    #[derive(Clone, Debug, PartialEq)]
206    #[non_exhaustive]
207    pub enum Type {
208        /// Version does not have availability yet
209        Unspecified,
210        /// Version is under development and not considered stable
211        Preview,
212        /// Version is available for public use
213        GeneralAvailability,
214        /// If set, the enum was initialized with an unknown value.
215        ///
216        /// Applications can examine the value using [Type::value] or
217        /// [Type::name].
218        UnknownValue(r#type::UnknownValue),
219    }
220
221    #[doc(hidden)]
222    pub mod r#type {
223        #[allow(unused_imports)]
224        use super::*;
225        #[derive(Clone, Debug, PartialEq)]
226        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
227    }
228
229    impl Type {
230        /// Gets the enum value.
231        ///
232        /// Returns `None` if the enum contains an unknown value deserialized from
233        /// the string representation of enums.
234        pub fn value(&self) -> std::option::Option<i32> {
235            match self {
236                Self::Unspecified => std::option::Option::Some(0),
237                Self::Preview => std::option::Option::Some(1),
238                Self::GeneralAvailability => std::option::Option::Some(2),
239                Self::UnknownValue(u) => u.0.value(),
240            }
241        }
242
243        /// Gets the enum value as a string.
244        ///
245        /// Returns `None` if the enum contains an unknown value deserialized from
246        /// the integer representation of enums.
247        pub fn name(&self) -> std::option::Option<&str> {
248            match self {
249                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
250                Self::Preview => std::option::Option::Some("TYPE_PREVIEW"),
251                Self::GeneralAvailability => std::option::Option::Some("TYPE_GENERAL_AVAILABILITY"),
252                Self::UnknownValue(u) => u.0.name(),
253            }
254        }
255    }
256
257    impl std::default::Default for Type {
258        fn default() -> Self {
259            use std::convert::From;
260            Self::from(0)
261        }
262    }
263
264    impl std::fmt::Display for Type {
265        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
266            wkt::internal::display_enum(f, self.name(), self.value())
267        }
268    }
269
270    impl std::convert::From<i32> for Type {
271        fn from(value: i32) -> Self {
272            match value {
273                0 => Self::Unspecified,
274                1 => Self::Preview,
275                2 => Self::GeneralAvailability,
276                _ => Self::UnknownValue(r#type::UnknownValue(
277                    wkt::internal::UnknownEnumValue::Integer(value),
278                )),
279            }
280        }
281    }
282
283    impl std::convert::From<&str> for Type {
284        fn from(value: &str) -> Self {
285            use std::string::ToString;
286            match value {
287                "TYPE_UNSPECIFIED" => Self::Unspecified,
288                "TYPE_PREVIEW" => Self::Preview,
289                "TYPE_GENERAL_AVAILABILITY" => Self::GeneralAvailability,
290                _ => Self::UnknownValue(r#type::UnknownValue(
291                    wkt::internal::UnknownEnumValue::String(value.to_string()),
292                )),
293            }
294        }
295    }
296
297    impl serde::ser::Serialize for Type {
298        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
299        where
300            S: serde::Serializer,
301        {
302            match self {
303                Self::Unspecified => serializer.serialize_i32(0),
304                Self::Preview => serializer.serialize_i32(1),
305                Self::GeneralAvailability => serializer.serialize_i32(2),
306                Self::UnknownValue(u) => u.0.serialize(serializer),
307            }
308        }
309    }
310
311    impl<'de> serde::de::Deserialize<'de> for Type {
312        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
313        where
314            D: serde::Deserializer<'de>,
315        {
316            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
317                ".google.cloud.datafusion.v1.Version.Type",
318            ))
319        }
320    }
321}
322
323/// Identifies Data Fusion accelerators for an instance.
324#[derive(Clone, Default, PartialEq)]
325#[non_exhaustive]
326pub struct Accelerator {
327    /// The type of an accelator for a CDF instance.
328    pub accelerator_type: crate::model::accelerator::AcceleratorType,
329
330    /// The state of the accelerator
331    pub state: crate::model::accelerator::State,
332
333    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
334}
335
336impl Accelerator {
337    pub fn new() -> Self {
338        std::default::Default::default()
339    }
340
341    /// Sets the value of [accelerator_type][crate::model::Accelerator::accelerator_type].
342    ///
343    /// # Example
344    /// ```ignore,no_run
345    /// # use google_cloud_datafusion_v1::model::Accelerator;
346    /// use google_cloud_datafusion_v1::model::accelerator::AcceleratorType;
347    /// let x0 = Accelerator::new().set_accelerator_type(AcceleratorType::Cdc);
348    /// let x1 = Accelerator::new().set_accelerator_type(AcceleratorType::Healthcare);
349    /// let x2 = Accelerator::new().set_accelerator_type(AcceleratorType::CcaiInsights);
350    /// ```
351    pub fn set_accelerator_type<
352        T: std::convert::Into<crate::model::accelerator::AcceleratorType>,
353    >(
354        mut self,
355        v: T,
356    ) -> Self {
357        self.accelerator_type = v.into();
358        self
359    }
360
361    /// Sets the value of [state][crate::model::Accelerator::state].
362    ///
363    /// # Example
364    /// ```ignore,no_run
365    /// # use google_cloud_datafusion_v1::model::Accelerator;
366    /// use google_cloud_datafusion_v1::model::accelerator::State;
367    /// let x0 = Accelerator::new().set_state(State::Enabled);
368    /// let x1 = Accelerator::new().set_state(State::Disabled);
369    /// let x2 = Accelerator::new().set_state(State::Unknown);
370    /// ```
371    pub fn set_state<T: std::convert::Into<crate::model::accelerator::State>>(
372        mut self,
373        v: T,
374    ) -> Self {
375        self.state = v.into();
376        self
377    }
378}
379
380impl wkt::message::Message for Accelerator {
381    fn typename() -> &'static str {
382        "type.googleapis.com/google.cloud.datafusion.v1.Accelerator"
383    }
384}
385
386/// Defines additional types related to [Accelerator].
387pub mod accelerator {
388    #[allow(unused_imports)]
389    use super::*;
390
391    /// Each type represents an Accelerator (Add-On) supported by Cloud Data Fusion
392    /// service.
393    ///
394    /// # Working with unknown values
395    ///
396    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
397    /// additional enum variants at any time. Adding new variants is not considered
398    /// a breaking change. Applications should write their code in anticipation of:
399    ///
400    /// - New values appearing in future releases of the client library, **and**
401    /// - New values received dynamically, without application changes.
402    ///
403    /// Please consult the [Working with enums] section in the user guide for some
404    /// guidelines.
405    ///
406    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
407    #[derive(Clone, Debug, PartialEq)]
408    #[non_exhaustive]
409    pub enum AcceleratorType {
410        /// Default value, if unspecified.
411        Unspecified,
412        /// Change Data Capture accelerator for CDF.
413        Cdc,
414        /// Cloud Healthcare accelerator for CDF. This accelerator is to enable Cloud
415        /// Healthcare specific CDF plugins developed by Healthcare team.
416        Healthcare,
417        /// Contact Center AI Insights
418        /// This accelerator is used to enable import and export pipelines
419        /// custom built to streamline CCAI Insights processing.
420        CcaiInsights,
421        /// If set, the enum was initialized with an unknown value.
422        ///
423        /// Applications can examine the value using [AcceleratorType::value] or
424        /// [AcceleratorType::name].
425        UnknownValue(accelerator_type::UnknownValue),
426    }
427
428    #[doc(hidden)]
429    pub mod accelerator_type {
430        #[allow(unused_imports)]
431        use super::*;
432        #[derive(Clone, Debug, PartialEq)]
433        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
434    }
435
436    impl AcceleratorType {
437        /// Gets the enum value.
438        ///
439        /// Returns `None` if the enum contains an unknown value deserialized from
440        /// the string representation of enums.
441        pub fn value(&self) -> std::option::Option<i32> {
442            match self {
443                Self::Unspecified => std::option::Option::Some(0),
444                Self::Cdc => std::option::Option::Some(1),
445                Self::Healthcare => std::option::Option::Some(2),
446                Self::CcaiInsights => std::option::Option::Some(3),
447                Self::UnknownValue(u) => u.0.value(),
448            }
449        }
450
451        /// Gets the enum value as a string.
452        ///
453        /// Returns `None` if the enum contains an unknown value deserialized from
454        /// the integer representation of enums.
455        pub fn name(&self) -> std::option::Option<&str> {
456            match self {
457                Self::Unspecified => std::option::Option::Some("ACCELERATOR_TYPE_UNSPECIFIED"),
458                Self::Cdc => std::option::Option::Some("CDC"),
459                Self::Healthcare => std::option::Option::Some("HEALTHCARE"),
460                Self::CcaiInsights => std::option::Option::Some("CCAI_INSIGHTS"),
461                Self::UnknownValue(u) => u.0.name(),
462            }
463        }
464    }
465
466    impl std::default::Default for AcceleratorType {
467        fn default() -> Self {
468            use std::convert::From;
469            Self::from(0)
470        }
471    }
472
473    impl std::fmt::Display for AcceleratorType {
474        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
475            wkt::internal::display_enum(f, self.name(), self.value())
476        }
477    }
478
479    impl std::convert::From<i32> for AcceleratorType {
480        fn from(value: i32) -> Self {
481            match value {
482                0 => Self::Unspecified,
483                1 => Self::Cdc,
484                2 => Self::Healthcare,
485                3 => Self::CcaiInsights,
486                _ => Self::UnknownValue(accelerator_type::UnknownValue(
487                    wkt::internal::UnknownEnumValue::Integer(value),
488                )),
489            }
490        }
491    }
492
493    impl std::convert::From<&str> for AcceleratorType {
494        fn from(value: &str) -> Self {
495            use std::string::ToString;
496            match value {
497                "ACCELERATOR_TYPE_UNSPECIFIED" => Self::Unspecified,
498                "CDC" => Self::Cdc,
499                "HEALTHCARE" => Self::Healthcare,
500                "CCAI_INSIGHTS" => Self::CcaiInsights,
501                _ => Self::UnknownValue(accelerator_type::UnknownValue(
502                    wkt::internal::UnknownEnumValue::String(value.to_string()),
503                )),
504            }
505        }
506    }
507
508    impl serde::ser::Serialize for AcceleratorType {
509        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
510        where
511            S: serde::Serializer,
512        {
513            match self {
514                Self::Unspecified => serializer.serialize_i32(0),
515                Self::Cdc => serializer.serialize_i32(1),
516                Self::Healthcare => serializer.serialize_i32(2),
517                Self::CcaiInsights => serializer.serialize_i32(3),
518                Self::UnknownValue(u) => u.0.serialize(serializer),
519            }
520        }
521    }
522
523    impl<'de> serde::de::Deserialize<'de> for AcceleratorType {
524        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
525        where
526            D: serde::Deserializer<'de>,
527        {
528            deserializer.deserialize_any(wkt::internal::EnumVisitor::<AcceleratorType>::new(
529                ".google.cloud.datafusion.v1.Accelerator.AcceleratorType",
530            ))
531        }
532    }
533
534    /// Different values possible for the state of an accelerator
535    ///
536    /// # Working with unknown values
537    ///
538    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
539    /// additional enum variants at any time. Adding new variants is not considered
540    /// a breaking change. Applications should write their code in anticipation of:
541    ///
542    /// - New values appearing in future releases of the client library, **and**
543    /// - New values received dynamically, without application changes.
544    ///
545    /// Please consult the [Working with enums] section in the user guide for some
546    /// guidelines.
547    ///
548    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
549    #[derive(Clone, Debug, PartialEq)]
550    #[non_exhaustive]
551    pub enum State {
552        /// Default value, do not use
553        Unspecified,
554        /// Indicates that the accelerator is enabled and available to use
555        Enabled,
556        /// Indicates that the accelerator is disabled and not available to use
557        Disabled,
558        /// Indicates that accelerator state is currently unknown.
559        /// Requests for enable, disable could be retried while in this state
560        Unknown,
561        /// If set, the enum was initialized with an unknown value.
562        ///
563        /// Applications can examine the value using [State::value] or
564        /// [State::name].
565        UnknownValue(state::UnknownValue),
566    }
567
568    #[doc(hidden)]
569    pub mod state {
570        #[allow(unused_imports)]
571        use super::*;
572        #[derive(Clone, Debug, PartialEq)]
573        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
574    }
575
576    impl State {
577        /// Gets the enum value.
578        ///
579        /// Returns `None` if the enum contains an unknown value deserialized from
580        /// the string representation of enums.
581        pub fn value(&self) -> std::option::Option<i32> {
582            match self {
583                Self::Unspecified => std::option::Option::Some(0),
584                Self::Enabled => std::option::Option::Some(1),
585                Self::Disabled => std::option::Option::Some(2),
586                Self::Unknown => std::option::Option::Some(3),
587                Self::UnknownValue(u) => u.0.value(),
588            }
589        }
590
591        /// Gets the enum value as a string.
592        ///
593        /// Returns `None` if the enum contains an unknown value deserialized from
594        /// the integer representation of enums.
595        pub fn name(&self) -> std::option::Option<&str> {
596            match self {
597                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
598                Self::Enabled => std::option::Option::Some("ENABLED"),
599                Self::Disabled => std::option::Option::Some("DISABLED"),
600                Self::Unknown => std::option::Option::Some("UNKNOWN"),
601                Self::UnknownValue(u) => u.0.name(),
602            }
603        }
604    }
605
606    impl std::default::Default for State {
607        fn default() -> Self {
608            use std::convert::From;
609            Self::from(0)
610        }
611    }
612
613    impl std::fmt::Display for State {
614        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
615            wkt::internal::display_enum(f, self.name(), self.value())
616        }
617    }
618
619    impl std::convert::From<i32> for State {
620        fn from(value: i32) -> Self {
621            match value {
622                0 => Self::Unspecified,
623                1 => Self::Enabled,
624                2 => Self::Disabled,
625                3 => Self::Unknown,
626                _ => Self::UnknownValue(state::UnknownValue(
627                    wkt::internal::UnknownEnumValue::Integer(value),
628                )),
629            }
630        }
631    }
632
633    impl std::convert::From<&str> for State {
634        fn from(value: &str) -> Self {
635            use std::string::ToString;
636            match value {
637                "STATE_UNSPECIFIED" => Self::Unspecified,
638                "ENABLED" => Self::Enabled,
639                "DISABLED" => Self::Disabled,
640                "UNKNOWN" => Self::Unknown,
641                _ => Self::UnknownValue(state::UnknownValue(
642                    wkt::internal::UnknownEnumValue::String(value.to_string()),
643                )),
644            }
645        }
646    }
647
648    impl serde::ser::Serialize for State {
649        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
650        where
651            S: serde::Serializer,
652        {
653            match self {
654                Self::Unspecified => serializer.serialize_i32(0),
655                Self::Enabled => serializer.serialize_i32(1),
656                Self::Disabled => serializer.serialize_i32(2),
657                Self::Unknown => serializer.serialize_i32(3),
658                Self::UnknownValue(u) => u.0.serialize(serializer),
659            }
660        }
661    }
662
663    impl<'de> serde::de::Deserialize<'de> for State {
664        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
665        where
666            D: serde::Deserializer<'de>,
667        {
668            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
669                ".google.cloud.datafusion.v1.Accelerator.State",
670            ))
671        }
672    }
673}
674
675/// The crypto key configuration. This field is used by the Customer-managed
676/// encryption keys (CMEK) feature.
677#[derive(Clone, Default, PartialEq)]
678#[non_exhaustive]
679pub struct CryptoKeyConfig {
680    /// The name of the key which is used to encrypt/decrypt customer data. For key
681    /// in Cloud KMS, the key should be in the format of
682    /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
683    pub key_reference: std::string::String,
684
685    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
686}
687
688impl CryptoKeyConfig {
689    pub fn new() -> Self {
690        std::default::Default::default()
691    }
692
693    /// Sets the value of [key_reference][crate::model::CryptoKeyConfig::key_reference].
694    ///
695    /// # Example
696    /// ```ignore,no_run
697    /// # use google_cloud_datafusion_v1::model::CryptoKeyConfig;
698    /// let x = CryptoKeyConfig::new().set_key_reference("example");
699    /// ```
700    pub fn set_key_reference<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
701        self.key_reference = v.into();
702        self
703    }
704}
705
706impl wkt::message::Message for CryptoKeyConfig {
707    fn typename() -> &'static str {
708        "type.googleapis.com/google.cloud.datafusion.v1.CryptoKeyConfig"
709    }
710}
711
712/// Represents a Data Fusion instance.
713#[derive(Clone, Default, PartialEq)]
714#[non_exhaustive]
715pub struct Instance {
716    /// Output only. The name of this instance is in the form of
717    /// projects/{project}/locations/{location}/instances/{instance}.
718    pub name: std::string::String,
719
720    /// A description of this instance.
721    pub description: std::string::String,
722
723    /// Required. Instance type.
724    pub r#type: crate::model::instance::Type,
725
726    /// Option to enable Stackdriver Logging.
727    pub enable_stackdriver_logging: bool,
728
729    /// Option to enable Stackdriver Monitoring.
730    pub enable_stackdriver_monitoring: bool,
731
732    /// Specifies whether the Data Fusion instance should be private. If set to
733    /// true, all Data Fusion nodes will have private IP addresses and will not be
734    /// able to access the public internet.
735    pub private_instance: bool,
736
737    /// Network configuration options. These are required when a private Data
738    /// Fusion instance is to be created.
739    pub network_config: std::option::Option<crate::model::NetworkConfig>,
740
741    /// The resource labels for instance to use to annotate any related underlying
742    /// resources such as Compute Engine VMs. The character '=' is not allowed to
743    /// be used within the labels.
744    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
745
746    /// Map of additional options used to configure the behavior of
747    /// Data Fusion instance.
748    pub options: std::collections::HashMap<std::string::String, std::string::String>,
749
750    /// Output only. The time the instance was created.
751    pub create_time: std::option::Option<wkt::Timestamp>,
752
753    /// Output only. The time the instance was last updated.
754    pub update_time: std::option::Option<wkt::Timestamp>,
755
756    /// Output only. The current state of this Data Fusion instance.
757    pub state: crate::model::instance::State,
758
759    /// Output only. Additional information about the current state of this Data
760    /// Fusion instance if available.
761    pub state_message: std::string::String,
762
763    /// Output only. Endpoint on which the Data Fusion UI is accessible.
764    pub service_endpoint: std::string::String,
765
766    /// Name of the zone in which the Data Fusion instance will be created. Only
767    /// DEVELOPER instances use this field.
768    pub zone: std::string::String,
769
770    /// Current version of the Data Fusion. Only specifiable in Update.
771    pub version: std::string::String,
772
773    /// Output only. Deprecated. Use tenant_project_id instead to extract the tenant project ID.
774    #[deprecated]
775    pub service_account: std::string::String,
776
777    /// Display name for an instance.
778    pub display_name: std::string::String,
779
780    /// Available versions that the instance can be upgraded to using
781    /// UpdateInstanceRequest.
782    pub available_version: std::vec::Vec<crate::model::Version>,
783
784    /// Output only. Endpoint on which the REST APIs is accessible.
785    pub api_endpoint: std::string::String,
786
787    /// Output only. Cloud Storage bucket generated by Data Fusion in the customer project.
788    pub gcs_bucket: std::string::String,
789
790    /// List of accelerators enabled for this CDF instance.
791    pub accelerators: std::vec::Vec<crate::model::Accelerator>,
792
793    /// Output only. P4 service account for the customer project.
794    pub p4_service_account: std::string::String,
795
796    /// Output only. The name of the tenant project.
797    pub tenant_project_id: std::string::String,
798
799    /// User-managed service account to set on Dataproc when Cloud Data Fusion
800    /// creates Dataproc to run data processing pipelines.
801    ///
802    /// This allows users to have fine-grained access control on Dataproc's
803    /// accesses to cloud resources.
804    pub dataproc_service_account: std::string::String,
805
806    /// Option to enable granular role-based access control.
807    pub enable_rbac: bool,
808
809    /// The crypto key configuration. This field is used by the Customer-Managed
810    /// Encryption Keys (CMEK) feature.
811    pub crypto_key_config: std::option::Option<crate::model::CryptoKeyConfig>,
812
813    /// Output only. If the instance state is DISABLED, the reason for disabling the instance.
814    pub disabled_reason: std::vec::Vec<crate::model::instance::DisabledReason>,
815
816    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
817}
818
819impl Instance {
820    pub fn new() -> Self {
821        std::default::Default::default()
822    }
823
824    /// Sets the value of [name][crate::model::Instance::name].
825    ///
826    /// # Example
827    /// ```ignore,no_run
828    /// # use google_cloud_datafusion_v1::model::Instance;
829    /// let x = Instance::new().set_name("example");
830    /// ```
831    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
832        self.name = v.into();
833        self
834    }
835
836    /// Sets the value of [description][crate::model::Instance::description].
837    ///
838    /// # Example
839    /// ```ignore,no_run
840    /// # use google_cloud_datafusion_v1::model::Instance;
841    /// let x = Instance::new().set_description("example");
842    /// ```
843    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
844        self.description = v.into();
845        self
846    }
847
848    /// Sets the value of [r#type][crate::model::Instance::type].
849    ///
850    /// # Example
851    /// ```ignore,no_run
852    /// # use google_cloud_datafusion_v1::model::Instance;
853    /// use google_cloud_datafusion_v1::model::instance::Type;
854    /// let x0 = Instance::new().set_type(Type::Basic);
855    /// let x1 = Instance::new().set_type(Type::Enterprise);
856    /// let x2 = Instance::new().set_type(Type::Developer);
857    /// ```
858    pub fn set_type<T: std::convert::Into<crate::model::instance::Type>>(mut self, v: T) -> Self {
859        self.r#type = v.into();
860        self
861    }
862
863    /// Sets the value of [enable_stackdriver_logging][crate::model::Instance::enable_stackdriver_logging].
864    ///
865    /// # Example
866    /// ```ignore,no_run
867    /// # use google_cloud_datafusion_v1::model::Instance;
868    /// let x = Instance::new().set_enable_stackdriver_logging(true);
869    /// ```
870    pub fn set_enable_stackdriver_logging<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
871        self.enable_stackdriver_logging = v.into();
872        self
873    }
874
875    /// Sets the value of [enable_stackdriver_monitoring][crate::model::Instance::enable_stackdriver_monitoring].
876    ///
877    /// # Example
878    /// ```ignore,no_run
879    /// # use google_cloud_datafusion_v1::model::Instance;
880    /// let x = Instance::new().set_enable_stackdriver_monitoring(true);
881    /// ```
882    pub fn set_enable_stackdriver_monitoring<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
883        self.enable_stackdriver_monitoring = v.into();
884        self
885    }
886
887    /// Sets the value of [private_instance][crate::model::Instance::private_instance].
888    ///
889    /// # Example
890    /// ```ignore,no_run
891    /// # use google_cloud_datafusion_v1::model::Instance;
892    /// let x = Instance::new().set_private_instance(true);
893    /// ```
894    pub fn set_private_instance<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
895        self.private_instance = v.into();
896        self
897    }
898
899    /// Sets the value of [network_config][crate::model::Instance::network_config].
900    ///
901    /// # Example
902    /// ```ignore,no_run
903    /// # use google_cloud_datafusion_v1::model::Instance;
904    /// use google_cloud_datafusion_v1::model::NetworkConfig;
905    /// let x = Instance::new().set_network_config(NetworkConfig::default()/* use setters */);
906    /// ```
907    pub fn set_network_config<T>(mut self, v: T) -> Self
908    where
909        T: std::convert::Into<crate::model::NetworkConfig>,
910    {
911        self.network_config = std::option::Option::Some(v.into());
912        self
913    }
914
915    /// Sets or clears the value of [network_config][crate::model::Instance::network_config].
916    ///
917    /// # Example
918    /// ```ignore,no_run
919    /// # use google_cloud_datafusion_v1::model::Instance;
920    /// use google_cloud_datafusion_v1::model::NetworkConfig;
921    /// let x = Instance::new().set_or_clear_network_config(Some(NetworkConfig::default()/* use setters */));
922    /// let x = Instance::new().set_or_clear_network_config(None::<NetworkConfig>);
923    /// ```
924    pub fn set_or_clear_network_config<T>(mut self, v: std::option::Option<T>) -> Self
925    where
926        T: std::convert::Into<crate::model::NetworkConfig>,
927    {
928        self.network_config = v.map(|x| x.into());
929        self
930    }
931
932    /// Sets the value of [labels][crate::model::Instance::labels].
933    ///
934    /// # Example
935    /// ```ignore,no_run
936    /// # use google_cloud_datafusion_v1::model::Instance;
937    /// let x = Instance::new().set_labels([
938    ///     ("key0", "abc"),
939    ///     ("key1", "xyz"),
940    /// ]);
941    /// ```
942    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
943    where
944        T: std::iter::IntoIterator<Item = (K, V)>,
945        K: std::convert::Into<std::string::String>,
946        V: std::convert::Into<std::string::String>,
947    {
948        use std::iter::Iterator;
949        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
950        self
951    }
952
953    /// Sets the value of [options][crate::model::Instance::options].
954    ///
955    /// # Example
956    /// ```ignore,no_run
957    /// # use google_cloud_datafusion_v1::model::Instance;
958    /// let x = Instance::new().set_options([
959    ///     ("key0", "abc"),
960    ///     ("key1", "xyz"),
961    /// ]);
962    /// ```
963    pub fn set_options<T, K, V>(mut self, v: T) -> Self
964    where
965        T: std::iter::IntoIterator<Item = (K, V)>,
966        K: std::convert::Into<std::string::String>,
967        V: std::convert::Into<std::string::String>,
968    {
969        use std::iter::Iterator;
970        self.options = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
971        self
972    }
973
974    /// Sets the value of [create_time][crate::model::Instance::create_time].
975    ///
976    /// # Example
977    /// ```ignore,no_run
978    /// # use google_cloud_datafusion_v1::model::Instance;
979    /// use wkt::Timestamp;
980    /// let x = Instance::new().set_create_time(Timestamp::default()/* use setters */);
981    /// ```
982    pub fn set_create_time<T>(mut self, v: T) -> Self
983    where
984        T: std::convert::Into<wkt::Timestamp>,
985    {
986        self.create_time = std::option::Option::Some(v.into());
987        self
988    }
989
990    /// Sets or clears the value of [create_time][crate::model::Instance::create_time].
991    ///
992    /// # Example
993    /// ```ignore,no_run
994    /// # use google_cloud_datafusion_v1::model::Instance;
995    /// use wkt::Timestamp;
996    /// let x = Instance::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
997    /// let x = Instance::new().set_or_clear_create_time(None::<Timestamp>);
998    /// ```
999    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1000    where
1001        T: std::convert::Into<wkt::Timestamp>,
1002    {
1003        self.create_time = v.map(|x| x.into());
1004        self
1005    }
1006
1007    /// Sets the value of [update_time][crate::model::Instance::update_time].
1008    ///
1009    /// # Example
1010    /// ```ignore,no_run
1011    /// # use google_cloud_datafusion_v1::model::Instance;
1012    /// use wkt::Timestamp;
1013    /// let x = Instance::new().set_update_time(Timestamp::default()/* use setters */);
1014    /// ```
1015    pub fn set_update_time<T>(mut self, v: T) -> Self
1016    where
1017        T: std::convert::Into<wkt::Timestamp>,
1018    {
1019        self.update_time = std::option::Option::Some(v.into());
1020        self
1021    }
1022
1023    /// Sets or clears the value of [update_time][crate::model::Instance::update_time].
1024    ///
1025    /// # Example
1026    /// ```ignore,no_run
1027    /// # use google_cloud_datafusion_v1::model::Instance;
1028    /// use wkt::Timestamp;
1029    /// let x = Instance::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1030    /// let x = Instance::new().set_or_clear_update_time(None::<Timestamp>);
1031    /// ```
1032    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1033    where
1034        T: std::convert::Into<wkt::Timestamp>,
1035    {
1036        self.update_time = v.map(|x| x.into());
1037        self
1038    }
1039
1040    /// Sets the value of [state][crate::model::Instance::state].
1041    ///
1042    /// # Example
1043    /// ```ignore,no_run
1044    /// # use google_cloud_datafusion_v1::model::Instance;
1045    /// use google_cloud_datafusion_v1::model::instance::State;
1046    /// let x0 = Instance::new().set_state(State::Creating);
1047    /// let x1 = Instance::new().set_state(State::Active);
1048    /// let x2 = Instance::new().set_state(State::Failed);
1049    /// ```
1050    pub fn set_state<T: std::convert::Into<crate::model::instance::State>>(mut self, v: T) -> Self {
1051        self.state = v.into();
1052        self
1053    }
1054
1055    /// Sets the value of [state_message][crate::model::Instance::state_message].
1056    ///
1057    /// # Example
1058    /// ```ignore,no_run
1059    /// # use google_cloud_datafusion_v1::model::Instance;
1060    /// let x = Instance::new().set_state_message("example");
1061    /// ```
1062    pub fn set_state_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1063        self.state_message = v.into();
1064        self
1065    }
1066
1067    /// Sets the value of [service_endpoint][crate::model::Instance::service_endpoint].
1068    ///
1069    /// # Example
1070    /// ```ignore,no_run
1071    /// # use google_cloud_datafusion_v1::model::Instance;
1072    /// let x = Instance::new().set_service_endpoint("example");
1073    /// ```
1074    pub fn set_service_endpoint<T: std::convert::Into<std::string::String>>(
1075        mut self,
1076        v: T,
1077    ) -> Self {
1078        self.service_endpoint = v.into();
1079        self
1080    }
1081
1082    /// Sets the value of [zone][crate::model::Instance::zone].
1083    ///
1084    /// # Example
1085    /// ```ignore,no_run
1086    /// # use google_cloud_datafusion_v1::model::Instance;
1087    /// let x = Instance::new().set_zone("example");
1088    /// ```
1089    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1090        self.zone = v.into();
1091        self
1092    }
1093
1094    /// Sets the value of [version][crate::model::Instance::version].
1095    ///
1096    /// # Example
1097    /// ```ignore,no_run
1098    /// # use google_cloud_datafusion_v1::model::Instance;
1099    /// let x = Instance::new().set_version("example");
1100    /// ```
1101    pub fn set_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1102        self.version = v.into();
1103        self
1104    }
1105
1106    /// Sets the value of [service_account][crate::model::Instance::service_account].
1107    ///
1108    /// # Example
1109    /// ```ignore,no_run
1110    /// # use google_cloud_datafusion_v1::model::Instance;
1111    /// let x = Instance::new().set_service_account("example");
1112    /// ```
1113    #[deprecated]
1114    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1115        self.service_account = v.into();
1116        self
1117    }
1118
1119    /// Sets the value of [display_name][crate::model::Instance::display_name].
1120    ///
1121    /// # Example
1122    /// ```ignore,no_run
1123    /// # use google_cloud_datafusion_v1::model::Instance;
1124    /// let x = Instance::new().set_display_name("example");
1125    /// ```
1126    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1127        self.display_name = v.into();
1128        self
1129    }
1130
1131    /// Sets the value of [available_version][crate::model::Instance::available_version].
1132    ///
1133    /// # Example
1134    /// ```ignore,no_run
1135    /// # use google_cloud_datafusion_v1::model::Instance;
1136    /// use google_cloud_datafusion_v1::model::Version;
1137    /// let x = Instance::new()
1138    ///     .set_available_version([
1139    ///         Version::default()/* use setters */,
1140    ///         Version::default()/* use (different) setters */,
1141    ///     ]);
1142    /// ```
1143    pub fn set_available_version<T, V>(mut self, v: T) -> Self
1144    where
1145        T: std::iter::IntoIterator<Item = V>,
1146        V: std::convert::Into<crate::model::Version>,
1147    {
1148        use std::iter::Iterator;
1149        self.available_version = v.into_iter().map(|i| i.into()).collect();
1150        self
1151    }
1152
1153    /// Sets the value of [api_endpoint][crate::model::Instance::api_endpoint].
1154    ///
1155    /// # Example
1156    /// ```ignore,no_run
1157    /// # use google_cloud_datafusion_v1::model::Instance;
1158    /// let x = Instance::new().set_api_endpoint("example");
1159    /// ```
1160    pub fn set_api_endpoint<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1161        self.api_endpoint = v.into();
1162        self
1163    }
1164
1165    /// Sets the value of [gcs_bucket][crate::model::Instance::gcs_bucket].
1166    ///
1167    /// # Example
1168    /// ```ignore,no_run
1169    /// # use google_cloud_datafusion_v1::model::Instance;
1170    /// let x = Instance::new().set_gcs_bucket("example");
1171    /// ```
1172    pub fn set_gcs_bucket<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1173        self.gcs_bucket = v.into();
1174        self
1175    }
1176
1177    /// Sets the value of [accelerators][crate::model::Instance::accelerators].
1178    ///
1179    /// # Example
1180    /// ```ignore,no_run
1181    /// # use google_cloud_datafusion_v1::model::Instance;
1182    /// use google_cloud_datafusion_v1::model::Accelerator;
1183    /// let x = Instance::new()
1184    ///     .set_accelerators([
1185    ///         Accelerator::default()/* use setters */,
1186    ///         Accelerator::default()/* use (different) setters */,
1187    ///     ]);
1188    /// ```
1189    pub fn set_accelerators<T, V>(mut self, v: T) -> Self
1190    where
1191        T: std::iter::IntoIterator<Item = V>,
1192        V: std::convert::Into<crate::model::Accelerator>,
1193    {
1194        use std::iter::Iterator;
1195        self.accelerators = v.into_iter().map(|i| i.into()).collect();
1196        self
1197    }
1198
1199    /// Sets the value of [p4_service_account][crate::model::Instance::p4_service_account].
1200    ///
1201    /// # Example
1202    /// ```ignore,no_run
1203    /// # use google_cloud_datafusion_v1::model::Instance;
1204    /// let x = Instance::new().set_p4_service_account("example");
1205    /// ```
1206    pub fn set_p4_service_account<T: std::convert::Into<std::string::String>>(
1207        mut self,
1208        v: T,
1209    ) -> Self {
1210        self.p4_service_account = v.into();
1211        self
1212    }
1213
1214    /// Sets the value of [tenant_project_id][crate::model::Instance::tenant_project_id].
1215    ///
1216    /// # Example
1217    /// ```ignore,no_run
1218    /// # use google_cloud_datafusion_v1::model::Instance;
1219    /// let x = Instance::new().set_tenant_project_id("example");
1220    /// ```
1221    pub fn set_tenant_project_id<T: std::convert::Into<std::string::String>>(
1222        mut self,
1223        v: T,
1224    ) -> Self {
1225        self.tenant_project_id = v.into();
1226        self
1227    }
1228
1229    /// Sets the value of [dataproc_service_account][crate::model::Instance::dataproc_service_account].
1230    ///
1231    /// # Example
1232    /// ```ignore,no_run
1233    /// # use google_cloud_datafusion_v1::model::Instance;
1234    /// let x = Instance::new().set_dataproc_service_account("example");
1235    /// ```
1236    pub fn set_dataproc_service_account<T: std::convert::Into<std::string::String>>(
1237        mut self,
1238        v: T,
1239    ) -> Self {
1240        self.dataproc_service_account = v.into();
1241        self
1242    }
1243
1244    /// Sets the value of [enable_rbac][crate::model::Instance::enable_rbac].
1245    ///
1246    /// # Example
1247    /// ```ignore,no_run
1248    /// # use google_cloud_datafusion_v1::model::Instance;
1249    /// let x = Instance::new().set_enable_rbac(true);
1250    /// ```
1251    pub fn set_enable_rbac<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1252        self.enable_rbac = v.into();
1253        self
1254    }
1255
1256    /// Sets the value of [crypto_key_config][crate::model::Instance::crypto_key_config].
1257    ///
1258    /// # Example
1259    /// ```ignore,no_run
1260    /// # use google_cloud_datafusion_v1::model::Instance;
1261    /// use google_cloud_datafusion_v1::model::CryptoKeyConfig;
1262    /// let x = Instance::new().set_crypto_key_config(CryptoKeyConfig::default()/* use setters */);
1263    /// ```
1264    pub fn set_crypto_key_config<T>(mut self, v: T) -> Self
1265    where
1266        T: std::convert::Into<crate::model::CryptoKeyConfig>,
1267    {
1268        self.crypto_key_config = std::option::Option::Some(v.into());
1269        self
1270    }
1271
1272    /// Sets or clears the value of [crypto_key_config][crate::model::Instance::crypto_key_config].
1273    ///
1274    /// # Example
1275    /// ```ignore,no_run
1276    /// # use google_cloud_datafusion_v1::model::Instance;
1277    /// use google_cloud_datafusion_v1::model::CryptoKeyConfig;
1278    /// let x = Instance::new().set_or_clear_crypto_key_config(Some(CryptoKeyConfig::default()/* use setters */));
1279    /// let x = Instance::new().set_or_clear_crypto_key_config(None::<CryptoKeyConfig>);
1280    /// ```
1281    pub fn set_or_clear_crypto_key_config<T>(mut self, v: std::option::Option<T>) -> Self
1282    where
1283        T: std::convert::Into<crate::model::CryptoKeyConfig>,
1284    {
1285        self.crypto_key_config = v.map(|x| x.into());
1286        self
1287    }
1288
1289    /// Sets the value of [disabled_reason][crate::model::Instance::disabled_reason].
1290    ///
1291    /// # Example
1292    /// ```ignore,no_run
1293    /// # use google_cloud_datafusion_v1::model::Instance;
1294    /// use google_cloud_datafusion_v1::model::instance::DisabledReason;
1295    /// let x = Instance::new().set_disabled_reason([
1296    ///     DisabledReason::KmsKeyIssue,
1297    /// ]);
1298    /// ```
1299    pub fn set_disabled_reason<T, V>(mut self, v: T) -> Self
1300    where
1301        T: std::iter::IntoIterator<Item = V>,
1302        V: std::convert::Into<crate::model::instance::DisabledReason>,
1303    {
1304        use std::iter::Iterator;
1305        self.disabled_reason = v.into_iter().map(|i| i.into()).collect();
1306        self
1307    }
1308}
1309
1310impl wkt::message::Message for Instance {
1311    fn typename() -> &'static str {
1312        "type.googleapis.com/google.cloud.datafusion.v1.Instance"
1313    }
1314}
1315
1316/// Defines additional types related to [Instance].
1317pub mod instance {
1318    #[allow(unused_imports)]
1319    use super::*;
1320
1321    /// Represents the type of Data Fusion instance. Each type is configured with
1322    /// the default settings for processing and memory.
1323    ///
1324    /// # Working with unknown values
1325    ///
1326    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1327    /// additional enum variants at any time. Adding new variants is not considered
1328    /// a breaking change. Applications should write their code in anticipation of:
1329    ///
1330    /// - New values appearing in future releases of the client library, **and**
1331    /// - New values received dynamically, without application changes.
1332    ///
1333    /// Please consult the [Working with enums] section in the user guide for some
1334    /// guidelines.
1335    ///
1336    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1337    #[derive(Clone, Debug, PartialEq)]
1338    #[non_exhaustive]
1339    pub enum Type {
1340        /// No type specified. The instance creation will fail.
1341        Unspecified,
1342        /// Basic Data Fusion instance. In Basic type, the user will be able to
1343        /// create data pipelines using point and click UI. However, there are
1344        /// certain limitations, such as fewer number of concurrent pipelines, no
1345        /// support for streaming pipelines, etc.
1346        Basic,
1347        /// Enterprise Data Fusion instance. In Enterprise type, the user will have
1348        /// all features available, such as support for streaming pipelines, higher
1349        /// number of concurrent pipelines, etc.
1350        Enterprise,
1351        /// Developer Data Fusion instance. In Developer type, the user will have all
1352        /// features available but with restrictive capabilities. This is to help
1353        /// enterprises design and develop their data ingestion and integration
1354        /// pipelines at low cost.
1355        Developer,
1356        /// If set, the enum was initialized with an unknown value.
1357        ///
1358        /// Applications can examine the value using [Type::value] or
1359        /// [Type::name].
1360        UnknownValue(r#type::UnknownValue),
1361    }
1362
1363    #[doc(hidden)]
1364    pub mod r#type {
1365        #[allow(unused_imports)]
1366        use super::*;
1367        #[derive(Clone, Debug, PartialEq)]
1368        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1369    }
1370
1371    impl Type {
1372        /// Gets the enum value.
1373        ///
1374        /// Returns `None` if the enum contains an unknown value deserialized from
1375        /// the string representation of enums.
1376        pub fn value(&self) -> std::option::Option<i32> {
1377            match self {
1378                Self::Unspecified => std::option::Option::Some(0),
1379                Self::Basic => std::option::Option::Some(1),
1380                Self::Enterprise => std::option::Option::Some(2),
1381                Self::Developer => std::option::Option::Some(3),
1382                Self::UnknownValue(u) => u.0.value(),
1383            }
1384        }
1385
1386        /// Gets the enum value as a string.
1387        ///
1388        /// Returns `None` if the enum contains an unknown value deserialized from
1389        /// the integer representation of enums.
1390        pub fn name(&self) -> std::option::Option<&str> {
1391            match self {
1392                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
1393                Self::Basic => std::option::Option::Some("BASIC"),
1394                Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
1395                Self::Developer => std::option::Option::Some("DEVELOPER"),
1396                Self::UnknownValue(u) => u.0.name(),
1397            }
1398        }
1399    }
1400
1401    impl std::default::Default for Type {
1402        fn default() -> Self {
1403            use std::convert::From;
1404            Self::from(0)
1405        }
1406    }
1407
1408    impl std::fmt::Display for Type {
1409        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1410            wkt::internal::display_enum(f, self.name(), self.value())
1411        }
1412    }
1413
1414    impl std::convert::From<i32> for Type {
1415        fn from(value: i32) -> Self {
1416            match value {
1417                0 => Self::Unspecified,
1418                1 => Self::Basic,
1419                2 => Self::Enterprise,
1420                3 => Self::Developer,
1421                _ => Self::UnknownValue(r#type::UnknownValue(
1422                    wkt::internal::UnknownEnumValue::Integer(value),
1423                )),
1424            }
1425        }
1426    }
1427
1428    impl std::convert::From<&str> for Type {
1429        fn from(value: &str) -> Self {
1430            use std::string::ToString;
1431            match value {
1432                "TYPE_UNSPECIFIED" => Self::Unspecified,
1433                "BASIC" => Self::Basic,
1434                "ENTERPRISE" => Self::Enterprise,
1435                "DEVELOPER" => Self::Developer,
1436                _ => Self::UnknownValue(r#type::UnknownValue(
1437                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1438                )),
1439            }
1440        }
1441    }
1442
1443    impl serde::ser::Serialize for Type {
1444        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1445        where
1446            S: serde::Serializer,
1447        {
1448            match self {
1449                Self::Unspecified => serializer.serialize_i32(0),
1450                Self::Basic => serializer.serialize_i32(1),
1451                Self::Enterprise => serializer.serialize_i32(2),
1452                Self::Developer => serializer.serialize_i32(3),
1453                Self::UnknownValue(u) => u.0.serialize(serializer),
1454            }
1455        }
1456    }
1457
1458    impl<'de> serde::de::Deserialize<'de> for Type {
1459        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1460        where
1461            D: serde::Deserializer<'de>,
1462        {
1463            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
1464                ".google.cloud.datafusion.v1.Instance.Type",
1465            ))
1466        }
1467    }
1468
1469    /// Represents the state of a Data Fusion instance
1470    ///
1471    /// # Working with unknown values
1472    ///
1473    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1474    /// additional enum variants at any time. Adding new variants is not considered
1475    /// a breaking change. Applications should write their code in anticipation of:
1476    ///
1477    /// - New values appearing in future releases of the client library, **and**
1478    /// - New values received dynamically, without application changes.
1479    ///
1480    /// Please consult the [Working with enums] section in the user guide for some
1481    /// guidelines.
1482    ///
1483    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1484    #[derive(Clone, Debug, PartialEq)]
1485    #[non_exhaustive]
1486    pub enum State {
1487        /// Instance does not have a state yet
1488        Unspecified,
1489        /// Instance is being created
1490        Creating,
1491        /// Instance is active and ready for requests. This corresponds to 'RUNNING'
1492        /// in datafusion.v1beta1.
1493        Active,
1494        /// Instance creation failed
1495        Failed,
1496        /// Instance is being deleted
1497        Deleting,
1498        /// Instance is being upgraded
1499        Upgrading,
1500        /// Instance is being restarted
1501        Restarting,
1502        /// Instance is being updated on customer request
1503        Updating,
1504        /// Instance is being auto-updated
1505        AutoUpdating,
1506        /// Instance is being auto-upgraded
1507        AutoUpgrading,
1508        /// Instance is disabled
1509        Disabled,
1510        /// If set, the enum was initialized with an unknown value.
1511        ///
1512        /// Applications can examine the value using [State::value] or
1513        /// [State::name].
1514        UnknownValue(state::UnknownValue),
1515    }
1516
1517    #[doc(hidden)]
1518    pub mod state {
1519        #[allow(unused_imports)]
1520        use super::*;
1521        #[derive(Clone, Debug, PartialEq)]
1522        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1523    }
1524
1525    impl State {
1526        /// Gets the enum value.
1527        ///
1528        /// Returns `None` if the enum contains an unknown value deserialized from
1529        /// the string representation of enums.
1530        pub fn value(&self) -> std::option::Option<i32> {
1531            match self {
1532                Self::Unspecified => std::option::Option::Some(0),
1533                Self::Creating => std::option::Option::Some(1),
1534                Self::Active => std::option::Option::Some(2),
1535                Self::Failed => std::option::Option::Some(3),
1536                Self::Deleting => std::option::Option::Some(4),
1537                Self::Upgrading => std::option::Option::Some(5),
1538                Self::Restarting => std::option::Option::Some(6),
1539                Self::Updating => std::option::Option::Some(7),
1540                Self::AutoUpdating => std::option::Option::Some(8),
1541                Self::AutoUpgrading => std::option::Option::Some(9),
1542                Self::Disabled => std::option::Option::Some(10),
1543                Self::UnknownValue(u) => u.0.value(),
1544            }
1545        }
1546
1547        /// Gets the enum value as a string.
1548        ///
1549        /// Returns `None` if the enum contains an unknown value deserialized from
1550        /// the integer representation of enums.
1551        pub fn name(&self) -> std::option::Option<&str> {
1552            match self {
1553                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1554                Self::Creating => std::option::Option::Some("CREATING"),
1555                Self::Active => std::option::Option::Some("ACTIVE"),
1556                Self::Failed => std::option::Option::Some("FAILED"),
1557                Self::Deleting => std::option::Option::Some("DELETING"),
1558                Self::Upgrading => std::option::Option::Some("UPGRADING"),
1559                Self::Restarting => std::option::Option::Some("RESTARTING"),
1560                Self::Updating => std::option::Option::Some("UPDATING"),
1561                Self::AutoUpdating => std::option::Option::Some("AUTO_UPDATING"),
1562                Self::AutoUpgrading => std::option::Option::Some("AUTO_UPGRADING"),
1563                Self::Disabled => std::option::Option::Some("DISABLED"),
1564                Self::UnknownValue(u) => u.0.name(),
1565            }
1566        }
1567    }
1568
1569    impl std::default::Default for State {
1570        fn default() -> Self {
1571            use std::convert::From;
1572            Self::from(0)
1573        }
1574    }
1575
1576    impl std::fmt::Display for State {
1577        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1578            wkt::internal::display_enum(f, self.name(), self.value())
1579        }
1580    }
1581
1582    impl std::convert::From<i32> for State {
1583        fn from(value: i32) -> Self {
1584            match value {
1585                0 => Self::Unspecified,
1586                1 => Self::Creating,
1587                2 => Self::Active,
1588                3 => Self::Failed,
1589                4 => Self::Deleting,
1590                5 => Self::Upgrading,
1591                6 => Self::Restarting,
1592                7 => Self::Updating,
1593                8 => Self::AutoUpdating,
1594                9 => Self::AutoUpgrading,
1595                10 => Self::Disabled,
1596                _ => Self::UnknownValue(state::UnknownValue(
1597                    wkt::internal::UnknownEnumValue::Integer(value),
1598                )),
1599            }
1600        }
1601    }
1602
1603    impl std::convert::From<&str> for State {
1604        fn from(value: &str) -> Self {
1605            use std::string::ToString;
1606            match value {
1607                "STATE_UNSPECIFIED" => Self::Unspecified,
1608                "CREATING" => Self::Creating,
1609                "ACTIVE" => Self::Active,
1610                "FAILED" => Self::Failed,
1611                "DELETING" => Self::Deleting,
1612                "UPGRADING" => Self::Upgrading,
1613                "RESTARTING" => Self::Restarting,
1614                "UPDATING" => Self::Updating,
1615                "AUTO_UPDATING" => Self::AutoUpdating,
1616                "AUTO_UPGRADING" => Self::AutoUpgrading,
1617                "DISABLED" => Self::Disabled,
1618                _ => Self::UnknownValue(state::UnknownValue(
1619                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1620                )),
1621            }
1622        }
1623    }
1624
1625    impl serde::ser::Serialize for State {
1626        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1627        where
1628            S: serde::Serializer,
1629        {
1630            match self {
1631                Self::Unspecified => serializer.serialize_i32(0),
1632                Self::Creating => serializer.serialize_i32(1),
1633                Self::Active => serializer.serialize_i32(2),
1634                Self::Failed => serializer.serialize_i32(3),
1635                Self::Deleting => serializer.serialize_i32(4),
1636                Self::Upgrading => serializer.serialize_i32(5),
1637                Self::Restarting => serializer.serialize_i32(6),
1638                Self::Updating => serializer.serialize_i32(7),
1639                Self::AutoUpdating => serializer.serialize_i32(8),
1640                Self::AutoUpgrading => serializer.serialize_i32(9),
1641                Self::Disabled => serializer.serialize_i32(10),
1642                Self::UnknownValue(u) => u.0.serialize(serializer),
1643            }
1644        }
1645    }
1646
1647    impl<'de> serde::de::Deserialize<'de> for State {
1648        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1649        where
1650            D: serde::Deserializer<'de>,
1651        {
1652            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1653                ".google.cloud.datafusion.v1.Instance.State",
1654            ))
1655        }
1656    }
1657
1658    /// The reason for disabling the instance if the state is DISABLED.
1659    ///
1660    /// # Working with unknown values
1661    ///
1662    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1663    /// additional enum variants at any time. Adding new variants is not considered
1664    /// a breaking change. Applications should write their code in anticipation of:
1665    ///
1666    /// - New values appearing in future releases of the client library, **and**
1667    /// - New values received dynamically, without application changes.
1668    ///
1669    /// Please consult the [Working with enums] section in the user guide for some
1670    /// guidelines.
1671    ///
1672    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1673    #[derive(Clone, Debug, PartialEq)]
1674    #[non_exhaustive]
1675    pub enum DisabledReason {
1676        /// This is an unknown reason for disabling.
1677        Unspecified,
1678        /// The KMS key used by the instance is either revoked or denied access to
1679        KmsKeyIssue,
1680        /// If set, the enum was initialized with an unknown value.
1681        ///
1682        /// Applications can examine the value using [DisabledReason::value] or
1683        /// [DisabledReason::name].
1684        UnknownValue(disabled_reason::UnknownValue),
1685    }
1686
1687    #[doc(hidden)]
1688    pub mod disabled_reason {
1689        #[allow(unused_imports)]
1690        use super::*;
1691        #[derive(Clone, Debug, PartialEq)]
1692        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1693    }
1694
1695    impl DisabledReason {
1696        /// Gets the enum value.
1697        ///
1698        /// Returns `None` if the enum contains an unknown value deserialized from
1699        /// the string representation of enums.
1700        pub fn value(&self) -> std::option::Option<i32> {
1701            match self {
1702                Self::Unspecified => std::option::Option::Some(0),
1703                Self::KmsKeyIssue => std::option::Option::Some(1),
1704                Self::UnknownValue(u) => u.0.value(),
1705            }
1706        }
1707
1708        /// Gets the enum value as a string.
1709        ///
1710        /// Returns `None` if the enum contains an unknown value deserialized from
1711        /// the integer representation of enums.
1712        pub fn name(&self) -> std::option::Option<&str> {
1713            match self {
1714                Self::Unspecified => std::option::Option::Some("DISABLED_REASON_UNSPECIFIED"),
1715                Self::KmsKeyIssue => std::option::Option::Some("KMS_KEY_ISSUE"),
1716                Self::UnknownValue(u) => u.0.name(),
1717            }
1718        }
1719    }
1720
1721    impl std::default::Default for DisabledReason {
1722        fn default() -> Self {
1723            use std::convert::From;
1724            Self::from(0)
1725        }
1726    }
1727
1728    impl std::fmt::Display for DisabledReason {
1729        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1730            wkt::internal::display_enum(f, self.name(), self.value())
1731        }
1732    }
1733
1734    impl std::convert::From<i32> for DisabledReason {
1735        fn from(value: i32) -> Self {
1736            match value {
1737                0 => Self::Unspecified,
1738                1 => Self::KmsKeyIssue,
1739                _ => Self::UnknownValue(disabled_reason::UnknownValue(
1740                    wkt::internal::UnknownEnumValue::Integer(value),
1741                )),
1742            }
1743        }
1744    }
1745
1746    impl std::convert::From<&str> for DisabledReason {
1747        fn from(value: &str) -> Self {
1748            use std::string::ToString;
1749            match value {
1750                "DISABLED_REASON_UNSPECIFIED" => Self::Unspecified,
1751                "KMS_KEY_ISSUE" => Self::KmsKeyIssue,
1752                _ => Self::UnknownValue(disabled_reason::UnknownValue(
1753                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1754                )),
1755            }
1756        }
1757    }
1758
1759    impl serde::ser::Serialize for DisabledReason {
1760        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1761        where
1762            S: serde::Serializer,
1763        {
1764            match self {
1765                Self::Unspecified => serializer.serialize_i32(0),
1766                Self::KmsKeyIssue => serializer.serialize_i32(1),
1767                Self::UnknownValue(u) => u.0.serialize(serializer),
1768            }
1769        }
1770    }
1771
1772    impl<'de> serde::de::Deserialize<'de> for DisabledReason {
1773        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1774        where
1775            D: serde::Deserializer<'de>,
1776        {
1777            deserializer.deserialize_any(wkt::internal::EnumVisitor::<DisabledReason>::new(
1778                ".google.cloud.datafusion.v1.Instance.DisabledReason",
1779            ))
1780        }
1781    }
1782}
1783
1784/// Request message for listing Data Fusion instances.
1785#[derive(Clone, Default, PartialEq)]
1786#[non_exhaustive]
1787pub struct ListInstancesRequest {
1788    /// Required. The project and location for which to retrieve instance information
1789    /// in the format projects/{project}/locations/{location}. If the location is
1790    /// specified as '-' (wildcard), then all regions available to the project
1791    /// are queried, and the results are aggregated.
1792    pub parent: std::string::String,
1793
1794    /// The maximum number of items to return.
1795    pub page_size: i32,
1796
1797    /// The next_page_token value to use if there are additional
1798    /// results to retrieve for this list request.
1799    pub page_token: std::string::String,
1800
1801    /// List filter.
1802    pub filter: std::string::String,
1803
1804    /// Sort results. Supported values are "name", "name desc",  or "" (unsorted).
1805    pub order_by: std::string::String,
1806
1807    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1808}
1809
1810impl ListInstancesRequest {
1811    pub fn new() -> Self {
1812        std::default::Default::default()
1813    }
1814
1815    /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
1816    ///
1817    /// # Example
1818    /// ```ignore,no_run
1819    /// # use google_cloud_datafusion_v1::model::ListInstancesRequest;
1820    /// let x = ListInstancesRequest::new().set_parent("example");
1821    /// ```
1822    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1823        self.parent = v.into();
1824        self
1825    }
1826
1827    /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
1828    ///
1829    /// # Example
1830    /// ```ignore,no_run
1831    /// # use google_cloud_datafusion_v1::model::ListInstancesRequest;
1832    /// let x = ListInstancesRequest::new().set_page_size(42);
1833    /// ```
1834    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1835        self.page_size = v.into();
1836        self
1837    }
1838
1839    /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
1840    ///
1841    /// # Example
1842    /// ```ignore,no_run
1843    /// # use google_cloud_datafusion_v1::model::ListInstancesRequest;
1844    /// let x = ListInstancesRequest::new().set_page_token("example");
1845    /// ```
1846    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1847        self.page_token = v.into();
1848        self
1849    }
1850
1851    /// Sets the value of [filter][crate::model::ListInstancesRequest::filter].
1852    ///
1853    /// # Example
1854    /// ```ignore,no_run
1855    /// # use google_cloud_datafusion_v1::model::ListInstancesRequest;
1856    /// let x = ListInstancesRequest::new().set_filter("example");
1857    /// ```
1858    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1859        self.filter = v.into();
1860        self
1861    }
1862
1863    /// Sets the value of [order_by][crate::model::ListInstancesRequest::order_by].
1864    ///
1865    /// # Example
1866    /// ```ignore,no_run
1867    /// # use google_cloud_datafusion_v1::model::ListInstancesRequest;
1868    /// let x = ListInstancesRequest::new().set_order_by("example");
1869    /// ```
1870    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1871        self.order_by = v.into();
1872        self
1873    }
1874}
1875
1876impl wkt::message::Message for ListInstancesRequest {
1877    fn typename() -> &'static str {
1878        "type.googleapis.com/google.cloud.datafusion.v1.ListInstancesRequest"
1879    }
1880}
1881
1882/// Response message for the list instance request.
1883#[derive(Clone, Default, PartialEq)]
1884#[non_exhaustive]
1885pub struct ListInstancesResponse {
1886    /// Represents a list of Data Fusion instances.
1887    pub instances: std::vec::Vec<crate::model::Instance>,
1888
1889    /// Token to retrieve the next page of results or empty if there are no more
1890    /// results in the list.
1891    pub next_page_token: std::string::String,
1892
1893    /// Locations that could not be reached.
1894    pub unreachable: std::vec::Vec<std::string::String>,
1895
1896    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1897}
1898
1899impl ListInstancesResponse {
1900    pub fn new() -> Self {
1901        std::default::Default::default()
1902    }
1903
1904    /// Sets the value of [instances][crate::model::ListInstancesResponse::instances].
1905    ///
1906    /// # Example
1907    /// ```ignore,no_run
1908    /// # use google_cloud_datafusion_v1::model::ListInstancesResponse;
1909    /// use google_cloud_datafusion_v1::model::Instance;
1910    /// let x = ListInstancesResponse::new()
1911    ///     .set_instances([
1912    ///         Instance::default()/* use setters */,
1913    ///         Instance::default()/* use (different) setters */,
1914    ///     ]);
1915    /// ```
1916    pub fn set_instances<T, V>(mut self, v: T) -> Self
1917    where
1918        T: std::iter::IntoIterator<Item = V>,
1919        V: std::convert::Into<crate::model::Instance>,
1920    {
1921        use std::iter::Iterator;
1922        self.instances = v.into_iter().map(|i| i.into()).collect();
1923        self
1924    }
1925
1926    /// Sets the value of [next_page_token][crate::model::ListInstancesResponse::next_page_token].
1927    ///
1928    /// # Example
1929    /// ```ignore,no_run
1930    /// # use google_cloud_datafusion_v1::model::ListInstancesResponse;
1931    /// let x = ListInstancesResponse::new().set_next_page_token("example");
1932    /// ```
1933    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1934        self.next_page_token = v.into();
1935        self
1936    }
1937
1938    /// Sets the value of [unreachable][crate::model::ListInstancesResponse::unreachable].
1939    ///
1940    /// # Example
1941    /// ```ignore,no_run
1942    /// # use google_cloud_datafusion_v1::model::ListInstancesResponse;
1943    /// let x = ListInstancesResponse::new().set_unreachable(["a", "b", "c"]);
1944    /// ```
1945    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1946    where
1947        T: std::iter::IntoIterator<Item = V>,
1948        V: std::convert::Into<std::string::String>,
1949    {
1950        use std::iter::Iterator;
1951        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1952        self
1953    }
1954}
1955
1956impl wkt::message::Message for ListInstancesResponse {
1957    fn typename() -> &'static str {
1958        "type.googleapis.com/google.cloud.datafusion.v1.ListInstancesResponse"
1959    }
1960}
1961
1962#[doc(hidden)]
1963impl gax::paginator::internal::PageableResponse for ListInstancesResponse {
1964    type PageItem = crate::model::Instance;
1965
1966    fn items(self) -> std::vec::Vec<Self::PageItem> {
1967        self.instances
1968    }
1969
1970    fn next_page_token(&self) -> std::string::String {
1971        use std::clone::Clone;
1972        self.next_page_token.clone()
1973    }
1974}
1975
1976/// Request message for the list available versions request.
1977#[derive(Clone, Default, PartialEq)]
1978#[non_exhaustive]
1979pub struct ListAvailableVersionsRequest {
1980    /// Required. The project and location for which to retrieve instance information
1981    /// in the format projects/{project}/locations/{location}.
1982    pub parent: std::string::String,
1983
1984    /// The maximum number of items to return.
1985    pub page_size: i32,
1986
1987    /// The next_page_token value to use if there are additional
1988    /// results to retrieve for this list request.
1989    pub page_token: std::string::String,
1990
1991    /// Whether or not to return the latest patch of every available minor version.
1992    /// If true, only the latest patch will be returned. Ex. if allowed versions is
1993    /// [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0]
1994    pub latest_patch_only: bool,
1995
1996    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1997}
1998
1999impl ListAvailableVersionsRequest {
2000    pub fn new() -> Self {
2001        std::default::Default::default()
2002    }
2003
2004    /// Sets the value of [parent][crate::model::ListAvailableVersionsRequest::parent].
2005    ///
2006    /// # Example
2007    /// ```ignore,no_run
2008    /// # use google_cloud_datafusion_v1::model::ListAvailableVersionsRequest;
2009    /// let x = ListAvailableVersionsRequest::new().set_parent("example");
2010    /// ```
2011    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2012        self.parent = v.into();
2013        self
2014    }
2015
2016    /// Sets the value of [page_size][crate::model::ListAvailableVersionsRequest::page_size].
2017    ///
2018    /// # Example
2019    /// ```ignore,no_run
2020    /// # use google_cloud_datafusion_v1::model::ListAvailableVersionsRequest;
2021    /// let x = ListAvailableVersionsRequest::new().set_page_size(42);
2022    /// ```
2023    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2024        self.page_size = v.into();
2025        self
2026    }
2027
2028    /// Sets the value of [page_token][crate::model::ListAvailableVersionsRequest::page_token].
2029    ///
2030    /// # Example
2031    /// ```ignore,no_run
2032    /// # use google_cloud_datafusion_v1::model::ListAvailableVersionsRequest;
2033    /// let x = ListAvailableVersionsRequest::new().set_page_token("example");
2034    /// ```
2035    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2036        self.page_token = v.into();
2037        self
2038    }
2039
2040    /// Sets the value of [latest_patch_only][crate::model::ListAvailableVersionsRequest::latest_patch_only].
2041    ///
2042    /// # Example
2043    /// ```ignore,no_run
2044    /// # use google_cloud_datafusion_v1::model::ListAvailableVersionsRequest;
2045    /// let x = ListAvailableVersionsRequest::new().set_latest_patch_only(true);
2046    /// ```
2047    pub fn set_latest_patch_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2048        self.latest_patch_only = v.into();
2049        self
2050    }
2051}
2052
2053impl wkt::message::Message for ListAvailableVersionsRequest {
2054    fn typename() -> &'static str {
2055        "type.googleapis.com/google.cloud.datafusion.v1.ListAvailableVersionsRequest"
2056    }
2057}
2058
2059/// Response message for the list available versions request.
2060#[derive(Clone, Default, PartialEq)]
2061#[non_exhaustive]
2062pub struct ListAvailableVersionsResponse {
2063    /// Represents a list of versions that are supported.
2064    pub available_versions: std::vec::Vec<crate::model::Version>,
2065
2066    /// Token to retrieve the next page of results or empty if there are no more
2067    /// results in the list.
2068    pub next_page_token: std::string::String,
2069
2070    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2071}
2072
2073impl ListAvailableVersionsResponse {
2074    pub fn new() -> Self {
2075        std::default::Default::default()
2076    }
2077
2078    /// Sets the value of [available_versions][crate::model::ListAvailableVersionsResponse::available_versions].
2079    ///
2080    /// # Example
2081    /// ```ignore,no_run
2082    /// # use google_cloud_datafusion_v1::model::ListAvailableVersionsResponse;
2083    /// use google_cloud_datafusion_v1::model::Version;
2084    /// let x = ListAvailableVersionsResponse::new()
2085    ///     .set_available_versions([
2086    ///         Version::default()/* use setters */,
2087    ///         Version::default()/* use (different) setters */,
2088    ///     ]);
2089    /// ```
2090    pub fn set_available_versions<T, V>(mut self, v: T) -> Self
2091    where
2092        T: std::iter::IntoIterator<Item = V>,
2093        V: std::convert::Into<crate::model::Version>,
2094    {
2095        use std::iter::Iterator;
2096        self.available_versions = v.into_iter().map(|i| i.into()).collect();
2097        self
2098    }
2099
2100    /// Sets the value of [next_page_token][crate::model::ListAvailableVersionsResponse::next_page_token].
2101    ///
2102    /// # Example
2103    /// ```ignore,no_run
2104    /// # use google_cloud_datafusion_v1::model::ListAvailableVersionsResponse;
2105    /// let x = ListAvailableVersionsResponse::new().set_next_page_token("example");
2106    /// ```
2107    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2108        self.next_page_token = v.into();
2109        self
2110    }
2111}
2112
2113impl wkt::message::Message for ListAvailableVersionsResponse {
2114    fn typename() -> &'static str {
2115        "type.googleapis.com/google.cloud.datafusion.v1.ListAvailableVersionsResponse"
2116    }
2117}
2118
2119#[doc(hidden)]
2120impl gax::paginator::internal::PageableResponse for ListAvailableVersionsResponse {
2121    type PageItem = crate::model::Version;
2122
2123    fn items(self) -> std::vec::Vec<Self::PageItem> {
2124        self.available_versions
2125    }
2126
2127    fn next_page_token(&self) -> std::string::String {
2128        use std::clone::Clone;
2129        self.next_page_token.clone()
2130    }
2131}
2132
2133/// Request message for getting details about a Data Fusion instance.
2134#[derive(Clone, Default, PartialEq)]
2135#[non_exhaustive]
2136pub struct GetInstanceRequest {
2137    /// Required. The instance resource name in the format
2138    /// projects/{project}/locations/{location}/instances/{instance}.
2139    pub name: std::string::String,
2140
2141    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2142}
2143
2144impl GetInstanceRequest {
2145    pub fn new() -> Self {
2146        std::default::Default::default()
2147    }
2148
2149    /// Sets the value of [name][crate::model::GetInstanceRequest::name].
2150    ///
2151    /// # Example
2152    /// ```ignore,no_run
2153    /// # use google_cloud_datafusion_v1::model::GetInstanceRequest;
2154    /// let x = GetInstanceRequest::new().set_name("example");
2155    /// ```
2156    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2157        self.name = v.into();
2158        self
2159    }
2160}
2161
2162impl wkt::message::Message for GetInstanceRequest {
2163    fn typename() -> &'static str {
2164        "type.googleapis.com/google.cloud.datafusion.v1.GetInstanceRequest"
2165    }
2166}
2167
2168/// Request message for creating a Data Fusion instance.
2169#[derive(Clone, Default, PartialEq)]
2170#[non_exhaustive]
2171pub struct CreateInstanceRequest {
2172    /// Required. The instance's project and location in the format
2173    /// projects/{project}/locations/{location}.
2174    pub parent: std::string::String,
2175
2176    /// Required. The name of the instance to create.
2177    pub instance_id: std::string::String,
2178
2179    /// An instance resource.
2180    pub instance: std::option::Option<crate::model::Instance>,
2181
2182    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2183}
2184
2185impl CreateInstanceRequest {
2186    pub fn new() -> Self {
2187        std::default::Default::default()
2188    }
2189
2190    /// Sets the value of [parent][crate::model::CreateInstanceRequest::parent].
2191    ///
2192    /// # Example
2193    /// ```ignore,no_run
2194    /// # use google_cloud_datafusion_v1::model::CreateInstanceRequest;
2195    /// let x = CreateInstanceRequest::new().set_parent("example");
2196    /// ```
2197    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2198        self.parent = v.into();
2199        self
2200    }
2201
2202    /// Sets the value of [instance_id][crate::model::CreateInstanceRequest::instance_id].
2203    ///
2204    /// # Example
2205    /// ```ignore,no_run
2206    /// # use google_cloud_datafusion_v1::model::CreateInstanceRequest;
2207    /// let x = CreateInstanceRequest::new().set_instance_id("example");
2208    /// ```
2209    pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2210        self.instance_id = v.into();
2211        self
2212    }
2213
2214    /// Sets the value of [instance][crate::model::CreateInstanceRequest::instance].
2215    ///
2216    /// # Example
2217    /// ```ignore,no_run
2218    /// # use google_cloud_datafusion_v1::model::CreateInstanceRequest;
2219    /// use google_cloud_datafusion_v1::model::Instance;
2220    /// let x = CreateInstanceRequest::new().set_instance(Instance::default()/* use setters */);
2221    /// ```
2222    pub fn set_instance<T>(mut self, v: T) -> Self
2223    where
2224        T: std::convert::Into<crate::model::Instance>,
2225    {
2226        self.instance = std::option::Option::Some(v.into());
2227        self
2228    }
2229
2230    /// Sets or clears the value of [instance][crate::model::CreateInstanceRequest::instance].
2231    ///
2232    /// # Example
2233    /// ```ignore,no_run
2234    /// # use google_cloud_datafusion_v1::model::CreateInstanceRequest;
2235    /// use google_cloud_datafusion_v1::model::Instance;
2236    /// let x = CreateInstanceRequest::new().set_or_clear_instance(Some(Instance::default()/* use setters */));
2237    /// let x = CreateInstanceRequest::new().set_or_clear_instance(None::<Instance>);
2238    /// ```
2239    pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
2240    where
2241        T: std::convert::Into<crate::model::Instance>,
2242    {
2243        self.instance = v.map(|x| x.into());
2244        self
2245    }
2246}
2247
2248impl wkt::message::Message for CreateInstanceRequest {
2249    fn typename() -> &'static str {
2250        "type.googleapis.com/google.cloud.datafusion.v1.CreateInstanceRequest"
2251    }
2252}
2253
2254/// Request message for deleting a Data Fusion instance.
2255#[derive(Clone, Default, PartialEq)]
2256#[non_exhaustive]
2257pub struct DeleteInstanceRequest {
2258    /// Required. The instance resource name in the format
2259    /// projects/{project}/locations/{location}/instances/{instance}
2260    pub name: std::string::String,
2261
2262    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2263}
2264
2265impl DeleteInstanceRequest {
2266    pub fn new() -> Self {
2267        std::default::Default::default()
2268    }
2269
2270    /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
2271    ///
2272    /// # Example
2273    /// ```ignore,no_run
2274    /// # use google_cloud_datafusion_v1::model::DeleteInstanceRequest;
2275    /// let x = DeleteInstanceRequest::new().set_name("example");
2276    /// ```
2277    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2278        self.name = v.into();
2279        self
2280    }
2281}
2282
2283impl wkt::message::Message for DeleteInstanceRequest {
2284    fn typename() -> &'static str {
2285        "type.googleapis.com/google.cloud.datafusion.v1.DeleteInstanceRequest"
2286    }
2287}
2288
2289/// Request message for updating a Data Fusion instance.
2290/// Data Fusion allows updating the labels, options, and stack driver settings.
2291/// This is also used for CDF version upgrade.
2292#[derive(Clone, Default, PartialEq)]
2293#[non_exhaustive]
2294pub struct UpdateInstanceRequest {
2295    /// Required. The instance resource that replaces the resource on the server. Currently,
2296    /// Data Fusion only allows replacing labels, options, and stack driver
2297    /// settings. All other fields will be ignored.
2298    pub instance: std::option::Option<crate::model::Instance>,
2299
2300    /// Field mask is used to specify the fields that the update will overwrite
2301    /// in an instance resource. The fields specified in the update_mask are
2302    /// relative to the resource, not the full request.
2303    /// A field will be overwritten if it is in the mask.
2304    /// If the user does not provide a mask, all the supported fields (labels,
2305    /// options, and version currently) will be overwritten.
2306    pub update_mask: std::option::Option<wkt::FieldMask>,
2307
2308    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2309}
2310
2311impl UpdateInstanceRequest {
2312    pub fn new() -> Self {
2313        std::default::Default::default()
2314    }
2315
2316    /// Sets the value of [instance][crate::model::UpdateInstanceRequest::instance].
2317    ///
2318    /// # Example
2319    /// ```ignore,no_run
2320    /// # use google_cloud_datafusion_v1::model::UpdateInstanceRequest;
2321    /// use google_cloud_datafusion_v1::model::Instance;
2322    /// let x = UpdateInstanceRequest::new().set_instance(Instance::default()/* use setters */);
2323    /// ```
2324    pub fn set_instance<T>(mut self, v: T) -> Self
2325    where
2326        T: std::convert::Into<crate::model::Instance>,
2327    {
2328        self.instance = std::option::Option::Some(v.into());
2329        self
2330    }
2331
2332    /// Sets or clears the value of [instance][crate::model::UpdateInstanceRequest::instance].
2333    ///
2334    /// # Example
2335    /// ```ignore,no_run
2336    /// # use google_cloud_datafusion_v1::model::UpdateInstanceRequest;
2337    /// use google_cloud_datafusion_v1::model::Instance;
2338    /// let x = UpdateInstanceRequest::new().set_or_clear_instance(Some(Instance::default()/* use setters */));
2339    /// let x = UpdateInstanceRequest::new().set_or_clear_instance(None::<Instance>);
2340    /// ```
2341    pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
2342    where
2343        T: std::convert::Into<crate::model::Instance>,
2344    {
2345        self.instance = v.map(|x| x.into());
2346        self
2347    }
2348
2349    /// Sets the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
2350    ///
2351    /// # Example
2352    /// ```ignore,no_run
2353    /// # use google_cloud_datafusion_v1::model::UpdateInstanceRequest;
2354    /// use wkt::FieldMask;
2355    /// let x = UpdateInstanceRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2356    /// ```
2357    pub fn set_update_mask<T>(mut self, v: T) -> Self
2358    where
2359        T: std::convert::Into<wkt::FieldMask>,
2360    {
2361        self.update_mask = std::option::Option::Some(v.into());
2362        self
2363    }
2364
2365    /// Sets or clears the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
2366    ///
2367    /// # Example
2368    /// ```ignore,no_run
2369    /// # use google_cloud_datafusion_v1::model::UpdateInstanceRequest;
2370    /// use wkt::FieldMask;
2371    /// let x = UpdateInstanceRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2372    /// let x = UpdateInstanceRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2373    /// ```
2374    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2375    where
2376        T: std::convert::Into<wkt::FieldMask>,
2377    {
2378        self.update_mask = v.map(|x| x.into());
2379        self
2380    }
2381}
2382
2383impl wkt::message::Message for UpdateInstanceRequest {
2384    fn typename() -> &'static str {
2385        "type.googleapis.com/google.cloud.datafusion.v1.UpdateInstanceRequest"
2386    }
2387}
2388
2389/// Request message for restarting a Data Fusion instance.
2390#[derive(Clone, Default, PartialEq)]
2391#[non_exhaustive]
2392pub struct RestartInstanceRequest {
2393    /// Required. Name of the Data Fusion instance which need to be restarted in the form of
2394    /// projects/{project}/locations/{location}/instances/{instance}
2395    pub name: std::string::String,
2396
2397    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2398}
2399
2400impl RestartInstanceRequest {
2401    pub fn new() -> Self {
2402        std::default::Default::default()
2403    }
2404
2405    /// Sets the value of [name][crate::model::RestartInstanceRequest::name].
2406    ///
2407    /// # Example
2408    /// ```ignore,no_run
2409    /// # use google_cloud_datafusion_v1::model::RestartInstanceRequest;
2410    /// let x = RestartInstanceRequest::new().set_name("example");
2411    /// ```
2412    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2413        self.name = v.into();
2414        self
2415    }
2416}
2417
2418impl wkt::message::Message for RestartInstanceRequest {
2419    fn typename() -> &'static str {
2420        "type.googleapis.com/google.cloud.datafusion.v1.RestartInstanceRequest"
2421    }
2422}
2423
2424/// Represents the metadata of a long-running operation.
2425#[derive(Clone, Default, PartialEq)]
2426#[non_exhaustive]
2427pub struct OperationMetadata {
2428    /// The time the operation was created.
2429    pub create_time: std::option::Option<wkt::Timestamp>,
2430
2431    /// The time the operation finished running.
2432    pub end_time: std::option::Option<wkt::Timestamp>,
2433
2434    /// Server-defined resource path for the target of the operation.
2435    pub target: std::string::String,
2436
2437    /// Name of the verb executed by the operation.
2438    pub verb: std::string::String,
2439
2440    /// Human-readable status of the operation if any.
2441    pub status_detail: std::string::String,
2442
2443    /// Identifies whether the user has requested cancellation
2444    /// of the operation. Operations that have successfully been cancelled
2445    /// have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
2446    /// corresponding to `Code.CANCELLED`.
2447    ///
2448    /// [google.rpc.Status.code]: rpc::model::Status::code
2449    pub requested_cancellation: bool,
2450
2451    /// API version used to start the operation.
2452    pub api_version: std::string::String,
2453
2454    /// Map to hold any additional status info for the operation
2455    /// If there is an accelerator being enabled/disabled/deleted, this will be
2456    /// populated with accelerator name as key and status as
2457    /// ENABLING, DISABLING or DELETING
2458    pub additional_status: std::collections::HashMap<std::string::String, std::string::String>,
2459
2460    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2461}
2462
2463impl OperationMetadata {
2464    pub fn new() -> Self {
2465        std::default::Default::default()
2466    }
2467
2468    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
2469    ///
2470    /// # Example
2471    /// ```ignore,no_run
2472    /// # use google_cloud_datafusion_v1::model::OperationMetadata;
2473    /// use wkt::Timestamp;
2474    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
2475    /// ```
2476    pub fn set_create_time<T>(mut self, v: T) -> Self
2477    where
2478        T: std::convert::Into<wkt::Timestamp>,
2479    {
2480        self.create_time = std::option::Option::Some(v.into());
2481        self
2482    }
2483
2484    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
2485    ///
2486    /// # Example
2487    /// ```ignore,no_run
2488    /// # use google_cloud_datafusion_v1::model::OperationMetadata;
2489    /// use wkt::Timestamp;
2490    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2491    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
2492    /// ```
2493    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2494    where
2495        T: std::convert::Into<wkt::Timestamp>,
2496    {
2497        self.create_time = v.map(|x| x.into());
2498        self
2499    }
2500
2501    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
2502    ///
2503    /// # Example
2504    /// ```ignore,no_run
2505    /// # use google_cloud_datafusion_v1::model::OperationMetadata;
2506    /// use wkt::Timestamp;
2507    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
2508    /// ```
2509    pub fn set_end_time<T>(mut self, v: T) -> Self
2510    where
2511        T: std::convert::Into<wkt::Timestamp>,
2512    {
2513        self.end_time = std::option::Option::Some(v.into());
2514        self
2515    }
2516
2517    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
2518    ///
2519    /// # Example
2520    /// ```ignore,no_run
2521    /// # use google_cloud_datafusion_v1::model::OperationMetadata;
2522    /// use wkt::Timestamp;
2523    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2524    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
2525    /// ```
2526    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2527    where
2528        T: std::convert::Into<wkt::Timestamp>,
2529    {
2530        self.end_time = v.map(|x| x.into());
2531        self
2532    }
2533
2534    /// Sets the value of [target][crate::model::OperationMetadata::target].
2535    ///
2536    /// # Example
2537    /// ```ignore,no_run
2538    /// # use google_cloud_datafusion_v1::model::OperationMetadata;
2539    /// let x = OperationMetadata::new().set_target("example");
2540    /// ```
2541    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2542        self.target = v.into();
2543        self
2544    }
2545
2546    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
2547    ///
2548    /// # Example
2549    /// ```ignore,no_run
2550    /// # use google_cloud_datafusion_v1::model::OperationMetadata;
2551    /// let x = OperationMetadata::new().set_verb("example");
2552    /// ```
2553    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2554        self.verb = v.into();
2555        self
2556    }
2557
2558    /// Sets the value of [status_detail][crate::model::OperationMetadata::status_detail].
2559    ///
2560    /// # Example
2561    /// ```ignore,no_run
2562    /// # use google_cloud_datafusion_v1::model::OperationMetadata;
2563    /// let x = OperationMetadata::new().set_status_detail("example");
2564    /// ```
2565    pub fn set_status_detail<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2566        self.status_detail = v.into();
2567        self
2568    }
2569
2570    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
2571    ///
2572    /// # Example
2573    /// ```ignore,no_run
2574    /// # use google_cloud_datafusion_v1::model::OperationMetadata;
2575    /// let x = OperationMetadata::new().set_requested_cancellation(true);
2576    /// ```
2577    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2578        self.requested_cancellation = v.into();
2579        self
2580    }
2581
2582    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
2583    ///
2584    /// # Example
2585    /// ```ignore,no_run
2586    /// # use google_cloud_datafusion_v1::model::OperationMetadata;
2587    /// let x = OperationMetadata::new().set_api_version("example");
2588    /// ```
2589    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2590        self.api_version = v.into();
2591        self
2592    }
2593
2594    /// Sets the value of [additional_status][crate::model::OperationMetadata::additional_status].
2595    ///
2596    /// # Example
2597    /// ```ignore,no_run
2598    /// # use google_cloud_datafusion_v1::model::OperationMetadata;
2599    /// let x = OperationMetadata::new().set_additional_status([
2600    ///     ("key0", "abc"),
2601    ///     ("key1", "xyz"),
2602    /// ]);
2603    /// ```
2604    pub fn set_additional_status<T, K, V>(mut self, v: T) -> Self
2605    where
2606        T: std::iter::IntoIterator<Item = (K, V)>,
2607        K: std::convert::Into<std::string::String>,
2608        V: std::convert::Into<std::string::String>,
2609    {
2610        use std::iter::Iterator;
2611        self.additional_status = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2612        self
2613    }
2614}
2615
2616impl wkt::message::Message for OperationMetadata {
2617    fn typename() -> &'static str {
2618        "type.googleapis.com/google.cloud.datafusion.v1.OperationMetadata"
2619    }
2620}