Skip to main content

google_cloud_datafusion_v1/
model.rs

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