Skip to main content

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