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