Skip to main content

google_cloud_parallelstore_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_location;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate google_cloud_rpc;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// A Parallelstore instance.
40#[derive(Clone, Default, PartialEq)]
41#[non_exhaustive]
42pub struct Instance {
43    /// Identifier. The resource name of the instance, in the format
44    /// `projects/{project}/locations/{location}/instances/{instance_id}`.
45    pub name: std::string::String,
46
47    /// Optional. The description of the instance. 2048 characters or less.
48    pub description: std::string::String,
49
50    /// Output only. The instance state.
51    pub state: crate::model::instance::State,
52
53    /// Output only. The time when the instance was created.
54    pub create_time: std::option::Option<wkt::Timestamp>,
55
56    /// Output only. The time when the instance was updated.
57    pub update_time: std::option::Option<wkt::Timestamp>,
58
59    /// Optional. Cloud Labels are a flexible and lightweight mechanism for
60    /// organizing cloud resources into groups that reflect a customer's
61    /// organizational needs and deployment strategies. See
62    /// <https://cloud.google.com/resource-manager/docs/labels-overview> for details.
63    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
64
65    /// Required. Immutable. The instance's storage capacity in Gibibytes (GiB).
66    /// Allowed values are between 12000 and 100000, in multiples of 4000; e.g.,
67    /// 12000, 16000, 20000, ...
68    pub capacity_gib: i64,
69
70    /// Output only. Deprecated: The version of DAOS software running in the
71    /// instance.
72    #[deprecated]
73    pub daos_version: std::string::String,
74
75    /// Output only. A list of IPv4 addresses used for client side configuration.
76    pub access_points: std::vec::Vec<std::string::String>,
77
78    /// Optional. Immutable. The name of the Compute Engine
79    /// [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the
80    /// instance is connected.
81    pub network: std::string::String,
82
83    /// Optional. Immutable. The ID of the IP address range being used by the
84    /// instance's VPC network. See [Configure a VPC
85    /// network](https://cloud.google.com/parallelstore/docs/vpc#create_and_configure_the_vpc).
86    /// If no ID is provided, all ranges are considered.
87    pub reserved_ip_range: std::string::String,
88
89    /// Output only. Immutable. The ID of the IP address range being used by the
90    /// instance's VPC network. This field is populated by the service and contains
91    /// the value currently used by the service.
92    pub effective_reserved_ip_range: std::string::String,
93
94    /// Optional. Immutable. Stripe level for files. Allowed values are:
95    ///
96    /// * `FILE_STRIPE_LEVEL_MIN`: offers the best performance for small size
97    ///   files.
98    /// * `FILE_STRIPE_LEVEL_BALANCED`: balances performance for workloads
99    ///   involving a mix of small and large files.
100    /// * `FILE_STRIPE_LEVEL_MAX`: higher throughput performance for larger files.
101    pub file_stripe_level: crate::model::FileStripeLevel,
102
103    /// Optional. Immutable. Stripe level for directories. Allowed values are:
104    ///
105    /// * `DIRECTORY_STRIPE_LEVEL_MIN`: recommended when directories contain a
106    ///   small number of files.
107    /// * `DIRECTORY_STRIPE_LEVEL_BALANCED`: balances performance for workloads
108    ///   involving a mix of small and large directories.
109    /// * `DIRECTORY_STRIPE_LEVEL_MAX`: recommended for directories with a large
110    ///   number of files.
111    pub directory_stripe_level: crate::model::DirectoryStripeLevel,
112
113    /// Optional. Immutable. The deployment type of the instance. Allowed values
114    /// are:
115    ///
116    /// * `SCRATCH`: the instance is a scratch instance.
117    /// * `PERSISTENT`: the instance is a persistent instance.
118    pub deployment_type: crate::model::DeploymentType,
119
120    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
121}
122
123impl Instance {
124    pub fn new() -> Self {
125        std::default::Default::default()
126    }
127
128    /// Sets the value of [name][crate::model::Instance::name].
129    ///
130    /// # Example
131    /// ```ignore,no_run
132    /// # use google_cloud_parallelstore_v1::model::Instance;
133    /// let x = Instance::new().set_name("example");
134    /// ```
135    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
136        self.name = v.into();
137        self
138    }
139
140    /// Sets the value of [description][crate::model::Instance::description].
141    ///
142    /// # Example
143    /// ```ignore,no_run
144    /// # use google_cloud_parallelstore_v1::model::Instance;
145    /// let x = Instance::new().set_description("example");
146    /// ```
147    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
148        self.description = v.into();
149        self
150    }
151
152    /// Sets the value of [state][crate::model::Instance::state].
153    ///
154    /// # Example
155    /// ```ignore,no_run
156    /// # use google_cloud_parallelstore_v1::model::Instance;
157    /// use google_cloud_parallelstore_v1::model::instance::State;
158    /// let x0 = Instance::new().set_state(State::Creating);
159    /// let x1 = Instance::new().set_state(State::Active);
160    /// let x2 = Instance::new().set_state(State::Deleting);
161    /// ```
162    pub fn set_state<T: std::convert::Into<crate::model::instance::State>>(mut self, v: T) -> Self {
163        self.state = v.into();
164        self
165    }
166
167    /// Sets the value of [create_time][crate::model::Instance::create_time].
168    ///
169    /// # Example
170    /// ```ignore,no_run
171    /// # use google_cloud_parallelstore_v1::model::Instance;
172    /// use wkt::Timestamp;
173    /// let x = Instance::new().set_create_time(Timestamp::default()/* use setters */);
174    /// ```
175    pub fn set_create_time<T>(mut self, v: T) -> Self
176    where
177        T: std::convert::Into<wkt::Timestamp>,
178    {
179        self.create_time = std::option::Option::Some(v.into());
180        self
181    }
182
183    /// Sets or clears the value of [create_time][crate::model::Instance::create_time].
184    ///
185    /// # Example
186    /// ```ignore,no_run
187    /// # use google_cloud_parallelstore_v1::model::Instance;
188    /// use wkt::Timestamp;
189    /// let x = Instance::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
190    /// let x = Instance::new().set_or_clear_create_time(None::<Timestamp>);
191    /// ```
192    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
193    where
194        T: std::convert::Into<wkt::Timestamp>,
195    {
196        self.create_time = v.map(|x| x.into());
197        self
198    }
199
200    /// Sets the value of [update_time][crate::model::Instance::update_time].
201    ///
202    /// # Example
203    /// ```ignore,no_run
204    /// # use google_cloud_parallelstore_v1::model::Instance;
205    /// use wkt::Timestamp;
206    /// let x = Instance::new().set_update_time(Timestamp::default()/* use setters */);
207    /// ```
208    pub fn set_update_time<T>(mut self, v: T) -> Self
209    where
210        T: std::convert::Into<wkt::Timestamp>,
211    {
212        self.update_time = std::option::Option::Some(v.into());
213        self
214    }
215
216    /// Sets or clears the value of [update_time][crate::model::Instance::update_time].
217    ///
218    /// # Example
219    /// ```ignore,no_run
220    /// # use google_cloud_parallelstore_v1::model::Instance;
221    /// use wkt::Timestamp;
222    /// let x = Instance::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
223    /// let x = Instance::new().set_or_clear_update_time(None::<Timestamp>);
224    /// ```
225    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
226    where
227        T: std::convert::Into<wkt::Timestamp>,
228    {
229        self.update_time = v.map(|x| x.into());
230        self
231    }
232
233    /// Sets the value of [labels][crate::model::Instance::labels].
234    ///
235    /// # Example
236    /// ```ignore,no_run
237    /// # use google_cloud_parallelstore_v1::model::Instance;
238    /// let x = Instance::new().set_labels([
239    ///     ("key0", "abc"),
240    ///     ("key1", "xyz"),
241    /// ]);
242    /// ```
243    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
244    where
245        T: std::iter::IntoIterator<Item = (K, V)>,
246        K: std::convert::Into<std::string::String>,
247        V: std::convert::Into<std::string::String>,
248    {
249        use std::iter::Iterator;
250        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
251        self
252    }
253
254    /// Sets the value of [capacity_gib][crate::model::Instance::capacity_gib].
255    ///
256    /// # Example
257    /// ```ignore,no_run
258    /// # use google_cloud_parallelstore_v1::model::Instance;
259    /// let x = Instance::new().set_capacity_gib(42);
260    /// ```
261    pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
262        self.capacity_gib = v.into();
263        self
264    }
265
266    /// Sets the value of [daos_version][crate::model::Instance::daos_version].
267    ///
268    /// # Example
269    /// ```ignore,no_run
270    /// # use google_cloud_parallelstore_v1::model::Instance;
271    /// let x = Instance::new().set_daos_version("example");
272    /// ```
273    #[deprecated]
274    pub fn set_daos_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
275        self.daos_version = v.into();
276        self
277    }
278
279    /// Sets the value of [access_points][crate::model::Instance::access_points].
280    ///
281    /// # Example
282    /// ```ignore,no_run
283    /// # use google_cloud_parallelstore_v1::model::Instance;
284    /// let x = Instance::new().set_access_points(["a", "b", "c"]);
285    /// ```
286    pub fn set_access_points<T, V>(mut self, v: T) -> Self
287    where
288        T: std::iter::IntoIterator<Item = V>,
289        V: std::convert::Into<std::string::String>,
290    {
291        use std::iter::Iterator;
292        self.access_points = v.into_iter().map(|i| i.into()).collect();
293        self
294    }
295
296    /// Sets the value of [network][crate::model::Instance::network].
297    ///
298    /// # Example
299    /// ```ignore,no_run
300    /// # use google_cloud_parallelstore_v1::model::Instance;
301    /// let x = Instance::new().set_network("example");
302    /// ```
303    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
304        self.network = v.into();
305        self
306    }
307
308    /// Sets the value of [reserved_ip_range][crate::model::Instance::reserved_ip_range].
309    ///
310    /// # Example
311    /// ```ignore,no_run
312    /// # use google_cloud_parallelstore_v1::model::Instance;
313    /// let x = Instance::new().set_reserved_ip_range("example");
314    /// ```
315    pub fn set_reserved_ip_range<T: std::convert::Into<std::string::String>>(
316        mut self,
317        v: T,
318    ) -> Self {
319        self.reserved_ip_range = v.into();
320        self
321    }
322
323    /// Sets the value of [effective_reserved_ip_range][crate::model::Instance::effective_reserved_ip_range].
324    ///
325    /// # Example
326    /// ```ignore,no_run
327    /// # use google_cloud_parallelstore_v1::model::Instance;
328    /// let x = Instance::new().set_effective_reserved_ip_range("example");
329    /// ```
330    pub fn set_effective_reserved_ip_range<T: std::convert::Into<std::string::String>>(
331        mut self,
332        v: T,
333    ) -> Self {
334        self.effective_reserved_ip_range = v.into();
335        self
336    }
337
338    /// Sets the value of [file_stripe_level][crate::model::Instance::file_stripe_level].
339    ///
340    /// # Example
341    /// ```ignore,no_run
342    /// # use google_cloud_parallelstore_v1::model::Instance;
343    /// use google_cloud_parallelstore_v1::model::FileStripeLevel;
344    /// let x0 = Instance::new().set_file_stripe_level(FileStripeLevel::Min);
345    /// let x1 = Instance::new().set_file_stripe_level(FileStripeLevel::Balanced);
346    /// let x2 = Instance::new().set_file_stripe_level(FileStripeLevel::Max);
347    /// ```
348    pub fn set_file_stripe_level<T: std::convert::Into<crate::model::FileStripeLevel>>(
349        mut self,
350        v: T,
351    ) -> Self {
352        self.file_stripe_level = v.into();
353        self
354    }
355
356    /// Sets the value of [directory_stripe_level][crate::model::Instance::directory_stripe_level].
357    ///
358    /// # Example
359    /// ```ignore,no_run
360    /// # use google_cloud_parallelstore_v1::model::Instance;
361    /// use google_cloud_parallelstore_v1::model::DirectoryStripeLevel;
362    /// let x0 = Instance::new().set_directory_stripe_level(DirectoryStripeLevel::Min);
363    /// let x1 = Instance::new().set_directory_stripe_level(DirectoryStripeLevel::Balanced);
364    /// let x2 = Instance::new().set_directory_stripe_level(DirectoryStripeLevel::Max);
365    /// ```
366    pub fn set_directory_stripe_level<T: std::convert::Into<crate::model::DirectoryStripeLevel>>(
367        mut self,
368        v: T,
369    ) -> Self {
370        self.directory_stripe_level = v.into();
371        self
372    }
373
374    /// Sets the value of [deployment_type][crate::model::Instance::deployment_type].
375    ///
376    /// # Example
377    /// ```ignore,no_run
378    /// # use google_cloud_parallelstore_v1::model::Instance;
379    /// use google_cloud_parallelstore_v1::model::DeploymentType;
380    /// let x0 = Instance::new().set_deployment_type(DeploymentType::Scratch);
381    /// let x1 = Instance::new().set_deployment_type(DeploymentType::Persistent);
382    /// ```
383    pub fn set_deployment_type<T: std::convert::Into<crate::model::DeploymentType>>(
384        mut self,
385        v: T,
386    ) -> Self {
387        self.deployment_type = v.into();
388        self
389    }
390}
391
392impl wkt::message::Message for Instance {
393    fn typename() -> &'static str {
394        "type.googleapis.com/google.cloud.parallelstore.v1.Instance"
395    }
396}
397
398/// Defines additional types related to [Instance].
399pub mod instance {
400    #[allow(unused_imports)]
401    use super::*;
402
403    /// The possible states of a Parallelstore instance.
404    ///
405    /// # Working with unknown values
406    ///
407    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
408    /// additional enum variants at any time. Adding new variants is not considered
409    /// a breaking change. Applications should write their code in anticipation of:
410    ///
411    /// - New values appearing in future releases of the client library, **and**
412    /// - New values received dynamically, without application changes.
413    ///
414    /// Please consult the [Working with enums] section in the user guide for some
415    /// guidelines.
416    ///
417    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
418    #[derive(Clone, Debug, PartialEq)]
419    #[non_exhaustive]
420    pub enum State {
421        /// Not set.
422        Unspecified,
423        /// The instance is being created.
424        Creating,
425        /// The instance is available for use.
426        Active,
427        /// The instance is being deleted.
428        Deleting,
429        /// The instance is not usable.
430        Failed,
431        /// The instance is being upgraded.
432        Upgrading,
433        /// The instance is being repaired. This should only be used by instances
434        /// using the `PERSISTENT` deployment type.
435        Repairing,
436        /// If set, the enum was initialized with an unknown value.
437        ///
438        /// Applications can examine the value using [State::value] or
439        /// [State::name].
440        UnknownValue(state::UnknownValue),
441    }
442
443    #[doc(hidden)]
444    pub mod state {
445        #[allow(unused_imports)]
446        use super::*;
447        #[derive(Clone, Debug, PartialEq)]
448        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
449    }
450
451    impl State {
452        /// Gets the enum value.
453        ///
454        /// Returns `None` if the enum contains an unknown value deserialized from
455        /// the string representation of enums.
456        pub fn value(&self) -> std::option::Option<i32> {
457            match self {
458                Self::Unspecified => std::option::Option::Some(0),
459                Self::Creating => std::option::Option::Some(1),
460                Self::Active => std::option::Option::Some(2),
461                Self::Deleting => std::option::Option::Some(3),
462                Self::Failed => std::option::Option::Some(4),
463                Self::Upgrading => std::option::Option::Some(5),
464                Self::Repairing => std::option::Option::Some(6),
465                Self::UnknownValue(u) => u.0.value(),
466            }
467        }
468
469        /// Gets the enum value as a string.
470        ///
471        /// Returns `None` if the enum contains an unknown value deserialized from
472        /// the integer representation of enums.
473        pub fn name(&self) -> std::option::Option<&str> {
474            match self {
475                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
476                Self::Creating => std::option::Option::Some("CREATING"),
477                Self::Active => std::option::Option::Some("ACTIVE"),
478                Self::Deleting => std::option::Option::Some("DELETING"),
479                Self::Failed => std::option::Option::Some("FAILED"),
480                Self::Upgrading => std::option::Option::Some("UPGRADING"),
481                Self::Repairing => std::option::Option::Some("REPAIRING"),
482                Self::UnknownValue(u) => u.0.name(),
483            }
484        }
485    }
486
487    impl std::default::Default for State {
488        fn default() -> Self {
489            use std::convert::From;
490            Self::from(0)
491        }
492    }
493
494    impl std::fmt::Display for State {
495        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
496            wkt::internal::display_enum(f, self.name(), self.value())
497        }
498    }
499
500    impl std::convert::From<i32> for State {
501        fn from(value: i32) -> Self {
502            match value {
503                0 => Self::Unspecified,
504                1 => Self::Creating,
505                2 => Self::Active,
506                3 => Self::Deleting,
507                4 => Self::Failed,
508                5 => Self::Upgrading,
509                6 => Self::Repairing,
510                _ => Self::UnknownValue(state::UnknownValue(
511                    wkt::internal::UnknownEnumValue::Integer(value),
512                )),
513            }
514        }
515    }
516
517    impl std::convert::From<&str> for State {
518        fn from(value: &str) -> Self {
519            use std::string::ToString;
520            match value {
521                "STATE_UNSPECIFIED" => Self::Unspecified,
522                "CREATING" => Self::Creating,
523                "ACTIVE" => Self::Active,
524                "DELETING" => Self::Deleting,
525                "FAILED" => Self::Failed,
526                "UPGRADING" => Self::Upgrading,
527                "REPAIRING" => Self::Repairing,
528                _ => Self::UnknownValue(state::UnknownValue(
529                    wkt::internal::UnknownEnumValue::String(value.to_string()),
530                )),
531            }
532        }
533    }
534
535    impl serde::ser::Serialize for State {
536        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
537        where
538            S: serde::Serializer,
539        {
540            match self {
541                Self::Unspecified => serializer.serialize_i32(0),
542                Self::Creating => serializer.serialize_i32(1),
543                Self::Active => serializer.serialize_i32(2),
544                Self::Deleting => serializer.serialize_i32(3),
545                Self::Failed => serializer.serialize_i32(4),
546                Self::Upgrading => serializer.serialize_i32(5),
547                Self::Repairing => serializer.serialize_i32(6),
548                Self::UnknownValue(u) => u.0.serialize(serializer),
549            }
550        }
551    }
552
553    impl<'de> serde::de::Deserialize<'de> for State {
554        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
555        where
556            D: serde::Deserializer<'de>,
557        {
558            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
559                ".google.cloud.parallelstore.v1.Instance.State",
560            ))
561        }
562    }
563}
564
565/// Transfer metadata options for the instance.
566#[derive(Clone, Default, PartialEq)]
567#[non_exhaustive]
568pub struct TransferMetadataOptions {
569    /// Optional. The UID preservation behavior.
570    pub uid: crate::model::transfer_metadata_options::Uid,
571
572    /// Optional. The GID preservation behavior.
573    pub gid: crate::model::transfer_metadata_options::Gid,
574
575    /// Optional. The mode preservation behavior.
576    pub mode: crate::model::transfer_metadata_options::Mode,
577
578    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
579}
580
581impl TransferMetadataOptions {
582    pub fn new() -> Self {
583        std::default::Default::default()
584    }
585
586    /// Sets the value of [uid][crate::model::TransferMetadataOptions::uid].
587    ///
588    /// # Example
589    /// ```ignore,no_run
590    /// # use google_cloud_parallelstore_v1::model::TransferMetadataOptions;
591    /// use google_cloud_parallelstore_v1::model::transfer_metadata_options::Uid;
592    /// let x0 = TransferMetadataOptions::new().set_uid(Uid::Skip);
593    /// let x1 = TransferMetadataOptions::new().set_uid(Uid::NumberPreserve);
594    /// ```
595    pub fn set_uid<T: std::convert::Into<crate::model::transfer_metadata_options::Uid>>(
596        mut self,
597        v: T,
598    ) -> Self {
599        self.uid = v.into();
600        self
601    }
602
603    /// Sets the value of [gid][crate::model::TransferMetadataOptions::gid].
604    ///
605    /// # Example
606    /// ```ignore,no_run
607    /// # use google_cloud_parallelstore_v1::model::TransferMetadataOptions;
608    /// use google_cloud_parallelstore_v1::model::transfer_metadata_options::Gid;
609    /// let x0 = TransferMetadataOptions::new().set_gid(Gid::Skip);
610    /// let x1 = TransferMetadataOptions::new().set_gid(Gid::NumberPreserve);
611    /// ```
612    pub fn set_gid<T: std::convert::Into<crate::model::transfer_metadata_options::Gid>>(
613        mut self,
614        v: T,
615    ) -> Self {
616        self.gid = v.into();
617        self
618    }
619
620    /// Sets the value of [mode][crate::model::TransferMetadataOptions::mode].
621    ///
622    /// # Example
623    /// ```ignore,no_run
624    /// # use google_cloud_parallelstore_v1::model::TransferMetadataOptions;
625    /// use google_cloud_parallelstore_v1::model::transfer_metadata_options::Mode;
626    /// let x0 = TransferMetadataOptions::new().set_mode(Mode::Skip);
627    /// let x1 = TransferMetadataOptions::new().set_mode(Mode::Preserve);
628    /// ```
629    pub fn set_mode<T: std::convert::Into<crate::model::transfer_metadata_options::Mode>>(
630        mut self,
631        v: T,
632    ) -> Self {
633        self.mode = v.into();
634        self
635    }
636}
637
638impl wkt::message::Message for TransferMetadataOptions {
639    fn typename() -> &'static str {
640        "type.googleapis.com/google.cloud.parallelstore.v1.TransferMetadataOptions"
641    }
642}
643
644/// Defines additional types related to [TransferMetadataOptions].
645pub mod transfer_metadata_options {
646    #[allow(unused_imports)]
647    use super::*;
648
649    /// The UID preservation behavior.
650    ///
651    /// # Working with unknown values
652    ///
653    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
654    /// additional enum variants at any time. Adding new variants is not considered
655    /// a breaking change. Applications should write their code in anticipation of:
656    ///
657    /// - New values appearing in future releases of the client library, **and**
658    /// - New values received dynamically, without application changes.
659    ///
660    /// Please consult the [Working with enums] section in the user guide for some
661    /// guidelines.
662    ///
663    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
664    #[derive(Clone, Debug, PartialEq)]
665    #[non_exhaustive]
666    pub enum Uid {
667        /// default is UID_NUMBER_PRESERVE.
668        Unspecified,
669        /// Do not preserve UID during a transfer job.
670        Skip,
671        /// Preserve UID that is in number format during a transfer job.
672        NumberPreserve,
673        /// If set, the enum was initialized with an unknown value.
674        ///
675        /// Applications can examine the value using [Uid::value] or
676        /// [Uid::name].
677        UnknownValue(uid::UnknownValue),
678    }
679
680    #[doc(hidden)]
681    pub mod uid {
682        #[allow(unused_imports)]
683        use super::*;
684        #[derive(Clone, Debug, PartialEq)]
685        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
686    }
687
688    impl Uid {
689        /// Gets the enum value.
690        ///
691        /// Returns `None` if the enum contains an unknown value deserialized from
692        /// the string representation of enums.
693        pub fn value(&self) -> std::option::Option<i32> {
694            match self {
695                Self::Unspecified => std::option::Option::Some(0),
696                Self::Skip => std::option::Option::Some(1),
697                Self::NumberPreserve => std::option::Option::Some(2),
698                Self::UnknownValue(u) => u.0.value(),
699            }
700        }
701
702        /// Gets the enum value as a string.
703        ///
704        /// Returns `None` if the enum contains an unknown value deserialized from
705        /// the integer representation of enums.
706        pub fn name(&self) -> std::option::Option<&str> {
707            match self {
708                Self::Unspecified => std::option::Option::Some("UID_UNSPECIFIED"),
709                Self::Skip => std::option::Option::Some("UID_SKIP"),
710                Self::NumberPreserve => std::option::Option::Some("UID_NUMBER_PRESERVE"),
711                Self::UnknownValue(u) => u.0.name(),
712            }
713        }
714    }
715
716    impl std::default::Default for Uid {
717        fn default() -> Self {
718            use std::convert::From;
719            Self::from(0)
720        }
721    }
722
723    impl std::fmt::Display for Uid {
724        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
725            wkt::internal::display_enum(f, self.name(), self.value())
726        }
727    }
728
729    impl std::convert::From<i32> for Uid {
730        fn from(value: i32) -> Self {
731            match value {
732                0 => Self::Unspecified,
733                1 => Self::Skip,
734                2 => Self::NumberPreserve,
735                _ => Self::UnknownValue(uid::UnknownValue(
736                    wkt::internal::UnknownEnumValue::Integer(value),
737                )),
738            }
739        }
740    }
741
742    impl std::convert::From<&str> for Uid {
743        fn from(value: &str) -> Self {
744            use std::string::ToString;
745            match value {
746                "UID_UNSPECIFIED" => Self::Unspecified,
747                "UID_SKIP" => Self::Skip,
748                "UID_NUMBER_PRESERVE" => Self::NumberPreserve,
749                _ => Self::UnknownValue(uid::UnknownValue(
750                    wkt::internal::UnknownEnumValue::String(value.to_string()),
751                )),
752            }
753        }
754    }
755
756    impl serde::ser::Serialize for Uid {
757        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
758        where
759            S: serde::Serializer,
760        {
761            match self {
762                Self::Unspecified => serializer.serialize_i32(0),
763                Self::Skip => serializer.serialize_i32(1),
764                Self::NumberPreserve => serializer.serialize_i32(2),
765                Self::UnknownValue(u) => u.0.serialize(serializer),
766            }
767        }
768    }
769
770    impl<'de> serde::de::Deserialize<'de> for Uid {
771        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
772        where
773            D: serde::Deserializer<'de>,
774        {
775            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Uid>::new(
776                ".google.cloud.parallelstore.v1.TransferMetadataOptions.Uid",
777            ))
778        }
779    }
780
781    /// The GID preservation behavior.
782    ///
783    /// # Working with unknown values
784    ///
785    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
786    /// additional enum variants at any time. Adding new variants is not considered
787    /// a breaking change. Applications should write their code in anticipation of:
788    ///
789    /// - New values appearing in future releases of the client library, **and**
790    /// - New values received dynamically, without application changes.
791    ///
792    /// Please consult the [Working with enums] section in the user guide for some
793    /// guidelines.
794    ///
795    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
796    #[derive(Clone, Debug, PartialEq)]
797    #[non_exhaustive]
798    pub enum Gid {
799        /// default is GID_NUMBER_PRESERVE.
800        Unspecified,
801        /// Do not preserve GID during a transfer job.
802        Skip,
803        /// Preserve GID that is in number format during a transfer job.
804        NumberPreserve,
805        /// If set, the enum was initialized with an unknown value.
806        ///
807        /// Applications can examine the value using [Gid::value] or
808        /// [Gid::name].
809        UnknownValue(gid::UnknownValue),
810    }
811
812    #[doc(hidden)]
813    pub mod gid {
814        #[allow(unused_imports)]
815        use super::*;
816        #[derive(Clone, Debug, PartialEq)]
817        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
818    }
819
820    impl Gid {
821        /// Gets the enum value.
822        ///
823        /// Returns `None` if the enum contains an unknown value deserialized from
824        /// the string representation of enums.
825        pub fn value(&self) -> std::option::Option<i32> {
826            match self {
827                Self::Unspecified => std::option::Option::Some(0),
828                Self::Skip => std::option::Option::Some(1),
829                Self::NumberPreserve => std::option::Option::Some(2),
830                Self::UnknownValue(u) => u.0.value(),
831            }
832        }
833
834        /// Gets the enum value as a string.
835        ///
836        /// Returns `None` if the enum contains an unknown value deserialized from
837        /// the integer representation of enums.
838        pub fn name(&self) -> std::option::Option<&str> {
839            match self {
840                Self::Unspecified => std::option::Option::Some("GID_UNSPECIFIED"),
841                Self::Skip => std::option::Option::Some("GID_SKIP"),
842                Self::NumberPreserve => std::option::Option::Some("GID_NUMBER_PRESERVE"),
843                Self::UnknownValue(u) => u.0.name(),
844            }
845        }
846    }
847
848    impl std::default::Default for Gid {
849        fn default() -> Self {
850            use std::convert::From;
851            Self::from(0)
852        }
853    }
854
855    impl std::fmt::Display for Gid {
856        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
857            wkt::internal::display_enum(f, self.name(), self.value())
858        }
859    }
860
861    impl std::convert::From<i32> for Gid {
862        fn from(value: i32) -> Self {
863            match value {
864                0 => Self::Unspecified,
865                1 => Self::Skip,
866                2 => Self::NumberPreserve,
867                _ => Self::UnknownValue(gid::UnknownValue(
868                    wkt::internal::UnknownEnumValue::Integer(value),
869                )),
870            }
871        }
872    }
873
874    impl std::convert::From<&str> for Gid {
875        fn from(value: &str) -> Self {
876            use std::string::ToString;
877            match value {
878                "GID_UNSPECIFIED" => Self::Unspecified,
879                "GID_SKIP" => Self::Skip,
880                "GID_NUMBER_PRESERVE" => Self::NumberPreserve,
881                _ => Self::UnknownValue(gid::UnknownValue(
882                    wkt::internal::UnknownEnumValue::String(value.to_string()),
883                )),
884            }
885        }
886    }
887
888    impl serde::ser::Serialize for Gid {
889        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
890        where
891            S: serde::Serializer,
892        {
893            match self {
894                Self::Unspecified => serializer.serialize_i32(0),
895                Self::Skip => serializer.serialize_i32(1),
896                Self::NumberPreserve => serializer.serialize_i32(2),
897                Self::UnknownValue(u) => u.0.serialize(serializer),
898            }
899        }
900    }
901
902    impl<'de> serde::de::Deserialize<'de> for Gid {
903        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
904        where
905            D: serde::Deserializer<'de>,
906        {
907            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Gid>::new(
908                ".google.cloud.parallelstore.v1.TransferMetadataOptions.Gid",
909            ))
910        }
911    }
912
913    /// The mode preservation behavior.
914    ///
915    /// # Working with unknown values
916    ///
917    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
918    /// additional enum variants at any time. Adding new variants is not considered
919    /// a breaking change. Applications should write their code in anticipation of:
920    ///
921    /// - New values appearing in future releases of the client library, **and**
922    /// - New values received dynamically, without application changes.
923    ///
924    /// Please consult the [Working with enums] section in the user guide for some
925    /// guidelines.
926    ///
927    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
928    #[derive(Clone, Debug, PartialEq)]
929    #[non_exhaustive]
930    pub enum Mode {
931        /// default is MODE_PRESERVE.
932        Unspecified,
933        /// Do not preserve mode during a transfer job.
934        Skip,
935        /// Preserve mode during a transfer job.
936        Preserve,
937        /// If set, the enum was initialized with an unknown value.
938        ///
939        /// Applications can examine the value using [Mode::value] or
940        /// [Mode::name].
941        UnknownValue(mode::UnknownValue),
942    }
943
944    #[doc(hidden)]
945    pub mod mode {
946        #[allow(unused_imports)]
947        use super::*;
948        #[derive(Clone, Debug, PartialEq)]
949        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
950    }
951
952    impl Mode {
953        /// Gets the enum value.
954        ///
955        /// Returns `None` if the enum contains an unknown value deserialized from
956        /// the string representation of enums.
957        pub fn value(&self) -> std::option::Option<i32> {
958            match self {
959                Self::Unspecified => std::option::Option::Some(0),
960                Self::Skip => std::option::Option::Some(1),
961                Self::Preserve => std::option::Option::Some(2),
962                Self::UnknownValue(u) => u.0.value(),
963            }
964        }
965
966        /// Gets the enum value as a string.
967        ///
968        /// Returns `None` if the enum contains an unknown value deserialized from
969        /// the integer representation of enums.
970        pub fn name(&self) -> std::option::Option<&str> {
971            match self {
972                Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
973                Self::Skip => std::option::Option::Some("MODE_SKIP"),
974                Self::Preserve => std::option::Option::Some("MODE_PRESERVE"),
975                Self::UnknownValue(u) => u.0.name(),
976            }
977        }
978    }
979
980    impl std::default::Default for Mode {
981        fn default() -> Self {
982            use std::convert::From;
983            Self::from(0)
984        }
985    }
986
987    impl std::fmt::Display for Mode {
988        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
989            wkt::internal::display_enum(f, self.name(), self.value())
990        }
991    }
992
993    impl std::convert::From<i32> for Mode {
994        fn from(value: i32) -> Self {
995            match value {
996                0 => Self::Unspecified,
997                1 => Self::Skip,
998                2 => Self::Preserve,
999                _ => Self::UnknownValue(mode::UnknownValue(
1000                    wkt::internal::UnknownEnumValue::Integer(value),
1001                )),
1002            }
1003        }
1004    }
1005
1006    impl std::convert::From<&str> for Mode {
1007        fn from(value: &str) -> Self {
1008            use std::string::ToString;
1009            match value {
1010                "MODE_UNSPECIFIED" => Self::Unspecified,
1011                "MODE_SKIP" => Self::Skip,
1012                "MODE_PRESERVE" => Self::Preserve,
1013                _ => Self::UnknownValue(mode::UnknownValue(
1014                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1015                )),
1016            }
1017        }
1018    }
1019
1020    impl serde::ser::Serialize for Mode {
1021        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1022        where
1023            S: serde::Serializer,
1024        {
1025            match self {
1026                Self::Unspecified => serializer.serialize_i32(0),
1027                Self::Skip => serializer.serialize_i32(1),
1028                Self::Preserve => serializer.serialize_i32(2),
1029                Self::UnknownValue(u) => u.0.serialize(serializer),
1030            }
1031        }
1032    }
1033
1034    impl<'de> serde::de::Deserialize<'de> for Mode {
1035        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1036        where
1037            D: serde::Deserializer<'de>,
1038        {
1039            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
1040                ".google.cloud.parallelstore.v1.TransferMetadataOptions.Mode",
1041            ))
1042        }
1043    }
1044}
1045
1046/// List instances request.
1047#[derive(Clone, Default, PartialEq)]
1048#[non_exhaustive]
1049pub struct ListInstancesRequest {
1050    /// Required. The project and location for which to retrieve instance
1051    /// information, in the format `projects/{project_id}/locations/{location}`.
1052    ///
1053    /// To retrieve instance information for all locations, use "-" as the value of
1054    /// `{location}`.
1055    pub parent: std::string::String,
1056
1057    /// Optional. Requested page size. Server may return fewer items than
1058    /// requested. If unspecified, the server will pick an appropriate default.
1059    pub page_size: i32,
1060
1061    /// Optional. A token identifying a page of results the server should return.
1062    pub page_token: std::string::String,
1063
1064    /// Optional. Filtering results.
1065    pub filter: std::string::String,
1066
1067    /// Optional. Hint for how to order the results.
1068    pub order_by: std::string::String,
1069
1070    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1071}
1072
1073impl ListInstancesRequest {
1074    pub fn new() -> Self {
1075        std::default::Default::default()
1076    }
1077
1078    /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
1079    ///
1080    /// # Example
1081    /// ```ignore,no_run
1082    /// # use google_cloud_parallelstore_v1::model::ListInstancesRequest;
1083    /// let x = ListInstancesRequest::new().set_parent("example");
1084    /// ```
1085    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1086        self.parent = v.into();
1087        self
1088    }
1089
1090    /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
1091    ///
1092    /// # Example
1093    /// ```ignore,no_run
1094    /// # use google_cloud_parallelstore_v1::model::ListInstancesRequest;
1095    /// let x = ListInstancesRequest::new().set_page_size(42);
1096    /// ```
1097    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1098        self.page_size = v.into();
1099        self
1100    }
1101
1102    /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
1103    ///
1104    /// # Example
1105    /// ```ignore,no_run
1106    /// # use google_cloud_parallelstore_v1::model::ListInstancesRequest;
1107    /// let x = ListInstancesRequest::new().set_page_token("example");
1108    /// ```
1109    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1110        self.page_token = v.into();
1111        self
1112    }
1113
1114    /// Sets the value of [filter][crate::model::ListInstancesRequest::filter].
1115    ///
1116    /// # Example
1117    /// ```ignore,no_run
1118    /// # use google_cloud_parallelstore_v1::model::ListInstancesRequest;
1119    /// let x = ListInstancesRequest::new().set_filter("example");
1120    /// ```
1121    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1122        self.filter = v.into();
1123        self
1124    }
1125
1126    /// Sets the value of [order_by][crate::model::ListInstancesRequest::order_by].
1127    ///
1128    /// # Example
1129    /// ```ignore,no_run
1130    /// # use google_cloud_parallelstore_v1::model::ListInstancesRequest;
1131    /// let x = ListInstancesRequest::new().set_order_by("example");
1132    /// ```
1133    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1134        self.order_by = v.into();
1135        self
1136    }
1137}
1138
1139impl wkt::message::Message for ListInstancesRequest {
1140    fn typename() -> &'static str {
1141        "type.googleapis.com/google.cloud.parallelstore.v1.ListInstancesRequest"
1142    }
1143}
1144
1145/// Response from
1146/// [ListInstances][google.cloud.parallelstore.v1.Parallelstore.ListInstances].
1147///
1148/// [google.cloud.parallelstore.v1.Parallelstore.ListInstances]: crate::client::Parallelstore::list_instances
1149#[derive(Clone, Default, PartialEq)]
1150#[non_exhaustive]
1151pub struct ListInstancesResponse {
1152    /// The list of Parallelstore instances.
1153    pub instances: std::vec::Vec<crate::model::Instance>,
1154
1155    /// A token identifying a page of results the server should return.
1156    pub next_page_token: std::string::String,
1157
1158    /// Locations that could not be reached.
1159    pub unreachable: std::vec::Vec<std::string::String>,
1160
1161    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1162}
1163
1164impl ListInstancesResponse {
1165    pub fn new() -> Self {
1166        std::default::Default::default()
1167    }
1168
1169    /// Sets the value of [instances][crate::model::ListInstancesResponse::instances].
1170    ///
1171    /// # Example
1172    /// ```ignore,no_run
1173    /// # use google_cloud_parallelstore_v1::model::ListInstancesResponse;
1174    /// use google_cloud_parallelstore_v1::model::Instance;
1175    /// let x = ListInstancesResponse::new()
1176    ///     .set_instances([
1177    ///         Instance::default()/* use setters */,
1178    ///         Instance::default()/* use (different) setters */,
1179    ///     ]);
1180    /// ```
1181    pub fn set_instances<T, V>(mut self, v: T) -> Self
1182    where
1183        T: std::iter::IntoIterator<Item = V>,
1184        V: std::convert::Into<crate::model::Instance>,
1185    {
1186        use std::iter::Iterator;
1187        self.instances = v.into_iter().map(|i| i.into()).collect();
1188        self
1189    }
1190
1191    /// Sets the value of [next_page_token][crate::model::ListInstancesResponse::next_page_token].
1192    ///
1193    /// # Example
1194    /// ```ignore,no_run
1195    /// # use google_cloud_parallelstore_v1::model::ListInstancesResponse;
1196    /// let x = ListInstancesResponse::new().set_next_page_token("example");
1197    /// ```
1198    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1199        self.next_page_token = v.into();
1200        self
1201    }
1202
1203    /// Sets the value of [unreachable][crate::model::ListInstancesResponse::unreachable].
1204    ///
1205    /// # Example
1206    /// ```ignore,no_run
1207    /// # use google_cloud_parallelstore_v1::model::ListInstancesResponse;
1208    /// let x = ListInstancesResponse::new().set_unreachable(["a", "b", "c"]);
1209    /// ```
1210    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1211    where
1212        T: std::iter::IntoIterator<Item = V>,
1213        V: std::convert::Into<std::string::String>,
1214    {
1215        use std::iter::Iterator;
1216        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1217        self
1218    }
1219}
1220
1221impl wkt::message::Message for ListInstancesResponse {
1222    fn typename() -> &'static str {
1223        "type.googleapis.com/google.cloud.parallelstore.v1.ListInstancesResponse"
1224    }
1225}
1226
1227#[doc(hidden)]
1228impl google_cloud_gax::paginator::internal::PageableResponse for ListInstancesResponse {
1229    type PageItem = crate::model::Instance;
1230
1231    fn items(self) -> std::vec::Vec<Self::PageItem> {
1232        self.instances
1233    }
1234
1235    fn next_page_token(&self) -> std::string::String {
1236        use std::clone::Clone;
1237        self.next_page_token.clone()
1238    }
1239}
1240
1241/// Get an instance's details.
1242#[derive(Clone, Default, PartialEq)]
1243#[non_exhaustive]
1244pub struct GetInstanceRequest {
1245    /// Required. The instance resource name, in the format
1246    /// `projects/{project_id}/locations/{location}/instances/{instance_id}`.
1247    pub name: std::string::String,
1248
1249    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1250}
1251
1252impl GetInstanceRequest {
1253    pub fn new() -> Self {
1254        std::default::Default::default()
1255    }
1256
1257    /// Sets the value of [name][crate::model::GetInstanceRequest::name].
1258    ///
1259    /// # Example
1260    /// ```ignore,no_run
1261    /// # use google_cloud_parallelstore_v1::model::GetInstanceRequest;
1262    /// let x = GetInstanceRequest::new().set_name("example");
1263    /// ```
1264    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1265        self.name = v.into();
1266        self
1267    }
1268}
1269
1270impl wkt::message::Message for GetInstanceRequest {
1271    fn typename() -> &'static str {
1272        "type.googleapis.com/google.cloud.parallelstore.v1.GetInstanceRequest"
1273    }
1274}
1275
1276/// Create a new Parallelstore instance.
1277#[derive(Clone, Default, PartialEq)]
1278#[non_exhaustive]
1279pub struct CreateInstanceRequest {
1280    /// Required. The instance's project and location, in the format
1281    /// `projects/{project}/locations/{location}`.
1282    /// Locations map to Google Cloud zones; for example, `us-west1-b`.
1283    pub parent: std::string::String,
1284
1285    /// Required. The name of the Parallelstore instance.
1286    ///
1287    /// * Must contain only lowercase letters, numbers, and hyphens.
1288    /// * Must start with a letter.
1289    /// * Must be between 1-63 characters.
1290    /// * Must end with a number or a letter.
1291    /// * Must be unique within the customer project / location
1292    pub instance_id: std::string::String,
1293
1294    /// Required. The instance to create.
1295    pub instance: std::option::Option<crate::model::Instance>,
1296
1297    /// Optional. An optional request ID to identify requests. Specify a unique
1298    /// request ID so that if you must retry your request, the server will know to
1299    /// ignore the request if it has already been completed. The server will
1300    /// guarantee that for at least 60 minutes since the first request.
1301    ///
1302    /// For example, consider a situation where you make an initial request and
1303    /// the request times out. If you make the request again with the same request
1304    /// ID, the server can check if original operation with the same request ID
1305    /// was received, and if so, will ignore the second request. This prevents
1306    /// clients from accidentally creating duplicate commitments.
1307    ///
1308    /// The request ID must be a valid UUID with the exception that zero UUID is
1309    /// not supported (00000000-0000-0000-0000-000000000000).
1310    pub request_id: std::string::String,
1311
1312    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1313}
1314
1315impl CreateInstanceRequest {
1316    pub fn new() -> Self {
1317        std::default::Default::default()
1318    }
1319
1320    /// Sets the value of [parent][crate::model::CreateInstanceRequest::parent].
1321    ///
1322    /// # Example
1323    /// ```ignore,no_run
1324    /// # use google_cloud_parallelstore_v1::model::CreateInstanceRequest;
1325    /// let x = CreateInstanceRequest::new().set_parent("example");
1326    /// ```
1327    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1328        self.parent = v.into();
1329        self
1330    }
1331
1332    /// Sets the value of [instance_id][crate::model::CreateInstanceRequest::instance_id].
1333    ///
1334    /// # Example
1335    /// ```ignore,no_run
1336    /// # use google_cloud_parallelstore_v1::model::CreateInstanceRequest;
1337    /// let x = CreateInstanceRequest::new().set_instance_id("example");
1338    /// ```
1339    pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1340        self.instance_id = v.into();
1341        self
1342    }
1343
1344    /// Sets the value of [instance][crate::model::CreateInstanceRequest::instance].
1345    ///
1346    /// # Example
1347    /// ```ignore,no_run
1348    /// # use google_cloud_parallelstore_v1::model::CreateInstanceRequest;
1349    /// use google_cloud_parallelstore_v1::model::Instance;
1350    /// let x = CreateInstanceRequest::new().set_instance(Instance::default()/* use setters */);
1351    /// ```
1352    pub fn set_instance<T>(mut self, v: T) -> Self
1353    where
1354        T: std::convert::Into<crate::model::Instance>,
1355    {
1356        self.instance = std::option::Option::Some(v.into());
1357        self
1358    }
1359
1360    /// Sets or clears the value of [instance][crate::model::CreateInstanceRequest::instance].
1361    ///
1362    /// # Example
1363    /// ```ignore,no_run
1364    /// # use google_cloud_parallelstore_v1::model::CreateInstanceRequest;
1365    /// use google_cloud_parallelstore_v1::model::Instance;
1366    /// let x = CreateInstanceRequest::new().set_or_clear_instance(Some(Instance::default()/* use setters */));
1367    /// let x = CreateInstanceRequest::new().set_or_clear_instance(None::<Instance>);
1368    /// ```
1369    pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
1370    where
1371        T: std::convert::Into<crate::model::Instance>,
1372    {
1373        self.instance = v.map(|x| x.into());
1374        self
1375    }
1376
1377    /// Sets the value of [request_id][crate::model::CreateInstanceRequest::request_id].
1378    ///
1379    /// # Example
1380    /// ```ignore,no_run
1381    /// # use google_cloud_parallelstore_v1::model::CreateInstanceRequest;
1382    /// let x = CreateInstanceRequest::new().set_request_id("example");
1383    /// ```
1384    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1385        self.request_id = v.into();
1386        self
1387    }
1388}
1389
1390impl wkt::message::Message for CreateInstanceRequest {
1391    fn typename() -> &'static str {
1392        "type.googleapis.com/google.cloud.parallelstore.v1.CreateInstanceRequest"
1393    }
1394}
1395
1396/// Update an instance.
1397#[derive(Clone, Default, PartialEq)]
1398#[non_exhaustive]
1399pub struct UpdateInstanceRequest {
1400    /// Required. Mask of fields to update. Field mask is used to specify the
1401    /// fields to be overwritten in the Instance resource by the update. At least
1402    /// one path must be supplied in this field. The fields specified in the
1403    /// update_mask are relative to the resource, not the full request.
1404    pub update_mask: std::option::Option<wkt::FieldMask>,
1405
1406    /// Required. The instance to update.
1407    pub instance: std::option::Option<crate::model::Instance>,
1408
1409    /// Optional. An optional request ID to identify requests. Specify a unique
1410    /// request ID so that if you must retry your request, the server will know to
1411    /// ignore the request if it has already been completed. The server will
1412    /// guarantee that for at least 60 minutes since the first request.
1413    ///
1414    /// For example, consider a situation where you make an initial request and
1415    /// the request times out. If you make the request again with the same request
1416    /// ID, the server can check if original operation with the same request ID
1417    /// was received, and if so, will ignore the second request. This prevents
1418    /// clients from accidentally creating duplicate commitments.
1419    ///
1420    /// The request ID must be a valid UUID with the exception that zero UUID is
1421    /// not supported (00000000-0000-0000-0000-000000000000).
1422    pub request_id: std::string::String,
1423
1424    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1425}
1426
1427impl UpdateInstanceRequest {
1428    pub fn new() -> Self {
1429        std::default::Default::default()
1430    }
1431
1432    /// Sets the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
1433    ///
1434    /// # Example
1435    /// ```ignore,no_run
1436    /// # use google_cloud_parallelstore_v1::model::UpdateInstanceRequest;
1437    /// use wkt::FieldMask;
1438    /// let x = UpdateInstanceRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1439    /// ```
1440    pub fn set_update_mask<T>(mut self, v: T) -> Self
1441    where
1442        T: std::convert::Into<wkt::FieldMask>,
1443    {
1444        self.update_mask = std::option::Option::Some(v.into());
1445        self
1446    }
1447
1448    /// Sets or clears the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
1449    ///
1450    /// # Example
1451    /// ```ignore,no_run
1452    /// # use google_cloud_parallelstore_v1::model::UpdateInstanceRequest;
1453    /// use wkt::FieldMask;
1454    /// let x = UpdateInstanceRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1455    /// let x = UpdateInstanceRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1456    /// ```
1457    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1458    where
1459        T: std::convert::Into<wkt::FieldMask>,
1460    {
1461        self.update_mask = v.map(|x| x.into());
1462        self
1463    }
1464
1465    /// Sets the value of [instance][crate::model::UpdateInstanceRequest::instance].
1466    ///
1467    /// # Example
1468    /// ```ignore,no_run
1469    /// # use google_cloud_parallelstore_v1::model::UpdateInstanceRequest;
1470    /// use google_cloud_parallelstore_v1::model::Instance;
1471    /// let x = UpdateInstanceRequest::new().set_instance(Instance::default()/* use setters */);
1472    /// ```
1473    pub fn set_instance<T>(mut self, v: T) -> Self
1474    where
1475        T: std::convert::Into<crate::model::Instance>,
1476    {
1477        self.instance = std::option::Option::Some(v.into());
1478        self
1479    }
1480
1481    /// Sets or clears the value of [instance][crate::model::UpdateInstanceRequest::instance].
1482    ///
1483    /// # Example
1484    /// ```ignore,no_run
1485    /// # use google_cloud_parallelstore_v1::model::UpdateInstanceRequest;
1486    /// use google_cloud_parallelstore_v1::model::Instance;
1487    /// let x = UpdateInstanceRequest::new().set_or_clear_instance(Some(Instance::default()/* use setters */));
1488    /// let x = UpdateInstanceRequest::new().set_or_clear_instance(None::<Instance>);
1489    /// ```
1490    pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
1491    where
1492        T: std::convert::Into<crate::model::Instance>,
1493    {
1494        self.instance = v.map(|x| x.into());
1495        self
1496    }
1497
1498    /// Sets the value of [request_id][crate::model::UpdateInstanceRequest::request_id].
1499    ///
1500    /// # Example
1501    /// ```ignore,no_run
1502    /// # use google_cloud_parallelstore_v1::model::UpdateInstanceRequest;
1503    /// let x = UpdateInstanceRequest::new().set_request_id("example");
1504    /// ```
1505    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1506        self.request_id = v.into();
1507        self
1508    }
1509}
1510
1511impl wkt::message::Message for UpdateInstanceRequest {
1512    fn typename() -> &'static str {
1513        "type.googleapis.com/google.cloud.parallelstore.v1.UpdateInstanceRequest"
1514    }
1515}
1516
1517/// Delete an instance.
1518#[derive(Clone, Default, PartialEq)]
1519#[non_exhaustive]
1520pub struct DeleteInstanceRequest {
1521    /// Required. Name of the resource
1522    pub name: std::string::String,
1523
1524    /// Optional. An optional request ID to identify requests. Specify a unique
1525    /// request ID so that if you must retry your request, the server will know to
1526    /// ignore the request if it has already been completed. The server will
1527    /// guarantee that for at least 60 minutes after the first request.
1528    ///
1529    /// For example, consider a situation where you make an initial request and
1530    /// the request times out. If you make the request again with the same request
1531    /// ID, the server can check if original operation with the same request ID
1532    /// was received, and if so, will ignore the second request. This prevents
1533    /// clients from accidentally creating duplicate commitments.
1534    ///
1535    /// The request ID must be a valid UUID with the exception that zero UUID is
1536    /// not supported (00000000-0000-0000-0000-000000000000).
1537    pub request_id: std::string::String,
1538
1539    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1540}
1541
1542impl DeleteInstanceRequest {
1543    pub fn new() -> Self {
1544        std::default::Default::default()
1545    }
1546
1547    /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
1548    ///
1549    /// # Example
1550    /// ```ignore,no_run
1551    /// # use google_cloud_parallelstore_v1::model::DeleteInstanceRequest;
1552    /// let x = DeleteInstanceRequest::new().set_name("example");
1553    /// ```
1554    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1555        self.name = v.into();
1556        self
1557    }
1558
1559    /// Sets the value of [request_id][crate::model::DeleteInstanceRequest::request_id].
1560    ///
1561    /// # Example
1562    /// ```ignore,no_run
1563    /// # use google_cloud_parallelstore_v1::model::DeleteInstanceRequest;
1564    /// let x = DeleteInstanceRequest::new().set_request_id("example");
1565    /// ```
1566    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1567        self.request_id = v.into();
1568        self
1569    }
1570}
1571
1572impl wkt::message::Message for DeleteInstanceRequest {
1573    fn typename() -> &'static str {
1574        "type.googleapis.com/google.cloud.parallelstore.v1.DeleteInstanceRequest"
1575    }
1576}
1577
1578/// Long-running operation metadata.
1579#[derive(Clone, Default, PartialEq)]
1580#[non_exhaustive]
1581pub struct OperationMetadata {
1582    /// Output only. The time the operation was created.
1583    pub create_time: std::option::Option<wkt::Timestamp>,
1584
1585    /// Output only. The time the operation finished running.
1586    pub end_time: std::option::Option<wkt::Timestamp>,
1587
1588    /// Output only. Server-defined resource path for the target of the operation.
1589    pub target: std::string::String,
1590
1591    /// Output only. Name of the verb executed by the operation.
1592    pub verb: std::string::String,
1593
1594    /// Output only. Human-readable status of the operation, if any.
1595    pub status_message: std::string::String,
1596
1597    /// Output only. Identifies whether the user has requested cancellation
1598    /// of the operation. Operations that have been cancelled successfully
1599    /// have [Operation.error][google.longrunning.Operation.error] value with a
1600    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
1601    /// `Code.CANCELLED`.
1602    ///
1603    /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
1604    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
1605    pub requested_cancellation: bool,
1606
1607    /// Output only. API version used to start the operation.
1608    pub api_version: std::string::String,
1609
1610    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1611}
1612
1613impl OperationMetadata {
1614    pub fn new() -> Self {
1615        std::default::Default::default()
1616    }
1617
1618    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
1619    ///
1620    /// # Example
1621    /// ```ignore,no_run
1622    /// # use google_cloud_parallelstore_v1::model::OperationMetadata;
1623    /// use wkt::Timestamp;
1624    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
1625    /// ```
1626    pub fn set_create_time<T>(mut self, v: T) -> Self
1627    where
1628        T: std::convert::Into<wkt::Timestamp>,
1629    {
1630        self.create_time = std::option::Option::Some(v.into());
1631        self
1632    }
1633
1634    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
1635    ///
1636    /// # Example
1637    /// ```ignore,no_run
1638    /// # use google_cloud_parallelstore_v1::model::OperationMetadata;
1639    /// use wkt::Timestamp;
1640    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1641    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
1642    /// ```
1643    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1644    where
1645        T: std::convert::Into<wkt::Timestamp>,
1646    {
1647        self.create_time = v.map(|x| x.into());
1648        self
1649    }
1650
1651    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
1652    ///
1653    /// # Example
1654    /// ```ignore,no_run
1655    /// # use google_cloud_parallelstore_v1::model::OperationMetadata;
1656    /// use wkt::Timestamp;
1657    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
1658    /// ```
1659    pub fn set_end_time<T>(mut self, v: T) -> Self
1660    where
1661        T: std::convert::Into<wkt::Timestamp>,
1662    {
1663        self.end_time = std::option::Option::Some(v.into());
1664        self
1665    }
1666
1667    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
1668    ///
1669    /// # Example
1670    /// ```ignore,no_run
1671    /// # use google_cloud_parallelstore_v1::model::OperationMetadata;
1672    /// use wkt::Timestamp;
1673    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
1674    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
1675    /// ```
1676    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1677    where
1678        T: std::convert::Into<wkt::Timestamp>,
1679    {
1680        self.end_time = v.map(|x| x.into());
1681        self
1682    }
1683
1684    /// Sets the value of [target][crate::model::OperationMetadata::target].
1685    ///
1686    /// # Example
1687    /// ```ignore,no_run
1688    /// # use google_cloud_parallelstore_v1::model::OperationMetadata;
1689    /// let x = OperationMetadata::new().set_target("example");
1690    /// ```
1691    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1692        self.target = v.into();
1693        self
1694    }
1695
1696    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
1697    ///
1698    /// # Example
1699    /// ```ignore,no_run
1700    /// # use google_cloud_parallelstore_v1::model::OperationMetadata;
1701    /// let x = OperationMetadata::new().set_verb("example");
1702    /// ```
1703    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1704        self.verb = v.into();
1705        self
1706    }
1707
1708    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
1709    ///
1710    /// # Example
1711    /// ```ignore,no_run
1712    /// # use google_cloud_parallelstore_v1::model::OperationMetadata;
1713    /// let x = OperationMetadata::new().set_status_message("example");
1714    /// ```
1715    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1716        self.status_message = v.into();
1717        self
1718    }
1719
1720    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
1721    ///
1722    /// # Example
1723    /// ```ignore,no_run
1724    /// # use google_cloud_parallelstore_v1::model::OperationMetadata;
1725    /// let x = OperationMetadata::new().set_requested_cancellation(true);
1726    /// ```
1727    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1728        self.requested_cancellation = v.into();
1729        self
1730    }
1731
1732    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
1733    ///
1734    /// # Example
1735    /// ```ignore,no_run
1736    /// # use google_cloud_parallelstore_v1::model::OperationMetadata;
1737    /// let x = OperationMetadata::new().set_api_version("example");
1738    /// ```
1739    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1740        self.api_version = v.into();
1741        self
1742    }
1743}
1744
1745impl wkt::message::Message for OperationMetadata {
1746    fn typename() -> &'static str {
1747        "type.googleapis.com/google.cloud.parallelstore.v1.OperationMetadata"
1748    }
1749}
1750
1751/// Cloud Storage as the source of a data transfer.
1752#[derive(Clone, Default, PartialEq)]
1753#[non_exhaustive]
1754pub struct SourceGcsBucket {
1755    /// Required. URI to a Cloud Storage bucket in the format:
1756    /// `gs://<bucket_name>/<path_inside_bucket>`. The path inside the bucket is
1757    /// optional.
1758    pub uri: std::string::String,
1759
1760    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1761}
1762
1763impl SourceGcsBucket {
1764    pub fn new() -> Self {
1765        std::default::Default::default()
1766    }
1767
1768    /// Sets the value of [uri][crate::model::SourceGcsBucket::uri].
1769    ///
1770    /// # Example
1771    /// ```ignore,no_run
1772    /// # use google_cloud_parallelstore_v1::model::SourceGcsBucket;
1773    /// let x = SourceGcsBucket::new().set_uri("example");
1774    /// ```
1775    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1776        self.uri = v.into();
1777        self
1778    }
1779}
1780
1781impl wkt::message::Message for SourceGcsBucket {
1782    fn typename() -> &'static str {
1783        "type.googleapis.com/google.cloud.parallelstore.v1.SourceGcsBucket"
1784    }
1785}
1786
1787/// Cloud Storage as the destination of a data transfer.
1788#[derive(Clone, Default, PartialEq)]
1789#[non_exhaustive]
1790pub struct DestinationGcsBucket {
1791    /// Required. URI to a Cloud Storage bucket in the format:
1792    /// `gs://<bucket_name>/<path_inside_bucket>`. The path inside the bucket is
1793    /// optional.
1794    pub uri: std::string::String,
1795
1796    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1797}
1798
1799impl DestinationGcsBucket {
1800    pub fn new() -> Self {
1801        std::default::Default::default()
1802    }
1803
1804    /// Sets the value of [uri][crate::model::DestinationGcsBucket::uri].
1805    ///
1806    /// # Example
1807    /// ```ignore,no_run
1808    /// # use google_cloud_parallelstore_v1::model::DestinationGcsBucket;
1809    /// let x = DestinationGcsBucket::new().set_uri("example");
1810    /// ```
1811    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1812        self.uri = v.into();
1813        self
1814    }
1815}
1816
1817impl wkt::message::Message for DestinationGcsBucket {
1818    fn typename() -> &'static str {
1819        "type.googleapis.com/google.cloud.parallelstore.v1.DestinationGcsBucket"
1820    }
1821}
1822
1823/// Parallelstore as the source of a data transfer.
1824#[derive(Clone, Default, PartialEq)]
1825#[non_exhaustive]
1826pub struct SourceParallelstore {
1827    /// Optional. Root directory path to the Paralellstore filesystem, starting
1828    /// with `/`. Defaults to `/` if unset.
1829    pub path: std::string::String,
1830
1831    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1832}
1833
1834impl SourceParallelstore {
1835    pub fn new() -> Self {
1836        std::default::Default::default()
1837    }
1838
1839    /// Sets the value of [path][crate::model::SourceParallelstore::path].
1840    ///
1841    /// # Example
1842    /// ```ignore,no_run
1843    /// # use google_cloud_parallelstore_v1::model::SourceParallelstore;
1844    /// let x = SourceParallelstore::new().set_path("example");
1845    /// ```
1846    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1847        self.path = v.into();
1848        self
1849    }
1850}
1851
1852impl wkt::message::Message for SourceParallelstore {
1853    fn typename() -> &'static str {
1854        "type.googleapis.com/google.cloud.parallelstore.v1.SourceParallelstore"
1855    }
1856}
1857
1858/// Parallelstore as the destination of a data transfer.
1859#[derive(Clone, Default, PartialEq)]
1860#[non_exhaustive]
1861pub struct DestinationParallelstore {
1862    /// Optional. Root directory path to the Paralellstore filesystem, starting
1863    /// with `/`. Defaults to `/` if unset.
1864    pub path: std::string::String,
1865
1866    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1867}
1868
1869impl DestinationParallelstore {
1870    pub fn new() -> Self {
1871        std::default::Default::default()
1872    }
1873
1874    /// Sets the value of [path][crate::model::DestinationParallelstore::path].
1875    ///
1876    /// # Example
1877    /// ```ignore,no_run
1878    /// # use google_cloud_parallelstore_v1::model::DestinationParallelstore;
1879    /// let x = DestinationParallelstore::new().set_path("example");
1880    /// ```
1881    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1882        self.path = v.into();
1883        self
1884    }
1885}
1886
1887impl wkt::message::Message for DestinationParallelstore {
1888    fn typename() -> &'static str {
1889        "type.googleapis.com/google.cloud.parallelstore.v1.DestinationParallelstore"
1890    }
1891}
1892
1893/// Import data from Cloud Storage into a Parallelstore instance.
1894#[derive(Clone, Default, PartialEq)]
1895#[non_exhaustive]
1896pub struct ImportDataRequest {
1897    /// Required. Name of the resource.
1898    pub name: std::string::String,
1899
1900    /// Optional. An optional request ID to identify requests. Specify a unique
1901    /// request ID so that if you must retry your request, the server will know to
1902    /// ignore the request if it has already been completed. The server will
1903    /// guarantee that for at least 60 minutes since the first request.
1904    ///
1905    /// For example, consider a situation where you make an initial request and
1906    /// the request times out. If you make the request again with the same request
1907    /// ID, the server can check if original operation with the same request ID
1908    /// was received, and if so, will ignore the second request. This prevents
1909    /// clients from accidentally creating duplicate commitments.
1910    ///
1911    /// The request ID must be a valid UUID with the exception that zero UUID is
1912    /// not supported (00000000-0000-0000-0000-000000000000).
1913    pub request_id: std::string::String,
1914
1915    /// Optional. User-specified service account credentials to be used when
1916    /// performing the transfer.
1917    ///
1918    /// Use one of the following formats:
1919    ///
1920    /// * `{EMAIL_ADDRESS_OR_UNIQUE_ID}`
1921    /// * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}`
1922    /// * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}`
1923    ///
1924    /// If unspecified, the Parallelstore service agent is used:
1925    /// `service-<PROJECT_NUMBER>@gcp-sa-parallelstore.iam.gserviceaccount.com`
1926    pub service_account: std::string::String,
1927
1928    /// Optional. The transfer metadata options for the import data.
1929    pub metadata_options: std::option::Option<crate::model::TransferMetadataOptions>,
1930
1931    /// The source of the data being imported into the Parallelstore instance.
1932    pub source: std::option::Option<crate::model::import_data_request::Source>,
1933
1934    /// The Parallelstore instance into which to import data.
1935    pub destination: std::option::Option<crate::model::import_data_request::Destination>,
1936
1937    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1938}
1939
1940impl ImportDataRequest {
1941    pub fn new() -> Self {
1942        std::default::Default::default()
1943    }
1944
1945    /// Sets the value of [name][crate::model::ImportDataRequest::name].
1946    ///
1947    /// # Example
1948    /// ```ignore,no_run
1949    /// # use google_cloud_parallelstore_v1::model::ImportDataRequest;
1950    /// let x = ImportDataRequest::new().set_name("example");
1951    /// ```
1952    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1953        self.name = v.into();
1954        self
1955    }
1956
1957    /// Sets the value of [request_id][crate::model::ImportDataRequest::request_id].
1958    ///
1959    /// # Example
1960    /// ```ignore,no_run
1961    /// # use google_cloud_parallelstore_v1::model::ImportDataRequest;
1962    /// let x = ImportDataRequest::new().set_request_id("example");
1963    /// ```
1964    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1965        self.request_id = v.into();
1966        self
1967    }
1968
1969    /// Sets the value of [service_account][crate::model::ImportDataRequest::service_account].
1970    ///
1971    /// # Example
1972    /// ```ignore,no_run
1973    /// # use google_cloud_parallelstore_v1::model::ImportDataRequest;
1974    /// let x = ImportDataRequest::new().set_service_account("example");
1975    /// ```
1976    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1977        self.service_account = v.into();
1978        self
1979    }
1980
1981    /// Sets the value of [metadata_options][crate::model::ImportDataRequest::metadata_options].
1982    ///
1983    /// # Example
1984    /// ```ignore,no_run
1985    /// # use google_cloud_parallelstore_v1::model::ImportDataRequest;
1986    /// use google_cloud_parallelstore_v1::model::TransferMetadataOptions;
1987    /// let x = ImportDataRequest::new().set_metadata_options(TransferMetadataOptions::default()/* use setters */);
1988    /// ```
1989    pub fn set_metadata_options<T>(mut self, v: T) -> Self
1990    where
1991        T: std::convert::Into<crate::model::TransferMetadataOptions>,
1992    {
1993        self.metadata_options = std::option::Option::Some(v.into());
1994        self
1995    }
1996
1997    /// Sets or clears the value of [metadata_options][crate::model::ImportDataRequest::metadata_options].
1998    ///
1999    /// # Example
2000    /// ```ignore,no_run
2001    /// # use google_cloud_parallelstore_v1::model::ImportDataRequest;
2002    /// use google_cloud_parallelstore_v1::model::TransferMetadataOptions;
2003    /// let x = ImportDataRequest::new().set_or_clear_metadata_options(Some(TransferMetadataOptions::default()/* use setters */));
2004    /// let x = ImportDataRequest::new().set_or_clear_metadata_options(None::<TransferMetadataOptions>);
2005    /// ```
2006    pub fn set_or_clear_metadata_options<T>(mut self, v: std::option::Option<T>) -> Self
2007    where
2008        T: std::convert::Into<crate::model::TransferMetadataOptions>,
2009    {
2010        self.metadata_options = v.map(|x| x.into());
2011        self
2012    }
2013
2014    /// Sets the value of [source][crate::model::ImportDataRequest::source].
2015    ///
2016    /// Note that all the setters affecting `source` are mutually
2017    /// exclusive.
2018    ///
2019    /// # Example
2020    /// ```ignore,no_run
2021    /// # use google_cloud_parallelstore_v1::model::ImportDataRequest;
2022    /// use google_cloud_parallelstore_v1::model::SourceGcsBucket;
2023    /// let x = ImportDataRequest::new().set_source(Some(
2024    ///     google_cloud_parallelstore_v1::model::import_data_request::Source::SourceGcsBucket(SourceGcsBucket::default().into())));
2025    /// ```
2026    pub fn set_source<
2027        T: std::convert::Into<std::option::Option<crate::model::import_data_request::Source>>,
2028    >(
2029        mut self,
2030        v: T,
2031    ) -> Self {
2032        self.source = v.into();
2033        self
2034    }
2035
2036    /// The value of [source][crate::model::ImportDataRequest::source]
2037    /// if it holds a `SourceGcsBucket`, `None` if the field is not set or
2038    /// holds a different branch.
2039    pub fn source_gcs_bucket(
2040        &self,
2041    ) -> std::option::Option<&std::boxed::Box<crate::model::SourceGcsBucket>> {
2042        #[allow(unreachable_patterns)]
2043        self.source.as_ref().and_then(|v| match v {
2044            crate::model::import_data_request::Source::SourceGcsBucket(v) => {
2045                std::option::Option::Some(v)
2046            }
2047            _ => std::option::Option::None,
2048        })
2049    }
2050
2051    /// Sets the value of [source][crate::model::ImportDataRequest::source]
2052    /// to hold a `SourceGcsBucket`.
2053    ///
2054    /// Note that all the setters affecting `source` are
2055    /// mutually exclusive.
2056    ///
2057    /// # Example
2058    /// ```ignore,no_run
2059    /// # use google_cloud_parallelstore_v1::model::ImportDataRequest;
2060    /// use google_cloud_parallelstore_v1::model::SourceGcsBucket;
2061    /// let x = ImportDataRequest::new().set_source_gcs_bucket(SourceGcsBucket::default()/* use setters */);
2062    /// assert!(x.source_gcs_bucket().is_some());
2063    /// ```
2064    pub fn set_source_gcs_bucket<
2065        T: std::convert::Into<std::boxed::Box<crate::model::SourceGcsBucket>>,
2066    >(
2067        mut self,
2068        v: T,
2069    ) -> Self {
2070        self.source = std::option::Option::Some(
2071            crate::model::import_data_request::Source::SourceGcsBucket(v.into()),
2072        );
2073        self
2074    }
2075
2076    /// Sets the value of [destination][crate::model::ImportDataRequest::destination].
2077    ///
2078    /// Note that all the setters affecting `destination` are mutually
2079    /// exclusive.
2080    ///
2081    /// # Example
2082    /// ```ignore,no_run
2083    /// # use google_cloud_parallelstore_v1::model::ImportDataRequest;
2084    /// use google_cloud_parallelstore_v1::model::DestinationParallelstore;
2085    /// let x = ImportDataRequest::new().set_destination(Some(
2086    ///     google_cloud_parallelstore_v1::model::import_data_request::Destination::DestinationParallelstore(DestinationParallelstore::default().into())));
2087    /// ```
2088    pub fn set_destination<
2089        T: std::convert::Into<std::option::Option<crate::model::import_data_request::Destination>>,
2090    >(
2091        mut self,
2092        v: T,
2093    ) -> Self {
2094        self.destination = v.into();
2095        self
2096    }
2097
2098    /// The value of [destination][crate::model::ImportDataRequest::destination]
2099    /// if it holds a `DestinationParallelstore`, `None` if the field is not set or
2100    /// holds a different branch.
2101    pub fn destination_parallelstore(
2102        &self,
2103    ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationParallelstore>> {
2104        #[allow(unreachable_patterns)]
2105        self.destination.as_ref().and_then(|v| match v {
2106            crate::model::import_data_request::Destination::DestinationParallelstore(v) => {
2107                std::option::Option::Some(v)
2108            }
2109            _ => std::option::Option::None,
2110        })
2111    }
2112
2113    /// Sets the value of [destination][crate::model::ImportDataRequest::destination]
2114    /// to hold a `DestinationParallelstore`.
2115    ///
2116    /// Note that all the setters affecting `destination` are
2117    /// mutually exclusive.
2118    ///
2119    /// # Example
2120    /// ```ignore,no_run
2121    /// # use google_cloud_parallelstore_v1::model::ImportDataRequest;
2122    /// use google_cloud_parallelstore_v1::model::DestinationParallelstore;
2123    /// let x = ImportDataRequest::new().set_destination_parallelstore(DestinationParallelstore::default()/* use setters */);
2124    /// assert!(x.destination_parallelstore().is_some());
2125    /// ```
2126    pub fn set_destination_parallelstore<
2127        T: std::convert::Into<std::boxed::Box<crate::model::DestinationParallelstore>>,
2128    >(
2129        mut self,
2130        v: T,
2131    ) -> Self {
2132        self.destination = std::option::Option::Some(
2133            crate::model::import_data_request::Destination::DestinationParallelstore(v.into()),
2134        );
2135        self
2136    }
2137}
2138
2139impl wkt::message::Message for ImportDataRequest {
2140    fn typename() -> &'static str {
2141        "type.googleapis.com/google.cloud.parallelstore.v1.ImportDataRequest"
2142    }
2143}
2144
2145/// Defines additional types related to [ImportDataRequest].
2146pub mod import_data_request {
2147    #[allow(unused_imports)]
2148    use super::*;
2149
2150    /// The source of the data being imported into the Parallelstore instance.
2151    #[derive(Clone, Debug, PartialEq)]
2152    #[non_exhaustive]
2153    pub enum Source {
2154        /// The Cloud Storage source bucket and, optionally, path inside the bucket.
2155        SourceGcsBucket(std::boxed::Box<crate::model::SourceGcsBucket>),
2156    }
2157
2158    /// The Parallelstore instance into which to import data.
2159    #[derive(Clone, Debug, PartialEq)]
2160    #[non_exhaustive]
2161    pub enum Destination {
2162        /// Parallelstore destination.
2163        DestinationParallelstore(std::boxed::Box<crate::model::DestinationParallelstore>),
2164    }
2165}
2166
2167/// Export data from Parallelstore to Cloud Storage.
2168#[derive(Clone, Default, PartialEq)]
2169#[non_exhaustive]
2170pub struct ExportDataRequest {
2171    /// Required. Name of the resource.
2172    pub name: std::string::String,
2173
2174    /// Optional. An optional request ID to identify requests. Specify a unique
2175    /// request ID so that if you must retry your request, the server will know to
2176    /// ignore the request if it has already been completed. The server will
2177    /// guarantee that for at least 60 minutes since the first request.
2178    ///
2179    /// For example, consider a situation where you make an initial request and
2180    /// the request times out. If you make the request again with the same request
2181    /// ID, the server can check if original operation with the same request ID
2182    /// was received, and if so, will ignore the second request. This prevents
2183    /// clients from accidentally creating duplicate commitments.
2184    ///
2185    /// The request ID must be a valid UUID with the exception that zero UUID is
2186    /// not supported (00000000-0000-0000-0000-000000000000).
2187    pub request_id: std::string::String,
2188
2189    /// Optional. User-specified Service Account (SA) credentials to be used when
2190    /// performing the transfer.
2191    /// Use one of the following formats:
2192    ///
2193    /// * `{EMAIL_ADDRESS_OR_UNIQUE_ID}`
2194    /// * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}`
2195    /// * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}`
2196    ///
2197    /// If unspecified, the Parallelstore service agent is used:
2198    /// `service-<PROJECT_NUMBER>@gcp-sa-parallelstore.iam.gserviceaccount.com`
2199    pub service_account: std::string::String,
2200
2201    /// Optional. The metadata options for the export data.
2202    pub metadata_options: std::option::Option<crate::model::TransferMetadataOptions>,
2203
2204    /// The Parallelstore instance to export from.
2205    pub source: std::option::Option<crate::model::export_data_request::Source>,
2206
2207    /// The Cloud Storage bucket to export to.
2208    pub destination: std::option::Option<crate::model::export_data_request::Destination>,
2209
2210    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2211}
2212
2213impl ExportDataRequest {
2214    pub fn new() -> Self {
2215        std::default::Default::default()
2216    }
2217
2218    /// Sets the value of [name][crate::model::ExportDataRequest::name].
2219    ///
2220    /// # Example
2221    /// ```ignore,no_run
2222    /// # use google_cloud_parallelstore_v1::model::ExportDataRequest;
2223    /// let x = ExportDataRequest::new().set_name("example");
2224    /// ```
2225    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2226        self.name = v.into();
2227        self
2228    }
2229
2230    /// Sets the value of [request_id][crate::model::ExportDataRequest::request_id].
2231    ///
2232    /// # Example
2233    /// ```ignore,no_run
2234    /// # use google_cloud_parallelstore_v1::model::ExportDataRequest;
2235    /// let x = ExportDataRequest::new().set_request_id("example");
2236    /// ```
2237    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2238        self.request_id = v.into();
2239        self
2240    }
2241
2242    /// Sets the value of [service_account][crate::model::ExportDataRequest::service_account].
2243    ///
2244    /// # Example
2245    /// ```ignore,no_run
2246    /// # use google_cloud_parallelstore_v1::model::ExportDataRequest;
2247    /// let x = ExportDataRequest::new().set_service_account("example");
2248    /// ```
2249    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2250        self.service_account = v.into();
2251        self
2252    }
2253
2254    /// Sets the value of [metadata_options][crate::model::ExportDataRequest::metadata_options].
2255    ///
2256    /// # Example
2257    /// ```ignore,no_run
2258    /// # use google_cloud_parallelstore_v1::model::ExportDataRequest;
2259    /// use google_cloud_parallelstore_v1::model::TransferMetadataOptions;
2260    /// let x = ExportDataRequest::new().set_metadata_options(TransferMetadataOptions::default()/* use setters */);
2261    /// ```
2262    pub fn set_metadata_options<T>(mut self, v: T) -> Self
2263    where
2264        T: std::convert::Into<crate::model::TransferMetadataOptions>,
2265    {
2266        self.metadata_options = std::option::Option::Some(v.into());
2267        self
2268    }
2269
2270    /// Sets or clears the value of [metadata_options][crate::model::ExportDataRequest::metadata_options].
2271    ///
2272    /// # Example
2273    /// ```ignore,no_run
2274    /// # use google_cloud_parallelstore_v1::model::ExportDataRequest;
2275    /// use google_cloud_parallelstore_v1::model::TransferMetadataOptions;
2276    /// let x = ExportDataRequest::new().set_or_clear_metadata_options(Some(TransferMetadataOptions::default()/* use setters */));
2277    /// let x = ExportDataRequest::new().set_or_clear_metadata_options(None::<TransferMetadataOptions>);
2278    /// ```
2279    pub fn set_or_clear_metadata_options<T>(mut self, v: std::option::Option<T>) -> Self
2280    where
2281        T: std::convert::Into<crate::model::TransferMetadataOptions>,
2282    {
2283        self.metadata_options = v.map(|x| x.into());
2284        self
2285    }
2286
2287    /// Sets the value of [source][crate::model::ExportDataRequest::source].
2288    ///
2289    /// Note that all the setters affecting `source` are mutually
2290    /// exclusive.
2291    ///
2292    /// # Example
2293    /// ```ignore,no_run
2294    /// # use google_cloud_parallelstore_v1::model::ExportDataRequest;
2295    /// use google_cloud_parallelstore_v1::model::SourceParallelstore;
2296    /// let x = ExportDataRequest::new().set_source(Some(
2297    ///     google_cloud_parallelstore_v1::model::export_data_request::Source::SourceParallelstore(SourceParallelstore::default().into())));
2298    /// ```
2299    pub fn set_source<
2300        T: std::convert::Into<std::option::Option<crate::model::export_data_request::Source>>,
2301    >(
2302        mut self,
2303        v: T,
2304    ) -> Self {
2305        self.source = v.into();
2306        self
2307    }
2308
2309    /// The value of [source][crate::model::ExportDataRequest::source]
2310    /// if it holds a `SourceParallelstore`, `None` if the field is not set or
2311    /// holds a different branch.
2312    pub fn source_parallelstore(
2313        &self,
2314    ) -> std::option::Option<&std::boxed::Box<crate::model::SourceParallelstore>> {
2315        #[allow(unreachable_patterns)]
2316        self.source.as_ref().and_then(|v| match v {
2317            crate::model::export_data_request::Source::SourceParallelstore(v) => {
2318                std::option::Option::Some(v)
2319            }
2320            _ => std::option::Option::None,
2321        })
2322    }
2323
2324    /// Sets the value of [source][crate::model::ExportDataRequest::source]
2325    /// to hold a `SourceParallelstore`.
2326    ///
2327    /// Note that all the setters affecting `source` are
2328    /// mutually exclusive.
2329    ///
2330    /// # Example
2331    /// ```ignore,no_run
2332    /// # use google_cloud_parallelstore_v1::model::ExportDataRequest;
2333    /// use google_cloud_parallelstore_v1::model::SourceParallelstore;
2334    /// let x = ExportDataRequest::new().set_source_parallelstore(SourceParallelstore::default()/* use setters */);
2335    /// assert!(x.source_parallelstore().is_some());
2336    /// ```
2337    pub fn set_source_parallelstore<
2338        T: std::convert::Into<std::boxed::Box<crate::model::SourceParallelstore>>,
2339    >(
2340        mut self,
2341        v: T,
2342    ) -> Self {
2343        self.source = std::option::Option::Some(
2344            crate::model::export_data_request::Source::SourceParallelstore(v.into()),
2345        );
2346        self
2347    }
2348
2349    /// Sets the value of [destination][crate::model::ExportDataRequest::destination].
2350    ///
2351    /// Note that all the setters affecting `destination` are mutually
2352    /// exclusive.
2353    ///
2354    /// # Example
2355    /// ```ignore,no_run
2356    /// # use google_cloud_parallelstore_v1::model::ExportDataRequest;
2357    /// use google_cloud_parallelstore_v1::model::DestinationGcsBucket;
2358    /// let x = ExportDataRequest::new().set_destination(Some(
2359    ///     google_cloud_parallelstore_v1::model::export_data_request::Destination::DestinationGcsBucket(DestinationGcsBucket::default().into())));
2360    /// ```
2361    pub fn set_destination<
2362        T: std::convert::Into<std::option::Option<crate::model::export_data_request::Destination>>,
2363    >(
2364        mut self,
2365        v: T,
2366    ) -> Self {
2367        self.destination = v.into();
2368        self
2369    }
2370
2371    /// The value of [destination][crate::model::ExportDataRequest::destination]
2372    /// if it holds a `DestinationGcsBucket`, `None` if the field is not set or
2373    /// holds a different branch.
2374    pub fn destination_gcs_bucket(
2375        &self,
2376    ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationGcsBucket>> {
2377        #[allow(unreachable_patterns)]
2378        self.destination.as_ref().and_then(|v| match v {
2379            crate::model::export_data_request::Destination::DestinationGcsBucket(v) => {
2380                std::option::Option::Some(v)
2381            }
2382            _ => std::option::Option::None,
2383        })
2384    }
2385
2386    /// Sets the value of [destination][crate::model::ExportDataRequest::destination]
2387    /// to hold a `DestinationGcsBucket`.
2388    ///
2389    /// Note that all the setters affecting `destination` are
2390    /// mutually exclusive.
2391    ///
2392    /// # Example
2393    /// ```ignore,no_run
2394    /// # use google_cloud_parallelstore_v1::model::ExportDataRequest;
2395    /// use google_cloud_parallelstore_v1::model::DestinationGcsBucket;
2396    /// let x = ExportDataRequest::new().set_destination_gcs_bucket(DestinationGcsBucket::default()/* use setters */);
2397    /// assert!(x.destination_gcs_bucket().is_some());
2398    /// ```
2399    pub fn set_destination_gcs_bucket<
2400        T: std::convert::Into<std::boxed::Box<crate::model::DestinationGcsBucket>>,
2401    >(
2402        mut self,
2403        v: T,
2404    ) -> Self {
2405        self.destination = std::option::Option::Some(
2406            crate::model::export_data_request::Destination::DestinationGcsBucket(v.into()),
2407        );
2408        self
2409    }
2410}
2411
2412impl wkt::message::Message for ExportDataRequest {
2413    fn typename() -> &'static str {
2414        "type.googleapis.com/google.cloud.parallelstore.v1.ExportDataRequest"
2415    }
2416}
2417
2418/// Defines additional types related to [ExportDataRequest].
2419pub mod export_data_request {
2420    #[allow(unused_imports)]
2421    use super::*;
2422
2423    /// The Parallelstore instance to export from.
2424    #[derive(Clone, Debug, PartialEq)]
2425    #[non_exhaustive]
2426    pub enum Source {
2427        /// Parallelstore source.
2428        SourceParallelstore(std::boxed::Box<crate::model::SourceParallelstore>),
2429    }
2430
2431    /// The Cloud Storage bucket to export to.
2432    #[derive(Clone, Debug, PartialEq)]
2433    #[non_exhaustive]
2434    pub enum Destination {
2435        /// Cloud Storage destination.
2436        DestinationGcsBucket(std::boxed::Box<crate::model::DestinationGcsBucket>),
2437    }
2438}
2439
2440/// The response to a request to import data to Parallelstore.
2441#[derive(Clone, Default, PartialEq)]
2442#[non_exhaustive]
2443pub struct ImportDataResponse {
2444    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2445}
2446
2447impl ImportDataResponse {
2448    pub fn new() -> Self {
2449        std::default::Default::default()
2450    }
2451}
2452
2453impl wkt::message::Message for ImportDataResponse {
2454    fn typename() -> &'static str {
2455        "type.googleapis.com/google.cloud.parallelstore.v1.ImportDataResponse"
2456    }
2457}
2458
2459/// An entry describing an error that has occurred.
2460#[derive(Clone, Default, PartialEq)]
2461#[non_exhaustive]
2462pub struct TransferErrorLogEntry {
2463    /// A URL that refers to the target (a data source, a data sink,
2464    /// or an object) with which the error is associated.
2465    pub uri: std::string::String,
2466
2467    /// A list of messages that carry the error details.
2468    pub error_details: std::vec::Vec<std::string::String>,
2469
2470    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2471}
2472
2473impl TransferErrorLogEntry {
2474    pub fn new() -> Self {
2475        std::default::Default::default()
2476    }
2477
2478    /// Sets the value of [uri][crate::model::TransferErrorLogEntry::uri].
2479    ///
2480    /// # Example
2481    /// ```ignore,no_run
2482    /// # use google_cloud_parallelstore_v1::model::TransferErrorLogEntry;
2483    /// let x = TransferErrorLogEntry::new().set_uri("example");
2484    /// ```
2485    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2486        self.uri = v.into();
2487        self
2488    }
2489
2490    /// Sets the value of [error_details][crate::model::TransferErrorLogEntry::error_details].
2491    ///
2492    /// # Example
2493    /// ```ignore,no_run
2494    /// # use google_cloud_parallelstore_v1::model::TransferErrorLogEntry;
2495    /// let x = TransferErrorLogEntry::new().set_error_details(["a", "b", "c"]);
2496    /// ```
2497    pub fn set_error_details<T, V>(mut self, v: T) -> Self
2498    where
2499        T: std::iter::IntoIterator<Item = V>,
2500        V: std::convert::Into<std::string::String>,
2501    {
2502        use std::iter::Iterator;
2503        self.error_details = v.into_iter().map(|i| i.into()).collect();
2504        self
2505    }
2506}
2507
2508impl wkt::message::Message for TransferErrorLogEntry {
2509    fn typename() -> &'static str {
2510        "type.googleapis.com/google.cloud.parallelstore.v1.TransferErrorLogEntry"
2511    }
2512}
2513
2514/// A summary of errors by error code, plus a count and sample error log
2515/// entries.
2516#[derive(Clone, Default, PartialEq)]
2517#[non_exhaustive]
2518pub struct TransferErrorSummary {
2519    /// One of the error codes that caused the transfer failure.
2520    pub error_code: google_cloud_rpc::model::Code,
2521
2522    /// Count of this type of error.
2523    pub error_count: i64,
2524
2525    /// A list of messages that carry the error details.
2526    pub error_log_entries: std::vec::Vec<crate::model::TransferErrorLogEntry>,
2527
2528    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2529}
2530
2531impl TransferErrorSummary {
2532    pub fn new() -> Self {
2533        std::default::Default::default()
2534    }
2535
2536    /// Sets the value of [error_code][crate::model::TransferErrorSummary::error_code].
2537    ///
2538    /// # Example
2539    /// ```ignore,no_run
2540    /// # use google_cloud_parallelstore_v1::model::TransferErrorSummary;
2541    /// use google_cloud_rpc::model::Code;
2542    /// let x0 = TransferErrorSummary::new().set_error_code(Code::Cancelled);
2543    /// let x1 = TransferErrorSummary::new().set_error_code(Code::Unknown);
2544    /// let x2 = TransferErrorSummary::new().set_error_code(Code::InvalidArgument);
2545    /// ```
2546    pub fn set_error_code<T: std::convert::Into<google_cloud_rpc::model::Code>>(
2547        mut self,
2548        v: T,
2549    ) -> Self {
2550        self.error_code = v.into();
2551        self
2552    }
2553
2554    /// Sets the value of [error_count][crate::model::TransferErrorSummary::error_count].
2555    ///
2556    /// # Example
2557    /// ```ignore,no_run
2558    /// # use google_cloud_parallelstore_v1::model::TransferErrorSummary;
2559    /// let x = TransferErrorSummary::new().set_error_count(42);
2560    /// ```
2561    pub fn set_error_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2562        self.error_count = v.into();
2563        self
2564    }
2565
2566    /// Sets the value of [error_log_entries][crate::model::TransferErrorSummary::error_log_entries].
2567    ///
2568    /// # Example
2569    /// ```ignore,no_run
2570    /// # use google_cloud_parallelstore_v1::model::TransferErrorSummary;
2571    /// use google_cloud_parallelstore_v1::model::TransferErrorLogEntry;
2572    /// let x = TransferErrorSummary::new()
2573    ///     .set_error_log_entries([
2574    ///         TransferErrorLogEntry::default()/* use setters */,
2575    ///         TransferErrorLogEntry::default()/* use (different) setters */,
2576    ///     ]);
2577    /// ```
2578    pub fn set_error_log_entries<T, V>(mut self, v: T) -> Self
2579    where
2580        T: std::iter::IntoIterator<Item = V>,
2581        V: std::convert::Into<crate::model::TransferErrorLogEntry>,
2582    {
2583        use std::iter::Iterator;
2584        self.error_log_entries = v.into_iter().map(|i| i.into()).collect();
2585        self
2586    }
2587}
2588
2589impl wkt::message::Message for TransferErrorSummary {
2590    fn typename() -> &'static str {
2591        "type.googleapis.com/google.cloud.parallelstore.v1.TransferErrorSummary"
2592    }
2593}
2594
2595/// Metadata related to the data import operation.
2596#[derive(Clone, Default, PartialEq)]
2597#[non_exhaustive]
2598pub struct ImportDataMetadata {
2599    /// Data transfer operation metadata.
2600    pub operation_metadata: std::option::Option<crate::model::TransferOperationMetadata>,
2601
2602    /// Output only. The time the operation was created.
2603    pub create_time: std::option::Option<wkt::Timestamp>,
2604
2605    /// Output only. The time the operation finished running.
2606    pub end_time: std::option::Option<wkt::Timestamp>,
2607
2608    /// Output only. Server-defined resource path for the target of the operation.
2609    pub target: std::string::String,
2610
2611    /// Output only. Name of the verb executed by the operation.
2612    pub verb: std::string::String,
2613
2614    /// Output only. Human-readable status of the operation, if any.
2615    pub status_message: std::string::String,
2616
2617    /// Output only. Identifies whether the user has requested cancellation
2618    /// of the operation. Operations that have successfully been cancelled
2619    /// have [Operation.error][google.longrunning.Operation.error] value with a
2620    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
2621    /// `Code.CANCELLED`.
2622    ///
2623    /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
2624    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
2625    pub requested_cancellation: bool,
2626
2627    /// Output only. API version used to start the operation.
2628    pub api_version: std::string::String,
2629
2630    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2631}
2632
2633impl ImportDataMetadata {
2634    pub fn new() -> Self {
2635        std::default::Default::default()
2636    }
2637
2638    /// Sets the value of [operation_metadata][crate::model::ImportDataMetadata::operation_metadata].
2639    ///
2640    /// # Example
2641    /// ```ignore,no_run
2642    /// # use google_cloud_parallelstore_v1::model::ImportDataMetadata;
2643    /// use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
2644    /// let x = ImportDataMetadata::new().set_operation_metadata(TransferOperationMetadata::default()/* use setters */);
2645    /// ```
2646    pub fn set_operation_metadata<T>(mut self, v: T) -> Self
2647    where
2648        T: std::convert::Into<crate::model::TransferOperationMetadata>,
2649    {
2650        self.operation_metadata = std::option::Option::Some(v.into());
2651        self
2652    }
2653
2654    /// Sets or clears the value of [operation_metadata][crate::model::ImportDataMetadata::operation_metadata].
2655    ///
2656    /// # Example
2657    /// ```ignore,no_run
2658    /// # use google_cloud_parallelstore_v1::model::ImportDataMetadata;
2659    /// use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
2660    /// let x = ImportDataMetadata::new().set_or_clear_operation_metadata(Some(TransferOperationMetadata::default()/* use setters */));
2661    /// let x = ImportDataMetadata::new().set_or_clear_operation_metadata(None::<TransferOperationMetadata>);
2662    /// ```
2663    pub fn set_or_clear_operation_metadata<T>(mut self, v: std::option::Option<T>) -> Self
2664    where
2665        T: std::convert::Into<crate::model::TransferOperationMetadata>,
2666    {
2667        self.operation_metadata = v.map(|x| x.into());
2668        self
2669    }
2670
2671    /// Sets the value of [create_time][crate::model::ImportDataMetadata::create_time].
2672    ///
2673    /// # Example
2674    /// ```ignore,no_run
2675    /// # use google_cloud_parallelstore_v1::model::ImportDataMetadata;
2676    /// use wkt::Timestamp;
2677    /// let x = ImportDataMetadata::new().set_create_time(Timestamp::default()/* use setters */);
2678    /// ```
2679    pub fn set_create_time<T>(mut self, v: T) -> Self
2680    where
2681        T: std::convert::Into<wkt::Timestamp>,
2682    {
2683        self.create_time = std::option::Option::Some(v.into());
2684        self
2685    }
2686
2687    /// Sets or clears the value of [create_time][crate::model::ImportDataMetadata::create_time].
2688    ///
2689    /// # Example
2690    /// ```ignore,no_run
2691    /// # use google_cloud_parallelstore_v1::model::ImportDataMetadata;
2692    /// use wkt::Timestamp;
2693    /// let x = ImportDataMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2694    /// let x = ImportDataMetadata::new().set_or_clear_create_time(None::<Timestamp>);
2695    /// ```
2696    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2697    where
2698        T: std::convert::Into<wkt::Timestamp>,
2699    {
2700        self.create_time = v.map(|x| x.into());
2701        self
2702    }
2703
2704    /// Sets the value of [end_time][crate::model::ImportDataMetadata::end_time].
2705    ///
2706    /// # Example
2707    /// ```ignore,no_run
2708    /// # use google_cloud_parallelstore_v1::model::ImportDataMetadata;
2709    /// use wkt::Timestamp;
2710    /// let x = ImportDataMetadata::new().set_end_time(Timestamp::default()/* use setters */);
2711    /// ```
2712    pub fn set_end_time<T>(mut self, v: T) -> Self
2713    where
2714        T: std::convert::Into<wkt::Timestamp>,
2715    {
2716        self.end_time = std::option::Option::Some(v.into());
2717        self
2718    }
2719
2720    /// Sets or clears the value of [end_time][crate::model::ImportDataMetadata::end_time].
2721    ///
2722    /// # Example
2723    /// ```ignore,no_run
2724    /// # use google_cloud_parallelstore_v1::model::ImportDataMetadata;
2725    /// use wkt::Timestamp;
2726    /// let x = ImportDataMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2727    /// let x = ImportDataMetadata::new().set_or_clear_end_time(None::<Timestamp>);
2728    /// ```
2729    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2730    where
2731        T: std::convert::Into<wkt::Timestamp>,
2732    {
2733        self.end_time = v.map(|x| x.into());
2734        self
2735    }
2736
2737    /// Sets the value of [target][crate::model::ImportDataMetadata::target].
2738    ///
2739    /// # Example
2740    /// ```ignore,no_run
2741    /// # use google_cloud_parallelstore_v1::model::ImportDataMetadata;
2742    /// let x = ImportDataMetadata::new().set_target("example");
2743    /// ```
2744    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2745        self.target = v.into();
2746        self
2747    }
2748
2749    /// Sets the value of [verb][crate::model::ImportDataMetadata::verb].
2750    ///
2751    /// # Example
2752    /// ```ignore,no_run
2753    /// # use google_cloud_parallelstore_v1::model::ImportDataMetadata;
2754    /// let x = ImportDataMetadata::new().set_verb("example");
2755    /// ```
2756    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2757        self.verb = v.into();
2758        self
2759    }
2760
2761    /// Sets the value of [status_message][crate::model::ImportDataMetadata::status_message].
2762    ///
2763    /// # Example
2764    /// ```ignore,no_run
2765    /// # use google_cloud_parallelstore_v1::model::ImportDataMetadata;
2766    /// let x = ImportDataMetadata::new().set_status_message("example");
2767    /// ```
2768    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2769        self.status_message = v.into();
2770        self
2771    }
2772
2773    /// Sets the value of [requested_cancellation][crate::model::ImportDataMetadata::requested_cancellation].
2774    ///
2775    /// # Example
2776    /// ```ignore,no_run
2777    /// # use google_cloud_parallelstore_v1::model::ImportDataMetadata;
2778    /// let x = ImportDataMetadata::new().set_requested_cancellation(true);
2779    /// ```
2780    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2781        self.requested_cancellation = v.into();
2782        self
2783    }
2784
2785    /// Sets the value of [api_version][crate::model::ImportDataMetadata::api_version].
2786    ///
2787    /// # Example
2788    /// ```ignore,no_run
2789    /// # use google_cloud_parallelstore_v1::model::ImportDataMetadata;
2790    /// let x = ImportDataMetadata::new().set_api_version("example");
2791    /// ```
2792    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2793        self.api_version = v.into();
2794        self
2795    }
2796}
2797
2798impl wkt::message::Message for ImportDataMetadata {
2799    fn typename() -> &'static str {
2800        "type.googleapis.com/google.cloud.parallelstore.v1.ImportDataMetadata"
2801    }
2802}
2803
2804/// The response to a request to export data from Parallelstore.
2805#[derive(Clone, Default, PartialEq)]
2806#[non_exhaustive]
2807pub struct ExportDataResponse {
2808    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2809}
2810
2811impl ExportDataResponse {
2812    pub fn new() -> Self {
2813        std::default::Default::default()
2814    }
2815}
2816
2817impl wkt::message::Message for ExportDataResponse {
2818    fn typename() -> &'static str {
2819        "type.googleapis.com/google.cloud.parallelstore.v1.ExportDataResponse"
2820    }
2821}
2822
2823/// Metadata related to the data export operation.
2824#[derive(Clone, Default, PartialEq)]
2825#[non_exhaustive]
2826pub struct ExportDataMetadata {
2827    /// Data transfer operation metadata.
2828    pub operation_metadata: std::option::Option<crate::model::TransferOperationMetadata>,
2829
2830    /// Output only. The time the operation was created.
2831    pub create_time: std::option::Option<wkt::Timestamp>,
2832
2833    /// Output only. The time the operation finished running.
2834    pub end_time: std::option::Option<wkt::Timestamp>,
2835
2836    /// Output only. Server-defined resource path for the target of the operation.
2837    pub target: std::string::String,
2838
2839    /// Output only. Name of the verb executed by the operation.
2840    pub verb: std::string::String,
2841
2842    /// Output only. Human-readable status of the operation, if any.
2843    pub status_message: std::string::String,
2844
2845    /// Output only. Identifies whether the user has requested cancellation
2846    /// of the operation. Operations that have successfully been cancelled
2847    /// have [Operation.error][google.longrunning.Operation.error] value with a
2848    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
2849    /// `Code.CANCELLED`.
2850    ///
2851    /// [google.longrunning.Operation.error]: google_cloud_longrunning::model::Operation::result
2852    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
2853    pub requested_cancellation: bool,
2854
2855    /// Output only. API version used to start the operation.
2856    pub api_version: std::string::String,
2857
2858    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2859}
2860
2861impl ExportDataMetadata {
2862    pub fn new() -> Self {
2863        std::default::Default::default()
2864    }
2865
2866    /// Sets the value of [operation_metadata][crate::model::ExportDataMetadata::operation_metadata].
2867    ///
2868    /// # Example
2869    /// ```ignore,no_run
2870    /// # use google_cloud_parallelstore_v1::model::ExportDataMetadata;
2871    /// use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
2872    /// let x = ExportDataMetadata::new().set_operation_metadata(TransferOperationMetadata::default()/* use setters */);
2873    /// ```
2874    pub fn set_operation_metadata<T>(mut self, v: T) -> Self
2875    where
2876        T: std::convert::Into<crate::model::TransferOperationMetadata>,
2877    {
2878        self.operation_metadata = std::option::Option::Some(v.into());
2879        self
2880    }
2881
2882    /// Sets or clears the value of [operation_metadata][crate::model::ExportDataMetadata::operation_metadata].
2883    ///
2884    /// # Example
2885    /// ```ignore,no_run
2886    /// # use google_cloud_parallelstore_v1::model::ExportDataMetadata;
2887    /// use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
2888    /// let x = ExportDataMetadata::new().set_or_clear_operation_metadata(Some(TransferOperationMetadata::default()/* use setters */));
2889    /// let x = ExportDataMetadata::new().set_or_clear_operation_metadata(None::<TransferOperationMetadata>);
2890    /// ```
2891    pub fn set_or_clear_operation_metadata<T>(mut self, v: std::option::Option<T>) -> Self
2892    where
2893        T: std::convert::Into<crate::model::TransferOperationMetadata>,
2894    {
2895        self.operation_metadata = v.map(|x| x.into());
2896        self
2897    }
2898
2899    /// Sets the value of [create_time][crate::model::ExportDataMetadata::create_time].
2900    ///
2901    /// # Example
2902    /// ```ignore,no_run
2903    /// # use google_cloud_parallelstore_v1::model::ExportDataMetadata;
2904    /// use wkt::Timestamp;
2905    /// let x = ExportDataMetadata::new().set_create_time(Timestamp::default()/* use setters */);
2906    /// ```
2907    pub fn set_create_time<T>(mut self, v: T) -> Self
2908    where
2909        T: std::convert::Into<wkt::Timestamp>,
2910    {
2911        self.create_time = std::option::Option::Some(v.into());
2912        self
2913    }
2914
2915    /// Sets or clears the value of [create_time][crate::model::ExportDataMetadata::create_time].
2916    ///
2917    /// # Example
2918    /// ```ignore,no_run
2919    /// # use google_cloud_parallelstore_v1::model::ExportDataMetadata;
2920    /// use wkt::Timestamp;
2921    /// let x = ExportDataMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2922    /// let x = ExportDataMetadata::new().set_or_clear_create_time(None::<Timestamp>);
2923    /// ```
2924    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2925    where
2926        T: std::convert::Into<wkt::Timestamp>,
2927    {
2928        self.create_time = v.map(|x| x.into());
2929        self
2930    }
2931
2932    /// Sets the value of [end_time][crate::model::ExportDataMetadata::end_time].
2933    ///
2934    /// # Example
2935    /// ```ignore,no_run
2936    /// # use google_cloud_parallelstore_v1::model::ExportDataMetadata;
2937    /// use wkt::Timestamp;
2938    /// let x = ExportDataMetadata::new().set_end_time(Timestamp::default()/* use setters */);
2939    /// ```
2940    pub fn set_end_time<T>(mut self, v: T) -> Self
2941    where
2942        T: std::convert::Into<wkt::Timestamp>,
2943    {
2944        self.end_time = std::option::Option::Some(v.into());
2945        self
2946    }
2947
2948    /// Sets or clears the value of [end_time][crate::model::ExportDataMetadata::end_time].
2949    ///
2950    /// # Example
2951    /// ```ignore,no_run
2952    /// # use google_cloud_parallelstore_v1::model::ExportDataMetadata;
2953    /// use wkt::Timestamp;
2954    /// let x = ExportDataMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
2955    /// let x = ExportDataMetadata::new().set_or_clear_end_time(None::<Timestamp>);
2956    /// ```
2957    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2958    where
2959        T: std::convert::Into<wkt::Timestamp>,
2960    {
2961        self.end_time = v.map(|x| x.into());
2962        self
2963    }
2964
2965    /// Sets the value of [target][crate::model::ExportDataMetadata::target].
2966    ///
2967    /// # Example
2968    /// ```ignore,no_run
2969    /// # use google_cloud_parallelstore_v1::model::ExportDataMetadata;
2970    /// let x = ExportDataMetadata::new().set_target("example");
2971    /// ```
2972    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2973        self.target = v.into();
2974        self
2975    }
2976
2977    /// Sets the value of [verb][crate::model::ExportDataMetadata::verb].
2978    ///
2979    /// # Example
2980    /// ```ignore,no_run
2981    /// # use google_cloud_parallelstore_v1::model::ExportDataMetadata;
2982    /// let x = ExportDataMetadata::new().set_verb("example");
2983    /// ```
2984    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2985        self.verb = v.into();
2986        self
2987    }
2988
2989    /// Sets the value of [status_message][crate::model::ExportDataMetadata::status_message].
2990    ///
2991    /// # Example
2992    /// ```ignore,no_run
2993    /// # use google_cloud_parallelstore_v1::model::ExportDataMetadata;
2994    /// let x = ExportDataMetadata::new().set_status_message("example");
2995    /// ```
2996    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2997        self.status_message = v.into();
2998        self
2999    }
3000
3001    /// Sets the value of [requested_cancellation][crate::model::ExportDataMetadata::requested_cancellation].
3002    ///
3003    /// # Example
3004    /// ```ignore,no_run
3005    /// # use google_cloud_parallelstore_v1::model::ExportDataMetadata;
3006    /// let x = ExportDataMetadata::new().set_requested_cancellation(true);
3007    /// ```
3008    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3009        self.requested_cancellation = v.into();
3010        self
3011    }
3012
3013    /// Sets the value of [api_version][crate::model::ExportDataMetadata::api_version].
3014    ///
3015    /// # Example
3016    /// ```ignore,no_run
3017    /// # use google_cloud_parallelstore_v1::model::ExportDataMetadata;
3018    /// let x = ExportDataMetadata::new().set_api_version("example");
3019    /// ```
3020    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3021        self.api_version = v.into();
3022        self
3023    }
3024}
3025
3026impl wkt::message::Message for ExportDataMetadata {
3027    fn typename() -> &'static str {
3028        "type.googleapis.com/google.cloud.parallelstore.v1.ExportDataMetadata"
3029    }
3030}
3031
3032/// Long-running operation metadata related to a data transfer.
3033#[derive(Clone, Default, PartialEq)]
3034#[non_exhaustive]
3035pub struct TransferOperationMetadata {
3036    /// Output only. The progress of the transfer operation.
3037    pub counters: std::option::Option<crate::model::TransferCounters>,
3038
3039    /// Output only. The type of transfer occurring.
3040    pub transfer_type: crate::model::TransferType,
3041
3042    /// Output only. List of files that failed to be transferred. This list will
3043    /// have a maximum size of 5 elements.
3044    pub error_summary: std::vec::Vec<crate::model::TransferErrorSummary>,
3045
3046    /// The source of transfer operation.
3047    pub source: std::option::Option<crate::model::transfer_operation_metadata::Source>,
3048
3049    /// The destination of transfer operation.
3050    pub destination: std::option::Option<crate::model::transfer_operation_metadata::Destination>,
3051
3052    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3053}
3054
3055impl TransferOperationMetadata {
3056    pub fn new() -> Self {
3057        std::default::Default::default()
3058    }
3059
3060    /// Sets the value of [counters][crate::model::TransferOperationMetadata::counters].
3061    ///
3062    /// # Example
3063    /// ```ignore,no_run
3064    /// # use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
3065    /// use google_cloud_parallelstore_v1::model::TransferCounters;
3066    /// let x = TransferOperationMetadata::new().set_counters(TransferCounters::default()/* use setters */);
3067    /// ```
3068    pub fn set_counters<T>(mut self, v: T) -> Self
3069    where
3070        T: std::convert::Into<crate::model::TransferCounters>,
3071    {
3072        self.counters = std::option::Option::Some(v.into());
3073        self
3074    }
3075
3076    /// Sets or clears the value of [counters][crate::model::TransferOperationMetadata::counters].
3077    ///
3078    /// # Example
3079    /// ```ignore,no_run
3080    /// # use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
3081    /// use google_cloud_parallelstore_v1::model::TransferCounters;
3082    /// let x = TransferOperationMetadata::new().set_or_clear_counters(Some(TransferCounters::default()/* use setters */));
3083    /// let x = TransferOperationMetadata::new().set_or_clear_counters(None::<TransferCounters>);
3084    /// ```
3085    pub fn set_or_clear_counters<T>(mut self, v: std::option::Option<T>) -> Self
3086    where
3087        T: std::convert::Into<crate::model::TransferCounters>,
3088    {
3089        self.counters = v.map(|x| x.into());
3090        self
3091    }
3092
3093    /// Sets the value of [transfer_type][crate::model::TransferOperationMetadata::transfer_type].
3094    ///
3095    /// # Example
3096    /// ```ignore,no_run
3097    /// # use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
3098    /// use google_cloud_parallelstore_v1::model::TransferType;
3099    /// let x0 = TransferOperationMetadata::new().set_transfer_type(TransferType::Import);
3100    /// let x1 = TransferOperationMetadata::new().set_transfer_type(TransferType::Export);
3101    /// ```
3102    pub fn set_transfer_type<T: std::convert::Into<crate::model::TransferType>>(
3103        mut self,
3104        v: T,
3105    ) -> Self {
3106        self.transfer_type = v.into();
3107        self
3108    }
3109
3110    /// Sets the value of [error_summary][crate::model::TransferOperationMetadata::error_summary].
3111    ///
3112    /// # Example
3113    /// ```ignore,no_run
3114    /// # use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
3115    /// use google_cloud_parallelstore_v1::model::TransferErrorSummary;
3116    /// let x = TransferOperationMetadata::new()
3117    ///     .set_error_summary([
3118    ///         TransferErrorSummary::default()/* use setters */,
3119    ///         TransferErrorSummary::default()/* use (different) setters */,
3120    ///     ]);
3121    /// ```
3122    pub fn set_error_summary<T, V>(mut self, v: T) -> Self
3123    where
3124        T: std::iter::IntoIterator<Item = V>,
3125        V: std::convert::Into<crate::model::TransferErrorSummary>,
3126    {
3127        use std::iter::Iterator;
3128        self.error_summary = v.into_iter().map(|i| i.into()).collect();
3129        self
3130    }
3131
3132    /// Sets the value of [source][crate::model::TransferOperationMetadata::source].
3133    ///
3134    /// Note that all the setters affecting `source` are mutually
3135    /// exclusive.
3136    ///
3137    /// # Example
3138    /// ```ignore,no_run
3139    /// # use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
3140    /// use google_cloud_parallelstore_v1::model::SourceParallelstore;
3141    /// let x = TransferOperationMetadata::new().set_source(Some(
3142    ///     google_cloud_parallelstore_v1::model::transfer_operation_metadata::Source::SourceParallelstore(SourceParallelstore::default().into())));
3143    /// ```
3144    pub fn set_source<
3145        T: std::convert::Into<std::option::Option<crate::model::transfer_operation_metadata::Source>>,
3146    >(
3147        mut self,
3148        v: T,
3149    ) -> Self {
3150        self.source = v.into();
3151        self
3152    }
3153
3154    /// The value of [source][crate::model::TransferOperationMetadata::source]
3155    /// if it holds a `SourceParallelstore`, `None` if the field is not set or
3156    /// holds a different branch.
3157    pub fn source_parallelstore(
3158        &self,
3159    ) -> std::option::Option<&std::boxed::Box<crate::model::SourceParallelstore>> {
3160        #[allow(unreachable_patterns)]
3161        self.source.as_ref().and_then(|v| match v {
3162            crate::model::transfer_operation_metadata::Source::SourceParallelstore(v) => {
3163                std::option::Option::Some(v)
3164            }
3165            _ => std::option::Option::None,
3166        })
3167    }
3168
3169    /// Sets the value of [source][crate::model::TransferOperationMetadata::source]
3170    /// to hold a `SourceParallelstore`.
3171    ///
3172    /// Note that all the setters affecting `source` are
3173    /// mutually exclusive.
3174    ///
3175    /// # Example
3176    /// ```ignore,no_run
3177    /// # use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
3178    /// use google_cloud_parallelstore_v1::model::SourceParallelstore;
3179    /// let x = TransferOperationMetadata::new().set_source_parallelstore(SourceParallelstore::default()/* use setters */);
3180    /// assert!(x.source_parallelstore().is_some());
3181    /// assert!(x.source_gcs_bucket().is_none());
3182    /// ```
3183    pub fn set_source_parallelstore<
3184        T: std::convert::Into<std::boxed::Box<crate::model::SourceParallelstore>>,
3185    >(
3186        mut self,
3187        v: T,
3188    ) -> Self {
3189        self.source = std::option::Option::Some(
3190            crate::model::transfer_operation_metadata::Source::SourceParallelstore(v.into()),
3191        );
3192        self
3193    }
3194
3195    /// The value of [source][crate::model::TransferOperationMetadata::source]
3196    /// if it holds a `SourceGcsBucket`, `None` if the field is not set or
3197    /// holds a different branch.
3198    pub fn source_gcs_bucket(
3199        &self,
3200    ) -> std::option::Option<&std::boxed::Box<crate::model::SourceGcsBucket>> {
3201        #[allow(unreachable_patterns)]
3202        self.source.as_ref().and_then(|v| match v {
3203            crate::model::transfer_operation_metadata::Source::SourceGcsBucket(v) => {
3204                std::option::Option::Some(v)
3205            }
3206            _ => std::option::Option::None,
3207        })
3208    }
3209
3210    /// Sets the value of [source][crate::model::TransferOperationMetadata::source]
3211    /// to hold a `SourceGcsBucket`.
3212    ///
3213    /// Note that all the setters affecting `source` are
3214    /// mutually exclusive.
3215    ///
3216    /// # Example
3217    /// ```ignore,no_run
3218    /// # use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
3219    /// use google_cloud_parallelstore_v1::model::SourceGcsBucket;
3220    /// let x = TransferOperationMetadata::new().set_source_gcs_bucket(SourceGcsBucket::default()/* use setters */);
3221    /// assert!(x.source_gcs_bucket().is_some());
3222    /// assert!(x.source_parallelstore().is_none());
3223    /// ```
3224    pub fn set_source_gcs_bucket<
3225        T: std::convert::Into<std::boxed::Box<crate::model::SourceGcsBucket>>,
3226    >(
3227        mut self,
3228        v: T,
3229    ) -> Self {
3230        self.source = std::option::Option::Some(
3231            crate::model::transfer_operation_metadata::Source::SourceGcsBucket(v.into()),
3232        );
3233        self
3234    }
3235
3236    /// Sets the value of [destination][crate::model::TransferOperationMetadata::destination].
3237    ///
3238    /// Note that all the setters affecting `destination` are mutually
3239    /// exclusive.
3240    ///
3241    /// # Example
3242    /// ```ignore,no_run
3243    /// # use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
3244    /// use google_cloud_parallelstore_v1::model::DestinationGcsBucket;
3245    /// let x = TransferOperationMetadata::new().set_destination(Some(
3246    ///     google_cloud_parallelstore_v1::model::transfer_operation_metadata::Destination::DestinationGcsBucket(DestinationGcsBucket::default().into())));
3247    /// ```
3248    pub fn set_destination<
3249        T: std::convert::Into<
3250                std::option::Option<crate::model::transfer_operation_metadata::Destination>,
3251            >,
3252    >(
3253        mut self,
3254        v: T,
3255    ) -> Self {
3256        self.destination = v.into();
3257        self
3258    }
3259
3260    /// The value of [destination][crate::model::TransferOperationMetadata::destination]
3261    /// if it holds a `DestinationGcsBucket`, `None` if the field is not set or
3262    /// holds a different branch.
3263    pub fn destination_gcs_bucket(
3264        &self,
3265    ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationGcsBucket>> {
3266        #[allow(unreachable_patterns)]
3267        self.destination.as_ref().and_then(|v| match v {
3268            crate::model::transfer_operation_metadata::Destination::DestinationGcsBucket(v) => {
3269                std::option::Option::Some(v)
3270            }
3271            _ => std::option::Option::None,
3272        })
3273    }
3274
3275    /// Sets the value of [destination][crate::model::TransferOperationMetadata::destination]
3276    /// to hold a `DestinationGcsBucket`.
3277    ///
3278    /// Note that all the setters affecting `destination` are
3279    /// mutually exclusive.
3280    ///
3281    /// # Example
3282    /// ```ignore,no_run
3283    /// # use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
3284    /// use google_cloud_parallelstore_v1::model::DestinationGcsBucket;
3285    /// let x = TransferOperationMetadata::new().set_destination_gcs_bucket(DestinationGcsBucket::default()/* use setters */);
3286    /// assert!(x.destination_gcs_bucket().is_some());
3287    /// assert!(x.destination_parallelstore().is_none());
3288    /// ```
3289    pub fn set_destination_gcs_bucket<
3290        T: std::convert::Into<std::boxed::Box<crate::model::DestinationGcsBucket>>,
3291    >(
3292        mut self,
3293        v: T,
3294    ) -> Self {
3295        self.destination = std::option::Option::Some(
3296            crate::model::transfer_operation_metadata::Destination::DestinationGcsBucket(v.into()),
3297        );
3298        self
3299    }
3300
3301    /// The value of [destination][crate::model::TransferOperationMetadata::destination]
3302    /// if it holds a `DestinationParallelstore`, `None` if the field is not set or
3303    /// holds a different branch.
3304    pub fn destination_parallelstore(
3305        &self,
3306    ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationParallelstore>> {
3307        #[allow(unreachable_patterns)]
3308        self.destination.as_ref().and_then(|v| match v {
3309            crate::model::transfer_operation_metadata::Destination::DestinationParallelstore(v) => {
3310                std::option::Option::Some(v)
3311            }
3312            _ => std::option::Option::None,
3313        })
3314    }
3315
3316    /// Sets the value of [destination][crate::model::TransferOperationMetadata::destination]
3317    /// to hold a `DestinationParallelstore`.
3318    ///
3319    /// Note that all the setters affecting `destination` are
3320    /// mutually exclusive.
3321    ///
3322    /// # Example
3323    /// ```ignore,no_run
3324    /// # use google_cloud_parallelstore_v1::model::TransferOperationMetadata;
3325    /// use google_cloud_parallelstore_v1::model::DestinationParallelstore;
3326    /// let x = TransferOperationMetadata::new().set_destination_parallelstore(DestinationParallelstore::default()/* use setters */);
3327    /// assert!(x.destination_parallelstore().is_some());
3328    /// assert!(x.destination_gcs_bucket().is_none());
3329    /// ```
3330    pub fn set_destination_parallelstore<
3331        T: std::convert::Into<std::boxed::Box<crate::model::DestinationParallelstore>>,
3332    >(
3333        mut self,
3334        v: T,
3335    ) -> Self {
3336        self.destination = std::option::Option::Some(
3337            crate::model::transfer_operation_metadata::Destination::DestinationParallelstore(
3338                v.into(),
3339            ),
3340        );
3341        self
3342    }
3343}
3344
3345impl wkt::message::Message for TransferOperationMetadata {
3346    fn typename() -> &'static str {
3347        "type.googleapis.com/google.cloud.parallelstore.v1.TransferOperationMetadata"
3348    }
3349}
3350
3351/// Defines additional types related to [TransferOperationMetadata].
3352pub mod transfer_operation_metadata {
3353    #[allow(unused_imports)]
3354    use super::*;
3355
3356    /// The source of transfer operation.
3357    #[derive(Clone, Debug, PartialEq)]
3358    #[non_exhaustive]
3359    pub enum Source {
3360        /// Output only. Parallelstore source.
3361        SourceParallelstore(std::boxed::Box<crate::model::SourceParallelstore>),
3362        /// Output only. Cloud Storage source.
3363        SourceGcsBucket(std::boxed::Box<crate::model::SourceGcsBucket>),
3364    }
3365
3366    /// The destination of transfer operation.
3367    #[derive(Clone, Debug, PartialEq)]
3368    #[non_exhaustive]
3369    pub enum Destination {
3370        /// Output only. Cloud Storage destination.
3371        DestinationGcsBucket(std::boxed::Box<crate::model::DestinationGcsBucket>),
3372        /// Output only. Parallelstore destination.
3373        DestinationParallelstore(std::boxed::Box<crate::model::DestinationParallelstore>),
3374    }
3375}
3376
3377/// A collection of counters that report the progress of a transfer operation.
3378#[derive(Clone, Default, PartialEq)]
3379#[non_exhaustive]
3380pub struct TransferCounters {
3381    /// Objects found in the data source that are scheduled to be transferred,
3382    /// excluding any that are filtered based on object conditions or skipped due
3383    /// to sync.
3384    pub objects_found: i64,
3385
3386    /// Bytes found in the data source that are scheduled to be transferred,
3387    /// excluding any that are filtered based on object conditions or skipped due
3388    /// to sync.
3389    pub bytes_found: i64,
3390
3391    /// Objects in the data source that are not transferred because they already
3392    /// exist in the data destination.
3393    pub objects_skipped: i64,
3394
3395    /// Bytes in the data source that are not transferred because they already
3396    /// exist in the data destination.
3397    pub bytes_skipped: i64,
3398
3399    /// Objects that are copied to the data destination.
3400    pub objects_copied: i64,
3401
3402    /// Bytes that are copied to the data destination.
3403    pub bytes_copied: i64,
3404
3405    /// Objects that failed to be written to the data destination.
3406    pub objects_failed: i64,
3407
3408    /// Bytes that failed to be written to the data destination.
3409    pub bytes_failed: i64,
3410
3411    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3412}
3413
3414impl TransferCounters {
3415    pub fn new() -> Self {
3416        std::default::Default::default()
3417    }
3418
3419    /// Sets the value of [objects_found][crate::model::TransferCounters::objects_found].
3420    ///
3421    /// # Example
3422    /// ```ignore,no_run
3423    /// # use google_cloud_parallelstore_v1::model::TransferCounters;
3424    /// let x = TransferCounters::new().set_objects_found(42);
3425    /// ```
3426    pub fn set_objects_found<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3427        self.objects_found = v.into();
3428        self
3429    }
3430
3431    /// Sets the value of [bytes_found][crate::model::TransferCounters::bytes_found].
3432    ///
3433    /// # Example
3434    /// ```ignore,no_run
3435    /// # use google_cloud_parallelstore_v1::model::TransferCounters;
3436    /// let x = TransferCounters::new().set_bytes_found(42);
3437    /// ```
3438    pub fn set_bytes_found<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3439        self.bytes_found = v.into();
3440        self
3441    }
3442
3443    /// Sets the value of [objects_skipped][crate::model::TransferCounters::objects_skipped].
3444    ///
3445    /// # Example
3446    /// ```ignore,no_run
3447    /// # use google_cloud_parallelstore_v1::model::TransferCounters;
3448    /// let x = TransferCounters::new().set_objects_skipped(42);
3449    /// ```
3450    pub fn set_objects_skipped<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3451        self.objects_skipped = v.into();
3452        self
3453    }
3454
3455    /// Sets the value of [bytes_skipped][crate::model::TransferCounters::bytes_skipped].
3456    ///
3457    /// # Example
3458    /// ```ignore,no_run
3459    /// # use google_cloud_parallelstore_v1::model::TransferCounters;
3460    /// let x = TransferCounters::new().set_bytes_skipped(42);
3461    /// ```
3462    pub fn set_bytes_skipped<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3463        self.bytes_skipped = v.into();
3464        self
3465    }
3466
3467    /// Sets the value of [objects_copied][crate::model::TransferCounters::objects_copied].
3468    ///
3469    /// # Example
3470    /// ```ignore,no_run
3471    /// # use google_cloud_parallelstore_v1::model::TransferCounters;
3472    /// let x = TransferCounters::new().set_objects_copied(42);
3473    /// ```
3474    pub fn set_objects_copied<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3475        self.objects_copied = v.into();
3476        self
3477    }
3478
3479    /// Sets the value of [bytes_copied][crate::model::TransferCounters::bytes_copied].
3480    ///
3481    /// # Example
3482    /// ```ignore,no_run
3483    /// # use google_cloud_parallelstore_v1::model::TransferCounters;
3484    /// let x = TransferCounters::new().set_bytes_copied(42);
3485    /// ```
3486    pub fn set_bytes_copied<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3487        self.bytes_copied = v.into();
3488        self
3489    }
3490
3491    /// Sets the value of [objects_failed][crate::model::TransferCounters::objects_failed].
3492    ///
3493    /// # Example
3494    /// ```ignore,no_run
3495    /// # use google_cloud_parallelstore_v1::model::TransferCounters;
3496    /// let x = TransferCounters::new().set_objects_failed(42);
3497    /// ```
3498    pub fn set_objects_failed<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3499        self.objects_failed = v.into();
3500        self
3501    }
3502
3503    /// Sets the value of [bytes_failed][crate::model::TransferCounters::bytes_failed].
3504    ///
3505    /// # Example
3506    /// ```ignore,no_run
3507    /// # use google_cloud_parallelstore_v1::model::TransferCounters;
3508    /// let x = TransferCounters::new().set_bytes_failed(42);
3509    /// ```
3510    pub fn set_bytes_failed<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3511        self.bytes_failed = v.into();
3512        self
3513    }
3514}
3515
3516impl wkt::message::Message for TransferCounters {
3517    fn typename() -> &'static str {
3518        "type.googleapis.com/google.cloud.parallelstore.v1.TransferCounters"
3519    }
3520}
3521
3522/// Type of transfer that occurred.
3523///
3524/// # Working with unknown values
3525///
3526/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3527/// additional enum variants at any time. Adding new variants is not considered
3528/// a breaking change. Applications should write their code in anticipation of:
3529///
3530/// - New values appearing in future releases of the client library, **and**
3531/// - New values received dynamically, without application changes.
3532///
3533/// Please consult the [Working with enums] section in the user guide for some
3534/// guidelines.
3535///
3536/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3537#[derive(Clone, Debug, PartialEq)]
3538#[non_exhaustive]
3539pub enum TransferType {
3540    /// Zero is an illegal value.
3541    Unspecified,
3542    /// Imports to Parallelstore.
3543    Import,
3544    /// Exports from Parallelstore.
3545    Export,
3546    /// If set, the enum was initialized with an unknown value.
3547    ///
3548    /// Applications can examine the value using [TransferType::value] or
3549    /// [TransferType::name].
3550    UnknownValue(transfer_type::UnknownValue),
3551}
3552
3553#[doc(hidden)]
3554pub mod transfer_type {
3555    #[allow(unused_imports)]
3556    use super::*;
3557    #[derive(Clone, Debug, PartialEq)]
3558    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3559}
3560
3561impl TransferType {
3562    /// Gets the enum value.
3563    ///
3564    /// Returns `None` if the enum contains an unknown value deserialized from
3565    /// the string representation of enums.
3566    pub fn value(&self) -> std::option::Option<i32> {
3567        match self {
3568            Self::Unspecified => std::option::Option::Some(0),
3569            Self::Import => std::option::Option::Some(1),
3570            Self::Export => std::option::Option::Some(2),
3571            Self::UnknownValue(u) => u.0.value(),
3572        }
3573    }
3574
3575    /// Gets the enum value as a string.
3576    ///
3577    /// Returns `None` if the enum contains an unknown value deserialized from
3578    /// the integer representation of enums.
3579    pub fn name(&self) -> std::option::Option<&str> {
3580        match self {
3581            Self::Unspecified => std::option::Option::Some("TRANSFER_TYPE_UNSPECIFIED"),
3582            Self::Import => std::option::Option::Some("IMPORT"),
3583            Self::Export => std::option::Option::Some("EXPORT"),
3584            Self::UnknownValue(u) => u.0.name(),
3585        }
3586    }
3587}
3588
3589impl std::default::Default for TransferType {
3590    fn default() -> Self {
3591        use std::convert::From;
3592        Self::from(0)
3593    }
3594}
3595
3596impl std::fmt::Display for TransferType {
3597    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3598        wkt::internal::display_enum(f, self.name(), self.value())
3599    }
3600}
3601
3602impl std::convert::From<i32> for TransferType {
3603    fn from(value: i32) -> Self {
3604        match value {
3605            0 => Self::Unspecified,
3606            1 => Self::Import,
3607            2 => Self::Export,
3608            _ => Self::UnknownValue(transfer_type::UnknownValue(
3609                wkt::internal::UnknownEnumValue::Integer(value),
3610            )),
3611        }
3612    }
3613}
3614
3615impl std::convert::From<&str> for TransferType {
3616    fn from(value: &str) -> Self {
3617        use std::string::ToString;
3618        match value {
3619            "TRANSFER_TYPE_UNSPECIFIED" => Self::Unspecified,
3620            "IMPORT" => Self::Import,
3621            "EXPORT" => Self::Export,
3622            _ => Self::UnknownValue(transfer_type::UnknownValue(
3623                wkt::internal::UnknownEnumValue::String(value.to_string()),
3624            )),
3625        }
3626    }
3627}
3628
3629impl serde::ser::Serialize for TransferType {
3630    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3631    where
3632        S: serde::Serializer,
3633    {
3634        match self {
3635            Self::Unspecified => serializer.serialize_i32(0),
3636            Self::Import => serializer.serialize_i32(1),
3637            Self::Export => serializer.serialize_i32(2),
3638            Self::UnknownValue(u) => u.0.serialize(serializer),
3639        }
3640    }
3641}
3642
3643impl<'de> serde::de::Deserialize<'de> for TransferType {
3644    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3645    where
3646        D: serde::Deserializer<'de>,
3647    {
3648        deserializer.deserialize_any(wkt::internal::EnumVisitor::<TransferType>::new(
3649            ".google.cloud.parallelstore.v1.TransferType",
3650        ))
3651    }
3652}
3653
3654/// Represents the striping options for files.
3655///
3656/// # Working with unknown values
3657///
3658/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3659/// additional enum variants at any time. Adding new variants is not considered
3660/// a breaking change. Applications should write their code in anticipation of:
3661///
3662/// - New values appearing in future releases of the client library, **and**
3663/// - New values received dynamically, without application changes.
3664///
3665/// Please consult the [Working with enums] section in the user guide for some
3666/// guidelines.
3667///
3668/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3669#[derive(Clone, Debug, PartialEq)]
3670#[non_exhaustive]
3671pub enum FileStripeLevel {
3672    /// If not set, FileStripeLevel will default to FILE_STRIPE_LEVEL_BALANCED
3673    Unspecified,
3674    /// Minimum file striping
3675    Min,
3676    /// Medium file striping
3677    Balanced,
3678    /// Maximum file striping
3679    Max,
3680    /// If set, the enum was initialized with an unknown value.
3681    ///
3682    /// Applications can examine the value using [FileStripeLevel::value] or
3683    /// [FileStripeLevel::name].
3684    UnknownValue(file_stripe_level::UnknownValue),
3685}
3686
3687#[doc(hidden)]
3688pub mod file_stripe_level {
3689    #[allow(unused_imports)]
3690    use super::*;
3691    #[derive(Clone, Debug, PartialEq)]
3692    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3693}
3694
3695impl FileStripeLevel {
3696    /// Gets the enum value.
3697    ///
3698    /// Returns `None` if the enum contains an unknown value deserialized from
3699    /// the string representation of enums.
3700    pub fn value(&self) -> std::option::Option<i32> {
3701        match self {
3702            Self::Unspecified => std::option::Option::Some(0),
3703            Self::Min => std::option::Option::Some(1),
3704            Self::Balanced => std::option::Option::Some(2),
3705            Self::Max => std::option::Option::Some(3),
3706            Self::UnknownValue(u) => u.0.value(),
3707        }
3708    }
3709
3710    /// Gets the enum value as a string.
3711    ///
3712    /// Returns `None` if the enum contains an unknown value deserialized from
3713    /// the integer representation of enums.
3714    pub fn name(&self) -> std::option::Option<&str> {
3715        match self {
3716            Self::Unspecified => std::option::Option::Some("FILE_STRIPE_LEVEL_UNSPECIFIED"),
3717            Self::Min => std::option::Option::Some("FILE_STRIPE_LEVEL_MIN"),
3718            Self::Balanced => std::option::Option::Some("FILE_STRIPE_LEVEL_BALANCED"),
3719            Self::Max => std::option::Option::Some("FILE_STRIPE_LEVEL_MAX"),
3720            Self::UnknownValue(u) => u.0.name(),
3721        }
3722    }
3723}
3724
3725impl std::default::Default for FileStripeLevel {
3726    fn default() -> Self {
3727        use std::convert::From;
3728        Self::from(0)
3729    }
3730}
3731
3732impl std::fmt::Display for FileStripeLevel {
3733    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3734        wkt::internal::display_enum(f, self.name(), self.value())
3735    }
3736}
3737
3738impl std::convert::From<i32> for FileStripeLevel {
3739    fn from(value: i32) -> Self {
3740        match value {
3741            0 => Self::Unspecified,
3742            1 => Self::Min,
3743            2 => Self::Balanced,
3744            3 => Self::Max,
3745            _ => Self::UnknownValue(file_stripe_level::UnknownValue(
3746                wkt::internal::UnknownEnumValue::Integer(value),
3747            )),
3748        }
3749    }
3750}
3751
3752impl std::convert::From<&str> for FileStripeLevel {
3753    fn from(value: &str) -> Self {
3754        use std::string::ToString;
3755        match value {
3756            "FILE_STRIPE_LEVEL_UNSPECIFIED" => Self::Unspecified,
3757            "FILE_STRIPE_LEVEL_MIN" => Self::Min,
3758            "FILE_STRIPE_LEVEL_BALANCED" => Self::Balanced,
3759            "FILE_STRIPE_LEVEL_MAX" => Self::Max,
3760            _ => Self::UnknownValue(file_stripe_level::UnknownValue(
3761                wkt::internal::UnknownEnumValue::String(value.to_string()),
3762            )),
3763        }
3764    }
3765}
3766
3767impl serde::ser::Serialize for FileStripeLevel {
3768    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3769    where
3770        S: serde::Serializer,
3771    {
3772        match self {
3773            Self::Unspecified => serializer.serialize_i32(0),
3774            Self::Min => serializer.serialize_i32(1),
3775            Self::Balanced => serializer.serialize_i32(2),
3776            Self::Max => serializer.serialize_i32(3),
3777            Self::UnknownValue(u) => u.0.serialize(serializer),
3778        }
3779    }
3780}
3781
3782impl<'de> serde::de::Deserialize<'de> for FileStripeLevel {
3783    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3784    where
3785        D: serde::Deserializer<'de>,
3786    {
3787        deserializer.deserialize_any(wkt::internal::EnumVisitor::<FileStripeLevel>::new(
3788            ".google.cloud.parallelstore.v1.FileStripeLevel",
3789        ))
3790    }
3791}
3792
3793/// Represents the striping options for directories.
3794///
3795/// # Working with unknown values
3796///
3797/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3798/// additional enum variants at any time. Adding new variants is not considered
3799/// a breaking change. Applications should write their code in anticipation of:
3800///
3801/// - New values appearing in future releases of the client library, **and**
3802/// - New values received dynamically, without application changes.
3803///
3804/// Please consult the [Working with enums] section in the user guide for some
3805/// guidelines.
3806///
3807/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3808#[derive(Clone, Debug, PartialEq)]
3809#[non_exhaustive]
3810pub enum DirectoryStripeLevel {
3811    /// If not set, DirectoryStripeLevel will default to DIRECTORY_STRIPE_LEVEL_MAX
3812    Unspecified,
3813    /// Minimum directory striping
3814    Min,
3815    /// Medium directory striping
3816    Balanced,
3817    /// Maximum directory striping
3818    Max,
3819    /// If set, the enum was initialized with an unknown value.
3820    ///
3821    /// Applications can examine the value using [DirectoryStripeLevel::value] or
3822    /// [DirectoryStripeLevel::name].
3823    UnknownValue(directory_stripe_level::UnknownValue),
3824}
3825
3826#[doc(hidden)]
3827pub mod directory_stripe_level {
3828    #[allow(unused_imports)]
3829    use super::*;
3830    #[derive(Clone, Debug, PartialEq)]
3831    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3832}
3833
3834impl DirectoryStripeLevel {
3835    /// Gets the enum value.
3836    ///
3837    /// Returns `None` if the enum contains an unknown value deserialized from
3838    /// the string representation of enums.
3839    pub fn value(&self) -> std::option::Option<i32> {
3840        match self {
3841            Self::Unspecified => std::option::Option::Some(0),
3842            Self::Min => std::option::Option::Some(1),
3843            Self::Balanced => std::option::Option::Some(2),
3844            Self::Max => std::option::Option::Some(3),
3845            Self::UnknownValue(u) => u.0.value(),
3846        }
3847    }
3848
3849    /// Gets the enum value as a string.
3850    ///
3851    /// Returns `None` if the enum contains an unknown value deserialized from
3852    /// the integer representation of enums.
3853    pub fn name(&self) -> std::option::Option<&str> {
3854        match self {
3855            Self::Unspecified => std::option::Option::Some("DIRECTORY_STRIPE_LEVEL_UNSPECIFIED"),
3856            Self::Min => std::option::Option::Some("DIRECTORY_STRIPE_LEVEL_MIN"),
3857            Self::Balanced => std::option::Option::Some("DIRECTORY_STRIPE_LEVEL_BALANCED"),
3858            Self::Max => std::option::Option::Some("DIRECTORY_STRIPE_LEVEL_MAX"),
3859            Self::UnknownValue(u) => u.0.name(),
3860        }
3861    }
3862}
3863
3864impl std::default::Default for DirectoryStripeLevel {
3865    fn default() -> Self {
3866        use std::convert::From;
3867        Self::from(0)
3868    }
3869}
3870
3871impl std::fmt::Display for DirectoryStripeLevel {
3872    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3873        wkt::internal::display_enum(f, self.name(), self.value())
3874    }
3875}
3876
3877impl std::convert::From<i32> for DirectoryStripeLevel {
3878    fn from(value: i32) -> Self {
3879        match value {
3880            0 => Self::Unspecified,
3881            1 => Self::Min,
3882            2 => Self::Balanced,
3883            3 => Self::Max,
3884            _ => Self::UnknownValue(directory_stripe_level::UnknownValue(
3885                wkt::internal::UnknownEnumValue::Integer(value),
3886            )),
3887        }
3888    }
3889}
3890
3891impl std::convert::From<&str> for DirectoryStripeLevel {
3892    fn from(value: &str) -> Self {
3893        use std::string::ToString;
3894        match value {
3895            "DIRECTORY_STRIPE_LEVEL_UNSPECIFIED" => Self::Unspecified,
3896            "DIRECTORY_STRIPE_LEVEL_MIN" => Self::Min,
3897            "DIRECTORY_STRIPE_LEVEL_BALANCED" => Self::Balanced,
3898            "DIRECTORY_STRIPE_LEVEL_MAX" => Self::Max,
3899            _ => Self::UnknownValue(directory_stripe_level::UnknownValue(
3900                wkt::internal::UnknownEnumValue::String(value.to_string()),
3901            )),
3902        }
3903    }
3904}
3905
3906impl serde::ser::Serialize for DirectoryStripeLevel {
3907    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3908    where
3909        S: serde::Serializer,
3910    {
3911        match self {
3912            Self::Unspecified => serializer.serialize_i32(0),
3913            Self::Min => serializer.serialize_i32(1),
3914            Self::Balanced => serializer.serialize_i32(2),
3915            Self::Max => serializer.serialize_i32(3),
3916            Self::UnknownValue(u) => u.0.serialize(serializer),
3917        }
3918    }
3919}
3920
3921impl<'de> serde::de::Deserialize<'de> for DirectoryStripeLevel {
3922    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3923    where
3924        D: serde::Deserializer<'de>,
3925    {
3926        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DirectoryStripeLevel>::new(
3927            ".google.cloud.parallelstore.v1.DirectoryStripeLevel",
3928        ))
3929    }
3930}
3931
3932/// Represents the deployment type for the instance.
3933///
3934/// # Working with unknown values
3935///
3936/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3937/// additional enum variants at any time. Adding new variants is not considered
3938/// a breaking change. Applications should write their code in anticipation of:
3939///
3940/// - New values appearing in future releases of the client library, **and**
3941/// - New values received dynamically, without application changes.
3942///
3943/// Please consult the [Working with enums] section in the user guide for some
3944/// guidelines.
3945///
3946/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3947#[derive(Clone, Debug, PartialEq)]
3948#[non_exhaustive]
3949pub enum DeploymentType {
3950    /// Default Deployment Type
3951    /// It is equivalent to SCRATCH
3952    Unspecified,
3953    /// Scratch
3954    Scratch,
3955    /// Persistent
3956    Persistent,
3957    /// If set, the enum was initialized with an unknown value.
3958    ///
3959    /// Applications can examine the value using [DeploymentType::value] or
3960    /// [DeploymentType::name].
3961    UnknownValue(deployment_type::UnknownValue),
3962}
3963
3964#[doc(hidden)]
3965pub mod deployment_type {
3966    #[allow(unused_imports)]
3967    use super::*;
3968    #[derive(Clone, Debug, PartialEq)]
3969    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3970}
3971
3972impl DeploymentType {
3973    /// Gets the enum value.
3974    ///
3975    /// Returns `None` if the enum contains an unknown value deserialized from
3976    /// the string representation of enums.
3977    pub fn value(&self) -> std::option::Option<i32> {
3978        match self {
3979            Self::Unspecified => std::option::Option::Some(0),
3980            Self::Scratch => std::option::Option::Some(1),
3981            Self::Persistent => std::option::Option::Some(2),
3982            Self::UnknownValue(u) => u.0.value(),
3983        }
3984    }
3985
3986    /// Gets the enum value as a string.
3987    ///
3988    /// Returns `None` if the enum contains an unknown value deserialized from
3989    /// the integer representation of enums.
3990    pub fn name(&self) -> std::option::Option<&str> {
3991        match self {
3992            Self::Unspecified => std::option::Option::Some("DEPLOYMENT_TYPE_UNSPECIFIED"),
3993            Self::Scratch => std::option::Option::Some("SCRATCH"),
3994            Self::Persistent => std::option::Option::Some("PERSISTENT"),
3995            Self::UnknownValue(u) => u.0.name(),
3996        }
3997    }
3998}
3999
4000impl std::default::Default for DeploymentType {
4001    fn default() -> Self {
4002        use std::convert::From;
4003        Self::from(0)
4004    }
4005}
4006
4007impl std::fmt::Display for DeploymentType {
4008    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4009        wkt::internal::display_enum(f, self.name(), self.value())
4010    }
4011}
4012
4013impl std::convert::From<i32> for DeploymentType {
4014    fn from(value: i32) -> Self {
4015        match value {
4016            0 => Self::Unspecified,
4017            1 => Self::Scratch,
4018            2 => Self::Persistent,
4019            _ => Self::UnknownValue(deployment_type::UnknownValue(
4020                wkt::internal::UnknownEnumValue::Integer(value),
4021            )),
4022        }
4023    }
4024}
4025
4026impl std::convert::From<&str> for DeploymentType {
4027    fn from(value: &str) -> Self {
4028        use std::string::ToString;
4029        match value {
4030            "DEPLOYMENT_TYPE_UNSPECIFIED" => Self::Unspecified,
4031            "SCRATCH" => Self::Scratch,
4032            "PERSISTENT" => Self::Persistent,
4033            _ => Self::UnknownValue(deployment_type::UnknownValue(
4034                wkt::internal::UnknownEnumValue::String(value.to_string()),
4035            )),
4036        }
4037    }
4038}
4039
4040impl serde::ser::Serialize for DeploymentType {
4041    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4042    where
4043        S: serde::Serializer,
4044    {
4045        match self {
4046            Self::Unspecified => serializer.serialize_i32(0),
4047            Self::Scratch => serializer.serialize_i32(1),
4048            Self::Persistent => serializer.serialize_i32(2),
4049            Self::UnknownValue(u) => u.0.serialize(serializer),
4050        }
4051    }
4052}
4053
4054impl<'de> serde::de::Deserialize<'de> for DeploymentType {
4055    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4056    where
4057        D: serde::Deserializer<'de>,
4058    {
4059        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentType>::new(
4060            ".google.cloud.parallelstore.v1.DeploymentType",
4061        ))
4062    }
4063}