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