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