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