Skip to main content

google_cloud_filestore_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_common;
24extern crate google_cloud_gax;
25extern crate google_cloud_location;
26extern crate google_cloud_longrunning;
27extern crate google_cloud_lro;
28extern crate serde;
29extern crate serde_json;
30extern crate serde_with;
31extern crate std;
32extern crate tracing;
33extern crate wkt;
34
35mod debug;
36mod deserialize;
37mod serialize;
38
39/// Network configuration for the instance.
40#[derive(Clone, Default, PartialEq)]
41#[non_exhaustive]
42pub struct NetworkConfig {
43    /// The name of the Google Compute Engine
44    /// [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the
45    /// instance is connected.
46    pub network: std::string::String,
47
48    /// Internet protocol versions for which the instance has IP addresses
49    /// assigned. For this version, only MODE_IPV4 is supported.
50    pub modes: std::vec::Vec<crate::model::network_config::AddressMode>,
51
52    /// Optional, reserved_ip_range can have one of the following two types of
53    /// values.
54    ///
55    /// * CIDR range value when using DIRECT_PEERING connect mode.
56    /// * [Allocated IP address
57    ///   range](https://cloud.google.com/compute/docs/ip-addresses/reserve-static-internal-ip-address)
58    ///   when using PRIVATE_SERVICE_ACCESS connect mode.
59    ///
60    /// When the name of an allocated IP address range is specified, it must be one
61    /// of the ranges associated with the private service access connection.
62    /// When specified as a direct CIDR value, it must be a /29 CIDR block for
63    /// Basic tier, a /24 CIDR block for High Scale tier, or a /26 CIDR block for
64    /// Enterprise tier in one of the [internal IP address
65    /// ranges](https://www.arin.net/reference/research/statistics/address_filters/)
66    /// that identifies the range of IP addresses reserved for this instance. For
67    /// example, 10.0.0.0/29, 192.168.0.0/24 or 192.168.0.0/26, respectively. The
68    /// range you specify can't overlap with either existing subnets or assigned IP
69    /// address ranges for other Filestore instances in the selected VPC
70    /// network.
71    pub reserved_ip_range: std::string::String,
72
73    /// Output only. IPv4 addresses in the format
74    /// `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format
75    /// `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`.
76    pub ip_addresses: std::vec::Vec<std::string::String>,
77
78    /// The network connect mode of the Filestore instance.
79    /// If not provided, the connect mode defaults to DIRECT_PEERING.
80    pub connect_mode: crate::model::network_config::ConnectMode,
81
82    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
83}
84
85impl NetworkConfig {
86    /// Creates a new default instance.
87    pub fn new() -> Self {
88        std::default::Default::default()
89    }
90
91    /// Sets the value of [network][crate::model::NetworkConfig::network].
92    ///
93    /// # Example
94    /// ```ignore,no_run
95    /// # use google_cloud_filestore_v1::model::NetworkConfig;
96    /// let x = NetworkConfig::new().set_network("example");
97    /// ```
98    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
99        self.network = v.into();
100        self
101    }
102
103    /// Sets the value of [modes][crate::model::NetworkConfig::modes].
104    ///
105    /// # Example
106    /// ```ignore,no_run
107    /// # use google_cloud_filestore_v1::model::NetworkConfig;
108    /// use google_cloud_filestore_v1::model::network_config::AddressMode;
109    /// let x = NetworkConfig::new().set_modes([
110    ///     AddressMode::ModeIpv4,
111    /// ]);
112    /// ```
113    pub fn set_modes<T, V>(mut self, v: T) -> Self
114    where
115        T: std::iter::IntoIterator<Item = V>,
116        V: std::convert::Into<crate::model::network_config::AddressMode>,
117    {
118        use std::iter::Iterator;
119        self.modes = v.into_iter().map(|i| i.into()).collect();
120        self
121    }
122
123    /// Sets the value of [reserved_ip_range][crate::model::NetworkConfig::reserved_ip_range].
124    ///
125    /// # Example
126    /// ```ignore,no_run
127    /// # use google_cloud_filestore_v1::model::NetworkConfig;
128    /// let x = NetworkConfig::new().set_reserved_ip_range("example");
129    /// ```
130    pub fn set_reserved_ip_range<T: std::convert::Into<std::string::String>>(
131        mut self,
132        v: T,
133    ) -> Self {
134        self.reserved_ip_range = v.into();
135        self
136    }
137
138    /// Sets the value of [ip_addresses][crate::model::NetworkConfig::ip_addresses].
139    ///
140    /// # Example
141    /// ```ignore,no_run
142    /// # use google_cloud_filestore_v1::model::NetworkConfig;
143    /// let x = NetworkConfig::new().set_ip_addresses(["a", "b", "c"]);
144    /// ```
145    pub fn set_ip_addresses<T, V>(mut self, v: T) -> Self
146    where
147        T: std::iter::IntoIterator<Item = V>,
148        V: std::convert::Into<std::string::String>,
149    {
150        use std::iter::Iterator;
151        self.ip_addresses = v.into_iter().map(|i| i.into()).collect();
152        self
153    }
154
155    /// Sets the value of [connect_mode][crate::model::NetworkConfig::connect_mode].
156    ///
157    /// # Example
158    /// ```ignore,no_run
159    /// # use google_cloud_filestore_v1::model::NetworkConfig;
160    /// use google_cloud_filestore_v1::model::network_config::ConnectMode;
161    /// let x0 = NetworkConfig::new().set_connect_mode(ConnectMode::DirectPeering);
162    /// let x1 = NetworkConfig::new().set_connect_mode(ConnectMode::PrivateServiceAccess);
163    /// ```
164    pub fn set_connect_mode<T: std::convert::Into<crate::model::network_config::ConnectMode>>(
165        mut self,
166        v: T,
167    ) -> Self {
168        self.connect_mode = v.into();
169        self
170    }
171}
172
173impl wkt::message::Message for NetworkConfig {
174    fn typename() -> &'static str {
175        "type.googleapis.com/google.cloud.filestore.v1.NetworkConfig"
176    }
177}
178
179/// Defines additional types related to [NetworkConfig].
180pub mod network_config {
181    #[allow(unused_imports)]
182    use super::*;
183
184    /// Internet protocol versions supported by Filestore.
185    ///
186    /// # Working with unknown values
187    ///
188    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
189    /// additional enum variants at any time. Adding new variants is not considered
190    /// a breaking change. Applications should write their code in anticipation of:
191    ///
192    /// - New values appearing in future releases of the client library, **and**
193    /// - New values received dynamically, without application changes.
194    ///
195    /// Please consult the [Working with enums] section in the user guide for some
196    /// guidelines.
197    ///
198    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
199    #[derive(Clone, Debug, PartialEq)]
200    #[non_exhaustive]
201    pub enum AddressMode {
202        /// Internet protocol not set.
203        Unspecified,
204        /// Use the IPv4 internet protocol.
205        ModeIpv4,
206        /// If set, the enum was initialized with an unknown value.
207        ///
208        /// Applications can examine the value using [AddressMode::value] or
209        /// [AddressMode::name].
210        UnknownValue(address_mode::UnknownValue),
211    }
212
213    #[doc(hidden)]
214    pub mod address_mode {
215        #[allow(unused_imports)]
216        use super::*;
217        #[derive(Clone, Debug, PartialEq)]
218        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
219    }
220
221    impl AddressMode {
222        /// Gets the enum value.
223        ///
224        /// Returns `None` if the enum contains an unknown value deserialized from
225        /// the string representation of enums.
226        pub fn value(&self) -> std::option::Option<i32> {
227            match self {
228                Self::Unspecified => std::option::Option::Some(0),
229                Self::ModeIpv4 => std::option::Option::Some(1),
230                Self::UnknownValue(u) => u.0.value(),
231            }
232        }
233
234        /// Gets the enum value as a string.
235        ///
236        /// Returns `None` if the enum contains an unknown value deserialized from
237        /// the integer representation of enums.
238        pub fn name(&self) -> std::option::Option<&str> {
239            match self {
240                Self::Unspecified => std::option::Option::Some("ADDRESS_MODE_UNSPECIFIED"),
241                Self::ModeIpv4 => std::option::Option::Some("MODE_IPV4"),
242                Self::UnknownValue(u) => u.0.name(),
243            }
244        }
245    }
246
247    impl std::default::Default for AddressMode {
248        fn default() -> Self {
249            use std::convert::From;
250            Self::from(0)
251        }
252    }
253
254    impl std::fmt::Display for AddressMode {
255        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
256            wkt::internal::display_enum(f, self.name(), self.value())
257        }
258    }
259
260    impl std::convert::From<i32> for AddressMode {
261        fn from(value: i32) -> Self {
262            match value {
263                0 => Self::Unspecified,
264                1 => Self::ModeIpv4,
265                _ => Self::UnknownValue(address_mode::UnknownValue(
266                    wkt::internal::UnknownEnumValue::Integer(value),
267                )),
268            }
269        }
270    }
271
272    impl std::convert::From<&str> for AddressMode {
273        fn from(value: &str) -> Self {
274            use std::string::ToString;
275            match value {
276                "ADDRESS_MODE_UNSPECIFIED" => Self::Unspecified,
277                "MODE_IPV4" => Self::ModeIpv4,
278                _ => Self::UnknownValue(address_mode::UnknownValue(
279                    wkt::internal::UnknownEnumValue::String(value.to_string()),
280                )),
281            }
282        }
283    }
284
285    impl serde::ser::Serialize for AddressMode {
286        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
287        where
288            S: serde::Serializer,
289        {
290            match self {
291                Self::Unspecified => serializer.serialize_i32(0),
292                Self::ModeIpv4 => serializer.serialize_i32(1),
293                Self::UnknownValue(u) => u.0.serialize(serializer),
294            }
295        }
296    }
297
298    impl<'de> serde::de::Deserialize<'de> for AddressMode {
299        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
300        where
301            D: serde::Deserializer<'de>,
302        {
303            deserializer.deserialize_any(wkt::internal::EnumVisitor::<AddressMode>::new(
304                ".google.cloud.filestore.v1.NetworkConfig.AddressMode",
305            ))
306        }
307    }
308
309    /// Available connection modes.
310    ///
311    /// # Working with unknown values
312    ///
313    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
314    /// additional enum variants at any time. Adding new variants is not considered
315    /// a breaking change. Applications should write their code in anticipation of:
316    ///
317    /// - New values appearing in future releases of the client library, **and**
318    /// - New values received dynamically, without application changes.
319    ///
320    /// Please consult the [Working with enums] section in the user guide for some
321    /// guidelines.
322    ///
323    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
324    #[derive(Clone, Debug, PartialEq)]
325    #[non_exhaustive]
326    pub enum ConnectMode {
327        /// Not set.
328        Unspecified,
329        /// Connect via direct peering to the Filestore service.
330        DirectPeering,
331        /// Connect to your Filestore instance using Private Service
332        /// Access. Private services access provides an IP address range for multiple
333        /// Google Cloud services, including Filestore.
334        PrivateServiceAccess,
335        /// If set, the enum was initialized with an unknown value.
336        ///
337        /// Applications can examine the value using [ConnectMode::value] or
338        /// [ConnectMode::name].
339        UnknownValue(connect_mode::UnknownValue),
340    }
341
342    #[doc(hidden)]
343    pub mod connect_mode {
344        #[allow(unused_imports)]
345        use super::*;
346        #[derive(Clone, Debug, PartialEq)]
347        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
348    }
349
350    impl ConnectMode {
351        /// Gets the enum value.
352        ///
353        /// Returns `None` if the enum contains an unknown value deserialized from
354        /// the string representation of enums.
355        pub fn value(&self) -> std::option::Option<i32> {
356            match self {
357                Self::Unspecified => std::option::Option::Some(0),
358                Self::DirectPeering => std::option::Option::Some(1),
359                Self::PrivateServiceAccess => std::option::Option::Some(2),
360                Self::UnknownValue(u) => u.0.value(),
361            }
362        }
363
364        /// Gets the enum value as a string.
365        ///
366        /// Returns `None` if the enum contains an unknown value deserialized from
367        /// the integer representation of enums.
368        pub fn name(&self) -> std::option::Option<&str> {
369            match self {
370                Self::Unspecified => std::option::Option::Some("CONNECT_MODE_UNSPECIFIED"),
371                Self::DirectPeering => std::option::Option::Some("DIRECT_PEERING"),
372                Self::PrivateServiceAccess => std::option::Option::Some("PRIVATE_SERVICE_ACCESS"),
373                Self::UnknownValue(u) => u.0.name(),
374            }
375        }
376    }
377
378    impl std::default::Default for ConnectMode {
379        fn default() -> Self {
380            use std::convert::From;
381            Self::from(0)
382        }
383    }
384
385    impl std::fmt::Display for ConnectMode {
386        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
387            wkt::internal::display_enum(f, self.name(), self.value())
388        }
389    }
390
391    impl std::convert::From<i32> for ConnectMode {
392        fn from(value: i32) -> Self {
393            match value {
394                0 => Self::Unspecified,
395                1 => Self::DirectPeering,
396                2 => Self::PrivateServiceAccess,
397                _ => Self::UnknownValue(connect_mode::UnknownValue(
398                    wkt::internal::UnknownEnumValue::Integer(value),
399                )),
400            }
401        }
402    }
403
404    impl std::convert::From<&str> for ConnectMode {
405        fn from(value: &str) -> Self {
406            use std::string::ToString;
407            match value {
408                "CONNECT_MODE_UNSPECIFIED" => Self::Unspecified,
409                "DIRECT_PEERING" => Self::DirectPeering,
410                "PRIVATE_SERVICE_ACCESS" => Self::PrivateServiceAccess,
411                _ => Self::UnknownValue(connect_mode::UnknownValue(
412                    wkt::internal::UnknownEnumValue::String(value.to_string()),
413                )),
414            }
415        }
416    }
417
418    impl serde::ser::Serialize for ConnectMode {
419        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
420        where
421            S: serde::Serializer,
422        {
423            match self {
424                Self::Unspecified => serializer.serialize_i32(0),
425                Self::DirectPeering => serializer.serialize_i32(1),
426                Self::PrivateServiceAccess => serializer.serialize_i32(2),
427                Self::UnknownValue(u) => u.0.serialize(serializer),
428            }
429        }
430    }
431
432    impl<'de> serde::de::Deserialize<'de> for ConnectMode {
433        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
434        where
435            D: serde::Deserializer<'de>,
436        {
437            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectMode>::new(
438                ".google.cloud.filestore.v1.NetworkConfig.ConnectMode",
439            ))
440        }
441    }
442}
443
444/// File share configuration for the instance.
445#[derive(Clone, Default, PartialEq)]
446#[non_exhaustive]
447pub struct FileShareConfig {
448    /// Required. The name of the file share. Must use 1-16 characters for the
449    /// basic service tier and 1-63 characters for all other service tiers.
450    /// Must use lowercase letters, numbers, or underscores `[a-z0-9_]`. Must
451    /// start with a letter. Immutable.
452    pub name: std::string::String,
453
454    /// File share capacity in gigabytes (GB).
455    /// Filestore defines 1 GB as 1024^3 bytes.
456    pub capacity_gb: i64,
457
458    /// Nfs Export Options.
459    /// There is a limit of 10 export options per file share.
460    pub nfs_export_options: std::vec::Vec<crate::model::NfsExportOptions>,
461
462    /// The source that this file share has been restored from. Empty if the file
463    /// share is created from scratch.
464    pub source: std::option::Option<crate::model::file_share_config::Source>,
465
466    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
467}
468
469impl FileShareConfig {
470    /// Creates a new default instance.
471    pub fn new() -> Self {
472        std::default::Default::default()
473    }
474
475    /// Sets the value of [name][crate::model::FileShareConfig::name].
476    ///
477    /// # Example
478    /// ```ignore,no_run
479    /// # use google_cloud_filestore_v1::model::FileShareConfig;
480    /// let x = FileShareConfig::new().set_name("example");
481    /// ```
482    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
483        self.name = v.into();
484        self
485    }
486
487    /// Sets the value of [capacity_gb][crate::model::FileShareConfig::capacity_gb].
488    ///
489    /// # Example
490    /// ```ignore,no_run
491    /// # use google_cloud_filestore_v1::model::FileShareConfig;
492    /// let x = FileShareConfig::new().set_capacity_gb(42);
493    /// ```
494    pub fn set_capacity_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
495        self.capacity_gb = v.into();
496        self
497    }
498
499    /// Sets the value of [nfs_export_options][crate::model::FileShareConfig::nfs_export_options].
500    ///
501    /// # Example
502    /// ```ignore,no_run
503    /// # use google_cloud_filestore_v1::model::FileShareConfig;
504    /// use google_cloud_filestore_v1::model::NfsExportOptions;
505    /// let x = FileShareConfig::new()
506    ///     .set_nfs_export_options([
507    ///         NfsExportOptions::default()/* use setters */,
508    ///         NfsExportOptions::default()/* use (different) setters */,
509    ///     ]);
510    /// ```
511    pub fn set_nfs_export_options<T, V>(mut self, v: T) -> Self
512    where
513        T: std::iter::IntoIterator<Item = V>,
514        V: std::convert::Into<crate::model::NfsExportOptions>,
515    {
516        use std::iter::Iterator;
517        self.nfs_export_options = v.into_iter().map(|i| i.into()).collect();
518        self
519    }
520
521    /// Sets the value of [source][crate::model::FileShareConfig::source].
522    ///
523    /// Note that all the setters affecting `source` are mutually
524    /// exclusive.
525    ///
526    /// # Example
527    /// ```ignore,no_run
528    /// # use google_cloud_filestore_v1::model::FileShareConfig;
529    /// use google_cloud_filestore_v1::model::file_share_config::Source;
530    /// let x = FileShareConfig::new().set_source(Some(Source::SourceBackup("example".to_string())));
531    /// ```
532    pub fn set_source<
533        T: std::convert::Into<std::option::Option<crate::model::file_share_config::Source>>,
534    >(
535        mut self,
536        v: T,
537    ) -> Self {
538        self.source = v.into();
539        self
540    }
541
542    /// The value of [source][crate::model::FileShareConfig::source]
543    /// if it holds a `SourceBackup`, `None` if the field is not set or
544    /// holds a different branch.
545    pub fn source_backup(&self) -> std::option::Option<&std::string::String> {
546        #[allow(unreachable_patterns)]
547        self.source.as_ref().and_then(|v| match v {
548            crate::model::file_share_config::Source::SourceBackup(v) => {
549                std::option::Option::Some(v)
550            }
551            _ => std::option::Option::None,
552        })
553    }
554
555    /// Sets the value of [source][crate::model::FileShareConfig::source]
556    /// to hold a `SourceBackup`.
557    ///
558    /// Note that all the setters affecting `source` are
559    /// mutually exclusive.
560    ///
561    /// # Example
562    /// ```ignore,no_run
563    /// # use google_cloud_filestore_v1::model::FileShareConfig;
564    /// let x = FileShareConfig::new().set_source_backup("example");
565    /// assert!(x.source_backup().is_some());
566    /// ```
567    pub fn set_source_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
568        self.source = std::option::Option::Some(
569            crate::model::file_share_config::Source::SourceBackup(v.into()),
570        );
571        self
572    }
573}
574
575impl wkt::message::Message for FileShareConfig {
576    fn typename() -> &'static str {
577        "type.googleapis.com/google.cloud.filestore.v1.FileShareConfig"
578    }
579}
580
581/// Defines additional types related to [FileShareConfig].
582pub mod file_share_config {
583    #[allow(unused_imports)]
584    use super::*;
585
586    /// The source that this file share has been restored from. Empty if the file
587    /// share is created from scratch.
588    #[derive(Clone, Debug, PartialEq)]
589    #[non_exhaustive]
590    pub enum Source {
591        /// The resource name of the backup, in the format
592        /// `projects/{project_number}/locations/{location_id}/backups/{backup_id}`,
593        /// that this file share has been restored from.
594        SourceBackup(std::string::String),
595    }
596}
597
598/// NFS export options specifications.
599#[derive(Clone, Default, PartialEq)]
600#[non_exhaustive]
601pub struct NfsExportOptions {
602    /// List of either an IPv4 addresses in the format
603    /// `{octet1}.{octet2}.{octet3}.{octet4}` or CIDR ranges in the format
604    /// `{octet1}.{octet2}.{octet3}.{octet4}/{mask size}` which may mount the
605    /// file share.
606    /// Overlapping IP ranges are not allowed, both within and across
607    /// NfsExportOptions. An error will be returned.
608    /// The limit is 64 IP ranges/addresses for each FileShareConfig among all
609    /// NfsExportOptions.
610    pub ip_ranges: std::vec::Vec<std::string::String>,
611
612    /// Either READ_ONLY, for allowing only read requests on the exported
613    /// directory, or READ_WRITE, for allowing both read and write requests.
614    /// The default is READ_WRITE.
615    pub access_mode: crate::model::nfs_export_options::AccessMode,
616
617    /// Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
618    /// or ROOT_SQUASH, for not allowing root access. The default is
619    /// NO_ROOT_SQUASH.
620    pub squash_mode: crate::model::nfs_export_options::SquashMode,
621
622    /// An integer representing the anonymous user id with a default value of
623    /// 65534.
624    /// Anon_uid may only be set with squash_mode of ROOT_SQUASH.  An error will be
625    /// returned if this field is specified for other squash_mode settings.
626    pub anon_uid: i64,
627
628    /// An integer representing the anonymous group id with a default value of
629    /// 65534.
630    /// Anon_gid may only be set with squash_mode of ROOT_SQUASH.  An error will be
631    /// returned if this field is specified for other squash_mode settings.
632    pub anon_gid: i64,
633
634    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
635}
636
637impl NfsExportOptions {
638    /// Creates a new default instance.
639    pub fn new() -> Self {
640        std::default::Default::default()
641    }
642
643    /// Sets the value of [ip_ranges][crate::model::NfsExportOptions::ip_ranges].
644    ///
645    /// # Example
646    /// ```ignore,no_run
647    /// # use google_cloud_filestore_v1::model::NfsExportOptions;
648    /// let x = NfsExportOptions::new().set_ip_ranges(["a", "b", "c"]);
649    /// ```
650    pub fn set_ip_ranges<T, V>(mut self, v: T) -> Self
651    where
652        T: std::iter::IntoIterator<Item = V>,
653        V: std::convert::Into<std::string::String>,
654    {
655        use std::iter::Iterator;
656        self.ip_ranges = v.into_iter().map(|i| i.into()).collect();
657        self
658    }
659
660    /// Sets the value of [access_mode][crate::model::NfsExportOptions::access_mode].
661    ///
662    /// # Example
663    /// ```ignore,no_run
664    /// # use google_cloud_filestore_v1::model::NfsExportOptions;
665    /// use google_cloud_filestore_v1::model::nfs_export_options::AccessMode;
666    /// let x0 = NfsExportOptions::new().set_access_mode(AccessMode::ReadOnly);
667    /// let x1 = NfsExportOptions::new().set_access_mode(AccessMode::ReadWrite);
668    /// ```
669    pub fn set_access_mode<T: std::convert::Into<crate::model::nfs_export_options::AccessMode>>(
670        mut self,
671        v: T,
672    ) -> Self {
673        self.access_mode = v.into();
674        self
675    }
676
677    /// Sets the value of [squash_mode][crate::model::NfsExportOptions::squash_mode].
678    ///
679    /// # Example
680    /// ```ignore,no_run
681    /// # use google_cloud_filestore_v1::model::NfsExportOptions;
682    /// use google_cloud_filestore_v1::model::nfs_export_options::SquashMode;
683    /// let x0 = NfsExportOptions::new().set_squash_mode(SquashMode::NoRootSquash);
684    /// let x1 = NfsExportOptions::new().set_squash_mode(SquashMode::RootSquash);
685    /// ```
686    pub fn set_squash_mode<T: std::convert::Into<crate::model::nfs_export_options::SquashMode>>(
687        mut self,
688        v: T,
689    ) -> Self {
690        self.squash_mode = v.into();
691        self
692    }
693
694    /// Sets the value of [anon_uid][crate::model::NfsExportOptions::anon_uid].
695    ///
696    /// # Example
697    /// ```ignore,no_run
698    /// # use google_cloud_filestore_v1::model::NfsExportOptions;
699    /// let x = NfsExportOptions::new().set_anon_uid(42);
700    /// ```
701    pub fn set_anon_uid<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
702        self.anon_uid = v.into();
703        self
704    }
705
706    /// Sets the value of [anon_gid][crate::model::NfsExportOptions::anon_gid].
707    ///
708    /// # Example
709    /// ```ignore,no_run
710    /// # use google_cloud_filestore_v1::model::NfsExportOptions;
711    /// let x = NfsExportOptions::new().set_anon_gid(42);
712    /// ```
713    pub fn set_anon_gid<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
714        self.anon_gid = v.into();
715        self
716    }
717}
718
719impl wkt::message::Message for NfsExportOptions {
720    fn typename() -> &'static str {
721        "type.googleapis.com/google.cloud.filestore.v1.NfsExportOptions"
722    }
723}
724
725/// Defines additional types related to [NfsExportOptions].
726pub mod nfs_export_options {
727    #[allow(unused_imports)]
728    use super::*;
729
730    /// The access mode.
731    ///
732    /// # Working with unknown values
733    ///
734    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
735    /// additional enum variants at any time. Adding new variants is not considered
736    /// a breaking change. Applications should write their code in anticipation of:
737    ///
738    /// - New values appearing in future releases of the client library, **and**
739    /// - New values received dynamically, without application changes.
740    ///
741    /// Please consult the [Working with enums] section in the user guide for some
742    /// guidelines.
743    ///
744    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
745    #[derive(Clone, Debug, PartialEq)]
746    #[non_exhaustive]
747    pub enum AccessMode {
748        /// AccessMode not set.
749        Unspecified,
750        /// The client can only read the file share.
751        ReadOnly,
752        /// The client can read and write the file share (default).
753        ReadWrite,
754        /// If set, the enum was initialized with an unknown value.
755        ///
756        /// Applications can examine the value using [AccessMode::value] or
757        /// [AccessMode::name].
758        UnknownValue(access_mode::UnknownValue),
759    }
760
761    #[doc(hidden)]
762    pub mod access_mode {
763        #[allow(unused_imports)]
764        use super::*;
765        #[derive(Clone, Debug, PartialEq)]
766        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
767    }
768
769    impl AccessMode {
770        /// Gets the enum value.
771        ///
772        /// Returns `None` if the enum contains an unknown value deserialized from
773        /// the string representation of enums.
774        pub fn value(&self) -> std::option::Option<i32> {
775            match self {
776                Self::Unspecified => std::option::Option::Some(0),
777                Self::ReadOnly => std::option::Option::Some(1),
778                Self::ReadWrite => std::option::Option::Some(2),
779                Self::UnknownValue(u) => u.0.value(),
780            }
781        }
782
783        /// Gets the enum value as a string.
784        ///
785        /// Returns `None` if the enum contains an unknown value deserialized from
786        /// the integer representation of enums.
787        pub fn name(&self) -> std::option::Option<&str> {
788            match self {
789                Self::Unspecified => std::option::Option::Some("ACCESS_MODE_UNSPECIFIED"),
790                Self::ReadOnly => std::option::Option::Some("READ_ONLY"),
791                Self::ReadWrite => std::option::Option::Some("READ_WRITE"),
792                Self::UnknownValue(u) => u.0.name(),
793            }
794        }
795    }
796
797    impl std::default::Default for AccessMode {
798        fn default() -> Self {
799            use std::convert::From;
800            Self::from(0)
801        }
802    }
803
804    impl std::fmt::Display for AccessMode {
805        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
806            wkt::internal::display_enum(f, self.name(), self.value())
807        }
808    }
809
810    impl std::convert::From<i32> for AccessMode {
811        fn from(value: i32) -> Self {
812            match value {
813                0 => Self::Unspecified,
814                1 => Self::ReadOnly,
815                2 => Self::ReadWrite,
816                _ => Self::UnknownValue(access_mode::UnknownValue(
817                    wkt::internal::UnknownEnumValue::Integer(value),
818                )),
819            }
820        }
821    }
822
823    impl std::convert::From<&str> for AccessMode {
824        fn from(value: &str) -> Self {
825            use std::string::ToString;
826            match value {
827                "ACCESS_MODE_UNSPECIFIED" => Self::Unspecified,
828                "READ_ONLY" => Self::ReadOnly,
829                "READ_WRITE" => Self::ReadWrite,
830                _ => Self::UnknownValue(access_mode::UnknownValue(
831                    wkt::internal::UnknownEnumValue::String(value.to_string()),
832                )),
833            }
834        }
835    }
836
837    impl serde::ser::Serialize for AccessMode {
838        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
839        where
840            S: serde::Serializer,
841        {
842            match self {
843                Self::Unspecified => serializer.serialize_i32(0),
844                Self::ReadOnly => serializer.serialize_i32(1),
845                Self::ReadWrite => serializer.serialize_i32(2),
846                Self::UnknownValue(u) => u.0.serialize(serializer),
847            }
848        }
849    }
850
851    impl<'de> serde::de::Deserialize<'de> for AccessMode {
852        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
853        where
854            D: serde::Deserializer<'de>,
855        {
856            deserializer.deserialize_any(wkt::internal::EnumVisitor::<AccessMode>::new(
857                ".google.cloud.filestore.v1.NfsExportOptions.AccessMode",
858            ))
859        }
860    }
861
862    /// The squash mode.
863    ///
864    /// # Working with unknown values
865    ///
866    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
867    /// additional enum variants at any time. Adding new variants is not considered
868    /// a breaking change. Applications should write their code in anticipation of:
869    ///
870    /// - New values appearing in future releases of the client library, **and**
871    /// - New values received dynamically, without application changes.
872    ///
873    /// Please consult the [Working with enums] section in the user guide for some
874    /// guidelines.
875    ///
876    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
877    #[derive(Clone, Debug, PartialEq)]
878    #[non_exhaustive]
879    pub enum SquashMode {
880        /// SquashMode not set.
881        Unspecified,
882        /// The Root user has root access to the file share (default).
883        NoRootSquash,
884        /// The Root user has squashed access to the anonymous uid/gid.
885        RootSquash,
886        /// If set, the enum was initialized with an unknown value.
887        ///
888        /// Applications can examine the value using [SquashMode::value] or
889        /// [SquashMode::name].
890        UnknownValue(squash_mode::UnknownValue),
891    }
892
893    #[doc(hidden)]
894    pub mod squash_mode {
895        #[allow(unused_imports)]
896        use super::*;
897        #[derive(Clone, Debug, PartialEq)]
898        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
899    }
900
901    impl SquashMode {
902        /// Gets the enum value.
903        ///
904        /// Returns `None` if the enum contains an unknown value deserialized from
905        /// the string representation of enums.
906        pub fn value(&self) -> std::option::Option<i32> {
907            match self {
908                Self::Unspecified => std::option::Option::Some(0),
909                Self::NoRootSquash => std::option::Option::Some(1),
910                Self::RootSquash => std::option::Option::Some(2),
911                Self::UnknownValue(u) => u.0.value(),
912            }
913        }
914
915        /// Gets the enum value as a string.
916        ///
917        /// Returns `None` if the enum contains an unknown value deserialized from
918        /// the integer representation of enums.
919        pub fn name(&self) -> std::option::Option<&str> {
920            match self {
921                Self::Unspecified => std::option::Option::Some("SQUASH_MODE_UNSPECIFIED"),
922                Self::NoRootSquash => std::option::Option::Some("NO_ROOT_SQUASH"),
923                Self::RootSquash => std::option::Option::Some("ROOT_SQUASH"),
924                Self::UnknownValue(u) => u.0.name(),
925            }
926        }
927    }
928
929    impl std::default::Default for SquashMode {
930        fn default() -> Self {
931            use std::convert::From;
932            Self::from(0)
933        }
934    }
935
936    impl std::fmt::Display for SquashMode {
937        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
938            wkt::internal::display_enum(f, self.name(), self.value())
939        }
940    }
941
942    impl std::convert::From<i32> for SquashMode {
943        fn from(value: i32) -> Self {
944            match value {
945                0 => Self::Unspecified,
946                1 => Self::NoRootSquash,
947                2 => Self::RootSquash,
948                _ => Self::UnknownValue(squash_mode::UnknownValue(
949                    wkt::internal::UnknownEnumValue::Integer(value),
950                )),
951            }
952        }
953    }
954
955    impl std::convert::From<&str> for SquashMode {
956        fn from(value: &str) -> Self {
957            use std::string::ToString;
958            match value {
959                "SQUASH_MODE_UNSPECIFIED" => Self::Unspecified,
960                "NO_ROOT_SQUASH" => Self::NoRootSquash,
961                "ROOT_SQUASH" => Self::RootSquash,
962                _ => Self::UnknownValue(squash_mode::UnknownValue(
963                    wkt::internal::UnknownEnumValue::String(value.to_string()),
964                )),
965            }
966        }
967    }
968
969    impl serde::ser::Serialize for SquashMode {
970        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
971        where
972            S: serde::Serializer,
973        {
974            match self {
975                Self::Unspecified => serializer.serialize_i32(0),
976                Self::NoRootSquash => serializer.serialize_i32(1),
977                Self::RootSquash => serializer.serialize_i32(2),
978                Self::UnknownValue(u) => u.0.serialize(serializer),
979            }
980        }
981    }
982
983    impl<'de> serde::de::Deserialize<'de> for SquashMode {
984        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
985        where
986            D: serde::Deserializer<'de>,
987        {
988            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SquashMode>::new(
989                ".google.cloud.filestore.v1.NfsExportOptions.SquashMode",
990            ))
991        }
992    }
993}
994
995/// Replica configuration for the instance.
996#[derive(Clone, Default, PartialEq)]
997#[non_exhaustive]
998pub struct ReplicaConfig {
999    /// Output only. The replica state.
1000    pub state: crate::model::replica_config::State,
1001
1002    /// Output only. Additional information about the replication state, if
1003    /// available.
1004    pub state_reasons: std::vec::Vec<crate::model::replica_config::StateReason>,
1005
1006    /// Optional. The peer instance.
1007    pub peer_instance: std::string::String,
1008
1009    /// Output only. The timestamp of the latest replication snapshot taken on the
1010    /// active instance and is already replicated safely.
1011    pub last_active_sync_time: std::option::Option<wkt::Timestamp>,
1012
1013    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1014}
1015
1016impl ReplicaConfig {
1017    /// Creates a new default instance.
1018    pub fn new() -> Self {
1019        std::default::Default::default()
1020    }
1021
1022    /// Sets the value of [state][crate::model::ReplicaConfig::state].
1023    ///
1024    /// # Example
1025    /// ```ignore,no_run
1026    /// # use google_cloud_filestore_v1::model::ReplicaConfig;
1027    /// use google_cloud_filestore_v1::model::replica_config::State;
1028    /// let x0 = ReplicaConfig::new().set_state(State::Creating);
1029    /// let x1 = ReplicaConfig::new().set_state(State::Ready);
1030    /// let x2 = ReplicaConfig::new().set_state(State::Removing);
1031    /// ```
1032    pub fn set_state<T: std::convert::Into<crate::model::replica_config::State>>(
1033        mut self,
1034        v: T,
1035    ) -> Self {
1036        self.state = v.into();
1037        self
1038    }
1039
1040    /// Sets the value of [state_reasons][crate::model::ReplicaConfig::state_reasons].
1041    ///
1042    /// # Example
1043    /// ```ignore,no_run
1044    /// # use google_cloud_filestore_v1::model::ReplicaConfig;
1045    /// use google_cloud_filestore_v1::model::replica_config::StateReason;
1046    /// let x = ReplicaConfig::new().set_state_reasons([
1047    ///     StateReason::PeerInstanceUnreachable,
1048    ///     StateReason::RemoveFailed,
1049    /// ]);
1050    /// ```
1051    pub fn set_state_reasons<T, V>(mut self, v: T) -> Self
1052    where
1053        T: std::iter::IntoIterator<Item = V>,
1054        V: std::convert::Into<crate::model::replica_config::StateReason>,
1055    {
1056        use std::iter::Iterator;
1057        self.state_reasons = v.into_iter().map(|i| i.into()).collect();
1058        self
1059    }
1060
1061    /// Sets the value of [peer_instance][crate::model::ReplicaConfig::peer_instance].
1062    ///
1063    /// # Example
1064    /// ```ignore,no_run
1065    /// # use google_cloud_filestore_v1::model::ReplicaConfig;
1066    /// let x = ReplicaConfig::new().set_peer_instance("example");
1067    /// ```
1068    pub fn set_peer_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1069        self.peer_instance = v.into();
1070        self
1071    }
1072
1073    /// Sets the value of [last_active_sync_time][crate::model::ReplicaConfig::last_active_sync_time].
1074    ///
1075    /// # Example
1076    /// ```ignore,no_run
1077    /// # use google_cloud_filestore_v1::model::ReplicaConfig;
1078    /// use wkt::Timestamp;
1079    /// let x = ReplicaConfig::new().set_last_active_sync_time(Timestamp::default()/* use setters */);
1080    /// ```
1081    pub fn set_last_active_sync_time<T>(mut self, v: T) -> Self
1082    where
1083        T: std::convert::Into<wkt::Timestamp>,
1084    {
1085        self.last_active_sync_time = std::option::Option::Some(v.into());
1086        self
1087    }
1088
1089    /// Sets or clears the value of [last_active_sync_time][crate::model::ReplicaConfig::last_active_sync_time].
1090    ///
1091    /// # Example
1092    /// ```ignore,no_run
1093    /// # use google_cloud_filestore_v1::model::ReplicaConfig;
1094    /// use wkt::Timestamp;
1095    /// let x = ReplicaConfig::new().set_or_clear_last_active_sync_time(Some(Timestamp::default()/* use setters */));
1096    /// let x = ReplicaConfig::new().set_or_clear_last_active_sync_time(None::<Timestamp>);
1097    /// ```
1098    pub fn set_or_clear_last_active_sync_time<T>(mut self, v: std::option::Option<T>) -> Self
1099    where
1100        T: std::convert::Into<wkt::Timestamp>,
1101    {
1102        self.last_active_sync_time = v.map(|x| x.into());
1103        self
1104    }
1105}
1106
1107impl wkt::message::Message for ReplicaConfig {
1108    fn typename() -> &'static str {
1109        "type.googleapis.com/google.cloud.filestore.v1.ReplicaConfig"
1110    }
1111}
1112
1113/// Defines additional types related to [ReplicaConfig].
1114pub mod replica_config {
1115    #[allow(unused_imports)]
1116    use super::*;
1117
1118    /// The replica state.
1119    ///
1120    /// # Working with unknown values
1121    ///
1122    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1123    /// additional enum variants at any time. Adding new variants is not considered
1124    /// a breaking change. Applications should write their code in anticipation of:
1125    ///
1126    /// - New values appearing in future releases of the client library, **and**
1127    /// - New values received dynamically, without application changes.
1128    ///
1129    /// Please consult the [Working with enums] section in the user guide for some
1130    /// guidelines.
1131    ///
1132    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1133    #[derive(Clone, Debug, PartialEq)]
1134    #[non_exhaustive]
1135    pub enum State {
1136        /// State not set.
1137        Unspecified,
1138        /// The replica is being created.
1139        Creating,
1140        /// The replica is ready.
1141        Ready,
1142        /// The replica is being removed.
1143        Removing,
1144        /// The replica is experiencing an issue and might be unusable. You can get
1145        /// further details from the `stateReasons` field of the `ReplicaConfig`
1146        /// object.
1147        Failed,
1148        /// If set, the enum was initialized with an unknown value.
1149        ///
1150        /// Applications can examine the value using [State::value] or
1151        /// [State::name].
1152        UnknownValue(state::UnknownValue),
1153    }
1154
1155    #[doc(hidden)]
1156    pub mod state {
1157        #[allow(unused_imports)]
1158        use super::*;
1159        #[derive(Clone, Debug, PartialEq)]
1160        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1161    }
1162
1163    impl State {
1164        /// Gets the enum value.
1165        ///
1166        /// Returns `None` if the enum contains an unknown value deserialized from
1167        /// the string representation of enums.
1168        pub fn value(&self) -> std::option::Option<i32> {
1169            match self {
1170                Self::Unspecified => std::option::Option::Some(0),
1171                Self::Creating => std::option::Option::Some(1),
1172                Self::Ready => std::option::Option::Some(3),
1173                Self::Removing => std::option::Option::Some(4),
1174                Self::Failed => std::option::Option::Some(5),
1175                Self::UnknownValue(u) => u.0.value(),
1176            }
1177        }
1178
1179        /// Gets the enum value as a string.
1180        ///
1181        /// Returns `None` if the enum contains an unknown value deserialized from
1182        /// the integer representation of enums.
1183        pub fn name(&self) -> std::option::Option<&str> {
1184            match self {
1185                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1186                Self::Creating => std::option::Option::Some("CREATING"),
1187                Self::Ready => std::option::Option::Some("READY"),
1188                Self::Removing => std::option::Option::Some("REMOVING"),
1189                Self::Failed => std::option::Option::Some("FAILED"),
1190                Self::UnknownValue(u) => u.0.name(),
1191            }
1192        }
1193    }
1194
1195    impl std::default::Default for State {
1196        fn default() -> Self {
1197            use std::convert::From;
1198            Self::from(0)
1199        }
1200    }
1201
1202    impl std::fmt::Display for State {
1203        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1204            wkt::internal::display_enum(f, self.name(), self.value())
1205        }
1206    }
1207
1208    impl std::convert::From<i32> for State {
1209        fn from(value: i32) -> Self {
1210            match value {
1211                0 => Self::Unspecified,
1212                1 => Self::Creating,
1213                3 => Self::Ready,
1214                4 => Self::Removing,
1215                5 => Self::Failed,
1216                _ => Self::UnknownValue(state::UnknownValue(
1217                    wkt::internal::UnknownEnumValue::Integer(value),
1218                )),
1219            }
1220        }
1221    }
1222
1223    impl std::convert::From<&str> for State {
1224        fn from(value: &str) -> Self {
1225            use std::string::ToString;
1226            match value {
1227                "STATE_UNSPECIFIED" => Self::Unspecified,
1228                "CREATING" => Self::Creating,
1229                "READY" => Self::Ready,
1230                "REMOVING" => Self::Removing,
1231                "FAILED" => Self::Failed,
1232                _ => Self::UnknownValue(state::UnknownValue(
1233                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1234                )),
1235            }
1236        }
1237    }
1238
1239    impl serde::ser::Serialize for State {
1240        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1241        where
1242            S: serde::Serializer,
1243        {
1244            match self {
1245                Self::Unspecified => serializer.serialize_i32(0),
1246                Self::Creating => serializer.serialize_i32(1),
1247                Self::Ready => serializer.serialize_i32(3),
1248                Self::Removing => serializer.serialize_i32(4),
1249                Self::Failed => serializer.serialize_i32(5),
1250                Self::UnknownValue(u) => u.0.serialize(serializer),
1251            }
1252        }
1253    }
1254
1255    impl<'de> serde::de::Deserialize<'de> for State {
1256        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1257        where
1258            D: serde::Deserializer<'de>,
1259        {
1260            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1261                ".google.cloud.filestore.v1.ReplicaConfig.State",
1262            ))
1263        }
1264    }
1265
1266    /// Additional information about the replication state, if available.
1267    ///
1268    /// # Working with unknown values
1269    ///
1270    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1271    /// additional enum variants at any time. Adding new variants is not considered
1272    /// a breaking change. Applications should write their code in anticipation of:
1273    ///
1274    /// - New values appearing in future releases of the client library, **and**
1275    /// - New values received dynamically, without application changes.
1276    ///
1277    /// Please consult the [Working with enums] section in the user guide for some
1278    /// guidelines.
1279    ///
1280    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1281    #[derive(Clone, Debug, PartialEq)]
1282    #[non_exhaustive]
1283    pub enum StateReason {
1284        /// Reason not specified.
1285        Unspecified,
1286        /// The peer instance is unreachable.
1287        PeerInstanceUnreachable,
1288        /// The remove replica peer instance operation failed.
1289        RemoveFailed,
1290        /// If set, the enum was initialized with an unknown value.
1291        ///
1292        /// Applications can examine the value using [StateReason::value] or
1293        /// [StateReason::name].
1294        UnknownValue(state_reason::UnknownValue),
1295    }
1296
1297    #[doc(hidden)]
1298    pub mod state_reason {
1299        #[allow(unused_imports)]
1300        use super::*;
1301        #[derive(Clone, Debug, PartialEq)]
1302        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1303    }
1304
1305    impl StateReason {
1306        /// Gets the enum value.
1307        ///
1308        /// Returns `None` if the enum contains an unknown value deserialized from
1309        /// the string representation of enums.
1310        pub fn value(&self) -> std::option::Option<i32> {
1311            match self {
1312                Self::Unspecified => std::option::Option::Some(0),
1313                Self::PeerInstanceUnreachable => std::option::Option::Some(1),
1314                Self::RemoveFailed => std::option::Option::Some(2),
1315                Self::UnknownValue(u) => u.0.value(),
1316            }
1317        }
1318
1319        /// Gets the enum value as a string.
1320        ///
1321        /// Returns `None` if the enum contains an unknown value deserialized from
1322        /// the integer representation of enums.
1323        pub fn name(&self) -> std::option::Option<&str> {
1324            match self {
1325                Self::Unspecified => std::option::Option::Some("STATE_REASON_UNSPECIFIED"),
1326                Self::PeerInstanceUnreachable => {
1327                    std::option::Option::Some("PEER_INSTANCE_UNREACHABLE")
1328                }
1329                Self::RemoveFailed => std::option::Option::Some("REMOVE_FAILED"),
1330                Self::UnknownValue(u) => u.0.name(),
1331            }
1332        }
1333    }
1334
1335    impl std::default::Default for StateReason {
1336        fn default() -> Self {
1337            use std::convert::From;
1338            Self::from(0)
1339        }
1340    }
1341
1342    impl std::fmt::Display for StateReason {
1343        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1344            wkt::internal::display_enum(f, self.name(), self.value())
1345        }
1346    }
1347
1348    impl std::convert::From<i32> for StateReason {
1349        fn from(value: i32) -> Self {
1350            match value {
1351                0 => Self::Unspecified,
1352                1 => Self::PeerInstanceUnreachable,
1353                2 => Self::RemoveFailed,
1354                _ => Self::UnknownValue(state_reason::UnknownValue(
1355                    wkt::internal::UnknownEnumValue::Integer(value),
1356                )),
1357            }
1358        }
1359    }
1360
1361    impl std::convert::From<&str> for StateReason {
1362        fn from(value: &str) -> Self {
1363            use std::string::ToString;
1364            match value {
1365                "STATE_REASON_UNSPECIFIED" => Self::Unspecified,
1366                "PEER_INSTANCE_UNREACHABLE" => Self::PeerInstanceUnreachable,
1367                "REMOVE_FAILED" => Self::RemoveFailed,
1368                _ => Self::UnknownValue(state_reason::UnknownValue(
1369                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1370                )),
1371            }
1372        }
1373    }
1374
1375    impl serde::ser::Serialize for StateReason {
1376        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1377        where
1378            S: serde::Serializer,
1379        {
1380            match self {
1381                Self::Unspecified => serializer.serialize_i32(0),
1382                Self::PeerInstanceUnreachable => serializer.serialize_i32(1),
1383                Self::RemoveFailed => serializer.serialize_i32(2),
1384                Self::UnknownValue(u) => u.0.serialize(serializer),
1385            }
1386        }
1387    }
1388
1389    impl<'de> serde::de::Deserialize<'de> for StateReason {
1390        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1391        where
1392            D: serde::Deserializer<'de>,
1393        {
1394            deserializer.deserialize_any(wkt::internal::EnumVisitor::<StateReason>::new(
1395                ".google.cloud.filestore.v1.ReplicaConfig.StateReason",
1396            ))
1397        }
1398    }
1399}
1400
1401/// Replication specifications.
1402#[derive(Clone, Default, PartialEq)]
1403#[non_exhaustive]
1404pub struct Replication {
1405    /// Optional. The replication role.
1406    pub role: crate::model::replication::Role,
1407
1408    /// Optional. Replication configuration for the replica instance associated
1409    /// with this instance. Only a single replica is supported.
1410    pub replicas: std::vec::Vec<crate::model::ReplicaConfig>,
1411
1412    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1413}
1414
1415impl Replication {
1416    /// Creates a new default instance.
1417    pub fn new() -> Self {
1418        std::default::Default::default()
1419    }
1420
1421    /// Sets the value of [role][crate::model::Replication::role].
1422    ///
1423    /// # Example
1424    /// ```ignore,no_run
1425    /// # use google_cloud_filestore_v1::model::Replication;
1426    /// use google_cloud_filestore_v1::model::replication::Role;
1427    /// let x0 = Replication::new().set_role(Role::Active);
1428    /// let x1 = Replication::new().set_role(Role::Standby);
1429    /// ```
1430    pub fn set_role<T: std::convert::Into<crate::model::replication::Role>>(
1431        mut self,
1432        v: T,
1433    ) -> Self {
1434        self.role = v.into();
1435        self
1436    }
1437
1438    /// Sets the value of [replicas][crate::model::Replication::replicas].
1439    ///
1440    /// # Example
1441    /// ```ignore,no_run
1442    /// # use google_cloud_filestore_v1::model::Replication;
1443    /// use google_cloud_filestore_v1::model::ReplicaConfig;
1444    /// let x = Replication::new()
1445    ///     .set_replicas([
1446    ///         ReplicaConfig::default()/* use setters */,
1447    ///         ReplicaConfig::default()/* use (different) setters */,
1448    ///     ]);
1449    /// ```
1450    pub fn set_replicas<T, V>(mut self, v: T) -> Self
1451    where
1452        T: std::iter::IntoIterator<Item = V>,
1453        V: std::convert::Into<crate::model::ReplicaConfig>,
1454    {
1455        use std::iter::Iterator;
1456        self.replicas = v.into_iter().map(|i| i.into()).collect();
1457        self
1458    }
1459}
1460
1461impl wkt::message::Message for Replication {
1462    fn typename() -> &'static str {
1463        "type.googleapis.com/google.cloud.filestore.v1.Replication"
1464    }
1465}
1466
1467/// Defines additional types related to [Replication].
1468pub mod replication {
1469    #[allow(unused_imports)]
1470    use super::*;
1471
1472    /// Replication role.
1473    ///
1474    /// # Working with unknown values
1475    ///
1476    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1477    /// additional enum variants at any time. Adding new variants is not considered
1478    /// a breaking change. Applications should write their code in anticipation of:
1479    ///
1480    /// - New values appearing in future releases of the client library, **and**
1481    /// - New values received dynamically, without application changes.
1482    ///
1483    /// Please consult the [Working with enums] section in the user guide for some
1484    /// guidelines.
1485    ///
1486    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1487    #[derive(Clone, Debug, PartialEq)]
1488    #[non_exhaustive]
1489    pub enum Role {
1490        /// Role not set.
1491        Unspecified,
1492        /// The instance is the `ACTIVE` replication member, functions as
1493        /// the replication source instance.
1494        Active,
1495        /// The instance is the `STANDBY` replication member, functions as
1496        /// the replication destination instance.
1497        Standby,
1498        /// If set, the enum was initialized with an unknown value.
1499        ///
1500        /// Applications can examine the value using [Role::value] or
1501        /// [Role::name].
1502        UnknownValue(role::UnknownValue),
1503    }
1504
1505    #[doc(hidden)]
1506    pub mod role {
1507        #[allow(unused_imports)]
1508        use super::*;
1509        #[derive(Clone, Debug, PartialEq)]
1510        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1511    }
1512
1513    impl Role {
1514        /// Gets the enum value.
1515        ///
1516        /// Returns `None` if the enum contains an unknown value deserialized from
1517        /// the string representation of enums.
1518        pub fn value(&self) -> std::option::Option<i32> {
1519            match self {
1520                Self::Unspecified => std::option::Option::Some(0),
1521                Self::Active => std::option::Option::Some(1),
1522                Self::Standby => std::option::Option::Some(2),
1523                Self::UnknownValue(u) => u.0.value(),
1524            }
1525        }
1526
1527        /// Gets the enum value as a string.
1528        ///
1529        /// Returns `None` if the enum contains an unknown value deserialized from
1530        /// the integer representation of enums.
1531        pub fn name(&self) -> std::option::Option<&str> {
1532            match self {
1533                Self::Unspecified => std::option::Option::Some("ROLE_UNSPECIFIED"),
1534                Self::Active => std::option::Option::Some("ACTIVE"),
1535                Self::Standby => std::option::Option::Some("STANDBY"),
1536                Self::UnknownValue(u) => u.0.name(),
1537            }
1538        }
1539    }
1540
1541    impl std::default::Default for Role {
1542        fn default() -> Self {
1543            use std::convert::From;
1544            Self::from(0)
1545        }
1546    }
1547
1548    impl std::fmt::Display for Role {
1549        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1550            wkt::internal::display_enum(f, self.name(), self.value())
1551        }
1552    }
1553
1554    impl std::convert::From<i32> for Role {
1555        fn from(value: i32) -> Self {
1556            match value {
1557                0 => Self::Unspecified,
1558                1 => Self::Active,
1559                2 => Self::Standby,
1560                _ => Self::UnknownValue(role::UnknownValue(
1561                    wkt::internal::UnknownEnumValue::Integer(value),
1562                )),
1563            }
1564        }
1565    }
1566
1567    impl std::convert::From<&str> for Role {
1568        fn from(value: &str) -> Self {
1569            use std::string::ToString;
1570            match value {
1571                "ROLE_UNSPECIFIED" => Self::Unspecified,
1572                "ACTIVE" => Self::Active,
1573                "STANDBY" => Self::Standby,
1574                _ => Self::UnknownValue(role::UnknownValue(
1575                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1576                )),
1577            }
1578        }
1579    }
1580
1581    impl serde::ser::Serialize for Role {
1582        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1583        where
1584            S: serde::Serializer,
1585        {
1586            match self {
1587                Self::Unspecified => serializer.serialize_i32(0),
1588                Self::Active => serializer.serialize_i32(1),
1589                Self::Standby => serializer.serialize_i32(2),
1590                Self::UnknownValue(u) => u.0.serialize(serializer),
1591            }
1592        }
1593    }
1594
1595    impl<'de> serde::de::Deserialize<'de> for Role {
1596        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1597        where
1598            D: serde::Deserializer<'de>,
1599        {
1600            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Role>::new(
1601                ".google.cloud.filestore.v1.Replication.Role",
1602            ))
1603        }
1604    }
1605}
1606
1607/// A Filestore instance.
1608#[derive(Clone, Default, PartialEq)]
1609#[non_exhaustive]
1610pub struct Instance {
1611    /// Output only. The resource name of the instance, in the format
1612    /// `projects/{project}/locations/{location}/instances/{instance}`.
1613    pub name: std::string::String,
1614
1615    /// The description of the instance (2048 characters or less).
1616    pub description: std::string::String,
1617
1618    /// Output only. The instance state.
1619    pub state: crate::model::instance::State,
1620
1621    /// Output only. Additional information about the instance state, if available.
1622    pub status_message: std::string::String,
1623
1624    /// Output only. The time when the instance was created.
1625    pub create_time: std::option::Option<wkt::Timestamp>,
1626
1627    /// The service tier of the instance.
1628    pub tier: crate::model::instance::Tier,
1629
1630    /// Resource labels to represent user provided metadata.
1631    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1632
1633    /// File system shares on the instance.
1634    /// For this version, only a single file share is supported.
1635    pub file_shares: std::vec::Vec<crate::model::FileShareConfig>,
1636
1637    /// VPC networks to which the instance is connected.
1638    /// For this version, only a single network is supported.
1639    pub networks: std::vec::Vec<crate::model::NetworkConfig>,
1640
1641    /// Server-specified ETag for the instance resource to prevent simultaneous
1642    /// updates from overwriting each other.
1643    pub etag: std::string::String,
1644
1645    /// Output only. Reserved for future use.
1646    pub satisfies_pzs: std::option::Option<wkt::BoolValue>,
1647
1648    /// Output only. Reserved for future use.
1649    pub satisfies_pzi: bool,
1650
1651    /// KMS key name used for data encryption.
1652    pub kms_key_name: std::string::String,
1653
1654    /// Output only. Field indicates all the reasons the instance is in "SUSPENDED"
1655    /// state.
1656    pub suspension_reasons: std::vec::Vec<crate::model::instance::SuspensionReason>,
1657
1658    /// Optional. Replication configuration.
1659    pub replication: std::option::Option<crate::model::Replication>,
1660
1661    /// Optional. Input only. Immutable. Tag key-value pairs bound to this
1662    /// resource. Each key must be a namespaced name and each value a short name.
1663    /// Example:
1664    /// "123456789012/environment" : "production",
1665    /// "123456789013/costCenter" : "marketing"
1666    /// See the documentation for more information:
1667    ///
1668    /// - Namespaced name:
1669    ///   <https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#retrieving_tag_key>
1670    /// - Short name:
1671    ///   <https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#retrieving_tag_value>
1672    pub tags: std::collections::HashMap<std::string::String, std::string::String>,
1673
1674    /// Immutable. The protocol indicates the access protocol for all shares in the
1675    /// instance. This field is immutable and it cannot be changed after the
1676    /// instance has been created. Default value: `NFS_V3`.
1677    pub protocol: crate::model::instance::FileProtocol,
1678
1679    /// Output only. Indicates whether this instance supports configuring its
1680    /// performance. If true, the user can configure the instance's performance by
1681    /// using the 'performance_config' field.
1682    pub custom_performance_supported: bool,
1683
1684    /// Optional. Used to configure performance.
1685    pub performance_config: std::option::Option<crate::model::instance::PerformanceConfig>,
1686
1687    /// Output only. Used for getting performance limits.
1688    pub performance_limits: std::option::Option<crate::model::instance::PerformanceLimits>,
1689
1690    /// Optional. Indicates whether the instance is protected against deletion.
1691    pub deletion_protection_enabled: bool,
1692
1693    /// Optional. The reason for enabling deletion protection.
1694    pub deletion_protection_reason: std::string::String,
1695
1696    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1697}
1698
1699impl Instance {
1700    /// Creates a new default instance.
1701    pub fn new() -> Self {
1702        std::default::Default::default()
1703    }
1704
1705    /// Sets the value of [name][crate::model::Instance::name].
1706    ///
1707    /// # Example
1708    /// ```ignore,no_run
1709    /// # use google_cloud_filestore_v1::model::Instance;
1710    /// let x = Instance::new().set_name("example");
1711    /// ```
1712    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1713        self.name = v.into();
1714        self
1715    }
1716
1717    /// Sets the value of [description][crate::model::Instance::description].
1718    ///
1719    /// # Example
1720    /// ```ignore,no_run
1721    /// # use google_cloud_filestore_v1::model::Instance;
1722    /// let x = Instance::new().set_description("example");
1723    /// ```
1724    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1725        self.description = v.into();
1726        self
1727    }
1728
1729    /// Sets the value of [state][crate::model::Instance::state].
1730    ///
1731    /// # Example
1732    /// ```ignore,no_run
1733    /// # use google_cloud_filestore_v1::model::Instance;
1734    /// use google_cloud_filestore_v1::model::instance::State;
1735    /// let x0 = Instance::new().set_state(State::Creating);
1736    /// let x1 = Instance::new().set_state(State::Ready);
1737    /// let x2 = Instance::new().set_state(State::Repairing);
1738    /// ```
1739    pub fn set_state<T: std::convert::Into<crate::model::instance::State>>(mut self, v: T) -> Self {
1740        self.state = v.into();
1741        self
1742    }
1743
1744    /// Sets the value of [status_message][crate::model::Instance::status_message].
1745    ///
1746    /// # Example
1747    /// ```ignore,no_run
1748    /// # use google_cloud_filestore_v1::model::Instance;
1749    /// let x = Instance::new().set_status_message("example");
1750    /// ```
1751    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1752        self.status_message = v.into();
1753        self
1754    }
1755
1756    /// Sets the value of [create_time][crate::model::Instance::create_time].
1757    ///
1758    /// # Example
1759    /// ```ignore,no_run
1760    /// # use google_cloud_filestore_v1::model::Instance;
1761    /// use wkt::Timestamp;
1762    /// let x = Instance::new().set_create_time(Timestamp::default()/* use setters */);
1763    /// ```
1764    pub fn set_create_time<T>(mut self, v: T) -> Self
1765    where
1766        T: std::convert::Into<wkt::Timestamp>,
1767    {
1768        self.create_time = std::option::Option::Some(v.into());
1769        self
1770    }
1771
1772    /// Sets or clears the value of [create_time][crate::model::Instance::create_time].
1773    ///
1774    /// # Example
1775    /// ```ignore,no_run
1776    /// # use google_cloud_filestore_v1::model::Instance;
1777    /// use wkt::Timestamp;
1778    /// let x = Instance::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1779    /// let x = Instance::new().set_or_clear_create_time(None::<Timestamp>);
1780    /// ```
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 [tier][crate::model::Instance::tier].
1790    ///
1791    /// # Example
1792    /// ```ignore,no_run
1793    /// # use google_cloud_filestore_v1::model::Instance;
1794    /// use google_cloud_filestore_v1::model::instance::Tier;
1795    /// let x0 = Instance::new().set_tier(Tier::Standard);
1796    /// let x1 = Instance::new().set_tier(Tier::Premium);
1797    /// let x2 = Instance::new().set_tier(Tier::BasicHdd);
1798    /// ```
1799    pub fn set_tier<T: std::convert::Into<crate::model::instance::Tier>>(mut self, v: T) -> Self {
1800        self.tier = v.into();
1801        self
1802    }
1803
1804    /// Sets the value of [labels][crate::model::Instance::labels].
1805    ///
1806    /// # Example
1807    /// ```ignore,no_run
1808    /// # use google_cloud_filestore_v1::model::Instance;
1809    /// let x = Instance::new().set_labels([
1810    ///     ("key0", "abc"),
1811    ///     ("key1", "xyz"),
1812    /// ]);
1813    /// ```
1814    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1815    where
1816        T: std::iter::IntoIterator<Item = (K, V)>,
1817        K: std::convert::Into<std::string::String>,
1818        V: std::convert::Into<std::string::String>,
1819    {
1820        use std::iter::Iterator;
1821        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1822        self
1823    }
1824
1825    /// Sets the value of [file_shares][crate::model::Instance::file_shares].
1826    ///
1827    /// # Example
1828    /// ```ignore,no_run
1829    /// # use google_cloud_filestore_v1::model::Instance;
1830    /// use google_cloud_filestore_v1::model::FileShareConfig;
1831    /// let x = Instance::new()
1832    ///     .set_file_shares([
1833    ///         FileShareConfig::default()/* use setters */,
1834    ///         FileShareConfig::default()/* use (different) setters */,
1835    ///     ]);
1836    /// ```
1837    pub fn set_file_shares<T, V>(mut self, v: T) -> Self
1838    where
1839        T: std::iter::IntoIterator<Item = V>,
1840        V: std::convert::Into<crate::model::FileShareConfig>,
1841    {
1842        use std::iter::Iterator;
1843        self.file_shares = v.into_iter().map(|i| i.into()).collect();
1844        self
1845    }
1846
1847    /// Sets the value of [networks][crate::model::Instance::networks].
1848    ///
1849    /// # Example
1850    /// ```ignore,no_run
1851    /// # use google_cloud_filestore_v1::model::Instance;
1852    /// use google_cloud_filestore_v1::model::NetworkConfig;
1853    /// let x = Instance::new()
1854    ///     .set_networks([
1855    ///         NetworkConfig::default()/* use setters */,
1856    ///         NetworkConfig::default()/* use (different) setters */,
1857    ///     ]);
1858    /// ```
1859    pub fn set_networks<T, V>(mut self, v: T) -> Self
1860    where
1861        T: std::iter::IntoIterator<Item = V>,
1862        V: std::convert::Into<crate::model::NetworkConfig>,
1863    {
1864        use std::iter::Iterator;
1865        self.networks = v.into_iter().map(|i| i.into()).collect();
1866        self
1867    }
1868
1869    /// Sets the value of [etag][crate::model::Instance::etag].
1870    ///
1871    /// # Example
1872    /// ```ignore,no_run
1873    /// # use google_cloud_filestore_v1::model::Instance;
1874    /// let x = Instance::new().set_etag("example");
1875    /// ```
1876    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1877        self.etag = v.into();
1878        self
1879    }
1880
1881    /// Sets the value of [satisfies_pzs][crate::model::Instance::satisfies_pzs].
1882    ///
1883    /// # Example
1884    /// ```ignore,no_run
1885    /// # use google_cloud_filestore_v1::model::Instance;
1886    /// use wkt::BoolValue;
1887    /// let x = Instance::new().set_satisfies_pzs(BoolValue::default()/* use setters */);
1888    /// ```
1889    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
1890    where
1891        T: std::convert::Into<wkt::BoolValue>,
1892    {
1893        self.satisfies_pzs = std::option::Option::Some(v.into());
1894        self
1895    }
1896
1897    /// Sets or clears the value of [satisfies_pzs][crate::model::Instance::satisfies_pzs].
1898    ///
1899    /// # Example
1900    /// ```ignore,no_run
1901    /// # use google_cloud_filestore_v1::model::Instance;
1902    /// use wkt::BoolValue;
1903    /// let x = Instance::new().set_or_clear_satisfies_pzs(Some(BoolValue::default()/* use setters */));
1904    /// let x = Instance::new().set_or_clear_satisfies_pzs(None::<BoolValue>);
1905    /// ```
1906    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
1907    where
1908        T: std::convert::Into<wkt::BoolValue>,
1909    {
1910        self.satisfies_pzs = v.map(|x| x.into());
1911        self
1912    }
1913
1914    /// Sets the value of [satisfies_pzi][crate::model::Instance::satisfies_pzi].
1915    ///
1916    /// # Example
1917    /// ```ignore,no_run
1918    /// # use google_cloud_filestore_v1::model::Instance;
1919    /// let x = Instance::new().set_satisfies_pzi(true);
1920    /// ```
1921    pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1922        self.satisfies_pzi = v.into();
1923        self
1924    }
1925
1926    /// Sets the value of [kms_key_name][crate::model::Instance::kms_key_name].
1927    ///
1928    /// # Example
1929    /// ```ignore,no_run
1930    /// # use google_cloud_filestore_v1::model::Instance;
1931    /// let x = Instance::new().set_kms_key_name("example");
1932    /// ```
1933    pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1934        self.kms_key_name = v.into();
1935        self
1936    }
1937
1938    /// Sets the value of [suspension_reasons][crate::model::Instance::suspension_reasons].
1939    ///
1940    /// # Example
1941    /// ```ignore,no_run
1942    /// # use google_cloud_filestore_v1::model::Instance;
1943    /// use google_cloud_filestore_v1::model::instance::SuspensionReason;
1944    /// let x = Instance::new().set_suspension_reasons([
1945    ///     SuspensionReason::KmsKeyIssue,
1946    /// ]);
1947    /// ```
1948    pub fn set_suspension_reasons<T, V>(mut self, v: T) -> Self
1949    where
1950        T: std::iter::IntoIterator<Item = V>,
1951        V: std::convert::Into<crate::model::instance::SuspensionReason>,
1952    {
1953        use std::iter::Iterator;
1954        self.suspension_reasons = v.into_iter().map(|i| i.into()).collect();
1955        self
1956    }
1957
1958    /// Sets the value of [replication][crate::model::Instance::replication].
1959    ///
1960    /// # Example
1961    /// ```ignore,no_run
1962    /// # use google_cloud_filestore_v1::model::Instance;
1963    /// use google_cloud_filestore_v1::model::Replication;
1964    /// let x = Instance::new().set_replication(Replication::default()/* use setters */);
1965    /// ```
1966    pub fn set_replication<T>(mut self, v: T) -> Self
1967    where
1968        T: std::convert::Into<crate::model::Replication>,
1969    {
1970        self.replication = std::option::Option::Some(v.into());
1971        self
1972    }
1973
1974    /// Sets or clears the value of [replication][crate::model::Instance::replication].
1975    ///
1976    /// # Example
1977    /// ```ignore,no_run
1978    /// # use google_cloud_filestore_v1::model::Instance;
1979    /// use google_cloud_filestore_v1::model::Replication;
1980    /// let x = Instance::new().set_or_clear_replication(Some(Replication::default()/* use setters */));
1981    /// let x = Instance::new().set_or_clear_replication(None::<Replication>);
1982    /// ```
1983    pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
1984    where
1985        T: std::convert::Into<crate::model::Replication>,
1986    {
1987        self.replication = v.map(|x| x.into());
1988        self
1989    }
1990
1991    /// Sets the value of [tags][crate::model::Instance::tags].
1992    ///
1993    /// # Example
1994    /// ```ignore,no_run
1995    /// # use google_cloud_filestore_v1::model::Instance;
1996    /// let x = Instance::new().set_tags([
1997    ///     ("key0", "abc"),
1998    ///     ("key1", "xyz"),
1999    /// ]);
2000    /// ```
2001    pub fn set_tags<T, K, V>(mut self, v: T) -> Self
2002    where
2003        T: std::iter::IntoIterator<Item = (K, V)>,
2004        K: std::convert::Into<std::string::String>,
2005        V: std::convert::Into<std::string::String>,
2006    {
2007        use std::iter::Iterator;
2008        self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2009        self
2010    }
2011
2012    /// Sets the value of [protocol][crate::model::Instance::protocol].
2013    ///
2014    /// # Example
2015    /// ```ignore,no_run
2016    /// # use google_cloud_filestore_v1::model::Instance;
2017    /// use google_cloud_filestore_v1::model::instance::FileProtocol;
2018    /// let x0 = Instance::new().set_protocol(FileProtocol::NfsV3);
2019    /// let x1 = Instance::new().set_protocol(FileProtocol::NfsV41);
2020    /// ```
2021    pub fn set_protocol<T: std::convert::Into<crate::model::instance::FileProtocol>>(
2022        mut self,
2023        v: T,
2024    ) -> Self {
2025        self.protocol = v.into();
2026        self
2027    }
2028
2029    /// Sets the value of [custom_performance_supported][crate::model::Instance::custom_performance_supported].
2030    ///
2031    /// # Example
2032    /// ```ignore,no_run
2033    /// # use google_cloud_filestore_v1::model::Instance;
2034    /// let x = Instance::new().set_custom_performance_supported(true);
2035    /// ```
2036    pub fn set_custom_performance_supported<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2037        self.custom_performance_supported = v.into();
2038        self
2039    }
2040
2041    /// Sets the value of [performance_config][crate::model::Instance::performance_config].
2042    ///
2043    /// # Example
2044    /// ```ignore,no_run
2045    /// # use google_cloud_filestore_v1::model::Instance;
2046    /// use google_cloud_filestore_v1::model::instance::PerformanceConfig;
2047    /// let x = Instance::new().set_performance_config(PerformanceConfig::default()/* use setters */);
2048    /// ```
2049    pub fn set_performance_config<T>(mut self, v: T) -> Self
2050    where
2051        T: std::convert::Into<crate::model::instance::PerformanceConfig>,
2052    {
2053        self.performance_config = std::option::Option::Some(v.into());
2054        self
2055    }
2056
2057    /// Sets or clears the value of [performance_config][crate::model::Instance::performance_config].
2058    ///
2059    /// # Example
2060    /// ```ignore,no_run
2061    /// # use google_cloud_filestore_v1::model::Instance;
2062    /// use google_cloud_filestore_v1::model::instance::PerformanceConfig;
2063    /// let x = Instance::new().set_or_clear_performance_config(Some(PerformanceConfig::default()/* use setters */));
2064    /// let x = Instance::new().set_or_clear_performance_config(None::<PerformanceConfig>);
2065    /// ```
2066    pub fn set_or_clear_performance_config<T>(mut self, v: std::option::Option<T>) -> Self
2067    where
2068        T: std::convert::Into<crate::model::instance::PerformanceConfig>,
2069    {
2070        self.performance_config = v.map(|x| x.into());
2071        self
2072    }
2073
2074    /// Sets the value of [performance_limits][crate::model::Instance::performance_limits].
2075    ///
2076    /// # Example
2077    /// ```ignore,no_run
2078    /// # use google_cloud_filestore_v1::model::Instance;
2079    /// use google_cloud_filestore_v1::model::instance::PerformanceLimits;
2080    /// let x = Instance::new().set_performance_limits(PerformanceLimits::default()/* use setters */);
2081    /// ```
2082    pub fn set_performance_limits<T>(mut self, v: T) -> Self
2083    where
2084        T: std::convert::Into<crate::model::instance::PerformanceLimits>,
2085    {
2086        self.performance_limits = std::option::Option::Some(v.into());
2087        self
2088    }
2089
2090    /// Sets or clears the value of [performance_limits][crate::model::Instance::performance_limits].
2091    ///
2092    /// # Example
2093    /// ```ignore,no_run
2094    /// # use google_cloud_filestore_v1::model::Instance;
2095    /// use google_cloud_filestore_v1::model::instance::PerformanceLimits;
2096    /// let x = Instance::new().set_or_clear_performance_limits(Some(PerformanceLimits::default()/* use setters */));
2097    /// let x = Instance::new().set_or_clear_performance_limits(None::<PerformanceLimits>);
2098    /// ```
2099    pub fn set_or_clear_performance_limits<T>(mut self, v: std::option::Option<T>) -> Self
2100    where
2101        T: std::convert::Into<crate::model::instance::PerformanceLimits>,
2102    {
2103        self.performance_limits = v.map(|x| x.into());
2104        self
2105    }
2106
2107    /// Sets the value of [deletion_protection_enabled][crate::model::Instance::deletion_protection_enabled].
2108    ///
2109    /// # Example
2110    /// ```ignore,no_run
2111    /// # use google_cloud_filestore_v1::model::Instance;
2112    /// let x = Instance::new().set_deletion_protection_enabled(true);
2113    /// ```
2114    pub fn set_deletion_protection_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2115        self.deletion_protection_enabled = v.into();
2116        self
2117    }
2118
2119    /// Sets the value of [deletion_protection_reason][crate::model::Instance::deletion_protection_reason].
2120    ///
2121    /// # Example
2122    /// ```ignore,no_run
2123    /// # use google_cloud_filestore_v1::model::Instance;
2124    /// let x = Instance::new().set_deletion_protection_reason("example");
2125    /// ```
2126    pub fn set_deletion_protection_reason<T: std::convert::Into<std::string::String>>(
2127        mut self,
2128        v: T,
2129    ) -> Self {
2130        self.deletion_protection_reason = v.into();
2131        self
2132    }
2133}
2134
2135impl wkt::message::Message for Instance {
2136    fn typename() -> &'static str {
2137        "type.googleapis.com/google.cloud.filestore.v1.Instance"
2138    }
2139}
2140
2141/// Defines additional types related to [Instance].
2142pub mod instance {
2143    #[allow(unused_imports)]
2144    use super::*;
2145
2146    /// IOPS per TB.
2147    /// Filestore defines TB as 1024^4 bytes (TiB).
2148    #[derive(Clone, Default, PartialEq)]
2149    #[non_exhaustive]
2150    pub struct IOPSPerTB {
2151        /// Required. Maximum IOPS per TiB.
2152        pub max_iops_per_tb: i64,
2153
2154        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2155    }
2156
2157    impl IOPSPerTB {
2158        /// Creates a new default instance.
2159        pub fn new() -> Self {
2160            std::default::Default::default()
2161        }
2162
2163        /// Sets the value of [max_iops_per_tb][crate::model::instance::IOPSPerTB::max_iops_per_tb].
2164        ///
2165        /// # Example
2166        /// ```ignore,no_run
2167        /// # use google_cloud_filestore_v1::model::instance::IOPSPerTB;
2168        /// let x = IOPSPerTB::new().set_max_iops_per_tb(42);
2169        /// ```
2170        pub fn set_max_iops_per_tb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2171            self.max_iops_per_tb = v.into();
2172            self
2173        }
2174    }
2175
2176    impl wkt::message::Message for IOPSPerTB {
2177        fn typename() -> &'static str {
2178            "type.googleapis.com/google.cloud.filestore.v1.Instance.IOPSPerTB"
2179        }
2180    }
2181
2182    /// Fixed IOPS (input/output operations per second) parameters.
2183    #[derive(Clone, Default, PartialEq)]
2184    #[non_exhaustive]
2185    pub struct FixedIOPS {
2186        /// Required. Maximum IOPS.
2187        pub max_iops: i64,
2188
2189        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2190    }
2191
2192    impl FixedIOPS {
2193        /// Creates a new default instance.
2194        pub fn new() -> Self {
2195            std::default::Default::default()
2196        }
2197
2198        /// Sets the value of [max_iops][crate::model::instance::FixedIOPS::max_iops].
2199        ///
2200        /// # Example
2201        /// ```ignore,no_run
2202        /// # use google_cloud_filestore_v1::model::instance::FixedIOPS;
2203        /// let x = FixedIOPS::new().set_max_iops(42);
2204        /// ```
2205        pub fn set_max_iops<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2206            self.max_iops = v.into();
2207            self
2208        }
2209    }
2210
2211    impl wkt::message::Message for FixedIOPS {
2212        fn typename() -> &'static str {
2213            "type.googleapis.com/google.cloud.filestore.v1.Instance.FixedIOPS"
2214        }
2215    }
2216
2217    /// Used for setting the performance configuration.
2218    /// If the user doesn't specify PerformanceConfig, automatically provision
2219    /// the default performance settings as described in
2220    /// <https://cloud.google.com/filestore/docs/performance>. Larger instances will
2221    /// be linearly set to more IOPS. If the instance's capacity is increased or
2222    /// decreased, its performance will be automatically adjusted upwards or
2223    /// downwards accordingly (respectively).
2224    #[derive(Clone, Default, PartialEq)]
2225    #[non_exhaustive]
2226    pub struct PerformanceConfig {
2227        #[allow(missing_docs)]
2228        pub mode: std::option::Option<crate::model::instance::performance_config::Mode>,
2229
2230        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2231    }
2232
2233    impl PerformanceConfig {
2234        /// Creates a new default instance.
2235        pub fn new() -> Self {
2236            std::default::Default::default()
2237        }
2238
2239        /// Sets the value of [mode][crate::model::instance::PerformanceConfig::mode].
2240        ///
2241        /// Note that all the setters affecting `mode` are mutually
2242        /// exclusive.
2243        ///
2244        /// # Example
2245        /// ```ignore,no_run
2246        /// # use google_cloud_filestore_v1::model::instance::PerformanceConfig;
2247        /// use google_cloud_filestore_v1::model::instance::IOPSPerTB;
2248        /// let x = PerformanceConfig::new().set_mode(Some(
2249        ///     google_cloud_filestore_v1::model::instance::performance_config::Mode::IopsPerTb(IOPSPerTB::default().into())));
2250        /// ```
2251        pub fn set_mode<
2252            T: std::convert::Into<
2253                    std::option::Option<crate::model::instance::performance_config::Mode>,
2254                >,
2255        >(
2256            mut self,
2257            v: T,
2258        ) -> Self {
2259            self.mode = v.into();
2260            self
2261        }
2262
2263        /// The value of [mode][crate::model::instance::PerformanceConfig::mode]
2264        /// if it holds a `IopsPerTb`, `None` if the field is not set or
2265        /// holds a different branch.
2266        pub fn iops_per_tb(
2267            &self,
2268        ) -> std::option::Option<&std::boxed::Box<crate::model::instance::IOPSPerTB>> {
2269            #[allow(unreachable_patterns)]
2270            self.mode.as_ref().and_then(|v| match v {
2271                crate::model::instance::performance_config::Mode::IopsPerTb(v) => {
2272                    std::option::Option::Some(v)
2273                }
2274                _ => std::option::Option::None,
2275            })
2276        }
2277
2278        /// Sets the value of [mode][crate::model::instance::PerformanceConfig::mode]
2279        /// to hold a `IopsPerTb`.
2280        ///
2281        /// Note that all the setters affecting `mode` are
2282        /// mutually exclusive.
2283        ///
2284        /// # Example
2285        /// ```ignore,no_run
2286        /// # use google_cloud_filestore_v1::model::instance::PerformanceConfig;
2287        /// use google_cloud_filestore_v1::model::instance::IOPSPerTB;
2288        /// let x = PerformanceConfig::new().set_iops_per_tb(IOPSPerTB::default()/* use setters */);
2289        /// assert!(x.iops_per_tb().is_some());
2290        /// assert!(x.fixed_iops().is_none());
2291        /// ```
2292        pub fn set_iops_per_tb<
2293            T: std::convert::Into<std::boxed::Box<crate::model::instance::IOPSPerTB>>,
2294        >(
2295            mut self,
2296            v: T,
2297        ) -> Self {
2298            self.mode = std::option::Option::Some(
2299                crate::model::instance::performance_config::Mode::IopsPerTb(v.into()),
2300            );
2301            self
2302        }
2303
2304        /// The value of [mode][crate::model::instance::PerformanceConfig::mode]
2305        /// if it holds a `FixedIops`, `None` if the field is not set or
2306        /// holds a different branch.
2307        pub fn fixed_iops(
2308            &self,
2309        ) -> std::option::Option<&std::boxed::Box<crate::model::instance::FixedIOPS>> {
2310            #[allow(unreachable_patterns)]
2311            self.mode.as_ref().and_then(|v| match v {
2312                crate::model::instance::performance_config::Mode::FixedIops(v) => {
2313                    std::option::Option::Some(v)
2314                }
2315                _ => std::option::Option::None,
2316            })
2317        }
2318
2319        /// Sets the value of [mode][crate::model::instance::PerformanceConfig::mode]
2320        /// to hold a `FixedIops`.
2321        ///
2322        /// Note that all the setters affecting `mode` are
2323        /// mutually exclusive.
2324        ///
2325        /// # Example
2326        /// ```ignore,no_run
2327        /// # use google_cloud_filestore_v1::model::instance::PerformanceConfig;
2328        /// use google_cloud_filestore_v1::model::instance::FixedIOPS;
2329        /// let x = PerformanceConfig::new().set_fixed_iops(FixedIOPS::default()/* use setters */);
2330        /// assert!(x.fixed_iops().is_some());
2331        /// assert!(x.iops_per_tb().is_none());
2332        /// ```
2333        pub fn set_fixed_iops<
2334            T: std::convert::Into<std::boxed::Box<crate::model::instance::FixedIOPS>>,
2335        >(
2336            mut self,
2337            v: T,
2338        ) -> Self {
2339            self.mode = std::option::Option::Some(
2340                crate::model::instance::performance_config::Mode::FixedIops(v.into()),
2341            );
2342            self
2343        }
2344    }
2345
2346    impl wkt::message::Message for PerformanceConfig {
2347        fn typename() -> &'static str {
2348            "type.googleapis.com/google.cloud.filestore.v1.Instance.PerformanceConfig"
2349        }
2350    }
2351
2352    /// Defines additional types related to [PerformanceConfig].
2353    pub mod performance_config {
2354        #[allow(unused_imports)]
2355        use super::*;
2356
2357        #[allow(missing_docs)]
2358        #[derive(Clone, Debug, PartialEq)]
2359        #[non_exhaustive]
2360        pub enum Mode {
2361            /// Provision IOPS dynamically based on the capacity of the instance.
2362            /// Provisioned IOPS will be calculated by multiplying the capacity of the
2363            /// instance in TiB by the `iops_per_tb` value. For example, for a 2 TiB
2364            /// instance with an `iops_per_tb` value of 17000 the provisioned IOPS will
2365            /// be 34000.
2366            ///
2367            /// If the calculated value is outside the supported range for the
2368            /// instance's capacity during instance creation, instance creation will
2369            /// fail with an `InvalidArgument` error. Similarly, if an instance
2370            /// capacity update would result in a value outside the supported range,
2371            /// the update will fail with an `InvalidArgument` error.
2372            IopsPerTb(std::boxed::Box<crate::model::instance::IOPSPerTB>),
2373            /// Choose a fixed provisioned IOPS value for the instance, which will
2374            /// remain constant regardless of instance capacity. Value must be a
2375            /// multiple of 1000.
2376            ///
2377            /// If the chosen value is outside the supported range for the instance's
2378            /// capacity during instance creation, instance creation will fail with an
2379            /// `InvalidArgument` error. Similarly, if an instance capacity update
2380            /// would result in a value outside the supported range, the update will
2381            /// fail with an `InvalidArgument` error.
2382            FixedIops(std::boxed::Box<crate::model::instance::FixedIOPS>),
2383        }
2384    }
2385
2386    /// The enforced performance limits, calculated from the instance's performance
2387    /// configuration.
2388    #[derive(Clone, Default, PartialEq)]
2389    #[non_exhaustive]
2390    pub struct PerformanceLimits {
2391        /// Output only. The max IOPS.
2392        pub max_iops: i64,
2393
2394        /// Output only. The max read IOPS.
2395        pub max_read_iops: i64,
2396
2397        /// Output only. The max write IOPS.
2398        pub max_write_iops: i64,
2399
2400        /// Output only. The max read throughput in bytes per second.
2401        pub max_read_throughput_bps: i64,
2402
2403        /// Output only. The max write throughput in bytes per second.
2404        pub max_write_throughput_bps: i64,
2405
2406        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2407    }
2408
2409    impl PerformanceLimits {
2410        /// Creates a new default instance.
2411        pub fn new() -> Self {
2412            std::default::Default::default()
2413        }
2414
2415        /// Sets the value of [max_iops][crate::model::instance::PerformanceLimits::max_iops].
2416        ///
2417        /// # Example
2418        /// ```ignore,no_run
2419        /// # use google_cloud_filestore_v1::model::instance::PerformanceLimits;
2420        /// let x = PerformanceLimits::new().set_max_iops(42);
2421        /// ```
2422        pub fn set_max_iops<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2423            self.max_iops = v.into();
2424            self
2425        }
2426
2427        /// Sets the value of [max_read_iops][crate::model::instance::PerformanceLimits::max_read_iops].
2428        ///
2429        /// # Example
2430        /// ```ignore,no_run
2431        /// # use google_cloud_filestore_v1::model::instance::PerformanceLimits;
2432        /// let x = PerformanceLimits::new().set_max_read_iops(42);
2433        /// ```
2434        pub fn set_max_read_iops<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2435            self.max_read_iops = v.into();
2436            self
2437        }
2438
2439        /// Sets the value of [max_write_iops][crate::model::instance::PerformanceLimits::max_write_iops].
2440        ///
2441        /// # Example
2442        /// ```ignore,no_run
2443        /// # use google_cloud_filestore_v1::model::instance::PerformanceLimits;
2444        /// let x = PerformanceLimits::new().set_max_write_iops(42);
2445        /// ```
2446        pub fn set_max_write_iops<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2447            self.max_write_iops = v.into();
2448            self
2449        }
2450
2451        /// Sets the value of [max_read_throughput_bps][crate::model::instance::PerformanceLimits::max_read_throughput_bps].
2452        ///
2453        /// # Example
2454        /// ```ignore,no_run
2455        /// # use google_cloud_filestore_v1::model::instance::PerformanceLimits;
2456        /// let x = PerformanceLimits::new().set_max_read_throughput_bps(42);
2457        /// ```
2458        pub fn set_max_read_throughput_bps<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2459            self.max_read_throughput_bps = v.into();
2460            self
2461        }
2462
2463        /// Sets the value of [max_write_throughput_bps][crate::model::instance::PerformanceLimits::max_write_throughput_bps].
2464        ///
2465        /// # Example
2466        /// ```ignore,no_run
2467        /// # use google_cloud_filestore_v1::model::instance::PerformanceLimits;
2468        /// let x = PerformanceLimits::new().set_max_write_throughput_bps(42);
2469        /// ```
2470        pub fn set_max_write_throughput_bps<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
2471            self.max_write_throughput_bps = v.into();
2472            self
2473        }
2474    }
2475
2476    impl wkt::message::Message for PerformanceLimits {
2477        fn typename() -> &'static str {
2478            "type.googleapis.com/google.cloud.filestore.v1.Instance.PerformanceLimits"
2479        }
2480    }
2481
2482    /// The instance state.
2483    ///
2484    /// # Working with unknown values
2485    ///
2486    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2487    /// additional enum variants at any time. Adding new variants is not considered
2488    /// a breaking change. Applications should write their code in anticipation of:
2489    ///
2490    /// - New values appearing in future releases of the client library, **and**
2491    /// - New values received dynamically, without application changes.
2492    ///
2493    /// Please consult the [Working with enums] section in the user guide for some
2494    /// guidelines.
2495    ///
2496    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2497    #[derive(Clone, Debug, PartialEq)]
2498    #[non_exhaustive]
2499    pub enum State {
2500        /// State not set.
2501        Unspecified,
2502        /// The instance is being created.
2503        Creating,
2504        /// The instance is available for use.
2505        Ready,
2506        /// Work is being done on the instance. You can get further details from the
2507        /// `statusMessage` field of the `Instance` resource.
2508        Repairing,
2509        /// The instance is shutting down.
2510        Deleting,
2511        /// The instance is experiencing an issue and might be unusable. You can get
2512        /// further details from the `statusMessage` field of the `Instance`
2513        /// resource.
2514        Error,
2515        /// The instance is restoring a backup to an existing file share and may be
2516        /// unusable during this time.
2517        Restoring,
2518        /// The instance is suspended. You can get further details from
2519        /// the `suspension_reasons` field of the `Instance` resource.
2520        Suspended,
2521        /// The instance is in the process of becoming suspended.
2522        Suspending,
2523        /// The instance is in the process of becoming active.
2524        Resuming,
2525        /// The instance is reverting to a snapshot.
2526        Reverting,
2527        /// The replica instance is being promoted.
2528        Promoting,
2529        /// If set, the enum was initialized with an unknown value.
2530        ///
2531        /// Applications can examine the value using [State::value] or
2532        /// [State::name].
2533        UnknownValue(state::UnknownValue),
2534    }
2535
2536    #[doc(hidden)]
2537    pub mod state {
2538        #[allow(unused_imports)]
2539        use super::*;
2540        #[derive(Clone, Debug, PartialEq)]
2541        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2542    }
2543
2544    impl State {
2545        /// Gets the enum value.
2546        ///
2547        /// Returns `None` if the enum contains an unknown value deserialized from
2548        /// the string representation of enums.
2549        pub fn value(&self) -> std::option::Option<i32> {
2550            match self {
2551                Self::Unspecified => std::option::Option::Some(0),
2552                Self::Creating => std::option::Option::Some(1),
2553                Self::Ready => std::option::Option::Some(2),
2554                Self::Repairing => std::option::Option::Some(3),
2555                Self::Deleting => std::option::Option::Some(4),
2556                Self::Error => std::option::Option::Some(6),
2557                Self::Restoring => std::option::Option::Some(7),
2558                Self::Suspended => std::option::Option::Some(8),
2559                Self::Suspending => std::option::Option::Some(9),
2560                Self::Resuming => std::option::Option::Some(10),
2561                Self::Reverting => std::option::Option::Some(12),
2562                Self::Promoting => std::option::Option::Some(13),
2563                Self::UnknownValue(u) => u.0.value(),
2564            }
2565        }
2566
2567        /// Gets the enum value as a string.
2568        ///
2569        /// Returns `None` if the enum contains an unknown value deserialized from
2570        /// the integer representation of enums.
2571        pub fn name(&self) -> std::option::Option<&str> {
2572            match self {
2573                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2574                Self::Creating => std::option::Option::Some("CREATING"),
2575                Self::Ready => std::option::Option::Some("READY"),
2576                Self::Repairing => std::option::Option::Some("REPAIRING"),
2577                Self::Deleting => std::option::Option::Some("DELETING"),
2578                Self::Error => std::option::Option::Some("ERROR"),
2579                Self::Restoring => std::option::Option::Some("RESTORING"),
2580                Self::Suspended => std::option::Option::Some("SUSPENDED"),
2581                Self::Suspending => std::option::Option::Some("SUSPENDING"),
2582                Self::Resuming => std::option::Option::Some("RESUMING"),
2583                Self::Reverting => std::option::Option::Some("REVERTING"),
2584                Self::Promoting => std::option::Option::Some("PROMOTING"),
2585                Self::UnknownValue(u) => u.0.name(),
2586            }
2587        }
2588    }
2589
2590    impl std::default::Default for State {
2591        fn default() -> Self {
2592            use std::convert::From;
2593            Self::from(0)
2594        }
2595    }
2596
2597    impl std::fmt::Display for State {
2598        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2599            wkt::internal::display_enum(f, self.name(), self.value())
2600        }
2601    }
2602
2603    impl std::convert::From<i32> for State {
2604        fn from(value: i32) -> Self {
2605            match value {
2606                0 => Self::Unspecified,
2607                1 => Self::Creating,
2608                2 => Self::Ready,
2609                3 => Self::Repairing,
2610                4 => Self::Deleting,
2611                6 => Self::Error,
2612                7 => Self::Restoring,
2613                8 => Self::Suspended,
2614                9 => Self::Suspending,
2615                10 => Self::Resuming,
2616                12 => Self::Reverting,
2617                13 => Self::Promoting,
2618                _ => Self::UnknownValue(state::UnknownValue(
2619                    wkt::internal::UnknownEnumValue::Integer(value),
2620                )),
2621            }
2622        }
2623    }
2624
2625    impl std::convert::From<&str> for State {
2626        fn from(value: &str) -> Self {
2627            use std::string::ToString;
2628            match value {
2629                "STATE_UNSPECIFIED" => Self::Unspecified,
2630                "CREATING" => Self::Creating,
2631                "READY" => Self::Ready,
2632                "REPAIRING" => Self::Repairing,
2633                "DELETING" => Self::Deleting,
2634                "ERROR" => Self::Error,
2635                "RESTORING" => Self::Restoring,
2636                "SUSPENDED" => Self::Suspended,
2637                "SUSPENDING" => Self::Suspending,
2638                "RESUMING" => Self::Resuming,
2639                "REVERTING" => Self::Reverting,
2640                "PROMOTING" => Self::Promoting,
2641                _ => Self::UnknownValue(state::UnknownValue(
2642                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2643                )),
2644            }
2645        }
2646    }
2647
2648    impl serde::ser::Serialize for State {
2649        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2650        where
2651            S: serde::Serializer,
2652        {
2653            match self {
2654                Self::Unspecified => serializer.serialize_i32(0),
2655                Self::Creating => serializer.serialize_i32(1),
2656                Self::Ready => serializer.serialize_i32(2),
2657                Self::Repairing => serializer.serialize_i32(3),
2658                Self::Deleting => serializer.serialize_i32(4),
2659                Self::Error => serializer.serialize_i32(6),
2660                Self::Restoring => serializer.serialize_i32(7),
2661                Self::Suspended => serializer.serialize_i32(8),
2662                Self::Suspending => serializer.serialize_i32(9),
2663                Self::Resuming => serializer.serialize_i32(10),
2664                Self::Reverting => serializer.serialize_i32(12),
2665                Self::Promoting => serializer.serialize_i32(13),
2666                Self::UnknownValue(u) => u.0.serialize(serializer),
2667            }
2668        }
2669    }
2670
2671    impl<'de> serde::de::Deserialize<'de> for State {
2672        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2673        where
2674            D: serde::Deserializer<'de>,
2675        {
2676            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2677                ".google.cloud.filestore.v1.Instance.State",
2678            ))
2679        }
2680    }
2681
2682    /// Available service tiers.
2683    ///
2684    /// # Working with unknown values
2685    ///
2686    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2687    /// additional enum variants at any time. Adding new variants is not considered
2688    /// a breaking change. Applications should write their code in anticipation of:
2689    ///
2690    /// - New values appearing in future releases of the client library, **and**
2691    /// - New values received dynamically, without application changes.
2692    ///
2693    /// Please consult the [Working with enums] section in the user guide for some
2694    /// guidelines.
2695    ///
2696    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2697    #[derive(Clone, Debug, PartialEq)]
2698    #[non_exhaustive]
2699    pub enum Tier {
2700        /// Not set.
2701        Unspecified,
2702        /// STANDARD tier. BASIC_HDD is the preferred term for this tier.
2703        Standard,
2704        /// PREMIUM tier. BASIC_SSD is the preferred term for this tier.
2705        Premium,
2706        /// BASIC instances offer a maximum capacity of 63.9 TB.
2707        /// BASIC_HDD is an alias for STANDARD Tier, offering economical
2708        /// performance backed by HDD.
2709        BasicHdd,
2710        /// BASIC instances offer a maximum capacity of 63.9 TB.
2711        /// BASIC_SSD is an alias for PREMIUM Tier, and offers improved
2712        /// performance backed by SSD.
2713        BasicSsd,
2714        /// HIGH_SCALE instances offer expanded capacity and performance scaling
2715        /// capabilities.
2716        HighScaleSsd,
2717        /// ENTERPRISE instances offer the features and availability needed for
2718        /// mission-critical workloads.
2719        Enterprise,
2720        /// ZONAL instances offer expanded capacity and performance scaling
2721        /// capabilities.
2722        Zonal,
2723        /// REGIONAL instances offer the features and availability needed for
2724        /// mission-critical workloads.
2725        Regional,
2726        /// If set, the enum was initialized with an unknown value.
2727        ///
2728        /// Applications can examine the value using [Tier::value] or
2729        /// [Tier::name].
2730        UnknownValue(tier::UnknownValue),
2731    }
2732
2733    #[doc(hidden)]
2734    pub mod tier {
2735        #[allow(unused_imports)]
2736        use super::*;
2737        #[derive(Clone, Debug, PartialEq)]
2738        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2739    }
2740
2741    impl Tier {
2742        /// Gets the enum value.
2743        ///
2744        /// Returns `None` if the enum contains an unknown value deserialized from
2745        /// the string representation of enums.
2746        pub fn value(&self) -> std::option::Option<i32> {
2747            match self {
2748                Self::Unspecified => std::option::Option::Some(0),
2749                Self::Standard => std::option::Option::Some(1),
2750                Self::Premium => std::option::Option::Some(2),
2751                Self::BasicHdd => std::option::Option::Some(3),
2752                Self::BasicSsd => std::option::Option::Some(4),
2753                Self::HighScaleSsd => std::option::Option::Some(5),
2754                Self::Enterprise => std::option::Option::Some(6),
2755                Self::Zonal => std::option::Option::Some(7),
2756                Self::Regional => std::option::Option::Some(8),
2757                Self::UnknownValue(u) => u.0.value(),
2758            }
2759        }
2760
2761        /// Gets the enum value as a string.
2762        ///
2763        /// Returns `None` if the enum contains an unknown value deserialized from
2764        /// the integer representation of enums.
2765        pub fn name(&self) -> std::option::Option<&str> {
2766            match self {
2767                Self::Unspecified => std::option::Option::Some("TIER_UNSPECIFIED"),
2768                Self::Standard => std::option::Option::Some("STANDARD"),
2769                Self::Premium => std::option::Option::Some("PREMIUM"),
2770                Self::BasicHdd => std::option::Option::Some("BASIC_HDD"),
2771                Self::BasicSsd => std::option::Option::Some("BASIC_SSD"),
2772                Self::HighScaleSsd => std::option::Option::Some("HIGH_SCALE_SSD"),
2773                Self::Enterprise => std::option::Option::Some("ENTERPRISE"),
2774                Self::Zonal => std::option::Option::Some("ZONAL"),
2775                Self::Regional => std::option::Option::Some("REGIONAL"),
2776                Self::UnknownValue(u) => u.0.name(),
2777            }
2778        }
2779    }
2780
2781    impl std::default::Default for Tier {
2782        fn default() -> Self {
2783            use std::convert::From;
2784            Self::from(0)
2785        }
2786    }
2787
2788    impl std::fmt::Display for Tier {
2789        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2790            wkt::internal::display_enum(f, self.name(), self.value())
2791        }
2792    }
2793
2794    impl std::convert::From<i32> for Tier {
2795        fn from(value: i32) -> Self {
2796            match value {
2797                0 => Self::Unspecified,
2798                1 => Self::Standard,
2799                2 => Self::Premium,
2800                3 => Self::BasicHdd,
2801                4 => Self::BasicSsd,
2802                5 => Self::HighScaleSsd,
2803                6 => Self::Enterprise,
2804                7 => Self::Zonal,
2805                8 => Self::Regional,
2806                _ => Self::UnknownValue(tier::UnknownValue(
2807                    wkt::internal::UnknownEnumValue::Integer(value),
2808                )),
2809            }
2810        }
2811    }
2812
2813    impl std::convert::From<&str> for Tier {
2814        fn from(value: &str) -> Self {
2815            use std::string::ToString;
2816            match value {
2817                "TIER_UNSPECIFIED" => Self::Unspecified,
2818                "STANDARD" => Self::Standard,
2819                "PREMIUM" => Self::Premium,
2820                "BASIC_HDD" => Self::BasicHdd,
2821                "BASIC_SSD" => Self::BasicSsd,
2822                "HIGH_SCALE_SSD" => Self::HighScaleSsd,
2823                "ENTERPRISE" => Self::Enterprise,
2824                "ZONAL" => Self::Zonal,
2825                "REGIONAL" => Self::Regional,
2826                _ => Self::UnknownValue(tier::UnknownValue(
2827                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2828                )),
2829            }
2830        }
2831    }
2832
2833    impl serde::ser::Serialize for Tier {
2834        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2835        where
2836            S: serde::Serializer,
2837        {
2838            match self {
2839                Self::Unspecified => serializer.serialize_i32(0),
2840                Self::Standard => serializer.serialize_i32(1),
2841                Self::Premium => serializer.serialize_i32(2),
2842                Self::BasicHdd => serializer.serialize_i32(3),
2843                Self::BasicSsd => serializer.serialize_i32(4),
2844                Self::HighScaleSsd => serializer.serialize_i32(5),
2845                Self::Enterprise => serializer.serialize_i32(6),
2846                Self::Zonal => serializer.serialize_i32(7),
2847                Self::Regional => serializer.serialize_i32(8),
2848                Self::UnknownValue(u) => u.0.serialize(serializer),
2849            }
2850        }
2851    }
2852
2853    impl<'de> serde::de::Deserialize<'de> for Tier {
2854        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2855        where
2856            D: serde::Deserializer<'de>,
2857        {
2858            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Tier>::new(
2859                ".google.cloud.filestore.v1.Instance.Tier",
2860            ))
2861        }
2862    }
2863
2864    /// SuspensionReason contains the possible reasons for a suspension.
2865    ///
2866    /// # Working with unknown values
2867    ///
2868    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2869    /// additional enum variants at any time. Adding new variants is not considered
2870    /// a breaking change. Applications should write their code in anticipation of:
2871    ///
2872    /// - New values appearing in future releases of the client library, **and**
2873    /// - New values received dynamically, without application changes.
2874    ///
2875    /// Please consult the [Working with enums] section in the user guide for some
2876    /// guidelines.
2877    ///
2878    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2879    #[derive(Clone, Debug, PartialEq)]
2880    #[non_exhaustive]
2881    pub enum SuspensionReason {
2882        /// Not set.
2883        Unspecified,
2884        /// The KMS key used by the instance is either revoked or denied access to.
2885        KmsKeyIssue,
2886        /// If set, the enum was initialized with an unknown value.
2887        ///
2888        /// Applications can examine the value using [SuspensionReason::value] or
2889        /// [SuspensionReason::name].
2890        UnknownValue(suspension_reason::UnknownValue),
2891    }
2892
2893    #[doc(hidden)]
2894    pub mod suspension_reason {
2895        #[allow(unused_imports)]
2896        use super::*;
2897        #[derive(Clone, Debug, PartialEq)]
2898        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2899    }
2900
2901    impl SuspensionReason {
2902        /// Gets the enum value.
2903        ///
2904        /// Returns `None` if the enum contains an unknown value deserialized from
2905        /// the string representation of enums.
2906        pub fn value(&self) -> std::option::Option<i32> {
2907            match self {
2908                Self::Unspecified => std::option::Option::Some(0),
2909                Self::KmsKeyIssue => std::option::Option::Some(1),
2910                Self::UnknownValue(u) => u.0.value(),
2911            }
2912        }
2913
2914        /// Gets the enum value as a string.
2915        ///
2916        /// Returns `None` if the enum contains an unknown value deserialized from
2917        /// the integer representation of enums.
2918        pub fn name(&self) -> std::option::Option<&str> {
2919            match self {
2920                Self::Unspecified => std::option::Option::Some("SUSPENSION_REASON_UNSPECIFIED"),
2921                Self::KmsKeyIssue => std::option::Option::Some("KMS_KEY_ISSUE"),
2922                Self::UnknownValue(u) => u.0.name(),
2923            }
2924        }
2925    }
2926
2927    impl std::default::Default for SuspensionReason {
2928        fn default() -> Self {
2929            use std::convert::From;
2930            Self::from(0)
2931        }
2932    }
2933
2934    impl std::fmt::Display for SuspensionReason {
2935        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2936            wkt::internal::display_enum(f, self.name(), self.value())
2937        }
2938    }
2939
2940    impl std::convert::From<i32> for SuspensionReason {
2941        fn from(value: i32) -> Self {
2942            match value {
2943                0 => Self::Unspecified,
2944                1 => Self::KmsKeyIssue,
2945                _ => Self::UnknownValue(suspension_reason::UnknownValue(
2946                    wkt::internal::UnknownEnumValue::Integer(value),
2947                )),
2948            }
2949        }
2950    }
2951
2952    impl std::convert::From<&str> for SuspensionReason {
2953        fn from(value: &str) -> Self {
2954            use std::string::ToString;
2955            match value {
2956                "SUSPENSION_REASON_UNSPECIFIED" => Self::Unspecified,
2957                "KMS_KEY_ISSUE" => Self::KmsKeyIssue,
2958                _ => Self::UnknownValue(suspension_reason::UnknownValue(
2959                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2960                )),
2961            }
2962        }
2963    }
2964
2965    impl serde::ser::Serialize for SuspensionReason {
2966        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2967        where
2968            S: serde::Serializer,
2969        {
2970            match self {
2971                Self::Unspecified => serializer.serialize_i32(0),
2972                Self::KmsKeyIssue => serializer.serialize_i32(1),
2973                Self::UnknownValue(u) => u.0.serialize(serializer),
2974            }
2975        }
2976    }
2977
2978    impl<'de> serde::de::Deserialize<'de> for SuspensionReason {
2979        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2980        where
2981            D: serde::Deserializer<'de>,
2982        {
2983            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SuspensionReason>::new(
2984                ".google.cloud.filestore.v1.Instance.SuspensionReason",
2985            ))
2986        }
2987    }
2988
2989    /// File access protocol.
2990    ///
2991    /// # Working with unknown values
2992    ///
2993    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2994    /// additional enum variants at any time. Adding new variants is not considered
2995    /// a breaking change. Applications should write their code in anticipation of:
2996    ///
2997    /// - New values appearing in future releases of the client library, **and**
2998    /// - New values received dynamically, without application changes.
2999    ///
3000    /// Please consult the [Working with enums] section in the user guide for some
3001    /// guidelines.
3002    ///
3003    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3004    #[derive(Clone, Debug, PartialEq)]
3005    #[non_exhaustive]
3006    pub enum FileProtocol {
3007        /// FILE_PROTOCOL_UNSPECIFIED serves a "not set" default value when
3008        /// a FileProtocol is a separate field in a message.
3009        Unspecified,
3010        /// NFS 3.0.
3011        NfsV3,
3012        /// NFS 4.1.
3013        NfsV41,
3014        /// If set, the enum was initialized with an unknown value.
3015        ///
3016        /// Applications can examine the value using [FileProtocol::value] or
3017        /// [FileProtocol::name].
3018        UnknownValue(file_protocol::UnknownValue),
3019    }
3020
3021    #[doc(hidden)]
3022    pub mod file_protocol {
3023        #[allow(unused_imports)]
3024        use super::*;
3025        #[derive(Clone, Debug, PartialEq)]
3026        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3027    }
3028
3029    impl FileProtocol {
3030        /// Gets the enum value.
3031        ///
3032        /// Returns `None` if the enum contains an unknown value deserialized from
3033        /// the string representation of enums.
3034        pub fn value(&self) -> std::option::Option<i32> {
3035            match self {
3036                Self::Unspecified => std::option::Option::Some(0),
3037                Self::NfsV3 => std::option::Option::Some(1),
3038                Self::NfsV41 => std::option::Option::Some(2),
3039                Self::UnknownValue(u) => u.0.value(),
3040            }
3041        }
3042
3043        /// Gets the enum value as a string.
3044        ///
3045        /// Returns `None` if the enum contains an unknown value deserialized from
3046        /// the integer representation of enums.
3047        pub fn name(&self) -> std::option::Option<&str> {
3048            match self {
3049                Self::Unspecified => std::option::Option::Some("FILE_PROTOCOL_UNSPECIFIED"),
3050                Self::NfsV3 => std::option::Option::Some("NFS_V3"),
3051                Self::NfsV41 => std::option::Option::Some("NFS_V4_1"),
3052                Self::UnknownValue(u) => u.0.name(),
3053            }
3054        }
3055    }
3056
3057    impl std::default::Default for FileProtocol {
3058        fn default() -> Self {
3059            use std::convert::From;
3060            Self::from(0)
3061        }
3062    }
3063
3064    impl std::fmt::Display for FileProtocol {
3065        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3066            wkt::internal::display_enum(f, self.name(), self.value())
3067        }
3068    }
3069
3070    impl std::convert::From<i32> for FileProtocol {
3071        fn from(value: i32) -> Self {
3072            match value {
3073                0 => Self::Unspecified,
3074                1 => Self::NfsV3,
3075                2 => Self::NfsV41,
3076                _ => Self::UnknownValue(file_protocol::UnknownValue(
3077                    wkt::internal::UnknownEnumValue::Integer(value),
3078                )),
3079            }
3080        }
3081    }
3082
3083    impl std::convert::From<&str> for FileProtocol {
3084        fn from(value: &str) -> Self {
3085            use std::string::ToString;
3086            match value {
3087                "FILE_PROTOCOL_UNSPECIFIED" => Self::Unspecified,
3088                "NFS_V3" => Self::NfsV3,
3089                "NFS_V4_1" => Self::NfsV41,
3090                _ => Self::UnknownValue(file_protocol::UnknownValue(
3091                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3092                )),
3093            }
3094        }
3095    }
3096
3097    impl serde::ser::Serialize for FileProtocol {
3098        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3099        where
3100            S: serde::Serializer,
3101        {
3102            match self {
3103                Self::Unspecified => serializer.serialize_i32(0),
3104                Self::NfsV3 => serializer.serialize_i32(1),
3105                Self::NfsV41 => serializer.serialize_i32(2),
3106                Self::UnknownValue(u) => u.0.serialize(serializer),
3107            }
3108        }
3109    }
3110
3111    impl<'de> serde::de::Deserialize<'de> for FileProtocol {
3112        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3113        where
3114            D: serde::Deserializer<'de>,
3115        {
3116            deserializer.deserialize_any(wkt::internal::EnumVisitor::<FileProtocol>::new(
3117                ".google.cloud.filestore.v1.Instance.FileProtocol",
3118            ))
3119        }
3120    }
3121}
3122
3123/// CreateInstanceRequest creates an instance.
3124#[derive(Clone, Default, PartialEq)]
3125#[non_exhaustive]
3126pub struct CreateInstanceRequest {
3127    /// Required. The instance's project and location, in the format
3128    /// `projects/{project_id}/locations/{location}`. In Filestore,
3129    /// locations map to Google Cloud zones, for example **us-west1-b**.
3130    pub parent: std::string::String,
3131
3132    /// Required. The name of the instance to create.
3133    /// The name must be unique for the specified project and location.
3134    pub instance_id: std::string::String,
3135
3136    /// Required. An [instance resource][google.cloud.filestore.v1.Instance]
3137    ///
3138    /// [google.cloud.filestore.v1.Instance]: crate::model::Instance
3139    pub instance: std::option::Option<crate::model::Instance>,
3140
3141    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3142}
3143
3144impl CreateInstanceRequest {
3145    /// Creates a new default instance.
3146    pub fn new() -> Self {
3147        std::default::Default::default()
3148    }
3149
3150    /// Sets the value of [parent][crate::model::CreateInstanceRequest::parent].
3151    ///
3152    /// # Example
3153    /// ```ignore,no_run
3154    /// # use google_cloud_filestore_v1::model::CreateInstanceRequest;
3155    /// let x = CreateInstanceRequest::new().set_parent("example");
3156    /// ```
3157    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3158        self.parent = v.into();
3159        self
3160    }
3161
3162    /// Sets the value of [instance_id][crate::model::CreateInstanceRequest::instance_id].
3163    ///
3164    /// # Example
3165    /// ```ignore,no_run
3166    /// # use google_cloud_filestore_v1::model::CreateInstanceRequest;
3167    /// let x = CreateInstanceRequest::new().set_instance_id("example");
3168    /// ```
3169    pub fn set_instance_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3170        self.instance_id = v.into();
3171        self
3172    }
3173
3174    /// Sets the value of [instance][crate::model::CreateInstanceRequest::instance].
3175    ///
3176    /// # Example
3177    /// ```ignore,no_run
3178    /// # use google_cloud_filestore_v1::model::CreateInstanceRequest;
3179    /// use google_cloud_filestore_v1::model::Instance;
3180    /// let x = CreateInstanceRequest::new().set_instance(Instance::default()/* use setters */);
3181    /// ```
3182    pub fn set_instance<T>(mut self, v: T) -> Self
3183    where
3184        T: std::convert::Into<crate::model::Instance>,
3185    {
3186        self.instance = std::option::Option::Some(v.into());
3187        self
3188    }
3189
3190    /// Sets or clears the value of [instance][crate::model::CreateInstanceRequest::instance].
3191    ///
3192    /// # Example
3193    /// ```ignore,no_run
3194    /// # use google_cloud_filestore_v1::model::CreateInstanceRequest;
3195    /// use google_cloud_filestore_v1::model::Instance;
3196    /// let x = CreateInstanceRequest::new().set_or_clear_instance(Some(Instance::default()/* use setters */));
3197    /// let x = CreateInstanceRequest::new().set_or_clear_instance(None::<Instance>);
3198    /// ```
3199    pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
3200    where
3201        T: std::convert::Into<crate::model::Instance>,
3202    {
3203        self.instance = v.map(|x| x.into());
3204        self
3205    }
3206}
3207
3208impl wkt::message::Message for CreateInstanceRequest {
3209    fn typename() -> &'static str {
3210        "type.googleapis.com/google.cloud.filestore.v1.CreateInstanceRequest"
3211    }
3212}
3213
3214/// GetInstanceRequest gets the state of an instance.
3215#[derive(Clone, Default, PartialEq)]
3216#[non_exhaustive]
3217pub struct GetInstanceRequest {
3218    /// Required. The instance resource name, in the format
3219    /// `projects/{project_id}/locations/{location}/instances/{instance_id}`.
3220    pub name: std::string::String,
3221
3222    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3223}
3224
3225impl GetInstanceRequest {
3226    /// Creates a new default instance.
3227    pub fn new() -> Self {
3228        std::default::Default::default()
3229    }
3230
3231    /// Sets the value of [name][crate::model::GetInstanceRequest::name].
3232    ///
3233    /// # Example
3234    /// ```ignore,no_run
3235    /// # use google_cloud_filestore_v1::model::GetInstanceRequest;
3236    /// let x = GetInstanceRequest::new().set_name("example");
3237    /// ```
3238    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3239        self.name = v.into();
3240        self
3241    }
3242}
3243
3244impl wkt::message::Message for GetInstanceRequest {
3245    fn typename() -> &'static str {
3246        "type.googleapis.com/google.cloud.filestore.v1.GetInstanceRequest"
3247    }
3248}
3249
3250/// UpdateInstanceRequest updates the settings of an instance.
3251#[derive(Clone, Default, PartialEq)]
3252#[non_exhaustive]
3253pub struct UpdateInstanceRequest {
3254    /// Mask of fields to update.  At least one path must be supplied in this
3255    /// field.  The elements of the repeated paths field may only include these
3256    /// fields:
3257    ///
3258    /// * "description"
3259    /// * "file_shares"
3260    /// * "labels"
3261    /// * "performance_config"
3262    /// * "deletion_protection_enabled"
3263    /// * "deletion_protection_reason"
3264    pub update_mask: std::option::Option<wkt::FieldMask>,
3265
3266    /// Only fields specified in update_mask are updated.
3267    pub instance: std::option::Option<crate::model::Instance>,
3268
3269    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3270}
3271
3272impl UpdateInstanceRequest {
3273    /// Creates a new default instance.
3274    pub fn new() -> Self {
3275        std::default::Default::default()
3276    }
3277
3278    /// Sets the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
3279    ///
3280    /// # Example
3281    /// ```ignore,no_run
3282    /// # use google_cloud_filestore_v1::model::UpdateInstanceRequest;
3283    /// use wkt::FieldMask;
3284    /// let x = UpdateInstanceRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3285    /// ```
3286    pub fn set_update_mask<T>(mut self, v: T) -> Self
3287    where
3288        T: std::convert::Into<wkt::FieldMask>,
3289    {
3290        self.update_mask = std::option::Option::Some(v.into());
3291        self
3292    }
3293
3294    /// Sets or clears the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
3295    ///
3296    /// # Example
3297    /// ```ignore,no_run
3298    /// # use google_cloud_filestore_v1::model::UpdateInstanceRequest;
3299    /// use wkt::FieldMask;
3300    /// let x = UpdateInstanceRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3301    /// let x = UpdateInstanceRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3302    /// ```
3303    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3304    where
3305        T: std::convert::Into<wkt::FieldMask>,
3306    {
3307        self.update_mask = v.map(|x| x.into());
3308        self
3309    }
3310
3311    /// Sets the value of [instance][crate::model::UpdateInstanceRequest::instance].
3312    ///
3313    /// # Example
3314    /// ```ignore,no_run
3315    /// # use google_cloud_filestore_v1::model::UpdateInstanceRequest;
3316    /// use google_cloud_filestore_v1::model::Instance;
3317    /// let x = UpdateInstanceRequest::new().set_instance(Instance::default()/* use setters */);
3318    /// ```
3319    pub fn set_instance<T>(mut self, v: T) -> Self
3320    where
3321        T: std::convert::Into<crate::model::Instance>,
3322    {
3323        self.instance = std::option::Option::Some(v.into());
3324        self
3325    }
3326
3327    /// Sets or clears the value of [instance][crate::model::UpdateInstanceRequest::instance].
3328    ///
3329    /// # Example
3330    /// ```ignore,no_run
3331    /// # use google_cloud_filestore_v1::model::UpdateInstanceRequest;
3332    /// use google_cloud_filestore_v1::model::Instance;
3333    /// let x = UpdateInstanceRequest::new().set_or_clear_instance(Some(Instance::default()/* use setters */));
3334    /// let x = UpdateInstanceRequest::new().set_or_clear_instance(None::<Instance>);
3335    /// ```
3336    pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
3337    where
3338        T: std::convert::Into<crate::model::Instance>,
3339    {
3340        self.instance = v.map(|x| x.into());
3341        self
3342    }
3343}
3344
3345impl wkt::message::Message for UpdateInstanceRequest {
3346    fn typename() -> &'static str {
3347        "type.googleapis.com/google.cloud.filestore.v1.UpdateInstanceRequest"
3348    }
3349}
3350
3351/// RestoreInstanceRequest restores an existing instance's file share from a
3352/// backup.
3353#[derive(Clone, Default, PartialEq)]
3354#[non_exhaustive]
3355pub struct RestoreInstanceRequest {
3356    /// Required. The resource name of the instance, in the format
3357    /// `projects/{project_number}/locations/{location_id}/instances/{instance_id}`.
3358    pub name: std::string::String,
3359
3360    /// Required. Name of the file share in the Filestore instance that the backup
3361    /// is being restored to.
3362    pub file_share: std::string::String,
3363
3364    #[allow(missing_docs)]
3365    pub source: std::option::Option<crate::model::restore_instance_request::Source>,
3366
3367    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3368}
3369
3370impl RestoreInstanceRequest {
3371    /// Creates a new default instance.
3372    pub fn new() -> Self {
3373        std::default::Default::default()
3374    }
3375
3376    /// Sets the value of [name][crate::model::RestoreInstanceRequest::name].
3377    ///
3378    /// # Example
3379    /// ```ignore,no_run
3380    /// # use google_cloud_filestore_v1::model::RestoreInstanceRequest;
3381    /// let x = RestoreInstanceRequest::new().set_name("example");
3382    /// ```
3383    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3384        self.name = v.into();
3385        self
3386    }
3387
3388    /// Sets the value of [file_share][crate::model::RestoreInstanceRequest::file_share].
3389    ///
3390    /// # Example
3391    /// ```ignore,no_run
3392    /// # use google_cloud_filestore_v1::model::RestoreInstanceRequest;
3393    /// let x = RestoreInstanceRequest::new().set_file_share("example");
3394    /// ```
3395    pub fn set_file_share<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3396        self.file_share = v.into();
3397        self
3398    }
3399
3400    /// Sets the value of [source][crate::model::RestoreInstanceRequest::source].
3401    ///
3402    /// Note that all the setters affecting `source` are mutually
3403    /// exclusive.
3404    ///
3405    /// # Example
3406    /// ```ignore,no_run
3407    /// # use google_cloud_filestore_v1::model::RestoreInstanceRequest;
3408    /// use google_cloud_filestore_v1::model::restore_instance_request::Source;
3409    /// let x = RestoreInstanceRequest::new().set_source(Some(Source::SourceBackup("example".to_string())));
3410    /// ```
3411    pub fn set_source<
3412        T: std::convert::Into<std::option::Option<crate::model::restore_instance_request::Source>>,
3413    >(
3414        mut self,
3415        v: T,
3416    ) -> Self {
3417        self.source = v.into();
3418        self
3419    }
3420
3421    /// The value of [source][crate::model::RestoreInstanceRequest::source]
3422    /// if it holds a `SourceBackup`, `None` if the field is not set or
3423    /// holds a different branch.
3424    pub fn source_backup(&self) -> std::option::Option<&std::string::String> {
3425        #[allow(unreachable_patterns)]
3426        self.source.as_ref().and_then(|v| match v {
3427            crate::model::restore_instance_request::Source::SourceBackup(v) => {
3428                std::option::Option::Some(v)
3429            }
3430            _ => std::option::Option::None,
3431        })
3432    }
3433
3434    /// Sets the value of [source][crate::model::RestoreInstanceRequest::source]
3435    /// to hold a `SourceBackup`.
3436    ///
3437    /// Note that all the setters affecting `source` are
3438    /// mutually exclusive.
3439    ///
3440    /// # Example
3441    /// ```ignore,no_run
3442    /// # use google_cloud_filestore_v1::model::RestoreInstanceRequest;
3443    /// let x = RestoreInstanceRequest::new().set_source_backup("example");
3444    /// assert!(x.source_backup().is_some());
3445    /// ```
3446    pub fn set_source_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3447        self.source = std::option::Option::Some(
3448            crate::model::restore_instance_request::Source::SourceBackup(v.into()),
3449        );
3450        self
3451    }
3452}
3453
3454impl wkt::message::Message for RestoreInstanceRequest {
3455    fn typename() -> &'static str {
3456        "type.googleapis.com/google.cloud.filestore.v1.RestoreInstanceRequest"
3457    }
3458}
3459
3460/// Defines additional types related to [RestoreInstanceRequest].
3461pub mod restore_instance_request {
3462    #[allow(unused_imports)]
3463    use super::*;
3464
3465    #[allow(missing_docs)]
3466    #[derive(Clone, Debug, PartialEq)]
3467    #[non_exhaustive]
3468    pub enum Source {
3469        /// The resource name of the backup, in the format
3470        /// `projects/{project_number}/locations/{location_id}/backups/{backup_id}`.
3471        SourceBackup(std::string::String),
3472    }
3473}
3474
3475/// RevertInstanceRequest reverts the given instance's file share to the
3476/// specified snapshot.
3477#[derive(Clone, Default, PartialEq)]
3478#[non_exhaustive]
3479pub struct RevertInstanceRequest {
3480    /// Required. The resource name of the instance, in the format
3481    /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`.
3482    pub name: std::string::String,
3483
3484    /// Required. The snapshot resource ID, in the format 'my-snapshot', where the
3485    /// specified ID is the {snapshot_id} of the fully qualified name like
3486    /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id}`
3487    pub target_snapshot_id: std::string::String,
3488
3489    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3490}
3491
3492impl RevertInstanceRequest {
3493    /// Creates a new default instance.
3494    pub fn new() -> Self {
3495        std::default::Default::default()
3496    }
3497
3498    /// Sets the value of [name][crate::model::RevertInstanceRequest::name].
3499    ///
3500    /// # Example
3501    /// ```ignore,no_run
3502    /// # use google_cloud_filestore_v1::model::RevertInstanceRequest;
3503    /// let x = RevertInstanceRequest::new().set_name("example");
3504    /// ```
3505    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3506        self.name = v.into();
3507        self
3508    }
3509
3510    /// Sets the value of [target_snapshot_id][crate::model::RevertInstanceRequest::target_snapshot_id].
3511    ///
3512    /// # Example
3513    /// ```ignore,no_run
3514    /// # use google_cloud_filestore_v1::model::RevertInstanceRequest;
3515    /// let x = RevertInstanceRequest::new().set_target_snapshot_id("example");
3516    /// ```
3517    pub fn set_target_snapshot_id<T: std::convert::Into<std::string::String>>(
3518        mut self,
3519        v: T,
3520    ) -> Self {
3521        self.target_snapshot_id = v.into();
3522        self
3523    }
3524}
3525
3526impl wkt::message::Message for RevertInstanceRequest {
3527    fn typename() -> &'static str {
3528        "type.googleapis.com/google.cloud.filestore.v1.RevertInstanceRequest"
3529    }
3530}
3531
3532/// DeleteInstanceRequest deletes an instance.
3533#[derive(Clone, Default, PartialEq)]
3534#[non_exhaustive]
3535pub struct DeleteInstanceRequest {
3536    /// Required. The instance resource name, in the format
3537    /// `projects/{project_id}/locations/{location}/instances/{instance_id}`
3538    pub name: std::string::String,
3539
3540    /// If set to true, all snapshots of the instance will also be deleted.
3541    /// (Otherwise, the request will only work if the instance has no snapshots.)
3542    pub force: bool,
3543
3544    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3545}
3546
3547impl DeleteInstanceRequest {
3548    /// Creates a new default instance.
3549    pub fn new() -> Self {
3550        std::default::Default::default()
3551    }
3552
3553    /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
3554    ///
3555    /// # Example
3556    /// ```ignore,no_run
3557    /// # use google_cloud_filestore_v1::model::DeleteInstanceRequest;
3558    /// let x = DeleteInstanceRequest::new().set_name("example");
3559    /// ```
3560    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3561        self.name = v.into();
3562        self
3563    }
3564
3565    /// Sets the value of [force][crate::model::DeleteInstanceRequest::force].
3566    ///
3567    /// # Example
3568    /// ```ignore,no_run
3569    /// # use google_cloud_filestore_v1::model::DeleteInstanceRequest;
3570    /// let x = DeleteInstanceRequest::new().set_force(true);
3571    /// ```
3572    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3573        self.force = v.into();
3574        self
3575    }
3576}
3577
3578impl wkt::message::Message for DeleteInstanceRequest {
3579    fn typename() -> &'static str {
3580        "type.googleapis.com/google.cloud.filestore.v1.DeleteInstanceRequest"
3581    }
3582}
3583
3584/// ListInstancesRequest lists instances.
3585#[derive(Clone, Default, PartialEq)]
3586#[non_exhaustive]
3587pub struct ListInstancesRequest {
3588    /// Required. The project and location for which to retrieve instance
3589    /// information, in the format `projects/{project_id}/locations/{location}`. In
3590    /// Cloud Filestore, locations map to Google Cloud zones, for example
3591    /// **us-west1-b**. To retrieve instance information for all locations, use "-"
3592    /// for the
3593    /// `{location}` value.
3594    pub parent: std::string::String,
3595
3596    /// The maximum number of items to return.
3597    pub page_size: i32,
3598
3599    /// The next_page_token value to use if there are additional
3600    /// results to retrieve for this list request.
3601    pub page_token: std::string::String,
3602
3603    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
3604    pub order_by: std::string::String,
3605
3606    /// List filter.
3607    pub filter: std::string::String,
3608
3609    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3610}
3611
3612impl ListInstancesRequest {
3613    /// Creates a new default instance.
3614    pub fn new() -> Self {
3615        std::default::Default::default()
3616    }
3617
3618    /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
3619    ///
3620    /// # Example
3621    /// ```ignore,no_run
3622    /// # use google_cloud_filestore_v1::model::ListInstancesRequest;
3623    /// let x = ListInstancesRequest::new().set_parent("example");
3624    /// ```
3625    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3626        self.parent = v.into();
3627        self
3628    }
3629
3630    /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
3631    ///
3632    /// # Example
3633    /// ```ignore,no_run
3634    /// # use google_cloud_filestore_v1::model::ListInstancesRequest;
3635    /// let x = ListInstancesRequest::new().set_page_size(42);
3636    /// ```
3637    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3638        self.page_size = v.into();
3639        self
3640    }
3641
3642    /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
3643    ///
3644    /// # Example
3645    /// ```ignore,no_run
3646    /// # use google_cloud_filestore_v1::model::ListInstancesRequest;
3647    /// let x = ListInstancesRequest::new().set_page_token("example");
3648    /// ```
3649    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3650        self.page_token = v.into();
3651        self
3652    }
3653
3654    /// Sets the value of [order_by][crate::model::ListInstancesRequest::order_by].
3655    ///
3656    /// # Example
3657    /// ```ignore,no_run
3658    /// # use google_cloud_filestore_v1::model::ListInstancesRequest;
3659    /// let x = ListInstancesRequest::new().set_order_by("example");
3660    /// ```
3661    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3662        self.order_by = v.into();
3663        self
3664    }
3665
3666    /// Sets the value of [filter][crate::model::ListInstancesRequest::filter].
3667    ///
3668    /// # Example
3669    /// ```ignore,no_run
3670    /// # use google_cloud_filestore_v1::model::ListInstancesRequest;
3671    /// let x = ListInstancesRequest::new().set_filter("example");
3672    /// ```
3673    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3674        self.filter = v.into();
3675        self
3676    }
3677}
3678
3679impl wkt::message::Message for ListInstancesRequest {
3680    fn typename() -> &'static str {
3681        "type.googleapis.com/google.cloud.filestore.v1.ListInstancesRequest"
3682    }
3683}
3684
3685/// ListInstancesResponse is the result of ListInstancesRequest.
3686#[derive(Clone, Default, PartialEq)]
3687#[non_exhaustive]
3688pub struct ListInstancesResponse {
3689    /// A list of instances in the project for the specified location.
3690    ///
3691    /// If the `{location}` value in the request is "-", the response contains a
3692    /// list of instances from all locations. If any location is unreachable, the
3693    /// response will only return instances in reachable locations and the
3694    /// "unreachable" field will be populated with a list of unreachable locations.
3695    pub instances: std::vec::Vec<crate::model::Instance>,
3696
3697    /// The token you can use to retrieve the next page of results. Not returned
3698    /// if there are no more results in the list.
3699    pub next_page_token: std::string::String,
3700
3701    /// Unordered list. Locations that could not be reached.
3702    pub unreachable: std::vec::Vec<std::string::String>,
3703
3704    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3705}
3706
3707impl ListInstancesResponse {
3708    /// Creates a new default instance.
3709    pub fn new() -> Self {
3710        std::default::Default::default()
3711    }
3712
3713    /// Sets the value of [instances][crate::model::ListInstancesResponse::instances].
3714    ///
3715    /// # Example
3716    /// ```ignore,no_run
3717    /// # use google_cloud_filestore_v1::model::ListInstancesResponse;
3718    /// use google_cloud_filestore_v1::model::Instance;
3719    /// let x = ListInstancesResponse::new()
3720    ///     .set_instances([
3721    ///         Instance::default()/* use setters */,
3722    ///         Instance::default()/* use (different) setters */,
3723    ///     ]);
3724    /// ```
3725    pub fn set_instances<T, V>(mut self, v: T) -> Self
3726    where
3727        T: std::iter::IntoIterator<Item = V>,
3728        V: std::convert::Into<crate::model::Instance>,
3729    {
3730        use std::iter::Iterator;
3731        self.instances = v.into_iter().map(|i| i.into()).collect();
3732        self
3733    }
3734
3735    /// Sets the value of [next_page_token][crate::model::ListInstancesResponse::next_page_token].
3736    ///
3737    /// # Example
3738    /// ```ignore,no_run
3739    /// # use google_cloud_filestore_v1::model::ListInstancesResponse;
3740    /// let x = ListInstancesResponse::new().set_next_page_token("example");
3741    /// ```
3742    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3743        self.next_page_token = v.into();
3744        self
3745    }
3746
3747    /// Sets the value of [unreachable][crate::model::ListInstancesResponse::unreachable].
3748    ///
3749    /// # Example
3750    /// ```ignore,no_run
3751    /// # use google_cloud_filestore_v1::model::ListInstancesResponse;
3752    /// let x = ListInstancesResponse::new().set_unreachable(["a", "b", "c"]);
3753    /// ```
3754    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3755    where
3756        T: std::iter::IntoIterator<Item = V>,
3757        V: std::convert::Into<std::string::String>,
3758    {
3759        use std::iter::Iterator;
3760        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3761        self
3762    }
3763}
3764
3765impl wkt::message::Message for ListInstancesResponse {
3766    fn typename() -> &'static str {
3767        "type.googleapis.com/google.cloud.filestore.v1.ListInstancesResponse"
3768    }
3769}
3770
3771#[doc(hidden)]
3772impl google_cloud_gax::paginator::internal::PageableResponse for ListInstancesResponse {
3773    type PageItem = crate::model::Instance;
3774
3775    fn items(self) -> std::vec::Vec<Self::PageItem> {
3776        self.instances
3777    }
3778
3779    fn next_page_token(&self) -> std::string::String {
3780        use std::clone::Clone;
3781        self.next_page_token.clone()
3782    }
3783}
3784
3785/// A Filestore snapshot.
3786#[derive(Clone, Default, PartialEq)]
3787#[non_exhaustive]
3788pub struct Snapshot {
3789    /// Output only. The resource name of the snapshot, in the format
3790    /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id}`.
3791    pub name: std::string::String,
3792
3793    /// A description of the snapshot with 2048 characters or less.
3794    /// Requests with longer descriptions will be rejected.
3795    pub description: std::string::String,
3796
3797    /// Output only. The snapshot state.
3798    pub state: crate::model::snapshot::State,
3799
3800    /// Output only. The time when the snapshot was created.
3801    pub create_time: std::option::Option<wkt::Timestamp>,
3802
3803    /// Resource labels to represent user provided metadata.
3804    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3805
3806    /// Output only. The amount of bytes needed to allocate a full copy of the
3807    /// snapshot content
3808    pub filesystem_used_bytes: i64,
3809
3810    /// Optional. Input only. Immutable. Tag key-value pairs bound to this
3811    /// resource. Each key must be a namespaced name and each value a short name.
3812    /// Example:
3813    /// "123456789012/environment" : "production",
3814    /// "123456789013/costCenter" : "marketing"
3815    /// See the documentation for more information:
3816    ///
3817    /// - Namespaced name:
3818    ///   <https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#retrieving_tag_key>
3819    /// - Short name:
3820    ///   <https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#retrieving_tag_value>
3821    pub tags: std::collections::HashMap<std::string::String, std::string::String>,
3822
3823    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3824}
3825
3826impl Snapshot {
3827    /// Creates a new default instance.
3828    pub fn new() -> Self {
3829        std::default::Default::default()
3830    }
3831
3832    /// Sets the value of [name][crate::model::Snapshot::name].
3833    ///
3834    /// # Example
3835    /// ```ignore,no_run
3836    /// # use google_cloud_filestore_v1::model::Snapshot;
3837    /// let x = Snapshot::new().set_name("example");
3838    /// ```
3839    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3840        self.name = v.into();
3841        self
3842    }
3843
3844    /// Sets the value of [description][crate::model::Snapshot::description].
3845    ///
3846    /// # Example
3847    /// ```ignore,no_run
3848    /// # use google_cloud_filestore_v1::model::Snapshot;
3849    /// let x = Snapshot::new().set_description("example");
3850    /// ```
3851    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3852        self.description = v.into();
3853        self
3854    }
3855
3856    /// Sets the value of [state][crate::model::Snapshot::state].
3857    ///
3858    /// # Example
3859    /// ```ignore,no_run
3860    /// # use google_cloud_filestore_v1::model::Snapshot;
3861    /// use google_cloud_filestore_v1::model::snapshot::State;
3862    /// let x0 = Snapshot::new().set_state(State::Creating);
3863    /// let x1 = Snapshot::new().set_state(State::Ready);
3864    /// let x2 = Snapshot::new().set_state(State::Deleting);
3865    /// ```
3866    pub fn set_state<T: std::convert::Into<crate::model::snapshot::State>>(mut self, v: T) -> Self {
3867        self.state = v.into();
3868        self
3869    }
3870
3871    /// Sets the value of [create_time][crate::model::Snapshot::create_time].
3872    ///
3873    /// # Example
3874    /// ```ignore,no_run
3875    /// # use google_cloud_filestore_v1::model::Snapshot;
3876    /// use wkt::Timestamp;
3877    /// let x = Snapshot::new().set_create_time(Timestamp::default()/* use setters */);
3878    /// ```
3879    pub fn set_create_time<T>(mut self, v: T) -> Self
3880    where
3881        T: std::convert::Into<wkt::Timestamp>,
3882    {
3883        self.create_time = std::option::Option::Some(v.into());
3884        self
3885    }
3886
3887    /// Sets or clears the value of [create_time][crate::model::Snapshot::create_time].
3888    ///
3889    /// # Example
3890    /// ```ignore,no_run
3891    /// # use google_cloud_filestore_v1::model::Snapshot;
3892    /// use wkt::Timestamp;
3893    /// let x = Snapshot::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3894    /// let x = Snapshot::new().set_or_clear_create_time(None::<Timestamp>);
3895    /// ```
3896    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3897    where
3898        T: std::convert::Into<wkt::Timestamp>,
3899    {
3900        self.create_time = v.map(|x| x.into());
3901        self
3902    }
3903
3904    /// Sets the value of [labels][crate::model::Snapshot::labels].
3905    ///
3906    /// # Example
3907    /// ```ignore,no_run
3908    /// # use google_cloud_filestore_v1::model::Snapshot;
3909    /// let x = Snapshot::new().set_labels([
3910    ///     ("key0", "abc"),
3911    ///     ("key1", "xyz"),
3912    /// ]);
3913    /// ```
3914    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3915    where
3916        T: std::iter::IntoIterator<Item = (K, V)>,
3917        K: std::convert::Into<std::string::String>,
3918        V: std::convert::Into<std::string::String>,
3919    {
3920        use std::iter::Iterator;
3921        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3922        self
3923    }
3924
3925    /// Sets the value of [filesystem_used_bytes][crate::model::Snapshot::filesystem_used_bytes].
3926    ///
3927    /// # Example
3928    /// ```ignore,no_run
3929    /// # use google_cloud_filestore_v1::model::Snapshot;
3930    /// let x = Snapshot::new().set_filesystem_used_bytes(42);
3931    /// ```
3932    pub fn set_filesystem_used_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3933        self.filesystem_used_bytes = v.into();
3934        self
3935    }
3936
3937    /// Sets the value of [tags][crate::model::Snapshot::tags].
3938    ///
3939    /// # Example
3940    /// ```ignore,no_run
3941    /// # use google_cloud_filestore_v1::model::Snapshot;
3942    /// let x = Snapshot::new().set_tags([
3943    ///     ("key0", "abc"),
3944    ///     ("key1", "xyz"),
3945    /// ]);
3946    /// ```
3947    pub fn set_tags<T, K, V>(mut self, v: T) -> Self
3948    where
3949        T: std::iter::IntoIterator<Item = (K, V)>,
3950        K: std::convert::Into<std::string::String>,
3951        V: std::convert::Into<std::string::String>,
3952    {
3953        use std::iter::Iterator;
3954        self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3955        self
3956    }
3957}
3958
3959impl wkt::message::Message for Snapshot {
3960    fn typename() -> &'static str {
3961        "type.googleapis.com/google.cloud.filestore.v1.Snapshot"
3962    }
3963}
3964
3965/// Defines additional types related to [Snapshot].
3966pub mod snapshot {
3967    #[allow(unused_imports)]
3968    use super::*;
3969
3970    /// The snapshot state.
3971    ///
3972    /// # Working with unknown values
3973    ///
3974    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3975    /// additional enum variants at any time. Adding new variants is not considered
3976    /// a breaking change. Applications should write their code in anticipation of:
3977    ///
3978    /// - New values appearing in future releases of the client library, **and**
3979    /// - New values received dynamically, without application changes.
3980    ///
3981    /// Please consult the [Working with enums] section in the user guide for some
3982    /// guidelines.
3983    ///
3984    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3985    #[derive(Clone, Debug, PartialEq)]
3986    #[non_exhaustive]
3987    pub enum State {
3988        /// State not set.
3989        Unspecified,
3990        /// Snapshot is being created.
3991        Creating,
3992        /// Snapshot is available for use.
3993        Ready,
3994        /// Snapshot is being deleted.
3995        Deleting,
3996        /// If set, the enum was initialized with an unknown value.
3997        ///
3998        /// Applications can examine the value using [State::value] or
3999        /// [State::name].
4000        UnknownValue(state::UnknownValue),
4001    }
4002
4003    #[doc(hidden)]
4004    pub mod state {
4005        #[allow(unused_imports)]
4006        use super::*;
4007        #[derive(Clone, Debug, PartialEq)]
4008        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4009    }
4010
4011    impl State {
4012        /// Gets the enum value.
4013        ///
4014        /// Returns `None` if the enum contains an unknown value deserialized from
4015        /// the string representation of enums.
4016        pub fn value(&self) -> std::option::Option<i32> {
4017            match self {
4018                Self::Unspecified => std::option::Option::Some(0),
4019                Self::Creating => std::option::Option::Some(1),
4020                Self::Ready => std::option::Option::Some(2),
4021                Self::Deleting => std::option::Option::Some(3),
4022                Self::UnknownValue(u) => u.0.value(),
4023            }
4024        }
4025
4026        /// Gets the enum value as a string.
4027        ///
4028        /// Returns `None` if the enum contains an unknown value deserialized from
4029        /// the integer representation of enums.
4030        pub fn name(&self) -> std::option::Option<&str> {
4031            match self {
4032                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
4033                Self::Creating => std::option::Option::Some("CREATING"),
4034                Self::Ready => std::option::Option::Some("READY"),
4035                Self::Deleting => std::option::Option::Some("DELETING"),
4036                Self::UnknownValue(u) => u.0.name(),
4037            }
4038        }
4039    }
4040
4041    impl std::default::Default for State {
4042        fn default() -> Self {
4043            use std::convert::From;
4044            Self::from(0)
4045        }
4046    }
4047
4048    impl std::fmt::Display for State {
4049        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4050            wkt::internal::display_enum(f, self.name(), self.value())
4051        }
4052    }
4053
4054    impl std::convert::From<i32> for State {
4055        fn from(value: i32) -> Self {
4056            match value {
4057                0 => Self::Unspecified,
4058                1 => Self::Creating,
4059                2 => Self::Ready,
4060                3 => Self::Deleting,
4061                _ => Self::UnknownValue(state::UnknownValue(
4062                    wkt::internal::UnknownEnumValue::Integer(value),
4063                )),
4064            }
4065        }
4066    }
4067
4068    impl std::convert::From<&str> for State {
4069        fn from(value: &str) -> Self {
4070            use std::string::ToString;
4071            match value {
4072                "STATE_UNSPECIFIED" => Self::Unspecified,
4073                "CREATING" => Self::Creating,
4074                "READY" => Self::Ready,
4075                "DELETING" => Self::Deleting,
4076                _ => Self::UnknownValue(state::UnknownValue(
4077                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4078                )),
4079            }
4080        }
4081    }
4082
4083    impl serde::ser::Serialize for State {
4084        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4085        where
4086            S: serde::Serializer,
4087        {
4088            match self {
4089                Self::Unspecified => serializer.serialize_i32(0),
4090                Self::Creating => serializer.serialize_i32(1),
4091                Self::Ready => serializer.serialize_i32(2),
4092                Self::Deleting => serializer.serialize_i32(3),
4093                Self::UnknownValue(u) => u.0.serialize(serializer),
4094            }
4095        }
4096    }
4097
4098    impl<'de> serde::de::Deserialize<'de> for State {
4099        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4100        where
4101            D: serde::Deserializer<'de>,
4102        {
4103            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
4104                ".google.cloud.filestore.v1.Snapshot.State",
4105            ))
4106        }
4107    }
4108}
4109
4110/// CreateSnapshotRequest creates a snapshot.
4111#[derive(Clone, Default, PartialEq)]
4112#[non_exhaustive]
4113pub struct CreateSnapshotRequest {
4114    /// Required. The Filestore Instance to create the snapshots of, in the format
4115    /// `projects/{project_id}/locations/{location}/instances/{instance_id}`
4116    pub parent: std::string::String,
4117
4118    /// Required. The ID to use for the snapshot.
4119    /// The ID must be unique within the specified instance.
4120    ///
4121    /// This value must start with a lowercase letter followed by up to 62
4122    /// lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
4123    pub snapshot_id: std::string::String,
4124
4125    /// Required. A snapshot resource.
4126    pub snapshot: std::option::Option<crate::model::Snapshot>,
4127
4128    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4129}
4130
4131impl CreateSnapshotRequest {
4132    /// Creates a new default instance.
4133    pub fn new() -> Self {
4134        std::default::Default::default()
4135    }
4136
4137    /// Sets the value of [parent][crate::model::CreateSnapshotRequest::parent].
4138    ///
4139    /// # Example
4140    /// ```ignore,no_run
4141    /// # use google_cloud_filestore_v1::model::CreateSnapshotRequest;
4142    /// let x = CreateSnapshotRequest::new().set_parent("example");
4143    /// ```
4144    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4145        self.parent = v.into();
4146        self
4147    }
4148
4149    /// Sets the value of [snapshot_id][crate::model::CreateSnapshotRequest::snapshot_id].
4150    ///
4151    /// # Example
4152    /// ```ignore,no_run
4153    /// # use google_cloud_filestore_v1::model::CreateSnapshotRequest;
4154    /// let x = CreateSnapshotRequest::new().set_snapshot_id("example");
4155    /// ```
4156    pub fn set_snapshot_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4157        self.snapshot_id = v.into();
4158        self
4159    }
4160
4161    /// Sets the value of [snapshot][crate::model::CreateSnapshotRequest::snapshot].
4162    ///
4163    /// # Example
4164    /// ```ignore,no_run
4165    /// # use google_cloud_filestore_v1::model::CreateSnapshotRequest;
4166    /// use google_cloud_filestore_v1::model::Snapshot;
4167    /// let x = CreateSnapshotRequest::new().set_snapshot(Snapshot::default()/* use setters */);
4168    /// ```
4169    pub fn set_snapshot<T>(mut self, v: T) -> Self
4170    where
4171        T: std::convert::Into<crate::model::Snapshot>,
4172    {
4173        self.snapshot = std::option::Option::Some(v.into());
4174        self
4175    }
4176
4177    /// Sets or clears the value of [snapshot][crate::model::CreateSnapshotRequest::snapshot].
4178    ///
4179    /// # Example
4180    /// ```ignore,no_run
4181    /// # use google_cloud_filestore_v1::model::CreateSnapshotRequest;
4182    /// use google_cloud_filestore_v1::model::Snapshot;
4183    /// let x = CreateSnapshotRequest::new().set_or_clear_snapshot(Some(Snapshot::default()/* use setters */));
4184    /// let x = CreateSnapshotRequest::new().set_or_clear_snapshot(None::<Snapshot>);
4185    /// ```
4186    pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
4187    where
4188        T: std::convert::Into<crate::model::Snapshot>,
4189    {
4190        self.snapshot = v.map(|x| x.into());
4191        self
4192    }
4193}
4194
4195impl wkt::message::Message for CreateSnapshotRequest {
4196    fn typename() -> &'static str {
4197        "type.googleapis.com/google.cloud.filestore.v1.CreateSnapshotRequest"
4198    }
4199}
4200
4201/// GetSnapshotRequest gets the state of a snapshot.
4202#[derive(Clone, Default, PartialEq)]
4203#[non_exhaustive]
4204pub struct GetSnapshotRequest {
4205    /// Required. The snapshot resource name, in the format
4206    /// `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
4207    pub name: std::string::String,
4208
4209    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4210}
4211
4212impl GetSnapshotRequest {
4213    /// Creates a new default instance.
4214    pub fn new() -> Self {
4215        std::default::Default::default()
4216    }
4217
4218    /// Sets the value of [name][crate::model::GetSnapshotRequest::name].
4219    ///
4220    /// # Example
4221    /// ```ignore,no_run
4222    /// # use google_cloud_filestore_v1::model::GetSnapshotRequest;
4223    /// let x = GetSnapshotRequest::new().set_name("example");
4224    /// ```
4225    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4226        self.name = v.into();
4227        self
4228    }
4229}
4230
4231impl wkt::message::Message for GetSnapshotRequest {
4232    fn typename() -> &'static str {
4233        "type.googleapis.com/google.cloud.filestore.v1.GetSnapshotRequest"
4234    }
4235}
4236
4237/// DeleteSnapshotRequest deletes a snapshot.
4238#[derive(Clone, Default, PartialEq)]
4239#[non_exhaustive]
4240pub struct DeleteSnapshotRequest {
4241    /// Required. The snapshot resource name, in the format
4242    /// `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}`
4243    pub name: std::string::String,
4244
4245    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4246}
4247
4248impl DeleteSnapshotRequest {
4249    /// Creates a new default instance.
4250    pub fn new() -> Self {
4251        std::default::Default::default()
4252    }
4253
4254    /// Sets the value of [name][crate::model::DeleteSnapshotRequest::name].
4255    ///
4256    /// # Example
4257    /// ```ignore,no_run
4258    /// # use google_cloud_filestore_v1::model::DeleteSnapshotRequest;
4259    /// let x = DeleteSnapshotRequest::new().set_name("example");
4260    /// ```
4261    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4262        self.name = v.into();
4263        self
4264    }
4265}
4266
4267impl wkt::message::Message for DeleteSnapshotRequest {
4268    fn typename() -> &'static str {
4269        "type.googleapis.com/google.cloud.filestore.v1.DeleteSnapshotRequest"
4270    }
4271}
4272
4273/// UpdateSnapshotRequest updates description and/or labels for a snapshot.
4274#[derive(Clone, Default, PartialEq)]
4275#[non_exhaustive]
4276pub struct UpdateSnapshotRequest {
4277    /// Required. Mask of fields to update. At least one path must be supplied in
4278    /// this field.
4279    pub update_mask: std::option::Option<wkt::FieldMask>,
4280
4281    /// Required. A snapshot resource.
4282    pub snapshot: std::option::Option<crate::model::Snapshot>,
4283
4284    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4285}
4286
4287impl UpdateSnapshotRequest {
4288    /// Creates a new default instance.
4289    pub fn new() -> Self {
4290        std::default::Default::default()
4291    }
4292
4293    /// Sets the value of [update_mask][crate::model::UpdateSnapshotRequest::update_mask].
4294    ///
4295    /// # Example
4296    /// ```ignore,no_run
4297    /// # use google_cloud_filestore_v1::model::UpdateSnapshotRequest;
4298    /// use wkt::FieldMask;
4299    /// let x = UpdateSnapshotRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4300    /// ```
4301    pub fn set_update_mask<T>(mut self, v: T) -> Self
4302    where
4303        T: std::convert::Into<wkt::FieldMask>,
4304    {
4305        self.update_mask = std::option::Option::Some(v.into());
4306        self
4307    }
4308
4309    /// Sets or clears the value of [update_mask][crate::model::UpdateSnapshotRequest::update_mask].
4310    ///
4311    /// # Example
4312    /// ```ignore,no_run
4313    /// # use google_cloud_filestore_v1::model::UpdateSnapshotRequest;
4314    /// use wkt::FieldMask;
4315    /// let x = UpdateSnapshotRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4316    /// let x = UpdateSnapshotRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4317    /// ```
4318    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4319    where
4320        T: std::convert::Into<wkt::FieldMask>,
4321    {
4322        self.update_mask = v.map(|x| x.into());
4323        self
4324    }
4325
4326    /// Sets the value of [snapshot][crate::model::UpdateSnapshotRequest::snapshot].
4327    ///
4328    /// # Example
4329    /// ```ignore,no_run
4330    /// # use google_cloud_filestore_v1::model::UpdateSnapshotRequest;
4331    /// use google_cloud_filestore_v1::model::Snapshot;
4332    /// let x = UpdateSnapshotRequest::new().set_snapshot(Snapshot::default()/* use setters */);
4333    /// ```
4334    pub fn set_snapshot<T>(mut self, v: T) -> Self
4335    where
4336        T: std::convert::Into<crate::model::Snapshot>,
4337    {
4338        self.snapshot = std::option::Option::Some(v.into());
4339        self
4340    }
4341
4342    /// Sets or clears the value of [snapshot][crate::model::UpdateSnapshotRequest::snapshot].
4343    ///
4344    /// # Example
4345    /// ```ignore,no_run
4346    /// # use google_cloud_filestore_v1::model::UpdateSnapshotRequest;
4347    /// use google_cloud_filestore_v1::model::Snapshot;
4348    /// let x = UpdateSnapshotRequest::new().set_or_clear_snapshot(Some(Snapshot::default()/* use setters */));
4349    /// let x = UpdateSnapshotRequest::new().set_or_clear_snapshot(None::<Snapshot>);
4350    /// ```
4351    pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
4352    where
4353        T: std::convert::Into<crate::model::Snapshot>,
4354    {
4355        self.snapshot = v.map(|x| x.into());
4356        self
4357    }
4358}
4359
4360impl wkt::message::Message for UpdateSnapshotRequest {
4361    fn typename() -> &'static str {
4362        "type.googleapis.com/google.cloud.filestore.v1.UpdateSnapshotRequest"
4363    }
4364}
4365
4366/// ListSnapshotsRequest lists snapshots.
4367#[derive(Clone, Default, PartialEq)]
4368#[non_exhaustive]
4369pub struct ListSnapshotsRequest {
4370    /// Required. The instance for which to retrieve snapshot information,
4371    /// in the format
4372    /// `projects/{project_id}/locations/{location}/instances/{instance_id}`.
4373    pub parent: std::string::String,
4374
4375    /// The maximum number of items to return.
4376    pub page_size: i32,
4377
4378    /// The next_page_token value to use if there are additional
4379    /// results to retrieve for this list request.
4380    pub page_token: std::string::String,
4381
4382    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
4383    pub order_by: std::string::String,
4384
4385    /// List filter.
4386    pub filter: std::string::String,
4387
4388    /// Optional. If true, allow partial responses for multi-regional Aggregated
4389    /// List requests.
4390    pub return_partial_success: bool,
4391
4392    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4393}
4394
4395impl ListSnapshotsRequest {
4396    /// Creates a new default instance.
4397    pub fn new() -> Self {
4398        std::default::Default::default()
4399    }
4400
4401    /// Sets the value of [parent][crate::model::ListSnapshotsRequest::parent].
4402    ///
4403    /// # Example
4404    /// ```ignore,no_run
4405    /// # use google_cloud_filestore_v1::model::ListSnapshotsRequest;
4406    /// let x = ListSnapshotsRequest::new().set_parent("example");
4407    /// ```
4408    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4409        self.parent = v.into();
4410        self
4411    }
4412
4413    /// Sets the value of [page_size][crate::model::ListSnapshotsRequest::page_size].
4414    ///
4415    /// # Example
4416    /// ```ignore,no_run
4417    /// # use google_cloud_filestore_v1::model::ListSnapshotsRequest;
4418    /// let x = ListSnapshotsRequest::new().set_page_size(42);
4419    /// ```
4420    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4421        self.page_size = v.into();
4422        self
4423    }
4424
4425    /// Sets the value of [page_token][crate::model::ListSnapshotsRequest::page_token].
4426    ///
4427    /// # Example
4428    /// ```ignore,no_run
4429    /// # use google_cloud_filestore_v1::model::ListSnapshotsRequest;
4430    /// let x = ListSnapshotsRequest::new().set_page_token("example");
4431    /// ```
4432    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4433        self.page_token = v.into();
4434        self
4435    }
4436
4437    /// Sets the value of [order_by][crate::model::ListSnapshotsRequest::order_by].
4438    ///
4439    /// # Example
4440    /// ```ignore,no_run
4441    /// # use google_cloud_filestore_v1::model::ListSnapshotsRequest;
4442    /// let x = ListSnapshotsRequest::new().set_order_by("example");
4443    /// ```
4444    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4445        self.order_by = v.into();
4446        self
4447    }
4448
4449    /// Sets the value of [filter][crate::model::ListSnapshotsRequest::filter].
4450    ///
4451    /// # Example
4452    /// ```ignore,no_run
4453    /// # use google_cloud_filestore_v1::model::ListSnapshotsRequest;
4454    /// let x = ListSnapshotsRequest::new().set_filter("example");
4455    /// ```
4456    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4457        self.filter = v.into();
4458        self
4459    }
4460
4461    /// Sets the value of [return_partial_success][crate::model::ListSnapshotsRequest::return_partial_success].
4462    ///
4463    /// # Example
4464    /// ```ignore,no_run
4465    /// # use google_cloud_filestore_v1::model::ListSnapshotsRequest;
4466    /// let x = ListSnapshotsRequest::new().set_return_partial_success(true);
4467    /// ```
4468    pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4469        self.return_partial_success = v.into();
4470        self
4471    }
4472}
4473
4474impl wkt::message::Message for ListSnapshotsRequest {
4475    fn typename() -> &'static str {
4476        "type.googleapis.com/google.cloud.filestore.v1.ListSnapshotsRequest"
4477    }
4478}
4479
4480/// ListSnapshotsResponse is the result of ListSnapshotsRequest.
4481#[derive(Clone, Default, PartialEq)]
4482#[non_exhaustive]
4483pub struct ListSnapshotsResponse {
4484    /// A list of snapshots in the project for the specified instance.
4485    pub snapshots: std::vec::Vec<crate::model::Snapshot>,
4486
4487    /// The token you can use to retrieve the next page of results. Not returned
4488    /// if there are no more results in the list.
4489    pub next_page_token: std::string::String,
4490
4491    /// Unordered list. Locations that could not be reached.
4492    pub unreachable: std::vec::Vec<std::string::String>,
4493
4494    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4495}
4496
4497impl ListSnapshotsResponse {
4498    /// Creates a new default instance.
4499    pub fn new() -> Self {
4500        std::default::Default::default()
4501    }
4502
4503    /// Sets the value of [snapshots][crate::model::ListSnapshotsResponse::snapshots].
4504    ///
4505    /// # Example
4506    /// ```ignore,no_run
4507    /// # use google_cloud_filestore_v1::model::ListSnapshotsResponse;
4508    /// use google_cloud_filestore_v1::model::Snapshot;
4509    /// let x = ListSnapshotsResponse::new()
4510    ///     .set_snapshots([
4511    ///         Snapshot::default()/* use setters */,
4512    ///         Snapshot::default()/* use (different) setters */,
4513    ///     ]);
4514    /// ```
4515    pub fn set_snapshots<T, V>(mut self, v: T) -> Self
4516    where
4517        T: std::iter::IntoIterator<Item = V>,
4518        V: std::convert::Into<crate::model::Snapshot>,
4519    {
4520        use std::iter::Iterator;
4521        self.snapshots = v.into_iter().map(|i| i.into()).collect();
4522        self
4523    }
4524
4525    /// Sets the value of [next_page_token][crate::model::ListSnapshotsResponse::next_page_token].
4526    ///
4527    /// # Example
4528    /// ```ignore,no_run
4529    /// # use google_cloud_filestore_v1::model::ListSnapshotsResponse;
4530    /// let x = ListSnapshotsResponse::new().set_next_page_token("example");
4531    /// ```
4532    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4533        self.next_page_token = v.into();
4534        self
4535    }
4536
4537    /// Sets the value of [unreachable][crate::model::ListSnapshotsResponse::unreachable].
4538    ///
4539    /// # Example
4540    /// ```ignore,no_run
4541    /// # use google_cloud_filestore_v1::model::ListSnapshotsResponse;
4542    /// let x = ListSnapshotsResponse::new().set_unreachable(["a", "b", "c"]);
4543    /// ```
4544    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4545    where
4546        T: std::iter::IntoIterator<Item = V>,
4547        V: std::convert::Into<std::string::String>,
4548    {
4549        use std::iter::Iterator;
4550        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4551        self
4552    }
4553}
4554
4555impl wkt::message::Message for ListSnapshotsResponse {
4556    fn typename() -> &'static str {
4557        "type.googleapis.com/google.cloud.filestore.v1.ListSnapshotsResponse"
4558    }
4559}
4560
4561#[doc(hidden)]
4562impl google_cloud_gax::paginator::internal::PageableResponse for ListSnapshotsResponse {
4563    type PageItem = crate::model::Snapshot;
4564
4565    fn items(self) -> std::vec::Vec<Self::PageItem> {
4566        self.snapshots
4567    }
4568
4569    fn next_page_token(&self) -> std::string::String {
4570        use std::clone::Clone;
4571        self.next_page_token.clone()
4572    }
4573}
4574
4575/// A Filestore backup.
4576#[derive(Clone, Default, PartialEq)]
4577#[non_exhaustive]
4578pub struct Backup {
4579    /// Output only. The resource name of the backup, in the format
4580    /// `projects/{project_number}/locations/{location_id}/backups/{backup_id}`.
4581    pub name: std::string::String,
4582
4583    /// A description of the backup with 2048 characters or less.
4584    /// Requests with longer descriptions will be rejected.
4585    pub description: std::string::String,
4586
4587    /// Output only. The backup state.
4588    pub state: crate::model::backup::State,
4589
4590    /// Output only. The time when the backup was created.
4591    pub create_time: std::option::Option<wkt::Timestamp>,
4592
4593    /// Resource labels to represent user provided metadata.
4594    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
4595
4596    /// Output only. Capacity of the source file share when the backup was created.
4597    pub capacity_gb: i64,
4598
4599    /// Output only. The size of the storage used by the backup. As backups share
4600    /// storage, this number is expected to change with backup creation/deletion.
4601    pub storage_bytes: i64,
4602
4603    /// The resource name of the source Filestore instance, in the format
4604    /// `projects/{project_number}/locations/{location_id}/instances/{instance_id}`,
4605    /// used to create this backup.
4606    pub source_instance: std::string::String,
4607
4608    /// Name of the file share in the source Filestore instance that the
4609    /// backup is created from.
4610    pub source_file_share: std::string::String,
4611
4612    /// Output only. The service tier of the source Filestore instance that this
4613    /// backup is created from.
4614    pub source_instance_tier: crate::model::instance::Tier,
4615
4616    /// Output only. Amount of bytes that will be downloaded if the backup is
4617    /// restored. This may be different than storage bytes, since sequential
4618    /// backups of the same disk will share storage.
4619    pub download_bytes: i64,
4620
4621    /// Output only. Reserved for future use.
4622    pub satisfies_pzs: std::option::Option<wkt::BoolValue>,
4623
4624    /// Output only. Reserved for future use.
4625    pub satisfies_pzi: bool,
4626
4627    /// Immutable. KMS key name used for data encryption.
4628    pub kms_key: std::string::String,
4629
4630    /// Optional. Input only. Immutable. Tag key-value pairs bound to this
4631    /// resource. Each key must be a namespaced name and each value a short name.
4632    /// Example:
4633    /// "123456789012/environment" : "production",
4634    /// "123456789013/costCenter" : "marketing"
4635    /// See the documentation for more information:
4636    ///
4637    /// - Namespaced name:
4638    ///   <https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#retrieving_tag_key>
4639    /// - Short name:
4640    ///   <https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing#retrieving_tag_value>
4641    pub tags: std::collections::HashMap<std::string::String, std::string::String>,
4642
4643    /// Output only. The file system protocol of the source Filestore instance that
4644    /// this backup is created from.
4645    pub file_system_protocol: crate::model::instance::FileProtocol,
4646
4647    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4648}
4649
4650impl Backup {
4651    /// Creates a new default instance.
4652    pub fn new() -> Self {
4653        std::default::Default::default()
4654    }
4655
4656    /// Sets the value of [name][crate::model::Backup::name].
4657    ///
4658    /// # Example
4659    /// ```ignore,no_run
4660    /// # use google_cloud_filestore_v1::model::Backup;
4661    /// let x = Backup::new().set_name("example");
4662    /// ```
4663    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4664        self.name = v.into();
4665        self
4666    }
4667
4668    /// Sets the value of [description][crate::model::Backup::description].
4669    ///
4670    /// # Example
4671    /// ```ignore,no_run
4672    /// # use google_cloud_filestore_v1::model::Backup;
4673    /// let x = Backup::new().set_description("example");
4674    /// ```
4675    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4676        self.description = v.into();
4677        self
4678    }
4679
4680    /// Sets the value of [state][crate::model::Backup::state].
4681    ///
4682    /// # Example
4683    /// ```ignore,no_run
4684    /// # use google_cloud_filestore_v1::model::Backup;
4685    /// use google_cloud_filestore_v1::model::backup::State;
4686    /// let x0 = Backup::new().set_state(State::Creating);
4687    /// let x1 = Backup::new().set_state(State::Finalizing);
4688    /// let x2 = Backup::new().set_state(State::Ready);
4689    /// ```
4690    pub fn set_state<T: std::convert::Into<crate::model::backup::State>>(mut self, v: T) -> Self {
4691        self.state = v.into();
4692        self
4693    }
4694
4695    /// Sets the value of [create_time][crate::model::Backup::create_time].
4696    ///
4697    /// # Example
4698    /// ```ignore,no_run
4699    /// # use google_cloud_filestore_v1::model::Backup;
4700    /// use wkt::Timestamp;
4701    /// let x = Backup::new().set_create_time(Timestamp::default()/* use setters */);
4702    /// ```
4703    pub fn set_create_time<T>(mut self, v: T) -> Self
4704    where
4705        T: std::convert::Into<wkt::Timestamp>,
4706    {
4707        self.create_time = std::option::Option::Some(v.into());
4708        self
4709    }
4710
4711    /// Sets or clears the value of [create_time][crate::model::Backup::create_time].
4712    ///
4713    /// # Example
4714    /// ```ignore,no_run
4715    /// # use google_cloud_filestore_v1::model::Backup;
4716    /// use wkt::Timestamp;
4717    /// let x = Backup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4718    /// let x = Backup::new().set_or_clear_create_time(None::<Timestamp>);
4719    /// ```
4720    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4721    where
4722        T: std::convert::Into<wkt::Timestamp>,
4723    {
4724        self.create_time = v.map(|x| x.into());
4725        self
4726    }
4727
4728    /// Sets the value of [labels][crate::model::Backup::labels].
4729    ///
4730    /// # Example
4731    /// ```ignore,no_run
4732    /// # use google_cloud_filestore_v1::model::Backup;
4733    /// let x = Backup::new().set_labels([
4734    ///     ("key0", "abc"),
4735    ///     ("key1", "xyz"),
4736    /// ]);
4737    /// ```
4738    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4739    where
4740        T: std::iter::IntoIterator<Item = (K, V)>,
4741        K: std::convert::Into<std::string::String>,
4742        V: std::convert::Into<std::string::String>,
4743    {
4744        use std::iter::Iterator;
4745        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4746        self
4747    }
4748
4749    /// Sets the value of [capacity_gb][crate::model::Backup::capacity_gb].
4750    ///
4751    /// # Example
4752    /// ```ignore,no_run
4753    /// # use google_cloud_filestore_v1::model::Backup;
4754    /// let x = Backup::new().set_capacity_gb(42);
4755    /// ```
4756    pub fn set_capacity_gb<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4757        self.capacity_gb = v.into();
4758        self
4759    }
4760
4761    /// Sets the value of [storage_bytes][crate::model::Backup::storage_bytes].
4762    ///
4763    /// # Example
4764    /// ```ignore,no_run
4765    /// # use google_cloud_filestore_v1::model::Backup;
4766    /// let x = Backup::new().set_storage_bytes(42);
4767    /// ```
4768    pub fn set_storage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4769        self.storage_bytes = v.into();
4770        self
4771    }
4772
4773    /// Sets the value of [source_instance][crate::model::Backup::source_instance].
4774    ///
4775    /// # Example
4776    /// ```ignore,no_run
4777    /// # use google_cloud_filestore_v1::model::Backup;
4778    /// let x = Backup::new().set_source_instance("example");
4779    /// ```
4780    pub fn set_source_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4781        self.source_instance = v.into();
4782        self
4783    }
4784
4785    /// Sets the value of [source_file_share][crate::model::Backup::source_file_share].
4786    ///
4787    /// # Example
4788    /// ```ignore,no_run
4789    /// # use google_cloud_filestore_v1::model::Backup;
4790    /// let x = Backup::new().set_source_file_share("example");
4791    /// ```
4792    pub fn set_source_file_share<T: std::convert::Into<std::string::String>>(
4793        mut self,
4794        v: T,
4795    ) -> Self {
4796        self.source_file_share = v.into();
4797        self
4798    }
4799
4800    /// Sets the value of [source_instance_tier][crate::model::Backup::source_instance_tier].
4801    ///
4802    /// # Example
4803    /// ```ignore,no_run
4804    /// # use google_cloud_filestore_v1::model::Backup;
4805    /// use google_cloud_filestore_v1::model::instance::Tier;
4806    /// let x0 = Backup::new().set_source_instance_tier(Tier::Standard);
4807    /// let x1 = Backup::new().set_source_instance_tier(Tier::Premium);
4808    /// let x2 = Backup::new().set_source_instance_tier(Tier::BasicHdd);
4809    /// ```
4810    pub fn set_source_instance_tier<T: std::convert::Into<crate::model::instance::Tier>>(
4811        mut self,
4812        v: T,
4813    ) -> Self {
4814        self.source_instance_tier = v.into();
4815        self
4816    }
4817
4818    /// Sets the value of [download_bytes][crate::model::Backup::download_bytes].
4819    ///
4820    /// # Example
4821    /// ```ignore,no_run
4822    /// # use google_cloud_filestore_v1::model::Backup;
4823    /// let x = Backup::new().set_download_bytes(42);
4824    /// ```
4825    pub fn set_download_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
4826        self.download_bytes = v.into();
4827        self
4828    }
4829
4830    /// Sets the value of [satisfies_pzs][crate::model::Backup::satisfies_pzs].
4831    ///
4832    /// # Example
4833    /// ```ignore,no_run
4834    /// # use google_cloud_filestore_v1::model::Backup;
4835    /// use wkt::BoolValue;
4836    /// let x = Backup::new().set_satisfies_pzs(BoolValue::default()/* use setters */);
4837    /// ```
4838    pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
4839    where
4840        T: std::convert::Into<wkt::BoolValue>,
4841    {
4842        self.satisfies_pzs = std::option::Option::Some(v.into());
4843        self
4844    }
4845
4846    /// Sets or clears the value of [satisfies_pzs][crate::model::Backup::satisfies_pzs].
4847    ///
4848    /// # Example
4849    /// ```ignore,no_run
4850    /// # use google_cloud_filestore_v1::model::Backup;
4851    /// use wkt::BoolValue;
4852    /// let x = Backup::new().set_or_clear_satisfies_pzs(Some(BoolValue::default()/* use setters */));
4853    /// let x = Backup::new().set_or_clear_satisfies_pzs(None::<BoolValue>);
4854    /// ```
4855    pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
4856    where
4857        T: std::convert::Into<wkt::BoolValue>,
4858    {
4859        self.satisfies_pzs = v.map(|x| x.into());
4860        self
4861    }
4862
4863    /// Sets the value of [satisfies_pzi][crate::model::Backup::satisfies_pzi].
4864    ///
4865    /// # Example
4866    /// ```ignore,no_run
4867    /// # use google_cloud_filestore_v1::model::Backup;
4868    /// let x = Backup::new().set_satisfies_pzi(true);
4869    /// ```
4870    pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4871        self.satisfies_pzi = v.into();
4872        self
4873    }
4874
4875    /// Sets the value of [kms_key][crate::model::Backup::kms_key].
4876    ///
4877    /// # Example
4878    /// ```ignore,no_run
4879    /// # use google_cloud_filestore_v1::model::Backup;
4880    /// let x = Backup::new().set_kms_key("example");
4881    /// ```
4882    pub fn set_kms_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4883        self.kms_key = v.into();
4884        self
4885    }
4886
4887    /// Sets the value of [tags][crate::model::Backup::tags].
4888    ///
4889    /// # Example
4890    /// ```ignore,no_run
4891    /// # use google_cloud_filestore_v1::model::Backup;
4892    /// let x = Backup::new().set_tags([
4893    ///     ("key0", "abc"),
4894    ///     ("key1", "xyz"),
4895    /// ]);
4896    /// ```
4897    pub fn set_tags<T, K, V>(mut self, v: T) -> Self
4898    where
4899        T: std::iter::IntoIterator<Item = (K, V)>,
4900        K: std::convert::Into<std::string::String>,
4901        V: std::convert::Into<std::string::String>,
4902    {
4903        use std::iter::Iterator;
4904        self.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4905        self
4906    }
4907
4908    /// Sets the value of [file_system_protocol][crate::model::Backup::file_system_protocol].
4909    ///
4910    /// # Example
4911    /// ```ignore,no_run
4912    /// # use google_cloud_filestore_v1::model::Backup;
4913    /// use google_cloud_filestore_v1::model::instance::FileProtocol;
4914    /// let x0 = Backup::new().set_file_system_protocol(FileProtocol::NfsV3);
4915    /// let x1 = Backup::new().set_file_system_protocol(FileProtocol::NfsV41);
4916    /// ```
4917    pub fn set_file_system_protocol<T: std::convert::Into<crate::model::instance::FileProtocol>>(
4918        mut self,
4919        v: T,
4920    ) -> Self {
4921        self.file_system_protocol = v.into();
4922        self
4923    }
4924}
4925
4926impl wkt::message::Message for Backup {
4927    fn typename() -> &'static str {
4928        "type.googleapis.com/google.cloud.filestore.v1.Backup"
4929    }
4930}
4931
4932/// Defines additional types related to [Backup].
4933pub mod backup {
4934    #[allow(unused_imports)]
4935    use super::*;
4936
4937    /// The backup state.
4938    ///
4939    /// # Working with unknown values
4940    ///
4941    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4942    /// additional enum variants at any time. Adding new variants is not considered
4943    /// a breaking change. Applications should write their code in anticipation of:
4944    ///
4945    /// - New values appearing in future releases of the client library, **and**
4946    /// - New values received dynamically, without application changes.
4947    ///
4948    /// Please consult the [Working with enums] section in the user guide for some
4949    /// guidelines.
4950    ///
4951    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
4952    #[derive(Clone, Debug, PartialEq)]
4953    #[non_exhaustive]
4954    pub enum State {
4955        /// State not set.
4956        Unspecified,
4957        /// Backup is being created.
4958        Creating,
4959        /// Backup has been taken and the operation is being finalized. At this
4960        /// point, changes to the file share will not be reflected in the backup.
4961        Finalizing,
4962        /// Backup is available for use.
4963        Ready,
4964        /// Backup is being deleted.
4965        Deleting,
4966        /// Backup is not valid and cannot be used for creating new instances or
4967        /// restoring existing instances.
4968        Invalid,
4969        /// If set, the enum was initialized with an unknown value.
4970        ///
4971        /// Applications can examine the value using [State::value] or
4972        /// [State::name].
4973        UnknownValue(state::UnknownValue),
4974    }
4975
4976    #[doc(hidden)]
4977    pub mod state {
4978        #[allow(unused_imports)]
4979        use super::*;
4980        #[derive(Clone, Debug, PartialEq)]
4981        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4982    }
4983
4984    impl State {
4985        /// Gets the enum value.
4986        ///
4987        /// Returns `None` if the enum contains an unknown value deserialized from
4988        /// the string representation of enums.
4989        pub fn value(&self) -> std::option::Option<i32> {
4990            match self {
4991                Self::Unspecified => std::option::Option::Some(0),
4992                Self::Creating => std::option::Option::Some(1),
4993                Self::Finalizing => std::option::Option::Some(2),
4994                Self::Ready => std::option::Option::Some(3),
4995                Self::Deleting => std::option::Option::Some(4),
4996                Self::Invalid => std::option::Option::Some(5),
4997                Self::UnknownValue(u) => u.0.value(),
4998            }
4999        }
5000
5001        /// Gets the enum value as a string.
5002        ///
5003        /// Returns `None` if the enum contains an unknown value deserialized from
5004        /// the integer representation of enums.
5005        pub fn name(&self) -> std::option::Option<&str> {
5006            match self {
5007                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5008                Self::Creating => std::option::Option::Some("CREATING"),
5009                Self::Finalizing => std::option::Option::Some("FINALIZING"),
5010                Self::Ready => std::option::Option::Some("READY"),
5011                Self::Deleting => std::option::Option::Some("DELETING"),
5012                Self::Invalid => std::option::Option::Some("INVALID"),
5013                Self::UnknownValue(u) => u.0.name(),
5014            }
5015        }
5016    }
5017
5018    impl std::default::Default for State {
5019        fn default() -> Self {
5020            use std::convert::From;
5021            Self::from(0)
5022        }
5023    }
5024
5025    impl std::fmt::Display for State {
5026        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5027            wkt::internal::display_enum(f, self.name(), self.value())
5028        }
5029    }
5030
5031    impl std::convert::From<i32> for State {
5032        fn from(value: i32) -> Self {
5033            match value {
5034                0 => Self::Unspecified,
5035                1 => Self::Creating,
5036                2 => Self::Finalizing,
5037                3 => Self::Ready,
5038                4 => Self::Deleting,
5039                5 => Self::Invalid,
5040                _ => Self::UnknownValue(state::UnknownValue(
5041                    wkt::internal::UnknownEnumValue::Integer(value),
5042                )),
5043            }
5044        }
5045    }
5046
5047    impl std::convert::From<&str> for State {
5048        fn from(value: &str) -> Self {
5049            use std::string::ToString;
5050            match value {
5051                "STATE_UNSPECIFIED" => Self::Unspecified,
5052                "CREATING" => Self::Creating,
5053                "FINALIZING" => Self::Finalizing,
5054                "READY" => Self::Ready,
5055                "DELETING" => Self::Deleting,
5056                "INVALID" => Self::Invalid,
5057                _ => Self::UnknownValue(state::UnknownValue(
5058                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5059                )),
5060            }
5061        }
5062    }
5063
5064    impl serde::ser::Serialize for State {
5065        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5066        where
5067            S: serde::Serializer,
5068        {
5069            match self {
5070                Self::Unspecified => serializer.serialize_i32(0),
5071                Self::Creating => serializer.serialize_i32(1),
5072                Self::Finalizing => serializer.serialize_i32(2),
5073                Self::Ready => serializer.serialize_i32(3),
5074                Self::Deleting => serializer.serialize_i32(4),
5075                Self::Invalid => serializer.serialize_i32(5),
5076                Self::UnknownValue(u) => u.0.serialize(serializer),
5077            }
5078        }
5079    }
5080
5081    impl<'de> serde::de::Deserialize<'de> for State {
5082        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5083        where
5084            D: serde::Deserializer<'de>,
5085        {
5086            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5087                ".google.cloud.filestore.v1.Backup.State",
5088            ))
5089        }
5090    }
5091}
5092
5093/// CreateBackupRequest creates a backup.
5094#[derive(Clone, Default, PartialEq)]
5095#[non_exhaustive]
5096pub struct CreateBackupRequest {
5097    /// Required. The backup's project and location, in the format
5098    /// `projects/{project_number}/locations/{location}`. In Filestore,
5099    /// backup locations map to Google Cloud regions, for example **us-west1**.
5100    pub parent: std::string::String,
5101
5102    /// Required. A [backup resource][google.cloud.filestore.v1.Backup]
5103    ///
5104    /// [google.cloud.filestore.v1.Backup]: crate::model::Backup
5105    pub backup: std::option::Option<crate::model::Backup>,
5106
5107    /// Required. The ID to use for the backup.
5108    /// The ID must be unique within the specified project and location.
5109    ///
5110    /// This value must start with a lowercase letter followed by up to 62
5111    /// lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
5112    /// Values that do not match this pattern will trigger an INVALID_ARGUMENT
5113    /// error.
5114    pub backup_id: std::string::String,
5115
5116    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5117}
5118
5119impl CreateBackupRequest {
5120    /// Creates a new default instance.
5121    pub fn new() -> Self {
5122        std::default::Default::default()
5123    }
5124
5125    /// Sets the value of [parent][crate::model::CreateBackupRequest::parent].
5126    ///
5127    /// # Example
5128    /// ```ignore,no_run
5129    /// # use google_cloud_filestore_v1::model::CreateBackupRequest;
5130    /// let x = CreateBackupRequest::new().set_parent("example");
5131    /// ```
5132    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5133        self.parent = v.into();
5134        self
5135    }
5136
5137    /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
5138    ///
5139    /// # Example
5140    /// ```ignore,no_run
5141    /// # use google_cloud_filestore_v1::model::CreateBackupRequest;
5142    /// use google_cloud_filestore_v1::model::Backup;
5143    /// let x = CreateBackupRequest::new().set_backup(Backup::default()/* use setters */);
5144    /// ```
5145    pub fn set_backup<T>(mut self, v: T) -> Self
5146    where
5147        T: std::convert::Into<crate::model::Backup>,
5148    {
5149        self.backup = std::option::Option::Some(v.into());
5150        self
5151    }
5152
5153    /// Sets or clears the value of [backup][crate::model::CreateBackupRequest::backup].
5154    ///
5155    /// # Example
5156    /// ```ignore,no_run
5157    /// # use google_cloud_filestore_v1::model::CreateBackupRequest;
5158    /// use google_cloud_filestore_v1::model::Backup;
5159    /// let x = CreateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
5160    /// let x = CreateBackupRequest::new().set_or_clear_backup(None::<Backup>);
5161    /// ```
5162    pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
5163    where
5164        T: std::convert::Into<crate::model::Backup>,
5165    {
5166        self.backup = v.map(|x| x.into());
5167        self
5168    }
5169
5170    /// Sets the value of [backup_id][crate::model::CreateBackupRequest::backup_id].
5171    ///
5172    /// # Example
5173    /// ```ignore,no_run
5174    /// # use google_cloud_filestore_v1::model::CreateBackupRequest;
5175    /// let x = CreateBackupRequest::new().set_backup_id("example");
5176    /// ```
5177    pub fn set_backup_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5178        self.backup_id = v.into();
5179        self
5180    }
5181}
5182
5183impl wkt::message::Message for CreateBackupRequest {
5184    fn typename() -> &'static str {
5185        "type.googleapis.com/google.cloud.filestore.v1.CreateBackupRequest"
5186    }
5187}
5188
5189/// DeleteBackupRequest deletes a backup.
5190#[derive(Clone, Default, PartialEq)]
5191#[non_exhaustive]
5192pub struct DeleteBackupRequest {
5193    /// Required. The backup resource name, in the format
5194    /// `projects/{project_number}/locations/{location}/backups/{backup_id}`
5195    pub name: std::string::String,
5196
5197    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5198}
5199
5200impl DeleteBackupRequest {
5201    /// Creates a new default instance.
5202    pub fn new() -> Self {
5203        std::default::Default::default()
5204    }
5205
5206    /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
5207    ///
5208    /// # Example
5209    /// ```ignore,no_run
5210    /// # use google_cloud_filestore_v1::model::DeleteBackupRequest;
5211    /// let x = DeleteBackupRequest::new().set_name("example");
5212    /// ```
5213    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5214        self.name = v.into();
5215        self
5216    }
5217}
5218
5219impl wkt::message::Message for DeleteBackupRequest {
5220    fn typename() -> &'static str {
5221        "type.googleapis.com/google.cloud.filestore.v1.DeleteBackupRequest"
5222    }
5223}
5224
5225/// UpdateBackupRequest updates description and/or labels for a backup.
5226#[derive(Clone, Default, PartialEq)]
5227#[non_exhaustive]
5228pub struct UpdateBackupRequest {
5229    /// Required. A [backup resource][google.cloud.filestore.v1.Backup]
5230    ///
5231    /// [google.cloud.filestore.v1.Backup]: crate::model::Backup
5232    pub backup: std::option::Option<crate::model::Backup>,
5233
5234    /// Required. Mask of fields to update.  At least one path must be supplied in
5235    /// this field.
5236    pub update_mask: std::option::Option<wkt::FieldMask>,
5237
5238    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5239}
5240
5241impl UpdateBackupRequest {
5242    /// Creates a new default instance.
5243    pub fn new() -> Self {
5244        std::default::Default::default()
5245    }
5246
5247    /// Sets the value of [backup][crate::model::UpdateBackupRequest::backup].
5248    ///
5249    /// # Example
5250    /// ```ignore,no_run
5251    /// # use google_cloud_filestore_v1::model::UpdateBackupRequest;
5252    /// use google_cloud_filestore_v1::model::Backup;
5253    /// let x = UpdateBackupRequest::new().set_backup(Backup::default()/* use setters */);
5254    /// ```
5255    pub fn set_backup<T>(mut self, v: T) -> Self
5256    where
5257        T: std::convert::Into<crate::model::Backup>,
5258    {
5259        self.backup = std::option::Option::Some(v.into());
5260        self
5261    }
5262
5263    /// Sets or clears the value of [backup][crate::model::UpdateBackupRequest::backup].
5264    ///
5265    /// # Example
5266    /// ```ignore,no_run
5267    /// # use google_cloud_filestore_v1::model::UpdateBackupRequest;
5268    /// use google_cloud_filestore_v1::model::Backup;
5269    /// let x = UpdateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
5270    /// let x = UpdateBackupRequest::new().set_or_clear_backup(None::<Backup>);
5271    /// ```
5272    pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
5273    where
5274        T: std::convert::Into<crate::model::Backup>,
5275    {
5276        self.backup = v.map(|x| x.into());
5277        self
5278    }
5279
5280    /// Sets the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
5281    ///
5282    /// # Example
5283    /// ```ignore,no_run
5284    /// # use google_cloud_filestore_v1::model::UpdateBackupRequest;
5285    /// use wkt::FieldMask;
5286    /// let x = UpdateBackupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5287    /// ```
5288    pub fn set_update_mask<T>(mut self, v: T) -> Self
5289    where
5290        T: std::convert::Into<wkt::FieldMask>,
5291    {
5292        self.update_mask = std::option::Option::Some(v.into());
5293        self
5294    }
5295
5296    /// Sets or clears the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
5297    ///
5298    /// # Example
5299    /// ```ignore,no_run
5300    /// # use google_cloud_filestore_v1::model::UpdateBackupRequest;
5301    /// use wkt::FieldMask;
5302    /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5303    /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5304    /// ```
5305    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5306    where
5307        T: std::convert::Into<wkt::FieldMask>,
5308    {
5309        self.update_mask = v.map(|x| x.into());
5310        self
5311    }
5312}
5313
5314impl wkt::message::Message for UpdateBackupRequest {
5315    fn typename() -> &'static str {
5316        "type.googleapis.com/google.cloud.filestore.v1.UpdateBackupRequest"
5317    }
5318}
5319
5320/// PromoteReplicaRequest promotes a Filestore standby instance (replica).
5321#[derive(Clone, Default, PartialEq)]
5322#[non_exhaustive]
5323pub struct PromoteReplicaRequest {
5324    /// Required. The resource name of the instance, in the format
5325    /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`.
5326    pub name: std::string::String,
5327
5328    /// Optional. The resource name of the peer instance to promote, in the format
5329    /// `projects/{project_id}/locations/{location_id}/instances/{instance_id}`.
5330    /// The peer instance is required if the operation is called on an active
5331    /// instance.
5332    pub peer_instance: std::string::String,
5333
5334    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5335}
5336
5337impl PromoteReplicaRequest {
5338    /// Creates a new default instance.
5339    pub fn new() -> Self {
5340        std::default::Default::default()
5341    }
5342
5343    /// Sets the value of [name][crate::model::PromoteReplicaRequest::name].
5344    ///
5345    /// # Example
5346    /// ```ignore,no_run
5347    /// # use google_cloud_filestore_v1::model::PromoteReplicaRequest;
5348    /// let x = PromoteReplicaRequest::new().set_name("example");
5349    /// ```
5350    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5351        self.name = v.into();
5352        self
5353    }
5354
5355    /// Sets the value of [peer_instance][crate::model::PromoteReplicaRequest::peer_instance].
5356    ///
5357    /// # Example
5358    /// ```ignore,no_run
5359    /// # use google_cloud_filestore_v1::model::PromoteReplicaRequest;
5360    /// let x = PromoteReplicaRequest::new().set_peer_instance("example");
5361    /// ```
5362    pub fn set_peer_instance<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5363        self.peer_instance = v.into();
5364        self
5365    }
5366}
5367
5368impl wkt::message::Message for PromoteReplicaRequest {
5369    fn typename() -> &'static str {
5370        "type.googleapis.com/google.cloud.filestore.v1.PromoteReplicaRequest"
5371    }
5372}
5373
5374/// GetBackupRequest gets the state of a backup.
5375#[derive(Clone, Default, PartialEq)]
5376#[non_exhaustive]
5377pub struct GetBackupRequest {
5378    /// Required. The backup resource name, in the format
5379    /// `projects/{project_number}/locations/{location}/backups/{backup_id}`.
5380    pub name: std::string::String,
5381
5382    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5383}
5384
5385impl GetBackupRequest {
5386    /// Creates a new default instance.
5387    pub fn new() -> Self {
5388        std::default::Default::default()
5389    }
5390
5391    /// Sets the value of [name][crate::model::GetBackupRequest::name].
5392    ///
5393    /// # Example
5394    /// ```ignore,no_run
5395    /// # use google_cloud_filestore_v1::model::GetBackupRequest;
5396    /// let x = GetBackupRequest::new().set_name("example");
5397    /// ```
5398    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5399        self.name = v.into();
5400        self
5401    }
5402}
5403
5404impl wkt::message::Message for GetBackupRequest {
5405    fn typename() -> &'static str {
5406        "type.googleapis.com/google.cloud.filestore.v1.GetBackupRequest"
5407    }
5408}
5409
5410/// ListBackupsRequest lists backups.
5411#[derive(Clone, Default, PartialEq)]
5412#[non_exhaustive]
5413pub struct ListBackupsRequest {
5414    /// Required. The project and location for which to retrieve backup
5415    /// information, in the format
5416    /// `projects/{project_number}/locations/{location}`. In Filestore, backup
5417    /// locations map to Google Cloud regions, for example **us-west1**. To
5418    /// retrieve backup information for all locations, use "-" for the
5419    /// `{location}` value.
5420    pub parent: std::string::String,
5421
5422    /// The maximum number of items to return.
5423    pub page_size: i32,
5424
5425    /// The next_page_token value to use if there are additional
5426    /// results to retrieve for this list request.
5427    pub page_token: std::string::String,
5428
5429    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
5430    pub order_by: std::string::String,
5431
5432    /// List filter.
5433    pub filter: std::string::String,
5434
5435    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5436}
5437
5438impl ListBackupsRequest {
5439    /// Creates a new default instance.
5440    pub fn new() -> Self {
5441        std::default::Default::default()
5442    }
5443
5444    /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
5445    ///
5446    /// # Example
5447    /// ```ignore,no_run
5448    /// # use google_cloud_filestore_v1::model::ListBackupsRequest;
5449    /// let x = ListBackupsRequest::new().set_parent("example");
5450    /// ```
5451    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5452        self.parent = v.into();
5453        self
5454    }
5455
5456    /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
5457    ///
5458    /// # Example
5459    /// ```ignore,no_run
5460    /// # use google_cloud_filestore_v1::model::ListBackupsRequest;
5461    /// let x = ListBackupsRequest::new().set_page_size(42);
5462    /// ```
5463    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5464        self.page_size = v.into();
5465        self
5466    }
5467
5468    /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
5469    ///
5470    /// # Example
5471    /// ```ignore,no_run
5472    /// # use google_cloud_filestore_v1::model::ListBackupsRequest;
5473    /// let x = ListBackupsRequest::new().set_page_token("example");
5474    /// ```
5475    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5476        self.page_token = v.into();
5477        self
5478    }
5479
5480    /// Sets the value of [order_by][crate::model::ListBackupsRequest::order_by].
5481    ///
5482    /// # Example
5483    /// ```ignore,no_run
5484    /// # use google_cloud_filestore_v1::model::ListBackupsRequest;
5485    /// let x = ListBackupsRequest::new().set_order_by("example");
5486    /// ```
5487    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5488        self.order_by = v.into();
5489        self
5490    }
5491
5492    /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
5493    ///
5494    /// # Example
5495    /// ```ignore,no_run
5496    /// # use google_cloud_filestore_v1::model::ListBackupsRequest;
5497    /// let x = ListBackupsRequest::new().set_filter("example");
5498    /// ```
5499    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5500        self.filter = v.into();
5501        self
5502    }
5503}
5504
5505impl wkt::message::Message for ListBackupsRequest {
5506    fn typename() -> &'static str {
5507        "type.googleapis.com/google.cloud.filestore.v1.ListBackupsRequest"
5508    }
5509}
5510
5511/// ListBackupsResponse is the result of ListBackupsRequest.
5512#[derive(Clone, Default, PartialEq)]
5513#[non_exhaustive]
5514pub struct ListBackupsResponse {
5515    /// A list of backups in the project for the specified location.
5516    ///
5517    /// If the `{location}` value in the request is "-", the response contains a
5518    /// list of backups from all locations. If any location is unreachable, the
5519    /// response will only return backups in reachable locations and the
5520    /// "unreachable" field will be populated with a list of unreachable
5521    /// locations.
5522    pub backups: std::vec::Vec<crate::model::Backup>,
5523
5524    /// The token you can use to retrieve the next page of results. Not returned
5525    /// if there are no more results in the list.
5526    pub next_page_token: std::string::String,
5527
5528    /// Unordered list. Locations that could not be reached.
5529    pub unreachable: std::vec::Vec<std::string::String>,
5530
5531    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5532}
5533
5534impl ListBackupsResponse {
5535    /// Creates a new default instance.
5536    pub fn new() -> Self {
5537        std::default::Default::default()
5538    }
5539
5540    /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
5541    ///
5542    /// # Example
5543    /// ```ignore,no_run
5544    /// # use google_cloud_filestore_v1::model::ListBackupsResponse;
5545    /// use google_cloud_filestore_v1::model::Backup;
5546    /// let x = ListBackupsResponse::new()
5547    ///     .set_backups([
5548    ///         Backup::default()/* use setters */,
5549    ///         Backup::default()/* use (different) setters */,
5550    ///     ]);
5551    /// ```
5552    pub fn set_backups<T, V>(mut self, v: T) -> Self
5553    where
5554        T: std::iter::IntoIterator<Item = V>,
5555        V: std::convert::Into<crate::model::Backup>,
5556    {
5557        use std::iter::Iterator;
5558        self.backups = v.into_iter().map(|i| i.into()).collect();
5559        self
5560    }
5561
5562    /// Sets the value of [next_page_token][crate::model::ListBackupsResponse::next_page_token].
5563    ///
5564    /// # Example
5565    /// ```ignore,no_run
5566    /// # use google_cloud_filestore_v1::model::ListBackupsResponse;
5567    /// let x = ListBackupsResponse::new().set_next_page_token("example");
5568    /// ```
5569    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5570        self.next_page_token = v.into();
5571        self
5572    }
5573
5574    /// Sets the value of [unreachable][crate::model::ListBackupsResponse::unreachable].
5575    ///
5576    /// # Example
5577    /// ```ignore,no_run
5578    /// # use google_cloud_filestore_v1::model::ListBackupsResponse;
5579    /// let x = ListBackupsResponse::new().set_unreachable(["a", "b", "c"]);
5580    /// ```
5581    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5582    where
5583        T: std::iter::IntoIterator<Item = V>,
5584        V: std::convert::Into<std::string::String>,
5585    {
5586        use std::iter::Iterator;
5587        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5588        self
5589    }
5590}
5591
5592impl wkt::message::Message for ListBackupsResponse {
5593    fn typename() -> &'static str {
5594        "type.googleapis.com/google.cloud.filestore.v1.ListBackupsResponse"
5595    }
5596}
5597
5598#[doc(hidden)]
5599impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupsResponse {
5600    type PageItem = crate::model::Backup;
5601
5602    fn items(self) -> std::vec::Vec<Self::PageItem> {
5603        self.backups
5604    }
5605
5606    fn next_page_token(&self) -> std::string::String {
5607        use std::clone::Clone;
5608        self.next_page_token.clone()
5609    }
5610}