google_cloud_parallelstore_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate location;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate 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 'daos_version' field.
73    /// Output only. The version of DAOS software running in the 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    pub fn new() -> Self {
127        std::default::Default::default()
128    }
129
130    /// Sets the value of [name][crate::model::Instance::name].
131    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
132        self.name = v.into();
133        self
134    }
135
136    /// Sets the value of [description][crate::model::Instance::description].
137    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
138        self.description = v.into();
139        self
140    }
141
142    /// Sets the value of [state][crate::model::Instance::state].
143    pub fn set_state<T: std::convert::Into<crate::model::instance::State>>(mut self, v: T) -> Self {
144        self.state = v.into();
145        self
146    }
147
148    /// Sets the value of [create_time][crate::model::Instance::create_time].
149    pub fn set_create_time<T>(mut self, v: T) -> Self
150    where
151        T: std::convert::Into<wkt::Timestamp>,
152    {
153        self.create_time = std::option::Option::Some(v.into());
154        self
155    }
156
157    /// Sets or clears the value of [create_time][crate::model::Instance::create_time].
158    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
159    where
160        T: std::convert::Into<wkt::Timestamp>,
161    {
162        self.create_time = v.map(|x| x.into());
163        self
164    }
165
166    /// Sets the value of [update_time][crate::model::Instance::update_time].
167    pub fn set_update_time<T>(mut self, v: T) -> Self
168    where
169        T: std::convert::Into<wkt::Timestamp>,
170    {
171        self.update_time = std::option::Option::Some(v.into());
172        self
173    }
174
175    /// Sets or clears the value of [update_time][crate::model::Instance::update_time].
176    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
177    where
178        T: std::convert::Into<wkt::Timestamp>,
179    {
180        self.update_time = v.map(|x| x.into());
181        self
182    }
183
184    /// Sets the value of [labels][crate::model::Instance::labels].
185    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
186    where
187        T: std::iter::IntoIterator<Item = (K, V)>,
188        K: std::convert::Into<std::string::String>,
189        V: std::convert::Into<std::string::String>,
190    {
191        use std::iter::Iterator;
192        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
193        self
194    }
195
196    /// Sets the value of [capacity_gib][crate::model::Instance::capacity_gib].
197    pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
198        self.capacity_gib = v.into();
199        self
200    }
201
202    /// Sets the value of [daos_version][crate::model::Instance::daos_version].
203    #[deprecated]
204    pub fn set_daos_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
205        self.daos_version = v.into();
206        self
207    }
208
209    /// Sets the value of [access_points][crate::model::Instance::access_points].
210    pub fn set_access_points<T, V>(mut self, v: T) -> Self
211    where
212        T: std::iter::IntoIterator<Item = V>,
213        V: std::convert::Into<std::string::String>,
214    {
215        use std::iter::Iterator;
216        self.access_points = v.into_iter().map(|i| i.into()).collect();
217        self
218    }
219
220    /// Sets the value of [network][crate::model::Instance::network].
221    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
222        self.network = v.into();
223        self
224    }
225
226    /// Sets the value of [reserved_ip_range][crate::model::Instance::reserved_ip_range].
227    pub fn set_reserved_ip_range<T: std::convert::Into<std::string::String>>(
228        mut self,
229        v: T,
230    ) -> Self {
231        self.reserved_ip_range = v.into();
232        self
233    }
234
235    /// Sets the value of [effective_reserved_ip_range][crate::model::Instance::effective_reserved_ip_range].
236    pub fn set_effective_reserved_ip_range<T: std::convert::Into<std::string::String>>(
237        mut self,
238        v: T,
239    ) -> Self {
240        self.effective_reserved_ip_range = v.into();
241        self
242    }
243
244    /// Sets the value of [file_stripe_level][crate::model::Instance::file_stripe_level].
245    pub fn set_file_stripe_level<T: std::convert::Into<crate::model::FileStripeLevel>>(
246        mut self,
247        v: T,
248    ) -> Self {
249        self.file_stripe_level = v.into();
250        self
251    }
252
253    /// Sets the value of [directory_stripe_level][crate::model::Instance::directory_stripe_level].
254    pub fn set_directory_stripe_level<T: std::convert::Into<crate::model::DirectoryStripeLevel>>(
255        mut self,
256        v: T,
257    ) -> Self {
258        self.directory_stripe_level = v.into();
259        self
260    }
261
262    /// Sets the value of [deployment_type][crate::model::Instance::deployment_type].
263    pub fn set_deployment_type<T: std::convert::Into<crate::model::DeploymentType>>(
264        mut self,
265        v: T,
266    ) -> Self {
267        self.deployment_type = v.into();
268        self
269    }
270}
271
272impl wkt::message::Message for Instance {
273    fn typename() -> &'static str {
274        "type.googleapis.com/google.cloud.parallelstore.v1.Instance"
275    }
276}
277
278/// Defines additional types related to [Instance].
279pub mod instance {
280    #[allow(unused_imports)]
281    use super::*;
282
283    /// The possible states of a Parallelstore instance.
284    ///
285    /// # Working with unknown values
286    ///
287    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
288    /// additional enum variants at any time. Adding new variants is not considered
289    /// a breaking change. Applications should write their code in anticipation of:
290    ///
291    /// - New values appearing in future releases of the client library, **and**
292    /// - New values received dynamically, without application changes.
293    ///
294    /// Please consult the [Working with enums] section in the user guide for some
295    /// guidelines.
296    ///
297    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
298    #[derive(Clone, Debug, PartialEq)]
299    #[non_exhaustive]
300    pub enum State {
301        /// Not set.
302        Unspecified,
303        /// The instance is being created.
304        Creating,
305        /// The instance is available for use.
306        Active,
307        /// The instance is being deleted.
308        Deleting,
309        /// The instance is not usable.
310        Failed,
311        /// The instance is being upgraded.
312        Upgrading,
313        /// The instance is being repaired. This should only be used by instances
314        /// using the `PERSISTENT` deployment type.
315        Repairing,
316        /// If set, the enum was initialized with an unknown value.
317        ///
318        /// Applications can examine the value using [State::value] or
319        /// [State::name].
320        UnknownValue(state::UnknownValue),
321    }
322
323    #[doc(hidden)]
324    pub mod state {
325        #[allow(unused_imports)]
326        use super::*;
327        #[derive(Clone, Debug, PartialEq)]
328        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
329    }
330
331    impl State {
332        /// Gets the enum value.
333        ///
334        /// Returns `None` if the enum contains an unknown value deserialized from
335        /// the string representation of enums.
336        pub fn value(&self) -> std::option::Option<i32> {
337            match self {
338                Self::Unspecified => std::option::Option::Some(0),
339                Self::Creating => std::option::Option::Some(1),
340                Self::Active => std::option::Option::Some(2),
341                Self::Deleting => std::option::Option::Some(3),
342                Self::Failed => std::option::Option::Some(4),
343                Self::Upgrading => std::option::Option::Some(5),
344                Self::Repairing => std::option::Option::Some(6),
345                Self::UnknownValue(u) => u.0.value(),
346            }
347        }
348
349        /// Gets the enum value as a string.
350        ///
351        /// Returns `None` if the enum contains an unknown value deserialized from
352        /// the integer representation of enums.
353        pub fn name(&self) -> std::option::Option<&str> {
354            match self {
355                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
356                Self::Creating => std::option::Option::Some("CREATING"),
357                Self::Active => std::option::Option::Some("ACTIVE"),
358                Self::Deleting => std::option::Option::Some("DELETING"),
359                Self::Failed => std::option::Option::Some("FAILED"),
360                Self::Upgrading => std::option::Option::Some("UPGRADING"),
361                Self::Repairing => std::option::Option::Some("REPAIRING"),
362                Self::UnknownValue(u) => u.0.name(),
363            }
364        }
365    }
366
367    impl std::default::Default for State {
368        fn default() -> Self {
369            use std::convert::From;
370            Self::from(0)
371        }
372    }
373
374    impl std::fmt::Display for State {
375        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
376            wkt::internal::display_enum(f, self.name(), self.value())
377        }
378    }
379
380    impl std::convert::From<i32> for State {
381        fn from(value: i32) -> Self {
382            match value {
383                0 => Self::Unspecified,
384                1 => Self::Creating,
385                2 => Self::Active,
386                3 => Self::Deleting,
387                4 => Self::Failed,
388                5 => Self::Upgrading,
389                6 => Self::Repairing,
390                _ => Self::UnknownValue(state::UnknownValue(
391                    wkt::internal::UnknownEnumValue::Integer(value),
392                )),
393            }
394        }
395    }
396
397    impl std::convert::From<&str> for State {
398        fn from(value: &str) -> Self {
399            use std::string::ToString;
400            match value {
401                "STATE_UNSPECIFIED" => Self::Unspecified,
402                "CREATING" => Self::Creating,
403                "ACTIVE" => Self::Active,
404                "DELETING" => Self::Deleting,
405                "FAILED" => Self::Failed,
406                "UPGRADING" => Self::Upgrading,
407                "REPAIRING" => Self::Repairing,
408                _ => Self::UnknownValue(state::UnknownValue(
409                    wkt::internal::UnknownEnumValue::String(value.to_string()),
410                )),
411            }
412        }
413    }
414
415    impl serde::ser::Serialize for State {
416        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
417        where
418            S: serde::Serializer,
419        {
420            match self {
421                Self::Unspecified => serializer.serialize_i32(0),
422                Self::Creating => serializer.serialize_i32(1),
423                Self::Active => serializer.serialize_i32(2),
424                Self::Deleting => serializer.serialize_i32(3),
425                Self::Failed => serializer.serialize_i32(4),
426                Self::Upgrading => serializer.serialize_i32(5),
427                Self::Repairing => serializer.serialize_i32(6),
428                Self::UnknownValue(u) => u.0.serialize(serializer),
429            }
430        }
431    }
432
433    impl<'de> serde::de::Deserialize<'de> for State {
434        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
435        where
436            D: serde::Deserializer<'de>,
437        {
438            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
439                ".google.cloud.parallelstore.v1.Instance.State",
440            ))
441        }
442    }
443}
444
445/// List instances request.
446#[derive(Clone, Default, PartialEq)]
447#[non_exhaustive]
448pub struct ListInstancesRequest {
449    /// Required. The project and location for which to retrieve instance
450    /// information, in the format `projects/{project_id}/locations/{location}`.
451    ///
452    /// To retrieve instance information for all locations, use "-" as the value of
453    /// `{location}`.
454    pub parent: std::string::String,
455
456    /// Optional. Requested page size. Server may return fewer items than
457    /// requested. If unspecified, the server will pick an appropriate default.
458    pub page_size: i32,
459
460    /// Optional. A token identifying a page of results the server should return.
461    pub page_token: std::string::String,
462
463    /// Optional. Filtering results.
464    pub filter: std::string::String,
465
466    /// Optional. Hint for how to order the results.
467    pub order_by: std::string::String,
468
469    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
470}
471
472impl ListInstancesRequest {
473    pub fn new() -> Self {
474        std::default::Default::default()
475    }
476
477    /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
478    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
479        self.parent = v.into();
480        self
481    }
482
483    /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
484    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
485        self.page_size = v.into();
486        self
487    }
488
489    /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
490    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
491        self.page_token = v.into();
492        self
493    }
494
495    /// Sets the value of [filter][crate::model::ListInstancesRequest::filter].
496    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
497        self.filter = v.into();
498        self
499    }
500
501    /// Sets the value of [order_by][crate::model::ListInstancesRequest::order_by].
502    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
503        self.order_by = v.into();
504        self
505    }
506}
507
508impl wkt::message::Message for ListInstancesRequest {
509    fn typename() -> &'static str {
510        "type.googleapis.com/google.cloud.parallelstore.v1.ListInstancesRequest"
511    }
512}
513
514/// Response from
515/// [ListInstances][google.cloud.parallelstore.v1.Parallelstore.ListInstances].
516///
517/// [google.cloud.parallelstore.v1.Parallelstore.ListInstances]: crate::client::Parallelstore::list_instances
518#[derive(Clone, Default, PartialEq)]
519#[non_exhaustive]
520pub struct ListInstancesResponse {
521    /// The list of Parallelstore instances.
522    pub instances: std::vec::Vec<crate::model::Instance>,
523
524    /// A token identifying a page of results the server should return.
525    pub next_page_token: std::string::String,
526
527    /// Locations that could not be reached.
528    pub unreachable: std::vec::Vec<std::string::String>,
529
530    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
531}
532
533impl ListInstancesResponse {
534    pub fn new() -> Self {
535        std::default::Default::default()
536    }
537
538    /// Sets the value of [instances][crate::model::ListInstancesResponse::instances].
539    pub fn set_instances<T, V>(mut self, v: T) -> Self
540    where
541        T: std::iter::IntoIterator<Item = V>,
542        V: std::convert::Into<crate::model::Instance>,
543    {
544        use std::iter::Iterator;
545        self.instances = v.into_iter().map(|i| i.into()).collect();
546        self
547    }
548
549    /// Sets the value of [next_page_token][crate::model::ListInstancesResponse::next_page_token].
550    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
551        self.next_page_token = v.into();
552        self
553    }
554
555    /// Sets the value of [unreachable][crate::model::ListInstancesResponse::unreachable].
556    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
557    where
558        T: std::iter::IntoIterator<Item = V>,
559        V: std::convert::Into<std::string::String>,
560    {
561        use std::iter::Iterator;
562        self.unreachable = v.into_iter().map(|i| i.into()).collect();
563        self
564    }
565}
566
567impl wkt::message::Message for ListInstancesResponse {
568    fn typename() -> &'static str {
569        "type.googleapis.com/google.cloud.parallelstore.v1.ListInstancesResponse"
570    }
571}
572
573#[doc(hidden)]
574impl gax::paginator::internal::PageableResponse for ListInstancesResponse {
575    type PageItem = crate::model::Instance;
576
577    fn items(self) -> std::vec::Vec<Self::PageItem> {
578        self.instances
579    }
580
581    fn next_page_token(&self) -> std::string::String {
582        use std::clone::Clone;
583        self.next_page_token.clone()
584    }
585}
586
587/// Get an instance's details.
588#[derive(Clone, Default, PartialEq)]
589#[non_exhaustive]
590pub struct GetInstanceRequest {
591    /// Required. The instance resource name, in the format
592    /// `projects/{project_id}/locations/{location}/instances/{instance_id}`.
593    pub name: std::string::String,
594
595    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
596}
597
598impl GetInstanceRequest {
599    pub fn new() -> Self {
600        std::default::Default::default()
601    }
602
603    /// Sets the value of [name][crate::model::GetInstanceRequest::name].
604    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
605        self.name = v.into();
606        self
607    }
608}
609
610impl wkt::message::Message for GetInstanceRequest {
611    fn typename() -> &'static str {
612        "type.googleapis.com/google.cloud.parallelstore.v1.GetInstanceRequest"
613    }
614}
615
616/// Create a new Parallelstore instance.
617#[derive(Clone, Default, PartialEq)]
618#[non_exhaustive]
619pub struct CreateInstanceRequest {
620    /// Required. The instance's project and location, in the format
621    /// `projects/{project}/locations/{location}`.
622    /// Locations map to Google Cloud zones; for example, `us-west1-b`.
623    pub parent: std::string::String,
624
625    /// Required. The name of the Parallelstore instance.
626    ///
627    /// * Must contain only lowercase letters, numbers, and hyphens.
628    /// * Must start with a letter.
629    /// * Must be between 1-63 characters.
630    /// * Must end with a number or a letter.
631    /// * Must be unique within the customer project / location
632    pub instance_id: std::string::String,
633
634    /// Required. The instance to create.
635    pub instance: std::option::Option<crate::model::Instance>,
636
637    /// Optional. An optional request ID to identify requests. Specify a unique
638    /// request ID so that if you must retry your request, the server will know to
639    /// ignore the request if it has already been completed. The server will
640    /// guarantee that for at least 60 minutes since the first request.
641    ///
642    /// For example, consider a situation where you make an initial request and t
643    /// he request times out. If you make the request again with the same request
644    /// ID, the server can check if original operation with the same request ID
645    /// was received, and if so, will ignore the second request. This prevents
646    /// clients from accidentally creating duplicate commitments.
647    ///
648    /// The request ID must be a valid UUID with the exception that zero UUID is
649    /// not supported (00000000-0000-0000-0000-000000000000).
650    pub request_id: std::string::String,
651
652    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
653}
654
655impl CreateInstanceRequest {
656    pub fn new() -> Self {
657        std::default::Default::default()
658    }
659
660    /// Sets the value of [parent][crate::model::CreateInstanceRequest::parent].
661    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
662        self.parent = v.into();
663        self
664    }
665
666    /// Sets the value of [instance_id][crate::model::CreateInstanceRequest::instance_id].
667    pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
668        self.instance_id = v.into();
669        self
670    }
671
672    /// Sets the value of [instance][crate::model::CreateInstanceRequest::instance].
673    pub fn set_instance<T>(mut self, v: T) -> Self
674    where
675        T: std::convert::Into<crate::model::Instance>,
676    {
677        self.instance = std::option::Option::Some(v.into());
678        self
679    }
680
681    /// Sets or clears the value of [instance][crate::model::CreateInstanceRequest::instance].
682    pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
683    where
684        T: std::convert::Into<crate::model::Instance>,
685    {
686        self.instance = v.map(|x| x.into());
687        self
688    }
689
690    /// Sets the value of [request_id][crate::model::CreateInstanceRequest::request_id].
691    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
692        self.request_id = v.into();
693        self
694    }
695}
696
697impl wkt::message::Message for CreateInstanceRequest {
698    fn typename() -> &'static str {
699        "type.googleapis.com/google.cloud.parallelstore.v1.CreateInstanceRequest"
700    }
701}
702
703/// Update an instance.
704#[derive(Clone, Default, PartialEq)]
705#[non_exhaustive]
706pub struct UpdateInstanceRequest {
707    /// Required. Mask of fields to update. Field mask is used to specify the
708    /// fields to be overwritten in the Instance resource by the update. At least
709    /// one path must be supplied in this field. The fields specified in the
710    /// update_mask are relative to the resource, not the full request.
711    pub update_mask: std::option::Option<wkt::FieldMask>,
712
713    /// Required. The instance to update.
714    pub instance: std::option::Option<crate::model::Instance>,
715
716    /// Optional. An optional request ID to identify requests. Specify a unique
717    /// request ID so that if you must retry your request, the server will know to
718    /// ignore the request if it has already been completed. The server will
719    /// guarantee that for at least 60 minutes since the first request.
720    ///
721    /// For example, consider a situation where you make an initial request and t
722    /// he request times out. If you make the request again with the same request
723    /// ID, the server can check if original operation with the same request ID
724    /// was received, and if so, will ignore the second request. This prevents
725    /// clients from accidentally creating duplicate commitments.
726    ///
727    /// The request ID must be a valid UUID with the exception that zero UUID is
728    /// not supported (00000000-0000-0000-0000-000000000000).
729    pub request_id: std::string::String,
730
731    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
732}
733
734impl UpdateInstanceRequest {
735    pub fn new() -> Self {
736        std::default::Default::default()
737    }
738
739    /// Sets the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
740    pub fn set_update_mask<T>(mut self, v: T) -> Self
741    where
742        T: std::convert::Into<wkt::FieldMask>,
743    {
744        self.update_mask = std::option::Option::Some(v.into());
745        self
746    }
747
748    /// Sets or clears the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
749    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
750    where
751        T: std::convert::Into<wkt::FieldMask>,
752    {
753        self.update_mask = v.map(|x| x.into());
754        self
755    }
756
757    /// Sets the value of [instance][crate::model::UpdateInstanceRequest::instance].
758    pub fn set_instance<T>(mut self, v: T) -> Self
759    where
760        T: std::convert::Into<crate::model::Instance>,
761    {
762        self.instance = std::option::Option::Some(v.into());
763        self
764    }
765
766    /// Sets or clears the value of [instance][crate::model::UpdateInstanceRequest::instance].
767    pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
768    where
769        T: std::convert::Into<crate::model::Instance>,
770    {
771        self.instance = v.map(|x| x.into());
772        self
773    }
774
775    /// Sets the value of [request_id][crate::model::UpdateInstanceRequest::request_id].
776    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
777        self.request_id = v.into();
778        self
779    }
780}
781
782impl wkt::message::Message for UpdateInstanceRequest {
783    fn typename() -> &'static str {
784        "type.googleapis.com/google.cloud.parallelstore.v1.UpdateInstanceRequest"
785    }
786}
787
788/// Delete an instance.
789#[derive(Clone, Default, PartialEq)]
790#[non_exhaustive]
791pub struct DeleteInstanceRequest {
792    /// Required. Name of the resource
793    pub name: std::string::String,
794
795    /// Optional. An optional request ID to identify requests. Specify a unique
796    /// request ID so that if you must retry your request, the server will know to
797    /// ignore the request if it has already been completed. The server will
798    /// guarantee that for at least 60 minutes after the first request.
799    ///
800    /// For example, consider a situation where you make an initial request and t
801    /// he request times out. If you make the request again with the same request
802    /// ID, the server can check if original operation with the same request ID
803    /// was received, and if so, will ignore the second request. This prevents
804    /// clients from accidentally creating duplicate commitments.
805    ///
806    /// The request ID must be a valid UUID with the exception that zero UUID is
807    /// not supported (00000000-0000-0000-0000-000000000000).
808    pub request_id: std::string::String,
809
810    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
811}
812
813impl DeleteInstanceRequest {
814    pub fn new() -> Self {
815        std::default::Default::default()
816    }
817
818    /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
819    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
820        self.name = v.into();
821        self
822    }
823
824    /// Sets the value of [request_id][crate::model::DeleteInstanceRequest::request_id].
825    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
826        self.request_id = v.into();
827        self
828    }
829}
830
831impl wkt::message::Message for DeleteInstanceRequest {
832    fn typename() -> &'static str {
833        "type.googleapis.com/google.cloud.parallelstore.v1.DeleteInstanceRequest"
834    }
835}
836
837/// Long-running operation metadata.
838#[derive(Clone, Default, PartialEq)]
839#[non_exhaustive]
840pub struct OperationMetadata {
841    /// Output only. The time the operation was created.
842    pub create_time: std::option::Option<wkt::Timestamp>,
843
844    /// Output only. The time the operation finished running.
845    pub end_time: std::option::Option<wkt::Timestamp>,
846
847    /// Output only. Server-defined resource path for the target of the operation.
848    pub target: std::string::String,
849
850    /// Output only. Name of the verb executed by the operation.
851    pub verb: std::string::String,
852
853    /// Output only. Human-readable status of the operation, if any.
854    pub status_message: std::string::String,
855
856    /// Output only. Identifies whether the user has requested cancellation
857    /// of the operation. Operations that have been cancelled successfully
858    /// have [Operation.error][google.longrunning.Operation.error] value with a
859    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
860    /// `Code.CANCELLED`.
861    ///
862    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
863    /// [google.rpc.Status.code]: rpc::model::Status::code
864    pub requested_cancellation: bool,
865
866    /// Output only. API version used to start the operation.
867    pub api_version: std::string::String,
868
869    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
870}
871
872impl OperationMetadata {
873    pub fn new() -> Self {
874        std::default::Default::default()
875    }
876
877    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
878    pub fn set_create_time<T>(mut self, v: T) -> Self
879    where
880        T: std::convert::Into<wkt::Timestamp>,
881    {
882        self.create_time = std::option::Option::Some(v.into());
883        self
884    }
885
886    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
887    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
888    where
889        T: std::convert::Into<wkt::Timestamp>,
890    {
891        self.create_time = v.map(|x| x.into());
892        self
893    }
894
895    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
896    pub fn set_end_time<T>(mut self, v: T) -> Self
897    where
898        T: std::convert::Into<wkt::Timestamp>,
899    {
900        self.end_time = std::option::Option::Some(v.into());
901        self
902    }
903
904    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
905    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
906    where
907        T: std::convert::Into<wkt::Timestamp>,
908    {
909        self.end_time = v.map(|x| x.into());
910        self
911    }
912
913    /// Sets the value of [target][crate::model::OperationMetadata::target].
914    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
915        self.target = v.into();
916        self
917    }
918
919    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
920    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
921        self.verb = v.into();
922        self
923    }
924
925    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
926    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
927        self.status_message = v.into();
928        self
929    }
930
931    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
932    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
933        self.requested_cancellation = v.into();
934        self
935    }
936
937    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
938    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
939        self.api_version = v.into();
940        self
941    }
942}
943
944impl wkt::message::Message for OperationMetadata {
945    fn typename() -> &'static str {
946        "type.googleapis.com/google.cloud.parallelstore.v1.OperationMetadata"
947    }
948}
949
950/// Cloud Storage as the source of a data transfer.
951#[derive(Clone, Default, PartialEq)]
952#[non_exhaustive]
953pub struct SourceGcsBucket {
954    /// Required. URI to a Cloud Storage bucket in the format:
955    /// `gs://<bucket_name>/<path_inside_bucket>`. The path inside the bucket is
956    /// optional.
957    pub uri: std::string::String,
958
959    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
960}
961
962impl SourceGcsBucket {
963    pub fn new() -> Self {
964        std::default::Default::default()
965    }
966
967    /// Sets the value of [uri][crate::model::SourceGcsBucket::uri].
968    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
969        self.uri = v.into();
970        self
971    }
972}
973
974impl wkt::message::Message for SourceGcsBucket {
975    fn typename() -> &'static str {
976        "type.googleapis.com/google.cloud.parallelstore.v1.SourceGcsBucket"
977    }
978}
979
980/// Cloud Storage as the destination of a data transfer.
981#[derive(Clone, Default, PartialEq)]
982#[non_exhaustive]
983pub struct DestinationGcsBucket {
984    /// Required. URI to a Cloud Storage bucket in the format:
985    /// `gs://<bucket_name>/<path_inside_bucket>`. The path inside the bucket is
986    /// optional.
987    pub uri: std::string::String,
988
989    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
990}
991
992impl DestinationGcsBucket {
993    pub fn new() -> Self {
994        std::default::Default::default()
995    }
996
997    /// Sets the value of [uri][crate::model::DestinationGcsBucket::uri].
998    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
999        self.uri = v.into();
1000        self
1001    }
1002}
1003
1004impl wkt::message::Message for DestinationGcsBucket {
1005    fn typename() -> &'static str {
1006        "type.googleapis.com/google.cloud.parallelstore.v1.DestinationGcsBucket"
1007    }
1008}
1009
1010/// Parallelstore as the source of a data transfer.
1011#[derive(Clone, Default, PartialEq)]
1012#[non_exhaustive]
1013pub struct SourceParallelstore {
1014    /// Optional. Root directory path to the Paralellstore filesystem, starting
1015    /// with `/`. Defaults to `/` if unset.
1016    pub path: std::string::String,
1017
1018    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1019}
1020
1021impl SourceParallelstore {
1022    pub fn new() -> Self {
1023        std::default::Default::default()
1024    }
1025
1026    /// Sets the value of [path][crate::model::SourceParallelstore::path].
1027    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1028        self.path = v.into();
1029        self
1030    }
1031}
1032
1033impl wkt::message::Message for SourceParallelstore {
1034    fn typename() -> &'static str {
1035        "type.googleapis.com/google.cloud.parallelstore.v1.SourceParallelstore"
1036    }
1037}
1038
1039/// Parallelstore as the destination of a data transfer.
1040#[derive(Clone, Default, PartialEq)]
1041#[non_exhaustive]
1042pub struct DestinationParallelstore {
1043    /// Optional. Root directory path to the Paralellstore filesystem, starting
1044    /// with `/`. Defaults to `/` if unset.
1045    pub path: std::string::String,
1046
1047    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1048}
1049
1050impl DestinationParallelstore {
1051    pub fn new() -> Self {
1052        std::default::Default::default()
1053    }
1054
1055    /// Sets the value of [path][crate::model::DestinationParallelstore::path].
1056    pub fn set_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1057        self.path = v.into();
1058        self
1059    }
1060}
1061
1062impl wkt::message::Message for DestinationParallelstore {
1063    fn typename() -> &'static str {
1064        "type.googleapis.com/google.cloud.parallelstore.v1.DestinationParallelstore"
1065    }
1066}
1067
1068/// Import data from Cloud Storage into a Parallelstore instance.
1069#[derive(Clone, Default, PartialEq)]
1070#[non_exhaustive]
1071pub struct ImportDataRequest {
1072    /// Required. Name of the resource.
1073    pub name: std::string::String,
1074
1075    /// Optional. An optional request ID to identify requests. Specify a unique
1076    /// request ID so that if you must retry your request, the server will know to
1077    /// ignore the request if it has already been completed. The server will
1078    /// guarantee that for at least 60 minutes since the first request.
1079    ///
1080    /// For example, consider a situation where you make an initial request and t
1081    /// he request times out. If you make the request again with the same request
1082    /// ID, the server can check if original operation with the same request ID
1083    /// was received, and if so, will ignore the second request. This prevents
1084    /// clients from accidentally creating duplicate commitments.
1085    ///
1086    /// The request ID must be a valid UUID with the exception that zero UUID is
1087    /// not supported (00000000-0000-0000-0000-000000000000).
1088    pub request_id: std::string::String,
1089
1090    /// Optional. User-specified service account credentials to be used when
1091    /// performing the transfer.
1092    ///
1093    /// Use one of the following formats:
1094    ///
1095    /// * `{EMAIL_ADDRESS_OR_UNIQUE_ID}`
1096    /// * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}`
1097    /// * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}`
1098    ///
1099    /// If unspecified, the Parallelstore service agent is used:
1100    /// `service-<PROJECT_NUMBER>@gcp-sa-parallelstore.iam.gserviceaccount.com`
1101    pub service_account: std::string::String,
1102
1103    /// The source of the data being imported into the Parallelstore instance.
1104    pub source: std::option::Option<crate::model::import_data_request::Source>,
1105
1106    /// The Parallelstore instance into which to import data.
1107    pub destination: std::option::Option<crate::model::import_data_request::Destination>,
1108
1109    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1110}
1111
1112impl ImportDataRequest {
1113    pub fn new() -> Self {
1114        std::default::Default::default()
1115    }
1116
1117    /// Sets the value of [name][crate::model::ImportDataRequest::name].
1118    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1119        self.name = v.into();
1120        self
1121    }
1122
1123    /// Sets the value of [request_id][crate::model::ImportDataRequest::request_id].
1124    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1125        self.request_id = v.into();
1126        self
1127    }
1128
1129    /// Sets the value of [service_account][crate::model::ImportDataRequest::service_account].
1130    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1131        self.service_account = v.into();
1132        self
1133    }
1134
1135    /// Sets the value of [source][crate::model::ImportDataRequest::source].
1136    ///
1137    /// Note that all the setters affecting `source` are mutually
1138    /// exclusive.
1139    pub fn set_source<
1140        T: std::convert::Into<std::option::Option<crate::model::import_data_request::Source>>,
1141    >(
1142        mut self,
1143        v: T,
1144    ) -> Self {
1145        self.source = v.into();
1146        self
1147    }
1148
1149    /// The value of [source][crate::model::ImportDataRequest::source]
1150    /// if it holds a `SourceGcsBucket`, `None` if the field is not set or
1151    /// holds a different branch.
1152    pub fn source_gcs_bucket(
1153        &self,
1154    ) -> std::option::Option<&std::boxed::Box<crate::model::SourceGcsBucket>> {
1155        #[allow(unreachable_patterns)]
1156        self.source.as_ref().and_then(|v| match v {
1157            crate::model::import_data_request::Source::SourceGcsBucket(v) => {
1158                std::option::Option::Some(v)
1159            }
1160            _ => std::option::Option::None,
1161        })
1162    }
1163
1164    /// Sets the value of [source][crate::model::ImportDataRequest::source]
1165    /// to hold a `SourceGcsBucket`.
1166    ///
1167    /// Note that all the setters affecting `source` are
1168    /// mutually exclusive.
1169    pub fn set_source_gcs_bucket<
1170        T: std::convert::Into<std::boxed::Box<crate::model::SourceGcsBucket>>,
1171    >(
1172        mut self,
1173        v: T,
1174    ) -> Self {
1175        self.source = std::option::Option::Some(
1176            crate::model::import_data_request::Source::SourceGcsBucket(v.into()),
1177        );
1178        self
1179    }
1180
1181    /// Sets the value of [destination][crate::model::ImportDataRequest::destination].
1182    ///
1183    /// Note that all the setters affecting `destination` are mutually
1184    /// exclusive.
1185    pub fn set_destination<
1186        T: std::convert::Into<std::option::Option<crate::model::import_data_request::Destination>>,
1187    >(
1188        mut self,
1189        v: T,
1190    ) -> Self {
1191        self.destination = v.into();
1192        self
1193    }
1194
1195    /// The value of [destination][crate::model::ImportDataRequest::destination]
1196    /// if it holds a `DestinationParallelstore`, `None` if the field is not set or
1197    /// holds a different branch.
1198    pub fn destination_parallelstore(
1199        &self,
1200    ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationParallelstore>> {
1201        #[allow(unreachable_patterns)]
1202        self.destination.as_ref().and_then(|v| match v {
1203            crate::model::import_data_request::Destination::DestinationParallelstore(v) => {
1204                std::option::Option::Some(v)
1205            }
1206            _ => std::option::Option::None,
1207        })
1208    }
1209
1210    /// Sets the value of [destination][crate::model::ImportDataRequest::destination]
1211    /// to hold a `DestinationParallelstore`.
1212    ///
1213    /// Note that all the setters affecting `destination` are
1214    /// mutually exclusive.
1215    pub fn set_destination_parallelstore<
1216        T: std::convert::Into<std::boxed::Box<crate::model::DestinationParallelstore>>,
1217    >(
1218        mut self,
1219        v: T,
1220    ) -> Self {
1221        self.destination = std::option::Option::Some(
1222            crate::model::import_data_request::Destination::DestinationParallelstore(v.into()),
1223        );
1224        self
1225    }
1226}
1227
1228impl wkt::message::Message for ImportDataRequest {
1229    fn typename() -> &'static str {
1230        "type.googleapis.com/google.cloud.parallelstore.v1.ImportDataRequest"
1231    }
1232}
1233
1234/// Defines additional types related to [ImportDataRequest].
1235pub mod import_data_request {
1236    #[allow(unused_imports)]
1237    use super::*;
1238
1239    /// The source of the data being imported into the Parallelstore instance.
1240    #[derive(Clone, Debug, PartialEq)]
1241    #[non_exhaustive]
1242    pub enum Source {
1243        /// The Cloud Storage source bucket and, optionally, path inside the bucket.
1244        SourceGcsBucket(std::boxed::Box<crate::model::SourceGcsBucket>),
1245    }
1246
1247    /// The Parallelstore instance into which to import data.
1248    #[derive(Clone, Debug, PartialEq)]
1249    #[non_exhaustive]
1250    pub enum Destination {
1251        /// Parallelstore destination.
1252        DestinationParallelstore(std::boxed::Box<crate::model::DestinationParallelstore>),
1253    }
1254}
1255
1256/// Export data from Parallelstore to Cloud Storage.
1257#[derive(Clone, Default, PartialEq)]
1258#[non_exhaustive]
1259pub struct ExportDataRequest {
1260    /// Required. Name of the resource.
1261    pub name: std::string::String,
1262
1263    /// Optional. An optional request ID to identify requests. Specify a unique
1264    /// request ID so that if you must retry your request, the server will know to
1265    /// ignore the request if it has already been completed. The server will
1266    /// guarantee that for at least 60 minutes since the first request.
1267    ///
1268    /// For example, consider a situation where you make an initial request and t
1269    /// he request times out. If you make the request again with the same request
1270    /// ID, the server can check if original operation with the same request ID
1271    /// was received, and if so, will ignore the second request. This prevents
1272    /// clients from accidentally creating duplicate commitments.
1273    ///
1274    /// The request ID must be a valid UUID with the exception that zero UUID is
1275    /// not supported (00000000-0000-0000-0000-000000000000).
1276    pub request_id: std::string::String,
1277
1278    /// Optional. User-specified Service Account (SA) credentials to be used when
1279    /// performing the transfer.
1280    /// Use one of the following formats:
1281    ///
1282    /// * `{EMAIL_ADDRESS_OR_UNIQUE_ID}`
1283    /// * `projects/{PROJECT_ID_OR_NUMBER}/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}`
1284    /// * `projects/-/serviceAccounts/{EMAIL_ADDRESS_OR_UNIQUE_ID}`
1285    ///
1286    /// If unspecified, the Parallelstore service agent is used:
1287    /// `service-<PROJECT_NUMBER>@gcp-sa-parallelstore.iam.gserviceaccount.com`
1288    pub service_account: std::string::String,
1289
1290    /// The Parallelstore instance to export from.
1291    pub source: std::option::Option<crate::model::export_data_request::Source>,
1292
1293    /// The Cloud Storage bucket to export to.
1294    pub destination: std::option::Option<crate::model::export_data_request::Destination>,
1295
1296    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1297}
1298
1299impl ExportDataRequest {
1300    pub fn new() -> Self {
1301        std::default::Default::default()
1302    }
1303
1304    /// Sets the value of [name][crate::model::ExportDataRequest::name].
1305    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1306        self.name = v.into();
1307        self
1308    }
1309
1310    /// Sets the value of [request_id][crate::model::ExportDataRequest::request_id].
1311    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1312        self.request_id = v.into();
1313        self
1314    }
1315
1316    /// Sets the value of [service_account][crate::model::ExportDataRequest::service_account].
1317    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1318        self.service_account = v.into();
1319        self
1320    }
1321
1322    /// Sets the value of [source][crate::model::ExportDataRequest::source].
1323    ///
1324    /// Note that all the setters affecting `source` are mutually
1325    /// exclusive.
1326    pub fn set_source<
1327        T: std::convert::Into<std::option::Option<crate::model::export_data_request::Source>>,
1328    >(
1329        mut self,
1330        v: T,
1331    ) -> Self {
1332        self.source = v.into();
1333        self
1334    }
1335
1336    /// The value of [source][crate::model::ExportDataRequest::source]
1337    /// if it holds a `SourceParallelstore`, `None` if the field is not set or
1338    /// holds a different branch.
1339    pub fn source_parallelstore(
1340        &self,
1341    ) -> std::option::Option<&std::boxed::Box<crate::model::SourceParallelstore>> {
1342        #[allow(unreachable_patterns)]
1343        self.source.as_ref().and_then(|v| match v {
1344            crate::model::export_data_request::Source::SourceParallelstore(v) => {
1345                std::option::Option::Some(v)
1346            }
1347            _ => std::option::Option::None,
1348        })
1349    }
1350
1351    /// Sets the value of [source][crate::model::ExportDataRequest::source]
1352    /// to hold a `SourceParallelstore`.
1353    ///
1354    /// Note that all the setters affecting `source` are
1355    /// mutually exclusive.
1356    pub fn set_source_parallelstore<
1357        T: std::convert::Into<std::boxed::Box<crate::model::SourceParallelstore>>,
1358    >(
1359        mut self,
1360        v: T,
1361    ) -> Self {
1362        self.source = std::option::Option::Some(
1363            crate::model::export_data_request::Source::SourceParallelstore(v.into()),
1364        );
1365        self
1366    }
1367
1368    /// Sets the value of [destination][crate::model::ExportDataRequest::destination].
1369    ///
1370    /// Note that all the setters affecting `destination` are mutually
1371    /// exclusive.
1372    pub fn set_destination<
1373        T: std::convert::Into<std::option::Option<crate::model::export_data_request::Destination>>,
1374    >(
1375        mut self,
1376        v: T,
1377    ) -> Self {
1378        self.destination = v.into();
1379        self
1380    }
1381
1382    /// The value of [destination][crate::model::ExportDataRequest::destination]
1383    /// if it holds a `DestinationGcsBucket`, `None` if the field is not set or
1384    /// holds a different branch.
1385    pub fn destination_gcs_bucket(
1386        &self,
1387    ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationGcsBucket>> {
1388        #[allow(unreachable_patterns)]
1389        self.destination.as_ref().and_then(|v| match v {
1390            crate::model::export_data_request::Destination::DestinationGcsBucket(v) => {
1391                std::option::Option::Some(v)
1392            }
1393            _ => std::option::Option::None,
1394        })
1395    }
1396
1397    /// Sets the value of [destination][crate::model::ExportDataRequest::destination]
1398    /// to hold a `DestinationGcsBucket`.
1399    ///
1400    /// Note that all the setters affecting `destination` are
1401    /// mutually exclusive.
1402    pub fn set_destination_gcs_bucket<
1403        T: std::convert::Into<std::boxed::Box<crate::model::DestinationGcsBucket>>,
1404    >(
1405        mut self,
1406        v: T,
1407    ) -> Self {
1408        self.destination = std::option::Option::Some(
1409            crate::model::export_data_request::Destination::DestinationGcsBucket(v.into()),
1410        );
1411        self
1412    }
1413}
1414
1415impl wkt::message::Message for ExportDataRequest {
1416    fn typename() -> &'static str {
1417        "type.googleapis.com/google.cloud.parallelstore.v1.ExportDataRequest"
1418    }
1419}
1420
1421/// Defines additional types related to [ExportDataRequest].
1422pub mod export_data_request {
1423    #[allow(unused_imports)]
1424    use super::*;
1425
1426    /// The Parallelstore instance to export from.
1427    #[derive(Clone, Debug, PartialEq)]
1428    #[non_exhaustive]
1429    pub enum Source {
1430        /// Parallelstore source.
1431        SourceParallelstore(std::boxed::Box<crate::model::SourceParallelstore>),
1432    }
1433
1434    /// The Cloud Storage bucket to export to.
1435    #[derive(Clone, Debug, PartialEq)]
1436    #[non_exhaustive]
1437    pub enum Destination {
1438        /// Cloud Storage destination.
1439        DestinationGcsBucket(std::boxed::Box<crate::model::DestinationGcsBucket>),
1440    }
1441}
1442
1443/// The response to a request to import data to Parallelstore.
1444#[derive(Clone, Default, PartialEq)]
1445#[non_exhaustive]
1446pub struct ImportDataResponse {
1447    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1448}
1449
1450impl ImportDataResponse {
1451    pub fn new() -> Self {
1452        std::default::Default::default()
1453    }
1454}
1455
1456impl wkt::message::Message for ImportDataResponse {
1457    fn typename() -> &'static str {
1458        "type.googleapis.com/google.cloud.parallelstore.v1.ImportDataResponse"
1459    }
1460}
1461
1462/// An entry describing an error that has occurred.
1463#[derive(Clone, Default, PartialEq)]
1464#[non_exhaustive]
1465pub struct TransferErrorLogEntry {
1466    /// A URL that refers to the target (a data source, a data sink,
1467    /// or an object) with which the error is associated.
1468    pub uri: std::string::String,
1469
1470    /// A list of messages that carry the error details.
1471    pub error_details: std::vec::Vec<std::string::String>,
1472
1473    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1474}
1475
1476impl TransferErrorLogEntry {
1477    pub fn new() -> Self {
1478        std::default::Default::default()
1479    }
1480
1481    /// Sets the value of [uri][crate::model::TransferErrorLogEntry::uri].
1482    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1483        self.uri = v.into();
1484        self
1485    }
1486
1487    /// Sets the value of [error_details][crate::model::TransferErrorLogEntry::error_details].
1488    pub fn set_error_details<T, V>(mut self, v: T) -> Self
1489    where
1490        T: std::iter::IntoIterator<Item = V>,
1491        V: std::convert::Into<std::string::String>,
1492    {
1493        use std::iter::Iterator;
1494        self.error_details = v.into_iter().map(|i| i.into()).collect();
1495        self
1496    }
1497}
1498
1499impl wkt::message::Message for TransferErrorLogEntry {
1500    fn typename() -> &'static str {
1501        "type.googleapis.com/google.cloud.parallelstore.v1.TransferErrorLogEntry"
1502    }
1503}
1504
1505/// A summary of errors by error code, plus a count and sample error log
1506/// entries.
1507#[derive(Clone, Default, PartialEq)]
1508#[non_exhaustive]
1509pub struct TransferErrorSummary {
1510    /// One of the error codes that caused the transfer failure.
1511    pub error_code: rpc::model::Code,
1512
1513    /// Count of this type of error.
1514    pub error_count: i64,
1515
1516    /// A list of messages that carry the error details.
1517    pub error_log_entries: std::vec::Vec<crate::model::TransferErrorLogEntry>,
1518
1519    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1520}
1521
1522impl TransferErrorSummary {
1523    pub fn new() -> Self {
1524        std::default::Default::default()
1525    }
1526
1527    /// Sets the value of [error_code][crate::model::TransferErrorSummary::error_code].
1528    pub fn set_error_code<T: std::convert::Into<rpc::model::Code>>(mut self, v: T) -> Self {
1529        self.error_code = v.into();
1530        self
1531    }
1532
1533    /// Sets the value of [error_count][crate::model::TransferErrorSummary::error_count].
1534    pub fn set_error_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1535        self.error_count = v.into();
1536        self
1537    }
1538
1539    /// Sets the value of [error_log_entries][crate::model::TransferErrorSummary::error_log_entries].
1540    pub fn set_error_log_entries<T, V>(mut self, v: T) -> Self
1541    where
1542        T: std::iter::IntoIterator<Item = V>,
1543        V: std::convert::Into<crate::model::TransferErrorLogEntry>,
1544    {
1545        use std::iter::Iterator;
1546        self.error_log_entries = v.into_iter().map(|i| i.into()).collect();
1547        self
1548    }
1549}
1550
1551impl wkt::message::Message for TransferErrorSummary {
1552    fn typename() -> &'static str {
1553        "type.googleapis.com/google.cloud.parallelstore.v1.TransferErrorSummary"
1554    }
1555}
1556
1557/// Metadata related to the data import operation.
1558#[derive(Clone, Default, PartialEq)]
1559#[non_exhaustive]
1560pub struct ImportDataMetadata {
1561    /// Data transfer operation metadata.
1562    pub operation_metadata: std::option::Option<crate::model::TransferOperationMetadata>,
1563
1564    /// Output only. The time the operation was created.
1565    pub create_time: std::option::Option<wkt::Timestamp>,
1566
1567    /// Output only. The time the operation finished running.
1568    pub end_time: std::option::Option<wkt::Timestamp>,
1569
1570    /// Output only. Server-defined resource path for the target of the operation.
1571    pub target: std::string::String,
1572
1573    /// Output only. Name of the verb executed by the operation.
1574    pub verb: std::string::String,
1575
1576    /// Output only. Human-readable status of the operation, if any.
1577    pub status_message: std::string::String,
1578
1579    /// Output only. Identifies whether the user has requested cancellation
1580    /// of the operation. Operations that have successfully been cancelled
1581    /// have [Operation.error][google.longrunning.Operation.error] value with a
1582    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
1583    /// `Code.CANCELLED`.
1584    ///
1585    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
1586    /// [google.rpc.Status.code]: rpc::model::Status::code
1587    pub requested_cancellation: bool,
1588
1589    /// Output only. API version used to start the operation.
1590    pub api_version: std::string::String,
1591
1592    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1593}
1594
1595impl ImportDataMetadata {
1596    pub fn new() -> Self {
1597        std::default::Default::default()
1598    }
1599
1600    /// Sets the value of [operation_metadata][crate::model::ImportDataMetadata::operation_metadata].
1601    pub fn set_operation_metadata<T>(mut self, v: T) -> Self
1602    where
1603        T: std::convert::Into<crate::model::TransferOperationMetadata>,
1604    {
1605        self.operation_metadata = std::option::Option::Some(v.into());
1606        self
1607    }
1608
1609    /// Sets or clears the value of [operation_metadata][crate::model::ImportDataMetadata::operation_metadata].
1610    pub fn set_or_clear_operation_metadata<T>(mut self, v: std::option::Option<T>) -> Self
1611    where
1612        T: std::convert::Into<crate::model::TransferOperationMetadata>,
1613    {
1614        self.operation_metadata = v.map(|x| x.into());
1615        self
1616    }
1617
1618    /// Sets the value of [create_time][crate::model::ImportDataMetadata::create_time].
1619    pub fn set_create_time<T>(mut self, v: T) -> Self
1620    where
1621        T: std::convert::Into<wkt::Timestamp>,
1622    {
1623        self.create_time = std::option::Option::Some(v.into());
1624        self
1625    }
1626
1627    /// Sets or clears the value of [create_time][crate::model::ImportDataMetadata::create_time].
1628    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1629    where
1630        T: std::convert::Into<wkt::Timestamp>,
1631    {
1632        self.create_time = v.map(|x| x.into());
1633        self
1634    }
1635
1636    /// Sets the value of [end_time][crate::model::ImportDataMetadata::end_time].
1637    pub fn set_end_time<T>(mut self, v: T) -> Self
1638    where
1639        T: std::convert::Into<wkt::Timestamp>,
1640    {
1641        self.end_time = std::option::Option::Some(v.into());
1642        self
1643    }
1644
1645    /// Sets or clears the value of [end_time][crate::model::ImportDataMetadata::end_time].
1646    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1647    where
1648        T: std::convert::Into<wkt::Timestamp>,
1649    {
1650        self.end_time = v.map(|x| x.into());
1651        self
1652    }
1653
1654    /// Sets the value of [target][crate::model::ImportDataMetadata::target].
1655    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1656        self.target = v.into();
1657        self
1658    }
1659
1660    /// Sets the value of [verb][crate::model::ImportDataMetadata::verb].
1661    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1662        self.verb = v.into();
1663        self
1664    }
1665
1666    /// Sets the value of [status_message][crate::model::ImportDataMetadata::status_message].
1667    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1668        self.status_message = v.into();
1669        self
1670    }
1671
1672    /// Sets the value of [requested_cancellation][crate::model::ImportDataMetadata::requested_cancellation].
1673    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1674        self.requested_cancellation = v.into();
1675        self
1676    }
1677
1678    /// Sets the value of [api_version][crate::model::ImportDataMetadata::api_version].
1679    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1680        self.api_version = v.into();
1681        self
1682    }
1683}
1684
1685impl wkt::message::Message for ImportDataMetadata {
1686    fn typename() -> &'static str {
1687        "type.googleapis.com/google.cloud.parallelstore.v1.ImportDataMetadata"
1688    }
1689}
1690
1691/// The response to a request to export data from Parallelstore.
1692#[derive(Clone, Default, PartialEq)]
1693#[non_exhaustive]
1694pub struct ExportDataResponse {
1695    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1696}
1697
1698impl ExportDataResponse {
1699    pub fn new() -> Self {
1700        std::default::Default::default()
1701    }
1702}
1703
1704impl wkt::message::Message for ExportDataResponse {
1705    fn typename() -> &'static str {
1706        "type.googleapis.com/google.cloud.parallelstore.v1.ExportDataResponse"
1707    }
1708}
1709
1710/// Metadata related to the data export operation.
1711#[derive(Clone, Default, PartialEq)]
1712#[non_exhaustive]
1713pub struct ExportDataMetadata {
1714    /// Data transfer operation metadata.
1715    pub operation_metadata: std::option::Option<crate::model::TransferOperationMetadata>,
1716
1717    /// Output only. The time the operation was created.
1718    pub create_time: std::option::Option<wkt::Timestamp>,
1719
1720    /// Output only. The time the operation finished running.
1721    pub end_time: std::option::Option<wkt::Timestamp>,
1722
1723    /// Output only. Server-defined resource path for the target of the operation.
1724    pub target: std::string::String,
1725
1726    /// Output only. Name of the verb executed by the operation.
1727    pub verb: std::string::String,
1728
1729    /// Output only. Human-readable status of the operation, if any.
1730    pub status_message: std::string::String,
1731
1732    /// Output only. Identifies whether the user has requested cancellation
1733    /// of the operation. Operations that have successfully been cancelled
1734    /// have [Operation.error][google.longrunning.Operation.error] value with a
1735    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
1736    /// `Code.CANCELLED`.
1737    ///
1738    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
1739    /// [google.rpc.Status.code]: rpc::model::Status::code
1740    pub requested_cancellation: bool,
1741
1742    /// Output only. API version used to start the operation.
1743    pub api_version: std::string::String,
1744
1745    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1746}
1747
1748impl ExportDataMetadata {
1749    pub fn new() -> Self {
1750        std::default::Default::default()
1751    }
1752
1753    /// Sets the value of [operation_metadata][crate::model::ExportDataMetadata::operation_metadata].
1754    pub fn set_operation_metadata<T>(mut self, v: T) -> Self
1755    where
1756        T: std::convert::Into<crate::model::TransferOperationMetadata>,
1757    {
1758        self.operation_metadata = std::option::Option::Some(v.into());
1759        self
1760    }
1761
1762    /// Sets or clears the value of [operation_metadata][crate::model::ExportDataMetadata::operation_metadata].
1763    pub fn set_or_clear_operation_metadata<T>(mut self, v: std::option::Option<T>) -> Self
1764    where
1765        T: std::convert::Into<crate::model::TransferOperationMetadata>,
1766    {
1767        self.operation_metadata = v.map(|x| x.into());
1768        self
1769    }
1770
1771    /// Sets the value of [create_time][crate::model::ExportDataMetadata::create_time].
1772    pub fn set_create_time<T>(mut self, v: T) -> Self
1773    where
1774        T: std::convert::Into<wkt::Timestamp>,
1775    {
1776        self.create_time = std::option::Option::Some(v.into());
1777        self
1778    }
1779
1780    /// Sets or clears the value of [create_time][crate::model::ExportDataMetadata::create_time].
1781    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1782    where
1783        T: std::convert::Into<wkt::Timestamp>,
1784    {
1785        self.create_time = v.map(|x| x.into());
1786        self
1787    }
1788
1789    /// Sets the value of [end_time][crate::model::ExportDataMetadata::end_time].
1790    pub fn set_end_time<T>(mut self, v: T) -> Self
1791    where
1792        T: std::convert::Into<wkt::Timestamp>,
1793    {
1794        self.end_time = std::option::Option::Some(v.into());
1795        self
1796    }
1797
1798    /// Sets or clears the value of [end_time][crate::model::ExportDataMetadata::end_time].
1799    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1800    where
1801        T: std::convert::Into<wkt::Timestamp>,
1802    {
1803        self.end_time = v.map(|x| x.into());
1804        self
1805    }
1806
1807    /// Sets the value of [target][crate::model::ExportDataMetadata::target].
1808    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1809        self.target = v.into();
1810        self
1811    }
1812
1813    /// Sets the value of [verb][crate::model::ExportDataMetadata::verb].
1814    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1815        self.verb = v.into();
1816        self
1817    }
1818
1819    /// Sets the value of [status_message][crate::model::ExportDataMetadata::status_message].
1820    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1821        self.status_message = v.into();
1822        self
1823    }
1824
1825    /// Sets the value of [requested_cancellation][crate::model::ExportDataMetadata::requested_cancellation].
1826    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1827        self.requested_cancellation = v.into();
1828        self
1829    }
1830
1831    /// Sets the value of [api_version][crate::model::ExportDataMetadata::api_version].
1832    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1833        self.api_version = v.into();
1834        self
1835    }
1836}
1837
1838impl wkt::message::Message for ExportDataMetadata {
1839    fn typename() -> &'static str {
1840        "type.googleapis.com/google.cloud.parallelstore.v1.ExportDataMetadata"
1841    }
1842}
1843
1844/// Long-running operation metadata related to a data transfer.
1845#[derive(Clone, Default, PartialEq)]
1846#[non_exhaustive]
1847pub struct TransferOperationMetadata {
1848    /// Output only. The progress of the transfer operation.
1849    pub counters: std::option::Option<crate::model::TransferCounters>,
1850
1851    /// Output only. The type of transfer occurring.
1852    pub transfer_type: crate::model::TransferType,
1853
1854    /// Output only. List of files that failed to be transferred. This list will
1855    /// have a maximum size of 5 elements.
1856    pub error_summary: std::vec::Vec<crate::model::TransferErrorSummary>,
1857
1858    /// The source of transfer operation.
1859    pub source: std::option::Option<crate::model::transfer_operation_metadata::Source>,
1860
1861    /// The destination of transfer operation.
1862    pub destination: std::option::Option<crate::model::transfer_operation_metadata::Destination>,
1863
1864    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1865}
1866
1867impl TransferOperationMetadata {
1868    pub fn new() -> Self {
1869        std::default::Default::default()
1870    }
1871
1872    /// Sets the value of [counters][crate::model::TransferOperationMetadata::counters].
1873    pub fn set_counters<T>(mut self, v: T) -> Self
1874    where
1875        T: std::convert::Into<crate::model::TransferCounters>,
1876    {
1877        self.counters = std::option::Option::Some(v.into());
1878        self
1879    }
1880
1881    /// Sets or clears the value of [counters][crate::model::TransferOperationMetadata::counters].
1882    pub fn set_or_clear_counters<T>(mut self, v: std::option::Option<T>) -> Self
1883    where
1884        T: std::convert::Into<crate::model::TransferCounters>,
1885    {
1886        self.counters = v.map(|x| x.into());
1887        self
1888    }
1889
1890    /// Sets the value of [transfer_type][crate::model::TransferOperationMetadata::transfer_type].
1891    pub fn set_transfer_type<T: std::convert::Into<crate::model::TransferType>>(
1892        mut self,
1893        v: T,
1894    ) -> Self {
1895        self.transfer_type = v.into();
1896        self
1897    }
1898
1899    /// Sets the value of [error_summary][crate::model::TransferOperationMetadata::error_summary].
1900    pub fn set_error_summary<T, V>(mut self, v: T) -> Self
1901    where
1902        T: std::iter::IntoIterator<Item = V>,
1903        V: std::convert::Into<crate::model::TransferErrorSummary>,
1904    {
1905        use std::iter::Iterator;
1906        self.error_summary = v.into_iter().map(|i| i.into()).collect();
1907        self
1908    }
1909
1910    /// Sets the value of [source][crate::model::TransferOperationMetadata::source].
1911    ///
1912    /// Note that all the setters affecting `source` are mutually
1913    /// exclusive.
1914    pub fn set_source<
1915        T: std::convert::Into<std::option::Option<crate::model::transfer_operation_metadata::Source>>,
1916    >(
1917        mut self,
1918        v: T,
1919    ) -> Self {
1920        self.source = v.into();
1921        self
1922    }
1923
1924    /// The value of [source][crate::model::TransferOperationMetadata::source]
1925    /// if it holds a `SourceParallelstore`, `None` if the field is not set or
1926    /// holds a different branch.
1927    pub fn source_parallelstore(
1928        &self,
1929    ) -> std::option::Option<&std::boxed::Box<crate::model::SourceParallelstore>> {
1930        #[allow(unreachable_patterns)]
1931        self.source.as_ref().and_then(|v| match v {
1932            crate::model::transfer_operation_metadata::Source::SourceParallelstore(v) => {
1933                std::option::Option::Some(v)
1934            }
1935            _ => std::option::Option::None,
1936        })
1937    }
1938
1939    /// Sets the value of [source][crate::model::TransferOperationMetadata::source]
1940    /// to hold a `SourceParallelstore`.
1941    ///
1942    /// Note that all the setters affecting `source` are
1943    /// mutually exclusive.
1944    pub fn set_source_parallelstore<
1945        T: std::convert::Into<std::boxed::Box<crate::model::SourceParallelstore>>,
1946    >(
1947        mut self,
1948        v: T,
1949    ) -> Self {
1950        self.source = std::option::Option::Some(
1951            crate::model::transfer_operation_metadata::Source::SourceParallelstore(v.into()),
1952        );
1953        self
1954    }
1955
1956    /// The value of [source][crate::model::TransferOperationMetadata::source]
1957    /// if it holds a `SourceGcsBucket`, `None` if the field is not set or
1958    /// holds a different branch.
1959    pub fn source_gcs_bucket(
1960        &self,
1961    ) -> std::option::Option<&std::boxed::Box<crate::model::SourceGcsBucket>> {
1962        #[allow(unreachable_patterns)]
1963        self.source.as_ref().and_then(|v| match v {
1964            crate::model::transfer_operation_metadata::Source::SourceGcsBucket(v) => {
1965                std::option::Option::Some(v)
1966            }
1967            _ => std::option::Option::None,
1968        })
1969    }
1970
1971    /// Sets the value of [source][crate::model::TransferOperationMetadata::source]
1972    /// to hold a `SourceGcsBucket`.
1973    ///
1974    /// Note that all the setters affecting `source` are
1975    /// mutually exclusive.
1976    pub fn set_source_gcs_bucket<
1977        T: std::convert::Into<std::boxed::Box<crate::model::SourceGcsBucket>>,
1978    >(
1979        mut self,
1980        v: T,
1981    ) -> Self {
1982        self.source = std::option::Option::Some(
1983            crate::model::transfer_operation_metadata::Source::SourceGcsBucket(v.into()),
1984        );
1985        self
1986    }
1987
1988    /// Sets the value of [destination][crate::model::TransferOperationMetadata::destination].
1989    ///
1990    /// Note that all the setters affecting `destination` are mutually
1991    /// exclusive.
1992    pub fn set_destination<
1993        T: std::convert::Into<
1994                std::option::Option<crate::model::transfer_operation_metadata::Destination>,
1995            >,
1996    >(
1997        mut self,
1998        v: T,
1999    ) -> Self {
2000        self.destination = v.into();
2001        self
2002    }
2003
2004    /// The value of [destination][crate::model::TransferOperationMetadata::destination]
2005    /// if it holds a `DestinationGcsBucket`, `None` if the field is not set or
2006    /// holds a different branch.
2007    pub fn destination_gcs_bucket(
2008        &self,
2009    ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationGcsBucket>> {
2010        #[allow(unreachable_patterns)]
2011        self.destination.as_ref().and_then(|v| match v {
2012            crate::model::transfer_operation_metadata::Destination::DestinationGcsBucket(v) => {
2013                std::option::Option::Some(v)
2014            }
2015            _ => std::option::Option::None,
2016        })
2017    }
2018
2019    /// Sets the value of [destination][crate::model::TransferOperationMetadata::destination]
2020    /// to hold a `DestinationGcsBucket`.
2021    ///
2022    /// Note that all the setters affecting `destination` are
2023    /// mutually exclusive.
2024    pub fn set_destination_gcs_bucket<
2025        T: std::convert::Into<std::boxed::Box<crate::model::DestinationGcsBucket>>,
2026    >(
2027        mut self,
2028        v: T,
2029    ) -> Self {
2030        self.destination = std::option::Option::Some(
2031            crate::model::transfer_operation_metadata::Destination::DestinationGcsBucket(v.into()),
2032        );
2033        self
2034    }
2035
2036    /// The value of [destination][crate::model::TransferOperationMetadata::destination]
2037    /// if it holds a `DestinationParallelstore`, `None` if the field is not set or
2038    /// holds a different branch.
2039    pub fn destination_parallelstore(
2040        &self,
2041    ) -> std::option::Option<&std::boxed::Box<crate::model::DestinationParallelstore>> {
2042        #[allow(unreachable_patterns)]
2043        self.destination.as_ref().and_then(|v| match v {
2044            crate::model::transfer_operation_metadata::Destination::DestinationParallelstore(v) => {
2045                std::option::Option::Some(v)
2046            }
2047            _ => std::option::Option::None,
2048        })
2049    }
2050
2051    /// Sets the value of [destination][crate::model::TransferOperationMetadata::destination]
2052    /// to hold a `DestinationParallelstore`.
2053    ///
2054    /// Note that all the setters affecting `destination` are
2055    /// mutually exclusive.
2056    pub fn set_destination_parallelstore<
2057        T: std::convert::Into<std::boxed::Box<crate::model::DestinationParallelstore>>,
2058    >(
2059        mut self,
2060        v: T,
2061    ) -> Self {
2062        self.destination = std::option::Option::Some(
2063            crate::model::transfer_operation_metadata::Destination::DestinationParallelstore(
2064                v.into(),
2065            ),
2066        );
2067        self
2068    }
2069}
2070
2071impl wkt::message::Message for TransferOperationMetadata {
2072    fn typename() -> &'static str {
2073        "type.googleapis.com/google.cloud.parallelstore.v1.TransferOperationMetadata"
2074    }
2075}
2076
2077/// Defines additional types related to [TransferOperationMetadata].
2078pub mod transfer_operation_metadata {
2079    #[allow(unused_imports)]
2080    use super::*;
2081
2082    /// The source of transfer operation.
2083    #[derive(Clone, Debug, PartialEq)]
2084    #[non_exhaustive]
2085    pub enum Source {
2086        /// Output only. Parallelstore source.
2087        SourceParallelstore(std::boxed::Box<crate::model::SourceParallelstore>),
2088        /// Output only. Cloud Storage source.
2089        SourceGcsBucket(std::boxed::Box<crate::model::SourceGcsBucket>),
2090    }
2091
2092    /// The destination of transfer operation.
2093    #[derive(Clone, Debug, PartialEq)]
2094    #[non_exhaustive]
2095    pub enum Destination {
2096        /// Output only. Cloud Storage destination.
2097        DestinationGcsBucket(std::boxed::Box<crate::model::DestinationGcsBucket>),
2098        /// Output only. Parallelstore destination.
2099        DestinationParallelstore(std::boxed::Box<crate::model::DestinationParallelstore>),
2100    }
2101}
2102
2103/// A collection of counters that report the progress of a transfer operation.
2104#[derive(Clone, Default, PartialEq)]
2105#[non_exhaustive]
2106pub struct TransferCounters {
2107    /// Objects found in the data source that are scheduled to be transferred,
2108    /// excluding any that are filtered based on object conditions or skipped due
2109    /// to sync.
2110    pub objects_found: i64,
2111
2112    /// Bytes found in the data source that are scheduled to be transferred,
2113    /// excluding any that are filtered based on object conditions or skipped due
2114    /// to sync.
2115    pub bytes_found: i64,
2116
2117    /// Objects in the data source that are not transferred because they already
2118    /// exist in the data destination.
2119    pub objects_skipped: i64,
2120
2121    /// Bytes in the data source that are not transferred because they already
2122    /// exist in the data destination.
2123    pub bytes_skipped: i64,
2124
2125    /// Objects that are copied to the data destination.
2126    pub objects_copied: i64,
2127
2128    /// Bytes that are copied to the data destination.
2129    pub bytes_copied: i64,
2130
2131    /// Objects that are failed to write to the data destination.
2132    pub objects_failed: i64,
2133
2134    /// Bytes that are failed to write to the data destination.
2135    pub bytes_failed: i64,
2136
2137    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2138}
2139
2140impl TransferCounters {
2141    pub fn new() -> Self {
2142        std::default::Default::default()
2143    }
2144
2145    /// Sets the value of [objects_found][crate::model::TransferCounters::objects_found].
2146    pub fn set_objects_found<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2147        self.objects_found = v.into();
2148        self
2149    }
2150
2151    /// Sets the value of [bytes_found][crate::model::TransferCounters::bytes_found].
2152    pub fn set_bytes_found<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2153        self.bytes_found = v.into();
2154        self
2155    }
2156
2157    /// Sets the value of [objects_skipped][crate::model::TransferCounters::objects_skipped].
2158    pub fn set_objects_skipped<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2159        self.objects_skipped = v.into();
2160        self
2161    }
2162
2163    /// Sets the value of [bytes_skipped][crate::model::TransferCounters::bytes_skipped].
2164    pub fn set_bytes_skipped<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2165        self.bytes_skipped = v.into();
2166        self
2167    }
2168
2169    /// Sets the value of [objects_copied][crate::model::TransferCounters::objects_copied].
2170    pub fn set_objects_copied<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2171        self.objects_copied = v.into();
2172        self
2173    }
2174
2175    /// Sets the value of [bytes_copied][crate::model::TransferCounters::bytes_copied].
2176    pub fn set_bytes_copied<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2177        self.bytes_copied = v.into();
2178        self
2179    }
2180
2181    /// Sets the value of [objects_failed][crate::model::TransferCounters::objects_failed].
2182    pub fn set_objects_failed<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2183        self.objects_failed = v.into();
2184        self
2185    }
2186
2187    /// Sets the value of [bytes_failed][crate::model::TransferCounters::bytes_failed].
2188    pub fn set_bytes_failed<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2189        self.bytes_failed = v.into();
2190        self
2191    }
2192}
2193
2194impl wkt::message::Message for TransferCounters {
2195    fn typename() -> &'static str {
2196        "type.googleapis.com/google.cloud.parallelstore.v1.TransferCounters"
2197    }
2198}
2199
2200/// Type of transfer that occurred.
2201///
2202/// # Working with unknown values
2203///
2204/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2205/// additional enum variants at any time. Adding new variants is not considered
2206/// a breaking change. Applications should write their code in anticipation of:
2207///
2208/// - New values appearing in future releases of the client library, **and**
2209/// - New values received dynamically, without application changes.
2210///
2211/// Please consult the [Working with enums] section in the user guide for some
2212/// guidelines.
2213///
2214/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2215#[derive(Clone, Debug, PartialEq)]
2216#[non_exhaustive]
2217pub enum TransferType {
2218    /// Zero is an illegal value.
2219    Unspecified,
2220    /// Imports to Parallelstore.
2221    Import,
2222    /// Exports from Parallelstore.
2223    Export,
2224    /// If set, the enum was initialized with an unknown value.
2225    ///
2226    /// Applications can examine the value using [TransferType::value] or
2227    /// [TransferType::name].
2228    UnknownValue(transfer_type::UnknownValue),
2229}
2230
2231#[doc(hidden)]
2232pub mod transfer_type {
2233    #[allow(unused_imports)]
2234    use super::*;
2235    #[derive(Clone, Debug, PartialEq)]
2236    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2237}
2238
2239impl TransferType {
2240    /// Gets the enum value.
2241    ///
2242    /// Returns `None` if the enum contains an unknown value deserialized from
2243    /// the string representation of enums.
2244    pub fn value(&self) -> std::option::Option<i32> {
2245        match self {
2246            Self::Unspecified => std::option::Option::Some(0),
2247            Self::Import => std::option::Option::Some(1),
2248            Self::Export => std::option::Option::Some(2),
2249            Self::UnknownValue(u) => u.0.value(),
2250        }
2251    }
2252
2253    /// Gets the enum value as a string.
2254    ///
2255    /// Returns `None` if the enum contains an unknown value deserialized from
2256    /// the integer representation of enums.
2257    pub fn name(&self) -> std::option::Option<&str> {
2258        match self {
2259            Self::Unspecified => std::option::Option::Some("TRANSFER_TYPE_UNSPECIFIED"),
2260            Self::Import => std::option::Option::Some("IMPORT"),
2261            Self::Export => std::option::Option::Some("EXPORT"),
2262            Self::UnknownValue(u) => u.0.name(),
2263        }
2264    }
2265}
2266
2267impl std::default::Default for TransferType {
2268    fn default() -> Self {
2269        use std::convert::From;
2270        Self::from(0)
2271    }
2272}
2273
2274impl std::fmt::Display for TransferType {
2275    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2276        wkt::internal::display_enum(f, self.name(), self.value())
2277    }
2278}
2279
2280impl std::convert::From<i32> for TransferType {
2281    fn from(value: i32) -> Self {
2282        match value {
2283            0 => Self::Unspecified,
2284            1 => Self::Import,
2285            2 => Self::Export,
2286            _ => Self::UnknownValue(transfer_type::UnknownValue(
2287                wkt::internal::UnknownEnumValue::Integer(value),
2288            )),
2289        }
2290    }
2291}
2292
2293impl std::convert::From<&str> for TransferType {
2294    fn from(value: &str) -> Self {
2295        use std::string::ToString;
2296        match value {
2297            "TRANSFER_TYPE_UNSPECIFIED" => Self::Unspecified,
2298            "IMPORT" => Self::Import,
2299            "EXPORT" => Self::Export,
2300            _ => Self::UnknownValue(transfer_type::UnknownValue(
2301                wkt::internal::UnknownEnumValue::String(value.to_string()),
2302            )),
2303        }
2304    }
2305}
2306
2307impl serde::ser::Serialize for TransferType {
2308    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2309    where
2310        S: serde::Serializer,
2311    {
2312        match self {
2313            Self::Unspecified => serializer.serialize_i32(0),
2314            Self::Import => serializer.serialize_i32(1),
2315            Self::Export => serializer.serialize_i32(2),
2316            Self::UnknownValue(u) => u.0.serialize(serializer),
2317        }
2318    }
2319}
2320
2321impl<'de> serde::de::Deserialize<'de> for TransferType {
2322    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2323    where
2324        D: serde::Deserializer<'de>,
2325    {
2326        deserializer.deserialize_any(wkt::internal::EnumVisitor::<TransferType>::new(
2327            ".google.cloud.parallelstore.v1.TransferType",
2328        ))
2329    }
2330}
2331
2332/// Represents the striping options for files.
2333///
2334/// # Working with unknown values
2335///
2336/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2337/// additional enum variants at any time. Adding new variants is not considered
2338/// a breaking change. Applications should write their code in anticipation of:
2339///
2340/// - New values appearing in future releases of the client library, **and**
2341/// - New values received dynamically, without application changes.
2342///
2343/// Please consult the [Working with enums] section in the user guide for some
2344/// guidelines.
2345///
2346/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2347#[derive(Clone, Debug, PartialEq)]
2348#[non_exhaustive]
2349pub enum FileStripeLevel {
2350    /// If not set, FileStripeLevel will default to FILE_STRIPE_LEVEL_BALANCED
2351    Unspecified,
2352    /// Minimum file striping
2353    Min,
2354    /// Medium file striping
2355    Balanced,
2356    /// Maximum file striping
2357    Max,
2358    /// If set, the enum was initialized with an unknown value.
2359    ///
2360    /// Applications can examine the value using [FileStripeLevel::value] or
2361    /// [FileStripeLevel::name].
2362    UnknownValue(file_stripe_level::UnknownValue),
2363}
2364
2365#[doc(hidden)]
2366pub mod file_stripe_level {
2367    #[allow(unused_imports)]
2368    use super::*;
2369    #[derive(Clone, Debug, PartialEq)]
2370    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2371}
2372
2373impl FileStripeLevel {
2374    /// Gets the enum value.
2375    ///
2376    /// Returns `None` if the enum contains an unknown value deserialized from
2377    /// the string representation of enums.
2378    pub fn value(&self) -> std::option::Option<i32> {
2379        match self {
2380            Self::Unspecified => std::option::Option::Some(0),
2381            Self::Min => std::option::Option::Some(1),
2382            Self::Balanced => std::option::Option::Some(2),
2383            Self::Max => std::option::Option::Some(3),
2384            Self::UnknownValue(u) => u.0.value(),
2385        }
2386    }
2387
2388    /// Gets the enum value as a string.
2389    ///
2390    /// Returns `None` if the enum contains an unknown value deserialized from
2391    /// the integer representation of enums.
2392    pub fn name(&self) -> std::option::Option<&str> {
2393        match self {
2394            Self::Unspecified => std::option::Option::Some("FILE_STRIPE_LEVEL_UNSPECIFIED"),
2395            Self::Min => std::option::Option::Some("FILE_STRIPE_LEVEL_MIN"),
2396            Self::Balanced => std::option::Option::Some("FILE_STRIPE_LEVEL_BALANCED"),
2397            Self::Max => std::option::Option::Some("FILE_STRIPE_LEVEL_MAX"),
2398            Self::UnknownValue(u) => u.0.name(),
2399        }
2400    }
2401}
2402
2403impl std::default::Default for FileStripeLevel {
2404    fn default() -> Self {
2405        use std::convert::From;
2406        Self::from(0)
2407    }
2408}
2409
2410impl std::fmt::Display for FileStripeLevel {
2411    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2412        wkt::internal::display_enum(f, self.name(), self.value())
2413    }
2414}
2415
2416impl std::convert::From<i32> for FileStripeLevel {
2417    fn from(value: i32) -> Self {
2418        match value {
2419            0 => Self::Unspecified,
2420            1 => Self::Min,
2421            2 => Self::Balanced,
2422            3 => Self::Max,
2423            _ => Self::UnknownValue(file_stripe_level::UnknownValue(
2424                wkt::internal::UnknownEnumValue::Integer(value),
2425            )),
2426        }
2427    }
2428}
2429
2430impl std::convert::From<&str> for FileStripeLevel {
2431    fn from(value: &str) -> Self {
2432        use std::string::ToString;
2433        match value {
2434            "FILE_STRIPE_LEVEL_UNSPECIFIED" => Self::Unspecified,
2435            "FILE_STRIPE_LEVEL_MIN" => Self::Min,
2436            "FILE_STRIPE_LEVEL_BALANCED" => Self::Balanced,
2437            "FILE_STRIPE_LEVEL_MAX" => Self::Max,
2438            _ => Self::UnknownValue(file_stripe_level::UnknownValue(
2439                wkt::internal::UnknownEnumValue::String(value.to_string()),
2440            )),
2441        }
2442    }
2443}
2444
2445impl serde::ser::Serialize for FileStripeLevel {
2446    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2447    where
2448        S: serde::Serializer,
2449    {
2450        match self {
2451            Self::Unspecified => serializer.serialize_i32(0),
2452            Self::Min => serializer.serialize_i32(1),
2453            Self::Balanced => serializer.serialize_i32(2),
2454            Self::Max => serializer.serialize_i32(3),
2455            Self::UnknownValue(u) => u.0.serialize(serializer),
2456        }
2457    }
2458}
2459
2460impl<'de> serde::de::Deserialize<'de> for FileStripeLevel {
2461    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2462    where
2463        D: serde::Deserializer<'de>,
2464    {
2465        deserializer.deserialize_any(wkt::internal::EnumVisitor::<FileStripeLevel>::new(
2466            ".google.cloud.parallelstore.v1.FileStripeLevel",
2467        ))
2468    }
2469}
2470
2471/// Represents the striping options for directories.
2472///
2473/// # Working with unknown values
2474///
2475/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2476/// additional enum variants at any time. Adding new variants is not considered
2477/// a breaking change. Applications should write their code in anticipation of:
2478///
2479/// - New values appearing in future releases of the client library, **and**
2480/// - New values received dynamically, without application changes.
2481///
2482/// Please consult the [Working with enums] section in the user guide for some
2483/// guidelines.
2484///
2485/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2486#[derive(Clone, Debug, PartialEq)]
2487#[non_exhaustive]
2488pub enum DirectoryStripeLevel {
2489    /// If not set, DirectoryStripeLevel will default to DIRECTORY_STRIPE_LEVEL_MAX
2490    Unspecified,
2491    /// Minimum directory striping
2492    Min,
2493    /// Medium directory striping
2494    Balanced,
2495    /// Maximum directory striping
2496    Max,
2497    /// If set, the enum was initialized with an unknown value.
2498    ///
2499    /// Applications can examine the value using [DirectoryStripeLevel::value] or
2500    /// [DirectoryStripeLevel::name].
2501    UnknownValue(directory_stripe_level::UnknownValue),
2502}
2503
2504#[doc(hidden)]
2505pub mod directory_stripe_level {
2506    #[allow(unused_imports)]
2507    use super::*;
2508    #[derive(Clone, Debug, PartialEq)]
2509    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2510}
2511
2512impl DirectoryStripeLevel {
2513    /// Gets the enum value.
2514    ///
2515    /// Returns `None` if the enum contains an unknown value deserialized from
2516    /// the string representation of enums.
2517    pub fn value(&self) -> std::option::Option<i32> {
2518        match self {
2519            Self::Unspecified => std::option::Option::Some(0),
2520            Self::Min => std::option::Option::Some(1),
2521            Self::Balanced => std::option::Option::Some(2),
2522            Self::Max => std::option::Option::Some(3),
2523            Self::UnknownValue(u) => u.0.value(),
2524        }
2525    }
2526
2527    /// Gets the enum value as a string.
2528    ///
2529    /// Returns `None` if the enum contains an unknown value deserialized from
2530    /// the integer representation of enums.
2531    pub fn name(&self) -> std::option::Option<&str> {
2532        match self {
2533            Self::Unspecified => std::option::Option::Some("DIRECTORY_STRIPE_LEVEL_UNSPECIFIED"),
2534            Self::Min => std::option::Option::Some("DIRECTORY_STRIPE_LEVEL_MIN"),
2535            Self::Balanced => std::option::Option::Some("DIRECTORY_STRIPE_LEVEL_BALANCED"),
2536            Self::Max => std::option::Option::Some("DIRECTORY_STRIPE_LEVEL_MAX"),
2537            Self::UnknownValue(u) => u.0.name(),
2538        }
2539    }
2540}
2541
2542impl std::default::Default for DirectoryStripeLevel {
2543    fn default() -> Self {
2544        use std::convert::From;
2545        Self::from(0)
2546    }
2547}
2548
2549impl std::fmt::Display for DirectoryStripeLevel {
2550    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2551        wkt::internal::display_enum(f, self.name(), self.value())
2552    }
2553}
2554
2555impl std::convert::From<i32> for DirectoryStripeLevel {
2556    fn from(value: i32) -> Self {
2557        match value {
2558            0 => Self::Unspecified,
2559            1 => Self::Min,
2560            2 => Self::Balanced,
2561            3 => Self::Max,
2562            _ => Self::UnknownValue(directory_stripe_level::UnknownValue(
2563                wkt::internal::UnknownEnumValue::Integer(value),
2564            )),
2565        }
2566    }
2567}
2568
2569impl std::convert::From<&str> for DirectoryStripeLevel {
2570    fn from(value: &str) -> Self {
2571        use std::string::ToString;
2572        match value {
2573            "DIRECTORY_STRIPE_LEVEL_UNSPECIFIED" => Self::Unspecified,
2574            "DIRECTORY_STRIPE_LEVEL_MIN" => Self::Min,
2575            "DIRECTORY_STRIPE_LEVEL_BALANCED" => Self::Balanced,
2576            "DIRECTORY_STRIPE_LEVEL_MAX" => Self::Max,
2577            _ => Self::UnknownValue(directory_stripe_level::UnknownValue(
2578                wkt::internal::UnknownEnumValue::String(value.to_string()),
2579            )),
2580        }
2581    }
2582}
2583
2584impl serde::ser::Serialize for DirectoryStripeLevel {
2585    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2586    where
2587        S: serde::Serializer,
2588    {
2589        match self {
2590            Self::Unspecified => serializer.serialize_i32(0),
2591            Self::Min => serializer.serialize_i32(1),
2592            Self::Balanced => serializer.serialize_i32(2),
2593            Self::Max => serializer.serialize_i32(3),
2594            Self::UnknownValue(u) => u.0.serialize(serializer),
2595        }
2596    }
2597}
2598
2599impl<'de> serde::de::Deserialize<'de> for DirectoryStripeLevel {
2600    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2601    where
2602        D: serde::Deserializer<'de>,
2603    {
2604        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DirectoryStripeLevel>::new(
2605            ".google.cloud.parallelstore.v1.DirectoryStripeLevel",
2606        ))
2607    }
2608}
2609
2610/// Represents the deployment type for the instance.
2611///
2612/// # Working with unknown values
2613///
2614/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2615/// additional enum variants at any time. Adding new variants is not considered
2616/// a breaking change. Applications should write their code in anticipation of:
2617///
2618/// - New values appearing in future releases of the client library, **and**
2619/// - New values received dynamically, without application changes.
2620///
2621/// Please consult the [Working with enums] section in the user guide for some
2622/// guidelines.
2623///
2624/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2625#[derive(Clone, Debug, PartialEq)]
2626#[non_exhaustive]
2627pub enum DeploymentType {
2628    /// Default Deployment Type
2629    /// It is equivalent to SCRATCH
2630    Unspecified,
2631    /// Scratch
2632    Scratch,
2633    /// Persistent
2634    Persistent,
2635    /// If set, the enum was initialized with an unknown value.
2636    ///
2637    /// Applications can examine the value using [DeploymentType::value] or
2638    /// [DeploymentType::name].
2639    UnknownValue(deployment_type::UnknownValue),
2640}
2641
2642#[doc(hidden)]
2643pub mod deployment_type {
2644    #[allow(unused_imports)]
2645    use super::*;
2646    #[derive(Clone, Debug, PartialEq)]
2647    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2648}
2649
2650impl DeploymentType {
2651    /// Gets the enum value.
2652    ///
2653    /// Returns `None` if the enum contains an unknown value deserialized from
2654    /// the string representation of enums.
2655    pub fn value(&self) -> std::option::Option<i32> {
2656        match self {
2657            Self::Unspecified => std::option::Option::Some(0),
2658            Self::Scratch => std::option::Option::Some(1),
2659            Self::Persistent => std::option::Option::Some(2),
2660            Self::UnknownValue(u) => u.0.value(),
2661        }
2662    }
2663
2664    /// Gets the enum value as a string.
2665    ///
2666    /// Returns `None` if the enum contains an unknown value deserialized from
2667    /// the integer representation of enums.
2668    pub fn name(&self) -> std::option::Option<&str> {
2669        match self {
2670            Self::Unspecified => std::option::Option::Some("DEPLOYMENT_TYPE_UNSPECIFIED"),
2671            Self::Scratch => std::option::Option::Some("SCRATCH"),
2672            Self::Persistent => std::option::Option::Some("PERSISTENT"),
2673            Self::UnknownValue(u) => u.0.name(),
2674        }
2675    }
2676}
2677
2678impl std::default::Default for DeploymentType {
2679    fn default() -> Self {
2680        use std::convert::From;
2681        Self::from(0)
2682    }
2683}
2684
2685impl std::fmt::Display for DeploymentType {
2686    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2687        wkt::internal::display_enum(f, self.name(), self.value())
2688    }
2689}
2690
2691impl std::convert::From<i32> for DeploymentType {
2692    fn from(value: i32) -> Self {
2693        match value {
2694            0 => Self::Unspecified,
2695            1 => Self::Scratch,
2696            2 => Self::Persistent,
2697            _ => Self::UnknownValue(deployment_type::UnknownValue(
2698                wkt::internal::UnknownEnumValue::Integer(value),
2699            )),
2700        }
2701    }
2702}
2703
2704impl std::convert::From<&str> for DeploymentType {
2705    fn from(value: &str) -> Self {
2706        use std::string::ToString;
2707        match value {
2708            "DEPLOYMENT_TYPE_UNSPECIFIED" => Self::Unspecified,
2709            "SCRATCH" => Self::Scratch,
2710            "PERSISTENT" => Self::Persistent,
2711            _ => Self::UnknownValue(deployment_type::UnknownValue(
2712                wkt::internal::UnknownEnumValue::String(value.to_string()),
2713            )),
2714        }
2715    }
2716}
2717
2718impl serde::ser::Serialize for DeploymentType {
2719    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2720    where
2721        S: serde::Serializer,
2722    {
2723        match self {
2724            Self::Unspecified => serializer.serialize_i32(0),
2725            Self::Scratch => serializer.serialize_i32(1),
2726            Self::Persistent => serializer.serialize_i32(2),
2727            Self::UnknownValue(u) => u.0.serialize(serializer),
2728        }
2729    }
2730}
2731
2732impl<'de> serde::de::Deserialize<'de> for DeploymentType {
2733    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2734    where
2735        D: serde::Deserializer<'de>,
2736    {
2737        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeploymentType>::new(
2738            ".google.cloud.parallelstore.v1.DeploymentType",
2739        ))
2740    }
2741}