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