Skip to main content

google_cloud_netapp_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_location;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate lazy_static;
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/// ListActiveDirectoriesRequest for requesting multiple active directories.
40#[derive(Clone, Default, PartialEq)]
41#[non_exhaustive]
42pub struct ListActiveDirectoriesRequest {
43    /// Required. Parent value for ListActiveDirectoriesRequest
44    pub parent: std::string::String,
45
46    /// Requested page size. Server may return fewer items than requested.
47    /// If unspecified, the server will pick an appropriate default.
48    pub page_size: i32,
49
50    /// A token identifying a page of results the server should return.
51    pub page_token: std::string::String,
52
53    /// Filtering results
54    pub filter: std::string::String,
55
56    /// Hint for how to order the results
57    pub order_by: std::string::String,
58
59    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
60}
61
62impl ListActiveDirectoriesRequest {
63    pub fn new() -> Self {
64        std::default::Default::default()
65    }
66
67    /// Sets the value of [parent][crate::model::ListActiveDirectoriesRequest::parent].
68    ///
69    /// # Example
70    /// ```ignore,no_run
71    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
72    /// let x = ListActiveDirectoriesRequest::new().set_parent("example");
73    /// ```
74    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
75        self.parent = v.into();
76        self
77    }
78
79    /// Sets the value of [page_size][crate::model::ListActiveDirectoriesRequest::page_size].
80    ///
81    /// # Example
82    /// ```ignore,no_run
83    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
84    /// let x = ListActiveDirectoriesRequest::new().set_page_size(42);
85    /// ```
86    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
87        self.page_size = v.into();
88        self
89    }
90
91    /// Sets the value of [page_token][crate::model::ListActiveDirectoriesRequest::page_token].
92    ///
93    /// # Example
94    /// ```ignore,no_run
95    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
96    /// let x = ListActiveDirectoriesRequest::new().set_page_token("example");
97    /// ```
98    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
99        self.page_token = v.into();
100        self
101    }
102
103    /// Sets the value of [filter][crate::model::ListActiveDirectoriesRequest::filter].
104    ///
105    /// # Example
106    /// ```ignore,no_run
107    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
108    /// let x = ListActiveDirectoriesRequest::new().set_filter("example");
109    /// ```
110    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
111        self.filter = v.into();
112        self
113    }
114
115    /// Sets the value of [order_by][crate::model::ListActiveDirectoriesRequest::order_by].
116    ///
117    /// # Example
118    /// ```ignore,no_run
119    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
120    /// let x = ListActiveDirectoriesRequest::new().set_order_by("example");
121    /// ```
122    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
123        self.order_by = v.into();
124        self
125    }
126}
127
128impl wkt::message::Message for ListActiveDirectoriesRequest {
129    fn typename() -> &'static str {
130        "type.googleapis.com/google.cloud.netapp.v1.ListActiveDirectoriesRequest"
131    }
132}
133
134/// ListActiveDirectoriesResponse contains all the active directories requested.
135#[derive(Clone, Default, PartialEq)]
136#[non_exhaustive]
137pub struct ListActiveDirectoriesResponse {
138    /// The list of active directories.
139    pub active_directories: std::vec::Vec<crate::model::ActiveDirectory>,
140
141    /// A token identifying a page of results the server should return.
142    pub next_page_token: std::string::String,
143
144    /// Locations that could not be reached.
145    pub unreachable: std::vec::Vec<std::string::String>,
146
147    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
148}
149
150impl ListActiveDirectoriesResponse {
151    pub fn new() -> Self {
152        std::default::Default::default()
153    }
154
155    /// Sets the value of [active_directories][crate::model::ListActiveDirectoriesResponse::active_directories].
156    ///
157    /// # Example
158    /// ```ignore,no_run
159    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesResponse;
160    /// use google_cloud_netapp_v1::model::ActiveDirectory;
161    /// let x = ListActiveDirectoriesResponse::new()
162    ///     .set_active_directories([
163    ///         ActiveDirectory::default()/* use setters */,
164    ///         ActiveDirectory::default()/* use (different) setters */,
165    ///     ]);
166    /// ```
167    pub fn set_active_directories<T, V>(mut self, v: T) -> Self
168    where
169        T: std::iter::IntoIterator<Item = V>,
170        V: std::convert::Into<crate::model::ActiveDirectory>,
171    {
172        use std::iter::Iterator;
173        self.active_directories = v.into_iter().map(|i| i.into()).collect();
174        self
175    }
176
177    /// Sets the value of [next_page_token][crate::model::ListActiveDirectoriesResponse::next_page_token].
178    ///
179    /// # Example
180    /// ```ignore,no_run
181    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesResponse;
182    /// let x = ListActiveDirectoriesResponse::new().set_next_page_token("example");
183    /// ```
184    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
185        self.next_page_token = v.into();
186        self
187    }
188
189    /// Sets the value of [unreachable][crate::model::ListActiveDirectoriesResponse::unreachable].
190    ///
191    /// # Example
192    /// ```ignore,no_run
193    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesResponse;
194    /// let x = ListActiveDirectoriesResponse::new().set_unreachable(["a", "b", "c"]);
195    /// ```
196    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
197    where
198        T: std::iter::IntoIterator<Item = V>,
199        V: std::convert::Into<std::string::String>,
200    {
201        use std::iter::Iterator;
202        self.unreachable = v.into_iter().map(|i| i.into()).collect();
203        self
204    }
205}
206
207impl wkt::message::Message for ListActiveDirectoriesResponse {
208    fn typename() -> &'static str {
209        "type.googleapis.com/google.cloud.netapp.v1.ListActiveDirectoriesResponse"
210    }
211}
212
213#[doc(hidden)]
214impl google_cloud_gax::paginator::internal::PageableResponse for ListActiveDirectoriesResponse {
215    type PageItem = crate::model::ActiveDirectory;
216
217    fn items(self) -> std::vec::Vec<Self::PageItem> {
218        self.active_directories
219    }
220
221    fn next_page_token(&self) -> std::string::String {
222        use std::clone::Clone;
223        self.next_page_token.clone()
224    }
225}
226
227/// GetActiveDirectory for getting a single active directory.
228#[derive(Clone, Default, PartialEq)]
229#[non_exhaustive]
230pub struct GetActiveDirectoryRequest {
231    /// Required. Name of the active directory.
232    pub name: std::string::String,
233
234    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
235}
236
237impl GetActiveDirectoryRequest {
238    pub fn new() -> Self {
239        std::default::Default::default()
240    }
241
242    /// Sets the value of [name][crate::model::GetActiveDirectoryRequest::name].
243    ///
244    /// # Example
245    /// ```ignore,no_run
246    /// # use google_cloud_netapp_v1::model::GetActiveDirectoryRequest;
247    /// let x = GetActiveDirectoryRequest::new().set_name("example");
248    /// ```
249    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
250        self.name = v.into();
251        self
252    }
253}
254
255impl wkt::message::Message for GetActiveDirectoryRequest {
256    fn typename() -> &'static str {
257        "type.googleapis.com/google.cloud.netapp.v1.GetActiveDirectoryRequest"
258    }
259}
260
261/// CreateActiveDirectoryRequest for creating an active directory.
262#[derive(Clone, Default, PartialEq)]
263#[non_exhaustive]
264pub struct CreateActiveDirectoryRequest {
265    /// Required. Value for parent.
266    pub parent: std::string::String,
267
268    /// Required. Fields of the to be created active directory.
269    pub active_directory: std::option::Option<crate::model::ActiveDirectory>,
270
271    /// Required. ID of the active directory to create. Must be unique within the
272    /// parent resource. Must contain only letters, numbers and hyphen, with the
273    /// first character a letter , the last a letter or a number, and a 63
274    /// character maximum.
275    pub active_directory_id: std::string::String,
276
277    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
278}
279
280impl CreateActiveDirectoryRequest {
281    pub fn new() -> Self {
282        std::default::Default::default()
283    }
284
285    /// Sets the value of [parent][crate::model::CreateActiveDirectoryRequest::parent].
286    ///
287    /// # Example
288    /// ```ignore,no_run
289    /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
290    /// let x = CreateActiveDirectoryRequest::new().set_parent("example");
291    /// ```
292    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
293        self.parent = v.into();
294        self
295    }
296
297    /// Sets the value of [active_directory][crate::model::CreateActiveDirectoryRequest::active_directory].
298    ///
299    /// # Example
300    /// ```ignore,no_run
301    /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
302    /// use google_cloud_netapp_v1::model::ActiveDirectory;
303    /// let x = CreateActiveDirectoryRequest::new().set_active_directory(ActiveDirectory::default()/* use setters */);
304    /// ```
305    pub fn set_active_directory<T>(mut self, v: T) -> Self
306    where
307        T: std::convert::Into<crate::model::ActiveDirectory>,
308    {
309        self.active_directory = std::option::Option::Some(v.into());
310        self
311    }
312
313    /// Sets or clears the value of [active_directory][crate::model::CreateActiveDirectoryRequest::active_directory].
314    ///
315    /// # Example
316    /// ```ignore,no_run
317    /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
318    /// use google_cloud_netapp_v1::model::ActiveDirectory;
319    /// let x = CreateActiveDirectoryRequest::new().set_or_clear_active_directory(Some(ActiveDirectory::default()/* use setters */));
320    /// let x = CreateActiveDirectoryRequest::new().set_or_clear_active_directory(None::<ActiveDirectory>);
321    /// ```
322    pub fn set_or_clear_active_directory<T>(mut self, v: std::option::Option<T>) -> Self
323    where
324        T: std::convert::Into<crate::model::ActiveDirectory>,
325    {
326        self.active_directory = v.map(|x| x.into());
327        self
328    }
329
330    /// Sets the value of [active_directory_id][crate::model::CreateActiveDirectoryRequest::active_directory_id].
331    ///
332    /// # Example
333    /// ```ignore,no_run
334    /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
335    /// let x = CreateActiveDirectoryRequest::new().set_active_directory_id("example");
336    /// ```
337    pub fn set_active_directory_id<T: std::convert::Into<std::string::String>>(
338        mut self,
339        v: T,
340    ) -> Self {
341        self.active_directory_id = v.into();
342        self
343    }
344}
345
346impl wkt::message::Message for CreateActiveDirectoryRequest {
347    fn typename() -> &'static str {
348        "type.googleapis.com/google.cloud.netapp.v1.CreateActiveDirectoryRequest"
349    }
350}
351
352/// UpdateActiveDirectoryRequest for updating an active directory.
353#[derive(Clone, Default, PartialEq)]
354#[non_exhaustive]
355pub struct UpdateActiveDirectoryRequest {
356    /// Required. Field mask is used to specify the fields to be overwritten in the
357    /// Active Directory resource by the update.
358    /// The fields specified in the update_mask are relative to the resource, not
359    /// the full request. A field will be overwritten if it is in the mask. If the
360    /// user does not provide a mask then all fields will be overwritten.
361    pub update_mask: std::option::Option<wkt::FieldMask>,
362
363    /// Required. The volume being updated
364    pub active_directory: std::option::Option<crate::model::ActiveDirectory>,
365
366    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
367}
368
369impl UpdateActiveDirectoryRequest {
370    pub fn new() -> Self {
371        std::default::Default::default()
372    }
373
374    /// Sets the value of [update_mask][crate::model::UpdateActiveDirectoryRequest::update_mask].
375    ///
376    /// # Example
377    /// ```ignore,no_run
378    /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
379    /// use wkt::FieldMask;
380    /// let x = UpdateActiveDirectoryRequest::new().set_update_mask(FieldMask::default()/* use setters */);
381    /// ```
382    pub fn set_update_mask<T>(mut self, v: T) -> Self
383    where
384        T: std::convert::Into<wkt::FieldMask>,
385    {
386        self.update_mask = std::option::Option::Some(v.into());
387        self
388    }
389
390    /// Sets or clears the value of [update_mask][crate::model::UpdateActiveDirectoryRequest::update_mask].
391    ///
392    /// # Example
393    /// ```ignore,no_run
394    /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
395    /// use wkt::FieldMask;
396    /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
397    /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_update_mask(None::<FieldMask>);
398    /// ```
399    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
400    where
401        T: std::convert::Into<wkt::FieldMask>,
402    {
403        self.update_mask = v.map(|x| x.into());
404        self
405    }
406
407    /// Sets the value of [active_directory][crate::model::UpdateActiveDirectoryRequest::active_directory].
408    ///
409    /// # Example
410    /// ```ignore,no_run
411    /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
412    /// use google_cloud_netapp_v1::model::ActiveDirectory;
413    /// let x = UpdateActiveDirectoryRequest::new().set_active_directory(ActiveDirectory::default()/* use setters */);
414    /// ```
415    pub fn set_active_directory<T>(mut self, v: T) -> Self
416    where
417        T: std::convert::Into<crate::model::ActiveDirectory>,
418    {
419        self.active_directory = std::option::Option::Some(v.into());
420        self
421    }
422
423    /// Sets or clears the value of [active_directory][crate::model::UpdateActiveDirectoryRequest::active_directory].
424    ///
425    /// # Example
426    /// ```ignore,no_run
427    /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
428    /// use google_cloud_netapp_v1::model::ActiveDirectory;
429    /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_active_directory(Some(ActiveDirectory::default()/* use setters */));
430    /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_active_directory(None::<ActiveDirectory>);
431    /// ```
432    pub fn set_or_clear_active_directory<T>(mut self, v: std::option::Option<T>) -> Self
433    where
434        T: std::convert::Into<crate::model::ActiveDirectory>,
435    {
436        self.active_directory = v.map(|x| x.into());
437        self
438    }
439}
440
441impl wkt::message::Message for UpdateActiveDirectoryRequest {
442    fn typename() -> &'static str {
443        "type.googleapis.com/google.cloud.netapp.v1.UpdateActiveDirectoryRequest"
444    }
445}
446
447/// DeleteActiveDirectoryRequest for deleting a single active directory.
448#[derive(Clone, Default, PartialEq)]
449#[non_exhaustive]
450pub struct DeleteActiveDirectoryRequest {
451    /// Required. Name of the active directory.
452    pub name: std::string::String,
453
454    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
455}
456
457impl DeleteActiveDirectoryRequest {
458    pub fn new() -> Self {
459        std::default::Default::default()
460    }
461
462    /// Sets the value of [name][crate::model::DeleteActiveDirectoryRequest::name].
463    ///
464    /// # Example
465    /// ```ignore,no_run
466    /// # use google_cloud_netapp_v1::model::DeleteActiveDirectoryRequest;
467    /// let x = DeleteActiveDirectoryRequest::new().set_name("example");
468    /// ```
469    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
470        self.name = v.into();
471        self
472    }
473}
474
475impl wkt::message::Message for DeleteActiveDirectoryRequest {
476    fn typename() -> &'static str {
477        "type.googleapis.com/google.cloud.netapp.v1.DeleteActiveDirectoryRequest"
478    }
479}
480
481/// ActiveDirectory is the public representation of the active directory config.
482#[derive(Clone, Default, PartialEq)]
483#[non_exhaustive]
484pub struct ActiveDirectory {
485    /// Identifier. The resource name of the active directory.
486    /// Format:
487    /// `projects/{project_number}/locations/{location_id}/activeDirectories/{active_directory_id}`.
488    pub name: std::string::String,
489
490    /// Output only. Create time of the active directory.
491    pub create_time: std::option::Option<wkt::Timestamp>,
492
493    /// Output only. The state of the AD.
494    pub state: crate::model::active_directory::State,
495
496    /// Required. Name of the Active Directory domain
497    pub domain: std::string::String,
498
499    /// The Active Directory site the service will limit Domain Controller
500    /// discovery too.
501    pub site: std::string::String,
502
503    /// Required. Comma separated list of DNS server IP addresses for the Active
504    /// Directory domain.
505    pub dns: std::string::String,
506
507    /// Required. NetBIOSPrefix is used as a prefix for SMB server name.
508    pub net_bios_prefix: std::string::String,
509
510    /// The Organizational Unit (OU) within the Windows Active Directory the user
511    /// belongs to.
512    pub organizational_unit: std::string::String,
513
514    /// If enabled, AES encryption will be enabled for SMB communication.
515    pub aes_encryption: bool,
516
517    /// Required. Username of the Active Directory domain administrator.
518    pub username: std::string::String,
519
520    /// Required. Password of the Active Directory domain administrator.
521    pub password: std::string::String,
522
523    /// Optional. Users to be added to the Built-in Backup Operator active
524    /// directory group.
525    pub backup_operators: std::vec::Vec<std::string::String>,
526
527    /// Optional. Users to be added to the Built-in Admininstrators group.
528    pub administrators: std::vec::Vec<std::string::String>,
529
530    /// Optional. Domain users to be given the SeSecurityPrivilege.
531    pub security_operators: std::vec::Vec<std::string::String>,
532
533    /// Name of the active directory machine. This optional parameter is used only
534    /// while creating kerberos volume
535    pub kdc_hostname: std::string::String,
536
537    /// KDC server IP address for the active directory machine.
538    pub kdc_ip: std::string::String,
539
540    /// If enabled, will allow access to local users and LDAP users. If access is
541    /// needed for only LDAP users, it has to be disabled.
542    pub nfs_users_with_ldap: bool,
543
544    /// Description of the active directory.
545    pub description: std::string::String,
546
547    /// Specifies whether or not the LDAP traffic needs to be signed.
548    pub ldap_signing: bool,
549
550    /// If enabled, traffic between the SMB server to Domain Controller (DC) will
551    /// be encrypted.
552    pub encrypt_dc_connections: bool,
553
554    /// Labels for the active directory.
555    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
556
557    /// Output only. The state details of the Active Directory.
558    pub state_details: std::string::String,
559
560    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
561}
562
563impl ActiveDirectory {
564    pub fn new() -> Self {
565        std::default::Default::default()
566    }
567
568    /// Sets the value of [name][crate::model::ActiveDirectory::name].
569    ///
570    /// # Example
571    /// ```ignore,no_run
572    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
573    /// let x = ActiveDirectory::new().set_name("example");
574    /// ```
575    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
576        self.name = v.into();
577        self
578    }
579
580    /// Sets the value of [create_time][crate::model::ActiveDirectory::create_time].
581    ///
582    /// # Example
583    /// ```ignore,no_run
584    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
585    /// use wkt::Timestamp;
586    /// let x = ActiveDirectory::new().set_create_time(Timestamp::default()/* use setters */);
587    /// ```
588    pub fn set_create_time<T>(mut self, v: T) -> Self
589    where
590        T: std::convert::Into<wkt::Timestamp>,
591    {
592        self.create_time = std::option::Option::Some(v.into());
593        self
594    }
595
596    /// Sets or clears the value of [create_time][crate::model::ActiveDirectory::create_time].
597    ///
598    /// # Example
599    /// ```ignore,no_run
600    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
601    /// use wkt::Timestamp;
602    /// let x = ActiveDirectory::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
603    /// let x = ActiveDirectory::new().set_or_clear_create_time(None::<Timestamp>);
604    /// ```
605    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
606    where
607        T: std::convert::Into<wkt::Timestamp>,
608    {
609        self.create_time = v.map(|x| x.into());
610        self
611    }
612
613    /// Sets the value of [state][crate::model::ActiveDirectory::state].
614    ///
615    /// # Example
616    /// ```ignore,no_run
617    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
618    /// use google_cloud_netapp_v1::model::active_directory::State;
619    /// let x0 = ActiveDirectory::new().set_state(State::Creating);
620    /// let x1 = ActiveDirectory::new().set_state(State::Ready);
621    /// let x2 = ActiveDirectory::new().set_state(State::Updating);
622    /// ```
623    pub fn set_state<T: std::convert::Into<crate::model::active_directory::State>>(
624        mut self,
625        v: T,
626    ) -> Self {
627        self.state = v.into();
628        self
629    }
630
631    /// Sets the value of [domain][crate::model::ActiveDirectory::domain].
632    ///
633    /// # Example
634    /// ```ignore,no_run
635    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
636    /// let x = ActiveDirectory::new().set_domain("example");
637    /// ```
638    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
639        self.domain = v.into();
640        self
641    }
642
643    /// Sets the value of [site][crate::model::ActiveDirectory::site].
644    ///
645    /// # Example
646    /// ```ignore,no_run
647    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
648    /// let x = ActiveDirectory::new().set_site("example");
649    /// ```
650    pub fn set_site<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
651        self.site = v.into();
652        self
653    }
654
655    /// Sets the value of [dns][crate::model::ActiveDirectory::dns].
656    ///
657    /// # Example
658    /// ```ignore,no_run
659    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
660    /// let x = ActiveDirectory::new().set_dns("example");
661    /// ```
662    pub fn set_dns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
663        self.dns = v.into();
664        self
665    }
666
667    /// Sets the value of [net_bios_prefix][crate::model::ActiveDirectory::net_bios_prefix].
668    ///
669    /// # Example
670    /// ```ignore,no_run
671    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
672    /// let x = ActiveDirectory::new().set_net_bios_prefix("example");
673    /// ```
674    pub fn set_net_bios_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
675        self.net_bios_prefix = v.into();
676        self
677    }
678
679    /// Sets the value of [organizational_unit][crate::model::ActiveDirectory::organizational_unit].
680    ///
681    /// # Example
682    /// ```ignore,no_run
683    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
684    /// let x = ActiveDirectory::new().set_organizational_unit("example");
685    /// ```
686    pub fn set_organizational_unit<T: std::convert::Into<std::string::String>>(
687        mut self,
688        v: T,
689    ) -> Self {
690        self.organizational_unit = v.into();
691        self
692    }
693
694    /// Sets the value of [aes_encryption][crate::model::ActiveDirectory::aes_encryption].
695    ///
696    /// # Example
697    /// ```ignore,no_run
698    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
699    /// let x = ActiveDirectory::new().set_aes_encryption(true);
700    /// ```
701    pub fn set_aes_encryption<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
702        self.aes_encryption = v.into();
703        self
704    }
705
706    /// Sets the value of [username][crate::model::ActiveDirectory::username].
707    ///
708    /// # Example
709    /// ```ignore,no_run
710    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
711    /// let x = ActiveDirectory::new().set_username("example");
712    /// ```
713    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
714        self.username = v.into();
715        self
716    }
717
718    /// Sets the value of [password][crate::model::ActiveDirectory::password].
719    ///
720    /// # Example
721    /// ```ignore,no_run
722    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
723    /// let x = ActiveDirectory::new().set_password("example");
724    /// ```
725    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
726        self.password = v.into();
727        self
728    }
729
730    /// Sets the value of [backup_operators][crate::model::ActiveDirectory::backup_operators].
731    ///
732    /// # Example
733    /// ```ignore,no_run
734    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
735    /// let x = ActiveDirectory::new().set_backup_operators(["a", "b", "c"]);
736    /// ```
737    pub fn set_backup_operators<T, V>(mut self, v: T) -> Self
738    where
739        T: std::iter::IntoIterator<Item = V>,
740        V: std::convert::Into<std::string::String>,
741    {
742        use std::iter::Iterator;
743        self.backup_operators = v.into_iter().map(|i| i.into()).collect();
744        self
745    }
746
747    /// Sets the value of [administrators][crate::model::ActiveDirectory::administrators].
748    ///
749    /// # Example
750    /// ```ignore,no_run
751    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
752    /// let x = ActiveDirectory::new().set_administrators(["a", "b", "c"]);
753    /// ```
754    pub fn set_administrators<T, V>(mut self, v: T) -> Self
755    where
756        T: std::iter::IntoIterator<Item = V>,
757        V: std::convert::Into<std::string::String>,
758    {
759        use std::iter::Iterator;
760        self.administrators = v.into_iter().map(|i| i.into()).collect();
761        self
762    }
763
764    /// Sets the value of [security_operators][crate::model::ActiveDirectory::security_operators].
765    ///
766    /// # Example
767    /// ```ignore,no_run
768    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
769    /// let x = ActiveDirectory::new().set_security_operators(["a", "b", "c"]);
770    /// ```
771    pub fn set_security_operators<T, V>(mut self, v: T) -> Self
772    where
773        T: std::iter::IntoIterator<Item = V>,
774        V: std::convert::Into<std::string::String>,
775    {
776        use std::iter::Iterator;
777        self.security_operators = v.into_iter().map(|i| i.into()).collect();
778        self
779    }
780
781    /// Sets the value of [kdc_hostname][crate::model::ActiveDirectory::kdc_hostname].
782    ///
783    /// # Example
784    /// ```ignore,no_run
785    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
786    /// let x = ActiveDirectory::new().set_kdc_hostname("example");
787    /// ```
788    pub fn set_kdc_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
789        self.kdc_hostname = v.into();
790        self
791    }
792
793    /// Sets the value of [kdc_ip][crate::model::ActiveDirectory::kdc_ip].
794    ///
795    /// # Example
796    /// ```ignore,no_run
797    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
798    /// let x = ActiveDirectory::new().set_kdc_ip("example");
799    /// ```
800    pub fn set_kdc_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
801        self.kdc_ip = v.into();
802        self
803    }
804
805    /// Sets the value of [nfs_users_with_ldap][crate::model::ActiveDirectory::nfs_users_with_ldap].
806    ///
807    /// # Example
808    /// ```ignore,no_run
809    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
810    /// let x = ActiveDirectory::new().set_nfs_users_with_ldap(true);
811    /// ```
812    pub fn set_nfs_users_with_ldap<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
813        self.nfs_users_with_ldap = v.into();
814        self
815    }
816
817    /// Sets the value of [description][crate::model::ActiveDirectory::description].
818    ///
819    /// # Example
820    /// ```ignore,no_run
821    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
822    /// let x = ActiveDirectory::new().set_description("example");
823    /// ```
824    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
825        self.description = v.into();
826        self
827    }
828
829    /// Sets the value of [ldap_signing][crate::model::ActiveDirectory::ldap_signing].
830    ///
831    /// # Example
832    /// ```ignore,no_run
833    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
834    /// let x = ActiveDirectory::new().set_ldap_signing(true);
835    /// ```
836    pub fn set_ldap_signing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
837        self.ldap_signing = v.into();
838        self
839    }
840
841    /// Sets the value of [encrypt_dc_connections][crate::model::ActiveDirectory::encrypt_dc_connections].
842    ///
843    /// # Example
844    /// ```ignore,no_run
845    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
846    /// let x = ActiveDirectory::new().set_encrypt_dc_connections(true);
847    /// ```
848    pub fn set_encrypt_dc_connections<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
849        self.encrypt_dc_connections = v.into();
850        self
851    }
852
853    /// Sets the value of [labels][crate::model::ActiveDirectory::labels].
854    ///
855    /// # Example
856    /// ```ignore,no_run
857    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
858    /// let x = ActiveDirectory::new().set_labels([
859    ///     ("key0", "abc"),
860    ///     ("key1", "xyz"),
861    /// ]);
862    /// ```
863    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
864    where
865        T: std::iter::IntoIterator<Item = (K, V)>,
866        K: std::convert::Into<std::string::String>,
867        V: std::convert::Into<std::string::String>,
868    {
869        use std::iter::Iterator;
870        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
871        self
872    }
873
874    /// Sets the value of [state_details][crate::model::ActiveDirectory::state_details].
875    ///
876    /// # Example
877    /// ```ignore,no_run
878    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
879    /// let x = ActiveDirectory::new().set_state_details("example");
880    /// ```
881    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
882        self.state_details = v.into();
883        self
884    }
885}
886
887impl wkt::message::Message for ActiveDirectory {
888    fn typename() -> &'static str {
889        "type.googleapis.com/google.cloud.netapp.v1.ActiveDirectory"
890    }
891}
892
893/// Defines additional types related to [ActiveDirectory].
894pub mod active_directory {
895    #[allow(unused_imports)]
896    use super::*;
897
898    /// The Active Directory States
899    ///
900    /// # Working with unknown values
901    ///
902    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
903    /// additional enum variants at any time. Adding new variants is not considered
904    /// a breaking change. Applications should write their code in anticipation of:
905    ///
906    /// - New values appearing in future releases of the client library, **and**
907    /// - New values received dynamically, without application changes.
908    ///
909    /// Please consult the [Working with enums] section in the user guide for some
910    /// guidelines.
911    ///
912    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
913    #[derive(Clone, Debug, PartialEq)]
914    #[non_exhaustive]
915    pub enum State {
916        /// Unspecified Active Directory State
917        Unspecified,
918        /// Active Directory State is Creating
919        Creating,
920        /// Active Directory State is Ready
921        Ready,
922        /// Active Directory State is Updating
923        Updating,
924        /// Active Directory State is In use
925        InUse,
926        /// Active Directory State is Deleting
927        Deleting,
928        /// Active Directory State is Error
929        Error,
930        /// Active Directory State is Diagnosing.
931        Diagnosing,
932        /// If set, the enum was initialized with an unknown value.
933        ///
934        /// Applications can examine the value using [State::value] or
935        /// [State::name].
936        UnknownValue(state::UnknownValue),
937    }
938
939    #[doc(hidden)]
940    pub mod state {
941        #[allow(unused_imports)]
942        use super::*;
943        #[derive(Clone, Debug, PartialEq)]
944        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
945    }
946
947    impl State {
948        /// Gets the enum value.
949        ///
950        /// Returns `None` if the enum contains an unknown value deserialized from
951        /// the string representation of enums.
952        pub fn value(&self) -> std::option::Option<i32> {
953            match self {
954                Self::Unspecified => std::option::Option::Some(0),
955                Self::Creating => std::option::Option::Some(1),
956                Self::Ready => std::option::Option::Some(2),
957                Self::Updating => std::option::Option::Some(3),
958                Self::InUse => std::option::Option::Some(4),
959                Self::Deleting => std::option::Option::Some(5),
960                Self::Error => std::option::Option::Some(6),
961                Self::Diagnosing => std::option::Option::Some(7),
962                Self::UnknownValue(u) => u.0.value(),
963            }
964        }
965
966        /// Gets the enum value as a string.
967        ///
968        /// Returns `None` if the enum contains an unknown value deserialized from
969        /// the integer representation of enums.
970        pub fn name(&self) -> std::option::Option<&str> {
971            match self {
972                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
973                Self::Creating => std::option::Option::Some("CREATING"),
974                Self::Ready => std::option::Option::Some("READY"),
975                Self::Updating => std::option::Option::Some("UPDATING"),
976                Self::InUse => std::option::Option::Some("IN_USE"),
977                Self::Deleting => std::option::Option::Some("DELETING"),
978                Self::Error => std::option::Option::Some("ERROR"),
979                Self::Diagnosing => std::option::Option::Some("DIAGNOSING"),
980                Self::UnknownValue(u) => u.0.name(),
981            }
982        }
983    }
984
985    impl std::default::Default for State {
986        fn default() -> Self {
987            use std::convert::From;
988            Self::from(0)
989        }
990    }
991
992    impl std::fmt::Display for State {
993        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
994            wkt::internal::display_enum(f, self.name(), self.value())
995        }
996    }
997
998    impl std::convert::From<i32> for State {
999        fn from(value: i32) -> Self {
1000            match value {
1001                0 => Self::Unspecified,
1002                1 => Self::Creating,
1003                2 => Self::Ready,
1004                3 => Self::Updating,
1005                4 => Self::InUse,
1006                5 => Self::Deleting,
1007                6 => Self::Error,
1008                7 => Self::Diagnosing,
1009                _ => Self::UnknownValue(state::UnknownValue(
1010                    wkt::internal::UnknownEnumValue::Integer(value),
1011                )),
1012            }
1013        }
1014    }
1015
1016    impl std::convert::From<&str> for State {
1017        fn from(value: &str) -> Self {
1018            use std::string::ToString;
1019            match value {
1020                "STATE_UNSPECIFIED" => Self::Unspecified,
1021                "CREATING" => Self::Creating,
1022                "READY" => Self::Ready,
1023                "UPDATING" => Self::Updating,
1024                "IN_USE" => Self::InUse,
1025                "DELETING" => Self::Deleting,
1026                "ERROR" => Self::Error,
1027                "DIAGNOSING" => Self::Diagnosing,
1028                _ => Self::UnknownValue(state::UnknownValue(
1029                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1030                )),
1031            }
1032        }
1033    }
1034
1035    impl serde::ser::Serialize for State {
1036        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1037        where
1038            S: serde::Serializer,
1039        {
1040            match self {
1041                Self::Unspecified => serializer.serialize_i32(0),
1042                Self::Creating => serializer.serialize_i32(1),
1043                Self::Ready => serializer.serialize_i32(2),
1044                Self::Updating => serializer.serialize_i32(3),
1045                Self::InUse => serializer.serialize_i32(4),
1046                Self::Deleting => serializer.serialize_i32(5),
1047                Self::Error => serializer.serialize_i32(6),
1048                Self::Diagnosing => serializer.serialize_i32(7),
1049                Self::UnknownValue(u) => u.0.serialize(serializer),
1050            }
1051        }
1052    }
1053
1054    impl<'de> serde::de::Deserialize<'de> for State {
1055        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1056        where
1057            D: serde::Deserializer<'de>,
1058        {
1059            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1060                ".google.cloud.netapp.v1.ActiveDirectory.State",
1061            ))
1062        }
1063    }
1064}
1065
1066/// A NetApp Backup.
1067#[derive(Clone, Default, PartialEq)]
1068#[non_exhaustive]
1069pub struct Backup {
1070    /// Identifier. The resource name of the backup.
1071    /// Format:
1072    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`.
1073    pub name: std::string::String,
1074
1075    /// Output only. The backup state.
1076    pub state: crate::model::backup::State,
1077
1078    /// A description of the backup with 2048 characters or less.
1079    /// Requests with longer descriptions will be rejected.
1080    pub description: std::string::String,
1081
1082    /// Output only. Size of the file system when the backup was created. When
1083    /// creating a new volume from the backup, the volume capacity will have to be
1084    /// at least as big.
1085    pub volume_usage_bytes: i64,
1086
1087    /// Output only. Type of backup, manually created or created by a backup
1088    /// policy.
1089    pub backup_type: crate::model::backup::Type,
1090
1091    /// Volume full name of this backup belongs to.
1092    /// Format:
1093    /// `projects/{projects_id}/locations/{location}/volumes/{volume_id}`
1094    pub source_volume: std::string::String,
1095
1096    /// If specified, backup will be created from the given snapshot.
1097    /// If not specified, there will be a new snapshot taken to initiate the backup
1098    /// creation. Format:
1099    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`
1100    pub source_snapshot: std::option::Option<std::string::String>,
1101
1102    /// Output only. The time when the backup was created.
1103    pub create_time: std::option::Option<wkt::Timestamp>,
1104
1105    /// Resource labels to represent user provided metadata.
1106    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1107
1108    /// Output only. Total size of all backups in a chain in bytes = baseline
1109    /// backup size + sum(incremental backup size)
1110    pub chain_storage_bytes: i64,
1111
1112    /// Output only. Reserved for future use
1113    pub satisfies_pzs: bool,
1114
1115    /// Output only. Reserved for future use
1116    pub satisfies_pzi: bool,
1117
1118    /// Output only. Region of the volume from which the backup was created.
1119    /// Format: `projects/{project_id}/locations/{location}`
1120    pub volume_region: std::string::String,
1121
1122    /// Output only. Region in which backup is stored.
1123    /// Format: `projects/{project_id}/locations/{location}`
1124    pub backup_region: std::string::String,
1125
1126    /// Output only. The time until which the backup is not deletable.
1127    pub enforced_retention_end_time: std::option::Option<wkt::Timestamp>,
1128
1129    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1130}
1131
1132impl Backup {
1133    pub fn new() -> Self {
1134        std::default::Default::default()
1135    }
1136
1137    /// Sets the value of [name][crate::model::Backup::name].
1138    ///
1139    /// # Example
1140    /// ```ignore,no_run
1141    /// # use google_cloud_netapp_v1::model::Backup;
1142    /// let x = Backup::new().set_name("example");
1143    /// ```
1144    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1145        self.name = v.into();
1146        self
1147    }
1148
1149    /// Sets the value of [state][crate::model::Backup::state].
1150    ///
1151    /// # Example
1152    /// ```ignore,no_run
1153    /// # use google_cloud_netapp_v1::model::Backup;
1154    /// use google_cloud_netapp_v1::model::backup::State;
1155    /// let x0 = Backup::new().set_state(State::Creating);
1156    /// let x1 = Backup::new().set_state(State::Uploading);
1157    /// let x2 = Backup::new().set_state(State::Ready);
1158    /// ```
1159    pub fn set_state<T: std::convert::Into<crate::model::backup::State>>(mut self, v: T) -> Self {
1160        self.state = v.into();
1161        self
1162    }
1163
1164    /// Sets the value of [description][crate::model::Backup::description].
1165    ///
1166    /// # Example
1167    /// ```ignore,no_run
1168    /// # use google_cloud_netapp_v1::model::Backup;
1169    /// let x = Backup::new().set_description("example");
1170    /// ```
1171    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1172        self.description = v.into();
1173        self
1174    }
1175
1176    /// Sets the value of [volume_usage_bytes][crate::model::Backup::volume_usage_bytes].
1177    ///
1178    /// # Example
1179    /// ```ignore,no_run
1180    /// # use google_cloud_netapp_v1::model::Backup;
1181    /// let x = Backup::new().set_volume_usage_bytes(42);
1182    /// ```
1183    pub fn set_volume_usage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1184        self.volume_usage_bytes = v.into();
1185        self
1186    }
1187
1188    /// Sets the value of [backup_type][crate::model::Backup::backup_type].
1189    ///
1190    /// # Example
1191    /// ```ignore,no_run
1192    /// # use google_cloud_netapp_v1::model::Backup;
1193    /// use google_cloud_netapp_v1::model::backup::Type;
1194    /// let x0 = Backup::new().set_backup_type(Type::Manual);
1195    /// let x1 = Backup::new().set_backup_type(Type::Scheduled);
1196    /// ```
1197    pub fn set_backup_type<T: std::convert::Into<crate::model::backup::Type>>(
1198        mut self,
1199        v: T,
1200    ) -> Self {
1201        self.backup_type = v.into();
1202        self
1203    }
1204
1205    /// Sets the value of [source_volume][crate::model::Backup::source_volume].
1206    ///
1207    /// # Example
1208    /// ```ignore,no_run
1209    /// # use google_cloud_netapp_v1::model::Backup;
1210    /// let x = Backup::new().set_source_volume("example");
1211    /// ```
1212    pub fn set_source_volume<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1213        self.source_volume = v.into();
1214        self
1215    }
1216
1217    /// Sets the value of [source_snapshot][crate::model::Backup::source_snapshot].
1218    ///
1219    /// # Example
1220    /// ```ignore,no_run
1221    /// # use google_cloud_netapp_v1::model::Backup;
1222    /// let x = Backup::new().set_source_snapshot("example");
1223    /// ```
1224    pub fn set_source_snapshot<T>(mut self, v: T) -> Self
1225    where
1226        T: std::convert::Into<std::string::String>,
1227    {
1228        self.source_snapshot = std::option::Option::Some(v.into());
1229        self
1230    }
1231
1232    /// Sets or clears the value of [source_snapshot][crate::model::Backup::source_snapshot].
1233    ///
1234    /// # Example
1235    /// ```ignore,no_run
1236    /// # use google_cloud_netapp_v1::model::Backup;
1237    /// let x = Backup::new().set_or_clear_source_snapshot(Some("example"));
1238    /// let x = Backup::new().set_or_clear_source_snapshot(None::<String>);
1239    /// ```
1240    pub fn set_or_clear_source_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
1241    where
1242        T: std::convert::Into<std::string::String>,
1243    {
1244        self.source_snapshot = v.map(|x| x.into());
1245        self
1246    }
1247
1248    /// Sets the value of [create_time][crate::model::Backup::create_time].
1249    ///
1250    /// # Example
1251    /// ```ignore,no_run
1252    /// # use google_cloud_netapp_v1::model::Backup;
1253    /// use wkt::Timestamp;
1254    /// let x = Backup::new().set_create_time(Timestamp::default()/* use setters */);
1255    /// ```
1256    pub fn set_create_time<T>(mut self, v: T) -> Self
1257    where
1258        T: std::convert::Into<wkt::Timestamp>,
1259    {
1260        self.create_time = std::option::Option::Some(v.into());
1261        self
1262    }
1263
1264    /// Sets or clears the value of [create_time][crate::model::Backup::create_time].
1265    ///
1266    /// # Example
1267    /// ```ignore,no_run
1268    /// # use google_cloud_netapp_v1::model::Backup;
1269    /// use wkt::Timestamp;
1270    /// let x = Backup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1271    /// let x = Backup::new().set_or_clear_create_time(None::<Timestamp>);
1272    /// ```
1273    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1274    where
1275        T: std::convert::Into<wkt::Timestamp>,
1276    {
1277        self.create_time = v.map(|x| x.into());
1278        self
1279    }
1280
1281    /// Sets the value of [labels][crate::model::Backup::labels].
1282    ///
1283    /// # Example
1284    /// ```ignore,no_run
1285    /// # use google_cloud_netapp_v1::model::Backup;
1286    /// let x = Backup::new().set_labels([
1287    ///     ("key0", "abc"),
1288    ///     ("key1", "xyz"),
1289    /// ]);
1290    /// ```
1291    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1292    where
1293        T: std::iter::IntoIterator<Item = (K, V)>,
1294        K: std::convert::Into<std::string::String>,
1295        V: std::convert::Into<std::string::String>,
1296    {
1297        use std::iter::Iterator;
1298        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1299        self
1300    }
1301
1302    /// Sets the value of [chain_storage_bytes][crate::model::Backup::chain_storage_bytes].
1303    ///
1304    /// # Example
1305    /// ```ignore,no_run
1306    /// # use google_cloud_netapp_v1::model::Backup;
1307    /// let x = Backup::new().set_chain_storage_bytes(42);
1308    /// ```
1309    pub fn set_chain_storage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1310        self.chain_storage_bytes = v.into();
1311        self
1312    }
1313
1314    /// Sets the value of [satisfies_pzs][crate::model::Backup::satisfies_pzs].
1315    ///
1316    /// # Example
1317    /// ```ignore,no_run
1318    /// # use google_cloud_netapp_v1::model::Backup;
1319    /// let x = Backup::new().set_satisfies_pzs(true);
1320    /// ```
1321    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1322        self.satisfies_pzs = v.into();
1323        self
1324    }
1325
1326    /// Sets the value of [satisfies_pzi][crate::model::Backup::satisfies_pzi].
1327    ///
1328    /// # Example
1329    /// ```ignore,no_run
1330    /// # use google_cloud_netapp_v1::model::Backup;
1331    /// let x = Backup::new().set_satisfies_pzi(true);
1332    /// ```
1333    pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1334        self.satisfies_pzi = v.into();
1335        self
1336    }
1337
1338    /// Sets the value of [volume_region][crate::model::Backup::volume_region].
1339    ///
1340    /// # Example
1341    /// ```ignore,no_run
1342    /// # use google_cloud_netapp_v1::model::Backup;
1343    /// let x = Backup::new().set_volume_region("example");
1344    /// ```
1345    pub fn set_volume_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1346        self.volume_region = v.into();
1347        self
1348    }
1349
1350    /// Sets the value of [backup_region][crate::model::Backup::backup_region].
1351    ///
1352    /// # Example
1353    /// ```ignore,no_run
1354    /// # use google_cloud_netapp_v1::model::Backup;
1355    /// let x = Backup::new().set_backup_region("example");
1356    /// ```
1357    pub fn set_backup_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1358        self.backup_region = v.into();
1359        self
1360    }
1361
1362    /// Sets the value of [enforced_retention_end_time][crate::model::Backup::enforced_retention_end_time].
1363    ///
1364    /// # Example
1365    /// ```ignore,no_run
1366    /// # use google_cloud_netapp_v1::model::Backup;
1367    /// use wkt::Timestamp;
1368    /// let x = Backup::new().set_enforced_retention_end_time(Timestamp::default()/* use setters */);
1369    /// ```
1370    pub fn set_enforced_retention_end_time<T>(mut self, v: T) -> Self
1371    where
1372        T: std::convert::Into<wkt::Timestamp>,
1373    {
1374        self.enforced_retention_end_time = std::option::Option::Some(v.into());
1375        self
1376    }
1377
1378    /// Sets or clears the value of [enforced_retention_end_time][crate::model::Backup::enforced_retention_end_time].
1379    ///
1380    /// # Example
1381    /// ```ignore,no_run
1382    /// # use google_cloud_netapp_v1::model::Backup;
1383    /// use wkt::Timestamp;
1384    /// let x = Backup::new().set_or_clear_enforced_retention_end_time(Some(Timestamp::default()/* use setters */));
1385    /// let x = Backup::new().set_or_clear_enforced_retention_end_time(None::<Timestamp>);
1386    /// ```
1387    pub fn set_or_clear_enforced_retention_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1388    where
1389        T: std::convert::Into<wkt::Timestamp>,
1390    {
1391        self.enforced_retention_end_time = v.map(|x| x.into());
1392        self
1393    }
1394}
1395
1396impl wkt::message::Message for Backup {
1397    fn typename() -> &'static str {
1398        "type.googleapis.com/google.cloud.netapp.v1.Backup"
1399    }
1400}
1401
1402/// Defines additional types related to [Backup].
1403pub mod backup {
1404    #[allow(unused_imports)]
1405    use super::*;
1406
1407    /// The Backup States
1408    ///
1409    /// # Working with unknown values
1410    ///
1411    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1412    /// additional enum variants at any time. Adding new variants is not considered
1413    /// a breaking change. Applications should write their code in anticipation of:
1414    ///
1415    /// - New values appearing in future releases of the client library, **and**
1416    /// - New values received dynamically, without application changes.
1417    ///
1418    /// Please consult the [Working with enums] section in the user guide for some
1419    /// guidelines.
1420    ///
1421    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1422    #[derive(Clone, Debug, PartialEq)]
1423    #[non_exhaustive]
1424    pub enum State {
1425        /// State not set.
1426        Unspecified,
1427        /// Backup is being created. While in this state, the snapshot for the backup
1428        /// point-in-time may not have been created yet, and so the point-in-time may
1429        /// not have been fixed.
1430        Creating,
1431        /// Backup is being uploaded. While in this state, none of the writes to the
1432        /// volume will be included in the backup.
1433        Uploading,
1434        /// Backup is available for use.
1435        Ready,
1436        /// Backup is being deleted.
1437        Deleting,
1438        /// Backup is not valid and cannot be used for creating new volumes or
1439        /// restoring existing volumes.
1440        Error,
1441        /// Backup is being updated.
1442        Updating,
1443        /// If set, the enum was initialized with an unknown value.
1444        ///
1445        /// Applications can examine the value using [State::value] or
1446        /// [State::name].
1447        UnknownValue(state::UnknownValue),
1448    }
1449
1450    #[doc(hidden)]
1451    pub mod state {
1452        #[allow(unused_imports)]
1453        use super::*;
1454        #[derive(Clone, Debug, PartialEq)]
1455        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1456    }
1457
1458    impl State {
1459        /// Gets the enum value.
1460        ///
1461        /// Returns `None` if the enum contains an unknown value deserialized from
1462        /// the string representation of enums.
1463        pub fn value(&self) -> std::option::Option<i32> {
1464            match self {
1465                Self::Unspecified => std::option::Option::Some(0),
1466                Self::Creating => std::option::Option::Some(1),
1467                Self::Uploading => std::option::Option::Some(2),
1468                Self::Ready => std::option::Option::Some(3),
1469                Self::Deleting => std::option::Option::Some(4),
1470                Self::Error => std::option::Option::Some(5),
1471                Self::Updating => std::option::Option::Some(6),
1472                Self::UnknownValue(u) => u.0.value(),
1473            }
1474        }
1475
1476        /// Gets the enum value as a string.
1477        ///
1478        /// Returns `None` if the enum contains an unknown value deserialized from
1479        /// the integer representation of enums.
1480        pub fn name(&self) -> std::option::Option<&str> {
1481            match self {
1482                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1483                Self::Creating => std::option::Option::Some("CREATING"),
1484                Self::Uploading => std::option::Option::Some("UPLOADING"),
1485                Self::Ready => std::option::Option::Some("READY"),
1486                Self::Deleting => std::option::Option::Some("DELETING"),
1487                Self::Error => std::option::Option::Some("ERROR"),
1488                Self::Updating => std::option::Option::Some("UPDATING"),
1489                Self::UnknownValue(u) => u.0.name(),
1490            }
1491        }
1492    }
1493
1494    impl std::default::Default for State {
1495        fn default() -> Self {
1496            use std::convert::From;
1497            Self::from(0)
1498        }
1499    }
1500
1501    impl std::fmt::Display for State {
1502        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1503            wkt::internal::display_enum(f, self.name(), self.value())
1504        }
1505    }
1506
1507    impl std::convert::From<i32> for State {
1508        fn from(value: i32) -> Self {
1509            match value {
1510                0 => Self::Unspecified,
1511                1 => Self::Creating,
1512                2 => Self::Uploading,
1513                3 => Self::Ready,
1514                4 => Self::Deleting,
1515                5 => Self::Error,
1516                6 => Self::Updating,
1517                _ => Self::UnknownValue(state::UnknownValue(
1518                    wkt::internal::UnknownEnumValue::Integer(value),
1519                )),
1520            }
1521        }
1522    }
1523
1524    impl std::convert::From<&str> for State {
1525        fn from(value: &str) -> Self {
1526            use std::string::ToString;
1527            match value {
1528                "STATE_UNSPECIFIED" => Self::Unspecified,
1529                "CREATING" => Self::Creating,
1530                "UPLOADING" => Self::Uploading,
1531                "READY" => Self::Ready,
1532                "DELETING" => Self::Deleting,
1533                "ERROR" => Self::Error,
1534                "UPDATING" => Self::Updating,
1535                _ => Self::UnknownValue(state::UnknownValue(
1536                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1537                )),
1538            }
1539        }
1540    }
1541
1542    impl serde::ser::Serialize for State {
1543        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1544        where
1545            S: serde::Serializer,
1546        {
1547            match self {
1548                Self::Unspecified => serializer.serialize_i32(0),
1549                Self::Creating => serializer.serialize_i32(1),
1550                Self::Uploading => serializer.serialize_i32(2),
1551                Self::Ready => serializer.serialize_i32(3),
1552                Self::Deleting => serializer.serialize_i32(4),
1553                Self::Error => serializer.serialize_i32(5),
1554                Self::Updating => serializer.serialize_i32(6),
1555                Self::UnknownValue(u) => u.0.serialize(serializer),
1556            }
1557        }
1558    }
1559
1560    impl<'de> serde::de::Deserialize<'de> for State {
1561        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1562        where
1563            D: serde::Deserializer<'de>,
1564        {
1565            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1566                ".google.cloud.netapp.v1.Backup.State",
1567            ))
1568        }
1569    }
1570
1571    /// Backup types.
1572    ///
1573    /// # Working with unknown values
1574    ///
1575    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1576    /// additional enum variants at any time. Adding new variants is not considered
1577    /// a breaking change. Applications should write their code in anticipation of:
1578    ///
1579    /// - New values appearing in future releases of the client library, **and**
1580    /// - New values received dynamically, without application changes.
1581    ///
1582    /// Please consult the [Working with enums] section in the user guide for some
1583    /// guidelines.
1584    ///
1585    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1586    #[derive(Clone, Debug, PartialEq)]
1587    #[non_exhaustive]
1588    pub enum Type {
1589        /// Unspecified backup type.
1590        Unspecified,
1591        /// Manual backup type.
1592        Manual,
1593        /// Scheduled backup type.
1594        Scheduled,
1595        /// If set, the enum was initialized with an unknown value.
1596        ///
1597        /// Applications can examine the value using [Type::value] or
1598        /// [Type::name].
1599        UnknownValue(r#type::UnknownValue),
1600    }
1601
1602    #[doc(hidden)]
1603    pub mod r#type {
1604        #[allow(unused_imports)]
1605        use super::*;
1606        #[derive(Clone, Debug, PartialEq)]
1607        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1608    }
1609
1610    impl Type {
1611        /// Gets the enum value.
1612        ///
1613        /// Returns `None` if the enum contains an unknown value deserialized from
1614        /// the string representation of enums.
1615        pub fn value(&self) -> std::option::Option<i32> {
1616            match self {
1617                Self::Unspecified => std::option::Option::Some(0),
1618                Self::Manual => std::option::Option::Some(1),
1619                Self::Scheduled => std::option::Option::Some(2),
1620                Self::UnknownValue(u) => u.0.value(),
1621            }
1622        }
1623
1624        /// Gets the enum value as a string.
1625        ///
1626        /// Returns `None` if the enum contains an unknown value deserialized from
1627        /// the integer representation of enums.
1628        pub fn name(&self) -> std::option::Option<&str> {
1629            match self {
1630                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
1631                Self::Manual => std::option::Option::Some("MANUAL"),
1632                Self::Scheduled => std::option::Option::Some("SCHEDULED"),
1633                Self::UnknownValue(u) => u.0.name(),
1634            }
1635        }
1636    }
1637
1638    impl std::default::Default for Type {
1639        fn default() -> Self {
1640            use std::convert::From;
1641            Self::from(0)
1642        }
1643    }
1644
1645    impl std::fmt::Display for Type {
1646        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1647            wkt::internal::display_enum(f, self.name(), self.value())
1648        }
1649    }
1650
1651    impl std::convert::From<i32> for Type {
1652        fn from(value: i32) -> Self {
1653            match value {
1654                0 => Self::Unspecified,
1655                1 => Self::Manual,
1656                2 => Self::Scheduled,
1657                _ => Self::UnknownValue(r#type::UnknownValue(
1658                    wkt::internal::UnknownEnumValue::Integer(value),
1659                )),
1660            }
1661        }
1662    }
1663
1664    impl std::convert::From<&str> for Type {
1665        fn from(value: &str) -> Self {
1666            use std::string::ToString;
1667            match value {
1668                "TYPE_UNSPECIFIED" => Self::Unspecified,
1669                "MANUAL" => Self::Manual,
1670                "SCHEDULED" => Self::Scheduled,
1671                _ => Self::UnknownValue(r#type::UnknownValue(
1672                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1673                )),
1674            }
1675        }
1676    }
1677
1678    impl serde::ser::Serialize for Type {
1679        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1680        where
1681            S: serde::Serializer,
1682        {
1683            match self {
1684                Self::Unspecified => serializer.serialize_i32(0),
1685                Self::Manual => serializer.serialize_i32(1),
1686                Self::Scheduled => serializer.serialize_i32(2),
1687                Self::UnknownValue(u) => u.0.serialize(serializer),
1688            }
1689        }
1690    }
1691
1692    impl<'de> serde::de::Deserialize<'de> for Type {
1693        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1694        where
1695            D: serde::Deserializer<'de>,
1696        {
1697            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
1698                ".google.cloud.netapp.v1.Backup.Type",
1699            ))
1700        }
1701    }
1702}
1703
1704/// ListBackupsRequest lists backups.
1705#[derive(Clone, Default, PartialEq)]
1706#[non_exhaustive]
1707pub struct ListBackupsRequest {
1708    /// Required. The backupVault for which to retrieve backup information,
1709    /// in the format
1710    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`.
1711    /// To retrieve backup information for all locations, use "-" for the
1712    /// `{location}` value.
1713    /// To retrieve backup information for all backupVaults, use "-" for the
1714    /// `{backup_vault_id}` value.
1715    /// To retrieve backup information for a volume, use "-" for the
1716    /// `{backup_vault_id}` value and specify volume full name with the filter.
1717    pub parent: std::string::String,
1718
1719    /// The maximum number of items to return. The service may return fewer
1720    /// than this value. The maximum value
1721    /// is 1000; values above 1000 will be coerced to 1000.
1722    pub page_size: i32,
1723
1724    /// The next_page_token value to use if there are additional
1725    /// results to retrieve for this list request.
1726    pub page_token: std::string::String,
1727
1728    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
1729    pub order_by: std::string::String,
1730
1731    /// The standard list filter.
1732    /// If specified, backups will be returned based on the attribute name that
1733    /// matches the filter expression. If empty, then no backups are filtered out.
1734    /// See <https://google.aip.dev/160>
1735    pub filter: std::string::String,
1736
1737    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1738}
1739
1740impl ListBackupsRequest {
1741    pub fn new() -> Self {
1742        std::default::Default::default()
1743    }
1744
1745    /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
1746    ///
1747    /// # Example
1748    /// ```ignore,no_run
1749    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1750    /// let x = ListBackupsRequest::new().set_parent("example");
1751    /// ```
1752    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1753        self.parent = v.into();
1754        self
1755    }
1756
1757    /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
1758    ///
1759    /// # Example
1760    /// ```ignore,no_run
1761    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1762    /// let x = ListBackupsRequest::new().set_page_size(42);
1763    /// ```
1764    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1765        self.page_size = v.into();
1766        self
1767    }
1768
1769    /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
1770    ///
1771    /// # Example
1772    /// ```ignore,no_run
1773    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1774    /// let x = ListBackupsRequest::new().set_page_token("example");
1775    /// ```
1776    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1777        self.page_token = v.into();
1778        self
1779    }
1780
1781    /// Sets the value of [order_by][crate::model::ListBackupsRequest::order_by].
1782    ///
1783    /// # Example
1784    /// ```ignore,no_run
1785    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1786    /// let x = ListBackupsRequest::new().set_order_by("example");
1787    /// ```
1788    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1789        self.order_by = v.into();
1790        self
1791    }
1792
1793    /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
1794    ///
1795    /// # Example
1796    /// ```ignore,no_run
1797    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1798    /// let x = ListBackupsRequest::new().set_filter("example");
1799    /// ```
1800    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1801        self.filter = v.into();
1802        self
1803    }
1804}
1805
1806impl wkt::message::Message for ListBackupsRequest {
1807    fn typename() -> &'static str {
1808        "type.googleapis.com/google.cloud.netapp.v1.ListBackupsRequest"
1809    }
1810}
1811
1812/// ListBackupsResponse is the result of ListBackupsRequest.
1813#[derive(Clone, Default, PartialEq)]
1814#[non_exhaustive]
1815pub struct ListBackupsResponse {
1816    /// A list of backups in the project.
1817    pub backups: std::vec::Vec<crate::model::Backup>,
1818
1819    /// The token you can use to retrieve the next page of results. Not returned
1820    /// if there are no more results in the list.
1821    pub next_page_token: std::string::String,
1822
1823    /// Locations that could not be reached.
1824    pub unreachable: std::vec::Vec<std::string::String>,
1825
1826    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1827}
1828
1829impl ListBackupsResponse {
1830    pub fn new() -> Self {
1831        std::default::Default::default()
1832    }
1833
1834    /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
1835    ///
1836    /// # Example
1837    /// ```ignore,no_run
1838    /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1839    /// use google_cloud_netapp_v1::model::Backup;
1840    /// let x = ListBackupsResponse::new()
1841    ///     .set_backups([
1842    ///         Backup::default()/* use setters */,
1843    ///         Backup::default()/* use (different) setters */,
1844    ///     ]);
1845    /// ```
1846    pub fn set_backups<T, V>(mut self, v: T) -> Self
1847    where
1848        T: std::iter::IntoIterator<Item = V>,
1849        V: std::convert::Into<crate::model::Backup>,
1850    {
1851        use std::iter::Iterator;
1852        self.backups = v.into_iter().map(|i| i.into()).collect();
1853        self
1854    }
1855
1856    /// Sets the value of [next_page_token][crate::model::ListBackupsResponse::next_page_token].
1857    ///
1858    /// # Example
1859    /// ```ignore,no_run
1860    /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1861    /// let x = ListBackupsResponse::new().set_next_page_token("example");
1862    /// ```
1863    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1864        self.next_page_token = v.into();
1865        self
1866    }
1867
1868    /// Sets the value of [unreachable][crate::model::ListBackupsResponse::unreachable].
1869    ///
1870    /// # Example
1871    /// ```ignore,no_run
1872    /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1873    /// let x = ListBackupsResponse::new().set_unreachable(["a", "b", "c"]);
1874    /// ```
1875    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1876    where
1877        T: std::iter::IntoIterator<Item = V>,
1878        V: std::convert::Into<std::string::String>,
1879    {
1880        use std::iter::Iterator;
1881        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1882        self
1883    }
1884}
1885
1886impl wkt::message::Message for ListBackupsResponse {
1887    fn typename() -> &'static str {
1888        "type.googleapis.com/google.cloud.netapp.v1.ListBackupsResponse"
1889    }
1890}
1891
1892#[doc(hidden)]
1893impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupsResponse {
1894    type PageItem = crate::model::Backup;
1895
1896    fn items(self) -> std::vec::Vec<Self::PageItem> {
1897        self.backups
1898    }
1899
1900    fn next_page_token(&self) -> std::string::String {
1901        use std::clone::Clone;
1902        self.next_page_token.clone()
1903    }
1904}
1905
1906/// GetBackupRequest gets the state of a backup.
1907#[derive(Clone, Default, PartialEq)]
1908#[non_exhaustive]
1909pub struct GetBackupRequest {
1910    /// Required. The backup resource name, in the format
1911    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
1912    pub name: std::string::String,
1913
1914    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1915}
1916
1917impl GetBackupRequest {
1918    pub fn new() -> Self {
1919        std::default::Default::default()
1920    }
1921
1922    /// Sets the value of [name][crate::model::GetBackupRequest::name].
1923    ///
1924    /// # Example
1925    /// ```ignore,no_run
1926    /// # use google_cloud_netapp_v1::model::GetBackupRequest;
1927    /// let x = GetBackupRequest::new().set_name("example");
1928    /// ```
1929    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1930        self.name = v.into();
1931        self
1932    }
1933}
1934
1935impl wkt::message::Message for GetBackupRequest {
1936    fn typename() -> &'static str {
1937        "type.googleapis.com/google.cloud.netapp.v1.GetBackupRequest"
1938    }
1939}
1940
1941/// CreateBackupRequest creates a backup.
1942#[derive(Clone, Default, PartialEq)]
1943#[non_exhaustive]
1944pub struct CreateBackupRequest {
1945    /// Required. The NetApp backupVault to create the backups of, in the format
1946    /// `projects/*/locations/*/backupVaults/{backup_vault_id}`
1947    pub parent: std::string::String,
1948
1949    /// Required. The ID to use for the backup.
1950    /// The ID must be unique within the specified backupVault.
1951    /// Must contain only letters, numbers and hyphen, with the first
1952    /// character a letter, the last a letter or a
1953    /// number, and a 63 character maximum.
1954    pub backup_id: std::string::String,
1955
1956    /// Required. A backup resource
1957    pub backup: std::option::Option<crate::model::Backup>,
1958
1959    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1960}
1961
1962impl CreateBackupRequest {
1963    pub fn new() -> Self {
1964        std::default::Default::default()
1965    }
1966
1967    /// Sets the value of [parent][crate::model::CreateBackupRequest::parent].
1968    ///
1969    /// # Example
1970    /// ```ignore,no_run
1971    /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
1972    /// let x = CreateBackupRequest::new().set_parent("example");
1973    /// ```
1974    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1975        self.parent = v.into();
1976        self
1977    }
1978
1979    /// Sets the value of [backup_id][crate::model::CreateBackupRequest::backup_id].
1980    ///
1981    /// # Example
1982    /// ```ignore,no_run
1983    /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
1984    /// let x = CreateBackupRequest::new().set_backup_id("example");
1985    /// ```
1986    pub fn set_backup_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1987        self.backup_id = v.into();
1988        self
1989    }
1990
1991    /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
1992    ///
1993    /// # Example
1994    /// ```ignore,no_run
1995    /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
1996    /// use google_cloud_netapp_v1::model::Backup;
1997    /// let x = CreateBackupRequest::new().set_backup(Backup::default()/* use setters */);
1998    /// ```
1999    pub fn set_backup<T>(mut self, v: T) -> Self
2000    where
2001        T: std::convert::Into<crate::model::Backup>,
2002    {
2003        self.backup = std::option::Option::Some(v.into());
2004        self
2005    }
2006
2007    /// Sets or clears the value of [backup][crate::model::CreateBackupRequest::backup].
2008    ///
2009    /// # Example
2010    /// ```ignore,no_run
2011    /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
2012    /// use google_cloud_netapp_v1::model::Backup;
2013    /// let x = CreateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
2014    /// let x = CreateBackupRequest::new().set_or_clear_backup(None::<Backup>);
2015    /// ```
2016    pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
2017    where
2018        T: std::convert::Into<crate::model::Backup>,
2019    {
2020        self.backup = v.map(|x| x.into());
2021        self
2022    }
2023}
2024
2025impl wkt::message::Message for CreateBackupRequest {
2026    fn typename() -> &'static str {
2027        "type.googleapis.com/google.cloud.netapp.v1.CreateBackupRequest"
2028    }
2029}
2030
2031/// DeleteBackupRequest deletes a backup.
2032#[derive(Clone, Default, PartialEq)]
2033#[non_exhaustive]
2034pub struct DeleteBackupRequest {
2035    /// Required. The backup resource name, in the format
2036    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
2037    pub name: std::string::String,
2038
2039    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2040}
2041
2042impl DeleteBackupRequest {
2043    pub fn new() -> Self {
2044        std::default::Default::default()
2045    }
2046
2047    /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
2048    ///
2049    /// # Example
2050    /// ```ignore,no_run
2051    /// # use google_cloud_netapp_v1::model::DeleteBackupRequest;
2052    /// let x = DeleteBackupRequest::new().set_name("example");
2053    /// ```
2054    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2055        self.name = v.into();
2056        self
2057    }
2058}
2059
2060impl wkt::message::Message for DeleteBackupRequest {
2061    fn typename() -> &'static str {
2062        "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupRequest"
2063    }
2064}
2065
2066/// UpdateBackupRequest updates description and/or labels for a backup.
2067#[derive(Clone, Default, PartialEq)]
2068#[non_exhaustive]
2069pub struct UpdateBackupRequest {
2070    /// Required. Field mask is used to specify the fields to be overwritten in the
2071    /// Backup resource to be updated.
2072    /// The fields specified in the update_mask are relative to the resource, not
2073    /// the full request. A field will be overwritten if it is in the mask. If the
2074    /// user does not provide a mask then all fields will be overwritten.
2075    pub update_mask: std::option::Option<wkt::FieldMask>,
2076
2077    /// Required. The backup being updated
2078    pub backup: std::option::Option<crate::model::Backup>,
2079
2080    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2081}
2082
2083impl UpdateBackupRequest {
2084    pub fn new() -> Self {
2085        std::default::Default::default()
2086    }
2087
2088    /// Sets the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
2089    ///
2090    /// # Example
2091    /// ```ignore,no_run
2092    /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2093    /// use wkt::FieldMask;
2094    /// let x = UpdateBackupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2095    /// ```
2096    pub fn set_update_mask<T>(mut self, v: T) -> Self
2097    where
2098        T: std::convert::Into<wkt::FieldMask>,
2099    {
2100        self.update_mask = std::option::Option::Some(v.into());
2101        self
2102    }
2103
2104    /// Sets or clears the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
2105    ///
2106    /// # Example
2107    /// ```ignore,no_run
2108    /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2109    /// use wkt::FieldMask;
2110    /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2111    /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2112    /// ```
2113    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2114    where
2115        T: std::convert::Into<wkt::FieldMask>,
2116    {
2117        self.update_mask = v.map(|x| x.into());
2118        self
2119    }
2120
2121    /// Sets the value of [backup][crate::model::UpdateBackupRequest::backup].
2122    ///
2123    /// # Example
2124    /// ```ignore,no_run
2125    /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2126    /// use google_cloud_netapp_v1::model::Backup;
2127    /// let x = UpdateBackupRequest::new().set_backup(Backup::default()/* use setters */);
2128    /// ```
2129    pub fn set_backup<T>(mut self, v: T) -> Self
2130    where
2131        T: std::convert::Into<crate::model::Backup>,
2132    {
2133        self.backup = std::option::Option::Some(v.into());
2134        self
2135    }
2136
2137    /// Sets or clears the value of [backup][crate::model::UpdateBackupRequest::backup].
2138    ///
2139    /// # Example
2140    /// ```ignore,no_run
2141    /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2142    /// use google_cloud_netapp_v1::model::Backup;
2143    /// let x = UpdateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
2144    /// let x = UpdateBackupRequest::new().set_or_clear_backup(None::<Backup>);
2145    /// ```
2146    pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
2147    where
2148        T: std::convert::Into<crate::model::Backup>,
2149    {
2150        self.backup = v.map(|x| x.into());
2151        self
2152    }
2153}
2154
2155impl wkt::message::Message for UpdateBackupRequest {
2156    fn typename() -> &'static str {
2157        "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupRequest"
2158    }
2159}
2160
2161/// Backup Policy.
2162#[derive(Clone, Default, PartialEq)]
2163#[non_exhaustive]
2164pub struct BackupPolicy {
2165    /// Identifier. The resource name of the backup policy.
2166    /// Format:
2167    /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`.
2168    pub name: std::string::String,
2169
2170    /// Number of daily backups to keep. Note that the minimum daily backup limit
2171    /// is 2.
2172    pub daily_backup_limit: std::option::Option<i32>,
2173
2174    /// Number of weekly backups to keep. Note that the sum of daily, weekly and
2175    /// monthly backups should be greater than 1.
2176    pub weekly_backup_limit: std::option::Option<i32>,
2177
2178    /// Number of monthly backups to keep. Note that the sum of daily, weekly and
2179    /// monthly backups should be greater than 1.
2180    pub monthly_backup_limit: std::option::Option<i32>,
2181
2182    /// Description of the backup policy.
2183    pub description: std::option::Option<std::string::String>,
2184
2185    /// If enabled, make backups automatically according to the schedules.
2186    /// This will be applied to all volumes that have this policy attached and
2187    /// enforced on volume level. If not specified, default is true.
2188    pub enabled: std::option::Option<bool>,
2189
2190    /// Output only. The total number of volumes assigned by this backup policy.
2191    pub assigned_volume_count: std::option::Option<i32>,
2192
2193    /// Output only. The time when the backup policy was created.
2194    pub create_time: std::option::Option<wkt::Timestamp>,
2195
2196    /// Resource labels to represent user provided metadata.
2197    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2198
2199    /// Output only. The backup policy state.
2200    pub state: crate::model::backup_policy::State,
2201
2202    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2203}
2204
2205impl BackupPolicy {
2206    pub fn new() -> Self {
2207        std::default::Default::default()
2208    }
2209
2210    /// Sets the value of [name][crate::model::BackupPolicy::name].
2211    ///
2212    /// # Example
2213    /// ```ignore,no_run
2214    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2215    /// let x = BackupPolicy::new().set_name("example");
2216    /// ```
2217    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2218        self.name = v.into();
2219        self
2220    }
2221
2222    /// Sets the value of [daily_backup_limit][crate::model::BackupPolicy::daily_backup_limit].
2223    ///
2224    /// # Example
2225    /// ```ignore,no_run
2226    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2227    /// let x = BackupPolicy::new().set_daily_backup_limit(42);
2228    /// ```
2229    pub fn set_daily_backup_limit<T>(mut self, v: T) -> Self
2230    where
2231        T: std::convert::Into<i32>,
2232    {
2233        self.daily_backup_limit = std::option::Option::Some(v.into());
2234        self
2235    }
2236
2237    /// Sets or clears the value of [daily_backup_limit][crate::model::BackupPolicy::daily_backup_limit].
2238    ///
2239    /// # Example
2240    /// ```ignore,no_run
2241    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2242    /// let x = BackupPolicy::new().set_or_clear_daily_backup_limit(Some(42));
2243    /// let x = BackupPolicy::new().set_or_clear_daily_backup_limit(None::<i32>);
2244    /// ```
2245    pub fn set_or_clear_daily_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2246    where
2247        T: std::convert::Into<i32>,
2248    {
2249        self.daily_backup_limit = v.map(|x| x.into());
2250        self
2251    }
2252
2253    /// Sets the value of [weekly_backup_limit][crate::model::BackupPolicy::weekly_backup_limit].
2254    ///
2255    /// # Example
2256    /// ```ignore,no_run
2257    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2258    /// let x = BackupPolicy::new().set_weekly_backup_limit(42);
2259    /// ```
2260    pub fn set_weekly_backup_limit<T>(mut self, v: T) -> Self
2261    where
2262        T: std::convert::Into<i32>,
2263    {
2264        self.weekly_backup_limit = std::option::Option::Some(v.into());
2265        self
2266    }
2267
2268    /// Sets or clears the value of [weekly_backup_limit][crate::model::BackupPolicy::weekly_backup_limit].
2269    ///
2270    /// # Example
2271    /// ```ignore,no_run
2272    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2273    /// let x = BackupPolicy::new().set_or_clear_weekly_backup_limit(Some(42));
2274    /// let x = BackupPolicy::new().set_or_clear_weekly_backup_limit(None::<i32>);
2275    /// ```
2276    pub fn set_or_clear_weekly_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2277    where
2278        T: std::convert::Into<i32>,
2279    {
2280        self.weekly_backup_limit = v.map(|x| x.into());
2281        self
2282    }
2283
2284    /// Sets the value of [monthly_backup_limit][crate::model::BackupPolicy::monthly_backup_limit].
2285    ///
2286    /// # Example
2287    /// ```ignore,no_run
2288    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2289    /// let x = BackupPolicy::new().set_monthly_backup_limit(42);
2290    /// ```
2291    pub fn set_monthly_backup_limit<T>(mut self, v: T) -> Self
2292    where
2293        T: std::convert::Into<i32>,
2294    {
2295        self.monthly_backup_limit = std::option::Option::Some(v.into());
2296        self
2297    }
2298
2299    /// Sets or clears the value of [monthly_backup_limit][crate::model::BackupPolicy::monthly_backup_limit].
2300    ///
2301    /// # Example
2302    /// ```ignore,no_run
2303    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2304    /// let x = BackupPolicy::new().set_or_clear_monthly_backup_limit(Some(42));
2305    /// let x = BackupPolicy::new().set_or_clear_monthly_backup_limit(None::<i32>);
2306    /// ```
2307    pub fn set_or_clear_monthly_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2308    where
2309        T: std::convert::Into<i32>,
2310    {
2311        self.monthly_backup_limit = v.map(|x| x.into());
2312        self
2313    }
2314
2315    /// Sets the value of [description][crate::model::BackupPolicy::description].
2316    ///
2317    /// # Example
2318    /// ```ignore,no_run
2319    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2320    /// let x = BackupPolicy::new().set_description("example");
2321    /// ```
2322    pub fn set_description<T>(mut self, v: T) -> Self
2323    where
2324        T: std::convert::Into<std::string::String>,
2325    {
2326        self.description = std::option::Option::Some(v.into());
2327        self
2328    }
2329
2330    /// Sets or clears the value of [description][crate::model::BackupPolicy::description].
2331    ///
2332    /// # Example
2333    /// ```ignore,no_run
2334    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2335    /// let x = BackupPolicy::new().set_or_clear_description(Some("example"));
2336    /// let x = BackupPolicy::new().set_or_clear_description(None::<String>);
2337    /// ```
2338    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
2339    where
2340        T: std::convert::Into<std::string::String>,
2341    {
2342        self.description = v.map(|x| x.into());
2343        self
2344    }
2345
2346    /// Sets the value of [enabled][crate::model::BackupPolicy::enabled].
2347    ///
2348    /// # Example
2349    /// ```ignore,no_run
2350    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2351    /// let x = BackupPolicy::new().set_enabled(true);
2352    /// ```
2353    pub fn set_enabled<T>(mut self, v: T) -> Self
2354    where
2355        T: std::convert::Into<bool>,
2356    {
2357        self.enabled = std::option::Option::Some(v.into());
2358        self
2359    }
2360
2361    /// Sets or clears the value of [enabled][crate::model::BackupPolicy::enabled].
2362    ///
2363    /// # Example
2364    /// ```ignore,no_run
2365    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2366    /// let x = BackupPolicy::new().set_or_clear_enabled(Some(false));
2367    /// let x = BackupPolicy::new().set_or_clear_enabled(None::<bool>);
2368    /// ```
2369    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
2370    where
2371        T: std::convert::Into<bool>,
2372    {
2373        self.enabled = v.map(|x| x.into());
2374        self
2375    }
2376
2377    /// Sets the value of [assigned_volume_count][crate::model::BackupPolicy::assigned_volume_count].
2378    ///
2379    /// # Example
2380    /// ```ignore,no_run
2381    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2382    /// let x = BackupPolicy::new().set_assigned_volume_count(42);
2383    /// ```
2384    pub fn set_assigned_volume_count<T>(mut self, v: T) -> Self
2385    where
2386        T: std::convert::Into<i32>,
2387    {
2388        self.assigned_volume_count = std::option::Option::Some(v.into());
2389        self
2390    }
2391
2392    /// Sets or clears the value of [assigned_volume_count][crate::model::BackupPolicy::assigned_volume_count].
2393    ///
2394    /// # Example
2395    /// ```ignore,no_run
2396    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2397    /// let x = BackupPolicy::new().set_or_clear_assigned_volume_count(Some(42));
2398    /// let x = BackupPolicy::new().set_or_clear_assigned_volume_count(None::<i32>);
2399    /// ```
2400    pub fn set_or_clear_assigned_volume_count<T>(mut self, v: std::option::Option<T>) -> Self
2401    where
2402        T: std::convert::Into<i32>,
2403    {
2404        self.assigned_volume_count = v.map(|x| x.into());
2405        self
2406    }
2407
2408    /// Sets the value of [create_time][crate::model::BackupPolicy::create_time].
2409    ///
2410    /// # Example
2411    /// ```ignore,no_run
2412    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2413    /// use wkt::Timestamp;
2414    /// let x = BackupPolicy::new().set_create_time(Timestamp::default()/* use setters */);
2415    /// ```
2416    pub fn set_create_time<T>(mut self, v: T) -> Self
2417    where
2418        T: std::convert::Into<wkt::Timestamp>,
2419    {
2420        self.create_time = std::option::Option::Some(v.into());
2421        self
2422    }
2423
2424    /// Sets or clears the value of [create_time][crate::model::BackupPolicy::create_time].
2425    ///
2426    /// # Example
2427    /// ```ignore,no_run
2428    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2429    /// use wkt::Timestamp;
2430    /// let x = BackupPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2431    /// let x = BackupPolicy::new().set_or_clear_create_time(None::<Timestamp>);
2432    /// ```
2433    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2434    where
2435        T: std::convert::Into<wkt::Timestamp>,
2436    {
2437        self.create_time = v.map(|x| x.into());
2438        self
2439    }
2440
2441    /// Sets the value of [labels][crate::model::BackupPolicy::labels].
2442    ///
2443    /// # Example
2444    /// ```ignore,no_run
2445    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2446    /// let x = BackupPolicy::new().set_labels([
2447    ///     ("key0", "abc"),
2448    ///     ("key1", "xyz"),
2449    /// ]);
2450    /// ```
2451    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2452    where
2453        T: std::iter::IntoIterator<Item = (K, V)>,
2454        K: std::convert::Into<std::string::String>,
2455        V: std::convert::Into<std::string::String>,
2456    {
2457        use std::iter::Iterator;
2458        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2459        self
2460    }
2461
2462    /// Sets the value of [state][crate::model::BackupPolicy::state].
2463    ///
2464    /// # Example
2465    /// ```ignore,no_run
2466    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2467    /// use google_cloud_netapp_v1::model::backup_policy::State;
2468    /// let x0 = BackupPolicy::new().set_state(State::Creating);
2469    /// let x1 = BackupPolicy::new().set_state(State::Ready);
2470    /// let x2 = BackupPolicy::new().set_state(State::Deleting);
2471    /// ```
2472    pub fn set_state<T: std::convert::Into<crate::model::backup_policy::State>>(
2473        mut self,
2474        v: T,
2475    ) -> Self {
2476        self.state = v.into();
2477        self
2478    }
2479}
2480
2481impl wkt::message::Message for BackupPolicy {
2482    fn typename() -> &'static str {
2483        "type.googleapis.com/google.cloud.netapp.v1.BackupPolicy"
2484    }
2485}
2486
2487/// Defines additional types related to [BackupPolicy].
2488pub mod backup_policy {
2489    #[allow(unused_imports)]
2490    use super::*;
2491
2492    ///
2493    /// # Working with unknown values
2494    ///
2495    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2496    /// additional enum variants at any time. Adding new variants is not considered
2497    /// a breaking change. Applications should write their code in anticipation of:
2498    ///
2499    /// - New values appearing in future releases of the client library, **and**
2500    /// - New values received dynamically, without application changes.
2501    ///
2502    /// Please consult the [Working with enums] section in the user guide for some
2503    /// guidelines.
2504    ///
2505    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2506    #[derive(Clone, Debug, PartialEq)]
2507    #[non_exhaustive]
2508    pub enum State {
2509        /// State not set.
2510        Unspecified,
2511        /// BackupPolicy is being created.
2512        Creating,
2513        /// BackupPolicy is available for use.
2514        Ready,
2515        /// BackupPolicy is being deleted.
2516        Deleting,
2517        /// BackupPolicy is not valid and cannot be used.
2518        Error,
2519        /// BackupPolicy is being updated.
2520        Updating,
2521        /// If set, the enum was initialized with an unknown value.
2522        ///
2523        /// Applications can examine the value using [State::value] or
2524        /// [State::name].
2525        UnknownValue(state::UnknownValue),
2526    }
2527
2528    #[doc(hidden)]
2529    pub mod state {
2530        #[allow(unused_imports)]
2531        use super::*;
2532        #[derive(Clone, Debug, PartialEq)]
2533        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2534    }
2535
2536    impl State {
2537        /// Gets the enum value.
2538        ///
2539        /// Returns `None` if the enum contains an unknown value deserialized from
2540        /// the string representation of enums.
2541        pub fn value(&self) -> std::option::Option<i32> {
2542            match self {
2543                Self::Unspecified => std::option::Option::Some(0),
2544                Self::Creating => std::option::Option::Some(1),
2545                Self::Ready => std::option::Option::Some(2),
2546                Self::Deleting => std::option::Option::Some(3),
2547                Self::Error => std::option::Option::Some(4),
2548                Self::Updating => std::option::Option::Some(5),
2549                Self::UnknownValue(u) => u.0.value(),
2550            }
2551        }
2552
2553        /// Gets the enum value as a string.
2554        ///
2555        /// Returns `None` if the enum contains an unknown value deserialized from
2556        /// the integer representation of enums.
2557        pub fn name(&self) -> std::option::Option<&str> {
2558            match self {
2559                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2560                Self::Creating => std::option::Option::Some("CREATING"),
2561                Self::Ready => std::option::Option::Some("READY"),
2562                Self::Deleting => std::option::Option::Some("DELETING"),
2563                Self::Error => std::option::Option::Some("ERROR"),
2564                Self::Updating => std::option::Option::Some("UPDATING"),
2565                Self::UnknownValue(u) => u.0.name(),
2566            }
2567        }
2568    }
2569
2570    impl std::default::Default for State {
2571        fn default() -> Self {
2572            use std::convert::From;
2573            Self::from(0)
2574        }
2575    }
2576
2577    impl std::fmt::Display for State {
2578        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2579            wkt::internal::display_enum(f, self.name(), self.value())
2580        }
2581    }
2582
2583    impl std::convert::From<i32> for State {
2584        fn from(value: i32) -> Self {
2585            match value {
2586                0 => Self::Unspecified,
2587                1 => Self::Creating,
2588                2 => Self::Ready,
2589                3 => Self::Deleting,
2590                4 => Self::Error,
2591                5 => Self::Updating,
2592                _ => Self::UnknownValue(state::UnknownValue(
2593                    wkt::internal::UnknownEnumValue::Integer(value),
2594                )),
2595            }
2596        }
2597    }
2598
2599    impl std::convert::From<&str> for State {
2600        fn from(value: &str) -> Self {
2601            use std::string::ToString;
2602            match value {
2603                "STATE_UNSPECIFIED" => Self::Unspecified,
2604                "CREATING" => Self::Creating,
2605                "READY" => Self::Ready,
2606                "DELETING" => Self::Deleting,
2607                "ERROR" => Self::Error,
2608                "UPDATING" => Self::Updating,
2609                _ => Self::UnknownValue(state::UnknownValue(
2610                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2611                )),
2612            }
2613        }
2614    }
2615
2616    impl serde::ser::Serialize for State {
2617        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2618        where
2619            S: serde::Serializer,
2620        {
2621            match self {
2622                Self::Unspecified => serializer.serialize_i32(0),
2623                Self::Creating => serializer.serialize_i32(1),
2624                Self::Ready => serializer.serialize_i32(2),
2625                Self::Deleting => serializer.serialize_i32(3),
2626                Self::Error => serializer.serialize_i32(4),
2627                Self::Updating => serializer.serialize_i32(5),
2628                Self::UnknownValue(u) => u.0.serialize(serializer),
2629            }
2630        }
2631    }
2632
2633    impl<'de> serde::de::Deserialize<'de> for State {
2634        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2635        where
2636            D: serde::Deserializer<'de>,
2637        {
2638            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2639                ".google.cloud.netapp.v1.BackupPolicy.State",
2640            ))
2641        }
2642    }
2643}
2644
2645/// CreateBackupPolicyRequest creates a backupPolicy.
2646#[derive(Clone, Default, PartialEq)]
2647#[non_exhaustive]
2648pub struct CreateBackupPolicyRequest {
2649    /// Required. The location to create the backup policies of, in the format
2650    /// `projects/{project_id}/locations/{location}`
2651    pub parent: std::string::String,
2652
2653    /// Required. A backupPolicy resource
2654    pub backup_policy: std::option::Option<crate::model::BackupPolicy>,
2655
2656    /// Required. The ID to use for the backup policy.
2657    /// The ID must be unique within the specified location.
2658    /// Must contain only letters, numbers and hyphen, with the first
2659    /// character a letter, the last a letter or a
2660    /// number, and a 63 character maximum.
2661    pub backup_policy_id: std::string::String,
2662
2663    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2664}
2665
2666impl CreateBackupPolicyRequest {
2667    pub fn new() -> Self {
2668        std::default::Default::default()
2669    }
2670
2671    /// Sets the value of [parent][crate::model::CreateBackupPolicyRequest::parent].
2672    ///
2673    /// # Example
2674    /// ```ignore,no_run
2675    /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2676    /// let x = CreateBackupPolicyRequest::new().set_parent("example");
2677    /// ```
2678    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2679        self.parent = v.into();
2680        self
2681    }
2682
2683    /// Sets the value of [backup_policy][crate::model::CreateBackupPolicyRequest::backup_policy].
2684    ///
2685    /// # Example
2686    /// ```ignore,no_run
2687    /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2688    /// use google_cloud_netapp_v1::model::BackupPolicy;
2689    /// let x = CreateBackupPolicyRequest::new().set_backup_policy(BackupPolicy::default()/* use setters */);
2690    /// ```
2691    pub fn set_backup_policy<T>(mut self, v: T) -> Self
2692    where
2693        T: std::convert::Into<crate::model::BackupPolicy>,
2694    {
2695        self.backup_policy = std::option::Option::Some(v.into());
2696        self
2697    }
2698
2699    /// Sets or clears the value of [backup_policy][crate::model::CreateBackupPolicyRequest::backup_policy].
2700    ///
2701    /// # Example
2702    /// ```ignore,no_run
2703    /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2704    /// use google_cloud_netapp_v1::model::BackupPolicy;
2705    /// let x = CreateBackupPolicyRequest::new().set_or_clear_backup_policy(Some(BackupPolicy::default()/* use setters */));
2706    /// let x = CreateBackupPolicyRequest::new().set_or_clear_backup_policy(None::<BackupPolicy>);
2707    /// ```
2708    pub fn set_or_clear_backup_policy<T>(mut self, v: std::option::Option<T>) -> Self
2709    where
2710        T: std::convert::Into<crate::model::BackupPolicy>,
2711    {
2712        self.backup_policy = v.map(|x| x.into());
2713        self
2714    }
2715
2716    /// Sets the value of [backup_policy_id][crate::model::CreateBackupPolicyRequest::backup_policy_id].
2717    ///
2718    /// # Example
2719    /// ```ignore,no_run
2720    /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2721    /// let x = CreateBackupPolicyRequest::new().set_backup_policy_id("example");
2722    /// ```
2723    pub fn set_backup_policy_id<T: std::convert::Into<std::string::String>>(
2724        mut self,
2725        v: T,
2726    ) -> Self {
2727        self.backup_policy_id = v.into();
2728        self
2729    }
2730}
2731
2732impl wkt::message::Message for CreateBackupPolicyRequest {
2733    fn typename() -> &'static str {
2734        "type.googleapis.com/google.cloud.netapp.v1.CreateBackupPolicyRequest"
2735    }
2736}
2737
2738/// GetBackupPolicyRequest gets the state of a backupPolicy.
2739#[derive(Clone, Default, PartialEq)]
2740#[non_exhaustive]
2741pub struct GetBackupPolicyRequest {
2742    /// Required. The backupPolicy resource name, in the format
2743    /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`
2744    pub name: std::string::String,
2745
2746    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2747}
2748
2749impl GetBackupPolicyRequest {
2750    pub fn new() -> Self {
2751        std::default::Default::default()
2752    }
2753
2754    /// Sets the value of [name][crate::model::GetBackupPolicyRequest::name].
2755    ///
2756    /// # Example
2757    /// ```ignore,no_run
2758    /// # use google_cloud_netapp_v1::model::GetBackupPolicyRequest;
2759    /// let x = GetBackupPolicyRequest::new().set_name("example");
2760    /// ```
2761    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2762        self.name = v.into();
2763        self
2764    }
2765}
2766
2767impl wkt::message::Message for GetBackupPolicyRequest {
2768    fn typename() -> &'static str {
2769        "type.googleapis.com/google.cloud.netapp.v1.GetBackupPolicyRequest"
2770    }
2771}
2772
2773/// ListBackupPoliciesRequest for requesting multiple backup policies.
2774#[derive(Clone, Default, PartialEq)]
2775#[non_exhaustive]
2776pub struct ListBackupPoliciesRequest {
2777    /// Required. Parent value for ListBackupPoliciesRequest
2778    pub parent: std::string::String,
2779
2780    /// Requested page size. Server may return fewer items than requested.
2781    /// If unspecified, the server will pick an appropriate default.
2782    pub page_size: i32,
2783
2784    /// A token identifying a page of results the server should return.
2785    pub page_token: std::string::String,
2786
2787    /// Filtering results
2788    pub filter: std::string::String,
2789
2790    /// Hint for how to order the results
2791    pub order_by: std::string::String,
2792
2793    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2794}
2795
2796impl ListBackupPoliciesRequest {
2797    pub fn new() -> Self {
2798        std::default::Default::default()
2799    }
2800
2801    /// Sets the value of [parent][crate::model::ListBackupPoliciesRequest::parent].
2802    ///
2803    /// # Example
2804    /// ```ignore,no_run
2805    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2806    /// let x = ListBackupPoliciesRequest::new().set_parent("example");
2807    /// ```
2808    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2809        self.parent = v.into();
2810        self
2811    }
2812
2813    /// Sets the value of [page_size][crate::model::ListBackupPoliciesRequest::page_size].
2814    ///
2815    /// # Example
2816    /// ```ignore,no_run
2817    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2818    /// let x = ListBackupPoliciesRequest::new().set_page_size(42);
2819    /// ```
2820    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2821        self.page_size = v.into();
2822        self
2823    }
2824
2825    /// Sets the value of [page_token][crate::model::ListBackupPoliciesRequest::page_token].
2826    ///
2827    /// # Example
2828    /// ```ignore,no_run
2829    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2830    /// let x = ListBackupPoliciesRequest::new().set_page_token("example");
2831    /// ```
2832    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2833        self.page_token = v.into();
2834        self
2835    }
2836
2837    /// Sets the value of [filter][crate::model::ListBackupPoliciesRequest::filter].
2838    ///
2839    /// # Example
2840    /// ```ignore,no_run
2841    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2842    /// let x = ListBackupPoliciesRequest::new().set_filter("example");
2843    /// ```
2844    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2845        self.filter = v.into();
2846        self
2847    }
2848
2849    /// Sets the value of [order_by][crate::model::ListBackupPoliciesRequest::order_by].
2850    ///
2851    /// # Example
2852    /// ```ignore,no_run
2853    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2854    /// let x = ListBackupPoliciesRequest::new().set_order_by("example");
2855    /// ```
2856    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2857        self.order_by = v.into();
2858        self
2859    }
2860}
2861
2862impl wkt::message::Message for ListBackupPoliciesRequest {
2863    fn typename() -> &'static str {
2864        "type.googleapis.com/google.cloud.netapp.v1.ListBackupPoliciesRequest"
2865    }
2866}
2867
2868/// ListBackupPoliciesResponse contains all the backup policies requested.
2869#[derive(Clone, Default, PartialEq)]
2870#[non_exhaustive]
2871pub struct ListBackupPoliciesResponse {
2872    /// The list of backup policies.
2873    pub backup_policies: std::vec::Vec<crate::model::BackupPolicy>,
2874
2875    /// A token identifying a page of results the server should return.
2876    pub next_page_token: std::string::String,
2877
2878    /// Locations that could not be reached.
2879    pub unreachable: std::vec::Vec<std::string::String>,
2880
2881    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2882}
2883
2884impl ListBackupPoliciesResponse {
2885    pub fn new() -> Self {
2886        std::default::Default::default()
2887    }
2888
2889    /// Sets the value of [backup_policies][crate::model::ListBackupPoliciesResponse::backup_policies].
2890    ///
2891    /// # Example
2892    /// ```ignore,no_run
2893    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
2894    /// use google_cloud_netapp_v1::model::BackupPolicy;
2895    /// let x = ListBackupPoliciesResponse::new()
2896    ///     .set_backup_policies([
2897    ///         BackupPolicy::default()/* use setters */,
2898    ///         BackupPolicy::default()/* use (different) setters */,
2899    ///     ]);
2900    /// ```
2901    pub fn set_backup_policies<T, V>(mut self, v: T) -> Self
2902    where
2903        T: std::iter::IntoIterator<Item = V>,
2904        V: std::convert::Into<crate::model::BackupPolicy>,
2905    {
2906        use std::iter::Iterator;
2907        self.backup_policies = v.into_iter().map(|i| i.into()).collect();
2908        self
2909    }
2910
2911    /// Sets the value of [next_page_token][crate::model::ListBackupPoliciesResponse::next_page_token].
2912    ///
2913    /// # Example
2914    /// ```ignore,no_run
2915    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
2916    /// let x = ListBackupPoliciesResponse::new().set_next_page_token("example");
2917    /// ```
2918    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2919        self.next_page_token = v.into();
2920        self
2921    }
2922
2923    /// Sets the value of [unreachable][crate::model::ListBackupPoliciesResponse::unreachable].
2924    ///
2925    /// # Example
2926    /// ```ignore,no_run
2927    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
2928    /// let x = ListBackupPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
2929    /// ```
2930    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2931    where
2932        T: std::iter::IntoIterator<Item = V>,
2933        V: std::convert::Into<std::string::String>,
2934    {
2935        use std::iter::Iterator;
2936        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2937        self
2938    }
2939}
2940
2941impl wkt::message::Message for ListBackupPoliciesResponse {
2942    fn typename() -> &'static str {
2943        "type.googleapis.com/google.cloud.netapp.v1.ListBackupPoliciesResponse"
2944    }
2945}
2946
2947#[doc(hidden)]
2948impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupPoliciesResponse {
2949    type PageItem = crate::model::BackupPolicy;
2950
2951    fn items(self) -> std::vec::Vec<Self::PageItem> {
2952        self.backup_policies
2953    }
2954
2955    fn next_page_token(&self) -> std::string::String {
2956        use std::clone::Clone;
2957        self.next_page_token.clone()
2958    }
2959}
2960
2961/// UpdateBackupPolicyRequest for updating a backup policy.
2962#[derive(Clone, Default, PartialEq)]
2963#[non_exhaustive]
2964pub struct UpdateBackupPolicyRequest {
2965    /// Required. Field mask is used to specify the fields to be overwritten in the
2966    /// Backup Policy resource by the update.
2967    /// The fields specified in the update_mask are relative to the resource, not
2968    /// the full request. A field will be overwritten if it is in the mask. If the
2969    /// user does not provide a mask then all fields will be overwritten.
2970    pub update_mask: std::option::Option<wkt::FieldMask>,
2971
2972    /// Required. The backup policy being updated
2973    pub backup_policy: std::option::Option<crate::model::BackupPolicy>,
2974
2975    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2976}
2977
2978impl UpdateBackupPolicyRequest {
2979    pub fn new() -> Self {
2980        std::default::Default::default()
2981    }
2982
2983    /// Sets the value of [update_mask][crate::model::UpdateBackupPolicyRequest::update_mask].
2984    ///
2985    /// # Example
2986    /// ```ignore,no_run
2987    /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
2988    /// use wkt::FieldMask;
2989    /// let x = UpdateBackupPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2990    /// ```
2991    pub fn set_update_mask<T>(mut self, v: T) -> Self
2992    where
2993        T: std::convert::Into<wkt::FieldMask>,
2994    {
2995        self.update_mask = std::option::Option::Some(v.into());
2996        self
2997    }
2998
2999    /// Sets or clears the value of [update_mask][crate::model::UpdateBackupPolicyRequest::update_mask].
3000    ///
3001    /// # Example
3002    /// ```ignore,no_run
3003    /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3004    /// use wkt::FieldMask;
3005    /// let x = UpdateBackupPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3006    /// let x = UpdateBackupPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3007    /// ```
3008    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3009    where
3010        T: std::convert::Into<wkt::FieldMask>,
3011    {
3012        self.update_mask = v.map(|x| x.into());
3013        self
3014    }
3015
3016    /// Sets the value of [backup_policy][crate::model::UpdateBackupPolicyRequest::backup_policy].
3017    ///
3018    /// # Example
3019    /// ```ignore,no_run
3020    /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3021    /// use google_cloud_netapp_v1::model::BackupPolicy;
3022    /// let x = UpdateBackupPolicyRequest::new().set_backup_policy(BackupPolicy::default()/* use setters */);
3023    /// ```
3024    pub fn set_backup_policy<T>(mut self, v: T) -> Self
3025    where
3026        T: std::convert::Into<crate::model::BackupPolicy>,
3027    {
3028        self.backup_policy = std::option::Option::Some(v.into());
3029        self
3030    }
3031
3032    /// Sets or clears the value of [backup_policy][crate::model::UpdateBackupPolicyRequest::backup_policy].
3033    ///
3034    /// # Example
3035    /// ```ignore,no_run
3036    /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3037    /// use google_cloud_netapp_v1::model::BackupPolicy;
3038    /// let x = UpdateBackupPolicyRequest::new().set_or_clear_backup_policy(Some(BackupPolicy::default()/* use setters */));
3039    /// let x = UpdateBackupPolicyRequest::new().set_or_clear_backup_policy(None::<BackupPolicy>);
3040    /// ```
3041    pub fn set_or_clear_backup_policy<T>(mut self, v: std::option::Option<T>) -> Self
3042    where
3043        T: std::convert::Into<crate::model::BackupPolicy>,
3044    {
3045        self.backup_policy = v.map(|x| x.into());
3046        self
3047    }
3048}
3049
3050impl wkt::message::Message for UpdateBackupPolicyRequest {
3051    fn typename() -> &'static str {
3052        "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupPolicyRequest"
3053    }
3054}
3055
3056/// DeleteBackupPolicyRequest deletes a backup policy.
3057#[derive(Clone, Default, PartialEq)]
3058#[non_exhaustive]
3059pub struct DeleteBackupPolicyRequest {
3060    /// Required. The backup policy resource name, in the format
3061    /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`
3062    pub name: std::string::String,
3063
3064    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3065}
3066
3067impl DeleteBackupPolicyRequest {
3068    pub fn new() -> Self {
3069        std::default::Default::default()
3070    }
3071
3072    /// Sets the value of [name][crate::model::DeleteBackupPolicyRequest::name].
3073    ///
3074    /// # Example
3075    /// ```ignore,no_run
3076    /// # use google_cloud_netapp_v1::model::DeleteBackupPolicyRequest;
3077    /// let x = DeleteBackupPolicyRequest::new().set_name("example");
3078    /// ```
3079    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3080        self.name = v.into();
3081        self
3082    }
3083}
3084
3085impl wkt::message::Message for DeleteBackupPolicyRequest {
3086    fn typename() -> &'static str {
3087        "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupPolicyRequest"
3088    }
3089}
3090
3091/// A NetApp BackupVault.
3092#[derive(Clone, Default, PartialEq)]
3093#[non_exhaustive]
3094pub struct BackupVault {
3095    /// Identifier. The resource name of the backup vault.
3096    /// Format:
3097    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`.
3098    pub name: std::string::String,
3099
3100    /// Output only. The backup vault state.
3101    pub state: crate::model::backup_vault::State,
3102
3103    /// Output only. Create time of the backup vault.
3104    pub create_time: std::option::Option<wkt::Timestamp>,
3105
3106    /// Description of the backup vault.
3107    pub description: std::string::String,
3108
3109    /// Resource labels to represent user provided metadata.
3110    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3111
3112    /// Optional. Type of backup vault to be created.
3113    /// Default is IN_REGION.
3114    pub backup_vault_type: crate::model::backup_vault::BackupVaultType,
3115
3116    /// Output only. Region in which the backup vault is created.
3117    /// Format: `projects/{project_id}/locations/{location}`
3118    pub source_region: std::string::String,
3119
3120    /// Optional. Region where the backups are stored.
3121    /// Format: `projects/{project_id}/locations/{location}`
3122    pub backup_region: std::string::String,
3123
3124    /// Output only. Name of the Backup vault created in source region.
3125    /// Format:
3126    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
3127    pub source_backup_vault: std::string::String,
3128
3129    /// Output only. Name of the Backup vault created in backup region.
3130    /// Format:
3131    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
3132    pub destination_backup_vault: std::string::String,
3133
3134    /// Optional. Backup retention policy defining the retention of backups.
3135    pub backup_retention_policy:
3136        std::option::Option<crate::model::backup_vault::BackupRetentionPolicy>,
3137
3138    /// Optional. Specifies the Key Management System (KMS) configuration to be
3139    /// used for backup encryption. Format:
3140    /// `projects/{project}/locations/{location}/kmsConfigs/{kms_config}`
3141    pub kms_config: std::string::String,
3142
3143    /// Output only. Field indicating encryption state of CMEK backups.
3144    pub encryption_state: crate::model::backup_vault::EncryptionState,
3145
3146    /// Output only. The crypto key version used to encrypt the backup vault.
3147    /// Format:
3148    /// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`
3149    pub backups_crypto_key_version: std::string::String,
3150
3151    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3152}
3153
3154impl BackupVault {
3155    pub fn new() -> Self {
3156        std::default::Default::default()
3157    }
3158
3159    /// Sets the value of [name][crate::model::BackupVault::name].
3160    ///
3161    /// # Example
3162    /// ```ignore,no_run
3163    /// # use google_cloud_netapp_v1::model::BackupVault;
3164    /// let x = BackupVault::new().set_name("example");
3165    /// ```
3166    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3167        self.name = v.into();
3168        self
3169    }
3170
3171    /// Sets the value of [state][crate::model::BackupVault::state].
3172    ///
3173    /// # Example
3174    /// ```ignore,no_run
3175    /// # use google_cloud_netapp_v1::model::BackupVault;
3176    /// use google_cloud_netapp_v1::model::backup_vault::State;
3177    /// let x0 = BackupVault::new().set_state(State::Creating);
3178    /// let x1 = BackupVault::new().set_state(State::Ready);
3179    /// let x2 = BackupVault::new().set_state(State::Deleting);
3180    /// ```
3181    pub fn set_state<T: std::convert::Into<crate::model::backup_vault::State>>(
3182        mut self,
3183        v: T,
3184    ) -> Self {
3185        self.state = v.into();
3186        self
3187    }
3188
3189    /// Sets the value of [create_time][crate::model::BackupVault::create_time].
3190    ///
3191    /// # Example
3192    /// ```ignore,no_run
3193    /// # use google_cloud_netapp_v1::model::BackupVault;
3194    /// use wkt::Timestamp;
3195    /// let x = BackupVault::new().set_create_time(Timestamp::default()/* use setters */);
3196    /// ```
3197    pub fn set_create_time<T>(mut self, v: T) -> Self
3198    where
3199        T: std::convert::Into<wkt::Timestamp>,
3200    {
3201        self.create_time = std::option::Option::Some(v.into());
3202        self
3203    }
3204
3205    /// Sets or clears the value of [create_time][crate::model::BackupVault::create_time].
3206    ///
3207    /// # Example
3208    /// ```ignore,no_run
3209    /// # use google_cloud_netapp_v1::model::BackupVault;
3210    /// use wkt::Timestamp;
3211    /// let x = BackupVault::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3212    /// let x = BackupVault::new().set_or_clear_create_time(None::<Timestamp>);
3213    /// ```
3214    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3215    where
3216        T: std::convert::Into<wkt::Timestamp>,
3217    {
3218        self.create_time = v.map(|x| x.into());
3219        self
3220    }
3221
3222    /// Sets the value of [description][crate::model::BackupVault::description].
3223    ///
3224    /// # Example
3225    /// ```ignore,no_run
3226    /// # use google_cloud_netapp_v1::model::BackupVault;
3227    /// let x = BackupVault::new().set_description("example");
3228    /// ```
3229    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3230        self.description = v.into();
3231        self
3232    }
3233
3234    /// Sets the value of [labels][crate::model::BackupVault::labels].
3235    ///
3236    /// # Example
3237    /// ```ignore,no_run
3238    /// # use google_cloud_netapp_v1::model::BackupVault;
3239    /// let x = BackupVault::new().set_labels([
3240    ///     ("key0", "abc"),
3241    ///     ("key1", "xyz"),
3242    /// ]);
3243    /// ```
3244    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3245    where
3246        T: std::iter::IntoIterator<Item = (K, V)>,
3247        K: std::convert::Into<std::string::String>,
3248        V: std::convert::Into<std::string::String>,
3249    {
3250        use std::iter::Iterator;
3251        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3252        self
3253    }
3254
3255    /// Sets the value of [backup_vault_type][crate::model::BackupVault::backup_vault_type].
3256    ///
3257    /// # Example
3258    /// ```ignore,no_run
3259    /// # use google_cloud_netapp_v1::model::BackupVault;
3260    /// use google_cloud_netapp_v1::model::backup_vault::BackupVaultType;
3261    /// let x0 = BackupVault::new().set_backup_vault_type(BackupVaultType::InRegion);
3262    /// let x1 = BackupVault::new().set_backup_vault_type(BackupVaultType::CrossRegion);
3263    /// ```
3264    pub fn set_backup_vault_type<
3265        T: std::convert::Into<crate::model::backup_vault::BackupVaultType>,
3266    >(
3267        mut self,
3268        v: T,
3269    ) -> Self {
3270        self.backup_vault_type = v.into();
3271        self
3272    }
3273
3274    /// Sets the value of [source_region][crate::model::BackupVault::source_region].
3275    ///
3276    /// # Example
3277    /// ```ignore,no_run
3278    /// # use google_cloud_netapp_v1::model::BackupVault;
3279    /// let x = BackupVault::new().set_source_region("example");
3280    /// ```
3281    pub fn set_source_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3282        self.source_region = v.into();
3283        self
3284    }
3285
3286    /// Sets the value of [backup_region][crate::model::BackupVault::backup_region].
3287    ///
3288    /// # Example
3289    /// ```ignore,no_run
3290    /// # use google_cloud_netapp_v1::model::BackupVault;
3291    /// let x = BackupVault::new().set_backup_region("example");
3292    /// ```
3293    pub fn set_backup_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3294        self.backup_region = v.into();
3295        self
3296    }
3297
3298    /// Sets the value of [source_backup_vault][crate::model::BackupVault::source_backup_vault].
3299    ///
3300    /// # Example
3301    /// ```ignore,no_run
3302    /// # use google_cloud_netapp_v1::model::BackupVault;
3303    /// let x = BackupVault::new().set_source_backup_vault("example");
3304    /// ```
3305    pub fn set_source_backup_vault<T: std::convert::Into<std::string::String>>(
3306        mut self,
3307        v: T,
3308    ) -> Self {
3309        self.source_backup_vault = v.into();
3310        self
3311    }
3312
3313    /// Sets the value of [destination_backup_vault][crate::model::BackupVault::destination_backup_vault].
3314    ///
3315    /// # Example
3316    /// ```ignore,no_run
3317    /// # use google_cloud_netapp_v1::model::BackupVault;
3318    /// let x = BackupVault::new().set_destination_backup_vault("example");
3319    /// ```
3320    pub fn set_destination_backup_vault<T: std::convert::Into<std::string::String>>(
3321        mut self,
3322        v: T,
3323    ) -> Self {
3324        self.destination_backup_vault = v.into();
3325        self
3326    }
3327
3328    /// Sets the value of [backup_retention_policy][crate::model::BackupVault::backup_retention_policy].
3329    ///
3330    /// # Example
3331    /// ```ignore,no_run
3332    /// # use google_cloud_netapp_v1::model::BackupVault;
3333    /// use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3334    /// let x = BackupVault::new().set_backup_retention_policy(BackupRetentionPolicy::default()/* use setters */);
3335    /// ```
3336    pub fn set_backup_retention_policy<T>(mut self, v: T) -> Self
3337    where
3338        T: std::convert::Into<crate::model::backup_vault::BackupRetentionPolicy>,
3339    {
3340        self.backup_retention_policy = std::option::Option::Some(v.into());
3341        self
3342    }
3343
3344    /// Sets or clears the value of [backup_retention_policy][crate::model::BackupVault::backup_retention_policy].
3345    ///
3346    /// # Example
3347    /// ```ignore,no_run
3348    /// # use google_cloud_netapp_v1::model::BackupVault;
3349    /// use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3350    /// let x = BackupVault::new().set_or_clear_backup_retention_policy(Some(BackupRetentionPolicy::default()/* use setters */));
3351    /// let x = BackupVault::new().set_or_clear_backup_retention_policy(None::<BackupRetentionPolicy>);
3352    /// ```
3353    pub fn set_or_clear_backup_retention_policy<T>(mut self, v: std::option::Option<T>) -> Self
3354    where
3355        T: std::convert::Into<crate::model::backup_vault::BackupRetentionPolicy>,
3356    {
3357        self.backup_retention_policy = v.map(|x| x.into());
3358        self
3359    }
3360
3361    /// Sets the value of [kms_config][crate::model::BackupVault::kms_config].
3362    ///
3363    /// # Example
3364    /// ```ignore,no_run
3365    /// # use google_cloud_netapp_v1::model::BackupVault;
3366    /// let x = BackupVault::new().set_kms_config("example");
3367    /// ```
3368    pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3369        self.kms_config = v.into();
3370        self
3371    }
3372
3373    /// Sets the value of [encryption_state][crate::model::BackupVault::encryption_state].
3374    ///
3375    /// # Example
3376    /// ```ignore,no_run
3377    /// # use google_cloud_netapp_v1::model::BackupVault;
3378    /// use google_cloud_netapp_v1::model::backup_vault::EncryptionState;
3379    /// let x0 = BackupVault::new().set_encryption_state(EncryptionState::Pending);
3380    /// let x1 = BackupVault::new().set_encryption_state(EncryptionState::Completed);
3381    /// let x2 = BackupVault::new().set_encryption_state(EncryptionState::InProgress);
3382    /// ```
3383    pub fn set_encryption_state<
3384        T: std::convert::Into<crate::model::backup_vault::EncryptionState>,
3385    >(
3386        mut self,
3387        v: T,
3388    ) -> Self {
3389        self.encryption_state = v.into();
3390        self
3391    }
3392
3393    /// Sets the value of [backups_crypto_key_version][crate::model::BackupVault::backups_crypto_key_version].
3394    ///
3395    /// # Example
3396    /// ```ignore,no_run
3397    /// # use google_cloud_netapp_v1::model::BackupVault;
3398    /// let x = BackupVault::new().set_backups_crypto_key_version("example");
3399    /// ```
3400    pub fn set_backups_crypto_key_version<T: std::convert::Into<std::string::String>>(
3401        mut self,
3402        v: T,
3403    ) -> Self {
3404        self.backups_crypto_key_version = v.into();
3405        self
3406    }
3407}
3408
3409impl wkt::message::Message for BackupVault {
3410    fn typename() -> &'static str {
3411        "type.googleapis.com/google.cloud.netapp.v1.BackupVault"
3412    }
3413}
3414
3415/// Defines additional types related to [BackupVault].
3416pub mod backup_vault {
3417    #[allow(unused_imports)]
3418    use super::*;
3419
3420    /// Retention policy for backups in the backup vault
3421    #[derive(Clone, Default, PartialEq)]
3422    #[non_exhaustive]
3423    pub struct BackupRetentionPolicy {
3424        /// Required. Minimum retention duration in days for backups in the backup
3425        /// vault.
3426        pub backup_minimum_enforced_retention_days: i32,
3427
3428        /// Optional. Indicates if the daily backups are immutable.
3429        /// At least one of daily_backup_immutable, weekly_backup_immutable,
3430        /// monthly_backup_immutable and manual_backup_immutable must be true.
3431        pub daily_backup_immutable: bool,
3432
3433        /// Optional. Indicates if the weekly backups are immutable.
3434        /// At least one of daily_backup_immutable, weekly_backup_immutable,
3435        /// monthly_backup_immutable and manual_backup_immutable must be true.
3436        pub weekly_backup_immutable: bool,
3437
3438        /// Optional. Indicates if the monthly backups are immutable.
3439        /// At least one of daily_backup_immutable, weekly_backup_immutable,
3440        /// monthly_backup_immutable and manual_backup_immutable must be true.
3441        pub monthly_backup_immutable: bool,
3442
3443        /// Optional. Indicates if the manual backups are immutable.
3444        /// At least one of daily_backup_immutable, weekly_backup_immutable,
3445        /// monthly_backup_immutable and manual_backup_immutable must be true.
3446        pub manual_backup_immutable: bool,
3447
3448        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3449    }
3450
3451    impl BackupRetentionPolicy {
3452        pub fn new() -> Self {
3453            std::default::Default::default()
3454        }
3455
3456        /// Sets the value of [backup_minimum_enforced_retention_days][crate::model::backup_vault::BackupRetentionPolicy::backup_minimum_enforced_retention_days].
3457        ///
3458        /// # Example
3459        /// ```ignore,no_run
3460        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3461        /// let x = BackupRetentionPolicy::new().set_backup_minimum_enforced_retention_days(42);
3462        /// ```
3463        pub fn set_backup_minimum_enforced_retention_days<T: std::convert::Into<i32>>(
3464            mut self,
3465            v: T,
3466        ) -> Self {
3467            self.backup_minimum_enforced_retention_days = v.into();
3468            self
3469        }
3470
3471        /// Sets the value of [daily_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::daily_backup_immutable].
3472        ///
3473        /// # Example
3474        /// ```ignore,no_run
3475        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3476        /// let x = BackupRetentionPolicy::new().set_daily_backup_immutable(true);
3477        /// ```
3478        pub fn set_daily_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3479            self.daily_backup_immutable = v.into();
3480            self
3481        }
3482
3483        /// Sets the value of [weekly_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::weekly_backup_immutable].
3484        ///
3485        /// # Example
3486        /// ```ignore,no_run
3487        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3488        /// let x = BackupRetentionPolicy::new().set_weekly_backup_immutable(true);
3489        /// ```
3490        pub fn set_weekly_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3491            self.weekly_backup_immutable = v.into();
3492            self
3493        }
3494
3495        /// Sets the value of [monthly_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::monthly_backup_immutable].
3496        ///
3497        /// # Example
3498        /// ```ignore,no_run
3499        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3500        /// let x = BackupRetentionPolicy::new().set_monthly_backup_immutable(true);
3501        /// ```
3502        pub fn set_monthly_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3503            self.monthly_backup_immutable = v.into();
3504            self
3505        }
3506
3507        /// Sets the value of [manual_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::manual_backup_immutable].
3508        ///
3509        /// # Example
3510        /// ```ignore,no_run
3511        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3512        /// let x = BackupRetentionPolicy::new().set_manual_backup_immutable(true);
3513        /// ```
3514        pub fn set_manual_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3515            self.manual_backup_immutable = v.into();
3516            self
3517        }
3518    }
3519
3520    impl wkt::message::Message for BackupRetentionPolicy {
3521        fn typename() -> &'static str {
3522            "type.googleapis.com/google.cloud.netapp.v1.BackupVault.BackupRetentionPolicy"
3523        }
3524    }
3525
3526    /// The Backup Vault States
3527    ///
3528    /// # Working with unknown values
3529    ///
3530    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3531    /// additional enum variants at any time. Adding new variants is not considered
3532    /// a breaking change. Applications should write their code in anticipation of:
3533    ///
3534    /// - New values appearing in future releases of the client library, **and**
3535    /// - New values received dynamically, without application changes.
3536    ///
3537    /// Please consult the [Working with enums] section in the user guide for some
3538    /// guidelines.
3539    ///
3540    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3541    #[derive(Clone, Debug, PartialEq)]
3542    #[non_exhaustive]
3543    pub enum State {
3544        /// State not set.
3545        Unspecified,
3546        /// BackupVault is being created.
3547        Creating,
3548        /// BackupVault is available for use.
3549        Ready,
3550        /// BackupVault is being deleted.
3551        Deleting,
3552        /// BackupVault is not valid and cannot be used.
3553        Error,
3554        /// BackupVault is being updated.
3555        Updating,
3556        /// If set, the enum was initialized with an unknown value.
3557        ///
3558        /// Applications can examine the value using [State::value] or
3559        /// [State::name].
3560        UnknownValue(state::UnknownValue),
3561    }
3562
3563    #[doc(hidden)]
3564    pub mod state {
3565        #[allow(unused_imports)]
3566        use super::*;
3567        #[derive(Clone, Debug, PartialEq)]
3568        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3569    }
3570
3571    impl State {
3572        /// Gets the enum value.
3573        ///
3574        /// Returns `None` if the enum contains an unknown value deserialized from
3575        /// the string representation of enums.
3576        pub fn value(&self) -> std::option::Option<i32> {
3577            match self {
3578                Self::Unspecified => std::option::Option::Some(0),
3579                Self::Creating => std::option::Option::Some(1),
3580                Self::Ready => std::option::Option::Some(2),
3581                Self::Deleting => std::option::Option::Some(3),
3582                Self::Error => std::option::Option::Some(4),
3583                Self::Updating => std::option::Option::Some(5),
3584                Self::UnknownValue(u) => u.0.value(),
3585            }
3586        }
3587
3588        /// Gets the enum value as a string.
3589        ///
3590        /// Returns `None` if the enum contains an unknown value deserialized from
3591        /// the integer representation of enums.
3592        pub fn name(&self) -> std::option::Option<&str> {
3593            match self {
3594                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3595                Self::Creating => std::option::Option::Some("CREATING"),
3596                Self::Ready => std::option::Option::Some("READY"),
3597                Self::Deleting => std::option::Option::Some("DELETING"),
3598                Self::Error => std::option::Option::Some("ERROR"),
3599                Self::Updating => std::option::Option::Some("UPDATING"),
3600                Self::UnknownValue(u) => u.0.name(),
3601            }
3602        }
3603    }
3604
3605    impl std::default::Default for State {
3606        fn default() -> Self {
3607            use std::convert::From;
3608            Self::from(0)
3609        }
3610    }
3611
3612    impl std::fmt::Display for State {
3613        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3614            wkt::internal::display_enum(f, self.name(), self.value())
3615        }
3616    }
3617
3618    impl std::convert::From<i32> for State {
3619        fn from(value: i32) -> Self {
3620            match value {
3621                0 => Self::Unspecified,
3622                1 => Self::Creating,
3623                2 => Self::Ready,
3624                3 => Self::Deleting,
3625                4 => Self::Error,
3626                5 => Self::Updating,
3627                _ => Self::UnknownValue(state::UnknownValue(
3628                    wkt::internal::UnknownEnumValue::Integer(value),
3629                )),
3630            }
3631        }
3632    }
3633
3634    impl std::convert::From<&str> for State {
3635        fn from(value: &str) -> Self {
3636            use std::string::ToString;
3637            match value {
3638                "STATE_UNSPECIFIED" => Self::Unspecified,
3639                "CREATING" => Self::Creating,
3640                "READY" => Self::Ready,
3641                "DELETING" => Self::Deleting,
3642                "ERROR" => Self::Error,
3643                "UPDATING" => Self::Updating,
3644                _ => Self::UnknownValue(state::UnknownValue(
3645                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3646                )),
3647            }
3648        }
3649    }
3650
3651    impl serde::ser::Serialize for State {
3652        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3653        where
3654            S: serde::Serializer,
3655        {
3656            match self {
3657                Self::Unspecified => serializer.serialize_i32(0),
3658                Self::Creating => serializer.serialize_i32(1),
3659                Self::Ready => serializer.serialize_i32(2),
3660                Self::Deleting => serializer.serialize_i32(3),
3661                Self::Error => serializer.serialize_i32(4),
3662                Self::Updating => serializer.serialize_i32(5),
3663                Self::UnknownValue(u) => u.0.serialize(serializer),
3664            }
3665        }
3666    }
3667
3668    impl<'de> serde::de::Deserialize<'de> for State {
3669        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3670        where
3671            D: serde::Deserializer<'de>,
3672        {
3673            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3674                ".google.cloud.netapp.v1.BackupVault.State",
3675            ))
3676        }
3677    }
3678
3679    /// Backup Vault Type.
3680    ///
3681    /// # Working with unknown values
3682    ///
3683    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3684    /// additional enum variants at any time. Adding new variants is not considered
3685    /// a breaking change. Applications should write their code in anticipation of:
3686    ///
3687    /// - New values appearing in future releases of the client library, **and**
3688    /// - New values received dynamically, without application changes.
3689    ///
3690    /// Please consult the [Working with enums] section in the user guide for some
3691    /// guidelines.
3692    ///
3693    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3694    #[derive(Clone, Debug, PartialEq)]
3695    #[non_exhaustive]
3696    pub enum BackupVaultType {
3697        /// BackupVault type not set.
3698        Unspecified,
3699        /// BackupVault type is IN_REGION.
3700        InRegion,
3701        /// BackupVault type is CROSS_REGION.
3702        CrossRegion,
3703        /// If set, the enum was initialized with an unknown value.
3704        ///
3705        /// Applications can examine the value using [BackupVaultType::value] or
3706        /// [BackupVaultType::name].
3707        UnknownValue(backup_vault_type::UnknownValue),
3708    }
3709
3710    #[doc(hidden)]
3711    pub mod backup_vault_type {
3712        #[allow(unused_imports)]
3713        use super::*;
3714        #[derive(Clone, Debug, PartialEq)]
3715        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3716    }
3717
3718    impl BackupVaultType {
3719        /// Gets the enum value.
3720        ///
3721        /// Returns `None` if the enum contains an unknown value deserialized from
3722        /// the string representation of enums.
3723        pub fn value(&self) -> std::option::Option<i32> {
3724            match self {
3725                Self::Unspecified => std::option::Option::Some(0),
3726                Self::InRegion => std::option::Option::Some(1),
3727                Self::CrossRegion => std::option::Option::Some(2),
3728                Self::UnknownValue(u) => u.0.value(),
3729            }
3730        }
3731
3732        /// Gets the enum value as a string.
3733        ///
3734        /// Returns `None` if the enum contains an unknown value deserialized from
3735        /// the integer representation of enums.
3736        pub fn name(&self) -> std::option::Option<&str> {
3737            match self {
3738                Self::Unspecified => std::option::Option::Some("BACKUP_VAULT_TYPE_UNSPECIFIED"),
3739                Self::InRegion => std::option::Option::Some("IN_REGION"),
3740                Self::CrossRegion => std::option::Option::Some("CROSS_REGION"),
3741                Self::UnknownValue(u) => u.0.name(),
3742            }
3743        }
3744    }
3745
3746    impl std::default::Default for BackupVaultType {
3747        fn default() -> Self {
3748            use std::convert::From;
3749            Self::from(0)
3750        }
3751    }
3752
3753    impl std::fmt::Display for BackupVaultType {
3754        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3755            wkt::internal::display_enum(f, self.name(), self.value())
3756        }
3757    }
3758
3759    impl std::convert::From<i32> for BackupVaultType {
3760        fn from(value: i32) -> Self {
3761            match value {
3762                0 => Self::Unspecified,
3763                1 => Self::InRegion,
3764                2 => Self::CrossRegion,
3765                _ => Self::UnknownValue(backup_vault_type::UnknownValue(
3766                    wkt::internal::UnknownEnumValue::Integer(value),
3767                )),
3768            }
3769        }
3770    }
3771
3772    impl std::convert::From<&str> for BackupVaultType {
3773        fn from(value: &str) -> Self {
3774            use std::string::ToString;
3775            match value {
3776                "BACKUP_VAULT_TYPE_UNSPECIFIED" => Self::Unspecified,
3777                "IN_REGION" => Self::InRegion,
3778                "CROSS_REGION" => Self::CrossRegion,
3779                _ => Self::UnknownValue(backup_vault_type::UnknownValue(
3780                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3781                )),
3782            }
3783        }
3784    }
3785
3786    impl serde::ser::Serialize for BackupVaultType {
3787        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3788        where
3789            S: serde::Serializer,
3790        {
3791            match self {
3792                Self::Unspecified => serializer.serialize_i32(0),
3793                Self::InRegion => serializer.serialize_i32(1),
3794                Self::CrossRegion => serializer.serialize_i32(2),
3795                Self::UnknownValue(u) => u.0.serialize(serializer),
3796            }
3797        }
3798    }
3799
3800    impl<'de> serde::de::Deserialize<'de> for BackupVaultType {
3801        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3802        where
3803            D: serde::Deserializer<'de>,
3804        {
3805            deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupVaultType>::new(
3806                ".google.cloud.netapp.v1.BackupVault.BackupVaultType",
3807            ))
3808        }
3809    }
3810
3811    /// Encryption state of customer-managed encryption keys (CMEK) backups.
3812    ///
3813    /// # Working with unknown values
3814    ///
3815    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3816    /// additional enum variants at any time. Adding new variants is not considered
3817    /// a breaking change. Applications should write their code in anticipation of:
3818    ///
3819    /// - New values appearing in future releases of the client library, **and**
3820    /// - New values received dynamically, without application changes.
3821    ///
3822    /// Please consult the [Working with enums] section in the user guide for some
3823    /// guidelines.
3824    ///
3825    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3826    #[derive(Clone, Debug, PartialEq)]
3827    #[non_exhaustive]
3828    pub enum EncryptionState {
3829        /// Encryption state not set.
3830        Unspecified,
3831        /// Encryption state is pending.
3832        Pending,
3833        /// Encryption is complete.
3834        Completed,
3835        /// Encryption is in progress.
3836        InProgress,
3837        /// Encryption has failed.
3838        Failed,
3839        /// If set, the enum was initialized with an unknown value.
3840        ///
3841        /// Applications can examine the value using [EncryptionState::value] or
3842        /// [EncryptionState::name].
3843        UnknownValue(encryption_state::UnknownValue),
3844    }
3845
3846    #[doc(hidden)]
3847    pub mod encryption_state {
3848        #[allow(unused_imports)]
3849        use super::*;
3850        #[derive(Clone, Debug, PartialEq)]
3851        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3852    }
3853
3854    impl EncryptionState {
3855        /// Gets the enum value.
3856        ///
3857        /// Returns `None` if the enum contains an unknown value deserialized from
3858        /// the string representation of enums.
3859        pub fn value(&self) -> std::option::Option<i32> {
3860            match self {
3861                Self::Unspecified => std::option::Option::Some(0),
3862                Self::Pending => std::option::Option::Some(1),
3863                Self::Completed => std::option::Option::Some(2),
3864                Self::InProgress => std::option::Option::Some(3),
3865                Self::Failed => std::option::Option::Some(4),
3866                Self::UnknownValue(u) => u.0.value(),
3867            }
3868        }
3869
3870        /// Gets the enum value as a string.
3871        ///
3872        /// Returns `None` if the enum contains an unknown value deserialized from
3873        /// the integer representation of enums.
3874        pub fn name(&self) -> std::option::Option<&str> {
3875            match self {
3876                Self::Unspecified => std::option::Option::Some("ENCRYPTION_STATE_UNSPECIFIED"),
3877                Self::Pending => std::option::Option::Some("ENCRYPTION_STATE_PENDING"),
3878                Self::Completed => std::option::Option::Some("ENCRYPTION_STATE_COMPLETED"),
3879                Self::InProgress => std::option::Option::Some("ENCRYPTION_STATE_IN_PROGRESS"),
3880                Self::Failed => std::option::Option::Some("ENCRYPTION_STATE_FAILED"),
3881                Self::UnknownValue(u) => u.0.name(),
3882            }
3883        }
3884    }
3885
3886    impl std::default::Default for EncryptionState {
3887        fn default() -> Self {
3888            use std::convert::From;
3889            Self::from(0)
3890        }
3891    }
3892
3893    impl std::fmt::Display for EncryptionState {
3894        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3895            wkt::internal::display_enum(f, self.name(), self.value())
3896        }
3897    }
3898
3899    impl std::convert::From<i32> for EncryptionState {
3900        fn from(value: i32) -> Self {
3901            match value {
3902                0 => Self::Unspecified,
3903                1 => Self::Pending,
3904                2 => Self::Completed,
3905                3 => Self::InProgress,
3906                4 => Self::Failed,
3907                _ => Self::UnknownValue(encryption_state::UnknownValue(
3908                    wkt::internal::UnknownEnumValue::Integer(value),
3909                )),
3910            }
3911        }
3912    }
3913
3914    impl std::convert::From<&str> for EncryptionState {
3915        fn from(value: &str) -> Self {
3916            use std::string::ToString;
3917            match value {
3918                "ENCRYPTION_STATE_UNSPECIFIED" => Self::Unspecified,
3919                "ENCRYPTION_STATE_PENDING" => Self::Pending,
3920                "ENCRYPTION_STATE_COMPLETED" => Self::Completed,
3921                "ENCRYPTION_STATE_IN_PROGRESS" => Self::InProgress,
3922                "ENCRYPTION_STATE_FAILED" => Self::Failed,
3923                _ => Self::UnknownValue(encryption_state::UnknownValue(
3924                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3925                )),
3926            }
3927        }
3928    }
3929
3930    impl serde::ser::Serialize for EncryptionState {
3931        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3932        where
3933            S: serde::Serializer,
3934        {
3935            match self {
3936                Self::Unspecified => serializer.serialize_i32(0),
3937                Self::Pending => serializer.serialize_i32(1),
3938                Self::Completed => serializer.serialize_i32(2),
3939                Self::InProgress => serializer.serialize_i32(3),
3940                Self::Failed => serializer.serialize_i32(4),
3941                Self::UnknownValue(u) => u.0.serialize(serializer),
3942            }
3943        }
3944    }
3945
3946    impl<'de> serde::de::Deserialize<'de> for EncryptionState {
3947        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3948        where
3949            D: serde::Deserializer<'de>,
3950        {
3951            deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionState>::new(
3952                ".google.cloud.netapp.v1.BackupVault.EncryptionState",
3953            ))
3954        }
3955    }
3956}
3957
3958/// GetBackupVaultRequest gets the state of a backupVault.
3959#[derive(Clone, Default, PartialEq)]
3960#[non_exhaustive]
3961pub struct GetBackupVaultRequest {
3962    /// Required. The backupVault resource name, in the format
3963    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
3964    pub name: std::string::String,
3965
3966    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3967}
3968
3969impl GetBackupVaultRequest {
3970    pub fn new() -> Self {
3971        std::default::Default::default()
3972    }
3973
3974    /// Sets the value of [name][crate::model::GetBackupVaultRequest::name].
3975    ///
3976    /// # Example
3977    /// ```ignore,no_run
3978    /// # use google_cloud_netapp_v1::model::GetBackupVaultRequest;
3979    /// let x = GetBackupVaultRequest::new().set_name("example");
3980    /// ```
3981    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3982        self.name = v.into();
3983        self
3984    }
3985}
3986
3987impl wkt::message::Message for GetBackupVaultRequest {
3988    fn typename() -> &'static str {
3989        "type.googleapis.com/google.cloud.netapp.v1.GetBackupVaultRequest"
3990    }
3991}
3992
3993/// ListBackupVaultsRequest lists backupVaults.
3994#[derive(Clone, Default, PartialEq)]
3995#[non_exhaustive]
3996pub struct ListBackupVaultsRequest {
3997    /// Required. The location for which to retrieve backupVault information,
3998    /// in the format
3999    /// `projects/{project_id}/locations/{location}`.
4000    pub parent: std::string::String,
4001
4002    /// The maximum number of items to return.
4003    pub page_size: i32,
4004
4005    /// The next_page_token value to use if there are additional
4006    /// results to retrieve for this list request.
4007    pub page_token: std::string::String,
4008
4009    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
4010    pub order_by: std::string::String,
4011
4012    /// List filter.
4013    pub filter: std::string::String,
4014
4015    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4016}
4017
4018impl ListBackupVaultsRequest {
4019    pub fn new() -> Self {
4020        std::default::Default::default()
4021    }
4022
4023    /// Sets the value of [parent][crate::model::ListBackupVaultsRequest::parent].
4024    ///
4025    /// # Example
4026    /// ```ignore,no_run
4027    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4028    /// let x = ListBackupVaultsRequest::new().set_parent("example");
4029    /// ```
4030    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4031        self.parent = v.into();
4032        self
4033    }
4034
4035    /// Sets the value of [page_size][crate::model::ListBackupVaultsRequest::page_size].
4036    ///
4037    /// # Example
4038    /// ```ignore,no_run
4039    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4040    /// let x = ListBackupVaultsRequest::new().set_page_size(42);
4041    /// ```
4042    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4043        self.page_size = v.into();
4044        self
4045    }
4046
4047    /// Sets the value of [page_token][crate::model::ListBackupVaultsRequest::page_token].
4048    ///
4049    /// # Example
4050    /// ```ignore,no_run
4051    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4052    /// let x = ListBackupVaultsRequest::new().set_page_token("example");
4053    /// ```
4054    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4055        self.page_token = v.into();
4056        self
4057    }
4058
4059    /// Sets the value of [order_by][crate::model::ListBackupVaultsRequest::order_by].
4060    ///
4061    /// # Example
4062    /// ```ignore,no_run
4063    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4064    /// let x = ListBackupVaultsRequest::new().set_order_by("example");
4065    /// ```
4066    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4067        self.order_by = v.into();
4068        self
4069    }
4070
4071    /// Sets the value of [filter][crate::model::ListBackupVaultsRequest::filter].
4072    ///
4073    /// # Example
4074    /// ```ignore,no_run
4075    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4076    /// let x = ListBackupVaultsRequest::new().set_filter("example");
4077    /// ```
4078    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4079        self.filter = v.into();
4080        self
4081    }
4082}
4083
4084impl wkt::message::Message for ListBackupVaultsRequest {
4085    fn typename() -> &'static str {
4086        "type.googleapis.com/google.cloud.netapp.v1.ListBackupVaultsRequest"
4087    }
4088}
4089
4090/// ListBackupVaultsResponse is the result of ListBackupVaultsRequest.
4091#[derive(Clone, Default, PartialEq)]
4092#[non_exhaustive]
4093pub struct ListBackupVaultsResponse {
4094    /// A list of backupVaults in the project for the specified location.
4095    pub backup_vaults: std::vec::Vec<crate::model::BackupVault>,
4096
4097    /// The token you can use to retrieve the next page of results. Not returned
4098    /// if there are no more results in the list.
4099    pub next_page_token: std::string::String,
4100
4101    /// Locations that could not be reached.
4102    pub unreachable: std::vec::Vec<std::string::String>,
4103
4104    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4105}
4106
4107impl ListBackupVaultsResponse {
4108    pub fn new() -> Self {
4109        std::default::Default::default()
4110    }
4111
4112    /// Sets the value of [backup_vaults][crate::model::ListBackupVaultsResponse::backup_vaults].
4113    ///
4114    /// # Example
4115    /// ```ignore,no_run
4116    /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
4117    /// use google_cloud_netapp_v1::model::BackupVault;
4118    /// let x = ListBackupVaultsResponse::new()
4119    ///     .set_backup_vaults([
4120    ///         BackupVault::default()/* use setters */,
4121    ///         BackupVault::default()/* use (different) setters */,
4122    ///     ]);
4123    /// ```
4124    pub fn set_backup_vaults<T, V>(mut self, v: T) -> Self
4125    where
4126        T: std::iter::IntoIterator<Item = V>,
4127        V: std::convert::Into<crate::model::BackupVault>,
4128    {
4129        use std::iter::Iterator;
4130        self.backup_vaults = v.into_iter().map(|i| i.into()).collect();
4131        self
4132    }
4133
4134    /// Sets the value of [next_page_token][crate::model::ListBackupVaultsResponse::next_page_token].
4135    ///
4136    /// # Example
4137    /// ```ignore,no_run
4138    /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
4139    /// let x = ListBackupVaultsResponse::new().set_next_page_token("example");
4140    /// ```
4141    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4142        self.next_page_token = v.into();
4143        self
4144    }
4145
4146    /// Sets the value of [unreachable][crate::model::ListBackupVaultsResponse::unreachable].
4147    ///
4148    /// # Example
4149    /// ```ignore,no_run
4150    /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
4151    /// let x = ListBackupVaultsResponse::new().set_unreachable(["a", "b", "c"]);
4152    /// ```
4153    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4154    where
4155        T: std::iter::IntoIterator<Item = V>,
4156        V: std::convert::Into<std::string::String>,
4157    {
4158        use std::iter::Iterator;
4159        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4160        self
4161    }
4162}
4163
4164impl wkt::message::Message for ListBackupVaultsResponse {
4165    fn typename() -> &'static str {
4166        "type.googleapis.com/google.cloud.netapp.v1.ListBackupVaultsResponse"
4167    }
4168}
4169
4170#[doc(hidden)]
4171impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupVaultsResponse {
4172    type PageItem = crate::model::BackupVault;
4173
4174    fn items(self) -> std::vec::Vec<Self::PageItem> {
4175        self.backup_vaults
4176    }
4177
4178    fn next_page_token(&self) -> std::string::String {
4179        use std::clone::Clone;
4180        self.next_page_token.clone()
4181    }
4182}
4183
4184/// CreateBackupVaultRequest creates a backup vault.
4185#[derive(Clone, Default, PartialEq)]
4186#[non_exhaustive]
4187pub struct CreateBackupVaultRequest {
4188    /// Required. The location to create the backup vaults, in the format
4189    /// `projects/{project_id}/locations/{location}`
4190    pub parent: std::string::String,
4191
4192    /// Required. The ID to use for the backupVault.
4193    /// The ID must be unique within the specified location.
4194    /// Must contain only letters, numbers and hyphen, with the first
4195    /// character a letter, the last a letter or a
4196    /// number, and a 63 character maximum.
4197    pub backup_vault_id: std::string::String,
4198
4199    /// Required. A backupVault resource
4200    pub backup_vault: std::option::Option<crate::model::BackupVault>,
4201
4202    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4203}
4204
4205impl CreateBackupVaultRequest {
4206    pub fn new() -> Self {
4207        std::default::Default::default()
4208    }
4209
4210    /// Sets the value of [parent][crate::model::CreateBackupVaultRequest::parent].
4211    ///
4212    /// # Example
4213    /// ```ignore,no_run
4214    /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4215    /// let x = CreateBackupVaultRequest::new().set_parent("example");
4216    /// ```
4217    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4218        self.parent = v.into();
4219        self
4220    }
4221
4222    /// Sets the value of [backup_vault_id][crate::model::CreateBackupVaultRequest::backup_vault_id].
4223    ///
4224    /// # Example
4225    /// ```ignore,no_run
4226    /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4227    /// let x = CreateBackupVaultRequest::new().set_backup_vault_id("example");
4228    /// ```
4229    pub fn set_backup_vault_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4230        self.backup_vault_id = v.into();
4231        self
4232    }
4233
4234    /// Sets the value of [backup_vault][crate::model::CreateBackupVaultRequest::backup_vault].
4235    ///
4236    /// # Example
4237    /// ```ignore,no_run
4238    /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4239    /// use google_cloud_netapp_v1::model::BackupVault;
4240    /// let x = CreateBackupVaultRequest::new().set_backup_vault(BackupVault::default()/* use setters */);
4241    /// ```
4242    pub fn set_backup_vault<T>(mut self, v: T) -> Self
4243    where
4244        T: std::convert::Into<crate::model::BackupVault>,
4245    {
4246        self.backup_vault = std::option::Option::Some(v.into());
4247        self
4248    }
4249
4250    /// Sets or clears the value of [backup_vault][crate::model::CreateBackupVaultRequest::backup_vault].
4251    ///
4252    /// # Example
4253    /// ```ignore,no_run
4254    /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4255    /// use google_cloud_netapp_v1::model::BackupVault;
4256    /// let x = CreateBackupVaultRequest::new().set_or_clear_backup_vault(Some(BackupVault::default()/* use setters */));
4257    /// let x = CreateBackupVaultRequest::new().set_or_clear_backup_vault(None::<BackupVault>);
4258    /// ```
4259    pub fn set_or_clear_backup_vault<T>(mut self, v: std::option::Option<T>) -> Self
4260    where
4261        T: std::convert::Into<crate::model::BackupVault>,
4262    {
4263        self.backup_vault = v.map(|x| x.into());
4264        self
4265    }
4266}
4267
4268impl wkt::message::Message for CreateBackupVaultRequest {
4269    fn typename() -> &'static str {
4270        "type.googleapis.com/google.cloud.netapp.v1.CreateBackupVaultRequest"
4271    }
4272}
4273
4274/// DeleteBackupVaultRequest deletes a backupVault.
4275#[derive(Clone, Default, PartialEq)]
4276#[non_exhaustive]
4277pub struct DeleteBackupVaultRequest {
4278    /// Required. The backupVault resource name, in the format
4279    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
4280    pub name: std::string::String,
4281
4282    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4283}
4284
4285impl DeleteBackupVaultRequest {
4286    pub fn new() -> Self {
4287        std::default::Default::default()
4288    }
4289
4290    /// Sets the value of [name][crate::model::DeleteBackupVaultRequest::name].
4291    ///
4292    /// # Example
4293    /// ```ignore,no_run
4294    /// # use google_cloud_netapp_v1::model::DeleteBackupVaultRequest;
4295    /// let x = DeleteBackupVaultRequest::new().set_name("example");
4296    /// ```
4297    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4298        self.name = v.into();
4299        self
4300    }
4301}
4302
4303impl wkt::message::Message for DeleteBackupVaultRequest {
4304    fn typename() -> &'static str {
4305        "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupVaultRequest"
4306    }
4307}
4308
4309/// UpdateBackupVaultRequest updates description and/or labels for a backupVault.
4310#[derive(Clone, Default, PartialEq)]
4311#[non_exhaustive]
4312pub struct UpdateBackupVaultRequest {
4313    /// Required. Field mask is used to specify the fields to be overwritten in the
4314    /// Backup resource to be updated.
4315    /// The fields specified in the update_mask are relative to the resource, not
4316    /// the full request. A field will be overwritten if it is in the mask. If the
4317    /// user does not provide a mask then all fields will be overwritten.
4318    pub update_mask: std::option::Option<wkt::FieldMask>,
4319
4320    /// Required. The backupVault being updated
4321    pub backup_vault: std::option::Option<crate::model::BackupVault>,
4322
4323    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4324}
4325
4326impl UpdateBackupVaultRequest {
4327    pub fn new() -> Self {
4328        std::default::Default::default()
4329    }
4330
4331    /// Sets the value of [update_mask][crate::model::UpdateBackupVaultRequest::update_mask].
4332    ///
4333    /// # Example
4334    /// ```ignore,no_run
4335    /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4336    /// use wkt::FieldMask;
4337    /// let x = UpdateBackupVaultRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4338    /// ```
4339    pub fn set_update_mask<T>(mut self, v: T) -> Self
4340    where
4341        T: std::convert::Into<wkt::FieldMask>,
4342    {
4343        self.update_mask = std::option::Option::Some(v.into());
4344        self
4345    }
4346
4347    /// Sets or clears the value of [update_mask][crate::model::UpdateBackupVaultRequest::update_mask].
4348    ///
4349    /// # Example
4350    /// ```ignore,no_run
4351    /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4352    /// use wkt::FieldMask;
4353    /// let x = UpdateBackupVaultRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4354    /// let x = UpdateBackupVaultRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4355    /// ```
4356    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4357    where
4358        T: std::convert::Into<wkt::FieldMask>,
4359    {
4360        self.update_mask = v.map(|x| x.into());
4361        self
4362    }
4363
4364    /// Sets the value of [backup_vault][crate::model::UpdateBackupVaultRequest::backup_vault].
4365    ///
4366    /// # Example
4367    /// ```ignore,no_run
4368    /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4369    /// use google_cloud_netapp_v1::model::BackupVault;
4370    /// let x = UpdateBackupVaultRequest::new().set_backup_vault(BackupVault::default()/* use setters */);
4371    /// ```
4372    pub fn set_backup_vault<T>(mut self, v: T) -> Self
4373    where
4374        T: std::convert::Into<crate::model::BackupVault>,
4375    {
4376        self.backup_vault = std::option::Option::Some(v.into());
4377        self
4378    }
4379
4380    /// Sets or clears the value of [backup_vault][crate::model::UpdateBackupVaultRequest::backup_vault].
4381    ///
4382    /// # Example
4383    /// ```ignore,no_run
4384    /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4385    /// use google_cloud_netapp_v1::model::BackupVault;
4386    /// let x = UpdateBackupVaultRequest::new().set_or_clear_backup_vault(Some(BackupVault::default()/* use setters */));
4387    /// let x = UpdateBackupVaultRequest::new().set_or_clear_backup_vault(None::<BackupVault>);
4388    /// ```
4389    pub fn set_or_clear_backup_vault<T>(mut self, v: std::option::Option<T>) -> Self
4390    where
4391        T: std::convert::Into<crate::model::BackupVault>,
4392    {
4393        self.backup_vault = v.map(|x| x.into());
4394        self
4395    }
4396}
4397
4398impl wkt::message::Message for UpdateBackupVaultRequest {
4399    fn typename() -> &'static str {
4400        "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupVaultRequest"
4401    }
4402}
4403
4404/// Represents the metadata of the long-running operation.
4405#[derive(Clone, Default, PartialEq)]
4406#[non_exhaustive]
4407pub struct OperationMetadata {
4408    /// Output only. The time the operation was created.
4409    pub create_time: std::option::Option<wkt::Timestamp>,
4410
4411    /// Output only. The time the operation finished running.
4412    pub end_time: std::option::Option<wkt::Timestamp>,
4413
4414    /// Output only. Server-defined resource path for the target of the operation.
4415    pub target: std::string::String,
4416
4417    /// Output only. Name of the verb executed by the operation.
4418    pub verb: std::string::String,
4419
4420    /// Output only. Human-readable status of the operation, if any.
4421    pub status_message: std::string::String,
4422
4423    /// Output only. Identifies whether the user has requested cancellation
4424    /// of the operation. Operations that have been canceled successfully
4425    /// have [Operation.error][] value with a
4426    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
4427    /// `Code.CANCELLED`.
4428    ///
4429    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
4430    pub requested_cancellation: bool,
4431
4432    /// Output only. API version used to start the operation.
4433    pub api_version: std::string::String,
4434
4435    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4436}
4437
4438impl OperationMetadata {
4439    pub fn new() -> Self {
4440        std::default::Default::default()
4441    }
4442
4443    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
4444    ///
4445    /// # Example
4446    /// ```ignore,no_run
4447    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4448    /// use wkt::Timestamp;
4449    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
4450    /// ```
4451    pub fn set_create_time<T>(mut self, v: T) -> Self
4452    where
4453        T: std::convert::Into<wkt::Timestamp>,
4454    {
4455        self.create_time = std::option::Option::Some(v.into());
4456        self
4457    }
4458
4459    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
4460    ///
4461    /// # Example
4462    /// ```ignore,no_run
4463    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4464    /// use wkt::Timestamp;
4465    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4466    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
4467    /// ```
4468    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4469    where
4470        T: std::convert::Into<wkt::Timestamp>,
4471    {
4472        self.create_time = v.map(|x| x.into());
4473        self
4474    }
4475
4476    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
4477    ///
4478    /// # Example
4479    /// ```ignore,no_run
4480    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4481    /// use wkt::Timestamp;
4482    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
4483    /// ```
4484    pub fn set_end_time<T>(mut self, v: T) -> Self
4485    where
4486        T: std::convert::Into<wkt::Timestamp>,
4487    {
4488        self.end_time = std::option::Option::Some(v.into());
4489        self
4490    }
4491
4492    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
4493    ///
4494    /// # Example
4495    /// ```ignore,no_run
4496    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4497    /// use wkt::Timestamp;
4498    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
4499    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
4500    /// ```
4501    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4502    where
4503        T: std::convert::Into<wkt::Timestamp>,
4504    {
4505        self.end_time = v.map(|x| x.into());
4506        self
4507    }
4508
4509    /// Sets the value of [target][crate::model::OperationMetadata::target].
4510    ///
4511    /// # Example
4512    /// ```ignore,no_run
4513    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4514    /// let x = OperationMetadata::new().set_target("example");
4515    /// ```
4516    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4517        self.target = v.into();
4518        self
4519    }
4520
4521    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
4522    ///
4523    /// # Example
4524    /// ```ignore,no_run
4525    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4526    /// let x = OperationMetadata::new().set_verb("example");
4527    /// ```
4528    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4529        self.verb = v.into();
4530        self
4531    }
4532
4533    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
4534    ///
4535    /// # Example
4536    /// ```ignore,no_run
4537    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4538    /// let x = OperationMetadata::new().set_status_message("example");
4539    /// ```
4540    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4541        self.status_message = v.into();
4542        self
4543    }
4544
4545    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
4546    ///
4547    /// # Example
4548    /// ```ignore,no_run
4549    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4550    /// let x = OperationMetadata::new().set_requested_cancellation(true);
4551    /// ```
4552    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4553        self.requested_cancellation = v.into();
4554        self
4555    }
4556
4557    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
4558    ///
4559    /// # Example
4560    /// ```ignore,no_run
4561    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4562    /// let x = OperationMetadata::new().set_api_version("example");
4563    /// ```
4564    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4565        self.api_version = v.into();
4566        self
4567    }
4568}
4569
4570impl wkt::message::Message for OperationMetadata {
4571    fn typename() -> &'static str {
4572        "type.googleapis.com/google.cloud.netapp.v1.OperationMetadata"
4573    }
4574}
4575
4576/// Metadata for a given
4577/// [google.cloud.location.Location][google.cloud.location.Location].
4578///
4579/// [google.cloud.location.Location]: google_cloud_location::model::Location
4580#[derive(Clone, Default, PartialEq)]
4581#[non_exhaustive]
4582pub struct LocationMetadata {
4583    /// Output only. Supported service levels in a location.
4584    pub supported_service_levels: std::vec::Vec<crate::model::ServiceLevel>,
4585
4586    /// Output only. Supported flex performance in a location.
4587    pub supported_flex_performance: std::vec::Vec<crate::model::FlexPerformance>,
4588
4589    /// Output only. Indicates if the location has VCP support.
4590    pub has_vcp: bool,
4591
4592    /// Output only. Indicates if the location has ONTAP Proxy support.
4593    pub has_ontap_proxy: bool,
4594
4595    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4596}
4597
4598impl LocationMetadata {
4599    pub fn new() -> Self {
4600        std::default::Default::default()
4601    }
4602
4603    /// Sets the value of [supported_service_levels][crate::model::LocationMetadata::supported_service_levels].
4604    ///
4605    /// # Example
4606    /// ```ignore,no_run
4607    /// # use google_cloud_netapp_v1::model::LocationMetadata;
4608    /// use google_cloud_netapp_v1::model::ServiceLevel;
4609    /// let x = LocationMetadata::new().set_supported_service_levels([
4610    ///     ServiceLevel::Premium,
4611    ///     ServiceLevel::Extreme,
4612    ///     ServiceLevel::Standard,
4613    /// ]);
4614    /// ```
4615    pub fn set_supported_service_levels<T, V>(mut self, v: T) -> Self
4616    where
4617        T: std::iter::IntoIterator<Item = V>,
4618        V: std::convert::Into<crate::model::ServiceLevel>,
4619    {
4620        use std::iter::Iterator;
4621        self.supported_service_levels = v.into_iter().map(|i| i.into()).collect();
4622        self
4623    }
4624
4625    /// Sets the value of [supported_flex_performance][crate::model::LocationMetadata::supported_flex_performance].
4626    ///
4627    /// # Example
4628    /// ```ignore,no_run
4629    /// # use google_cloud_netapp_v1::model::LocationMetadata;
4630    /// use google_cloud_netapp_v1::model::FlexPerformance;
4631    /// let x = LocationMetadata::new().set_supported_flex_performance([
4632    ///     FlexPerformance::Default,
4633    ///     FlexPerformance::Custom,
4634    /// ]);
4635    /// ```
4636    pub fn set_supported_flex_performance<T, V>(mut self, v: T) -> Self
4637    where
4638        T: std::iter::IntoIterator<Item = V>,
4639        V: std::convert::Into<crate::model::FlexPerformance>,
4640    {
4641        use std::iter::Iterator;
4642        self.supported_flex_performance = v.into_iter().map(|i| i.into()).collect();
4643        self
4644    }
4645
4646    /// Sets the value of [has_vcp][crate::model::LocationMetadata::has_vcp].
4647    ///
4648    /// # Example
4649    /// ```ignore,no_run
4650    /// # use google_cloud_netapp_v1::model::LocationMetadata;
4651    /// let x = LocationMetadata::new().set_has_vcp(true);
4652    /// ```
4653    pub fn set_has_vcp<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4654        self.has_vcp = v.into();
4655        self
4656    }
4657
4658    /// Sets the value of [has_ontap_proxy][crate::model::LocationMetadata::has_ontap_proxy].
4659    ///
4660    /// # Example
4661    /// ```ignore,no_run
4662    /// # use google_cloud_netapp_v1::model::LocationMetadata;
4663    /// let x = LocationMetadata::new().set_has_ontap_proxy(true);
4664    /// ```
4665    pub fn set_has_ontap_proxy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4666        self.has_ontap_proxy = v.into();
4667        self
4668    }
4669}
4670
4671impl wkt::message::Message for LocationMetadata {
4672    fn typename() -> &'static str {
4673        "type.googleapis.com/google.cloud.netapp.v1.LocationMetadata"
4674    }
4675}
4676
4677/// UserCommands contains the commands to be executed by the customer.
4678#[derive(Clone, Default, PartialEq)]
4679#[non_exhaustive]
4680pub struct UserCommands {
4681    /// Output only. List of commands to be executed by the customer.
4682    pub commands: std::vec::Vec<std::string::String>,
4683
4684    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4685}
4686
4687impl UserCommands {
4688    pub fn new() -> Self {
4689        std::default::Default::default()
4690    }
4691
4692    /// Sets the value of [commands][crate::model::UserCommands::commands].
4693    ///
4694    /// # Example
4695    /// ```ignore,no_run
4696    /// # use google_cloud_netapp_v1::model::UserCommands;
4697    /// let x = UserCommands::new().set_commands(["a", "b", "c"]);
4698    /// ```
4699    pub fn set_commands<T, V>(mut self, v: T) -> Self
4700    where
4701        T: std::iter::IntoIterator<Item = V>,
4702        V: std::convert::Into<std::string::String>,
4703    {
4704        use std::iter::Iterator;
4705        self.commands = v.into_iter().map(|i| i.into()).collect();
4706        self
4707    }
4708}
4709
4710impl wkt::message::Message for UserCommands {
4711    fn typename() -> &'static str {
4712        "type.googleapis.com/google.cloud.netapp.v1.UserCommands"
4713    }
4714}
4715
4716/// ListHostGroupsRequest for listing host groups.
4717#[derive(Clone, Default, PartialEq)]
4718#[non_exhaustive]
4719pub struct ListHostGroupsRequest {
4720    /// Required. Parent value for ListHostGroupsRequest
4721    pub parent: std::string::String,
4722
4723    /// Optional. Requested page size. Server may return fewer items than
4724    /// requested. If unspecified, the server will pick an appropriate default.
4725    pub page_size: i32,
4726
4727    /// Optional. A token identifying a page of results the server should return.
4728    pub page_token: std::string::String,
4729
4730    /// Optional. Filter to apply to the request.
4731    pub filter: std::string::String,
4732
4733    /// Optional. Hint for how to order the results
4734    pub order_by: std::string::String,
4735
4736    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4737}
4738
4739impl ListHostGroupsRequest {
4740    pub fn new() -> Self {
4741        std::default::Default::default()
4742    }
4743
4744    /// Sets the value of [parent][crate::model::ListHostGroupsRequest::parent].
4745    ///
4746    /// # Example
4747    /// ```ignore,no_run
4748    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4749    /// let x = ListHostGroupsRequest::new().set_parent("example");
4750    /// ```
4751    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4752        self.parent = v.into();
4753        self
4754    }
4755
4756    /// Sets the value of [page_size][crate::model::ListHostGroupsRequest::page_size].
4757    ///
4758    /// # Example
4759    /// ```ignore,no_run
4760    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4761    /// let x = ListHostGroupsRequest::new().set_page_size(42);
4762    /// ```
4763    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4764        self.page_size = v.into();
4765        self
4766    }
4767
4768    /// Sets the value of [page_token][crate::model::ListHostGroupsRequest::page_token].
4769    ///
4770    /// # Example
4771    /// ```ignore,no_run
4772    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4773    /// let x = ListHostGroupsRequest::new().set_page_token("example");
4774    /// ```
4775    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4776        self.page_token = v.into();
4777        self
4778    }
4779
4780    /// Sets the value of [filter][crate::model::ListHostGroupsRequest::filter].
4781    ///
4782    /// # Example
4783    /// ```ignore,no_run
4784    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4785    /// let x = ListHostGroupsRequest::new().set_filter("example");
4786    /// ```
4787    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4788        self.filter = v.into();
4789        self
4790    }
4791
4792    /// Sets the value of [order_by][crate::model::ListHostGroupsRequest::order_by].
4793    ///
4794    /// # Example
4795    /// ```ignore,no_run
4796    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4797    /// let x = ListHostGroupsRequest::new().set_order_by("example");
4798    /// ```
4799    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4800        self.order_by = v.into();
4801        self
4802    }
4803}
4804
4805impl wkt::message::Message for ListHostGroupsRequest {
4806    fn typename() -> &'static str {
4807        "type.googleapis.com/google.cloud.netapp.v1.ListHostGroupsRequest"
4808    }
4809}
4810
4811/// ListHostGroupsResponse is the response to a ListHostGroupsRequest.
4812#[derive(Clone, Default, PartialEq)]
4813#[non_exhaustive]
4814pub struct ListHostGroupsResponse {
4815    /// The list of host groups.
4816    pub host_groups: std::vec::Vec<crate::model::HostGroup>,
4817
4818    /// A token identifying a page of results the server should return.
4819    pub next_page_token: std::string::String,
4820
4821    /// Locations that could not be reached.
4822    pub unreachable: std::vec::Vec<std::string::String>,
4823
4824    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4825}
4826
4827impl ListHostGroupsResponse {
4828    pub fn new() -> Self {
4829        std::default::Default::default()
4830    }
4831
4832    /// Sets the value of [host_groups][crate::model::ListHostGroupsResponse::host_groups].
4833    ///
4834    /// # Example
4835    /// ```ignore,no_run
4836    /// # use google_cloud_netapp_v1::model::ListHostGroupsResponse;
4837    /// use google_cloud_netapp_v1::model::HostGroup;
4838    /// let x = ListHostGroupsResponse::new()
4839    ///     .set_host_groups([
4840    ///         HostGroup::default()/* use setters */,
4841    ///         HostGroup::default()/* use (different) setters */,
4842    ///     ]);
4843    /// ```
4844    pub fn set_host_groups<T, V>(mut self, v: T) -> Self
4845    where
4846        T: std::iter::IntoIterator<Item = V>,
4847        V: std::convert::Into<crate::model::HostGroup>,
4848    {
4849        use std::iter::Iterator;
4850        self.host_groups = v.into_iter().map(|i| i.into()).collect();
4851        self
4852    }
4853
4854    /// Sets the value of [next_page_token][crate::model::ListHostGroupsResponse::next_page_token].
4855    ///
4856    /// # Example
4857    /// ```ignore,no_run
4858    /// # use google_cloud_netapp_v1::model::ListHostGroupsResponse;
4859    /// let x = ListHostGroupsResponse::new().set_next_page_token("example");
4860    /// ```
4861    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4862        self.next_page_token = v.into();
4863        self
4864    }
4865
4866    /// Sets the value of [unreachable][crate::model::ListHostGroupsResponse::unreachable].
4867    ///
4868    /// # Example
4869    /// ```ignore,no_run
4870    /// # use google_cloud_netapp_v1::model::ListHostGroupsResponse;
4871    /// let x = ListHostGroupsResponse::new().set_unreachable(["a", "b", "c"]);
4872    /// ```
4873    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4874    where
4875        T: std::iter::IntoIterator<Item = V>,
4876        V: std::convert::Into<std::string::String>,
4877    {
4878        use std::iter::Iterator;
4879        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4880        self
4881    }
4882}
4883
4884impl wkt::message::Message for ListHostGroupsResponse {
4885    fn typename() -> &'static str {
4886        "type.googleapis.com/google.cloud.netapp.v1.ListHostGroupsResponse"
4887    }
4888}
4889
4890#[doc(hidden)]
4891impl google_cloud_gax::paginator::internal::PageableResponse for ListHostGroupsResponse {
4892    type PageItem = crate::model::HostGroup;
4893
4894    fn items(self) -> std::vec::Vec<Self::PageItem> {
4895        self.host_groups
4896    }
4897
4898    fn next_page_token(&self) -> std::string::String {
4899        use std::clone::Clone;
4900        self.next_page_token.clone()
4901    }
4902}
4903
4904/// GetHostGroupRequest for getting a host group.
4905#[derive(Clone, Default, PartialEq)]
4906#[non_exhaustive]
4907pub struct GetHostGroupRequest {
4908    /// Required. The resource name of the host group.
4909    /// Format:
4910    /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
4911    pub name: std::string::String,
4912
4913    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4914}
4915
4916impl GetHostGroupRequest {
4917    pub fn new() -> Self {
4918        std::default::Default::default()
4919    }
4920
4921    /// Sets the value of [name][crate::model::GetHostGroupRequest::name].
4922    ///
4923    /// # Example
4924    /// ```ignore,no_run
4925    /// # use google_cloud_netapp_v1::model::GetHostGroupRequest;
4926    /// let x = GetHostGroupRequest::new().set_name("example");
4927    /// ```
4928    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4929        self.name = v.into();
4930        self
4931    }
4932}
4933
4934impl wkt::message::Message for GetHostGroupRequest {
4935    fn typename() -> &'static str {
4936        "type.googleapis.com/google.cloud.netapp.v1.GetHostGroupRequest"
4937    }
4938}
4939
4940/// CreateHostGroupRequest for creating a host group.
4941#[derive(Clone, Default, PartialEq)]
4942#[non_exhaustive]
4943pub struct CreateHostGroupRequest {
4944    /// Required. Parent value for CreateHostGroupRequest
4945    pub parent: std::string::String,
4946
4947    /// Required. Fields of the host group to create.
4948    pub host_group: std::option::Option<crate::model::HostGroup>,
4949
4950    /// Required. ID of the host group to create. Must be unique within the parent
4951    /// resource. Must contain only letters, numbers, and hyphen, with
4952    /// the first character a letter or underscore, the last a letter or underscore
4953    /// or a number, and a 63 character maximum.
4954    pub host_group_id: std::string::String,
4955
4956    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4957}
4958
4959impl CreateHostGroupRequest {
4960    pub fn new() -> Self {
4961        std::default::Default::default()
4962    }
4963
4964    /// Sets the value of [parent][crate::model::CreateHostGroupRequest::parent].
4965    ///
4966    /// # Example
4967    /// ```ignore,no_run
4968    /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
4969    /// let x = CreateHostGroupRequest::new().set_parent("example");
4970    /// ```
4971    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4972        self.parent = v.into();
4973        self
4974    }
4975
4976    /// Sets the value of [host_group][crate::model::CreateHostGroupRequest::host_group].
4977    ///
4978    /// # Example
4979    /// ```ignore,no_run
4980    /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
4981    /// use google_cloud_netapp_v1::model::HostGroup;
4982    /// let x = CreateHostGroupRequest::new().set_host_group(HostGroup::default()/* use setters */);
4983    /// ```
4984    pub fn set_host_group<T>(mut self, v: T) -> Self
4985    where
4986        T: std::convert::Into<crate::model::HostGroup>,
4987    {
4988        self.host_group = std::option::Option::Some(v.into());
4989        self
4990    }
4991
4992    /// Sets or clears the value of [host_group][crate::model::CreateHostGroupRequest::host_group].
4993    ///
4994    /// # Example
4995    /// ```ignore,no_run
4996    /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
4997    /// use google_cloud_netapp_v1::model::HostGroup;
4998    /// let x = CreateHostGroupRequest::new().set_or_clear_host_group(Some(HostGroup::default()/* use setters */));
4999    /// let x = CreateHostGroupRequest::new().set_or_clear_host_group(None::<HostGroup>);
5000    /// ```
5001    pub fn set_or_clear_host_group<T>(mut self, v: std::option::Option<T>) -> Self
5002    where
5003        T: std::convert::Into<crate::model::HostGroup>,
5004    {
5005        self.host_group = v.map(|x| x.into());
5006        self
5007    }
5008
5009    /// Sets the value of [host_group_id][crate::model::CreateHostGroupRequest::host_group_id].
5010    ///
5011    /// # Example
5012    /// ```ignore,no_run
5013    /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
5014    /// let x = CreateHostGroupRequest::new().set_host_group_id("example");
5015    /// ```
5016    pub fn set_host_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5017        self.host_group_id = v.into();
5018        self
5019    }
5020}
5021
5022impl wkt::message::Message for CreateHostGroupRequest {
5023    fn typename() -> &'static str {
5024        "type.googleapis.com/google.cloud.netapp.v1.CreateHostGroupRequest"
5025    }
5026}
5027
5028/// UpdateHostGroupRequest for updating a host group.
5029#[derive(Clone, Default, PartialEq)]
5030#[non_exhaustive]
5031pub struct UpdateHostGroupRequest {
5032    /// Required. The host group to update.
5033    /// The host group's `name` field is used to identify the host group.
5034    /// Format:
5035    /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5036    pub host_group: std::option::Option<crate::model::HostGroup>,
5037
5038    /// Optional. The list of fields to update.
5039    pub update_mask: std::option::Option<wkt::FieldMask>,
5040
5041    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5042}
5043
5044impl UpdateHostGroupRequest {
5045    pub fn new() -> Self {
5046        std::default::Default::default()
5047    }
5048
5049    /// Sets the value of [host_group][crate::model::UpdateHostGroupRequest::host_group].
5050    ///
5051    /// # Example
5052    /// ```ignore,no_run
5053    /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5054    /// use google_cloud_netapp_v1::model::HostGroup;
5055    /// let x = UpdateHostGroupRequest::new().set_host_group(HostGroup::default()/* use setters */);
5056    /// ```
5057    pub fn set_host_group<T>(mut self, v: T) -> Self
5058    where
5059        T: std::convert::Into<crate::model::HostGroup>,
5060    {
5061        self.host_group = std::option::Option::Some(v.into());
5062        self
5063    }
5064
5065    /// Sets or clears the value of [host_group][crate::model::UpdateHostGroupRequest::host_group].
5066    ///
5067    /// # Example
5068    /// ```ignore,no_run
5069    /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5070    /// use google_cloud_netapp_v1::model::HostGroup;
5071    /// let x = UpdateHostGroupRequest::new().set_or_clear_host_group(Some(HostGroup::default()/* use setters */));
5072    /// let x = UpdateHostGroupRequest::new().set_or_clear_host_group(None::<HostGroup>);
5073    /// ```
5074    pub fn set_or_clear_host_group<T>(mut self, v: std::option::Option<T>) -> Self
5075    where
5076        T: std::convert::Into<crate::model::HostGroup>,
5077    {
5078        self.host_group = v.map(|x| x.into());
5079        self
5080    }
5081
5082    /// Sets the value of [update_mask][crate::model::UpdateHostGroupRequest::update_mask].
5083    ///
5084    /// # Example
5085    /// ```ignore,no_run
5086    /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5087    /// use wkt::FieldMask;
5088    /// let x = UpdateHostGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5089    /// ```
5090    pub fn set_update_mask<T>(mut self, v: T) -> Self
5091    where
5092        T: std::convert::Into<wkt::FieldMask>,
5093    {
5094        self.update_mask = std::option::Option::Some(v.into());
5095        self
5096    }
5097
5098    /// Sets or clears the value of [update_mask][crate::model::UpdateHostGroupRequest::update_mask].
5099    ///
5100    /// # Example
5101    /// ```ignore,no_run
5102    /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5103    /// use wkt::FieldMask;
5104    /// let x = UpdateHostGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5105    /// let x = UpdateHostGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5106    /// ```
5107    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5108    where
5109        T: std::convert::Into<wkt::FieldMask>,
5110    {
5111        self.update_mask = v.map(|x| x.into());
5112        self
5113    }
5114}
5115
5116impl wkt::message::Message for UpdateHostGroupRequest {
5117    fn typename() -> &'static str {
5118        "type.googleapis.com/google.cloud.netapp.v1.UpdateHostGroupRequest"
5119    }
5120}
5121
5122/// DeleteHostGroupRequest for deleting a single host group.
5123#[derive(Clone, Default, PartialEq)]
5124#[non_exhaustive]
5125pub struct DeleteHostGroupRequest {
5126    /// Required. The resource name of the host group.
5127    /// Format:
5128    /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5129    pub name: std::string::String,
5130
5131    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5132}
5133
5134impl DeleteHostGroupRequest {
5135    pub fn new() -> Self {
5136        std::default::Default::default()
5137    }
5138
5139    /// Sets the value of [name][crate::model::DeleteHostGroupRequest::name].
5140    ///
5141    /// # Example
5142    /// ```ignore,no_run
5143    /// # use google_cloud_netapp_v1::model::DeleteHostGroupRequest;
5144    /// let x = DeleteHostGroupRequest::new().set_name("example");
5145    /// ```
5146    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5147        self.name = v.into();
5148        self
5149    }
5150}
5151
5152impl wkt::message::Message for DeleteHostGroupRequest {
5153    fn typename() -> &'static str {
5154        "type.googleapis.com/google.cloud.netapp.v1.DeleteHostGroupRequest"
5155    }
5156}
5157
5158/// Host group is a collection of hosts that can be used for accessing a Block
5159/// Volume.
5160#[derive(Clone, Default, PartialEq)]
5161#[non_exhaustive]
5162pub struct HostGroup {
5163    /// Identifier. The resource name of the host group.
5164    /// Format:
5165    /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5166    pub name: std::string::String,
5167
5168    /// Required. Type of the host group.
5169    pub r#type: crate::model::host_group::Type,
5170
5171    /// Output only. State of the host group.
5172    pub state: crate::model::host_group::State,
5173
5174    /// Output only. Create time of the host group.
5175    pub create_time: std::option::Option<wkt::Timestamp>,
5176
5177    /// Required. The list of hosts associated with the host group.
5178    pub hosts: std::vec::Vec<std::string::String>,
5179
5180    /// Required. The OS type of the host group. It indicates the type of operating
5181    /// system used by all of the hosts in the HostGroup. All hosts in a HostGroup
5182    /// must be of the same OS type. This can be set only when creating a
5183    /// HostGroup.
5184    pub os_type: crate::model::OsType,
5185
5186    /// Optional. Description of the host group.
5187    pub description: std::string::String,
5188
5189    /// Optional. Labels of the host group.
5190    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5191
5192    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5193}
5194
5195impl HostGroup {
5196    pub fn new() -> Self {
5197        std::default::Default::default()
5198    }
5199
5200    /// Sets the value of [name][crate::model::HostGroup::name].
5201    ///
5202    /// # Example
5203    /// ```ignore,no_run
5204    /// # use google_cloud_netapp_v1::model::HostGroup;
5205    /// let x = HostGroup::new().set_name("example");
5206    /// ```
5207    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5208        self.name = v.into();
5209        self
5210    }
5211
5212    /// Sets the value of [r#type][crate::model::HostGroup::type].
5213    ///
5214    /// # Example
5215    /// ```ignore,no_run
5216    /// # use google_cloud_netapp_v1::model::HostGroup;
5217    /// use google_cloud_netapp_v1::model::host_group::Type;
5218    /// let x0 = HostGroup::new().set_type(Type::IscsiInitiator);
5219    /// ```
5220    pub fn set_type<T: std::convert::Into<crate::model::host_group::Type>>(mut self, v: T) -> Self {
5221        self.r#type = v.into();
5222        self
5223    }
5224
5225    /// Sets the value of [state][crate::model::HostGroup::state].
5226    ///
5227    /// # Example
5228    /// ```ignore,no_run
5229    /// # use google_cloud_netapp_v1::model::HostGroup;
5230    /// use google_cloud_netapp_v1::model::host_group::State;
5231    /// let x0 = HostGroup::new().set_state(State::Creating);
5232    /// let x1 = HostGroup::new().set_state(State::Ready);
5233    /// let x2 = HostGroup::new().set_state(State::Updating);
5234    /// ```
5235    pub fn set_state<T: std::convert::Into<crate::model::host_group::State>>(
5236        mut self,
5237        v: T,
5238    ) -> Self {
5239        self.state = v.into();
5240        self
5241    }
5242
5243    /// Sets the value of [create_time][crate::model::HostGroup::create_time].
5244    ///
5245    /// # Example
5246    /// ```ignore,no_run
5247    /// # use google_cloud_netapp_v1::model::HostGroup;
5248    /// use wkt::Timestamp;
5249    /// let x = HostGroup::new().set_create_time(Timestamp::default()/* use setters */);
5250    /// ```
5251    pub fn set_create_time<T>(mut self, v: T) -> Self
5252    where
5253        T: std::convert::Into<wkt::Timestamp>,
5254    {
5255        self.create_time = std::option::Option::Some(v.into());
5256        self
5257    }
5258
5259    /// Sets or clears the value of [create_time][crate::model::HostGroup::create_time].
5260    ///
5261    /// # Example
5262    /// ```ignore,no_run
5263    /// # use google_cloud_netapp_v1::model::HostGroup;
5264    /// use wkt::Timestamp;
5265    /// let x = HostGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5266    /// let x = HostGroup::new().set_or_clear_create_time(None::<Timestamp>);
5267    /// ```
5268    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5269    where
5270        T: std::convert::Into<wkt::Timestamp>,
5271    {
5272        self.create_time = v.map(|x| x.into());
5273        self
5274    }
5275
5276    /// Sets the value of [hosts][crate::model::HostGroup::hosts].
5277    ///
5278    /// # Example
5279    /// ```ignore,no_run
5280    /// # use google_cloud_netapp_v1::model::HostGroup;
5281    /// let x = HostGroup::new().set_hosts(["a", "b", "c"]);
5282    /// ```
5283    pub fn set_hosts<T, V>(mut self, v: T) -> Self
5284    where
5285        T: std::iter::IntoIterator<Item = V>,
5286        V: std::convert::Into<std::string::String>,
5287    {
5288        use std::iter::Iterator;
5289        self.hosts = v.into_iter().map(|i| i.into()).collect();
5290        self
5291    }
5292
5293    /// Sets the value of [os_type][crate::model::HostGroup::os_type].
5294    ///
5295    /// # Example
5296    /// ```ignore,no_run
5297    /// # use google_cloud_netapp_v1::model::HostGroup;
5298    /// use google_cloud_netapp_v1::model::OsType;
5299    /// let x0 = HostGroup::new().set_os_type(OsType::Linux);
5300    /// let x1 = HostGroup::new().set_os_type(OsType::Windows);
5301    /// let x2 = HostGroup::new().set_os_type(OsType::Esxi);
5302    /// ```
5303    pub fn set_os_type<T: std::convert::Into<crate::model::OsType>>(mut self, v: T) -> Self {
5304        self.os_type = v.into();
5305        self
5306    }
5307
5308    /// Sets the value of [description][crate::model::HostGroup::description].
5309    ///
5310    /// # Example
5311    /// ```ignore,no_run
5312    /// # use google_cloud_netapp_v1::model::HostGroup;
5313    /// let x = HostGroup::new().set_description("example");
5314    /// ```
5315    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5316        self.description = v.into();
5317        self
5318    }
5319
5320    /// Sets the value of [labels][crate::model::HostGroup::labels].
5321    ///
5322    /// # Example
5323    /// ```ignore,no_run
5324    /// # use google_cloud_netapp_v1::model::HostGroup;
5325    /// let x = HostGroup::new().set_labels([
5326    ///     ("key0", "abc"),
5327    ///     ("key1", "xyz"),
5328    /// ]);
5329    /// ```
5330    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5331    where
5332        T: std::iter::IntoIterator<Item = (K, V)>,
5333        K: std::convert::Into<std::string::String>,
5334        V: std::convert::Into<std::string::String>,
5335    {
5336        use std::iter::Iterator;
5337        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5338        self
5339    }
5340}
5341
5342impl wkt::message::Message for HostGroup {
5343    fn typename() -> &'static str {
5344        "type.googleapis.com/google.cloud.netapp.v1.HostGroup"
5345    }
5346}
5347
5348/// Defines additional types related to [HostGroup].
5349pub mod host_group {
5350    #[allow(unused_imports)]
5351    use super::*;
5352
5353    /// Types of host group.
5354    ///
5355    /// # Working with unknown values
5356    ///
5357    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5358    /// additional enum variants at any time. Adding new variants is not considered
5359    /// a breaking change. Applications should write their code in anticipation of:
5360    ///
5361    /// - New values appearing in future releases of the client library, **and**
5362    /// - New values received dynamically, without application changes.
5363    ///
5364    /// Please consult the [Working with enums] section in the user guide for some
5365    /// guidelines.
5366    ///
5367    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5368    #[derive(Clone, Debug, PartialEq)]
5369    #[non_exhaustive]
5370    pub enum Type {
5371        /// Unspecified type for host group.
5372        Unspecified,
5373        /// iSCSI initiator host group.
5374        IscsiInitiator,
5375        /// If set, the enum was initialized with an unknown value.
5376        ///
5377        /// Applications can examine the value using [Type::value] or
5378        /// [Type::name].
5379        UnknownValue(r#type::UnknownValue),
5380    }
5381
5382    #[doc(hidden)]
5383    pub mod r#type {
5384        #[allow(unused_imports)]
5385        use super::*;
5386        #[derive(Clone, Debug, PartialEq)]
5387        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5388    }
5389
5390    impl Type {
5391        /// Gets the enum value.
5392        ///
5393        /// Returns `None` if the enum contains an unknown value deserialized from
5394        /// the string representation of enums.
5395        pub fn value(&self) -> std::option::Option<i32> {
5396            match self {
5397                Self::Unspecified => std::option::Option::Some(0),
5398                Self::IscsiInitiator => std::option::Option::Some(1),
5399                Self::UnknownValue(u) => u.0.value(),
5400            }
5401        }
5402
5403        /// Gets the enum value as a string.
5404        ///
5405        /// Returns `None` if the enum contains an unknown value deserialized from
5406        /// the integer representation of enums.
5407        pub fn name(&self) -> std::option::Option<&str> {
5408            match self {
5409                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
5410                Self::IscsiInitiator => std::option::Option::Some("ISCSI_INITIATOR"),
5411                Self::UnknownValue(u) => u.0.name(),
5412            }
5413        }
5414    }
5415
5416    impl std::default::Default for Type {
5417        fn default() -> Self {
5418            use std::convert::From;
5419            Self::from(0)
5420        }
5421    }
5422
5423    impl std::fmt::Display for Type {
5424        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5425            wkt::internal::display_enum(f, self.name(), self.value())
5426        }
5427    }
5428
5429    impl std::convert::From<i32> for Type {
5430        fn from(value: i32) -> Self {
5431            match value {
5432                0 => Self::Unspecified,
5433                1 => Self::IscsiInitiator,
5434                _ => Self::UnknownValue(r#type::UnknownValue(
5435                    wkt::internal::UnknownEnumValue::Integer(value),
5436                )),
5437            }
5438        }
5439    }
5440
5441    impl std::convert::From<&str> for Type {
5442        fn from(value: &str) -> Self {
5443            use std::string::ToString;
5444            match value {
5445                "TYPE_UNSPECIFIED" => Self::Unspecified,
5446                "ISCSI_INITIATOR" => Self::IscsiInitiator,
5447                _ => Self::UnknownValue(r#type::UnknownValue(
5448                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5449                )),
5450            }
5451        }
5452    }
5453
5454    impl serde::ser::Serialize for Type {
5455        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5456        where
5457            S: serde::Serializer,
5458        {
5459            match self {
5460                Self::Unspecified => serializer.serialize_i32(0),
5461                Self::IscsiInitiator => serializer.serialize_i32(1),
5462                Self::UnknownValue(u) => u.0.serialize(serializer),
5463            }
5464        }
5465    }
5466
5467    impl<'de> serde::de::Deserialize<'de> for Type {
5468        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5469        where
5470            D: serde::Deserializer<'de>,
5471        {
5472            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
5473                ".google.cloud.netapp.v1.HostGroup.Type",
5474            ))
5475        }
5476    }
5477
5478    /// Host group states.
5479    ///
5480    /// # Working with unknown values
5481    ///
5482    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5483    /// additional enum variants at any time. Adding new variants is not considered
5484    /// a breaking change. Applications should write their code in anticipation of:
5485    ///
5486    /// - New values appearing in future releases of the client library, **and**
5487    /// - New values received dynamically, without application changes.
5488    ///
5489    /// Please consult the [Working with enums] section in the user guide for some
5490    /// guidelines.
5491    ///
5492    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5493    #[derive(Clone, Debug, PartialEq)]
5494    #[non_exhaustive]
5495    pub enum State {
5496        /// Unspecified state for host group.
5497        Unspecified,
5498        /// Host group is creating.
5499        Creating,
5500        /// Host group is ready.
5501        Ready,
5502        /// Host group is updating.
5503        Updating,
5504        /// Host group is deleting.
5505        Deleting,
5506        /// Host group is disabled.
5507        Disabled,
5508        /// If set, the enum was initialized with an unknown value.
5509        ///
5510        /// Applications can examine the value using [State::value] or
5511        /// [State::name].
5512        UnknownValue(state::UnknownValue),
5513    }
5514
5515    #[doc(hidden)]
5516    pub mod state {
5517        #[allow(unused_imports)]
5518        use super::*;
5519        #[derive(Clone, Debug, PartialEq)]
5520        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5521    }
5522
5523    impl State {
5524        /// Gets the enum value.
5525        ///
5526        /// Returns `None` if the enum contains an unknown value deserialized from
5527        /// the string representation of enums.
5528        pub fn value(&self) -> std::option::Option<i32> {
5529            match self {
5530                Self::Unspecified => std::option::Option::Some(0),
5531                Self::Creating => std::option::Option::Some(1),
5532                Self::Ready => std::option::Option::Some(2),
5533                Self::Updating => std::option::Option::Some(3),
5534                Self::Deleting => std::option::Option::Some(4),
5535                Self::Disabled => std::option::Option::Some(5),
5536                Self::UnknownValue(u) => u.0.value(),
5537            }
5538        }
5539
5540        /// Gets the enum value as a string.
5541        ///
5542        /// Returns `None` if the enum contains an unknown value deserialized from
5543        /// the integer representation of enums.
5544        pub fn name(&self) -> std::option::Option<&str> {
5545            match self {
5546                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5547                Self::Creating => std::option::Option::Some("CREATING"),
5548                Self::Ready => std::option::Option::Some("READY"),
5549                Self::Updating => std::option::Option::Some("UPDATING"),
5550                Self::Deleting => std::option::Option::Some("DELETING"),
5551                Self::Disabled => std::option::Option::Some("DISABLED"),
5552                Self::UnknownValue(u) => u.0.name(),
5553            }
5554        }
5555    }
5556
5557    impl std::default::Default for State {
5558        fn default() -> Self {
5559            use std::convert::From;
5560            Self::from(0)
5561        }
5562    }
5563
5564    impl std::fmt::Display for State {
5565        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5566            wkt::internal::display_enum(f, self.name(), self.value())
5567        }
5568    }
5569
5570    impl std::convert::From<i32> for State {
5571        fn from(value: i32) -> Self {
5572            match value {
5573                0 => Self::Unspecified,
5574                1 => Self::Creating,
5575                2 => Self::Ready,
5576                3 => Self::Updating,
5577                4 => Self::Deleting,
5578                5 => Self::Disabled,
5579                _ => Self::UnknownValue(state::UnknownValue(
5580                    wkt::internal::UnknownEnumValue::Integer(value),
5581                )),
5582            }
5583        }
5584    }
5585
5586    impl std::convert::From<&str> for State {
5587        fn from(value: &str) -> Self {
5588            use std::string::ToString;
5589            match value {
5590                "STATE_UNSPECIFIED" => Self::Unspecified,
5591                "CREATING" => Self::Creating,
5592                "READY" => Self::Ready,
5593                "UPDATING" => Self::Updating,
5594                "DELETING" => Self::Deleting,
5595                "DISABLED" => Self::Disabled,
5596                _ => Self::UnknownValue(state::UnknownValue(
5597                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5598                )),
5599            }
5600        }
5601    }
5602
5603    impl serde::ser::Serialize for State {
5604        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5605        where
5606            S: serde::Serializer,
5607        {
5608            match self {
5609                Self::Unspecified => serializer.serialize_i32(0),
5610                Self::Creating => serializer.serialize_i32(1),
5611                Self::Ready => serializer.serialize_i32(2),
5612                Self::Updating => serializer.serialize_i32(3),
5613                Self::Deleting => serializer.serialize_i32(4),
5614                Self::Disabled => serializer.serialize_i32(5),
5615                Self::UnknownValue(u) => u.0.serialize(serializer),
5616            }
5617        }
5618    }
5619
5620    impl<'de> serde::de::Deserialize<'de> for State {
5621        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5622        where
5623            D: serde::Deserializer<'de>,
5624        {
5625            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5626                ".google.cloud.netapp.v1.HostGroup.State",
5627            ))
5628        }
5629    }
5630}
5631
5632/// GetKmsConfigRequest gets a KMS Config.
5633#[derive(Clone, Default, PartialEq)]
5634#[non_exhaustive]
5635pub struct GetKmsConfigRequest {
5636    /// Required. Name of the KmsConfig
5637    pub name: std::string::String,
5638
5639    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5640}
5641
5642impl GetKmsConfigRequest {
5643    pub fn new() -> Self {
5644        std::default::Default::default()
5645    }
5646
5647    /// Sets the value of [name][crate::model::GetKmsConfigRequest::name].
5648    ///
5649    /// # Example
5650    /// ```ignore,no_run
5651    /// # use google_cloud_netapp_v1::model::GetKmsConfigRequest;
5652    /// let x = GetKmsConfigRequest::new().set_name("example");
5653    /// ```
5654    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5655        self.name = v.into();
5656        self
5657    }
5658}
5659
5660impl wkt::message::Message for GetKmsConfigRequest {
5661    fn typename() -> &'static str {
5662        "type.googleapis.com/google.cloud.netapp.v1.GetKmsConfigRequest"
5663    }
5664}
5665
5666/// ListKmsConfigsRequest lists KMS Configs.
5667#[derive(Clone, Default, PartialEq)]
5668#[non_exhaustive]
5669pub struct ListKmsConfigsRequest {
5670    /// Required. Parent value
5671    pub parent: std::string::String,
5672
5673    /// The maximum number of items to return.
5674    pub page_size: i32,
5675
5676    /// The next_page_token value to use if there are additional
5677    /// results to retrieve for this list request.
5678    pub page_token: std::string::String,
5679
5680    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
5681    pub order_by: std::string::String,
5682
5683    /// List filter.
5684    pub filter: std::string::String,
5685
5686    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5687}
5688
5689impl ListKmsConfigsRequest {
5690    pub fn new() -> Self {
5691        std::default::Default::default()
5692    }
5693
5694    /// Sets the value of [parent][crate::model::ListKmsConfigsRequest::parent].
5695    ///
5696    /// # Example
5697    /// ```ignore,no_run
5698    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5699    /// let x = ListKmsConfigsRequest::new().set_parent("example");
5700    /// ```
5701    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5702        self.parent = v.into();
5703        self
5704    }
5705
5706    /// Sets the value of [page_size][crate::model::ListKmsConfigsRequest::page_size].
5707    ///
5708    /// # Example
5709    /// ```ignore,no_run
5710    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5711    /// let x = ListKmsConfigsRequest::new().set_page_size(42);
5712    /// ```
5713    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5714        self.page_size = v.into();
5715        self
5716    }
5717
5718    /// Sets the value of [page_token][crate::model::ListKmsConfigsRequest::page_token].
5719    ///
5720    /// # Example
5721    /// ```ignore,no_run
5722    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5723    /// let x = ListKmsConfigsRequest::new().set_page_token("example");
5724    /// ```
5725    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5726        self.page_token = v.into();
5727        self
5728    }
5729
5730    /// Sets the value of [order_by][crate::model::ListKmsConfigsRequest::order_by].
5731    ///
5732    /// # Example
5733    /// ```ignore,no_run
5734    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5735    /// let x = ListKmsConfigsRequest::new().set_order_by("example");
5736    /// ```
5737    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5738        self.order_by = v.into();
5739        self
5740    }
5741
5742    /// Sets the value of [filter][crate::model::ListKmsConfigsRequest::filter].
5743    ///
5744    /// # Example
5745    /// ```ignore,no_run
5746    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5747    /// let x = ListKmsConfigsRequest::new().set_filter("example");
5748    /// ```
5749    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5750        self.filter = v.into();
5751        self
5752    }
5753}
5754
5755impl wkt::message::Message for ListKmsConfigsRequest {
5756    fn typename() -> &'static str {
5757        "type.googleapis.com/google.cloud.netapp.v1.ListKmsConfigsRequest"
5758    }
5759}
5760
5761/// ListKmsConfigsResponse is the response to a ListKmsConfigsRequest.
5762#[derive(Clone, Default, PartialEq)]
5763#[non_exhaustive]
5764pub struct ListKmsConfigsResponse {
5765    /// The list of KmsConfigs
5766    pub kms_configs: std::vec::Vec<crate::model::KmsConfig>,
5767
5768    /// A token identifying a page of results the server should return.
5769    pub next_page_token: std::string::String,
5770
5771    /// Locations that could not be reached.
5772    pub unreachable: std::vec::Vec<std::string::String>,
5773
5774    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5775}
5776
5777impl ListKmsConfigsResponse {
5778    pub fn new() -> Self {
5779        std::default::Default::default()
5780    }
5781
5782    /// Sets the value of [kms_configs][crate::model::ListKmsConfigsResponse::kms_configs].
5783    ///
5784    /// # Example
5785    /// ```ignore,no_run
5786    /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
5787    /// use google_cloud_netapp_v1::model::KmsConfig;
5788    /// let x = ListKmsConfigsResponse::new()
5789    ///     .set_kms_configs([
5790    ///         KmsConfig::default()/* use setters */,
5791    ///         KmsConfig::default()/* use (different) setters */,
5792    ///     ]);
5793    /// ```
5794    pub fn set_kms_configs<T, V>(mut self, v: T) -> Self
5795    where
5796        T: std::iter::IntoIterator<Item = V>,
5797        V: std::convert::Into<crate::model::KmsConfig>,
5798    {
5799        use std::iter::Iterator;
5800        self.kms_configs = v.into_iter().map(|i| i.into()).collect();
5801        self
5802    }
5803
5804    /// Sets the value of [next_page_token][crate::model::ListKmsConfigsResponse::next_page_token].
5805    ///
5806    /// # Example
5807    /// ```ignore,no_run
5808    /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
5809    /// let x = ListKmsConfigsResponse::new().set_next_page_token("example");
5810    /// ```
5811    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5812        self.next_page_token = v.into();
5813        self
5814    }
5815
5816    /// Sets the value of [unreachable][crate::model::ListKmsConfigsResponse::unreachable].
5817    ///
5818    /// # Example
5819    /// ```ignore,no_run
5820    /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
5821    /// let x = ListKmsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
5822    /// ```
5823    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5824    where
5825        T: std::iter::IntoIterator<Item = V>,
5826        V: std::convert::Into<std::string::String>,
5827    {
5828        use std::iter::Iterator;
5829        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5830        self
5831    }
5832}
5833
5834impl wkt::message::Message for ListKmsConfigsResponse {
5835    fn typename() -> &'static str {
5836        "type.googleapis.com/google.cloud.netapp.v1.ListKmsConfigsResponse"
5837    }
5838}
5839
5840#[doc(hidden)]
5841impl google_cloud_gax::paginator::internal::PageableResponse for ListKmsConfigsResponse {
5842    type PageItem = crate::model::KmsConfig;
5843
5844    fn items(self) -> std::vec::Vec<Self::PageItem> {
5845        self.kms_configs
5846    }
5847
5848    fn next_page_token(&self) -> std::string::String {
5849        use std::clone::Clone;
5850        self.next_page_token.clone()
5851    }
5852}
5853
5854/// CreateKmsConfigRequest creates a KMS Config.
5855#[derive(Clone, Default, PartialEq)]
5856#[non_exhaustive]
5857pub struct CreateKmsConfigRequest {
5858    /// Required. Value for parent.
5859    pub parent: std::string::String,
5860
5861    /// Required. Id of the requesting KmsConfig. Must be unique within the parent
5862    /// resource. Must contain only letters, numbers and hyphen, with the first
5863    /// character a letter, the last a letter or a
5864    /// number, and a 63 character maximum.
5865    pub kms_config_id: std::string::String,
5866
5867    /// Required. The required parameters to create a new KmsConfig.
5868    pub kms_config: std::option::Option<crate::model::KmsConfig>,
5869
5870    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5871}
5872
5873impl CreateKmsConfigRequest {
5874    pub fn new() -> Self {
5875        std::default::Default::default()
5876    }
5877
5878    /// Sets the value of [parent][crate::model::CreateKmsConfigRequest::parent].
5879    ///
5880    /// # Example
5881    /// ```ignore,no_run
5882    /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
5883    /// let x = CreateKmsConfigRequest::new().set_parent("example");
5884    /// ```
5885    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5886        self.parent = v.into();
5887        self
5888    }
5889
5890    /// Sets the value of [kms_config_id][crate::model::CreateKmsConfigRequest::kms_config_id].
5891    ///
5892    /// # Example
5893    /// ```ignore,no_run
5894    /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
5895    /// let x = CreateKmsConfigRequest::new().set_kms_config_id("example");
5896    /// ```
5897    pub fn set_kms_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5898        self.kms_config_id = v.into();
5899        self
5900    }
5901
5902    /// Sets the value of [kms_config][crate::model::CreateKmsConfigRequest::kms_config].
5903    ///
5904    /// # Example
5905    /// ```ignore,no_run
5906    /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
5907    /// use google_cloud_netapp_v1::model::KmsConfig;
5908    /// let x = CreateKmsConfigRequest::new().set_kms_config(KmsConfig::default()/* use setters */);
5909    /// ```
5910    pub fn set_kms_config<T>(mut self, v: T) -> Self
5911    where
5912        T: std::convert::Into<crate::model::KmsConfig>,
5913    {
5914        self.kms_config = std::option::Option::Some(v.into());
5915        self
5916    }
5917
5918    /// Sets or clears the value of [kms_config][crate::model::CreateKmsConfigRequest::kms_config].
5919    ///
5920    /// # Example
5921    /// ```ignore,no_run
5922    /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
5923    /// use google_cloud_netapp_v1::model::KmsConfig;
5924    /// let x = CreateKmsConfigRequest::new().set_or_clear_kms_config(Some(KmsConfig::default()/* use setters */));
5925    /// let x = CreateKmsConfigRequest::new().set_or_clear_kms_config(None::<KmsConfig>);
5926    /// ```
5927    pub fn set_or_clear_kms_config<T>(mut self, v: std::option::Option<T>) -> Self
5928    where
5929        T: std::convert::Into<crate::model::KmsConfig>,
5930    {
5931        self.kms_config = v.map(|x| x.into());
5932        self
5933    }
5934}
5935
5936impl wkt::message::Message for CreateKmsConfigRequest {
5937    fn typename() -> &'static str {
5938        "type.googleapis.com/google.cloud.netapp.v1.CreateKmsConfigRequest"
5939    }
5940}
5941
5942/// UpdateKmsConfigRequest updates a KMS Config.
5943#[derive(Clone, Default, PartialEq)]
5944#[non_exhaustive]
5945pub struct UpdateKmsConfigRequest {
5946    /// Required. Field mask is used to specify the fields to be overwritten in the
5947    /// KmsConfig resource by the update.
5948    /// The fields specified in the update_mask are relative to the resource, not
5949    /// the full request. A field will be overwritten if it is in the mask. If the
5950    /// user does not provide a mask then all fields will be overwritten.
5951    pub update_mask: std::option::Option<wkt::FieldMask>,
5952
5953    /// Required. The KmsConfig being updated
5954    pub kms_config: std::option::Option<crate::model::KmsConfig>,
5955
5956    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5957}
5958
5959impl UpdateKmsConfigRequest {
5960    pub fn new() -> Self {
5961        std::default::Default::default()
5962    }
5963
5964    /// Sets the value of [update_mask][crate::model::UpdateKmsConfigRequest::update_mask].
5965    ///
5966    /// # Example
5967    /// ```ignore,no_run
5968    /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
5969    /// use wkt::FieldMask;
5970    /// let x = UpdateKmsConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5971    /// ```
5972    pub fn set_update_mask<T>(mut self, v: T) -> Self
5973    where
5974        T: std::convert::Into<wkt::FieldMask>,
5975    {
5976        self.update_mask = std::option::Option::Some(v.into());
5977        self
5978    }
5979
5980    /// Sets or clears the value of [update_mask][crate::model::UpdateKmsConfigRequest::update_mask].
5981    ///
5982    /// # Example
5983    /// ```ignore,no_run
5984    /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
5985    /// use wkt::FieldMask;
5986    /// let x = UpdateKmsConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5987    /// let x = UpdateKmsConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5988    /// ```
5989    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5990    where
5991        T: std::convert::Into<wkt::FieldMask>,
5992    {
5993        self.update_mask = v.map(|x| x.into());
5994        self
5995    }
5996
5997    /// Sets the value of [kms_config][crate::model::UpdateKmsConfigRequest::kms_config].
5998    ///
5999    /// # Example
6000    /// ```ignore,no_run
6001    /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
6002    /// use google_cloud_netapp_v1::model::KmsConfig;
6003    /// let x = UpdateKmsConfigRequest::new().set_kms_config(KmsConfig::default()/* use setters */);
6004    /// ```
6005    pub fn set_kms_config<T>(mut self, v: T) -> Self
6006    where
6007        T: std::convert::Into<crate::model::KmsConfig>,
6008    {
6009        self.kms_config = std::option::Option::Some(v.into());
6010        self
6011    }
6012
6013    /// Sets or clears the value of [kms_config][crate::model::UpdateKmsConfigRequest::kms_config].
6014    ///
6015    /// # Example
6016    /// ```ignore,no_run
6017    /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
6018    /// use google_cloud_netapp_v1::model::KmsConfig;
6019    /// let x = UpdateKmsConfigRequest::new().set_or_clear_kms_config(Some(KmsConfig::default()/* use setters */));
6020    /// let x = UpdateKmsConfigRequest::new().set_or_clear_kms_config(None::<KmsConfig>);
6021    /// ```
6022    pub fn set_or_clear_kms_config<T>(mut self, v: std::option::Option<T>) -> Self
6023    where
6024        T: std::convert::Into<crate::model::KmsConfig>,
6025    {
6026        self.kms_config = v.map(|x| x.into());
6027        self
6028    }
6029}
6030
6031impl wkt::message::Message for UpdateKmsConfigRequest {
6032    fn typename() -> &'static str {
6033        "type.googleapis.com/google.cloud.netapp.v1.UpdateKmsConfigRequest"
6034    }
6035}
6036
6037/// DeleteKmsConfigRequest deletes a KMS Config.
6038#[derive(Clone, Default, PartialEq)]
6039#[non_exhaustive]
6040pub struct DeleteKmsConfigRequest {
6041    /// Required. Name of the KmsConfig.
6042    pub name: std::string::String,
6043
6044    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6045}
6046
6047impl DeleteKmsConfigRequest {
6048    pub fn new() -> Self {
6049        std::default::Default::default()
6050    }
6051
6052    /// Sets the value of [name][crate::model::DeleteKmsConfigRequest::name].
6053    ///
6054    /// # Example
6055    /// ```ignore,no_run
6056    /// # use google_cloud_netapp_v1::model::DeleteKmsConfigRequest;
6057    /// let x = DeleteKmsConfigRequest::new().set_name("example");
6058    /// ```
6059    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6060        self.name = v.into();
6061        self
6062    }
6063}
6064
6065impl wkt::message::Message for DeleteKmsConfigRequest {
6066    fn typename() -> &'static str {
6067        "type.googleapis.com/google.cloud.netapp.v1.DeleteKmsConfigRequest"
6068    }
6069}
6070
6071/// EncryptVolumesRequest specifies the KMS config to encrypt existing volumes.
6072#[derive(Clone, Default, PartialEq)]
6073#[non_exhaustive]
6074pub struct EncryptVolumesRequest {
6075    /// Required. Name of the KmsConfig.
6076    pub name: std::string::String,
6077
6078    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6079}
6080
6081impl EncryptVolumesRequest {
6082    pub fn new() -> Self {
6083        std::default::Default::default()
6084    }
6085
6086    /// Sets the value of [name][crate::model::EncryptVolumesRequest::name].
6087    ///
6088    /// # Example
6089    /// ```ignore,no_run
6090    /// # use google_cloud_netapp_v1::model::EncryptVolumesRequest;
6091    /// let x = EncryptVolumesRequest::new().set_name("example");
6092    /// ```
6093    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6094        self.name = v.into();
6095        self
6096    }
6097}
6098
6099impl wkt::message::Message for EncryptVolumesRequest {
6100    fn typename() -> &'static str {
6101        "type.googleapis.com/google.cloud.netapp.v1.EncryptVolumesRequest"
6102    }
6103}
6104
6105/// VerifyKmsConfigRequest specifies the KMS config to be validated.
6106#[derive(Clone, Default, PartialEq)]
6107#[non_exhaustive]
6108pub struct VerifyKmsConfigRequest {
6109    /// Required. Name of the KMS Config to be verified.
6110    pub name: std::string::String,
6111
6112    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6113}
6114
6115impl VerifyKmsConfigRequest {
6116    pub fn new() -> Self {
6117        std::default::Default::default()
6118    }
6119
6120    /// Sets the value of [name][crate::model::VerifyKmsConfigRequest::name].
6121    ///
6122    /// # Example
6123    /// ```ignore,no_run
6124    /// # use google_cloud_netapp_v1::model::VerifyKmsConfigRequest;
6125    /// let x = VerifyKmsConfigRequest::new().set_name("example");
6126    /// ```
6127    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6128        self.name = v.into();
6129        self
6130    }
6131}
6132
6133impl wkt::message::Message for VerifyKmsConfigRequest {
6134    fn typename() -> &'static str {
6135        "type.googleapis.com/google.cloud.netapp.v1.VerifyKmsConfigRequest"
6136    }
6137}
6138
6139/// VerifyKmsConfigResponse contains the information if the config is correctly
6140/// and error message.
6141#[derive(Clone, Default, PartialEq)]
6142#[non_exhaustive]
6143pub struct VerifyKmsConfigResponse {
6144    /// Output only. If the customer key configured correctly to the encrypt
6145    /// volume.
6146    pub healthy: bool,
6147
6148    /// Output only. Error message if config is not healthy.
6149    pub health_error: std::string::String,
6150
6151    /// Output only. Instructions for the customers to provide the access to the
6152    /// encryption key.
6153    pub instructions: std::string::String,
6154
6155    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6156}
6157
6158impl VerifyKmsConfigResponse {
6159    pub fn new() -> Self {
6160        std::default::Default::default()
6161    }
6162
6163    /// Sets the value of [healthy][crate::model::VerifyKmsConfigResponse::healthy].
6164    ///
6165    /// # Example
6166    /// ```ignore,no_run
6167    /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
6168    /// let x = VerifyKmsConfigResponse::new().set_healthy(true);
6169    /// ```
6170    pub fn set_healthy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6171        self.healthy = v.into();
6172        self
6173    }
6174
6175    /// Sets the value of [health_error][crate::model::VerifyKmsConfigResponse::health_error].
6176    ///
6177    /// # Example
6178    /// ```ignore,no_run
6179    /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
6180    /// let x = VerifyKmsConfigResponse::new().set_health_error("example");
6181    /// ```
6182    pub fn set_health_error<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6183        self.health_error = v.into();
6184        self
6185    }
6186
6187    /// Sets the value of [instructions][crate::model::VerifyKmsConfigResponse::instructions].
6188    ///
6189    /// # Example
6190    /// ```ignore,no_run
6191    /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
6192    /// let x = VerifyKmsConfigResponse::new().set_instructions("example");
6193    /// ```
6194    pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6195        self.instructions = v.into();
6196        self
6197    }
6198}
6199
6200impl wkt::message::Message for VerifyKmsConfigResponse {
6201    fn typename() -> &'static str {
6202        "type.googleapis.com/google.cloud.netapp.v1.VerifyKmsConfigResponse"
6203    }
6204}
6205
6206/// KmsConfig is the customer-managed encryption key(CMEK) configuration.
6207#[derive(Clone, Default, PartialEq)]
6208#[non_exhaustive]
6209pub struct KmsConfig {
6210    /// Identifier. Name of the KmsConfig.
6211    /// Format: `projects/{project}/locations/{location}/kmsConfigs/{kms_config}`
6212    pub name: std::string::String,
6213
6214    /// Required. Customer-managed crypto key resource full name. Format:
6215    /// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`
6216    pub crypto_key_name: std::string::String,
6217
6218    /// Output only. State of the KmsConfig.
6219    pub state: crate::model::kms_config::State,
6220
6221    /// Output only. State details of the KmsConfig.
6222    pub state_details: std::string::String,
6223
6224    /// Output only. Create time of the KmsConfig.
6225    pub create_time: std::option::Option<wkt::Timestamp>,
6226
6227    /// Description of the KmsConfig.
6228    pub description: std::string::String,
6229
6230    /// Labels as key value pairs
6231    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6232
6233    /// Output only. Instructions to provide the access to the customer provided
6234    /// encryption key.
6235    pub instructions: std::string::String,
6236
6237    /// Output only. The Service account which will have access to the customer
6238    /// provided encryption key.
6239    pub service_account: std::string::String,
6240
6241    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6242}
6243
6244impl KmsConfig {
6245    pub fn new() -> Self {
6246        std::default::Default::default()
6247    }
6248
6249    /// Sets the value of [name][crate::model::KmsConfig::name].
6250    ///
6251    /// # Example
6252    /// ```ignore,no_run
6253    /// # use google_cloud_netapp_v1::model::KmsConfig;
6254    /// let x = KmsConfig::new().set_name("example");
6255    /// ```
6256    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6257        self.name = v.into();
6258        self
6259    }
6260
6261    /// Sets the value of [crypto_key_name][crate::model::KmsConfig::crypto_key_name].
6262    ///
6263    /// # Example
6264    /// ```ignore,no_run
6265    /// # use google_cloud_netapp_v1::model::KmsConfig;
6266    /// let x = KmsConfig::new().set_crypto_key_name("example");
6267    /// ```
6268    pub fn set_crypto_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6269        self.crypto_key_name = v.into();
6270        self
6271    }
6272
6273    /// Sets the value of [state][crate::model::KmsConfig::state].
6274    ///
6275    /// # Example
6276    /// ```ignore,no_run
6277    /// # use google_cloud_netapp_v1::model::KmsConfig;
6278    /// use google_cloud_netapp_v1::model::kms_config::State;
6279    /// let x0 = KmsConfig::new().set_state(State::Ready);
6280    /// let x1 = KmsConfig::new().set_state(State::Creating);
6281    /// let x2 = KmsConfig::new().set_state(State::Deleting);
6282    /// ```
6283    pub fn set_state<T: std::convert::Into<crate::model::kms_config::State>>(
6284        mut self,
6285        v: T,
6286    ) -> Self {
6287        self.state = v.into();
6288        self
6289    }
6290
6291    /// Sets the value of [state_details][crate::model::KmsConfig::state_details].
6292    ///
6293    /// # Example
6294    /// ```ignore,no_run
6295    /// # use google_cloud_netapp_v1::model::KmsConfig;
6296    /// let x = KmsConfig::new().set_state_details("example");
6297    /// ```
6298    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6299        self.state_details = v.into();
6300        self
6301    }
6302
6303    /// Sets the value of [create_time][crate::model::KmsConfig::create_time].
6304    ///
6305    /// # Example
6306    /// ```ignore,no_run
6307    /// # use google_cloud_netapp_v1::model::KmsConfig;
6308    /// use wkt::Timestamp;
6309    /// let x = KmsConfig::new().set_create_time(Timestamp::default()/* use setters */);
6310    /// ```
6311    pub fn set_create_time<T>(mut self, v: T) -> Self
6312    where
6313        T: std::convert::Into<wkt::Timestamp>,
6314    {
6315        self.create_time = std::option::Option::Some(v.into());
6316        self
6317    }
6318
6319    /// Sets or clears the value of [create_time][crate::model::KmsConfig::create_time].
6320    ///
6321    /// # Example
6322    /// ```ignore,no_run
6323    /// # use google_cloud_netapp_v1::model::KmsConfig;
6324    /// use wkt::Timestamp;
6325    /// let x = KmsConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6326    /// let x = KmsConfig::new().set_or_clear_create_time(None::<Timestamp>);
6327    /// ```
6328    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6329    where
6330        T: std::convert::Into<wkt::Timestamp>,
6331    {
6332        self.create_time = v.map(|x| x.into());
6333        self
6334    }
6335
6336    /// Sets the value of [description][crate::model::KmsConfig::description].
6337    ///
6338    /// # Example
6339    /// ```ignore,no_run
6340    /// # use google_cloud_netapp_v1::model::KmsConfig;
6341    /// let x = KmsConfig::new().set_description("example");
6342    /// ```
6343    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6344        self.description = v.into();
6345        self
6346    }
6347
6348    /// Sets the value of [labels][crate::model::KmsConfig::labels].
6349    ///
6350    /// # Example
6351    /// ```ignore,no_run
6352    /// # use google_cloud_netapp_v1::model::KmsConfig;
6353    /// let x = KmsConfig::new().set_labels([
6354    ///     ("key0", "abc"),
6355    ///     ("key1", "xyz"),
6356    /// ]);
6357    /// ```
6358    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6359    where
6360        T: std::iter::IntoIterator<Item = (K, V)>,
6361        K: std::convert::Into<std::string::String>,
6362        V: std::convert::Into<std::string::String>,
6363    {
6364        use std::iter::Iterator;
6365        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6366        self
6367    }
6368
6369    /// Sets the value of [instructions][crate::model::KmsConfig::instructions].
6370    ///
6371    /// # Example
6372    /// ```ignore,no_run
6373    /// # use google_cloud_netapp_v1::model::KmsConfig;
6374    /// let x = KmsConfig::new().set_instructions("example");
6375    /// ```
6376    pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6377        self.instructions = v.into();
6378        self
6379    }
6380
6381    /// Sets the value of [service_account][crate::model::KmsConfig::service_account].
6382    ///
6383    /// # Example
6384    /// ```ignore,no_run
6385    /// # use google_cloud_netapp_v1::model::KmsConfig;
6386    /// let x = KmsConfig::new().set_service_account("example");
6387    /// ```
6388    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6389        self.service_account = v.into();
6390        self
6391    }
6392}
6393
6394impl wkt::message::Message for KmsConfig {
6395    fn typename() -> &'static str {
6396        "type.googleapis.com/google.cloud.netapp.v1.KmsConfig"
6397    }
6398}
6399
6400/// Defines additional types related to [KmsConfig].
6401pub mod kms_config {
6402    #[allow(unused_imports)]
6403    use super::*;
6404
6405    /// The KmsConfig States
6406    ///
6407    /// # Working with unknown values
6408    ///
6409    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6410    /// additional enum variants at any time. Adding new variants is not considered
6411    /// a breaking change. Applications should write their code in anticipation of:
6412    ///
6413    /// - New values appearing in future releases of the client library, **and**
6414    /// - New values received dynamically, without application changes.
6415    ///
6416    /// Please consult the [Working with enums] section in the user guide for some
6417    /// guidelines.
6418    ///
6419    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6420    #[derive(Clone, Debug, PartialEq)]
6421    #[non_exhaustive]
6422    pub enum State {
6423        /// Unspecified KmsConfig State
6424        Unspecified,
6425        /// KmsConfig State is Ready
6426        Ready,
6427        /// KmsConfig State is Creating
6428        Creating,
6429        /// KmsConfig State is Deleting
6430        Deleting,
6431        /// KmsConfig State is Updating
6432        Updating,
6433        /// KmsConfig State is In Use.
6434        InUse,
6435        /// KmsConfig State is Error
6436        Error,
6437        /// KmsConfig State is Pending to verify crypto key access.
6438        KeyCheckPending,
6439        /// KmsConfig State is Not accessbile by the SDE service account to the
6440        /// crypto key.
6441        KeyNotReachable,
6442        /// KmsConfig State is Disabling.
6443        Disabling,
6444        /// KmsConfig State is Disabled.
6445        Disabled,
6446        /// KmsConfig State is Migrating.
6447        /// The existing volumes are migrating from SMEK to CMEK.
6448        Migrating,
6449        /// If set, the enum was initialized with an unknown value.
6450        ///
6451        /// Applications can examine the value using [State::value] or
6452        /// [State::name].
6453        UnknownValue(state::UnknownValue),
6454    }
6455
6456    #[doc(hidden)]
6457    pub mod state {
6458        #[allow(unused_imports)]
6459        use super::*;
6460        #[derive(Clone, Debug, PartialEq)]
6461        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6462    }
6463
6464    impl State {
6465        /// Gets the enum value.
6466        ///
6467        /// Returns `None` if the enum contains an unknown value deserialized from
6468        /// the string representation of enums.
6469        pub fn value(&self) -> std::option::Option<i32> {
6470            match self {
6471                Self::Unspecified => std::option::Option::Some(0),
6472                Self::Ready => std::option::Option::Some(1),
6473                Self::Creating => std::option::Option::Some(2),
6474                Self::Deleting => std::option::Option::Some(3),
6475                Self::Updating => std::option::Option::Some(4),
6476                Self::InUse => std::option::Option::Some(5),
6477                Self::Error => std::option::Option::Some(6),
6478                Self::KeyCheckPending => std::option::Option::Some(7),
6479                Self::KeyNotReachable => std::option::Option::Some(8),
6480                Self::Disabling => std::option::Option::Some(9),
6481                Self::Disabled => std::option::Option::Some(10),
6482                Self::Migrating => std::option::Option::Some(11),
6483                Self::UnknownValue(u) => u.0.value(),
6484            }
6485        }
6486
6487        /// Gets the enum value as a string.
6488        ///
6489        /// Returns `None` if the enum contains an unknown value deserialized from
6490        /// the integer representation of enums.
6491        pub fn name(&self) -> std::option::Option<&str> {
6492            match self {
6493                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6494                Self::Ready => std::option::Option::Some("READY"),
6495                Self::Creating => std::option::Option::Some("CREATING"),
6496                Self::Deleting => std::option::Option::Some("DELETING"),
6497                Self::Updating => std::option::Option::Some("UPDATING"),
6498                Self::InUse => std::option::Option::Some("IN_USE"),
6499                Self::Error => std::option::Option::Some("ERROR"),
6500                Self::KeyCheckPending => std::option::Option::Some("KEY_CHECK_PENDING"),
6501                Self::KeyNotReachable => std::option::Option::Some("KEY_NOT_REACHABLE"),
6502                Self::Disabling => std::option::Option::Some("DISABLING"),
6503                Self::Disabled => std::option::Option::Some("DISABLED"),
6504                Self::Migrating => std::option::Option::Some("MIGRATING"),
6505                Self::UnknownValue(u) => u.0.name(),
6506            }
6507        }
6508    }
6509
6510    impl std::default::Default for State {
6511        fn default() -> Self {
6512            use std::convert::From;
6513            Self::from(0)
6514        }
6515    }
6516
6517    impl std::fmt::Display for State {
6518        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6519            wkt::internal::display_enum(f, self.name(), self.value())
6520        }
6521    }
6522
6523    impl std::convert::From<i32> for State {
6524        fn from(value: i32) -> Self {
6525            match value {
6526                0 => Self::Unspecified,
6527                1 => Self::Ready,
6528                2 => Self::Creating,
6529                3 => Self::Deleting,
6530                4 => Self::Updating,
6531                5 => Self::InUse,
6532                6 => Self::Error,
6533                7 => Self::KeyCheckPending,
6534                8 => Self::KeyNotReachable,
6535                9 => Self::Disabling,
6536                10 => Self::Disabled,
6537                11 => Self::Migrating,
6538                _ => Self::UnknownValue(state::UnknownValue(
6539                    wkt::internal::UnknownEnumValue::Integer(value),
6540                )),
6541            }
6542        }
6543    }
6544
6545    impl std::convert::From<&str> for State {
6546        fn from(value: &str) -> Self {
6547            use std::string::ToString;
6548            match value {
6549                "STATE_UNSPECIFIED" => Self::Unspecified,
6550                "READY" => Self::Ready,
6551                "CREATING" => Self::Creating,
6552                "DELETING" => Self::Deleting,
6553                "UPDATING" => Self::Updating,
6554                "IN_USE" => Self::InUse,
6555                "ERROR" => Self::Error,
6556                "KEY_CHECK_PENDING" => Self::KeyCheckPending,
6557                "KEY_NOT_REACHABLE" => Self::KeyNotReachable,
6558                "DISABLING" => Self::Disabling,
6559                "DISABLED" => Self::Disabled,
6560                "MIGRATING" => Self::Migrating,
6561                _ => Self::UnknownValue(state::UnknownValue(
6562                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6563                )),
6564            }
6565        }
6566    }
6567
6568    impl serde::ser::Serialize for State {
6569        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6570        where
6571            S: serde::Serializer,
6572        {
6573            match self {
6574                Self::Unspecified => serializer.serialize_i32(0),
6575                Self::Ready => serializer.serialize_i32(1),
6576                Self::Creating => serializer.serialize_i32(2),
6577                Self::Deleting => serializer.serialize_i32(3),
6578                Self::Updating => serializer.serialize_i32(4),
6579                Self::InUse => serializer.serialize_i32(5),
6580                Self::Error => serializer.serialize_i32(6),
6581                Self::KeyCheckPending => serializer.serialize_i32(7),
6582                Self::KeyNotReachable => serializer.serialize_i32(8),
6583                Self::Disabling => serializer.serialize_i32(9),
6584                Self::Disabled => serializer.serialize_i32(10),
6585                Self::Migrating => serializer.serialize_i32(11),
6586                Self::UnknownValue(u) => u.0.serialize(serializer),
6587            }
6588        }
6589    }
6590
6591    impl<'de> serde::de::Deserialize<'de> for State {
6592        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6593        where
6594            D: serde::Deserializer<'de>,
6595        {
6596            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6597                ".google.cloud.netapp.v1.KmsConfig.State",
6598            ))
6599        }
6600    }
6601}
6602
6603/// ListQuotaRulesRequest for listing quota rules.
6604#[derive(Clone, Default, PartialEq)]
6605#[non_exhaustive]
6606pub struct ListQuotaRulesRequest {
6607    /// Required. Parent value for ListQuotaRulesRequest
6608    pub parent: std::string::String,
6609
6610    /// Optional. Requested page size. Server may return fewer items than
6611    /// requested. If unspecified, the server will pick an appropriate default.
6612    pub page_size: i32,
6613
6614    /// Optional. A token identifying a page of results the server should return.
6615    pub page_token: std::string::String,
6616
6617    /// Optional. Filtering results
6618    pub filter: std::string::String,
6619
6620    /// Optional. Hint for how to order the results
6621    pub order_by: std::string::String,
6622
6623    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6624}
6625
6626impl ListQuotaRulesRequest {
6627    pub fn new() -> Self {
6628        std::default::Default::default()
6629    }
6630
6631    /// Sets the value of [parent][crate::model::ListQuotaRulesRequest::parent].
6632    ///
6633    /// # Example
6634    /// ```ignore,no_run
6635    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
6636    /// let x = ListQuotaRulesRequest::new().set_parent("example");
6637    /// ```
6638    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6639        self.parent = v.into();
6640        self
6641    }
6642
6643    /// Sets the value of [page_size][crate::model::ListQuotaRulesRequest::page_size].
6644    ///
6645    /// # Example
6646    /// ```ignore,no_run
6647    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
6648    /// let x = ListQuotaRulesRequest::new().set_page_size(42);
6649    /// ```
6650    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6651        self.page_size = v.into();
6652        self
6653    }
6654
6655    /// Sets the value of [page_token][crate::model::ListQuotaRulesRequest::page_token].
6656    ///
6657    /// # Example
6658    /// ```ignore,no_run
6659    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
6660    /// let x = ListQuotaRulesRequest::new().set_page_token("example");
6661    /// ```
6662    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6663        self.page_token = v.into();
6664        self
6665    }
6666
6667    /// Sets the value of [filter][crate::model::ListQuotaRulesRequest::filter].
6668    ///
6669    /// # Example
6670    /// ```ignore,no_run
6671    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
6672    /// let x = ListQuotaRulesRequest::new().set_filter("example");
6673    /// ```
6674    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6675        self.filter = v.into();
6676        self
6677    }
6678
6679    /// Sets the value of [order_by][crate::model::ListQuotaRulesRequest::order_by].
6680    ///
6681    /// # Example
6682    /// ```ignore,no_run
6683    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
6684    /// let x = ListQuotaRulesRequest::new().set_order_by("example");
6685    /// ```
6686    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6687        self.order_by = v.into();
6688        self
6689    }
6690}
6691
6692impl wkt::message::Message for ListQuotaRulesRequest {
6693    fn typename() -> &'static str {
6694        "type.googleapis.com/google.cloud.netapp.v1.ListQuotaRulesRequest"
6695    }
6696}
6697
6698/// ListQuotaRulesResponse is the response to a ListQuotaRulesRequest.
6699#[derive(Clone, Default, PartialEq)]
6700#[non_exhaustive]
6701pub struct ListQuotaRulesResponse {
6702    /// List of quota rules
6703    pub quota_rules: std::vec::Vec<crate::model::QuotaRule>,
6704
6705    /// A token identifying a page of results the server should return.
6706    pub next_page_token: std::string::String,
6707
6708    /// Locations that could not be reached.
6709    pub unreachable: std::vec::Vec<std::string::String>,
6710
6711    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6712}
6713
6714impl ListQuotaRulesResponse {
6715    pub fn new() -> Self {
6716        std::default::Default::default()
6717    }
6718
6719    /// Sets the value of [quota_rules][crate::model::ListQuotaRulesResponse::quota_rules].
6720    ///
6721    /// # Example
6722    /// ```ignore,no_run
6723    /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
6724    /// use google_cloud_netapp_v1::model::QuotaRule;
6725    /// let x = ListQuotaRulesResponse::new()
6726    ///     .set_quota_rules([
6727    ///         QuotaRule::default()/* use setters */,
6728    ///         QuotaRule::default()/* use (different) setters */,
6729    ///     ]);
6730    /// ```
6731    pub fn set_quota_rules<T, V>(mut self, v: T) -> Self
6732    where
6733        T: std::iter::IntoIterator<Item = V>,
6734        V: std::convert::Into<crate::model::QuotaRule>,
6735    {
6736        use std::iter::Iterator;
6737        self.quota_rules = v.into_iter().map(|i| i.into()).collect();
6738        self
6739    }
6740
6741    /// Sets the value of [next_page_token][crate::model::ListQuotaRulesResponse::next_page_token].
6742    ///
6743    /// # Example
6744    /// ```ignore,no_run
6745    /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
6746    /// let x = ListQuotaRulesResponse::new().set_next_page_token("example");
6747    /// ```
6748    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6749        self.next_page_token = v.into();
6750        self
6751    }
6752
6753    /// Sets the value of [unreachable][crate::model::ListQuotaRulesResponse::unreachable].
6754    ///
6755    /// # Example
6756    /// ```ignore,no_run
6757    /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
6758    /// let x = ListQuotaRulesResponse::new().set_unreachable(["a", "b", "c"]);
6759    /// ```
6760    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6761    where
6762        T: std::iter::IntoIterator<Item = V>,
6763        V: std::convert::Into<std::string::String>,
6764    {
6765        use std::iter::Iterator;
6766        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6767        self
6768    }
6769}
6770
6771impl wkt::message::Message for ListQuotaRulesResponse {
6772    fn typename() -> &'static str {
6773        "type.googleapis.com/google.cloud.netapp.v1.ListQuotaRulesResponse"
6774    }
6775}
6776
6777#[doc(hidden)]
6778impl google_cloud_gax::paginator::internal::PageableResponse for ListQuotaRulesResponse {
6779    type PageItem = crate::model::QuotaRule;
6780
6781    fn items(self) -> std::vec::Vec<Self::PageItem> {
6782        self.quota_rules
6783    }
6784
6785    fn next_page_token(&self) -> std::string::String {
6786        use std::clone::Clone;
6787        self.next_page_token.clone()
6788    }
6789}
6790
6791/// GetQuotaRuleRequest for getting a quota rule.
6792#[derive(Clone, Default, PartialEq)]
6793#[non_exhaustive]
6794pub struct GetQuotaRuleRequest {
6795    /// Required. Name of the quota rule
6796    pub name: std::string::String,
6797
6798    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6799}
6800
6801impl GetQuotaRuleRequest {
6802    pub fn new() -> Self {
6803        std::default::Default::default()
6804    }
6805
6806    /// Sets the value of [name][crate::model::GetQuotaRuleRequest::name].
6807    ///
6808    /// # Example
6809    /// ```ignore,no_run
6810    /// # use google_cloud_netapp_v1::model::GetQuotaRuleRequest;
6811    /// let x = GetQuotaRuleRequest::new().set_name("example");
6812    /// ```
6813    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6814        self.name = v.into();
6815        self
6816    }
6817}
6818
6819impl wkt::message::Message for GetQuotaRuleRequest {
6820    fn typename() -> &'static str {
6821        "type.googleapis.com/google.cloud.netapp.v1.GetQuotaRuleRequest"
6822    }
6823}
6824
6825/// CreateQuotaRuleRequest for creating a quota rule.
6826#[derive(Clone, Default, PartialEq)]
6827#[non_exhaustive]
6828pub struct CreateQuotaRuleRequest {
6829    /// Required. Parent value for CreateQuotaRuleRequest
6830    pub parent: std::string::String,
6831
6832    /// Required. Fields of the to be created quota rule.
6833    pub quota_rule: std::option::Option<crate::model::QuotaRule>,
6834
6835    /// Required. ID of the quota rule to create. Must be unique within the parent
6836    /// resource. Must contain only letters, numbers, underscore and hyphen, with
6837    /// the first character a letter or underscore, the last a letter or underscore
6838    /// or a number, and a 63 character maximum.
6839    pub quota_rule_id: std::string::String,
6840
6841    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6842}
6843
6844impl CreateQuotaRuleRequest {
6845    pub fn new() -> Self {
6846        std::default::Default::default()
6847    }
6848
6849    /// Sets the value of [parent][crate::model::CreateQuotaRuleRequest::parent].
6850    ///
6851    /// # Example
6852    /// ```ignore,no_run
6853    /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
6854    /// let x = CreateQuotaRuleRequest::new().set_parent("example");
6855    /// ```
6856    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6857        self.parent = v.into();
6858        self
6859    }
6860
6861    /// Sets the value of [quota_rule][crate::model::CreateQuotaRuleRequest::quota_rule].
6862    ///
6863    /// # Example
6864    /// ```ignore,no_run
6865    /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
6866    /// use google_cloud_netapp_v1::model::QuotaRule;
6867    /// let x = CreateQuotaRuleRequest::new().set_quota_rule(QuotaRule::default()/* use setters */);
6868    /// ```
6869    pub fn set_quota_rule<T>(mut self, v: T) -> Self
6870    where
6871        T: std::convert::Into<crate::model::QuotaRule>,
6872    {
6873        self.quota_rule = std::option::Option::Some(v.into());
6874        self
6875    }
6876
6877    /// Sets or clears the value of [quota_rule][crate::model::CreateQuotaRuleRequest::quota_rule].
6878    ///
6879    /// # Example
6880    /// ```ignore,no_run
6881    /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
6882    /// use google_cloud_netapp_v1::model::QuotaRule;
6883    /// let x = CreateQuotaRuleRequest::new().set_or_clear_quota_rule(Some(QuotaRule::default()/* use setters */));
6884    /// let x = CreateQuotaRuleRequest::new().set_or_clear_quota_rule(None::<QuotaRule>);
6885    /// ```
6886    pub fn set_or_clear_quota_rule<T>(mut self, v: std::option::Option<T>) -> Self
6887    where
6888        T: std::convert::Into<crate::model::QuotaRule>,
6889    {
6890        self.quota_rule = v.map(|x| x.into());
6891        self
6892    }
6893
6894    /// Sets the value of [quota_rule_id][crate::model::CreateQuotaRuleRequest::quota_rule_id].
6895    ///
6896    /// # Example
6897    /// ```ignore,no_run
6898    /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
6899    /// let x = CreateQuotaRuleRequest::new().set_quota_rule_id("example");
6900    /// ```
6901    pub fn set_quota_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6902        self.quota_rule_id = v.into();
6903        self
6904    }
6905}
6906
6907impl wkt::message::Message for CreateQuotaRuleRequest {
6908    fn typename() -> &'static str {
6909        "type.googleapis.com/google.cloud.netapp.v1.CreateQuotaRuleRequest"
6910    }
6911}
6912
6913/// UpdateQuotaRuleRequest for updating a quota rule.
6914#[derive(Clone, Default, PartialEq)]
6915#[non_exhaustive]
6916pub struct UpdateQuotaRuleRequest {
6917    /// Optional. Field mask is used to specify the fields to be overwritten in the
6918    /// Quota Rule resource by the update.
6919    /// The fields specified in the update_mask are relative to the resource, not
6920    /// the full request. A field will be overwritten if it is in the mask. If the
6921    /// user does not provide a mask then all fields will be overwritten.
6922    pub update_mask: std::option::Option<wkt::FieldMask>,
6923
6924    /// Required. The quota rule being updated
6925    pub quota_rule: std::option::Option<crate::model::QuotaRule>,
6926
6927    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6928}
6929
6930impl UpdateQuotaRuleRequest {
6931    pub fn new() -> Self {
6932        std::default::Default::default()
6933    }
6934
6935    /// Sets the value of [update_mask][crate::model::UpdateQuotaRuleRequest::update_mask].
6936    ///
6937    /// # Example
6938    /// ```ignore,no_run
6939    /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
6940    /// use wkt::FieldMask;
6941    /// let x = UpdateQuotaRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6942    /// ```
6943    pub fn set_update_mask<T>(mut self, v: T) -> Self
6944    where
6945        T: std::convert::Into<wkt::FieldMask>,
6946    {
6947        self.update_mask = std::option::Option::Some(v.into());
6948        self
6949    }
6950
6951    /// Sets or clears the value of [update_mask][crate::model::UpdateQuotaRuleRequest::update_mask].
6952    ///
6953    /// # Example
6954    /// ```ignore,no_run
6955    /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
6956    /// use wkt::FieldMask;
6957    /// let x = UpdateQuotaRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6958    /// let x = UpdateQuotaRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6959    /// ```
6960    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6961    where
6962        T: std::convert::Into<wkt::FieldMask>,
6963    {
6964        self.update_mask = v.map(|x| x.into());
6965        self
6966    }
6967
6968    /// Sets the value of [quota_rule][crate::model::UpdateQuotaRuleRequest::quota_rule].
6969    ///
6970    /// # Example
6971    /// ```ignore,no_run
6972    /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
6973    /// use google_cloud_netapp_v1::model::QuotaRule;
6974    /// let x = UpdateQuotaRuleRequest::new().set_quota_rule(QuotaRule::default()/* use setters */);
6975    /// ```
6976    pub fn set_quota_rule<T>(mut self, v: T) -> Self
6977    where
6978        T: std::convert::Into<crate::model::QuotaRule>,
6979    {
6980        self.quota_rule = std::option::Option::Some(v.into());
6981        self
6982    }
6983
6984    /// Sets or clears the value of [quota_rule][crate::model::UpdateQuotaRuleRequest::quota_rule].
6985    ///
6986    /// # Example
6987    /// ```ignore,no_run
6988    /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
6989    /// use google_cloud_netapp_v1::model::QuotaRule;
6990    /// let x = UpdateQuotaRuleRequest::new().set_or_clear_quota_rule(Some(QuotaRule::default()/* use setters */));
6991    /// let x = UpdateQuotaRuleRequest::new().set_or_clear_quota_rule(None::<QuotaRule>);
6992    /// ```
6993    pub fn set_or_clear_quota_rule<T>(mut self, v: std::option::Option<T>) -> Self
6994    where
6995        T: std::convert::Into<crate::model::QuotaRule>,
6996    {
6997        self.quota_rule = v.map(|x| x.into());
6998        self
6999    }
7000}
7001
7002impl wkt::message::Message for UpdateQuotaRuleRequest {
7003    fn typename() -> &'static str {
7004        "type.googleapis.com/google.cloud.netapp.v1.UpdateQuotaRuleRequest"
7005    }
7006}
7007
7008/// DeleteQuotaRuleRequest for deleting a single quota rule.
7009#[derive(Clone, Default, PartialEq)]
7010#[non_exhaustive]
7011pub struct DeleteQuotaRuleRequest {
7012    /// Required. Name of the quota rule.
7013    pub name: std::string::String,
7014
7015    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7016}
7017
7018impl DeleteQuotaRuleRequest {
7019    pub fn new() -> Self {
7020        std::default::Default::default()
7021    }
7022
7023    /// Sets the value of [name][crate::model::DeleteQuotaRuleRequest::name].
7024    ///
7025    /// # Example
7026    /// ```ignore,no_run
7027    /// # use google_cloud_netapp_v1::model::DeleteQuotaRuleRequest;
7028    /// let x = DeleteQuotaRuleRequest::new().set_name("example");
7029    /// ```
7030    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7031        self.name = v.into();
7032        self
7033    }
7034}
7035
7036impl wkt::message::Message for DeleteQuotaRuleRequest {
7037    fn typename() -> &'static str {
7038        "type.googleapis.com/google.cloud.netapp.v1.DeleteQuotaRuleRequest"
7039    }
7040}
7041
7042/// QuotaRule specifies the maximum disk space a user or group can use within a
7043/// volume. They can be used for creating default and individual quota rules.
7044#[derive(Clone, Default, PartialEq)]
7045#[non_exhaustive]
7046pub struct QuotaRule {
7047    /// Identifier. The resource name of the quota rule.
7048    /// Format:
7049    /// `projects/{project_number}/locations/{location_id}/volumes/volumes/{volume_id}/quotaRules/{quota_rule_id}`.
7050    pub name: std::string::String,
7051
7052    /// Optional. The quota rule applies to the specified user or group, identified
7053    /// by a Unix UID/GID, Windows SID, or null for default.
7054    pub target: std::string::String,
7055
7056    /// Required. The type of quota rule.
7057    pub r#type: crate::model::quota_rule::Type,
7058
7059    /// Required. The maximum allowed disk space in MiB.
7060    pub disk_limit_mib: i32,
7061
7062    /// Output only. State of the quota rule
7063    pub state: crate::model::quota_rule::State,
7064
7065    /// Output only. State details of the quota rule
7066    pub state_details: std::string::String,
7067
7068    /// Output only. Create time of the quota rule
7069    pub create_time: std::option::Option<wkt::Timestamp>,
7070
7071    /// Optional. Description of the quota rule
7072    pub description: std::string::String,
7073
7074    /// Optional. Labels of the quota rule
7075    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7076
7077    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7078}
7079
7080impl QuotaRule {
7081    pub fn new() -> Self {
7082        std::default::Default::default()
7083    }
7084
7085    /// Sets the value of [name][crate::model::QuotaRule::name].
7086    ///
7087    /// # Example
7088    /// ```ignore,no_run
7089    /// # use google_cloud_netapp_v1::model::QuotaRule;
7090    /// let x = QuotaRule::new().set_name("example");
7091    /// ```
7092    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7093        self.name = v.into();
7094        self
7095    }
7096
7097    /// Sets the value of [target][crate::model::QuotaRule::target].
7098    ///
7099    /// # Example
7100    /// ```ignore,no_run
7101    /// # use google_cloud_netapp_v1::model::QuotaRule;
7102    /// let x = QuotaRule::new().set_target("example");
7103    /// ```
7104    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7105        self.target = v.into();
7106        self
7107    }
7108
7109    /// Sets the value of [r#type][crate::model::QuotaRule::type].
7110    ///
7111    /// # Example
7112    /// ```ignore,no_run
7113    /// # use google_cloud_netapp_v1::model::QuotaRule;
7114    /// use google_cloud_netapp_v1::model::quota_rule::Type;
7115    /// let x0 = QuotaRule::new().set_type(Type::IndividualUserQuota);
7116    /// let x1 = QuotaRule::new().set_type(Type::IndividualGroupQuota);
7117    /// let x2 = QuotaRule::new().set_type(Type::DefaultUserQuota);
7118    /// ```
7119    pub fn set_type<T: std::convert::Into<crate::model::quota_rule::Type>>(mut self, v: T) -> Self {
7120        self.r#type = v.into();
7121        self
7122    }
7123
7124    /// Sets the value of [disk_limit_mib][crate::model::QuotaRule::disk_limit_mib].
7125    ///
7126    /// # Example
7127    /// ```ignore,no_run
7128    /// # use google_cloud_netapp_v1::model::QuotaRule;
7129    /// let x = QuotaRule::new().set_disk_limit_mib(42);
7130    /// ```
7131    pub fn set_disk_limit_mib<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7132        self.disk_limit_mib = v.into();
7133        self
7134    }
7135
7136    /// Sets the value of [state][crate::model::QuotaRule::state].
7137    ///
7138    /// # Example
7139    /// ```ignore,no_run
7140    /// # use google_cloud_netapp_v1::model::QuotaRule;
7141    /// use google_cloud_netapp_v1::model::quota_rule::State;
7142    /// let x0 = QuotaRule::new().set_state(State::Creating);
7143    /// let x1 = QuotaRule::new().set_state(State::Updating);
7144    /// let x2 = QuotaRule::new().set_state(State::Deleting);
7145    /// ```
7146    pub fn set_state<T: std::convert::Into<crate::model::quota_rule::State>>(
7147        mut self,
7148        v: T,
7149    ) -> Self {
7150        self.state = v.into();
7151        self
7152    }
7153
7154    /// Sets the value of [state_details][crate::model::QuotaRule::state_details].
7155    ///
7156    /// # Example
7157    /// ```ignore,no_run
7158    /// # use google_cloud_netapp_v1::model::QuotaRule;
7159    /// let x = QuotaRule::new().set_state_details("example");
7160    /// ```
7161    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7162        self.state_details = v.into();
7163        self
7164    }
7165
7166    /// Sets the value of [create_time][crate::model::QuotaRule::create_time].
7167    ///
7168    /// # Example
7169    /// ```ignore,no_run
7170    /// # use google_cloud_netapp_v1::model::QuotaRule;
7171    /// use wkt::Timestamp;
7172    /// let x = QuotaRule::new().set_create_time(Timestamp::default()/* use setters */);
7173    /// ```
7174    pub fn set_create_time<T>(mut self, v: T) -> Self
7175    where
7176        T: std::convert::Into<wkt::Timestamp>,
7177    {
7178        self.create_time = std::option::Option::Some(v.into());
7179        self
7180    }
7181
7182    /// Sets or clears the value of [create_time][crate::model::QuotaRule::create_time].
7183    ///
7184    /// # Example
7185    /// ```ignore,no_run
7186    /// # use google_cloud_netapp_v1::model::QuotaRule;
7187    /// use wkt::Timestamp;
7188    /// let x = QuotaRule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7189    /// let x = QuotaRule::new().set_or_clear_create_time(None::<Timestamp>);
7190    /// ```
7191    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7192    where
7193        T: std::convert::Into<wkt::Timestamp>,
7194    {
7195        self.create_time = v.map(|x| x.into());
7196        self
7197    }
7198
7199    /// Sets the value of [description][crate::model::QuotaRule::description].
7200    ///
7201    /// # Example
7202    /// ```ignore,no_run
7203    /// # use google_cloud_netapp_v1::model::QuotaRule;
7204    /// let x = QuotaRule::new().set_description("example");
7205    /// ```
7206    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7207        self.description = v.into();
7208        self
7209    }
7210
7211    /// Sets the value of [labels][crate::model::QuotaRule::labels].
7212    ///
7213    /// # Example
7214    /// ```ignore,no_run
7215    /// # use google_cloud_netapp_v1::model::QuotaRule;
7216    /// let x = QuotaRule::new().set_labels([
7217    ///     ("key0", "abc"),
7218    ///     ("key1", "xyz"),
7219    /// ]);
7220    /// ```
7221    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7222    where
7223        T: std::iter::IntoIterator<Item = (K, V)>,
7224        K: std::convert::Into<std::string::String>,
7225        V: std::convert::Into<std::string::String>,
7226    {
7227        use std::iter::Iterator;
7228        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7229        self
7230    }
7231}
7232
7233impl wkt::message::Message for QuotaRule {
7234    fn typename() -> &'static str {
7235        "type.googleapis.com/google.cloud.netapp.v1.QuotaRule"
7236    }
7237}
7238
7239/// Defines additional types related to [QuotaRule].
7240pub mod quota_rule {
7241    #[allow(unused_imports)]
7242    use super::*;
7243
7244    /// Types of Quota Rule
7245    ///
7246    /// # Working with unknown values
7247    ///
7248    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7249    /// additional enum variants at any time. Adding new variants is not considered
7250    /// a breaking change. Applications should write their code in anticipation of:
7251    ///
7252    /// - New values appearing in future releases of the client library, **and**
7253    /// - New values received dynamically, without application changes.
7254    ///
7255    /// Please consult the [Working with enums] section in the user guide for some
7256    /// guidelines.
7257    ///
7258    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7259    #[derive(Clone, Debug, PartialEq)]
7260    #[non_exhaustive]
7261    pub enum Type {
7262        /// Unspecified type for quota rule
7263        Unspecified,
7264        /// Individual user quota rule
7265        IndividualUserQuota,
7266        /// Individual group quota rule
7267        IndividualGroupQuota,
7268        /// Default user quota rule
7269        DefaultUserQuota,
7270        /// Default group quota rule
7271        DefaultGroupQuota,
7272        /// If set, the enum was initialized with an unknown value.
7273        ///
7274        /// Applications can examine the value using [Type::value] or
7275        /// [Type::name].
7276        UnknownValue(r#type::UnknownValue),
7277    }
7278
7279    #[doc(hidden)]
7280    pub mod r#type {
7281        #[allow(unused_imports)]
7282        use super::*;
7283        #[derive(Clone, Debug, PartialEq)]
7284        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7285    }
7286
7287    impl Type {
7288        /// Gets the enum value.
7289        ///
7290        /// Returns `None` if the enum contains an unknown value deserialized from
7291        /// the string representation of enums.
7292        pub fn value(&self) -> std::option::Option<i32> {
7293            match self {
7294                Self::Unspecified => std::option::Option::Some(0),
7295                Self::IndividualUserQuota => std::option::Option::Some(1),
7296                Self::IndividualGroupQuota => std::option::Option::Some(2),
7297                Self::DefaultUserQuota => std::option::Option::Some(3),
7298                Self::DefaultGroupQuota => std::option::Option::Some(4),
7299                Self::UnknownValue(u) => u.0.value(),
7300            }
7301        }
7302
7303        /// Gets the enum value as a string.
7304        ///
7305        /// Returns `None` if the enum contains an unknown value deserialized from
7306        /// the integer representation of enums.
7307        pub fn name(&self) -> std::option::Option<&str> {
7308            match self {
7309                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
7310                Self::IndividualUserQuota => std::option::Option::Some("INDIVIDUAL_USER_QUOTA"),
7311                Self::IndividualGroupQuota => std::option::Option::Some("INDIVIDUAL_GROUP_QUOTA"),
7312                Self::DefaultUserQuota => std::option::Option::Some("DEFAULT_USER_QUOTA"),
7313                Self::DefaultGroupQuota => std::option::Option::Some("DEFAULT_GROUP_QUOTA"),
7314                Self::UnknownValue(u) => u.0.name(),
7315            }
7316        }
7317    }
7318
7319    impl std::default::Default for Type {
7320        fn default() -> Self {
7321            use std::convert::From;
7322            Self::from(0)
7323        }
7324    }
7325
7326    impl std::fmt::Display for Type {
7327        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7328            wkt::internal::display_enum(f, self.name(), self.value())
7329        }
7330    }
7331
7332    impl std::convert::From<i32> for Type {
7333        fn from(value: i32) -> Self {
7334            match value {
7335                0 => Self::Unspecified,
7336                1 => Self::IndividualUserQuota,
7337                2 => Self::IndividualGroupQuota,
7338                3 => Self::DefaultUserQuota,
7339                4 => Self::DefaultGroupQuota,
7340                _ => Self::UnknownValue(r#type::UnknownValue(
7341                    wkt::internal::UnknownEnumValue::Integer(value),
7342                )),
7343            }
7344        }
7345    }
7346
7347    impl std::convert::From<&str> for Type {
7348        fn from(value: &str) -> Self {
7349            use std::string::ToString;
7350            match value {
7351                "TYPE_UNSPECIFIED" => Self::Unspecified,
7352                "INDIVIDUAL_USER_QUOTA" => Self::IndividualUserQuota,
7353                "INDIVIDUAL_GROUP_QUOTA" => Self::IndividualGroupQuota,
7354                "DEFAULT_USER_QUOTA" => Self::DefaultUserQuota,
7355                "DEFAULT_GROUP_QUOTA" => Self::DefaultGroupQuota,
7356                _ => Self::UnknownValue(r#type::UnknownValue(
7357                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7358                )),
7359            }
7360        }
7361    }
7362
7363    impl serde::ser::Serialize for Type {
7364        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7365        where
7366            S: serde::Serializer,
7367        {
7368            match self {
7369                Self::Unspecified => serializer.serialize_i32(0),
7370                Self::IndividualUserQuota => serializer.serialize_i32(1),
7371                Self::IndividualGroupQuota => serializer.serialize_i32(2),
7372                Self::DefaultUserQuota => serializer.serialize_i32(3),
7373                Self::DefaultGroupQuota => serializer.serialize_i32(4),
7374                Self::UnknownValue(u) => u.0.serialize(serializer),
7375            }
7376        }
7377    }
7378
7379    impl<'de> serde::de::Deserialize<'de> for Type {
7380        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7381        where
7382            D: serde::Deserializer<'de>,
7383        {
7384            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
7385                ".google.cloud.netapp.v1.QuotaRule.Type",
7386            ))
7387        }
7388    }
7389
7390    /// Quota Rule states
7391    ///
7392    /// # Working with unknown values
7393    ///
7394    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7395    /// additional enum variants at any time. Adding new variants is not considered
7396    /// a breaking change. Applications should write their code in anticipation of:
7397    ///
7398    /// - New values appearing in future releases of the client library, **and**
7399    /// - New values received dynamically, without application changes.
7400    ///
7401    /// Please consult the [Working with enums] section in the user guide for some
7402    /// guidelines.
7403    ///
7404    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7405    #[derive(Clone, Debug, PartialEq)]
7406    #[non_exhaustive]
7407    pub enum State {
7408        /// Unspecified state for quota rule
7409        Unspecified,
7410        /// Quota rule is creating
7411        Creating,
7412        /// Quota rule is updating
7413        Updating,
7414        /// Quota rule is deleting
7415        Deleting,
7416        /// Quota rule is ready
7417        Ready,
7418        /// Quota rule is in error state.
7419        Error,
7420        /// If set, the enum was initialized with an unknown value.
7421        ///
7422        /// Applications can examine the value using [State::value] or
7423        /// [State::name].
7424        UnknownValue(state::UnknownValue),
7425    }
7426
7427    #[doc(hidden)]
7428    pub mod state {
7429        #[allow(unused_imports)]
7430        use super::*;
7431        #[derive(Clone, Debug, PartialEq)]
7432        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7433    }
7434
7435    impl State {
7436        /// Gets the enum value.
7437        ///
7438        /// Returns `None` if the enum contains an unknown value deserialized from
7439        /// the string representation of enums.
7440        pub fn value(&self) -> std::option::Option<i32> {
7441            match self {
7442                Self::Unspecified => std::option::Option::Some(0),
7443                Self::Creating => std::option::Option::Some(1),
7444                Self::Updating => std::option::Option::Some(2),
7445                Self::Deleting => std::option::Option::Some(3),
7446                Self::Ready => std::option::Option::Some(4),
7447                Self::Error => std::option::Option::Some(5),
7448                Self::UnknownValue(u) => u.0.value(),
7449            }
7450        }
7451
7452        /// Gets the enum value as a string.
7453        ///
7454        /// Returns `None` if the enum contains an unknown value deserialized from
7455        /// the integer representation of enums.
7456        pub fn name(&self) -> std::option::Option<&str> {
7457            match self {
7458                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7459                Self::Creating => std::option::Option::Some("CREATING"),
7460                Self::Updating => std::option::Option::Some("UPDATING"),
7461                Self::Deleting => std::option::Option::Some("DELETING"),
7462                Self::Ready => std::option::Option::Some("READY"),
7463                Self::Error => std::option::Option::Some("ERROR"),
7464                Self::UnknownValue(u) => u.0.name(),
7465            }
7466        }
7467    }
7468
7469    impl std::default::Default for State {
7470        fn default() -> Self {
7471            use std::convert::From;
7472            Self::from(0)
7473        }
7474    }
7475
7476    impl std::fmt::Display for State {
7477        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7478            wkt::internal::display_enum(f, self.name(), self.value())
7479        }
7480    }
7481
7482    impl std::convert::From<i32> for State {
7483        fn from(value: i32) -> Self {
7484            match value {
7485                0 => Self::Unspecified,
7486                1 => Self::Creating,
7487                2 => Self::Updating,
7488                3 => Self::Deleting,
7489                4 => Self::Ready,
7490                5 => Self::Error,
7491                _ => Self::UnknownValue(state::UnknownValue(
7492                    wkt::internal::UnknownEnumValue::Integer(value),
7493                )),
7494            }
7495        }
7496    }
7497
7498    impl std::convert::From<&str> for State {
7499        fn from(value: &str) -> Self {
7500            use std::string::ToString;
7501            match value {
7502                "STATE_UNSPECIFIED" => Self::Unspecified,
7503                "CREATING" => Self::Creating,
7504                "UPDATING" => Self::Updating,
7505                "DELETING" => Self::Deleting,
7506                "READY" => Self::Ready,
7507                "ERROR" => Self::Error,
7508                _ => Self::UnknownValue(state::UnknownValue(
7509                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7510                )),
7511            }
7512        }
7513    }
7514
7515    impl serde::ser::Serialize for State {
7516        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7517        where
7518            S: serde::Serializer,
7519        {
7520            match self {
7521                Self::Unspecified => serializer.serialize_i32(0),
7522                Self::Creating => serializer.serialize_i32(1),
7523                Self::Updating => serializer.serialize_i32(2),
7524                Self::Deleting => serializer.serialize_i32(3),
7525                Self::Ready => serializer.serialize_i32(4),
7526                Self::Error => serializer.serialize_i32(5),
7527                Self::UnknownValue(u) => u.0.serialize(serializer),
7528            }
7529        }
7530    }
7531
7532    impl<'de> serde::de::Deserialize<'de> for State {
7533        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7534        where
7535            D: serde::Deserializer<'de>,
7536        {
7537            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7538                ".google.cloud.netapp.v1.QuotaRule.State",
7539            ))
7540        }
7541    }
7542}
7543
7544/// TransferStats reports all statistics related to replication transfer.
7545#[derive(Clone, Default, PartialEq)]
7546#[non_exhaustive]
7547pub struct TransferStats {
7548    /// Cumulative bytes transferred so far for the replication relationship.
7549    pub transfer_bytes: std::option::Option<i64>,
7550
7551    /// Cumulative time taken across all transfers for the replication
7552    /// relationship.
7553    pub total_transfer_duration: std::option::Option<wkt::Duration>,
7554
7555    /// Last transfer size in bytes.
7556    pub last_transfer_bytes: std::option::Option<i64>,
7557
7558    /// Time taken during last transfer.
7559    pub last_transfer_duration: std::option::Option<wkt::Duration>,
7560
7561    /// Lag duration indicates the duration by which Destination region volume
7562    /// content lags behind the primary region volume content.
7563    pub lag_duration: std::option::Option<wkt::Duration>,
7564
7565    /// Time when progress was updated last.
7566    pub update_time: std::option::Option<wkt::Timestamp>,
7567
7568    /// Time when last transfer completed.
7569    pub last_transfer_end_time: std::option::Option<wkt::Timestamp>,
7570
7571    /// A message describing the cause of the last transfer failure.
7572    pub last_transfer_error: std::option::Option<std::string::String>,
7573
7574    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7575}
7576
7577impl TransferStats {
7578    pub fn new() -> Self {
7579        std::default::Default::default()
7580    }
7581
7582    /// Sets the value of [transfer_bytes][crate::model::TransferStats::transfer_bytes].
7583    ///
7584    /// # Example
7585    /// ```ignore,no_run
7586    /// # use google_cloud_netapp_v1::model::TransferStats;
7587    /// let x = TransferStats::new().set_transfer_bytes(42);
7588    /// ```
7589    pub fn set_transfer_bytes<T>(mut self, v: T) -> Self
7590    where
7591        T: std::convert::Into<i64>,
7592    {
7593        self.transfer_bytes = std::option::Option::Some(v.into());
7594        self
7595    }
7596
7597    /// Sets or clears the value of [transfer_bytes][crate::model::TransferStats::transfer_bytes].
7598    ///
7599    /// # Example
7600    /// ```ignore,no_run
7601    /// # use google_cloud_netapp_v1::model::TransferStats;
7602    /// let x = TransferStats::new().set_or_clear_transfer_bytes(Some(42));
7603    /// let x = TransferStats::new().set_or_clear_transfer_bytes(None::<i32>);
7604    /// ```
7605    pub fn set_or_clear_transfer_bytes<T>(mut self, v: std::option::Option<T>) -> Self
7606    where
7607        T: std::convert::Into<i64>,
7608    {
7609        self.transfer_bytes = v.map(|x| x.into());
7610        self
7611    }
7612
7613    /// Sets the value of [total_transfer_duration][crate::model::TransferStats::total_transfer_duration].
7614    ///
7615    /// # Example
7616    /// ```ignore,no_run
7617    /// # use google_cloud_netapp_v1::model::TransferStats;
7618    /// use wkt::Duration;
7619    /// let x = TransferStats::new().set_total_transfer_duration(Duration::default()/* use setters */);
7620    /// ```
7621    pub fn set_total_transfer_duration<T>(mut self, v: T) -> Self
7622    where
7623        T: std::convert::Into<wkt::Duration>,
7624    {
7625        self.total_transfer_duration = std::option::Option::Some(v.into());
7626        self
7627    }
7628
7629    /// Sets or clears the value of [total_transfer_duration][crate::model::TransferStats::total_transfer_duration].
7630    ///
7631    /// # Example
7632    /// ```ignore,no_run
7633    /// # use google_cloud_netapp_v1::model::TransferStats;
7634    /// use wkt::Duration;
7635    /// let x = TransferStats::new().set_or_clear_total_transfer_duration(Some(Duration::default()/* use setters */));
7636    /// let x = TransferStats::new().set_or_clear_total_transfer_duration(None::<Duration>);
7637    /// ```
7638    pub fn set_or_clear_total_transfer_duration<T>(mut self, v: std::option::Option<T>) -> Self
7639    where
7640        T: std::convert::Into<wkt::Duration>,
7641    {
7642        self.total_transfer_duration = v.map(|x| x.into());
7643        self
7644    }
7645
7646    /// Sets the value of [last_transfer_bytes][crate::model::TransferStats::last_transfer_bytes].
7647    ///
7648    /// # Example
7649    /// ```ignore,no_run
7650    /// # use google_cloud_netapp_v1::model::TransferStats;
7651    /// let x = TransferStats::new().set_last_transfer_bytes(42);
7652    /// ```
7653    pub fn set_last_transfer_bytes<T>(mut self, v: T) -> Self
7654    where
7655        T: std::convert::Into<i64>,
7656    {
7657        self.last_transfer_bytes = std::option::Option::Some(v.into());
7658        self
7659    }
7660
7661    /// Sets or clears the value of [last_transfer_bytes][crate::model::TransferStats::last_transfer_bytes].
7662    ///
7663    /// # Example
7664    /// ```ignore,no_run
7665    /// # use google_cloud_netapp_v1::model::TransferStats;
7666    /// let x = TransferStats::new().set_or_clear_last_transfer_bytes(Some(42));
7667    /// let x = TransferStats::new().set_or_clear_last_transfer_bytes(None::<i32>);
7668    /// ```
7669    pub fn set_or_clear_last_transfer_bytes<T>(mut self, v: std::option::Option<T>) -> Self
7670    where
7671        T: std::convert::Into<i64>,
7672    {
7673        self.last_transfer_bytes = v.map(|x| x.into());
7674        self
7675    }
7676
7677    /// Sets the value of [last_transfer_duration][crate::model::TransferStats::last_transfer_duration].
7678    ///
7679    /// # Example
7680    /// ```ignore,no_run
7681    /// # use google_cloud_netapp_v1::model::TransferStats;
7682    /// use wkt::Duration;
7683    /// let x = TransferStats::new().set_last_transfer_duration(Duration::default()/* use setters */);
7684    /// ```
7685    pub fn set_last_transfer_duration<T>(mut self, v: T) -> Self
7686    where
7687        T: std::convert::Into<wkt::Duration>,
7688    {
7689        self.last_transfer_duration = std::option::Option::Some(v.into());
7690        self
7691    }
7692
7693    /// Sets or clears the value of [last_transfer_duration][crate::model::TransferStats::last_transfer_duration].
7694    ///
7695    /// # Example
7696    /// ```ignore,no_run
7697    /// # use google_cloud_netapp_v1::model::TransferStats;
7698    /// use wkt::Duration;
7699    /// let x = TransferStats::new().set_or_clear_last_transfer_duration(Some(Duration::default()/* use setters */));
7700    /// let x = TransferStats::new().set_or_clear_last_transfer_duration(None::<Duration>);
7701    /// ```
7702    pub fn set_or_clear_last_transfer_duration<T>(mut self, v: std::option::Option<T>) -> Self
7703    where
7704        T: std::convert::Into<wkt::Duration>,
7705    {
7706        self.last_transfer_duration = v.map(|x| x.into());
7707        self
7708    }
7709
7710    /// Sets the value of [lag_duration][crate::model::TransferStats::lag_duration].
7711    ///
7712    /// # Example
7713    /// ```ignore,no_run
7714    /// # use google_cloud_netapp_v1::model::TransferStats;
7715    /// use wkt::Duration;
7716    /// let x = TransferStats::new().set_lag_duration(Duration::default()/* use setters */);
7717    /// ```
7718    pub fn set_lag_duration<T>(mut self, v: T) -> Self
7719    where
7720        T: std::convert::Into<wkt::Duration>,
7721    {
7722        self.lag_duration = std::option::Option::Some(v.into());
7723        self
7724    }
7725
7726    /// Sets or clears the value of [lag_duration][crate::model::TransferStats::lag_duration].
7727    ///
7728    /// # Example
7729    /// ```ignore,no_run
7730    /// # use google_cloud_netapp_v1::model::TransferStats;
7731    /// use wkt::Duration;
7732    /// let x = TransferStats::new().set_or_clear_lag_duration(Some(Duration::default()/* use setters */));
7733    /// let x = TransferStats::new().set_or_clear_lag_duration(None::<Duration>);
7734    /// ```
7735    pub fn set_or_clear_lag_duration<T>(mut self, v: std::option::Option<T>) -> Self
7736    where
7737        T: std::convert::Into<wkt::Duration>,
7738    {
7739        self.lag_duration = v.map(|x| x.into());
7740        self
7741    }
7742
7743    /// Sets the value of [update_time][crate::model::TransferStats::update_time].
7744    ///
7745    /// # Example
7746    /// ```ignore,no_run
7747    /// # use google_cloud_netapp_v1::model::TransferStats;
7748    /// use wkt::Timestamp;
7749    /// let x = TransferStats::new().set_update_time(Timestamp::default()/* use setters */);
7750    /// ```
7751    pub fn set_update_time<T>(mut self, v: T) -> Self
7752    where
7753        T: std::convert::Into<wkt::Timestamp>,
7754    {
7755        self.update_time = std::option::Option::Some(v.into());
7756        self
7757    }
7758
7759    /// Sets or clears the value of [update_time][crate::model::TransferStats::update_time].
7760    ///
7761    /// # Example
7762    /// ```ignore,no_run
7763    /// # use google_cloud_netapp_v1::model::TransferStats;
7764    /// use wkt::Timestamp;
7765    /// let x = TransferStats::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7766    /// let x = TransferStats::new().set_or_clear_update_time(None::<Timestamp>);
7767    /// ```
7768    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7769    where
7770        T: std::convert::Into<wkt::Timestamp>,
7771    {
7772        self.update_time = v.map(|x| x.into());
7773        self
7774    }
7775
7776    /// Sets the value of [last_transfer_end_time][crate::model::TransferStats::last_transfer_end_time].
7777    ///
7778    /// # Example
7779    /// ```ignore,no_run
7780    /// # use google_cloud_netapp_v1::model::TransferStats;
7781    /// use wkt::Timestamp;
7782    /// let x = TransferStats::new().set_last_transfer_end_time(Timestamp::default()/* use setters */);
7783    /// ```
7784    pub fn set_last_transfer_end_time<T>(mut self, v: T) -> Self
7785    where
7786        T: std::convert::Into<wkt::Timestamp>,
7787    {
7788        self.last_transfer_end_time = std::option::Option::Some(v.into());
7789        self
7790    }
7791
7792    /// Sets or clears the value of [last_transfer_end_time][crate::model::TransferStats::last_transfer_end_time].
7793    ///
7794    /// # Example
7795    /// ```ignore,no_run
7796    /// # use google_cloud_netapp_v1::model::TransferStats;
7797    /// use wkt::Timestamp;
7798    /// let x = TransferStats::new().set_or_clear_last_transfer_end_time(Some(Timestamp::default()/* use setters */));
7799    /// let x = TransferStats::new().set_or_clear_last_transfer_end_time(None::<Timestamp>);
7800    /// ```
7801    pub fn set_or_clear_last_transfer_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7802    where
7803        T: std::convert::Into<wkt::Timestamp>,
7804    {
7805        self.last_transfer_end_time = v.map(|x| x.into());
7806        self
7807    }
7808
7809    /// Sets the value of [last_transfer_error][crate::model::TransferStats::last_transfer_error].
7810    ///
7811    /// # Example
7812    /// ```ignore,no_run
7813    /// # use google_cloud_netapp_v1::model::TransferStats;
7814    /// let x = TransferStats::new().set_last_transfer_error("example");
7815    /// ```
7816    pub fn set_last_transfer_error<T>(mut self, v: T) -> Self
7817    where
7818        T: std::convert::Into<std::string::String>,
7819    {
7820        self.last_transfer_error = std::option::Option::Some(v.into());
7821        self
7822    }
7823
7824    /// Sets or clears the value of [last_transfer_error][crate::model::TransferStats::last_transfer_error].
7825    ///
7826    /// # Example
7827    /// ```ignore,no_run
7828    /// # use google_cloud_netapp_v1::model::TransferStats;
7829    /// let x = TransferStats::new().set_or_clear_last_transfer_error(Some("example"));
7830    /// let x = TransferStats::new().set_or_clear_last_transfer_error(None::<String>);
7831    /// ```
7832    pub fn set_or_clear_last_transfer_error<T>(mut self, v: std::option::Option<T>) -> Self
7833    where
7834        T: std::convert::Into<std::string::String>,
7835    {
7836        self.last_transfer_error = v.map(|x| x.into());
7837        self
7838    }
7839}
7840
7841impl wkt::message::Message for TransferStats {
7842    fn typename() -> &'static str {
7843        "type.googleapis.com/google.cloud.netapp.v1.TransferStats"
7844    }
7845}
7846
7847/// Replication is a nested resource under Volume, that describes a
7848/// cross-region replication relationship between 2 volumes in different
7849/// regions.
7850#[derive(Clone, Default, PartialEq)]
7851#[non_exhaustive]
7852pub struct Replication {
7853    /// Identifier. The resource name of the Replication.
7854    /// Format:
7855    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}`.
7856    pub name: std::string::String,
7857
7858    /// Output only. State of the replication.
7859    pub state: crate::model::replication::State,
7860
7861    /// Output only. State details of the replication.
7862    pub state_details: std::string::String,
7863
7864    /// Output only. Indicates whether this points to source or destination.
7865    pub role: crate::model::replication::ReplicationRole,
7866
7867    /// Required. Indicates the schedule for replication.
7868    pub replication_schedule: crate::model::replication::ReplicationSchedule,
7869
7870    /// Output only. Indicates the state of mirroring.
7871    pub mirror_state: crate::model::replication::MirrorState,
7872
7873    /// Output only. Condition of the relationship. Can be one of the following:
7874    ///
7875    /// - true: The replication relationship is healthy. It has not missed the most
7876    ///   recent scheduled transfer.
7877    /// - false: The replication relationship is not healthy. It has missed the
7878    ///   most recent scheduled transfer.
7879    pub healthy: std::option::Option<bool>,
7880
7881    /// Output only. Replication create time.
7882    pub create_time: std::option::Option<wkt::Timestamp>,
7883
7884    /// Output only. Full name of destination volume resource.
7885    /// Example : "projects/{project}/locations/{location}/volumes/{volume_id}"
7886    pub destination_volume: std::string::String,
7887
7888    /// Output only. Replication transfer statistics.
7889    pub transfer_stats: std::option::Option<crate::model::TransferStats>,
7890
7891    /// Resource labels to represent user provided metadata.
7892    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7893
7894    /// A description about this replication relationship.
7895    pub description: std::option::Option<std::string::String>,
7896
7897    /// Required. Input only. Destination volume parameters
7898    pub destination_volume_parameters:
7899        std::option::Option<crate::model::DestinationVolumeParameters>,
7900
7901    /// Output only. Full name of source volume resource.
7902    /// Example : "projects/{project}/locations/{location}/volumes/{volume_id}"
7903    pub source_volume: std::string::String,
7904
7905    /// Output only. Hybrid peering details.
7906    pub hybrid_peering_details: std::option::Option<crate::model::HybridPeeringDetails>,
7907
7908    /// Optional. Location of the user cluster.
7909    pub cluster_location: std::string::String,
7910
7911    /// Output only. Type of the hybrid replication.
7912    pub hybrid_replication_type: crate::model::replication::HybridReplicationType,
7913
7914    /// Output only. Copy pastable snapmirror commands to be executed on onprem
7915    /// cluster by the customer.
7916    pub hybrid_replication_user_commands: std::option::Option<crate::model::UserCommands>,
7917
7918    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7919}
7920
7921impl Replication {
7922    pub fn new() -> Self {
7923        std::default::Default::default()
7924    }
7925
7926    /// Sets the value of [name][crate::model::Replication::name].
7927    ///
7928    /// # Example
7929    /// ```ignore,no_run
7930    /// # use google_cloud_netapp_v1::model::Replication;
7931    /// let x = Replication::new().set_name("example");
7932    /// ```
7933    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7934        self.name = v.into();
7935        self
7936    }
7937
7938    /// Sets the value of [state][crate::model::Replication::state].
7939    ///
7940    /// # Example
7941    /// ```ignore,no_run
7942    /// # use google_cloud_netapp_v1::model::Replication;
7943    /// use google_cloud_netapp_v1::model::replication::State;
7944    /// let x0 = Replication::new().set_state(State::Creating);
7945    /// let x1 = Replication::new().set_state(State::Ready);
7946    /// let x2 = Replication::new().set_state(State::Updating);
7947    /// ```
7948    pub fn set_state<T: std::convert::Into<crate::model::replication::State>>(
7949        mut self,
7950        v: T,
7951    ) -> Self {
7952        self.state = v.into();
7953        self
7954    }
7955
7956    /// Sets the value of [state_details][crate::model::Replication::state_details].
7957    ///
7958    /// # Example
7959    /// ```ignore,no_run
7960    /// # use google_cloud_netapp_v1::model::Replication;
7961    /// let x = Replication::new().set_state_details("example");
7962    /// ```
7963    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7964        self.state_details = v.into();
7965        self
7966    }
7967
7968    /// Sets the value of [role][crate::model::Replication::role].
7969    ///
7970    /// # Example
7971    /// ```ignore,no_run
7972    /// # use google_cloud_netapp_v1::model::Replication;
7973    /// use google_cloud_netapp_v1::model::replication::ReplicationRole;
7974    /// let x0 = Replication::new().set_role(ReplicationRole::Source);
7975    /// let x1 = Replication::new().set_role(ReplicationRole::Destination);
7976    /// ```
7977    pub fn set_role<T: std::convert::Into<crate::model::replication::ReplicationRole>>(
7978        mut self,
7979        v: T,
7980    ) -> Self {
7981        self.role = v.into();
7982        self
7983    }
7984
7985    /// Sets the value of [replication_schedule][crate::model::Replication::replication_schedule].
7986    ///
7987    /// # Example
7988    /// ```ignore,no_run
7989    /// # use google_cloud_netapp_v1::model::Replication;
7990    /// use google_cloud_netapp_v1::model::replication::ReplicationSchedule;
7991    /// let x0 = Replication::new().set_replication_schedule(ReplicationSchedule::Every10Minutes);
7992    /// let x1 = Replication::new().set_replication_schedule(ReplicationSchedule::Hourly);
7993    /// let x2 = Replication::new().set_replication_schedule(ReplicationSchedule::Daily);
7994    /// ```
7995    pub fn set_replication_schedule<
7996        T: std::convert::Into<crate::model::replication::ReplicationSchedule>,
7997    >(
7998        mut self,
7999        v: T,
8000    ) -> Self {
8001        self.replication_schedule = v.into();
8002        self
8003    }
8004
8005    /// Sets the value of [mirror_state][crate::model::Replication::mirror_state].
8006    ///
8007    /// # Example
8008    /// ```ignore,no_run
8009    /// # use google_cloud_netapp_v1::model::Replication;
8010    /// use google_cloud_netapp_v1::model::replication::MirrorState;
8011    /// let x0 = Replication::new().set_mirror_state(MirrorState::Preparing);
8012    /// let x1 = Replication::new().set_mirror_state(MirrorState::Mirrored);
8013    /// let x2 = Replication::new().set_mirror_state(MirrorState::Stopped);
8014    /// ```
8015    pub fn set_mirror_state<T: std::convert::Into<crate::model::replication::MirrorState>>(
8016        mut self,
8017        v: T,
8018    ) -> Self {
8019        self.mirror_state = v.into();
8020        self
8021    }
8022
8023    /// Sets the value of [healthy][crate::model::Replication::healthy].
8024    ///
8025    /// # Example
8026    /// ```ignore,no_run
8027    /// # use google_cloud_netapp_v1::model::Replication;
8028    /// let x = Replication::new().set_healthy(true);
8029    /// ```
8030    pub fn set_healthy<T>(mut self, v: T) -> Self
8031    where
8032        T: std::convert::Into<bool>,
8033    {
8034        self.healthy = std::option::Option::Some(v.into());
8035        self
8036    }
8037
8038    /// Sets or clears the value of [healthy][crate::model::Replication::healthy].
8039    ///
8040    /// # Example
8041    /// ```ignore,no_run
8042    /// # use google_cloud_netapp_v1::model::Replication;
8043    /// let x = Replication::new().set_or_clear_healthy(Some(false));
8044    /// let x = Replication::new().set_or_clear_healthy(None::<bool>);
8045    /// ```
8046    pub fn set_or_clear_healthy<T>(mut self, v: std::option::Option<T>) -> Self
8047    where
8048        T: std::convert::Into<bool>,
8049    {
8050        self.healthy = v.map(|x| x.into());
8051        self
8052    }
8053
8054    /// Sets the value of [create_time][crate::model::Replication::create_time].
8055    ///
8056    /// # Example
8057    /// ```ignore,no_run
8058    /// # use google_cloud_netapp_v1::model::Replication;
8059    /// use wkt::Timestamp;
8060    /// let x = Replication::new().set_create_time(Timestamp::default()/* use setters */);
8061    /// ```
8062    pub fn set_create_time<T>(mut self, v: T) -> Self
8063    where
8064        T: std::convert::Into<wkt::Timestamp>,
8065    {
8066        self.create_time = std::option::Option::Some(v.into());
8067        self
8068    }
8069
8070    /// Sets or clears the value of [create_time][crate::model::Replication::create_time].
8071    ///
8072    /// # Example
8073    /// ```ignore,no_run
8074    /// # use google_cloud_netapp_v1::model::Replication;
8075    /// use wkt::Timestamp;
8076    /// let x = Replication::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8077    /// let x = Replication::new().set_or_clear_create_time(None::<Timestamp>);
8078    /// ```
8079    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8080    where
8081        T: std::convert::Into<wkt::Timestamp>,
8082    {
8083        self.create_time = v.map(|x| x.into());
8084        self
8085    }
8086
8087    /// Sets the value of [destination_volume][crate::model::Replication::destination_volume].
8088    ///
8089    /// # Example
8090    /// ```ignore,no_run
8091    /// # use google_cloud_netapp_v1::model::Replication;
8092    /// let x = Replication::new().set_destination_volume("example");
8093    /// ```
8094    pub fn set_destination_volume<T: std::convert::Into<std::string::String>>(
8095        mut self,
8096        v: T,
8097    ) -> Self {
8098        self.destination_volume = v.into();
8099        self
8100    }
8101
8102    /// Sets the value of [transfer_stats][crate::model::Replication::transfer_stats].
8103    ///
8104    /// # Example
8105    /// ```ignore,no_run
8106    /// # use google_cloud_netapp_v1::model::Replication;
8107    /// use google_cloud_netapp_v1::model::TransferStats;
8108    /// let x = Replication::new().set_transfer_stats(TransferStats::default()/* use setters */);
8109    /// ```
8110    pub fn set_transfer_stats<T>(mut self, v: T) -> Self
8111    where
8112        T: std::convert::Into<crate::model::TransferStats>,
8113    {
8114        self.transfer_stats = std::option::Option::Some(v.into());
8115        self
8116    }
8117
8118    /// Sets or clears the value of [transfer_stats][crate::model::Replication::transfer_stats].
8119    ///
8120    /// # Example
8121    /// ```ignore,no_run
8122    /// # use google_cloud_netapp_v1::model::Replication;
8123    /// use google_cloud_netapp_v1::model::TransferStats;
8124    /// let x = Replication::new().set_or_clear_transfer_stats(Some(TransferStats::default()/* use setters */));
8125    /// let x = Replication::new().set_or_clear_transfer_stats(None::<TransferStats>);
8126    /// ```
8127    pub fn set_or_clear_transfer_stats<T>(mut self, v: std::option::Option<T>) -> Self
8128    where
8129        T: std::convert::Into<crate::model::TransferStats>,
8130    {
8131        self.transfer_stats = v.map(|x| x.into());
8132        self
8133    }
8134
8135    /// Sets the value of [labels][crate::model::Replication::labels].
8136    ///
8137    /// # Example
8138    /// ```ignore,no_run
8139    /// # use google_cloud_netapp_v1::model::Replication;
8140    /// let x = Replication::new().set_labels([
8141    ///     ("key0", "abc"),
8142    ///     ("key1", "xyz"),
8143    /// ]);
8144    /// ```
8145    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8146    where
8147        T: std::iter::IntoIterator<Item = (K, V)>,
8148        K: std::convert::Into<std::string::String>,
8149        V: std::convert::Into<std::string::String>,
8150    {
8151        use std::iter::Iterator;
8152        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8153        self
8154    }
8155
8156    /// Sets the value of [description][crate::model::Replication::description].
8157    ///
8158    /// # Example
8159    /// ```ignore,no_run
8160    /// # use google_cloud_netapp_v1::model::Replication;
8161    /// let x = Replication::new().set_description("example");
8162    /// ```
8163    pub fn set_description<T>(mut self, v: T) -> Self
8164    where
8165        T: std::convert::Into<std::string::String>,
8166    {
8167        self.description = std::option::Option::Some(v.into());
8168        self
8169    }
8170
8171    /// Sets or clears the value of [description][crate::model::Replication::description].
8172    ///
8173    /// # Example
8174    /// ```ignore,no_run
8175    /// # use google_cloud_netapp_v1::model::Replication;
8176    /// let x = Replication::new().set_or_clear_description(Some("example"));
8177    /// let x = Replication::new().set_or_clear_description(None::<String>);
8178    /// ```
8179    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
8180    where
8181        T: std::convert::Into<std::string::String>,
8182    {
8183        self.description = v.map(|x| x.into());
8184        self
8185    }
8186
8187    /// Sets the value of [destination_volume_parameters][crate::model::Replication::destination_volume_parameters].
8188    ///
8189    /// # Example
8190    /// ```ignore,no_run
8191    /// # use google_cloud_netapp_v1::model::Replication;
8192    /// use google_cloud_netapp_v1::model::DestinationVolumeParameters;
8193    /// let x = Replication::new().set_destination_volume_parameters(DestinationVolumeParameters::default()/* use setters */);
8194    /// ```
8195    pub fn set_destination_volume_parameters<T>(mut self, v: T) -> Self
8196    where
8197        T: std::convert::Into<crate::model::DestinationVolumeParameters>,
8198    {
8199        self.destination_volume_parameters = std::option::Option::Some(v.into());
8200        self
8201    }
8202
8203    /// Sets or clears the value of [destination_volume_parameters][crate::model::Replication::destination_volume_parameters].
8204    ///
8205    /// # Example
8206    /// ```ignore,no_run
8207    /// # use google_cloud_netapp_v1::model::Replication;
8208    /// use google_cloud_netapp_v1::model::DestinationVolumeParameters;
8209    /// let x = Replication::new().set_or_clear_destination_volume_parameters(Some(DestinationVolumeParameters::default()/* use setters */));
8210    /// let x = Replication::new().set_or_clear_destination_volume_parameters(None::<DestinationVolumeParameters>);
8211    /// ```
8212    pub fn set_or_clear_destination_volume_parameters<T>(
8213        mut self,
8214        v: std::option::Option<T>,
8215    ) -> Self
8216    where
8217        T: std::convert::Into<crate::model::DestinationVolumeParameters>,
8218    {
8219        self.destination_volume_parameters = v.map(|x| x.into());
8220        self
8221    }
8222
8223    /// Sets the value of [source_volume][crate::model::Replication::source_volume].
8224    ///
8225    /// # Example
8226    /// ```ignore,no_run
8227    /// # use google_cloud_netapp_v1::model::Replication;
8228    /// let x = Replication::new().set_source_volume("example");
8229    /// ```
8230    pub fn set_source_volume<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8231        self.source_volume = v.into();
8232        self
8233    }
8234
8235    /// Sets the value of [hybrid_peering_details][crate::model::Replication::hybrid_peering_details].
8236    ///
8237    /// # Example
8238    /// ```ignore,no_run
8239    /// # use google_cloud_netapp_v1::model::Replication;
8240    /// use google_cloud_netapp_v1::model::HybridPeeringDetails;
8241    /// let x = Replication::new().set_hybrid_peering_details(HybridPeeringDetails::default()/* use setters */);
8242    /// ```
8243    pub fn set_hybrid_peering_details<T>(mut self, v: T) -> Self
8244    where
8245        T: std::convert::Into<crate::model::HybridPeeringDetails>,
8246    {
8247        self.hybrid_peering_details = std::option::Option::Some(v.into());
8248        self
8249    }
8250
8251    /// Sets or clears the value of [hybrid_peering_details][crate::model::Replication::hybrid_peering_details].
8252    ///
8253    /// # Example
8254    /// ```ignore,no_run
8255    /// # use google_cloud_netapp_v1::model::Replication;
8256    /// use google_cloud_netapp_v1::model::HybridPeeringDetails;
8257    /// let x = Replication::new().set_or_clear_hybrid_peering_details(Some(HybridPeeringDetails::default()/* use setters */));
8258    /// let x = Replication::new().set_or_clear_hybrid_peering_details(None::<HybridPeeringDetails>);
8259    /// ```
8260    pub fn set_or_clear_hybrid_peering_details<T>(mut self, v: std::option::Option<T>) -> Self
8261    where
8262        T: std::convert::Into<crate::model::HybridPeeringDetails>,
8263    {
8264        self.hybrid_peering_details = v.map(|x| x.into());
8265        self
8266    }
8267
8268    /// Sets the value of [cluster_location][crate::model::Replication::cluster_location].
8269    ///
8270    /// # Example
8271    /// ```ignore,no_run
8272    /// # use google_cloud_netapp_v1::model::Replication;
8273    /// let x = Replication::new().set_cluster_location("example");
8274    /// ```
8275    pub fn set_cluster_location<T: std::convert::Into<std::string::String>>(
8276        mut self,
8277        v: T,
8278    ) -> Self {
8279        self.cluster_location = v.into();
8280        self
8281    }
8282
8283    /// Sets the value of [hybrid_replication_type][crate::model::Replication::hybrid_replication_type].
8284    ///
8285    /// # Example
8286    /// ```ignore,no_run
8287    /// # use google_cloud_netapp_v1::model::Replication;
8288    /// use google_cloud_netapp_v1::model::replication::HybridReplicationType;
8289    /// let x0 = Replication::new().set_hybrid_replication_type(HybridReplicationType::Migration);
8290    /// let x1 = Replication::new().set_hybrid_replication_type(HybridReplicationType::ContinuousReplication);
8291    /// let x2 = Replication::new().set_hybrid_replication_type(HybridReplicationType::OnpremReplication);
8292    /// ```
8293    pub fn set_hybrid_replication_type<
8294        T: std::convert::Into<crate::model::replication::HybridReplicationType>,
8295    >(
8296        mut self,
8297        v: T,
8298    ) -> Self {
8299        self.hybrid_replication_type = v.into();
8300        self
8301    }
8302
8303    /// Sets the value of [hybrid_replication_user_commands][crate::model::Replication::hybrid_replication_user_commands].
8304    ///
8305    /// # Example
8306    /// ```ignore,no_run
8307    /// # use google_cloud_netapp_v1::model::Replication;
8308    /// use google_cloud_netapp_v1::model::UserCommands;
8309    /// let x = Replication::new().set_hybrid_replication_user_commands(UserCommands::default()/* use setters */);
8310    /// ```
8311    pub fn set_hybrid_replication_user_commands<T>(mut self, v: T) -> Self
8312    where
8313        T: std::convert::Into<crate::model::UserCommands>,
8314    {
8315        self.hybrid_replication_user_commands = std::option::Option::Some(v.into());
8316        self
8317    }
8318
8319    /// Sets or clears the value of [hybrid_replication_user_commands][crate::model::Replication::hybrid_replication_user_commands].
8320    ///
8321    /// # Example
8322    /// ```ignore,no_run
8323    /// # use google_cloud_netapp_v1::model::Replication;
8324    /// use google_cloud_netapp_v1::model::UserCommands;
8325    /// let x = Replication::new().set_or_clear_hybrid_replication_user_commands(Some(UserCommands::default()/* use setters */));
8326    /// let x = Replication::new().set_or_clear_hybrid_replication_user_commands(None::<UserCommands>);
8327    /// ```
8328    pub fn set_or_clear_hybrid_replication_user_commands<T>(
8329        mut self,
8330        v: std::option::Option<T>,
8331    ) -> Self
8332    where
8333        T: std::convert::Into<crate::model::UserCommands>,
8334    {
8335        self.hybrid_replication_user_commands = v.map(|x| x.into());
8336        self
8337    }
8338}
8339
8340impl wkt::message::Message for Replication {
8341    fn typename() -> &'static str {
8342        "type.googleapis.com/google.cloud.netapp.v1.Replication"
8343    }
8344}
8345
8346/// Defines additional types related to [Replication].
8347pub mod replication {
8348    #[allow(unused_imports)]
8349    use super::*;
8350
8351    /// The replication states
8352    /// New enum values may be added in future to indicate possible new states.
8353    ///
8354    /// # Working with unknown values
8355    ///
8356    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8357    /// additional enum variants at any time. Adding new variants is not considered
8358    /// a breaking change. Applications should write their code in anticipation of:
8359    ///
8360    /// - New values appearing in future releases of the client library, **and**
8361    /// - New values received dynamically, without application changes.
8362    ///
8363    /// Please consult the [Working with enums] section in the user guide for some
8364    /// guidelines.
8365    ///
8366    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8367    #[derive(Clone, Debug, PartialEq)]
8368    #[non_exhaustive]
8369    pub enum State {
8370        /// Unspecified replication State
8371        Unspecified,
8372        /// Replication is creating.
8373        Creating,
8374        /// Replication is ready.
8375        Ready,
8376        /// Replication is updating.
8377        Updating,
8378        /// Replication is deleting.
8379        Deleting,
8380        /// Replication is in error state.
8381        Error,
8382        /// Replication is waiting for cluster peering to be established.
8383        PendingClusterPeering,
8384        /// Replication is waiting for SVM peering to be established.
8385        PendingSvmPeering,
8386        /// Replication is waiting for Commands to be executed on Onprem ONTAP.
8387        PendingRemoteResync,
8388        /// Onprem ONTAP is destination and Replication can only be managed from
8389        /// Onprem.
8390        ExternallyManagedReplication,
8391        /// If set, the enum was initialized with an unknown value.
8392        ///
8393        /// Applications can examine the value using [State::value] or
8394        /// [State::name].
8395        UnknownValue(state::UnknownValue),
8396    }
8397
8398    #[doc(hidden)]
8399    pub mod state {
8400        #[allow(unused_imports)]
8401        use super::*;
8402        #[derive(Clone, Debug, PartialEq)]
8403        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8404    }
8405
8406    impl State {
8407        /// Gets the enum value.
8408        ///
8409        /// Returns `None` if the enum contains an unknown value deserialized from
8410        /// the string representation of enums.
8411        pub fn value(&self) -> std::option::Option<i32> {
8412            match self {
8413                Self::Unspecified => std::option::Option::Some(0),
8414                Self::Creating => std::option::Option::Some(1),
8415                Self::Ready => std::option::Option::Some(2),
8416                Self::Updating => std::option::Option::Some(3),
8417                Self::Deleting => std::option::Option::Some(5),
8418                Self::Error => std::option::Option::Some(6),
8419                Self::PendingClusterPeering => std::option::Option::Some(8),
8420                Self::PendingSvmPeering => std::option::Option::Some(9),
8421                Self::PendingRemoteResync => std::option::Option::Some(10),
8422                Self::ExternallyManagedReplication => std::option::Option::Some(11),
8423                Self::UnknownValue(u) => u.0.value(),
8424            }
8425        }
8426
8427        /// Gets the enum value as a string.
8428        ///
8429        /// Returns `None` if the enum contains an unknown value deserialized from
8430        /// the integer representation of enums.
8431        pub fn name(&self) -> std::option::Option<&str> {
8432            match self {
8433                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8434                Self::Creating => std::option::Option::Some("CREATING"),
8435                Self::Ready => std::option::Option::Some("READY"),
8436                Self::Updating => std::option::Option::Some("UPDATING"),
8437                Self::Deleting => std::option::Option::Some("DELETING"),
8438                Self::Error => std::option::Option::Some("ERROR"),
8439                Self::PendingClusterPeering => std::option::Option::Some("PENDING_CLUSTER_PEERING"),
8440                Self::PendingSvmPeering => std::option::Option::Some("PENDING_SVM_PEERING"),
8441                Self::PendingRemoteResync => std::option::Option::Some("PENDING_REMOTE_RESYNC"),
8442                Self::ExternallyManagedReplication => {
8443                    std::option::Option::Some("EXTERNALLY_MANAGED_REPLICATION")
8444                }
8445                Self::UnknownValue(u) => u.0.name(),
8446            }
8447        }
8448    }
8449
8450    impl std::default::Default for State {
8451        fn default() -> Self {
8452            use std::convert::From;
8453            Self::from(0)
8454        }
8455    }
8456
8457    impl std::fmt::Display for State {
8458        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8459            wkt::internal::display_enum(f, self.name(), self.value())
8460        }
8461    }
8462
8463    impl std::convert::From<i32> for State {
8464        fn from(value: i32) -> Self {
8465            match value {
8466                0 => Self::Unspecified,
8467                1 => Self::Creating,
8468                2 => Self::Ready,
8469                3 => Self::Updating,
8470                5 => Self::Deleting,
8471                6 => Self::Error,
8472                8 => Self::PendingClusterPeering,
8473                9 => Self::PendingSvmPeering,
8474                10 => Self::PendingRemoteResync,
8475                11 => Self::ExternallyManagedReplication,
8476                _ => Self::UnknownValue(state::UnknownValue(
8477                    wkt::internal::UnknownEnumValue::Integer(value),
8478                )),
8479            }
8480        }
8481    }
8482
8483    impl std::convert::From<&str> for State {
8484        fn from(value: &str) -> Self {
8485            use std::string::ToString;
8486            match value {
8487                "STATE_UNSPECIFIED" => Self::Unspecified,
8488                "CREATING" => Self::Creating,
8489                "READY" => Self::Ready,
8490                "UPDATING" => Self::Updating,
8491                "DELETING" => Self::Deleting,
8492                "ERROR" => Self::Error,
8493                "PENDING_CLUSTER_PEERING" => Self::PendingClusterPeering,
8494                "PENDING_SVM_PEERING" => Self::PendingSvmPeering,
8495                "PENDING_REMOTE_RESYNC" => Self::PendingRemoteResync,
8496                "EXTERNALLY_MANAGED_REPLICATION" => Self::ExternallyManagedReplication,
8497                _ => Self::UnknownValue(state::UnknownValue(
8498                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8499                )),
8500            }
8501        }
8502    }
8503
8504    impl serde::ser::Serialize for State {
8505        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8506        where
8507            S: serde::Serializer,
8508        {
8509            match self {
8510                Self::Unspecified => serializer.serialize_i32(0),
8511                Self::Creating => serializer.serialize_i32(1),
8512                Self::Ready => serializer.serialize_i32(2),
8513                Self::Updating => serializer.serialize_i32(3),
8514                Self::Deleting => serializer.serialize_i32(5),
8515                Self::Error => serializer.serialize_i32(6),
8516                Self::PendingClusterPeering => serializer.serialize_i32(8),
8517                Self::PendingSvmPeering => serializer.serialize_i32(9),
8518                Self::PendingRemoteResync => serializer.serialize_i32(10),
8519                Self::ExternallyManagedReplication => serializer.serialize_i32(11),
8520                Self::UnknownValue(u) => u.0.serialize(serializer),
8521            }
8522        }
8523    }
8524
8525    impl<'de> serde::de::Deserialize<'de> for State {
8526        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8527        where
8528            D: serde::Deserializer<'de>,
8529        {
8530            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8531                ".google.cloud.netapp.v1.Replication.State",
8532            ))
8533        }
8534    }
8535
8536    /// New enum values may be added in future to support different replication
8537    /// topology.
8538    ///
8539    /// # Working with unknown values
8540    ///
8541    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8542    /// additional enum variants at any time. Adding new variants is not considered
8543    /// a breaking change. Applications should write their code in anticipation of:
8544    ///
8545    /// - New values appearing in future releases of the client library, **and**
8546    /// - New values received dynamically, without application changes.
8547    ///
8548    /// Please consult the [Working with enums] section in the user guide for some
8549    /// guidelines.
8550    ///
8551    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8552    #[derive(Clone, Debug, PartialEq)]
8553    #[non_exhaustive]
8554    pub enum ReplicationRole {
8555        /// Unspecified replication role
8556        Unspecified,
8557        /// Indicates Source volume.
8558        Source,
8559        /// Indicates Destination volume.
8560        Destination,
8561        /// If set, the enum was initialized with an unknown value.
8562        ///
8563        /// Applications can examine the value using [ReplicationRole::value] or
8564        /// [ReplicationRole::name].
8565        UnknownValue(replication_role::UnknownValue),
8566    }
8567
8568    #[doc(hidden)]
8569    pub mod replication_role {
8570        #[allow(unused_imports)]
8571        use super::*;
8572        #[derive(Clone, Debug, PartialEq)]
8573        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8574    }
8575
8576    impl ReplicationRole {
8577        /// Gets the enum value.
8578        ///
8579        /// Returns `None` if the enum contains an unknown value deserialized from
8580        /// the string representation of enums.
8581        pub fn value(&self) -> std::option::Option<i32> {
8582            match self {
8583                Self::Unspecified => std::option::Option::Some(0),
8584                Self::Source => std::option::Option::Some(1),
8585                Self::Destination => std::option::Option::Some(2),
8586                Self::UnknownValue(u) => u.0.value(),
8587            }
8588        }
8589
8590        /// Gets the enum value as a string.
8591        ///
8592        /// Returns `None` if the enum contains an unknown value deserialized from
8593        /// the integer representation of enums.
8594        pub fn name(&self) -> std::option::Option<&str> {
8595            match self {
8596                Self::Unspecified => std::option::Option::Some("REPLICATION_ROLE_UNSPECIFIED"),
8597                Self::Source => std::option::Option::Some("SOURCE"),
8598                Self::Destination => std::option::Option::Some("DESTINATION"),
8599                Self::UnknownValue(u) => u.0.name(),
8600            }
8601        }
8602    }
8603
8604    impl std::default::Default for ReplicationRole {
8605        fn default() -> Self {
8606            use std::convert::From;
8607            Self::from(0)
8608        }
8609    }
8610
8611    impl std::fmt::Display for ReplicationRole {
8612        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8613            wkt::internal::display_enum(f, self.name(), self.value())
8614        }
8615    }
8616
8617    impl std::convert::From<i32> for ReplicationRole {
8618        fn from(value: i32) -> Self {
8619            match value {
8620                0 => Self::Unspecified,
8621                1 => Self::Source,
8622                2 => Self::Destination,
8623                _ => Self::UnknownValue(replication_role::UnknownValue(
8624                    wkt::internal::UnknownEnumValue::Integer(value),
8625                )),
8626            }
8627        }
8628    }
8629
8630    impl std::convert::From<&str> for ReplicationRole {
8631        fn from(value: &str) -> Self {
8632            use std::string::ToString;
8633            match value {
8634                "REPLICATION_ROLE_UNSPECIFIED" => Self::Unspecified,
8635                "SOURCE" => Self::Source,
8636                "DESTINATION" => Self::Destination,
8637                _ => Self::UnknownValue(replication_role::UnknownValue(
8638                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8639                )),
8640            }
8641        }
8642    }
8643
8644    impl serde::ser::Serialize for ReplicationRole {
8645        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8646        where
8647            S: serde::Serializer,
8648        {
8649            match self {
8650                Self::Unspecified => serializer.serialize_i32(0),
8651                Self::Source => serializer.serialize_i32(1),
8652                Self::Destination => serializer.serialize_i32(2),
8653                Self::UnknownValue(u) => u.0.serialize(serializer),
8654            }
8655        }
8656    }
8657
8658    impl<'de> serde::de::Deserialize<'de> for ReplicationRole {
8659        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8660        where
8661            D: serde::Deserializer<'de>,
8662        {
8663            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicationRole>::new(
8664                ".google.cloud.netapp.v1.Replication.ReplicationRole",
8665            ))
8666        }
8667    }
8668
8669    /// Schedule for Replication.
8670    /// New enum values may be added in future to support different frequency of
8671    /// replication.
8672    ///
8673    /// # Working with unknown values
8674    ///
8675    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8676    /// additional enum variants at any time. Adding new variants is not considered
8677    /// a breaking change. Applications should write their code in anticipation of:
8678    ///
8679    /// - New values appearing in future releases of the client library, **and**
8680    /// - New values received dynamically, without application changes.
8681    ///
8682    /// Please consult the [Working with enums] section in the user guide for some
8683    /// guidelines.
8684    ///
8685    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8686    #[derive(Clone, Debug, PartialEq)]
8687    #[non_exhaustive]
8688    pub enum ReplicationSchedule {
8689        /// Unspecified ReplicationSchedule
8690        Unspecified,
8691        /// Replication happens once every 10 minutes.
8692        Every10Minutes,
8693        /// Replication happens once every hour.
8694        Hourly,
8695        /// Replication happens once every day.
8696        Daily,
8697        /// If set, the enum was initialized with an unknown value.
8698        ///
8699        /// Applications can examine the value using [ReplicationSchedule::value] or
8700        /// [ReplicationSchedule::name].
8701        UnknownValue(replication_schedule::UnknownValue),
8702    }
8703
8704    #[doc(hidden)]
8705    pub mod replication_schedule {
8706        #[allow(unused_imports)]
8707        use super::*;
8708        #[derive(Clone, Debug, PartialEq)]
8709        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8710    }
8711
8712    impl ReplicationSchedule {
8713        /// Gets the enum value.
8714        ///
8715        /// Returns `None` if the enum contains an unknown value deserialized from
8716        /// the string representation of enums.
8717        pub fn value(&self) -> std::option::Option<i32> {
8718            match self {
8719                Self::Unspecified => std::option::Option::Some(0),
8720                Self::Every10Minutes => std::option::Option::Some(1),
8721                Self::Hourly => std::option::Option::Some(2),
8722                Self::Daily => std::option::Option::Some(3),
8723                Self::UnknownValue(u) => u.0.value(),
8724            }
8725        }
8726
8727        /// Gets the enum value as a string.
8728        ///
8729        /// Returns `None` if the enum contains an unknown value deserialized from
8730        /// the integer representation of enums.
8731        pub fn name(&self) -> std::option::Option<&str> {
8732            match self {
8733                Self::Unspecified => std::option::Option::Some("REPLICATION_SCHEDULE_UNSPECIFIED"),
8734                Self::Every10Minutes => std::option::Option::Some("EVERY_10_MINUTES"),
8735                Self::Hourly => std::option::Option::Some("HOURLY"),
8736                Self::Daily => std::option::Option::Some("DAILY"),
8737                Self::UnknownValue(u) => u.0.name(),
8738            }
8739        }
8740    }
8741
8742    impl std::default::Default for ReplicationSchedule {
8743        fn default() -> Self {
8744            use std::convert::From;
8745            Self::from(0)
8746        }
8747    }
8748
8749    impl std::fmt::Display for ReplicationSchedule {
8750        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8751            wkt::internal::display_enum(f, self.name(), self.value())
8752        }
8753    }
8754
8755    impl std::convert::From<i32> for ReplicationSchedule {
8756        fn from(value: i32) -> Self {
8757            match value {
8758                0 => Self::Unspecified,
8759                1 => Self::Every10Minutes,
8760                2 => Self::Hourly,
8761                3 => Self::Daily,
8762                _ => Self::UnknownValue(replication_schedule::UnknownValue(
8763                    wkt::internal::UnknownEnumValue::Integer(value),
8764                )),
8765            }
8766        }
8767    }
8768
8769    impl std::convert::From<&str> for ReplicationSchedule {
8770        fn from(value: &str) -> Self {
8771            use std::string::ToString;
8772            match value {
8773                "REPLICATION_SCHEDULE_UNSPECIFIED" => Self::Unspecified,
8774                "EVERY_10_MINUTES" => Self::Every10Minutes,
8775                "HOURLY" => Self::Hourly,
8776                "DAILY" => Self::Daily,
8777                _ => Self::UnknownValue(replication_schedule::UnknownValue(
8778                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8779                )),
8780            }
8781        }
8782    }
8783
8784    impl serde::ser::Serialize for ReplicationSchedule {
8785        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8786        where
8787            S: serde::Serializer,
8788        {
8789            match self {
8790                Self::Unspecified => serializer.serialize_i32(0),
8791                Self::Every10Minutes => serializer.serialize_i32(1),
8792                Self::Hourly => serializer.serialize_i32(2),
8793                Self::Daily => serializer.serialize_i32(3),
8794                Self::UnknownValue(u) => u.0.serialize(serializer),
8795            }
8796        }
8797    }
8798
8799    impl<'de> serde::de::Deserialize<'de> for ReplicationSchedule {
8800        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8801        where
8802            D: serde::Deserializer<'de>,
8803        {
8804            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicationSchedule>::new(
8805                ".google.cloud.netapp.v1.Replication.ReplicationSchedule",
8806            ))
8807        }
8808    }
8809
8810    /// Mirroring states.
8811    /// No new value is expected to be added in future.
8812    ///
8813    /// # Working with unknown values
8814    ///
8815    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8816    /// additional enum variants at any time. Adding new variants is not considered
8817    /// a breaking change. Applications should write their code in anticipation of:
8818    ///
8819    /// - New values appearing in future releases of the client library, **and**
8820    /// - New values received dynamically, without application changes.
8821    ///
8822    /// Please consult the [Working with enums] section in the user guide for some
8823    /// guidelines.
8824    ///
8825    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8826    #[derive(Clone, Debug, PartialEq)]
8827    #[non_exhaustive]
8828    pub enum MirrorState {
8829        /// Unspecified MirrorState
8830        Unspecified,
8831        /// Destination volume is being prepared.
8832        Preparing,
8833        /// Destination volume has been initialized and is ready to receive
8834        /// replication transfers.
8835        Mirrored,
8836        /// Destination volume is not receiving replication transfers.
8837        Stopped,
8838        /// Incremental replication is in progress.
8839        Transferring,
8840        /// Baseline replication is in progress.
8841        BaselineTransferring,
8842        /// Replication is aborted.
8843        Aborted,
8844        /// Replication is being managed from Onprem ONTAP.
8845        ExternallyManaged,
8846        /// Peering is yet to be established.
8847        PendingPeering,
8848        /// If set, the enum was initialized with an unknown value.
8849        ///
8850        /// Applications can examine the value using [MirrorState::value] or
8851        /// [MirrorState::name].
8852        UnknownValue(mirror_state::UnknownValue),
8853    }
8854
8855    #[doc(hidden)]
8856    pub mod mirror_state {
8857        #[allow(unused_imports)]
8858        use super::*;
8859        #[derive(Clone, Debug, PartialEq)]
8860        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8861    }
8862
8863    impl MirrorState {
8864        /// Gets the enum value.
8865        ///
8866        /// Returns `None` if the enum contains an unknown value deserialized from
8867        /// the string representation of enums.
8868        pub fn value(&self) -> std::option::Option<i32> {
8869            match self {
8870                Self::Unspecified => std::option::Option::Some(0),
8871                Self::Preparing => std::option::Option::Some(1),
8872                Self::Mirrored => std::option::Option::Some(2),
8873                Self::Stopped => std::option::Option::Some(3),
8874                Self::Transferring => std::option::Option::Some(4),
8875                Self::BaselineTransferring => std::option::Option::Some(5),
8876                Self::Aborted => std::option::Option::Some(6),
8877                Self::ExternallyManaged => std::option::Option::Some(7),
8878                Self::PendingPeering => std::option::Option::Some(8),
8879                Self::UnknownValue(u) => u.0.value(),
8880            }
8881        }
8882
8883        /// Gets the enum value as a string.
8884        ///
8885        /// Returns `None` if the enum contains an unknown value deserialized from
8886        /// the integer representation of enums.
8887        pub fn name(&self) -> std::option::Option<&str> {
8888            match self {
8889                Self::Unspecified => std::option::Option::Some("MIRROR_STATE_UNSPECIFIED"),
8890                Self::Preparing => std::option::Option::Some("PREPARING"),
8891                Self::Mirrored => std::option::Option::Some("MIRRORED"),
8892                Self::Stopped => std::option::Option::Some("STOPPED"),
8893                Self::Transferring => std::option::Option::Some("TRANSFERRING"),
8894                Self::BaselineTransferring => std::option::Option::Some("BASELINE_TRANSFERRING"),
8895                Self::Aborted => std::option::Option::Some("ABORTED"),
8896                Self::ExternallyManaged => std::option::Option::Some("EXTERNALLY_MANAGED"),
8897                Self::PendingPeering => std::option::Option::Some("PENDING_PEERING"),
8898                Self::UnknownValue(u) => u.0.name(),
8899            }
8900        }
8901    }
8902
8903    impl std::default::Default for MirrorState {
8904        fn default() -> Self {
8905            use std::convert::From;
8906            Self::from(0)
8907        }
8908    }
8909
8910    impl std::fmt::Display for MirrorState {
8911        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8912            wkt::internal::display_enum(f, self.name(), self.value())
8913        }
8914    }
8915
8916    impl std::convert::From<i32> for MirrorState {
8917        fn from(value: i32) -> Self {
8918            match value {
8919                0 => Self::Unspecified,
8920                1 => Self::Preparing,
8921                2 => Self::Mirrored,
8922                3 => Self::Stopped,
8923                4 => Self::Transferring,
8924                5 => Self::BaselineTransferring,
8925                6 => Self::Aborted,
8926                7 => Self::ExternallyManaged,
8927                8 => Self::PendingPeering,
8928                _ => Self::UnknownValue(mirror_state::UnknownValue(
8929                    wkt::internal::UnknownEnumValue::Integer(value),
8930                )),
8931            }
8932        }
8933    }
8934
8935    impl std::convert::From<&str> for MirrorState {
8936        fn from(value: &str) -> Self {
8937            use std::string::ToString;
8938            match value {
8939                "MIRROR_STATE_UNSPECIFIED" => Self::Unspecified,
8940                "PREPARING" => Self::Preparing,
8941                "MIRRORED" => Self::Mirrored,
8942                "STOPPED" => Self::Stopped,
8943                "TRANSFERRING" => Self::Transferring,
8944                "BASELINE_TRANSFERRING" => Self::BaselineTransferring,
8945                "ABORTED" => Self::Aborted,
8946                "EXTERNALLY_MANAGED" => Self::ExternallyManaged,
8947                "PENDING_PEERING" => Self::PendingPeering,
8948                _ => Self::UnknownValue(mirror_state::UnknownValue(
8949                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8950                )),
8951            }
8952        }
8953    }
8954
8955    impl serde::ser::Serialize for MirrorState {
8956        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8957        where
8958            S: serde::Serializer,
8959        {
8960            match self {
8961                Self::Unspecified => serializer.serialize_i32(0),
8962                Self::Preparing => serializer.serialize_i32(1),
8963                Self::Mirrored => serializer.serialize_i32(2),
8964                Self::Stopped => serializer.serialize_i32(3),
8965                Self::Transferring => serializer.serialize_i32(4),
8966                Self::BaselineTransferring => serializer.serialize_i32(5),
8967                Self::Aborted => serializer.serialize_i32(6),
8968                Self::ExternallyManaged => serializer.serialize_i32(7),
8969                Self::PendingPeering => serializer.serialize_i32(8),
8970                Self::UnknownValue(u) => u.0.serialize(serializer),
8971            }
8972        }
8973    }
8974
8975    impl<'de> serde::de::Deserialize<'de> for MirrorState {
8976        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8977        where
8978            D: serde::Deserializer<'de>,
8979        {
8980            deserializer.deserialize_any(wkt::internal::EnumVisitor::<MirrorState>::new(
8981                ".google.cloud.netapp.v1.Replication.MirrorState",
8982            ))
8983        }
8984    }
8985
8986    /// Hybrid replication type.
8987    ///
8988    /// # Working with unknown values
8989    ///
8990    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8991    /// additional enum variants at any time. Adding new variants is not considered
8992    /// a breaking change. Applications should write their code in anticipation of:
8993    ///
8994    /// - New values appearing in future releases of the client library, **and**
8995    /// - New values received dynamically, without application changes.
8996    ///
8997    /// Please consult the [Working with enums] section in the user guide for some
8998    /// guidelines.
8999    ///
9000    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9001    #[derive(Clone, Debug, PartialEq)]
9002    #[non_exhaustive]
9003    pub enum HybridReplicationType {
9004        /// Unspecified hybrid replication type.
9005        Unspecified,
9006        /// Hybrid replication type for migration.
9007        Migration,
9008        /// Hybrid replication type for continuous replication.
9009        ContinuousReplication,
9010        /// New field for reversible OnPrem replication, to be used for data
9011        /// protection.
9012        OnpremReplication,
9013        /// Hybrid replication type for incremental Transfer in the reverse direction
9014        /// (GCNV is source and Onprem is destination)
9015        ReverseOnpremReplication,
9016        /// If set, the enum was initialized with an unknown value.
9017        ///
9018        /// Applications can examine the value using [HybridReplicationType::value] or
9019        /// [HybridReplicationType::name].
9020        UnknownValue(hybrid_replication_type::UnknownValue),
9021    }
9022
9023    #[doc(hidden)]
9024    pub mod hybrid_replication_type {
9025        #[allow(unused_imports)]
9026        use super::*;
9027        #[derive(Clone, Debug, PartialEq)]
9028        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9029    }
9030
9031    impl HybridReplicationType {
9032        /// Gets the enum value.
9033        ///
9034        /// Returns `None` if the enum contains an unknown value deserialized from
9035        /// the string representation of enums.
9036        pub fn value(&self) -> std::option::Option<i32> {
9037            match self {
9038                Self::Unspecified => std::option::Option::Some(0),
9039                Self::Migration => std::option::Option::Some(1),
9040                Self::ContinuousReplication => std::option::Option::Some(2),
9041                Self::OnpremReplication => std::option::Option::Some(3),
9042                Self::ReverseOnpremReplication => std::option::Option::Some(4),
9043                Self::UnknownValue(u) => u.0.value(),
9044            }
9045        }
9046
9047        /// Gets the enum value as a string.
9048        ///
9049        /// Returns `None` if the enum contains an unknown value deserialized from
9050        /// the integer representation of enums.
9051        pub fn name(&self) -> std::option::Option<&str> {
9052            match self {
9053                Self::Unspecified => {
9054                    std::option::Option::Some("HYBRID_REPLICATION_TYPE_UNSPECIFIED")
9055                }
9056                Self::Migration => std::option::Option::Some("MIGRATION"),
9057                Self::ContinuousReplication => std::option::Option::Some("CONTINUOUS_REPLICATION"),
9058                Self::OnpremReplication => std::option::Option::Some("ONPREM_REPLICATION"),
9059                Self::ReverseOnpremReplication => {
9060                    std::option::Option::Some("REVERSE_ONPREM_REPLICATION")
9061                }
9062                Self::UnknownValue(u) => u.0.name(),
9063            }
9064        }
9065    }
9066
9067    impl std::default::Default for HybridReplicationType {
9068        fn default() -> Self {
9069            use std::convert::From;
9070            Self::from(0)
9071        }
9072    }
9073
9074    impl std::fmt::Display for HybridReplicationType {
9075        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9076            wkt::internal::display_enum(f, self.name(), self.value())
9077        }
9078    }
9079
9080    impl std::convert::From<i32> for HybridReplicationType {
9081        fn from(value: i32) -> Self {
9082            match value {
9083                0 => Self::Unspecified,
9084                1 => Self::Migration,
9085                2 => Self::ContinuousReplication,
9086                3 => Self::OnpremReplication,
9087                4 => Self::ReverseOnpremReplication,
9088                _ => Self::UnknownValue(hybrid_replication_type::UnknownValue(
9089                    wkt::internal::UnknownEnumValue::Integer(value),
9090                )),
9091            }
9092        }
9093    }
9094
9095    impl std::convert::From<&str> for HybridReplicationType {
9096        fn from(value: &str) -> Self {
9097            use std::string::ToString;
9098            match value {
9099                "HYBRID_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
9100                "MIGRATION" => Self::Migration,
9101                "CONTINUOUS_REPLICATION" => Self::ContinuousReplication,
9102                "ONPREM_REPLICATION" => Self::OnpremReplication,
9103                "REVERSE_ONPREM_REPLICATION" => Self::ReverseOnpremReplication,
9104                _ => Self::UnknownValue(hybrid_replication_type::UnknownValue(
9105                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9106                )),
9107            }
9108        }
9109    }
9110
9111    impl serde::ser::Serialize for HybridReplicationType {
9112        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9113        where
9114            S: serde::Serializer,
9115        {
9116            match self {
9117                Self::Unspecified => serializer.serialize_i32(0),
9118                Self::Migration => serializer.serialize_i32(1),
9119                Self::ContinuousReplication => serializer.serialize_i32(2),
9120                Self::OnpremReplication => serializer.serialize_i32(3),
9121                Self::ReverseOnpremReplication => serializer.serialize_i32(4),
9122                Self::UnknownValue(u) => u.0.serialize(serializer),
9123            }
9124        }
9125    }
9126
9127    impl<'de> serde::de::Deserialize<'de> for HybridReplicationType {
9128        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9129        where
9130            D: serde::Deserializer<'de>,
9131        {
9132            deserializer.deserialize_any(wkt::internal::EnumVisitor::<HybridReplicationType>::new(
9133                ".google.cloud.netapp.v1.Replication.HybridReplicationType",
9134            ))
9135        }
9136    }
9137}
9138
9139/// HybridPeeringDetails contains details about the hybrid peering.
9140#[derive(Clone, Default, PartialEq)]
9141#[non_exhaustive]
9142pub struct HybridPeeringDetails {
9143    /// Output only. IP address of the subnet.
9144    pub subnet_ip: std::string::String,
9145
9146    /// Output only. Copy-paste-able commands to be used on user's ONTAP to accept
9147    /// peering requests.
9148    pub command: std::string::String,
9149
9150    /// Output only. Expiration time for the peering command to be executed on
9151    /// user's ONTAP.
9152    pub command_expiry_time: std::option::Option<wkt::Timestamp>,
9153
9154    /// Output only. Temporary passphrase generated to accept cluster peering
9155    /// command.
9156    pub passphrase: std::string::String,
9157
9158    /// Output only. Name of the user's local source volume to be peered with the
9159    /// destination volume.
9160    pub peer_volume_name: std::string::String,
9161
9162    /// Output only. Name of the user's local source cluster to be peered with the
9163    /// destination cluster.
9164    pub peer_cluster_name: std::string::String,
9165
9166    /// Output only. Name of the user's local source vserver svm to be peered with
9167    /// the destination vserver svm.
9168    pub peer_svm_name: std::string::String,
9169
9170    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9171}
9172
9173impl HybridPeeringDetails {
9174    pub fn new() -> Self {
9175        std::default::Default::default()
9176    }
9177
9178    /// Sets the value of [subnet_ip][crate::model::HybridPeeringDetails::subnet_ip].
9179    ///
9180    /// # Example
9181    /// ```ignore,no_run
9182    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9183    /// let x = HybridPeeringDetails::new().set_subnet_ip("example");
9184    /// ```
9185    pub fn set_subnet_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9186        self.subnet_ip = v.into();
9187        self
9188    }
9189
9190    /// Sets the value of [command][crate::model::HybridPeeringDetails::command].
9191    ///
9192    /// # Example
9193    /// ```ignore,no_run
9194    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9195    /// let x = HybridPeeringDetails::new().set_command("example");
9196    /// ```
9197    pub fn set_command<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9198        self.command = v.into();
9199        self
9200    }
9201
9202    /// Sets the value of [command_expiry_time][crate::model::HybridPeeringDetails::command_expiry_time].
9203    ///
9204    /// # Example
9205    /// ```ignore,no_run
9206    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9207    /// use wkt::Timestamp;
9208    /// let x = HybridPeeringDetails::new().set_command_expiry_time(Timestamp::default()/* use setters */);
9209    /// ```
9210    pub fn set_command_expiry_time<T>(mut self, v: T) -> Self
9211    where
9212        T: std::convert::Into<wkt::Timestamp>,
9213    {
9214        self.command_expiry_time = std::option::Option::Some(v.into());
9215        self
9216    }
9217
9218    /// Sets or clears the value of [command_expiry_time][crate::model::HybridPeeringDetails::command_expiry_time].
9219    ///
9220    /// # Example
9221    /// ```ignore,no_run
9222    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9223    /// use wkt::Timestamp;
9224    /// let x = HybridPeeringDetails::new().set_or_clear_command_expiry_time(Some(Timestamp::default()/* use setters */));
9225    /// let x = HybridPeeringDetails::new().set_or_clear_command_expiry_time(None::<Timestamp>);
9226    /// ```
9227    pub fn set_or_clear_command_expiry_time<T>(mut self, v: std::option::Option<T>) -> Self
9228    where
9229        T: std::convert::Into<wkt::Timestamp>,
9230    {
9231        self.command_expiry_time = v.map(|x| x.into());
9232        self
9233    }
9234
9235    /// Sets the value of [passphrase][crate::model::HybridPeeringDetails::passphrase].
9236    ///
9237    /// # Example
9238    /// ```ignore,no_run
9239    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9240    /// let x = HybridPeeringDetails::new().set_passphrase("example");
9241    /// ```
9242    pub fn set_passphrase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9243        self.passphrase = v.into();
9244        self
9245    }
9246
9247    /// Sets the value of [peer_volume_name][crate::model::HybridPeeringDetails::peer_volume_name].
9248    ///
9249    /// # Example
9250    /// ```ignore,no_run
9251    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9252    /// let x = HybridPeeringDetails::new().set_peer_volume_name("example");
9253    /// ```
9254    pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
9255        mut self,
9256        v: T,
9257    ) -> Self {
9258        self.peer_volume_name = v.into();
9259        self
9260    }
9261
9262    /// Sets the value of [peer_cluster_name][crate::model::HybridPeeringDetails::peer_cluster_name].
9263    ///
9264    /// # Example
9265    /// ```ignore,no_run
9266    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9267    /// let x = HybridPeeringDetails::new().set_peer_cluster_name("example");
9268    /// ```
9269    pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
9270        mut self,
9271        v: T,
9272    ) -> Self {
9273        self.peer_cluster_name = v.into();
9274        self
9275    }
9276
9277    /// Sets the value of [peer_svm_name][crate::model::HybridPeeringDetails::peer_svm_name].
9278    ///
9279    /// # Example
9280    /// ```ignore,no_run
9281    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9282    /// let x = HybridPeeringDetails::new().set_peer_svm_name("example");
9283    /// ```
9284    pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9285        self.peer_svm_name = v.into();
9286        self
9287    }
9288}
9289
9290impl wkt::message::Message for HybridPeeringDetails {
9291    fn typename() -> &'static str {
9292        "type.googleapis.com/google.cloud.netapp.v1.HybridPeeringDetails"
9293    }
9294}
9295
9296/// ListReplications lists replications.
9297#[derive(Clone, Default, PartialEq)]
9298#[non_exhaustive]
9299pub struct ListReplicationsRequest {
9300    /// Required. The volume for which to retrieve replication information,
9301    /// in the format
9302    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`.
9303    pub parent: std::string::String,
9304
9305    /// The maximum number of items to return.
9306    pub page_size: i32,
9307
9308    /// The next_page_token value to use if there are additional
9309    /// results to retrieve for this list request.
9310    pub page_token: std::string::String,
9311
9312    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
9313    pub order_by: std::string::String,
9314
9315    /// List filter.
9316    pub filter: std::string::String,
9317
9318    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9319}
9320
9321impl ListReplicationsRequest {
9322    pub fn new() -> Self {
9323        std::default::Default::default()
9324    }
9325
9326    /// Sets the value of [parent][crate::model::ListReplicationsRequest::parent].
9327    ///
9328    /// # Example
9329    /// ```ignore,no_run
9330    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9331    /// let x = ListReplicationsRequest::new().set_parent("example");
9332    /// ```
9333    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9334        self.parent = v.into();
9335        self
9336    }
9337
9338    /// Sets the value of [page_size][crate::model::ListReplicationsRequest::page_size].
9339    ///
9340    /// # Example
9341    /// ```ignore,no_run
9342    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9343    /// let x = ListReplicationsRequest::new().set_page_size(42);
9344    /// ```
9345    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9346        self.page_size = v.into();
9347        self
9348    }
9349
9350    /// Sets the value of [page_token][crate::model::ListReplicationsRequest::page_token].
9351    ///
9352    /// # Example
9353    /// ```ignore,no_run
9354    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9355    /// let x = ListReplicationsRequest::new().set_page_token("example");
9356    /// ```
9357    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9358        self.page_token = v.into();
9359        self
9360    }
9361
9362    /// Sets the value of [order_by][crate::model::ListReplicationsRequest::order_by].
9363    ///
9364    /// # Example
9365    /// ```ignore,no_run
9366    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9367    /// let x = ListReplicationsRequest::new().set_order_by("example");
9368    /// ```
9369    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9370        self.order_by = v.into();
9371        self
9372    }
9373
9374    /// Sets the value of [filter][crate::model::ListReplicationsRequest::filter].
9375    ///
9376    /// # Example
9377    /// ```ignore,no_run
9378    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9379    /// let x = ListReplicationsRequest::new().set_filter("example");
9380    /// ```
9381    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9382        self.filter = v.into();
9383        self
9384    }
9385}
9386
9387impl wkt::message::Message for ListReplicationsRequest {
9388    fn typename() -> &'static str {
9389        "type.googleapis.com/google.cloud.netapp.v1.ListReplicationsRequest"
9390    }
9391}
9392
9393/// ListReplicationsResponse is the result of ListReplicationsRequest.
9394#[derive(Clone, Default, PartialEq)]
9395#[non_exhaustive]
9396pub struct ListReplicationsResponse {
9397    /// A list of replications in the project for the specified volume.
9398    pub replications: std::vec::Vec<crate::model::Replication>,
9399
9400    /// The token you can use to retrieve the next page of results. Not returned
9401    /// if there are no more results in the list.
9402    pub next_page_token: std::string::String,
9403
9404    /// Locations that could not be reached.
9405    pub unreachable: std::vec::Vec<std::string::String>,
9406
9407    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9408}
9409
9410impl ListReplicationsResponse {
9411    pub fn new() -> Self {
9412        std::default::Default::default()
9413    }
9414
9415    /// Sets the value of [replications][crate::model::ListReplicationsResponse::replications].
9416    ///
9417    /// # Example
9418    /// ```ignore,no_run
9419    /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
9420    /// use google_cloud_netapp_v1::model::Replication;
9421    /// let x = ListReplicationsResponse::new()
9422    ///     .set_replications([
9423    ///         Replication::default()/* use setters */,
9424    ///         Replication::default()/* use (different) setters */,
9425    ///     ]);
9426    /// ```
9427    pub fn set_replications<T, V>(mut self, v: T) -> Self
9428    where
9429        T: std::iter::IntoIterator<Item = V>,
9430        V: std::convert::Into<crate::model::Replication>,
9431    {
9432        use std::iter::Iterator;
9433        self.replications = v.into_iter().map(|i| i.into()).collect();
9434        self
9435    }
9436
9437    /// Sets the value of [next_page_token][crate::model::ListReplicationsResponse::next_page_token].
9438    ///
9439    /// # Example
9440    /// ```ignore,no_run
9441    /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
9442    /// let x = ListReplicationsResponse::new().set_next_page_token("example");
9443    /// ```
9444    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9445        self.next_page_token = v.into();
9446        self
9447    }
9448
9449    /// Sets the value of [unreachable][crate::model::ListReplicationsResponse::unreachable].
9450    ///
9451    /// # Example
9452    /// ```ignore,no_run
9453    /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
9454    /// let x = ListReplicationsResponse::new().set_unreachable(["a", "b", "c"]);
9455    /// ```
9456    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9457    where
9458        T: std::iter::IntoIterator<Item = V>,
9459        V: std::convert::Into<std::string::String>,
9460    {
9461        use std::iter::Iterator;
9462        self.unreachable = v.into_iter().map(|i| i.into()).collect();
9463        self
9464    }
9465}
9466
9467impl wkt::message::Message for ListReplicationsResponse {
9468    fn typename() -> &'static str {
9469        "type.googleapis.com/google.cloud.netapp.v1.ListReplicationsResponse"
9470    }
9471}
9472
9473#[doc(hidden)]
9474impl google_cloud_gax::paginator::internal::PageableResponse for ListReplicationsResponse {
9475    type PageItem = crate::model::Replication;
9476
9477    fn items(self) -> std::vec::Vec<Self::PageItem> {
9478        self.replications
9479    }
9480
9481    fn next_page_token(&self) -> std::string::String {
9482        use std::clone::Clone;
9483        self.next_page_token.clone()
9484    }
9485}
9486
9487/// GetReplicationRequest gets the state of a replication.
9488#[derive(Clone, Default, PartialEq)]
9489#[non_exhaustive]
9490pub struct GetReplicationRequest {
9491    /// Required. The replication resource name, in the format
9492    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}`
9493    pub name: std::string::String,
9494
9495    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9496}
9497
9498impl GetReplicationRequest {
9499    pub fn new() -> Self {
9500        std::default::Default::default()
9501    }
9502
9503    /// Sets the value of [name][crate::model::GetReplicationRequest::name].
9504    ///
9505    /// # Example
9506    /// ```ignore,no_run
9507    /// # use google_cloud_netapp_v1::model::GetReplicationRequest;
9508    /// let x = GetReplicationRequest::new().set_name("example");
9509    /// ```
9510    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9511        self.name = v.into();
9512        self
9513    }
9514}
9515
9516impl wkt::message::Message for GetReplicationRequest {
9517    fn typename() -> &'static str {
9518        "type.googleapis.com/google.cloud.netapp.v1.GetReplicationRequest"
9519    }
9520}
9521
9522/// DestinationVolumeParameters specify input parameters used for creating
9523/// destination volume.
9524#[derive(Clone, Default, PartialEq)]
9525#[non_exhaustive]
9526pub struct DestinationVolumeParameters {
9527    /// Required. Existing destination StoragePool name.
9528    pub storage_pool: std::string::String,
9529
9530    /// Desired destination volume resource id. If not specified, source volume's
9531    /// resource id will be used.
9532    /// This value must start with a lowercase letter followed by up to 62
9533    /// lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
9534    pub volume_id: std::string::String,
9535
9536    /// Destination volume's share name. If not specified, source volume's share
9537    /// name will be used.
9538    pub share_name: std::string::String,
9539
9540    /// Description for the destination volume.
9541    pub description: std::option::Option<std::string::String>,
9542
9543    /// Optional. Tiering policy for the volume.
9544    pub tiering_policy: std::option::Option<crate::model::TieringPolicy>,
9545
9546    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9547}
9548
9549impl DestinationVolumeParameters {
9550    pub fn new() -> Self {
9551        std::default::Default::default()
9552    }
9553
9554    /// Sets the value of [storage_pool][crate::model::DestinationVolumeParameters::storage_pool].
9555    ///
9556    /// # Example
9557    /// ```ignore,no_run
9558    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
9559    /// let x = DestinationVolumeParameters::new().set_storage_pool("example");
9560    /// ```
9561    pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9562        self.storage_pool = v.into();
9563        self
9564    }
9565
9566    /// Sets the value of [volume_id][crate::model::DestinationVolumeParameters::volume_id].
9567    ///
9568    /// # Example
9569    /// ```ignore,no_run
9570    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
9571    /// let x = DestinationVolumeParameters::new().set_volume_id("example");
9572    /// ```
9573    pub fn set_volume_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9574        self.volume_id = v.into();
9575        self
9576    }
9577
9578    /// Sets the value of [share_name][crate::model::DestinationVolumeParameters::share_name].
9579    ///
9580    /// # Example
9581    /// ```ignore,no_run
9582    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
9583    /// let x = DestinationVolumeParameters::new().set_share_name("example");
9584    /// ```
9585    pub fn set_share_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9586        self.share_name = v.into();
9587        self
9588    }
9589
9590    /// Sets the value of [description][crate::model::DestinationVolumeParameters::description].
9591    ///
9592    /// # Example
9593    /// ```ignore,no_run
9594    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
9595    /// let x = DestinationVolumeParameters::new().set_description("example");
9596    /// ```
9597    pub fn set_description<T>(mut self, v: T) -> Self
9598    where
9599        T: std::convert::Into<std::string::String>,
9600    {
9601        self.description = std::option::Option::Some(v.into());
9602        self
9603    }
9604
9605    /// Sets or clears the value of [description][crate::model::DestinationVolumeParameters::description].
9606    ///
9607    /// # Example
9608    /// ```ignore,no_run
9609    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
9610    /// let x = DestinationVolumeParameters::new().set_or_clear_description(Some("example"));
9611    /// let x = DestinationVolumeParameters::new().set_or_clear_description(None::<String>);
9612    /// ```
9613    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
9614    where
9615        T: std::convert::Into<std::string::String>,
9616    {
9617        self.description = v.map(|x| x.into());
9618        self
9619    }
9620
9621    /// Sets the value of [tiering_policy][crate::model::DestinationVolumeParameters::tiering_policy].
9622    ///
9623    /// # Example
9624    /// ```ignore,no_run
9625    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
9626    /// use google_cloud_netapp_v1::model::TieringPolicy;
9627    /// let x = DestinationVolumeParameters::new().set_tiering_policy(TieringPolicy::default()/* use setters */);
9628    /// ```
9629    pub fn set_tiering_policy<T>(mut self, v: T) -> Self
9630    where
9631        T: std::convert::Into<crate::model::TieringPolicy>,
9632    {
9633        self.tiering_policy = std::option::Option::Some(v.into());
9634        self
9635    }
9636
9637    /// Sets or clears the value of [tiering_policy][crate::model::DestinationVolumeParameters::tiering_policy].
9638    ///
9639    /// # Example
9640    /// ```ignore,no_run
9641    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
9642    /// use google_cloud_netapp_v1::model::TieringPolicy;
9643    /// let x = DestinationVolumeParameters::new().set_or_clear_tiering_policy(Some(TieringPolicy::default()/* use setters */));
9644    /// let x = DestinationVolumeParameters::new().set_or_clear_tiering_policy(None::<TieringPolicy>);
9645    /// ```
9646    pub fn set_or_clear_tiering_policy<T>(mut self, v: std::option::Option<T>) -> Self
9647    where
9648        T: std::convert::Into<crate::model::TieringPolicy>,
9649    {
9650        self.tiering_policy = v.map(|x| x.into());
9651        self
9652    }
9653}
9654
9655impl wkt::message::Message for DestinationVolumeParameters {
9656    fn typename() -> &'static str {
9657        "type.googleapis.com/google.cloud.netapp.v1.DestinationVolumeParameters"
9658    }
9659}
9660
9661/// CreateReplicationRequest creates a replication.
9662#[derive(Clone, Default, PartialEq)]
9663#[non_exhaustive]
9664pub struct CreateReplicationRequest {
9665    /// Required. The NetApp volume to create the replications of, in the format
9666    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
9667    pub parent: std::string::String,
9668
9669    /// Required. A replication resource
9670    pub replication: std::option::Option<crate::model::Replication>,
9671
9672    /// Required. ID of the replication to create. Must be unique within the parent
9673    /// resource. Must contain only letters, numbers and hyphen, with the first
9674    /// character a letter, the last a letter or a
9675    /// number, and a 63 character maximum.
9676    pub replication_id: std::string::String,
9677
9678    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9679}
9680
9681impl CreateReplicationRequest {
9682    pub fn new() -> Self {
9683        std::default::Default::default()
9684    }
9685
9686    /// Sets the value of [parent][crate::model::CreateReplicationRequest::parent].
9687    ///
9688    /// # Example
9689    /// ```ignore,no_run
9690    /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
9691    /// let x = CreateReplicationRequest::new().set_parent("example");
9692    /// ```
9693    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9694        self.parent = v.into();
9695        self
9696    }
9697
9698    /// Sets the value of [replication][crate::model::CreateReplicationRequest::replication].
9699    ///
9700    /// # Example
9701    /// ```ignore,no_run
9702    /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
9703    /// use google_cloud_netapp_v1::model::Replication;
9704    /// let x = CreateReplicationRequest::new().set_replication(Replication::default()/* use setters */);
9705    /// ```
9706    pub fn set_replication<T>(mut self, v: T) -> Self
9707    where
9708        T: std::convert::Into<crate::model::Replication>,
9709    {
9710        self.replication = std::option::Option::Some(v.into());
9711        self
9712    }
9713
9714    /// Sets or clears the value of [replication][crate::model::CreateReplicationRequest::replication].
9715    ///
9716    /// # Example
9717    /// ```ignore,no_run
9718    /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
9719    /// use google_cloud_netapp_v1::model::Replication;
9720    /// let x = CreateReplicationRequest::new().set_or_clear_replication(Some(Replication::default()/* use setters */));
9721    /// let x = CreateReplicationRequest::new().set_or_clear_replication(None::<Replication>);
9722    /// ```
9723    pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
9724    where
9725        T: std::convert::Into<crate::model::Replication>,
9726    {
9727        self.replication = v.map(|x| x.into());
9728        self
9729    }
9730
9731    /// Sets the value of [replication_id][crate::model::CreateReplicationRequest::replication_id].
9732    ///
9733    /// # Example
9734    /// ```ignore,no_run
9735    /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
9736    /// let x = CreateReplicationRequest::new().set_replication_id("example");
9737    /// ```
9738    pub fn set_replication_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9739        self.replication_id = v.into();
9740        self
9741    }
9742}
9743
9744impl wkt::message::Message for CreateReplicationRequest {
9745    fn typename() -> &'static str {
9746        "type.googleapis.com/google.cloud.netapp.v1.CreateReplicationRequest"
9747    }
9748}
9749
9750/// DeleteReplicationRequest deletes a replication.
9751#[derive(Clone, Default, PartialEq)]
9752#[non_exhaustive]
9753pub struct DeleteReplicationRequest {
9754    /// Required. The replication resource name, in the format
9755    /// `projects/*/locations/*/volumes/*/replications/{replication_id}`
9756    pub name: std::string::String,
9757
9758    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9759}
9760
9761impl DeleteReplicationRequest {
9762    pub fn new() -> Self {
9763        std::default::Default::default()
9764    }
9765
9766    /// Sets the value of [name][crate::model::DeleteReplicationRequest::name].
9767    ///
9768    /// # Example
9769    /// ```ignore,no_run
9770    /// # use google_cloud_netapp_v1::model::DeleteReplicationRequest;
9771    /// let x = DeleteReplicationRequest::new().set_name("example");
9772    /// ```
9773    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9774        self.name = v.into();
9775        self
9776    }
9777}
9778
9779impl wkt::message::Message for DeleteReplicationRequest {
9780    fn typename() -> &'static str {
9781        "type.googleapis.com/google.cloud.netapp.v1.DeleteReplicationRequest"
9782    }
9783}
9784
9785/// UpdateReplicationRequest updates description and/or labels for a replication.
9786#[derive(Clone, Default, PartialEq)]
9787#[non_exhaustive]
9788pub struct UpdateReplicationRequest {
9789    /// Required. Mask of fields to update.  At least one path must be supplied in
9790    /// this field.
9791    pub update_mask: std::option::Option<wkt::FieldMask>,
9792
9793    /// Required. A replication resource
9794    pub replication: std::option::Option<crate::model::Replication>,
9795
9796    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9797}
9798
9799impl UpdateReplicationRequest {
9800    pub fn new() -> Self {
9801        std::default::Default::default()
9802    }
9803
9804    /// Sets the value of [update_mask][crate::model::UpdateReplicationRequest::update_mask].
9805    ///
9806    /// # Example
9807    /// ```ignore,no_run
9808    /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
9809    /// use wkt::FieldMask;
9810    /// let x = UpdateReplicationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
9811    /// ```
9812    pub fn set_update_mask<T>(mut self, v: T) -> Self
9813    where
9814        T: std::convert::Into<wkt::FieldMask>,
9815    {
9816        self.update_mask = std::option::Option::Some(v.into());
9817        self
9818    }
9819
9820    /// Sets or clears the value of [update_mask][crate::model::UpdateReplicationRequest::update_mask].
9821    ///
9822    /// # Example
9823    /// ```ignore,no_run
9824    /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
9825    /// use wkt::FieldMask;
9826    /// let x = UpdateReplicationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
9827    /// let x = UpdateReplicationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
9828    /// ```
9829    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9830    where
9831        T: std::convert::Into<wkt::FieldMask>,
9832    {
9833        self.update_mask = v.map(|x| x.into());
9834        self
9835    }
9836
9837    /// Sets the value of [replication][crate::model::UpdateReplicationRequest::replication].
9838    ///
9839    /// # Example
9840    /// ```ignore,no_run
9841    /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
9842    /// use google_cloud_netapp_v1::model::Replication;
9843    /// let x = UpdateReplicationRequest::new().set_replication(Replication::default()/* use setters */);
9844    /// ```
9845    pub fn set_replication<T>(mut self, v: T) -> Self
9846    where
9847        T: std::convert::Into<crate::model::Replication>,
9848    {
9849        self.replication = std::option::Option::Some(v.into());
9850        self
9851    }
9852
9853    /// Sets or clears the value of [replication][crate::model::UpdateReplicationRequest::replication].
9854    ///
9855    /// # Example
9856    /// ```ignore,no_run
9857    /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
9858    /// use google_cloud_netapp_v1::model::Replication;
9859    /// let x = UpdateReplicationRequest::new().set_or_clear_replication(Some(Replication::default()/* use setters */));
9860    /// let x = UpdateReplicationRequest::new().set_or_clear_replication(None::<Replication>);
9861    /// ```
9862    pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
9863    where
9864        T: std::convert::Into<crate::model::Replication>,
9865    {
9866        self.replication = v.map(|x| x.into());
9867        self
9868    }
9869}
9870
9871impl wkt::message::Message for UpdateReplicationRequest {
9872    fn typename() -> &'static str {
9873        "type.googleapis.com/google.cloud.netapp.v1.UpdateReplicationRequest"
9874    }
9875}
9876
9877/// StopReplicationRequest stops a replication until resumed.
9878#[derive(Clone, Default, PartialEq)]
9879#[non_exhaustive]
9880pub struct StopReplicationRequest {
9881    /// Required. The resource name of the replication, in the format of
9882    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
9883    pub name: std::string::String,
9884
9885    /// Indicates whether to stop replication forcefully while data transfer is in
9886    /// progress.
9887    /// Warning! if force is true, this will abort any current transfers
9888    /// and can lead to data loss due to partial transfer.
9889    /// If force is false, stop replication will fail while data transfer is in
9890    /// progress and you will need to retry later.
9891    pub force: bool,
9892
9893    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9894}
9895
9896impl StopReplicationRequest {
9897    pub fn new() -> Self {
9898        std::default::Default::default()
9899    }
9900
9901    /// Sets the value of [name][crate::model::StopReplicationRequest::name].
9902    ///
9903    /// # Example
9904    /// ```ignore,no_run
9905    /// # use google_cloud_netapp_v1::model::StopReplicationRequest;
9906    /// let x = StopReplicationRequest::new().set_name("example");
9907    /// ```
9908    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9909        self.name = v.into();
9910        self
9911    }
9912
9913    /// Sets the value of [force][crate::model::StopReplicationRequest::force].
9914    ///
9915    /// # Example
9916    /// ```ignore,no_run
9917    /// # use google_cloud_netapp_v1::model::StopReplicationRequest;
9918    /// let x = StopReplicationRequest::new().set_force(true);
9919    /// ```
9920    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9921        self.force = v.into();
9922        self
9923    }
9924}
9925
9926impl wkt::message::Message for StopReplicationRequest {
9927    fn typename() -> &'static str {
9928        "type.googleapis.com/google.cloud.netapp.v1.StopReplicationRequest"
9929    }
9930}
9931
9932/// ResumeReplicationRequest resumes a stopped replication.
9933#[derive(Clone, Default, PartialEq)]
9934#[non_exhaustive]
9935pub struct ResumeReplicationRequest {
9936    /// Required. The resource name of the replication, in the format of
9937    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
9938    pub name: std::string::String,
9939
9940    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9941}
9942
9943impl ResumeReplicationRequest {
9944    pub fn new() -> Self {
9945        std::default::Default::default()
9946    }
9947
9948    /// Sets the value of [name][crate::model::ResumeReplicationRequest::name].
9949    ///
9950    /// # Example
9951    /// ```ignore,no_run
9952    /// # use google_cloud_netapp_v1::model::ResumeReplicationRequest;
9953    /// let x = ResumeReplicationRequest::new().set_name("example");
9954    /// ```
9955    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9956        self.name = v.into();
9957        self
9958    }
9959}
9960
9961impl wkt::message::Message for ResumeReplicationRequest {
9962    fn typename() -> &'static str {
9963        "type.googleapis.com/google.cloud.netapp.v1.ResumeReplicationRequest"
9964    }
9965}
9966
9967/// ReverseReplicationDirectionRequest reverses direction of replication. Source
9968/// becomes destination and destination becomes source.
9969#[derive(Clone, Default, PartialEq)]
9970#[non_exhaustive]
9971pub struct ReverseReplicationDirectionRequest {
9972    /// Required. The resource name of the replication, in the format of
9973    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
9974    pub name: std::string::String,
9975
9976    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9977}
9978
9979impl ReverseReplicationDirectionRequest {
9980    pub fn new() -> Self {
9981        std::default::Default::default()
9982    }
9983
9984    /// Sets the value of [name][crate::model::ReverseReplicationDirectionRequest::name].
9985    ///
9986    /// # Example
9987    /// ```ignore,no_run
9988    /// # use google_cloud_netapp_v1::model::ReverseReplicationDirectionRequest;
9989    /// let x = ReverseReplicationDirectionRequest::new().set_name("example");
9990    /// ```
9991    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9992        self.name = v.into();
9993        self
9994    }
9995}
9996
9997impl wkt::message::Message for ReverseReplicationDirectionRequest {
9998    fn typename() -> &'static str {
9999        "type.googleapis.com/google.cloud.netapp.v1.ReverseReplicationDirectionRequest"
10000    }
10001}
10002
10003/// EstablishPeeringRequest establishes cluster and svm peerings between the
10004/// source and the destination replications.
10005#[derive(Clone, Default, PartialEq)]
10006#[non_exhaustive]
10007pub struct EstablishPeeringRequest {
10008    /// Required. The resource name of the replication, in the format of
10009    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10010    pub name: std::string::String,
10011
10012    /// Required. Name of the user's local source cluster to be peered with the
10013    /// destination cluster.
10014    pub peer_cluster_name: std::string::String,
10015
10016    /// Required. Name of the user's local source vserver svm to be peered with the
10017    /// destination vserver svm.
10018    pub peer_svm_name: std::string::String,
10019
10020    /// Optional. List of IPv4 ip addresses to be used for peering.
10021    pub peer_ip_addresses: std::vec::Vec<std::string::String>,
10022
10023    /// Required. Name of the user's local source volume to be peered with the
10024    /// destination volume.
10025    pub peer_volume_name: std::string::String,
10026
10027    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10028}
10029
10030impl EstablishPeeringRequest {
10031    pub fn new() -> Self {
10032        std::default::Default::default()
10033    }
10034
10035    /// Sets the value of [name][crate::model::EstablishPeeringRequest::name].
10036    ///
10037    /// # Example
10038    /// ```ignore,no_run
10039    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10040    /// let x = EstablishPeeringRequest::new().set_name("example");
10041    /// ```
10042    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10043        self.name = v.into();
10044        self
10045    }
10046
10047    /// Sets the value of [peer_cluster_name][crate::model::EstablishPeeringRequest::peer_cluster_name].
10048    ///
10049    /// # Example
10050    /// ```ignore,no_run
10051    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10052    /// let x = EstablishPeeringRequest::new().set_peer_cluster_name("example");
10053    /// ```
10054    pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
10055        mut self,
10056        v: T,
10057    ) -> Self {
10058        self.peer_cluster_name = v.into();
10059        self
10060    }
10061
10062    /// Sets the value of [peer_svm_name][crate::model::EstablishPeeringRequest::peer_svm_name].
10063    ///
10064    /// # Example
10065    /// ```ignore,no_run
10066    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10067    /// let x = EstablishPeeringRequest::new().set_peer_svm_name("example");
10068    /// ```
10069    pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10070        self.peer_svm_name = v.into();
10071        self
10072    }
10073
10074    /// Sets the value of [peer_ip_addresses][crate::model::EstablishPeeringRequest::peer_ip_addresses].
10075    ///
10076    /// # Example
10077    /// ```ignore,no_run
10078    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10079    /// let x = EstablishPeeringRequest::new().set_peer_ip_addresses(["a", "b", "c"]);
10080    /// ```
10081    pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
10082    where
10083        T: std::iter::IntoIterator<Item = V>,
10084        V: std::convert::Into<std::string::String>,
10085    {
10086        use std::iter::Iterator;
10087        self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
10088        self
10089    }
10090
10091    /// Sets the value of [peer_volume_name][crate::model::EstablishPeeringRequest::peer_volume_name].
10092    ///
10093    /// # Example
10094    /// ```ignore,no_run
10095    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10096    /// let x = EstablishPeeringRequest::new().set_peer_volume_name("example");
10097    /// ```
10098    pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
10099        mut self,
10100        v: T,
10101    ) -> Self {
10102        self.peer_volume_name = v.into();
10103        self
10104    }
10105}
10106
10107impl wkt::message::Message for EstablishPeeringRequest {
10108    fn typename() -> &'static str {
10109        "type.googleapis.com/google.cloud.netapp.v1.EstablishPeeringRequest"
10110    }
10111}
10112
10113/// SyncReplicationRequest syncs the replication from source to destination.
10114#[derive(Clone, Default, PartialEq)]
10115#[non_exhaustive]
10116pub struct SyncReplicationRequest {
10117    /// Required. The resource name of the replication, in the format of
10118    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10119    pub name: std::string::String,
10120
10121    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10122}
10123
10124impl SyncReplicationRequest {
10125    pub fn new() -> Self {
10126        std::default::Default::default()
10127    }
10128
10129    /// Sets the value of [name][crate::model::SyncReplicationRequest::name].
10130    ///
10131    /// # Example
10132    /// ```ignore,no_run
10133    /// # use google_cloud_netapp_v1::model::SyncReplicationRequest;
10134    /// let x = SyncReplicationRequest::new().set_name("example");
10135    /// ```
10136    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10137        self.name = v.into();
10138        self
10139    }
10140}
10141
10142impl wkt::message::Message for SyncReplicationRequest {
10143    fn typename() -> &'static str {
10144        "type.googleapis.com/google.cloud.netapp.v1.SyncReplicationRequest"
10145    }
10146}
10147
10148/// ListSnapshotsRequest lists snapshots.
10149#[derive(Clone, Default, PartialEq)]
10150#[non_exhaustive]
10151pub struct ListSnapshotsRequest {
10152    /// Required. The volume for which to retrieve snapshot information,
10153    /// in the format
10154    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`.
10155    pub parent: std::string::String,
10156
10157    /// The maximum number of items to return.
10158    pub page_size: i32,
10159
10160    /// The next_page_token value to use if there are additional
10161    /// results to retrieve for this list request.
10162    pub page_token: std::string::String,
10163
10164    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
10165    pub order_by: std::string::String,
10166
10167    /// List filter.
10168    pub filter: std::string::String,
10169
10170    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10171}
10172
10173impl ListSnapshotsRequest {
10174    pub fn new() -> Self {
10175        std::default::Default::default()
10176    }
10177
10178    /// Sets the value of [parent][crate::model::ListSnapshotsRequest::parent].
10179    ///
10180    /// # Example
10181    /// ```ignore,no_run
10182    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10183    /// let x = ListSnapshotsRequest::new().set_parent("example");
10184    /// ```
10185    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10186        self.parent = v.into();
10187        self
10188    }
10189
10190    /// Sets the value of [page_size][crate::model::ListSnapshotsRequest::page_size].
10191    ///
10192    /// # Example
10193    /// ```ignore,no_run
10194    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10195    /// let x = ListSnapshotsRequest::new().set_page_size(42);
10196    /// ```
10197    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10198        self.page_size = v.into();
10199        self
10200    }
10201
10202    /// Sets the value of [page_token][crate::model::ListSnapshotsRequest::page_token].
10203    ///
10204    /// # Example
10205    /// ```ignore,no_run
10206    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10207    /// let x = ListSnapshotsRequest::new().set_page_token("example");
10208    /// ```
10209    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10210        self.page_token = v.into();
10211        self
10212    }
10213
10214    /// Sets the value of [order_by][crate::model::ListSnapshotsRequest::order_by].
10215    ///
10216    /// # Example
10217    /// ```ignore,no_run
10218    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10219    /// let x = ListSnapshotsRequest::new().set_order_by("example");
10220    /// ```
10221    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10222        self.order_by = v.into();
10223        self
10224    }
10225
10226    /// Sets the value of [filter][crate::model::ListSnapshotsRequest::filter].
10227    ///
10228    /// # Example
10229    /// ```ignore,no_run
10230    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10231    /// let x = ListSnapshotsRequest::new().set_filter("example");
10232    /// ```
10233    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10234        self.filter = v.into();
10235        self
10236    }
10237}
10238
10239impl wkt::message::Message for ListSnapshotsRequest {
10240    fn typename() -> &'static str {
10241        "type.googleapis.com/google.cloud.netapp.v1.ListSnapshotsRequest"
10242    }
10243}
10244
10245/// ListSnapshotsResponse is the result of ListSnapshotsRequest.
10246#[derive(Clone, Default, PartialEq)]
10247#[non_exhaustive]
10248pub struct ListSnapshotsResponse {
10249    /// A list of snapshots in the project for the specified volume.
10250    pub snapshots: std::vec::Vec<crate::model::Snapshot>,
10251
10252    /// The token you can use to retrieve the next page of results. Not returned
10253    /// if there are no more results in the list.
10254    pub next_page_token: std::string::String,
10255
10256    /// Locations that could not be reached.
10257    pub unreachable: std::vec::Vec<std::string::String>,
10258
10259    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10260}
10261
10262impl ListSnapshotsResponse {
10263    pub fn new() -> Self {
10264        std::default::Default::default()
10265    }
10266
10267    /// Sets the value of [snapshots][crate::model::ListSnapshotsResponse::snapshots].
10268    ///
10269    /// # Example
10270    /// ```ignore,no_run
10271    /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
10272    /// use google_cloud_netapp_v1::model::Snapshot;
10273    /// let x = ListSnapshotsResponse::new()
10274    ///     .set_snapshots([
10275    ///         Snapshot::default()/* use setters */,
10276    ///         Snapshot::default()/* use (different) setters */,
10277    ///     ]);
10278    /// ```
10279    pub fn set_snapshots<T, V>(mut self, v: T) -> Self
10280    where
10281        T: std::iter::IntoIterator<Item = V>,
10282        V: std::convert::Into<crate::model::Snapshot>,
10283    {
10284        use std::iter::Iterator;
10285        self.snapshots = v.into_iter().map(|i| i.into()).collect();
10286        self
10287    }
10288
10289    /// Sets the value of [next_page_token][crate::model::ListSnapshotsResponse::next_page_token].
10290    ///
10291    /// # Example
10292    /// ```ignore,no_run
10293    /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
10294    /// let x = ListSnapshotsResponse::new().set_next_page_token("example");
10295    /// ```
10296    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10297        self.next_page_token = v.into();
10298        self
10299    }
10300
10301    /// Sets the value of [unreachable][crate::model::ListSnapshotsResponse::unreachable].
10302    ///
10303    /// # Example
10304    /// ```ignore,no_run
10305    /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
10306    /// let x = ListSnapshotsResponse::new().set_unreachable(["a", "b", "c"]);
10307    /// ```
10308    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10309    where
10310        T: std::iter::IntoIterator<Item = V>,
10311        V: std::convert::Into<std::string::String>,
10312    {
10313        use std::iter::Iterator;
10314        self.unreachable = v.into_iter().map(|i| i.into()).collect();
10315        self
10316    }
10317}
10318
10319impl wkt::message::Message for ListSnapshotsResponse {
10320    fn typename() -> &'static str {
10321        "type.googleapis.com/google.cloud.netapp.v1.ListSnapshotsResponse"
10322    }
10323}
10324
10325#[doc(hidden)]
10326impl google_cloud_gax::paginator::internal::PageableResponse for ListSnapshotsResponse {
10327    type PageItem = crate::model::Snapshot;
10328
10329    fn items(self) -> std::vec::Vec<Self::PageItem> {
10330        self.snapshots
10331    }
10332
10333    fn next_page_token(&self) -> std::string::String {
10334        use std::clone::Clone;
10335        self.next_page_token.clone()
10336    }
10337}
10338
10339/// GetSnapshotRequest gets the state of a snapshot.
10340#[derive(Clone, Default, PartialEq)]
10341#[non_exhaustive]
10342pub struct GetSnapshotRequest {
10343    /// Required. The snapshot resource name, in the format
10344    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`
10345    pub name: std::string::String,
10346
10347    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10348}
10349
10350impl GetSnapshotRequest {
10351    pub fn new() -> Self {
10352        std::default::Default::default()
10353    }
10354
10355    /// Sets the value of [name][crate::model::GetSnapshotRequest::name].
10356    ///
10357    /// # Example
10358    /// ```ignore,no_run
10359    /// # use google_cloud_netapp_v1::model::GetSnapshotRequest;
10360    /// let x = GetSnapshotRequest::new().set_name("example");
10361    /// ```
10362    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10363        self.name = v.into();
10364        self
10365    }
10366}
10367
10368impl wkt::message::Message for GetSnapshotRequest {
10369    fn typename() -> &'static str {
10370        "type.googleapis.com/google.cloud.netapp.v1.GetSnapshotRequest"
10371    }
10372}
10373
10374/// CreateSnapshotRequest creates a snapshot.
10375#[derive(Clone, Default, PartialEq)]
10376#[non_exhaustive]
10377pub struct CreateSnapshotRequest {
10378    /// Required. The NetApp volume to create the snapshots of, in the format
10379    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
10380    pub parent: std::string::String,
10381
10382    /// Required. A snapshot resource
10383    pub snapshot: std::option::Option<crate::model::Snapshot>,
10384
10385    /// Required. ID of the snapshot to create. Must be unique within the parent
10386    /// resource. Must contain only letters, numbers and hyphen, with the first
10387    /// character a letter, the last a letter or a
10388    /// number, and a 63 character maximum.
10389    pub snapshot_id: std::string::String,
10390
10391    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10392}
10393
10394impl CreateSnapshotRequest {
10395    pub fn new() -> Self {
10396        std::default::Default::default()
10397    }
10398
10399    /// Sets the value of [parent][crate::model::CreateSnapshotRequest::parent].
10400    ///
10401    /// # Example
10402    /// ```ignore,no_run
10403    /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
10404    /// let x = CreateSnapshotRequest::new().set_parent("example");
10405    /// ```
10406    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10407        self.parent = v.into();
10408        self
10409    }
10410
10411    /// Sets the value of [snapshot][crate::model::CreateSnapshotRequest::snapshot].
10412    ///
10413    /// # Example
10414    /// ```ignore,no_run
10415    /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
10416    /// use google_cloud_netapp_v1::model::Snapshot;
10417    /// let x = CreateSnapshotRequest::new().set_snapshot(Snapshot::default()/* use setters */);
10418    /// ```
10419    pub fn set_snapshot<T>(mut self, v: T) -> Self
10420    where
10421        T: std::convert::Into<crate::model::Snapshot>,
10422    {
10423        self.snapshot = std::option::Option::Some(v.into());
10424        self
10425    }
10426
10427    /// Sets or clears the value of [snapshot][crate::model::CreateSnapshotRequest::snapshot].
10428    ///
10429    /// # Example
10430    /// ```ignore,no_run
10431    /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
10432    /// use google_cloud_netapp_v1::model::Snapshot;
10433    /// let x = CreateSnapshotRequest::new().set_or_clear_snapshot(Some(Snapshot::default()/* use setters */));
10434    /// let x = CreateSnapshotRequest::new().set_or_clear_snapshot(None::<Snapshot>);
10435    /// ```
10436    pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
10437    where
10438        T: std::convert::Into<crate::model::Snapshot>,
10439    {
10440        self.snapshot = v.map(|x| x.into());
10441        self
10442    }
10443
10444    /// Sets the value of [snapshot_id][crate::model::CreateSnapshotRequest::snapshot_id].
10445    ///
10446    /// # Example
10447    /// ```ignore,no_run
10448    /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
10449    /// let x = CreateSnapshotRequest::new().set_snapshot_id("example");
10450    /// ```
10451    pub fn set_snapshot_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10452        self.snapshot_id = v.into();
10453        self
10454    }
10455}
10456
10457impl wkt::message::Message for CreateSnapshotRequest {
10458    fn typename() -> &'static str {
10459        "type.googleapis.com/google.cloud.netapp.v1.CreateSnapshotRequest"
10460    }
10461}
10462
10463/// DeleteSnapshotRequest deletes a snapshot.
10464#[derive(Clone, Default, PartialEq)]
10465#[non_exhaustive]
10466pub struct DeleteSnapshotRequest {
10467    /// Required. The snapshot resource name, in the format
10468    /// `projects/*/locations/*/volumes/*/snapshots/{snapshot_id}`
10469    pub name: std::string::String,
10470
10471    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10472}
10473
10474impl DeleteSnapshotRequest {
10475    pub fn new() -> Self {
10476        std::default::Default::default()
10477    }
10478
10479    /// Sets the value of [name][crate::model::DeleteSnapshotRequest::name].
10480    ///
10481    /// # Example
10482    /// ```ignore,no_run
10483    /// # use google_cloud_netapp_v1::model::DeleteSnapshotRequest;
10484    /// let x = DeleteSnapshotRequest::new().set_name("example");
10485    /// ```
10486    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10487        self.name = v.into();
10488        self
10489    }
10490}
10491
10492impl wkt::message::Message for DeleteSnapshotRequest {
10493    fn typename() -> &'static str {
10494        "type.googleapis.com/google.cloud.netapp.v1.DeleteSnapshotRequest"
10495    }
10496}
10497
10498/// UpdateSnapshotRequest updates description and/or labels for a snapshot.
10499#[derive(Clone, Default, PartialEq)]
10500#[non_exhaustive]
10501pub struct UpdateSnapshotRequest {
10502    /// Required. Mask of fields to update.  At least one path must be supplied in
10503    /// this field.
10504    pub update_mask: std::option::Option<wkt::FieldMask>,
10505
10506    /// Required. A snapshot resource
10507    pub snapshot: std::option::Option<crate::model::Snapshot>,
10508
10509    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10510}
10511
10512impl UpdateSnapshotRequest {
10513    pub fn new() -> Self {
10514        std::default::Default::default()
10515    }
10516
10517    /// Sets the value of [update_mask][crate::model::UpdateSnapshotRequest::update_mask].
10518    ///
10519    /// # Example
10520    /// ```ignore,no_run
10521    /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
10522    /// use wkt::FieldMask;
10523    /// let x = UpdateSnapshotRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10524    /// ```
10525    pub fn set_update_mask<T>(mut self, v: T) -> Self
10526    where
10527        T: std::convert::Into<wkt::FieldMask>,
10528    {
10529        self.update_mask = std::option::Option::Some(v.into());
10530        self
10531    }
10532
10533    /// Sets or clears the value of [update_mask][crate::model::UpdateSnapshotRequest::update_mask].
10534    ///
10535    /// # Example
10536    /// ```ignore,no_run
10537    /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
10538    /// use wkt::FieldMask;
10539    /// let x = UpdateSnapshotRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10540    /// let x = UpdateSnapshotRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10541    /// ```
10542    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10543    where
10544        T: std::convert::Into<wkt::FieldMask>,
10545    {
10546        self.update_mask = v.map(|x| x.into());
10547        self
10548    }
10549
10550    /// Sets the value of [snapshot][crate::model::UpdateSnapshotRequest::snapshot].
10551    ///
10552    /// # Example
10553    /// ```ignore,no_run
10554    /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
10555    /// use google_cloud_netapp_v1::model::Snapshot;
10556    /// let x = UpdateSnapshotRequest::new().set_snapshot(Snapshot::default()/* use setters */);
10557    /// ```
10558    pub fn set_snapshot<T>(mut self, v: T) -> Self
10559    where
10560        T: std::convert::Into<crate::model::Snapshot>,
10561    {
10562        self.snapshot = std::option::Option::Some(v.into());
10563        self
10564    }
10565
10566    /// Sets or clears the value of [snapshot][crate::model::UpdateSnapshotRequest::snapshot].
10567    ///
10568    /// # Example
10569    /// ```ignore,no_run
10570    /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
10571    /// use google_cloud_netapp_v1::model::Snapshot;
10572    /// let x = UpdateSnapshotRequest::new().set_or_clear_snapshot(Some(Snapshot::default()/* use setters */));
10573    /// let x = UpdateSnapshotRequest::new().set_or_clear_snapshot(None::<Snapshot>);
10574    /// ```
10575    pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
10576    where
10577        T: std::convert::Into<crate::model::Snapshot>,
10578    {
10579        self.snapshot = v.map(|x| x.into());
10580        self
10581    }
10582}
10583
10584impl wkt::message::Message for UpdateSnapshotRequest {
10585    fn typename() -> &'static str {
10586        "type.googleapis.com/google.cloud.netapp.v1.UpdateSnapshotRequest"
10587    }
10588}
10589
10590/// Snapshot is a point-in-time version of a Volume's content.
10591#[derive(Clone, Default, PartialEq)]
10592#[non_exhaustive]
10593pub struct Snapshot {
10594    /// Identifier. The resource name of the snapshot.
10595    /// Format:
10596    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`.
10597    pub name: std::string::String,
10598
10599    /// Output only. The snapshot state.
10600    pub state: crate::model::snapshot::State,
10601
10602    /// Output only. State details of the storage pool
10603    pub state_details: std::string::String,
10604
10605    /// A description of the snapshot with 2048 characters or less.
10606    /// Requests with longer descriptions will be rejected.
10607    pub description: std::string::String,
10608
10609    /// Output only. Current storage usage for the snapshot in bytes.
10610    pub used_bytes: f64,
10611
10612    /// Output only. The time when the snapshot was created.
10613    pub create_time: std::option::Option<wkt::Timestamp>,
10614
10615    /// Resource labels to represent user provided metadata.
10616    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
10617
10618    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10619}
10620
10621impl Snapshot {
10622    pub fn new() -> Self {
10623        std::default::Default::default()
10624    }
10625
10626    /// Sets the value of [name][crate::model::Snapshot::name].
10627    ///
10628    /// # Example
10629    /// ```ignore,no_run
10630    /// # use google_cloud_netapp_v1::model::Snapshot;
10631    /// let x = Snapshot::new().set_name("example");
10632    /// ```
10633    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10634        self.name = v.into();
10635        self
10636    }
10637
10638    /// Sets the value of [state][crate::model::Snapshot::state].
10639    ///
10640    /// # Example
10641    /// ```ignore,no_run
10642    /// # use google_cloud_netapp_v1::model::Snapshot;
10643    /// use google_cloud_netapp_v1::model::snapshot::State;
10644    /// let x0 = Snapshot::new().set_state(State::Ready);
10645    /// let x1 = Snapshot::new().set_state(State::Creating);
10646    /// let x2 = Snapshot::new().set_state(State::Deleting);
10647    /// ```
10648    pub fn set_state<T: std::convert::Into<crate::model::snapshot::State>>(mut self, v: T) -> Self {
10649        self.state = v.into();
10650        self
10651    }
10652
10653    /// Sets the value of [state_details][crate::model::Snapshot::state_details].
10654    ///
10655    /// # Example
10656    /// ```ignore,no_run
10657    /// # use google_cloud_netapp_v1::model::Snapshot;
10658    /// let x = Snapshot::new().set_state_details("example");
10659    /// ```
10660    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10661        self.state_details = v.into();
10662        self
10663    }
10664
10665    /// Sets the value of [description][crate::model::Snapshot::description].
10666    ///
10667    /// # Example
10668    /// ```ignore,no_run
10669    /// # use google_cloud_netapp_v1::model::Snapshot;
10670    /// let x = Snapshot::new().set_description("example");
10671    /// ```
10672    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10673        self.description = v.into();
10674        self
10675    }
10676
10677    /// Sets the value of [used_bytes][crate::model::Snapshot::used_bytes].
10678    ///
10679    /// # Example
10680    /// ```ignore,no_run
10681    /// # use google_cloud_netapp_v1::model::Snapshot;
10682    /// let x = Snapshot::new().set_used_bytes(42.0);
10683    /// ```
10684    pub fn set_used_bytes<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
10685        self.used_bytes = v.into();
10686        self
10687    }
10688
10689    /// Sets the value of [create_time][crate::model::Snapshot::create_time].
10690    ///
10691    /// # Example
10692    /// ```ignore,no_run
10693    /// # use google_cloud_netapp_v1::model::Snapshot;
10694    /// use wkt::Timestamp;
10695    /// let x = Snapshot::new().set_create_time(Timestamp::default()/* use setters */);
10696    /// ```
10697    pub fn set_create_time<T>(mut self, v: T) -> Self
10698    where
10699        T: std::convert::Into<wkt::Timestamp>,
10700    {
10701        self.create_time = std::option::Option::Some(v.into());
10702        self
10703    }
10704
10705    /// Sets or clears the value of [create_time][crate::model::Snapshot::create_time].
10706    ///
10707    /// # Example
10708    /// ```ignore,no_run
10709    /// # use google_cloud_netapp_v1::model::Snapshot;
10710    /// use wkt::Timestamp;
10711    /// let x = Snapshot::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10712    /// let x = Snapshot::new().set_or_clear_create_time(None::<Timestamp>);
10713    /// ```
10714    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10715    where
10716        T: std::convert::Into<wkt::Timestamp>,
10717    {
10718        self.create_time = v.map(|x| x.into());
10719        self
10720    }
10721
10722    /// Sets the value of [labels][crate::model::Snapshot::labels].
10723    ///
10724    /// # Example
10725    /// ```ignore,no_run
10726    /// # use google_cloud_netapp_v1::model::Snapshot;
10727    /// let x = Snapshot::new().set_labels([
10728    ///     ("key0", "abc"),
10729    ///     ("key1", "xyz"),
10730    /// ]);
10731    /// ```
10732    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
10733    where
10734        T: std::iter::IntoIterator<Item = (K, V)>,
10735        K: std::convert::Into<std::string::String>,
10736        V: std::convert::Into<std::string::String>,
10737    {
10738        use std::iter::Iterator;
10739        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10740        self
10741    }
10742}
10743
10744impl wkt::message::Message for Snapshot {
10745    fn typename() -> &'static str {
10746        "type.googleapis.com/google.cloud.netapp.v1.Snapshot"
10747    }
10748}
10749
10750/// Defines additional types related to [Snapshot].
10751pub mod snapshot {
10752    #[allow(unused_imports)]
10753    use super::*;
10754
10755    /// The Snapshot States
10756    ///
10757    /// # Working with unknown values
10758    ///
10759    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10760    /// additional enum variants at any time. Adding new variants is not considered
10761    /// a breaking change. Applications should write their code in anticipation of:
10762    ///
10763    /// - New values appearing in future releases of the client library, **and**
10764    /// - New values received dynamically, without application changes.
10765    ///
10766    /// Please consult the [Working with enums] section in the user guide for some
10767    /// guidelines.
10768    ///
10769    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10770    #[derive(Clone, Debug, PartialEq)]
10771    #[non_exhaustive]
10772    pub enum State {
10773        /// Unspecified Snapshot State
10774        Unspecified,
10775        /// Snapshot State is Ready
10776        Ready,
10777        /// Snapshot State is Creating
10778        Creating,
10779        /// Snapshot State is Deleting
10780        Deleting,
10781        /// Snapshot State is Updating
10782        Updating,
10783        /// Snapshot State is Disabled
10784        Disabled,
10785        /// Snapshot State is Error
10786        Error,
10787        /// If set, the enum was initialized with an unknown value.
10788        ///
10789        /// Applications can examine the value using [State::value] or
10790        /// [State::name].
10791        UnknownValue(state::UnknownValue),
10792    }
10793
10794    #[doc(hidden)]
10795    pub mod state {
10796        #[allow(unused_imports)]
10797        use super::*;
10798        #[derive(Clone, Debug, PartialEq)]
10799        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10800    }
10801
10802    impl State {
10803        /// Gets the enum value.
10804        ///
10805        /// Returns `None` if the enum contains an unknown value deserialized from
10806        /// the string representation of enums.
10807        pub fn value(&self) -> std::option::Option<i32> {
10808            match self {
10809                Self::Unspecified => std::option::Option::Some(0),
10810                Self::Ready => std::option::Option::Some(1),
10811                Self::Creating => std::option::Option::Some(2),
10812                Self::Deleting => std::option::Option::Some(3),
10813                Self::Updating => std::option::Option::Some(4),
10814                Self::Disabled => std::option::Option::Some(5),
10815                Self::Error => std::option::Option::Some(6),
10816                Self::UnknownValue(u) => u.0.value(),
10817            }
10818        }
10819
10820        /// Gets the enum value as a string.
10821        ///
10822        /// Returns `None` if the enum contains an unknown value deserialized from
10823        /// the integer representation of enums.
10824        pub fn name(&self) -> std::option::Option<&str> {
10825            match self {
10826                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10827                Self::Ready => std::option::Option::Some("READY"),
10828                Self::Creating => std::option::Option::Some("CREATING"),
10829                Self::Deleting => std::option::Option::Some("DELETING"),
10830                Self::Updating => std::option::Option::Some("UPDATING"),
10831                Self::Disabled => std::option::Option::Some("DISABLED"),
10832                Self::Error => std::option::Option::Some("ERROR"),
10833                Self::UnknownValue(u) => u.0.name(),
10834            }
10835        }
10836    }
10837
10838    impl std::default::Default for State {
10839        fn default() -> Self {
10840            use std::convert::From;
10841            Self::from(0)
10842        }
10843    }
10844
10845    impl std::fmt::Display for State {
10846        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10847            wkt::internal::display_enum(f, self.name(), self.value())
10848        }
10849    }
10850
10851    impl std::convert::From<i32> for State {
10852        fn from(value: i32) -> Self {
10853            match value {
10854                0 => Self::Unspecified,
10855                1 => Self::Ready,
10856                2 => Self::Creating,
10857                3 => Self::Deleting,
10858                4 => Self::Updating,
10859                5 => Self::Disabled,
10860                6 => Self::Error,
10861                _ => Self::UnknownValue(state::UnknownValue(
10862                    wkt::internal::UnknownEnumValue::Integer(value),
10863                )),
10864            }
10865        }
10866    }
10867
10868    impl std::convert::From<&str> for State {
10869        fn from(value: &str) -> Self {
10870            use std::string::ToString;
10871            match value {
10872                "STATE_UNSPECIFIED" => Self::Unspecified,
10873                "READY" => Self::Ready,
10874                "CREATING" => Self::Creating,
10875                "DELETING" => Self::Deleting,
10876                "UPDATING" => Self::Updating,
10877                "DISABLED" => Self::Disabled,
10878                "ERROR" => Self::Error,
10879                _ => Self::UnknownValue(state::UnknownValue(
10880                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10881                )),
10882            }
10883        }
10884    }
10885
10886    impl serde::ser::Serialize for State {
10887        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10888        where
10889            S: serde::Serializer,
10890        {
10891            match self {
10892                Self::Unspecified => serializer.serialize_i32(0),
10893                Self::Ready => serializer.serialize_i32(1),
10894                Self::Creating => serializer.serialize_i32(2),
10895                Self::Deleting => serializer.serialize_i32(3),
10896                Self::Updating => serializer.serialize_i32(4),
10897                Self::Disabled => serializer.serialize_i32(5),
10898                Self::Error => serializer.serialize_i32(6),
10899                Self::UnknownValue(u) => u.0.serialize(serializer),
10900            }
10901        }
10902    }
10903
10904    impl<'de> serde::de::Deserialize<'de> for State {
10905        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10906        where
10907            D: serde::Deserializer<'de>,
10908        {
10909            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10910                ".google.cloud.netapp.v1.Snapshot.State",
10911            ))
10912        }
10913    }
10914}
10915
10916/// GetStoragePoolRequest gets a Storage Pool.
10917#[derive(Clone, Default, PartialEq)]
10918#[non_exhaustive]
10919pub struct GetStoragePoolRequest {
10920    /// Required. Name of the storage pool
10921    pub name: std::string::String,
10922
10923    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10924}
10925
10926impl GetStoragePoolRequest {
10927    pub fn new() -> Self {
10928        std::default::Default::default()
10929    }
10930
10931    /// Sets the value of [name][crate::model::GetStoragePoolRequest::name].
10932    ///
10933    /// # Example
10934    /// ```ignore,no_run
10935    /// # use google_cloud_netapp_v1::model::GetStoragePoolRequest;
10936    /// let x = GetStoragePoolRequest::new().set_name("example");
10937    /// ```
10938    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10939        self.name = v.into();
10940        self
10941    }
10942}
10943
10944impl wkt::message::Message for GetStoragePoolRequest {
10945    fn typename() -> &'static str {
10946        "type.googleapis.com/google.cloud.netapp.v1.GetStoragePoolRequest"
10947    }
10948}
10949
10950/// ListStoragePoolsRequest lists Storage Pools.
10951#[derive(Clone, Default, PartialEq)]
10952#[non_exhaustive]
10953pub struct ListStoragePoolsRequest {
10954    /// Required. Parent value
10955    pub parent: std::string::String,
10956
10957    /// Optional. The maximum number of items to return.
10958    pub page_size: i32,
10959
10960    /// Optional. The next_page_token value to use if there are additional
10961    /// results to retrieve for this list request.
10962    pub page_token: std::string::String,
10963
10964    /// Optional. Sort results. Supported values are "name", "name desc" or ""
10965    /// (unsorted).
10966    pub order_by: std::string::String,
10967
10968    /// Optional. List filter.
10969    pub filter: std::string::String,
10970
10971    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10972}
10973
10974impl ListStoragePoolsRequest {
10975    pub fn new() -> Self {
10976        std::default::Default::default()
10977    }
10978
10979    /// Sets the value of [parent][crate::model::ListStoragePoolsRequest::parent].
10980    ///
10981    /// # Example
10982    /// ```ignore,no_run
10983    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
10984    /// let x = ListStoragePoolsRequest::new().set_parent("example");
10985    /// ```
10986    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10987        self.parent = v.into();
10988        self
10989    }
10990
10991    /// Sets the value of [page_size][crate::model::ListStoragePoolsRequest::page_size].
10992    ///
10993    /// # Example
10994    /// ```ignore,no_run
10995    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
10996    /// let x = ListStoragePoolsRequest::new().set_page_size(42);
10997    /// ```
10998    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10999        self.page_size = v.into();
11000        self
11001    }
11002
11003    /// Sets the value of [page_token][crate::model::ListStoragePoolsRequest::page_token].
11004    ///
11005    /// # Example
11006    /// ```ignore,no_run
11007    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11008    /// let x = ListStoragePoolsRequest::new().set_page_token("example");
11009    /// ```
11010    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11011        self.page_token = v.into();
11012        self
11013    }
11014
11015    /// Sets the value of [order_by][crate::model::ListStoragePoolsRequest::order_by].
11016    ///
11017    /// # Example
11018    /// ```ignore,no_run
11019    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11020    /// let x = ListStoragePoolsRequest::new().set_order_by("example");
11021    /// ```
11022    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11023        self.order_by = v.into();
11024        self
11025    }
11026
11027    /// Sets the value of [filter][crate::model::ListStoragePoolsRequest::filter].
11028    ///
11029    /// # Example
11030    /// ```ignore,no_run
11031    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11032    /// let x = ListStoragePoolsRequest::new().set_filter("example");
11033    /// ```
11034    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11035        self.filter = v.into();
11036        self
11037    }
11038}
11039
11040impl wkt::message::Message for ListStoragePoolsRequest {
11041    fn typename() -> &'static str {
11042        "type.googleapis.com/google.cloud.netapp.v1.ListStoragePoolsRequest"
11043    }
11044}
11045
11046/// ListStoragePoolsResponse is the response to a ListStoragePoolsRequest.
11047#[derive(Clone, Default, PartialEq)]
11048#[non_exhaustive]
11049pub struct ListStoragePoolsResponse {
11050    /// The list of StoragePools
11051    pub storage_pools: std::vec::Vec<crate::model::StoragePool>,
11052
11053    /// A token identifying a page of results the server should return.
11054    pub next_page_token: std::string::String,
11055
11056    /// Locations that could not be reached.
11057    pub unreachable: std::vec::Vec<std::string::String>,
11058
11059    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11060}
11061
11062impl ListStoragePoolsResponse {
11063    pub fn new() -> Self {
11064        std::default::Default::default()
11065    }
11066
11067    /// Sets the value of [storage_pools][crate::model::ListStoragePoolsResponse::storage_pools].
11068    ///
11069    /// # Example
11070    /// ```ignore,no_run
11071    /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
11072    /// use google_cloud_netapp_v1::model::StoragePool;
11073    /// let x = ListStoragePoolsResponse::new()
11074    ///     .set_storage_pools([
11075    ///         StoragePool::default()/* use setters */,
11076    ///         StoragePool::default()/* use (different) setters */,
11077    ///     ]);
11078    /// ```
11079    pub fn set_storage_pools<T, V>(mut self, v: T) -> Self
11080    where
11081        T: std::iter::IntoIterator<Item = V>,
11082        V: std::convert::Into<crate::model::StoragePool>,
11083    {
11084        use std::iter::Iterator;
11085        self.storage_pools = v.into_iter().map(|i| i.into()).collect();
11086        self
11087    }
11088
11089    /// Sets the value of [next_page_token][crate::model::ListStoragePoolsResponse::next_page_token].
11090    ///
11091    /// # Example
11092    /// ```ignore,no_run
11093    /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
11094    /// let x = ListStoragePoolsResponse::new().set_next_page_token("example");
11095    /// ```
11096    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11097        self.next_page_token = v.into();
11098        self
11099    }
11100
11101    /// Sets the value of [unreachable][crate::model::ListStoragePoolsResponse::unreachable].
11102    ///
11103    /// # Example
11104    /// ```ignore,no_run
11105    /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
11106    /// let x = ListStoragePoolsResponse::new().set_unreachable(["a", "b", "c"]);
11107    /// ```
11108    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11109    where
11110        T: std::iter::IntoIterator<Item = V>,
11111        V: std::convert::Into<std::string::String>,
11112    {
11113        use std::iter::Iterator;
11114        self.unreachable = v.into_iter().map(|i| i.into()).collect();
11115        self
11116    }
11117}
11118
11119impl wkt::message::Message for ListStoragePoolsResponse {
11120    fn typename() -> &'static str {
11121        "type.googleapis.com/google.cloud.netapp.v1.ListStoragePoolsResponse"
11122    }
11123}
11124
11125#[doc(hidden)]
11126impl google_cloud_gax::paginator::internal::PageableResponse for ListStoragePoolsResponse {
11127    type PageItem = crate::model::StoragePool;
11128
11129    fn items(self) -> std::vec::Vec<Self::PageItem> {
11130        self.storage_pools
11131    }
11132
11133    fn next_page_token(&self) -> std::string::String {
11134        use std::clone::Clone;
11135        self.next_page_token.clone()
11136    }
11137}
11138
11139/// CreateStoragePoolRequest creates a Storage Pool.
11140#[derive(Clone, Default, PartialEq)]
11141#[non_exhaustive]
11142pub struct CreateStoragePoolRequest {
11143    /// Required. Value for parent.
11144    pub parent: std::string::String,
11145
11146    /// Required. Id of the requesting storage pool. Must be unique within the
11147    /// parent resource. Must contain only letters, numbers and hyphen, with the
11148    /// first character a letter, the last a letter or a number, and a 63 character
11149    /// maximum.
11150    pub storage_pool_id: std::string::String,
11151
11152    /// Required. The required parameters to create a new storage pool.
11153    pub storage_pool: std::option::Option<crate::model::StoragePool>,
11154
11155    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11156}
11157
11158impl CreateStoragePoolRequest {
11159    pub fn new() -> Self {
11160        std::default::Default::default()
11161    }
11162
11163    /// Sets the value of [parent][crate::model::CreateStoragePoolRequest::parent].
11164    ///
11165    /// # Example
11166    /// ```ignore,no_run
11167    /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11168    /// let x = CreateStoragePoolRequest::new().set_parent("example");
11169    /// ```
11170    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11171        self.parent = v.into();
11172        self
11173    }
11174
11175    /// Sets the value of [storage_pool_id][crate::model::CreateStoragePoolRequest::storage_pool_id].
11176    ///
11177    /// # Example
11178    /// ```ignore,no_run
11179    /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11180    /// let x = CreateStoragePoolRequest::new().set_storage_pool_id("example");
11181    /// ```
11182    pub fn set_storage_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11183        self.storage_pool_id = v.into();
11184        self
11185    }
11186
11187    /// Sets the value of [storage_pool][crate::model::CreateStoragePoolRequest::storage_pool].
11188    ///
11189    /// # Example
11190    /// ```ignore,no_run
11191    /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11192    /// use google_cloud_netapp_v1::model::StoragePool;
11193    /// let x = CreateStoragePoolRequest::new().set_storage_pool(StoragePool::default()/* use setters */);
11194    /// ```
11195    pub fn set_storage_pool<T>(mut self, v: T) -> Self
11196    where
11197        T: std::convert::Into<crate::model::StoragePool>,
11198    {
11199        self.storage_pool = std::option::Option::Some(v.into());
11200        self
11201    }
11202
11203    /// Sets or clears the value of [storage_pool][crate::model::CreateStoragePoolRequest::storage_pool].
11204    ///
11205    /// # Example
11206    /// ```ignore,no_run
11207    /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11208    /// use google_cloud_netapp_v1::model::StoragePool;
11209    /// let x = CreateStoragePoolRequest::new().set_or_clear_storage_pool(Some(StoragePool::default()/* use setters */));
11210    /// let x = CreateStoragePoolRequest::new().set_or_clear_storage_pool(None::<StoragePool>);
11211    /// ```
11212    pub fn set_or_clear_storage_pool<T>(mut self, v: std::option::Option<T>) -> Self
11213    where
11214        T: std::convert::Into<crate::model::StoragePool>,
11215    {
11216        self.storage_pool = v.map(|x| x.into());
11217        self
11218    }
11219}
11220
11221impl wkt::message::Message for CreateStoragePoolRequest {
11222    fn typename() -> &'static str {
11223        "type.googleapis.com/google.cloud.netapp.v1.CreateStoragePoolRequest"
11224    }
11225}
11226
11227/// UpdateStoragePoolRequest updates a Storage Pool.
11228#[derive(Clone, Default, PartialEq)]
11229#[non_exhaustive]
11230pub struct UpdateStoragePoolRequest {
11231    /// Required. Field mask is used to specify the fields to be overwritten in the
11232    /// StoragePool resource by the update.
11233    /// The fields specified in the update_mask are relative to the resource, not
11234    /// the full request. A field will be overwritten if it is in the mask. If the
11235    /// user does not provide a mask then all fields will be overwritten.
11236    pub update_mask: std::option::Option<wkt::FieldMask>,
11237
11238    /// Required. The pool being updated
11239    pub storage_pool: std::option::Option<crate::model::StoragePool>,
11240
11241    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11242}
11243
11244impl UpdateStoragePoolRequest {
11245    pub fn new() -> Self {
11246        std::default::Default::default()
11247    }
11248
11249    /// Sets the value of [update_mask][crate::model::UpdateStoragePoolRequest::update_mask].
11250    ///
11251    /// # Example
11252    /// ```ignore,no_run
11253    /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
11254    /// use wkt::FieldMask;
11255    /// let x = UpdateStoragePoolRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11256    /// ```
11257    pub fn set_update_mask<T>(mut self, v: T) -> Self
11258    where
11259        T: std::convert::Into<wkt::FieldMask>,
11260    {
11261        self.update_mask = std::option::Option::Some(v.into());
11262        self
11263    }
11264
11265    /// Sets or clears the value of [update_mask][crate::model::UpdateStoragePoolRequest::update_mask].
11266    ///
11267    /// # Example
11268    /// ```ignore,no_run
11269    /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
11270    /// use wkt::FieldMask;
11271    /// let x = UpdateStoragePoolRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11272    /// let x = UpdateStoragePoolRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11273    /// ```
11274    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11275    where
11276        T: std::convert::Into<wkt::FieldMask>,
11277    {
11278        self.update_mask = v.map(|x| x.into());
11279        self
11280    }
11281
11282    /// Sets the value of [storage_pool][crate::model::UpdateStoragePoolRequest::storage_pool].
11283    ///
11284    /// # Example
11285    /// ```ignore,no_run
11286    /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
11287    /// use google_cloud_netapp_v1::model::StoragePool;
11288    /// let x = UpdateStoragePoolRequest::new().set_storage_pool(StoragePool::default()/* use setters */);
11289    /// ```
11290    pub fn set_storage_pool<T>(mut self, v: T) -> Self
11291    where
11292        T: std::convert::Into<crate::model::StoragePool>,
11293    {
11294        self.storage_pool = std::option::Option::Some(v.into());
11295        self
11296    }
11297
11298    /// Sets or clears the value of [storage_pool][crate::model::UpdateStoragePoolRequest::storage_pool].
11299    ///
11300    /// # Example
11301    /// ```ignore,no_run
11302    /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
11303    /// use google_cloud_netapp_v1::model::StoragePool;
11304    /// let x = UpdateStoragePoolRequest::new().set_or_clear_storage_pool(Some(StoragePool::default()/* use setters */));
11305    /// let x = UpdateStoragePoolRequest::new().set_or_clear_storage_pool(None::<StoragePool>);
11306    /// ```
11307    pub fn set_or_clear_storage_pool<T>(mut self, v: std::option::Option<T>) -> Self
11308    where
11309        T: std::convert::Into<crate::model::StoragePool>,
11310    {
11311        self.storage_pool = v.map(|x| x.into());
11312        self
11313    }
11314}
11315
11316impl wkt::message::Message for UpdateStoragePoolRequest {
11317    fn typename() -> &'static str {
11318        "type.googleapis.com/google.cloud.netapp.v1.UpdateStoragePoolRequest"
11319    }
11320}
11321
11322/// DeleteStoragePoolRequest deletes a Storage Pool.
11323#[derive(Clone, Default, PartialEq)]
11324#[non_exhaustive]
11325pub struct DeleteStoragePoolRequest {
11326    /// Required. Name of the storage pool
11327    pub name: std::string::String,
11328
11329    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11330}
11331
11332impl DeleteStoragePoolRequest {
11333    pub fn new() -> Self {
11334        std::default::Default::default()
11335    }
11336
11337    /// Sets the value of [name][crate::model::DeleteStoragePoolRequest::name].
11338    ///
11339    /// # Example
11340    /// ```ignore,no_run
11341    /// # use google_cloud_netapp_v1::model::DeleteStoragePoolRequest;
11342    /// let x = DeleteStoragePoolRequest::new().set_name("example");
11343    /// ```
11344    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11345        self.name = v.into();
11346        self
11347    }
11348}
11349
11350impl wkt::message::Message for DeleteStoragePoolRequest {
11351    fn typename() -> &'static str {
11352        "type.googleapis.com/google.cloud.netapp.v1.DeleteStoragePoolRequest"
11353    }
11354}
11355
11356/// SwitchActiveReplicaZoneRequest switch the active/replica zone for a regional
11357/// storagePool.
11358#[derive(Clone, Default, PartialEq)]
11359#[non_exhaustive]
11360pub struct SwitchActiveReplicaZoneRequest {
11361    /// Required. Name of the storage pool
11362    pub name: std::string::String,
11363
11364    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11365}
11366
11367impl SwitchActiveReplicaZoneRequest {
11368    pub fn new() -> Self {
11369        std::default::Default::default()
11370    }
11371
11372    /// Sets the value of [name][crate::model::SwitchActiveReplicaZoneRequest::name].
11373    ///
11374    /// # Example
11375    /// ```ignore,no_run
11376    /// # use google_cloud_netapp_v1::model::SwitchActiveReplicaZoneRequest;
11377    /// let x = SwitchActiveReplicaZoneRequest::new().set_name("example");
11378    /// ```
11379    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11380        self.name = v.into();
11381        self
11382    }
11383}
11384
11385impl wkt::message::Message for SwitchActiveReplicaZoneRequest {
11386    fn typename() -> &'static str {
11387        "type.googleapis.com/google.cloud.netapp.v1.SwitchActiveReplicaZoneRequest"
11388    }
11389}
11390
11391/// StoragePool is a container for volumes with a service level and capacity.
11392/// Volumes can be created in a pool of sufficient available capacity.
11393/// StoragePool capacity is what you are billed for.
11394#[derive(Clone, Default, PartialEq)]
11395#[non_exhaustive]
11396pub struct StoragePool {
11397    /// Identifier. Name of the storage pool
11398    pub name: std::string::String,
11399
11400    /// Required. Service level of the storage pool
11401    pub service_level: crate::model::ServiceLevel,
11402
11403    /// Required. Capacity in GIB of the pool
11404    pub capacity_gib: i64,
11405
11406    /// Output only. Allocated size of all volumes in GIB in the storage pool
11407    pub volume_capacity_gib: i64,
11408
11409    /// Output only. Volume count of the storage pool
11410    pub volume_count: i32,
11411
11412    /// Output only. State of the storage pool
11413    pub state: crate::model::storage_pool::State,
11414
11415    /// Output only. State details of the storage pool
11416    pub state_details: std::string::String,
11417
11418    /// Output only. Create time of the storage pool
11419    pub create_time: std::option::Option<wkt::Timestamp>,
11420
11421    /// Optional. Description of the storage pool
11422    pub description: std::string::String,
11423
11424    /// Optional. Labels as key value pairs
11425    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11426
11427    /// Required. VPC Network name.
11428    /// Format: projects/{project}/global/networks/{network}
11429    pub network: std::string::String,
11430
11431    /// Optional. Specifies the Active Directory to be used for creating a SMB
11432    /// volume.
11433    pub active_directory: std::string::String,
11434
11435    /// Optional. Specifies the KMS config to be used for volume encryption.
11436    pub kms_config: std::string::String,
11437
11438    /// Optional. Flag indicating if the pool is NFS LDAP enabled or not.
11439    pub ldap_enabled: bool,
11440
11441    /// Optional. This field is not implemented. The values provided in this field
11442    /// are ignored.
11443    pub psa_range: std::string::String,
11444
11445    /// Output only. Specifies the current pool encryption key source.
11446    pub encryption_type: crate::model::EncryptionType,
11447
11448    /// Deprecated. Used to allow SO pool to access AD or DNS server from other
11449    /// regions.
11450    #[deprecated]
11451    pub global_access_allowed: std::option::Option<bool>,
11452
11453    /// Optional. True if the storage pool supports Auto Tiering enabled volumes.
11454    /// Default is false. Auto-tiering can be enabled after storage pool creation
11455    /// but it can't be disabled once enabled.
11456    pub allow_auto_tiering: bool,
11457
11458    /// Optional. Specifies the replica zone for regional storagePool.
11459    pub replica_zone: std::string::String,
11460
11461    /// Optional. Specifies the active zone for regional storagePool.
11462    pub zone: std::string::String,
11463
11464    /// Output only. Reserved for future use
11465    pub satisfies_pzs: bool,
11466
11467    /// Output only. Reserved for future use
11468    pub satisfies_pzi: bool,
11469
11470    /// Optional. True if using Independent Scaling of capacity and performance
11471    /// (Hyperdisk) By default set to false
11472    pub custom_performance_enabled: bool,
11473
11474    /// Optional. Custom Performance Total Throughput of the pool (in MiBps)
11475    pub total_throughput_mibps: i64,
11476
11477    /// Optional. Custom Performance Total IOPS of the pool
11478    /// if not provided, it will be calculated based on the total_throughput_mibps
11479    pub total_iops: i64,
11480
11481    /// Optional. Total hot tier capacity for the Storage Pool. It is applicable
11482    /// only to Flex service level. It should be less than the minimum storage pool
11483    /// size and cannot be more than the current storage pool size. It cannot be
11484    /// decreased once set.
11485    pub hot_tier_size_gib: i64,
11486
11487    /// Optional. Flag indicating that the hot-tier threshold will be
11488    /// auto-increased by 10% of the hot-tier when it hits 100%. Default is true.
11489    /// The increment will kick in only if the new size after increment is
11490    /// still less than or equal to storage pool size.
11491    pub enable_hot_tier_auto_resize: std::option::Option<bool>,
11492
11493    /// Optional. QoS (Quality of Service) Type of the storage pool
11494    pub qos_type: crate::model::QosType,
11495
11496    /// Output only. Available throughput of the storage pool (in MiB/s).
11497    pub available_throughput_mibps: f64,
11498
11499    /// Output only. Total cold tier data rounded down to the nearest GiB used by
11500    /// the storage pool.
11501    pub cold_tier_size_used_gib: i64,
11502
11503    /// Output only. Total hot tier data rounded down to the nearest GiB used by
11504    /// the storage pool.
11505    pub hot_tier_size_used_gib: i64,
11506
11507    /// Optional. Type of the storage pool. This field is used to control whether
11508    /// the pool supports `FILE` based volumes only or `UNIFIED` (both `FILE` and
11509    /// `BLOCK`) volumes or `UNIFIED_LARGE_CAPACITY` (both `FILE` and `BLOCK`)
11510    /// volumes with large capacity. If not specified during creation, it defaults
11511    /// to `FILE`.
11512    pub r#type: std::option::Option<crate::model::StoragePoolType>,
11513
11514    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11515}
11516
11517impl StoragePool {
11518    pub fn new() -> Self {
11519        std::default::Default::default()
11520    }
11521
11522    /// Sets the value of [name][crate::model::StoragePool::name].
11523    ///
11524    /// # Example
11525    /// ```ignore,no_run
11526    /// # use google_cloud_netapp_v1::model::StoragePool;
11527    /// let x = StoragePool::new().set_name("example");
11528    /// ```
11529    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11530        self.name = v.into();
11531        self
11532    }
11533
11534    /// Sets the value of [service_level][crate::model::StoragePool::service_level].
11535    ///
11536    /// # Example
11537    /// ```ignore,no_run
11538    /// # use google_cloud_netapp_v1::model::StoragePool;
11539    /// use google_cloud_netapp_v1::model::ServiceLevel;
11540    /// let x0 = StoragePool::new().set_service_level(ServiceLevel::Premium);
11541    /// let x1 = StoragePool::new().set_service_level(ServiceLevel::Extreme);
11542    /// let x2 = StoragePool::new().set_service_level(ServiceLevel::Standard);
11543    /// ```
11544    pub fn set_service_level<T: std::convert::Into<crate::model::ServiceLevel>>(
11545        mut self,
11546        v: T,
11547    ) -> Self {
11548        self.service_level = v.into();
11549        self
11550    }
11551
11552    /// Sets the value of [capacity_gib][crate::model::StoragePool::capacity_gib].
11553    ///
11554    /// # Example
11555    /// ```ignore,no_run
11556    /// # use google_cloud_netapp_v1::model::StoragePool;
11557    /// let x = StoragePool::new().set_capacity_gib(42);
11558    /// ```
11559    pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11560        self.capacity_gib = v.into();
11561        self
11562    }
11563
11564    /// Sets the value of [volume_capacity_gib][crate::model::StoragePool::volume_capacity_gib].
11565    ///
11566    /// # Example
11567    /// ```ignore,no_run
11568    /// # use google_cloud_netapp_v1::model::StoragePool;
11569    /// let x = StoragePool::new().set_volume_capacity_gib(42);
11570    /// ```
11571    pub fn set_volume_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11572        self.volume_capacity_gib = v.into();
11573        self
11574    }
11575
11576    /// Sets the value of [volume_count][crate::model::StoragePool::volume_count].
11577    ///
11578    /// # Example
11579    /// ```ignore,no_run
11580    /// # use google_cloud_netapp_v1::model::StoragePool;
11581    /// let x = StoragePool::new().set_volume_count(42);
11582    /// ```
11583    pub fn set_volume_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11584        self.volume_count = v.into();
11585        self
11586    }
11587
11588    /// Sets the value of [state][crate::model::StoragePool::state].
11589    ///
11590    /// # Example
11591    /// ```ignore,no_run
11592    /// # use google_cloud_netapp_v1::model::StoragePool;
11593    /// use google_cloud_netapp_v1::model::storage_pool::State;
11594    /// let x0 = StoragePool::new().set_state(State::Ready);
11595    /// let x1 = StoragePool::new().set_state(State::Creating);
11596    /// let x2 = StoragePool::new().set_state(State::Deleting);
11597    /// ```
11598    pub fn set_state<T: std::convert::Into<crate::model::storage_pool::State>>(
11599        mut self,
11600        v: T,
11601    ) -> Self {
11602        self.state = v.into();
11603        self
11604    }
11605
11606    /// Sets the value of [state_details][crate::model::StoragePool::state_details].
11607    ///
11608    /// # Example
11609    /// ```ignore,no_run
11610    /// # use google_cloud_netapp_v1::model::StoragePool;
11611    /// let x = StoragePool::new().set_state_details("example");
11612    /// ```
11613    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11614        self.state_details = v.into();
11615        self
11616    }
11617
11618    /// Sets the value of [create_time][crate::model::StoragePool::create_time].
11619    ///
11620    /// # Example
11621    /// ```ignore,no_run
11622    /// # use google_cloud_netapp_v1::model::StoragePool;
11623    /// use wkt::Timestamp;
11624    /// let x = StoragePool::new().set_create_time(Timestamp::default()/* use setters */);
11625    /// ```
11626    pub fn set_create_time<T>(mut self, v: T) -> Self
11627    where
11628        T: std::convert::Into<wkt::Timestamp>,
11629    {
11630        self.create_time = std::option::Option::Some(v.into());
11631        self
11632    }
11633
11634    /// Sets or clears the value of [create_time][crate::model::StoragePool::create_time].
11635    ///
11636    /// # Example
11637    /// ```ignore,no_run
11638    /// # use google_cloud_netapp_v1::model::StoragePool;
11639    /// use wkt::Timestamp;
11640    /// let x = StoragePool::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11641    /// let x = StoragePool::new().set_or_clear_create_time(None::<Timestamp>);
11642    /// ```
11643    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11644    where
11645        T: std::convert::Into<wkt::Timestamp>,
11646    {
11647        self.create_time = v.map(|x| x.into());
11648        self
11649    }
11650
11651    /// Sets the value of [description][crate::model::StoragePool::description].
11652    ///
11653    /// # Example
11654    /// ```ignore,no_run
11655    /// # use google_cloud_netapp_v1::model::StoragePool;
11656    /// let x = StoragePool::new().set_description("example");
11657    /// ```
11658    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11659        self.description = v.into();
11660        self
11661    }
11662
11663    /// Sets the value of [labels][crate::model::StoragePool::labels].
11664    ///
11665    /// # Example
11666    /// ```ignore,no_run
11667    /// # use google_cloud_netapp_v1::model::StoragePool;
11668    /// let x = StoragePool::new().set_labels([
11669    ///     ("key0", "abc"),
11670    ///     ("key1", "xyz"),
11671    /// ]);
11672    /// ```
11673    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11674    where
11675        T: std::iter::IntoIterator<Item = (K, V)>,
11676        K: std::convert::Into<std::string::String>,
11677        V: std::convert::Into<std::string::String>,
11678    {
11679        use std::iter::Iterator;
11680        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11681        self
11682    }
11683
11684    /// Sets the value of [network][crate::model::StoragePool::network].
11685    ///
11686    /// # Example
11687    /// ```ignore,no_run
11688    /// # use google_cloud_netapp_v1::model::StoragePool;
11689    /// let x = StoragePool::new().set_network("example");
11690    /// ```
11691    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11692        self.network = v.into();
11693        self
11694    }
11695
11696    /// Sets the value of [active_directory][crate::model::StoragePool::active_directory].
11697    ///
11698    /// # Example
11699    /// ```ignore,no_run
11700    /// # use google_cloud_netapp_v1::model::StoragePool;
11701    /// let x = StoragePool::new().set_active_directory("example");
11702    /// ```
11703    pub fn set_active_directory<T: std::convert::Into<std::string::String>>(
11704        mut self,
11705        v: T,
11706    ) -> Self {
11707        self.active_directory = v.into();
11708        self
11709    }
11710
11711    /// Sets the value of [kms_config][crate::model::StoragePool::kms_config].
11712    ///
11713    /// # Example
11714    /// ```ignore,no_run
11715    /// # use google_cloud_netapp_v1::model::StoragePool;
11716    /// let x = StoragePool::new().set_kms_config("example");
11717    /// ```
11718    pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11719        self.kms_config = v.into();
11720        self
11721    }
11722
11723    /// Sets the value of [ldap_enabled][crate::model::StoragePool::ldap_enabled].
11724    ///
11725    /// # Example
11726    /// ```ignore,no_run
11727    /// # use google_cloud_netapp_v1::model::StoragePool;
11728    /// let x = StoragePool::new().set_ldap_enabled(true);
11729    /// ```
11730    pub fn set_ldap_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11731        self.ldap_enabled = v.into();
11732        self
11733    }
11734
11735    /// Sets the value of [psa_range][crate::model::StoragePool::psa_range].
11736    ///
11737    /// # Example
11738    /// ```ignore,no_run
11739    /// # use google_cloud_netapp_v1::model::StoragePool;
11740    /// let x = StoragePool::new().set_psa_range("example");
11741    /// ```
11742    pub fn set_psa_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11743        self.psa_range = v.into();
11744        self
11745    }
11746
11747    /// Sets the value of [encryption_type][crate::model::StoragePool::encryption_type].
11748    ///
11749    /// # Example
11750    /// ```ignore,no_run
11751    /// # use google_cloud_netapp_v1::model::StoragePool;
11752    /// use google_cloud_netapp_v1::model::EncryptionType;
11753    /// let x0 = StoragePool::new().set_encryption_type(EncryptionType::ServiceManaged);
11754    /// let x1 = StoragePool::new().set_encryption_type(EncryptionType::CloudKms);
11755    /// ```
11756    pub fn set_encryption_type<T: std::convert::Into<crate::model::EncryptionType>>(
11757        mut self,
11758        v: T,
11759    ) -> Self {
11760        self.encryption_type = v.into();
11761        self
11762    }
11763
11764    /// Sets the value of [global_access_allowed][crate::model::StoragePool::global_access_allowed].
11765    ///
11766    /// # Example
11767    /// ```ignore,no_run
11768    /// # use google_cloud_netapp_v1::model::StoragePool;
11769    /// let x = StoragePool::new().set_global_access_allowed(true);
11770    /// ```
11771    #[deprecated]
11772    pub fn set_global_access_allowed<T>(mut self, v: T) -> Self
11773    where
11774        T: std::convert::Into<bool>,
11775    {
11776        self.global_access_allowed = std::option::Option::Some(v.into());
11777        self
11778    }
11779
11780    /// Sets or clears the value of [global_access_allowed][crate::model::StoragePool::global_access_allowed].
11781    ///
11782    /// # Example
11783    /// ```ignore,no_run
11784    /// # use google_cloud_netapp_v1::model::StoragePool;
11785    /// let x = StoragePool::new().set_or_clear_global_access_allowed(Some(false));
11786    /// let x = StoragePool::new().set_or_clear_global_access_allowed(None::<bool>);
11787    /// ```
11788    #[deprecated]
11789    pub fn set_or_clear_global_access_allowed<T>(mut self, v: std::option::Option<T>) -> Self
11790    where
11791        T: std::convert::Into<bool>,
11792    {
11793        self.global_access_allowed = v.map(|x| x.into());
11794        self
11795    }
11796
11797    /// Sets the value of [allow_auto_tiering][crate::model::StoragePool::allow_auto_tiering].
11798    ///
11799    /// # Example
11800    /// ```ignore,no_run
11801    /// # use google_cloud_netapp_v1::model::StoragePool;
11802    /// let x = StoragePool::new().set_allow_auto_tiering(true);
11803    /// ```
11804    pub fn set_allow_auto_tiering<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11805        self.allow_auto_tiering = v.into();
11806        self
11807    }
11808
11809    /// Sets the value of [replica_zone][crate::model::StoragePool::replica_zone].
11810    ///
11811    /// # Example
11812    /// ```ignore,no_run
11813    /// # use google_cloud_netapp_v1::model::StoragePool;
11814    /// let x = StoragePool::new().set_replica_zone("example");
11815    /// ```
11816    pub fn set_replica_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11817        self.replica_zone = v.into();
11818        self
11819    }
11820
11821    /// Sets the value of [zone][crate::model::StoragePool::zone].
11822    ///
11823    /// # Example
11824    /// ```ignore,no_run
11825    /// # use google_cloud_netapp_v1::model::StoragePool;
11826    /// let x = StoragePool::new().set_zone("example");
11827    /// ```
11828    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11829        self.zone = v.into();
11830        self
11831    }
11832
11833    /// Sets the value of [satisfies_pzs][crate::model::StoragePool::satisfies_pzs].
11834    ///
11835    /// # Example
11836    /// ```ignore,no_run
11837    /// # use google_cloud_netapp_v1::model::StoragePool;
11838    /// let x = StoragePool::new().set_satisfies_pzs(true);
11839    /// ```
11840    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11841        self.satisfies_pzs = v.into();
11842        self
11843    }
11844
11845    /// Sets the value of [satisfies_pzi][crate::model::StoragePool::satisfies_pzi].
11846    ///
11847    /// # Example
11848    /// ```ignore,no_run
11849    /// # use google_cloud_netapp_v1::model::StoragePool;
11850    /// let x = StoragePool::new().set_satisfies_pzi(true);
11851    /// ```
11852    pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11853        self.satisfies_pzi = v.into();
11854        self
11855    }
11856
11857    /// Sets the value of [custom_performance_enabled][crate::model::StoragePool::custom_performance_enabled].
11858    ///
11859    /// # Example
11860    /// ```ignore,no_run
11861    /// # use google_cloud_netapp_v1::model::StoragePool;
11862    /// let x = StoragePool::new().set_custom_performance_enabled(true);
11863    /// ```
11864    pub fn set_custom_performance_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11865        self.custom_performance_enabled = v.into();
11866        self
11867    }
11868
11869    /// Sets the value of [total_throughput_mibps][crate::model::StoragePool::total_throughput_mibps].
11870    ///
11871    /// # Example
11872    /// ```ignore,no_run
11873    /// # use google_cloud_netapp_v1::model::StoragePool;
11874    /// let x = StoragePool::new().set_total_throughput_mibps(42);
11875    /// ```
11876    pub fn set_total_throughput_mibps<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11877        self.total_throughput_mibps = v.into();
11878        self
11879    }
11880
11881    /// Sets the value of [total_iops][crate::model::StoragePool::total_iops].
11882    ///
11883    /// # Example
11884    /// ```ignore,no_run
11885    /// # use google_cloud_netapp_v1::model::StoragePool;
11886    /// let x = StoragePool::new().set_total_iops(42);
11887    /// ```
11888    pub fn set_total_iops<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11889        self.total_iops = v.into();
11890        self
11891    }
11892
11893    /// Sets the value of [hot_tier_size_gib][crate::model::StoragePool::hot_tier_size_gib].
11894    ///
11895    /// # Example
11896    /// ```ignore,no_run
11897    /// # use google_cloud_netapp_v1::model::StoragePool;
11898    /// let x = StoragePool::new().set_hot_tier_size_gib(42);
11899    /// ```
11900    pub fn set_hot_tier_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11901        self.hot_tier_size_gib = v.into();
11902        self
11903    }
11904
11905    /// Sets the value of [enable_hot_tier_auto_resize][crate::model::StoragePool::enable_hot_tier_auto_resize].
11906    ///
11907    /// # Example
11908    /// ```ignore,no_run
11909    /// # use google_cloud_netapp_v1::model::StoragePool;
11910    /// let x = StoragePool::new().set_enable_hot_tier_auto_resize(true);
11911    /// ```
11912    pub fn set_enable_hot_tier_auto_resize<T>(mut self, v: T) -> Self
11913    where
11914        T: std::convert::Into<bool>,
11915    {
11916        self.enable_hot_tier_auto_resize = std::option::Option::Some(v.into());
11917        self
11918    }
11919
11920    /// Sets or clears the value of [enable_hot_tier_auto_resize][crate::model::StoragePool::enable_hot_tier_auto_resize].
11921    ///
11922    /// # Example
11923    /// ```ignore,no_run
11924    /// # use google_cloud_netapp_v1::model::StoragePool;
11925    /// let x = StoragePool::new().set_or_clear_enable_hot_tier_auto_resize(Some(false));
11926    /// let x = StoragePool::new().set_or_clear_enable_hot_tier_auto_resize(None::<bool>);
11927    /// ```
11928    pub fn set_or_clear_enable_hot_tier_auto_resize<T>(mut self, v: std::option::Option<T>) -> Self
11929    where
11930        T: std::convert::Into<bool>,
11931    {
11932        self.enable_hot_tier_auto_resize = v.map(|x| x.into());
11933        self
11934    }
11935
11936    /// Sets the value of [qos_type][crate::model::StoragePool::qos_type].
11937    ///
11938    /// # Example
11939    /// ```ignore,no_run
11940    /// # use google_cloud_netapp_v1::model::StoragePool;
11941    /// use google_cloud_netapp_v1::model::QosType;
11942    /// let x0 = StoragePool::new().set_qos_type(QosType::Auto);
11943    /// let x1 = StoragePool::new().set_qos_type(QosType::Manual);
11944    /// ```
11945    pub fn set_qos_type<T: std::convert::Into<crate::model::QosType>>(mut self, v: T) -> Self {
11946        self.qos_type = v.into();
11947        self
11948    }
11949
11950    /// Sets the value of [available_throughput_mibps][crate::model::StoragePool::available_throughput_mibps].
11951    ///
11952    /// # Example
11953    /// ```ignore,no_run
11954    /// # use google_cloud_netapp_v1::model::StoragePool;
11955    /// let x = StoragePool::new().set_available_throughput_mibps(42.0);
11956    /// ```
11957    pub fn set_available_throughput_mibps<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11958        self.available_throughput_mibps = v.into();
11959        self
11960    }
11961
11962    /// Sets the value of [cold_tier_size_used_gib][crate::model::StoragePool::cold_tier_size_used_gib].
11963    ///
11964    /// # Example
11965    /// ```ignore,no_run
11966    /// # use google_cloud_netapp_v1::model::StoragePool;
11967    /// let x = StoragePool::new().set_cold_tier_size_used_gib(42);
11968    /// ```
11969    pub fn set_cold_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11970        self.cold_tier_size_used_gib = v.into();
11971        self
11972    }
11973
11974    /// Sets the value of [hot_tier_size_used_gib][crate::model::StoragePool::hot_tier_size_used_gib].
11975    ///
11976    /// # Example
11977    /// ```ignore,no_run
11978    /// # use google_cloud_netapp_v1::model::StoragePool;
11979    /// let x = StoragePool::new().set_hot_tier_size_used_gib(42);
11980    /// ```
11981    pub fn set_hot_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11982        self.hot_tier_size_used_gib = v.into();
11983        self
11984    }
11985
11986    /// Sets the value of [r#type][crate::model::StoragePool::type].
11987    ///
11988    /// # Example
11989    /// ```ignore,no_run
11990    /// # use google_cloud_netapp_v1::model::StoragePool;
11991    /// use google_cloud_netapp_v1::model::StoragePoolType;
11992    /// let x0 = StoragePool::new().set_type(StoragePoolType::File);
11993    /// let x1 = StoragePool::new().set_type(StoragePoolType::Unified);
11994    /// let x2 = StoragePool::new().set_type(StoragePoolType::UnifiedLargeCapacity);
11995    /// ```
11996    pub fn set_type<T>(mut self, v: T) -> Self
11997    where
11998        T: std::convert::Into<crate::model::StoragePoolType>,
11999    {
12000        self.r#type = std::option::Option::Some(v.into());
12001        self
12002    }
12003
12004    /// Sets or clears the value of [r#type][crate::model::StoragePool::type].
12005    ///
12006    /// # Example
12007    /// ```ignore,no_run
12008    /// # use google_cloud_netapp_v1::model::StoragePool;
12009    /// use google_cloud_netapp_v1::model::StoragePoolType;
12010    /// let x0 = StoragePool::new().set_or_clear_type(Some(StoragePoolType::File));
12011    /// let x1 = StoragePool::new().set_or_clear_type(Some(StoragePoolType::Unified));
12012    /// let x2 = StoragePool::new().set_or_clear_type(Some(StoragePoolType::UnifiedLargeCapacity));
12013    /// let x_none = StoragePool::new().set_or_clear_type(None::<StoragePoolType>);
12014    /// ```
12015    pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
12016    where
12017        T: std::convert::Into<crate::model::StoragePoolType>,
12018    {
12019        self.r#type = v.map(|x| x.into());
12020        self
12021    }
12022}
12023
12024impl wkt::message::Message for StoragePool {
12025    fn typename() -> &'static str {
12026        "type.googleapis.com/google.cloud.netapp.v1.StoragePool"
12027    }
12028}
12029
12030/// Defines additional types related to [StoragePool].
12031pub mod storage_pool {
12032    #[allow(unused_imports)]
12033    use super::*;
12034
12035    /// The Storage Pool States
12036    ///
12037    /// # Working with unknown values
12038    ///
12039    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12040    /// additional enum variants at any time. Adding new variants is not considered
12041    /// a breaking change. Applications should write their code in anticipation of:
12042    ///
12043    /// - New values appearing in future releases of the client library, **and**
12044    /// - New values received dynamically, without application changes.
12045    ///
12046    /// Please consult the [Working with enums] section in the user guide for some
12047    /// guidelines.
12048    ///
12049    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12050    #[derive(Clone, Debug, PartialEq)]
12051    #[non_exhaustive]
12052    pub enum State {
12053        /// Unspecified Storage Pool State
12054        Unspecified,
12055        /// Storage Pool State is Ready
12056        Ready,
12057        /// Storage Pool State is Creating
12058        Creating,
12059        /// Storage Pool State is Deleting
12060        Deleting,
12061        /// Storage Pool State is Updating
12062        Updating,
12063        /// Storage Pool State is Restoring
12064        Restoring,
12065        /// Storage Pool State is Disabled
12066        Disabled,
12067        /// Storage Pool State is Error
12068        Error,
12069        /// If set, the enum was initialized with an unknown value.
12070        ///
12071        /// Applications can examine the value using [State::value] or
12072        /// [State::name].
12073        UnknownValue(state::UnknownValue),
12074    }
12075
12076    #[doc(hidden)]
12077    pub mod state {
12078        #[allow(unused_imports)]
12079        use super::*;
12080        #[derive(Clone, Debug, PartialEq)]
12081        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12082    }
12083
12084    impl State {
12085        /// Gets the enum value.
12086        ///
12087        /// Returns `None` if the enum contains an unknown value deserialized from
12088        /// the string representation of enums.
12089        pub fn value(&self) -> std::option::Option<i32> {
12090            match self {
12091                Self::Unspecified => std::option::Option::Some(0),
12092                Self::Ready => std::option::Option::Some(1),
12093                Self::Creating => std::option::Option::Some(2),
12094                Self::Deleting => std::option::Option::Some(3),
12095                Self::Updating => std::option::Option::Some(4),
12096                Self::Restoring => std::option::Option::Some(5),
12097                Self::Disabled => std::option::Option::Some(6),
12098                Self::Error => std::option::Option::Some(7),
12099                Self::UnknownValue(u) => u.0.value(),
12100            }
12101        }
12102
12103        /// Gets the enum value as a string.
12104        ///
12105        /// Returns `None` if the enum contains an unknown value deserialized from
12106        /// the integer representation of enums.
12107        pub fn name(&self) -> std::option::Option<&str> {
12108            match self {
12109                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12110                Self::Ready => std::option::Option::Some("READY"),
12111                Self::Creating => std::option::Option::Some("CREATING"),
12112                Self::Deleting => std::option::Option::Some("DELETING"),
12113                Self::Updating => std::option::Option::Some("UPDATING"),
12114                Self::Restoring => std::option::Option::Some("RESTORING"),
12115                Self::Disabled => std::option::Option::Some("DISABLED"),
12116                Self::Error => std::option::Option::Some("ERROR"),
12117                Self::UnknownValue(u) => u.0.name(),
12118            }
12119        }
12120    }
12121
12122    impl std::default::Default for State {
12123        fn default() -> Self {
12124            use std::convert::From;
12125            Self::from(0)
12126        }
12127    }
12128
12129    impl std::fmt::Display for State {
12130        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12131            wkt::internal::display_enum(f, self.name(), self.value())
12132        }
12133    }
12134
12135    impl std::convert::From<i32> for State {
12136        fn from(value: i32) -> Self {
12137            match value {
12138                0 => Self::Unspecified,
12139                1 => Self::Ready,
12140                2 => Self::Creating,
12141                3 => Self::Deleting,
12142                4 => Self::Updating,
12143                5 => Self::Restoring,
12144                6 => Self::Disabled,
12145                7 => Self::Error,
12146                _ => Self::UnknownValue(state::UnknownValue(
12147                    wkt::internal::UnknownEnumValue::Integer(value),
12148                )),
12149            }
12150        }
12151    }
12152
12153    impl std::convert::From<&str> for State {
12154        fn from(value: &str) -> Self {
12155            use std::string::ToString;
12156            match value {
12157                "STATE_UNSPECIFIED" => Self::Unspecified,
12158                "READY" => Self::Ready,
12159                "CREATING" => Self::Creating,
12160                "DELETING" => Self::Deleting,
12161                "UPDATING" => Self::Updating,
12162                "RESTORING" => Self::Restoring,
12163                "DISABLED" => Self::Disabled,
12164                "ERROR" => Self::Error,
12165                _ => Self::UnknownValue(state::UnknownValue(
12166                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12167                )),
12168            }
12169        }
12170    }
12171
12172    impl serde::ser::Serialize for State {
12173        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12174        where
12175            S: serde::Serializer,
12176        {
12177            match self {
12178                Self::Unspecified => serializer.serialize_i32(0),
12179                Self::Ready => serializer.serialize_i32(1),
12180                Self::Creating => serializer.serialize_i32(2),
12181                Self::Deleting => serializer.serialize_i32(3),
12182                Self::Updating => serializer.serialize_i32(4),
12183                Self::Restoring => serializer.serialize_i32(5),
12184                Self::Disabled => serializer.serialize_i32(6),
12185                Self::Error => serializer.serialize_i32(7),
12186                Self::UnknownValue(u) => u.0.serialize(serializer),
12187            }
12188        }
12189    }
12190
12191    impl<'de> serde::de::Deserialize<'de> for State {
12192        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12193        where
12194            D: serde::Deserializer<'de>,
12195        {
12196            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12197                ".google.cloud.netapp.v1.StoragePool.State",
12198            ))
12199        }
12200    }
12201}
12202
12203/// ValidateDirectoryServiceRequest validates the directory service policy
12204/// attached to the storage pool.
12205#[derive(Clone, Default, PartialEq)]
12206#[non_exhaustive]
12207pub struct ValidateDirectoryServiceRequest {
12208    /// Required. Name of the storage pool
12209    pub name: std::string::String,
12210
12211    /// Type of directory service policy attached to the storage pool.
12212    pub directory_service_type: crate::model::DirectoryServiceType,
12213
12214    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12215}
12216
12217impl ValidateDirectoryServiceRequest {
12218    pub fn new() -> Self {
12219        std::default::Default::default()
12220    }
12221
12222    /// Sets the value of [name][crate::model::ValidateDirectoryServiceRequest::name].
12223    ///
12224    /// # Example
12225    /// ```ignore,no_run
12226    /// # use google_cloud_netapp_v1::model::ValidateDirectoryServiceRequest;
12227    /// let x = ValidateDirectoryServiceRequest::new().set_name("example");
12228    /// ```
12229    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12230        self.name = v.into();
12231        self
12232    }
12233
12234    /// Sets the value of [directory_service_type][crate::model::ValidateDirectoryServiceRequest::directory_service_type].
12235    ///
12236    /// # Example
12237    /// ```ignore,no_run
12238    /// # use google_cloud_netapp_v1::model::ValidateDirectoryServiceRequest;
12239    /// use google_cloud_netapp_v1::model::DirectoryServiceType;
12240    /// let x0 = ValidateDirectoryServiceRequest::new().set_directory_service_type(DirectoryServiceType::ActiveDirectory);
12241    /// ```
12242    pub fn set_directory_service_type<T: std::convert::Into<crate::model::DirectoryServiceType>>(
12243        mut self,
12244        v: T,
12245    ) -> Self {
12246        self.directory_service_type = v.into();
12247        self
12248    }
12249}
12250
12251impl wkt::message::Message for ValidateDirectoryServiceRequest {
12252    fn typename() -> &'static str {
12253        "type.googleapis.com/google.cloud.netapp.v1.ValidateDirectoryServiceRequest"
12254    }
12255}
12256
12257/// Message for requesting list of Volumes
12258#[derive(Clone, Default, PartialEq)]
12259#[non_exhaustive]
12260pub struct ListVolumesRequest {
12261    /// Required. Parent value for ListVolumesRequest
12262    pub parent: std::string::String,
12263
12264    /// Requested page size. Server may return fewer items than requested.
12265    /// If unspecified, the server will pick an appropriate default.
12266    pub page_size: i32,
12267
12268    /// A token identifying a page of results the server should return.
12269    pub page_token: std::string::String,
12270
12271    /// Filtering results
12272    pub filter: std::string::String,
12273
12274    /// Hint for how to order the results
12275    pub order_by: std::string::String,
12276
12277    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12278}
12279
12280impl ListVolumesRequest {
12281    pub fn new() -> Self {
12282        std::default::Default::default()
12283    }
12284
12285    /// Sets the value of [parent][crate::model::ListVolumesRequest::parent].
12286    ///
12287    /// # Example
12288    /// ```ignore,no_run
12289    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12290    /// let x = ListVolumesRequest::new().set_parent("example");
12291    /// ```
12292    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12293        self.parent = v.into();
12294        self
12295    }
12296
12297    /// Sets the value of [page_size][crate::model::ListVolumesRequest::page_size].
12298    ///
12299    /// # Example
12300    /// ```ignore,no_run
12301    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12302    /// let x = ListVolumesRequest::new().set_page_size(42);
12303    /// ```
12304    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12305        self.page_size = v.into();
12306        self
12307    }
12308
12309    /// Sets the value of [page_token][crate::model::ListVolumesRequest::page_token].
12310    ///
12311    /// # Example
12312    /// ```ignore,no_run
12313    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12314    /// let x = ListVolumesRequest::new().set_page_token("example");
12315    /// ```
12316    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12317        self.page_token = v.into();
12318        self
12319    }
12320
12321    /// Sets the value of [filter][crate::model::ListVolumesRequest::filter].
12322    ///
12323    /// # Example
12324    /// ```ignore,no_run
12325    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12326    /// let x = ListVolumesRequest::new().set_filter("example");
12327    /// ```
12328    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12329        self.filter = v.into();
12330        self
12331    }
12332
12333    /// Sets the value of [order_by][crate::model::ListVolumesRequest::order_by].
12334    ///
12335    /// # Example
12336    /// ```ignore,no_run
12337    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12338    /// let x = ListVolumesRequest::new().set_order_by("example");
12339    /// ```
12340    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12341        self.order_by = v.into();
12342        self
12343    }
12344}
12345
12346impl wkt::message::Message for ListVolumesRequest {
12347    fn typename() -> &'static str {
12348        "type.googleapis.com/google.cloud.netapp.v1.ListVolumesRequest"
12349    }
12350}
12351
12352/// Message for response to listing Volumes
12353#[derive(Clone, Default, PartialEq)]
12354#[non_exhaustive]
12355pub struct ListVolumesResponse {
12356    /// The list of Volume
12357    pub volumes: std::vec::Vec<crate::model::Volume>,
12358
12359    /// A token identifying a page of results the server should return.
12360    pub next_page_token: std::string::String,
12361
12362    /// Locations that could not be reached.
12363    pub unreachable: std::vec::Vec<std::string::String>,
12364
12365    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12366}
12367
12368impl ListVolumesResponse {
12369    pub fn new() -> Self {
12370        std::default::Default::default()
12371    }
12372
12373    /// Sets the value of [volumes][crate::model::ListVolumesResponse::volumes].
12374    ///
12375    /// # Example
12376    /// ```ignore,no_run
12377    /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
12378    /// use google_cloud_netapp_v1::model::Volume;
12379    /// let x = ListVolumesResponse::new()
12380    ///     .set_volumes([
12381    ///         Volume::default()/* use setters */,
12382    ///         Volume::default()/* use (different) setters */,
12383    ///     ]);
12384    /// ```
12385    pub fn set_volumes<T, V>(mut self, v: T) -> Self
12386    where
12387        T: std::iter::IntoIterator<Item = V>,
12388        V: std::convert::Into<crate::model::Volume>,
12389    {
12390        use std::iter::Iterator;
12391        self.volumes = v.into_iter().map(|i| i.into()).collect();
12392        self
12393    }
12394
12395    /// Sets the value of [next_page_token][crate::model::ListVolumesResponse::next_page_token].
12396    ///
12397    /// # Example
12398    /// ```ignore,no_run
12399    /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
12400    /// let x = ListVolumesResponse::new().set_next_page_token("example");
12401    /// ```
12402    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12403        self.next_page_token = v.into();
12404        self
12405    }
12406
12407    /// Sets the value of [unreachable][crate::model::ListVolumesResponse::unreachable].
12408    ///
12409    /// # Example
12410    /// ```ignore,no_run
12411    /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
12412    /// let x = ListVolumesResponse::new().set_unreachable(["a", "b", "c"]);
12413    /// ```
12414    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
12415    where
12416        T: std::iter::IntoIterator<Item = V>,
12417        V: std::convert::Into<std::string::String>,
12418    {
12419        use std::iter::Iterator;
12420        self.unreachable = v.into_iter().map(|i| i.into()).collect();
12421        self
12422    }
12423}
12424
12425impl wkt::message::Message for ListVolumesResponse {
12426    fn typename() -> &'static str {
12427        "type.googleapis.com/google.cloud.netapp.v1.ListVolumesResponse"
12428    }
12429}
12430
12431#[doc(hidden)]
12432impl google_cloud_gax::paginator::internal::PageableResponse for ListVolumesResponse {
12433    type PageItem = crate::model::Volume;
12434
12435    fn items(self) -> std::vec::Vec<Self::PageItem> {
12436        self.volumes
12437    }
12438
12439    fn next_page_token(&self) -> std::string::String {
12440        use std::clone::Clone;
12441        self.next_page_token.clone()
12442    }
12443}
12444
12445/// Message for getting a Volume
12446#[derive(Clone, Default, PartialEq)]
12447#[non_exhaustive]
12448pub struct GetVolumeRequest {
12449    /// Required. Name of the volume
12450    pub name: std::string::String,
12451
12452    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12453}
12454
12455impl GetVolumeRequest {
12456    pub fn new() -> Self {
12457        std::default::Default::default()
12458    }
12459
12460    /// Sets the value of [name][crate::model::GetVolumeRequest::name].
12461    ///
12462    /// # Example
12463    /// ```ignore,no_run
12464    /// # use google_cloud_netapp_v1::model::GetVolumeRequest;
12465    /// let x = GetVolumeRequest::new().set_name("example");
12466    /// ```
12467    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12468        self.name = v.into();
12469        self
12470    }
12471}
12472
12473impl wkt::message::Message for GetVolumeRequest {
12474    fn typename() -> &'static str {
12475        "type.googleapis.com/google.cloud.netapp.v1.GetVolumeRequest"
12476    }
12477}
12478
12479/// Message for creating a Volume
12480#[derive(Clone, Default, PartialEq)]
12481#[non_exhaustive]
12482pub struct CreateVolumeRequest {
12483    /// Required. Value for parent.
12484    pub parent: std::string::String,
12485
12486    /// Required. Id of the requesting volume. Must be unique within the parent
12487    /// resource. Must contain only letters, numbers and hyphen, with the first
12488    /// character a letter, the last a letter or a number,
12489    /// and a 63 character maximum.
12490    pub volume_id: std::string::String,
12491
12492    /// Required. The volume being created.
12493    pub volume: std::option::Option<crate::model::Volume>,
12494
12495    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12496}
12497
12498impl CreateVolumeRequest {
12499    pub fn new() -> Self {
12500        std::default::Default::default()
12501    }
12502
12503    /// Sets the value of [parent][crate::model::CreateVolumeRequest::parent].
12504    ///
12505    /// # Example
12506    /// ```ignore,no_run
12507    /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
12508    /// let x = CreateVolumeRequest::new().set_parent("example");
12509    /// ```
12510    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12511        self.parent = v.into();
12512        self
12513    }
12514
12515    /// Sets the value of [volume_id][crate::model::CreateVolumeRequest::volume_id].
12516    ///
12517    /// # Example
12518    /// ```ignore,no_run
12519    /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
12520    /// let x = CreateVolumeRequest::new().set_volume_id("example");
12521    /// ```
12522    pub fn set_volume_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12523        self.volume_id = v.into();
12524        self
12525    }
12526
12527    /// Sets the value of [volume][crate::model::CreateVolumeRequest::volume].
12528    ///
12529    /// # Example
12530    /// ```ignore,no_run
12531    /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
12532    /// use google_cloud_netapp_v1::model::Volume;
12533    /// let x = CreateVolumeRequest::new().set_volume(Volume::default()/* use setters */);
12534    /// ```
12535    pub fn set_volume<T>(mut self, v: T) -> Self
12536    where
12537        T: std::convert::Into<crate::model::Volume>,
12538    {
12539        self.volume = std::option::Option::Some(v.into());
12540        self
12541    }
12542
12543    /// Sets or clears the value of [volume][crate::model::CreateVolumeRequest::volume].
12544    ///
12545    /// # Example
12546    /// ```ignore,no_run
12547    /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
12548    /// use google_cloud_netapp_v1::model::Volume;
12549    /// let x = CreateVolumeRequest::new().set_or_clear_volume(Some(Volume::default()/* use setters */));
12550    /// let x = CreateVolumeRequest::new().set_or_clear_volume(None::<Volume>);
12551    /// ```
12552    pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
12553    where
12554        T: std::convert::Into<crate::model::Volume>,
12555    {
12556        self.volume = v.map(|x| x.into());
12557        self
12558    }
12559}
12560
12561impl wkt::message::Message for CreateVolumeRequest {
12562    fn typename() -> &'static str {
12563        "type.googleapis.com/google.cloud.netapp.v1.CreateVolumeRequest"
12564    }
12565}
12566
12567/// Message for updating a Volume
12568#[derive(Clone, Default, PartialEq)]
12569#[non_exhaustive]
12570pub struct UpdateVolumeRequest {
12571    /// Required. Field mask is used to specify the fields to be overwritten in the
12572    /// Volume resource by the update.
12573    /// The fields specified in the update_mask are relative to the resource, not
12574    /// the full request. A field will be overwritten if it is in the mask. If the
12575    /// user does not provide a mask then all fields will be overwritten.
12576    pub update_mask: std::option::Option<wkt::FieldMask>,
12577
12578    /// Required. The volume being updated
12579    pub volume: std::option::Option<crate::model::Volume>,
12580
12581    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12582}
12583
12584impl UpdateVolumeRequest {
12585    pub fn new() -> Self {
12586        std::default::Default::default()
12587    }
12588
12589    /// Sets the value of [update_mask][crate::model::UpdateVolumeRequest::update_mask].
12590    ///
12591    /// # Example
12592    /// ```ignore,no_run
12593    /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
12594    /// use wkt::FieldMask;
12595    /// let x = UpdateVolumeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
12596    /// ```
12597    pub fn set_update_mask<T>(mut self, v: T) -> Self
12598    where
12599        T: std::convert::Into<wkt::FieldMask>,
12600    {
12601        self.update_mask = std::option::Option::Some(v.into());
12602        self
12603    }
12604
12605    /// Sets or clears the value of [update_mask][crate::model::UpdateVolumeRequest::update_mask].
12606    ///
12607    /// # Example
12608    /// ```ignore,no_run
12609    /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
12610    /// use wkt::FieldMask;
12611    /// let x = UpdateVolumeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
12612    /// let x = UpdateVolumeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
12613    /// ```
12614    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12615    where
12616        T: std::convert::Into<wkt::FieldMask>,
12617    {
12618        self.update_mask = v.map(|x| x.into());
12619        self
12620    }
12621
12622    /// Sets the value of [volume][crate::model::UpdateVolumeRequest::volume].
12623    ///
12624    /// # Example
12625    /// ```ignore,no_run
12626    /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
12627    /// use google_cloud_netapp_v1::model::Volume;
12628    /// let x = UpdateVolumeRequest::new().set_volume(Volume::default()/* use setters */);
12629    /// ```
12630    pub fn set_volume<T>(mut self, v: T) -> Self
12631    where
12632        T: std::convert::Into<crate::model::Volume>,
12633    {
12634        self.volume = std::option::Option::Some(v.into());
12635        self
12636    }
12637
12638    /// Sets or clears the value of [volume][crate::model::UpdateVolumeRequest::volume].
12639    ///
12640    /// # Example
12641    /// ```ignore,no_run
12642    /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
12643    /// use google_cloud_netapp_v1::model::Volume;
12644    /// let x = UpdateVolumeRequest::new().set_or_clear_volume(Some(Volume::default()/* use setters */));
12645    /// let x = UpdateVolumeRequest::new().set_or_clear_volume(None::<Volume>);
12646    /// ```
12647    pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
12648    where
12649        T: std::convert::Into<crate::model::Volume>,
12650    {
12651        self.volume = v.map(|x| x.into());
12652        self
12653    }
12654}
12655
12656impl wkt::message::Message for UpdateVolumeRequest {
12657    fn typename() -> &'static str {
12658        "type.googleapis.com/google.cloud.netapp.v1.UpdateVolumeRequest"
12659    }
12660}
12661
12662/// Message for deleting a Volume
12663#[derive(Clone, Default, PartialEq)]
12664#[non_exhaustive]
12665pub struct DeleteVolumeRequest {
12666    /// Required. Name of the volume
12667    pub name: std::string::String,
12668
12669    /// If this field is set as true, CCFE will not block the volume resource
12670    /// deletion even if it has any snapshots resource. (Otherwise, the request
12671    /// will only work if the volume has no snapshots.)
12672    pub force: bool,
12673
12674    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12675}
12676
12677impl DeleteVolumeRequest {
12678    pub fn new() -> Self {
12679        std::default::Default::default()
12680    }
12681
12682    /// Sets the value of [name][crate::model::DeleteVolumeRequest::name].
12683    ///
12684    /// # Example
12685    /// ```ignore,no_run
12686    /// # use google_cloud_netapp_v1::model::DeleteVolumeRequest;
12687    /// let x = DeleteVolumeRequest::new().set_name("example");
12688    /// ```
12689    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12690        self.name = v.into();
12691        self
12692    }
12693
12694    /// Sets the value of [force][crate::model::DeleteVolumeRequest::force].
12695    ///
12696    /// # Example
12697    /// ```ignore,no_run
12698    /// # use google_cloud_netapp_v1::model::DeleteVolumeRequest;
12699    /// let x = DeleteVolumeRequest::new().set_force(true);
12700    /// ```
12701    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12702        self.force = v.into();
12703        self
12704    }
12705}
12706
12707impl wkt::message::Message for DeleteVolumeRequest {
12708    fn typename() -> &'static str {
12709        "type.googleapis.com/google.cloud.netapp.v1.DeleteVolumeRequest"
12710    }
12711}
12712
12713/// RevertVolumeRequest reverts the given volume to the specified snapshot.
12714#[derive(Clone, Default, PartialEq)]
12715#[non_exhaustive]
12716pub struct RevertVolumeRequest {
12717    /// Required. The resource name of the volume, in the format of
12718    /// projects/{project_id}/locations/{location}/volumes/{volume_id}.
12719    pub name: std::string::String,
12720
12721    /// Required. The snapshot resource ID, in the format 'my-snapshot', where the
12722    /// specified ID is the {snapshot_id} of the fully qualified name like
12723    /// projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}
12724    pub snapshot_id: std::string::String,
12725
12726    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12727}
12728
12729impl RevertVolumeRequest {
12730    pub fn new() -> Self {
12731        std::default::Default::default()
12732    }
12733
12734    /// Sets the value of [name][crate::model::RevertVolumeRequest::name].
12735    ///
12736    /// # Example
12737    /// ```ignore,no_run
12738    /// # use google_cloud_netapp_v1::model::RevertVolumeRequest;
12739    /// let x = RevertVolumeRequest::new().set_name("example");
12740    /// ```
12741    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12742        self.name = v.into();
12743        self
12744    }
12745
12746    /// Sets the value of [snapshot_id][crate::model::RevertVolumeRequest::snapshot_id].
12747    ///
12748    /// # Example
12749    /// ```ignore,no_run
12750    /// # use google_cloud_netapp_v1::model::RevertVolumeRequest;
12751    /// let x = RevertVolumeRequest::new().set_snapshot_id("example");
12752    /// ```
12753    pub fn set_snapshot_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12754        self.snapshot_id = v.into();
12755        self
12756    }
12757}
12758
12759impl wkt::message::Message for RevertVolumeRequest {
12760    fn typename() -> &'static str {
12761        "type.googleapis.com/google.cloud.netapp.v1.RevertVolumeRequest"
12762    }
12763}
12764
12765/// Volume provides a filesystem that you can mount.
12766#[derive(Clone, Default, PartialEq)]
12767#[non_exhaustive]
12768pub struct Volume {
12769    /// Identifier. Name of the volume
12770    pub name: std::string::String,
12771
12772    /// Output only. State of the volume
12773    pub state: crate::model::volume::State,
12774
12775    /// Output only. State details of the volume
12776    pub state_details: std::string::String,
12777
12778    /// Output only. Create time of the volume
12779    pub create_time: std::option::Option<wkt::Timestamp>,
12780
12781    /// Required. Share name of the volume
12782    pub share_name: std::string::String,
12783
12784    /// Output only. This field is not implemented. The values provided in this
12785    /// field are ignored.
12786    pub psa_range: std::string::String,
12787
12788    /// Required. StoragePool name of the volume
12789    pub storage_pool: std::string::String,
12790
12791    /// Output only. VPC Network name.
12792    /// Format: projects/{project}/global/networks/{network}
12793    pub network: std::string::String,
12794
12795    /// Output only. Service level of the volume
12796    pub service_level: crate::model::ServiceLevel,
12797
12798    /// Required. Capacity in GIB of the volume
12799    pub capacity_gib: i64,
12800
12801    /// Optional. Export policy of the volume
12802    pub export_policy: std::option::Option<crate::model::ExportPolicy>,
12803
12804    /// Required. Protocols required for the volume
12805    pub protocols: std::vec::Vec<crate::model::Protocols>,
12806
12807    /// Optional. SMB share settings for the volume.
12808    pub smb_settings: std::vec::Vec<crate::model::SMBSettings>,
12809
12810    /// Output only. Mount options of this volume
12811    pub mount_options: std::vec::Vec<crate::model::MountOption>,
12812
12813    /// Optional. Default unix style permission (e.g. 777) the mount point will be
12814    /// created with. Applicable for NFS protocol types only.
12815    pub unix_permissions: std::string::String,
12816
12817    /// Optional. Labels as key value pairs
12818    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12819
12820    /// Optional. Description of the volume
12821    pub description: std::string::String,
12822
12823    /// Optional. SnapshotPolicy for a volume.
12824    pub snapshot_policy: std::option::Option<crate::model::SnapshotPolicy>,
12825
12826    /// Optional. Snap_reserve specifies percentage of volume storage reserved for
12827    /// snapshot storage. Default is 0 percent.
12828    pub snap_reserve: f64,
12829
12830    /// Optional. Snapshot_directory if enabled (true) the volume will contain a
12831    /// read-only .snapshot directory which provides access to each of the volume's
12832    /// snapshots.
12833    pub snapshot_directory: bool,
12834
12835    /// Output only. Used capacity in GIB of the volume. This is computed
12836    /// periodically and it does not represent the realtime usage.
12837    pub used_gib: i64,
12838
12839    /// Optional. Security Style of the Volume
12840    pub security_style: crate::model::SecurityStyle,
12841
12842    /// Optional. Flag indicating if the volume is a kerberos volume or not, export
12843    /// policy rules control kerberos security modes (krb5, krb5i, krb5p).
12844    pub kerberos_enabled: bool,
12845
12846    /// Output only. Flag indicating if the volume is NFS LDAP enabled or not.
12847    pub ldap_enabled: bool,
12848
12849    /// Output only. Specifies the ActiveDirectory name of a SMB volume.
12850    pub active_directory: std::string::String,
12851
12852    /// Optional. Specifies the source of the volume to be created from.
12853    pub restore_parameters: std::option::Option<crate::model::RestoreParameters>,
12854
12855    /// Output only. Specifies the KMS config to be used for volume encryption.
12856    pub kms_config: std::string::String,
12857
12858    /// Output only. Specified the current volume encryption key source.
12859    pub encryption_type: crate::model::EncryptionType,
12860
12861    /// Output only. Indicates whether the volume is part of a replication
12862    /// relationship.
12863    pub has_replication: bool,
12864
12865    /// BackupConfig of the volume.
12866    pub backup_config: std::option::Option<crate::model::BackupConfig>,
12867
12868    /// Optional. List of actions that are restricted on this volume.
12869    pub restricted_actions: std::vec::Vec<crate::model::RestrictedAction>,
12870
12871    /// Optional. Flag indicating if the volume will be a large capacity volume or
12872    /// a regular volume.
12873    pub large_capacity: bool,
12874
12875    /// Optional. Flag indicating if the volume will have an IP address per node
12876    /// for volumes supporting multiple IP endpoints. Only the volume with
12877    /// large_capacity will be allowed to have multiple endpoints.
12878    pub multiple_endpoints: bool,
12879
12880    /// Tiering policy for the volume.
12881    pub tiering_policy: std::option::Option<crate::model::TieringPolicy>,
12882
12883    /// Output only. Specifies the replica zone for regional volume.
12884    pub replica_zone: std::string::String,
12885
12886    /// Output only. Specifies the active zone for regional volume.
12887    pub zone: std::string::String,
12888
12889    /// Output only. Size of the volume cold tier data rounded down to the nearest
12890    /// GiB.
12891    pub cold_tier_size_gib: i64,
12892
12893    /// Optional. The Hybrid Replication parameters for the volume.
12894    pub hybrid_replication_parameters:
12895        std::option::Option<crate::model::HybridReplicationParameters>,
12896
12897    /// Optional. Throughput of the volume (in MiB/s)
12898    pub throughput_mibps: f64,
12899
12900    /// Optional. Cache parameters for the volume.
12901    pub cache_parameters: std::option::Option<crate::model::CacheParameters>,
12902
12903    /// Output only. Total hot tier data rounded down to the nearest GiB used by
12904    /// the Volume. This field is only used for flex Service Level
12905    pub hot_tier_size_used_gib: i64,
12906
12907    /// Optional. Block devices for the volume.
12908    /// Currently, only one block device is permitted per Volume.
12909    pub block_devices: std::vec::Vec<crate::model::BlockDevice>,
12910
12911    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12912}
12913
12914impl Volume {
12915    pub fn new() -> Self {
12916        std::default::Default::default()
12917    }
12918
12919    /// Sets the value of [name][crate::model::Volume::name].
12920    ///
12921    /// # Example
12922    /// ```ignore,no_run
12923    /// # use google_cloud_netapp_v1::model::Volume;
12924    /// let x = Volume::new().set_name("example");
12925    /// ```
12926    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12927        self.name = v.into();
12928        self
12929    }
12930
12931    /// Sets the value of [state][crate::model::Volume::state].
12932    ///
12933    /// # Example
12934    /// ```ignore,no_run
12935    /// # use google_cloud_netapp_v1::model::Volume;
12936    /// use google_cloud_netapp_v1::model::volume::State;
12937    /// let x0 = Volume::new().set_state(State::Ready);
12938    /// let x1 = Volume::new().set_state(State::Creating);
12939    /// let x2 = Volume::new().set_state(State::Deleting);
12940    /// ```
12941    pub fn set_state<T: std::convert::Into<crate::model::volume::State>>(mut self, v: T) -> Self {
12942        self.state = v.into();
12943        self
12944    }
12945
12946    /// Sets the value of [state_details][crate::model::Volume::state_details].
12947    ///
12948    /// # Example
12949    /// ```ignore,no_run
12950    /// # use google_cloud_netapp_v1::model::Volume;
12951    /// let x = Volume::new().set_state_details("example");
12952    /// ```
12953    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12954        self.state_details = v.into();
12955        self
12956    }
12957
12958    /// Sets the value of [create_time][crate::model::Volume::create_time].
12959    ///
12960    /// # Example
12961    /// ```ignore,no_run
12962    /// # use google_cloud_netapp_v1::model::Volume;
12963    /// use wkt::Timestamp;
12964    /// let x = Volume::new().set_create_time(Timestamp::default()/* use setters */);
12965    /// ```
12966    pub fn set_create_time<T>(mut self, v: T) -> Self
12967    where
12968        T: std::convert::Into<wkt::Timestamp>,
12969    {
12970        self.create_time = std::option::Option::Some(v.into());
12971        self
12972    }
12973
12974    /// Sets or clears the value of [create_time][crate::model::Volume::create_time].
12975    ///
12976    /// # Example
12977    /// ```ignore,no_run
12978    /// # use google_cloud_netapp_v1::model::Volume;
12979    /// use wkt::Timestamp;
12980    /// let x = Volume::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
12981    /// let x = Volume::new().set_or_clear_create_time(None::<Timestamp>);
12982    /// ```
12983    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12984    where
12985        T: std::convert::Into<wkt::Timestamp>,
12986    {
12987        self.create_time = v.map(|x| x.into());
12988        self
12989    }
12990
12991    /// Sets the value of [share_name][crate::model::Volume::share_name].
12992    ///
12993    /// # Example
12994    /// ```ignore,no_run
12995    /// # use google_cloud_netapp_v1::model::Volume;
12996    /// let x = Volume::new().set_share_name("example");
12997    /// ```
12998    pub fn set_share_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12999        self.share_name = v.into();
13000        self
13001    }
13002
13003    /// Sets the value of [psa_range][crate::model::Volume::psa_range].
13004    ///
13005    /// # Example
13006    /// ```ignore,no_run
13007    /// # use google_cloud_netapp_v1::model::Volume;
13008    /// let x = Volume::new().set_psa_range("example");
13009    /// ```
13010    pub fn set_psa_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13011        self.psa_range = v.into();
13012        self
13013    }
13014
13015    /// Sets the value of [storage_pool][crate::model::Volume::storage_pool].
13016    ///
13017    /// # Example
13018    /// ```ignore,no_run
13019    /// # use google_cloud_netapp_v1::model::Volume;
13020    /// let x = Volume::new().set_storage_pool("example");
13021    /// ```
13022    pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13023        self.storage_pool = v.into();
13024        self
13025    }
13026
13027    /// Sets the value of [network][crate::model::Volume::network].
13028    ///
13029    /// # Example
13030    /// ```ignore,no_run
13031    /// # use google_cloud_netapp_v1::model::Volume;
13032    /// let x = Volume::new().set_network("example");
13033    /// ```
13034    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13035        self.network = v.into();
13036        self
13037    }
13038
13039    /// Sets the value of [service_level][crate::model::Volume::service_level].
13040    ///
13041    /// # Example
13042    /// ```ignore,no_run
13043    /// # use google_cloud_netapp_v1::model::Volume;
13044    /// use google_cloud_netapp_v1::model::ServiceLevel;
13045    /// let x0 = Volume::new().set_service_level(ServiceLevel::Premium);
13046    /// let x1 = Volume::new().set_service_level(ServiceLevel::Extreme);
13047    /// let x2 = Volume::new().set_service_level(ServiceLevel::Standard);
13048    /// ```
13049    pub fn set_service_level<T: std::convert::Into<crate::model::ServiceLevel>>(
13050        mut self,
13051        v: T,
13052    ) -> Self {
13053        self.service_level = v.into();
13054        self
13055    }
13056
13057    /// Sets the value of [capacity_gib][crate::model::Volume::capacity_gib].
13058    ///
13059    /// # Example
13060    /// ```ignore,no_run
13061    /// # use google_cloud_netapp_v1::model::Volume;
13062    /// let x = Volume::new().set_capacity_gib(42);
13063    /// ```
13064    pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13065        self.capacity_gib = v.into();
13066        self
13067    }
13068
13069    /// Sets the value of [export_policy][crate::model::Volume::export_policy].
13070    ///
13071    /// # Example
13072    /// ```ignore,no_run
13073    /// # use google_cloud_netapp_v1::model::Volume;
13074    /// use google_cloud_netapp_v1::model::ExportPolicy;
13075    /// let x = Volume::new().set_export_policy(ExportPolicy::default()/* use setters */);
13076    /// ```
13077    pub fn set_export_policy<T>(mut self, v: T) -> Self
13078    where
13079        T: std::convert::Into<crate::model::ExportPolicy>,
13080    {
13081        self.export_policy = std::option::Option::Some(v.into());
13082        self
13083    }
13084
13085    /// Sets or clears the value of [export_policy][crate::model::Volume::export_policy].
13086    ///
13087    /// # Example
13088    /// ```ignore,no_run
13089    /// # use google_cloud_netapp_v1::model::Volume;
13090    /// use google_cloud_netapp_v1::model::ExportPolicy;
13091    /// let x = Volume::new().set_or_clear_export_policy(Some(ExportPolicy::default()/* use setters */));
13092    /// let x = Volume::new().set_or_clear_export_policy(None::<ExportPolicy>);
13093    /// ```
13094    pub fn set_or_clear_export_policy<T>(mut self, v: std::option::Option<T>) -> Self
13095    where
13096        T: std::convert::Into<crate::model::ExportPolicy>,
13097    {
13098        self.export_policy = v.map(|x| x.into());
13099        self
13100    }
13101
13102    /// Sets the value of [protocols][crate::model::Volume::protocols].
13103    ///
13104    /// # Example
13105    /// ```ignore,no_run
13106    /// # use google_cloud_netapp_v1::model::Volume;
13107    /// use google_cloud_netapp_v1::model::Protocols;
13108    /// let x = Volume::new().set_protocols([
13109    ///     Protocols::Nfsv3,
13110    ///     Protocols::Nfsv4,
13111    ///     Protocols::Smb,
13112    /// ]);
13113    /// ```
13114    pub fn set_protocols<T, V>(mut self, v: T) -> Self
13115    where
13116        T: std::iter::IntoIterator<Item = V>,
13117        V: std::convert::Into<crate::model::Protocols>,
13118    {
13119        use std::iter::Iterator;
13120        self.protocols = v.into_iter().map(|i| i.into()).collect();
13121        self
13122    }
13123
13124    /// Sets the value of [smb_settings][crate::model::Volume::smb_settings].
13125    ///
13126    /// # Example
13127    /// ```ignore,no_run
13128    /// # use google_cloud_netapp_v1::model::Volume;
13129    /// use google_cloud_netapp_v1::model::SMBSettings;
13130    /// let x = Volume::new().set_smb_settings([
13131    ///     SMBSettings::EncryptData,
13132    ///     SMBSettings::Browsable,
13133    ///     SMBSettings::ChangeNotify,
13134    /// ]);
13135    /// ```
13136    pub fn set_smb_settings<T, V>(mut self, v: T) -> Self
13137    where
13138        T: std::iter::IntoIterator<Item = V>,
13139        V: std::convert::Into<crate::model::SMBSettings>,
13140    {
13141        use std::iter::Iterator;
13142        self.smb_settings = v.into_iter().map(|i| i.into()).collect();
13143        self
13144    }
13145
13146    /// Sets the value of [mount_options][crate::model::Volume::mount_options].
13147    ///
13148    /// # Example
13149    /// ```ignore,no_run
13150    /// # use google_cloud_netapp_v1::model::Volume;
13151    /// use google_cloud_netapp_v1::model::MountOption;
13152    /// let x = Volume::new()
13153    ///     .set_mount_options([
13154    ///         MountOption::default()/* use setters */,
13155    ///         MountOption::default()/* use (different) setters */,
13156    ///     ]);
13157    /// ```
13158    pub fn set_mount_options<T, V>(mut self, v: T) -> Self
13159    where
13160        T: std::iter::IntoIterator<Item = V>,
13161        V: std::convert::Into<crate::model::MountOption>,
13162    {
13163        use std::iter::Iterator;
13164        self.mount_options = v.into_iter().map(|i| i.into()).collect();
13165        self
13166    }
13167
13168    /// Sets the value of [unix_permissions][crate::model::Volume::unix_permissions].
13169    ///
13170    /// # Example
13171    /// ```ignore,no_run
13172    /// # use google_cloud_netapp_v1::model::Volume;
13173    /// let x = Volume::new().set_unix_permissions("example");
13174    /// ```
13175    pub fn set_unix_permissions<T: std::convert::Into<std::string::String>>(
13176        mut self,
13177        v: T,
13178    ) -> Self {
13179        self.unix_permissions = v.into();
13180        self
13181    }
13182
13183    /// Sets the value of [labels][crate::model::Volume::labels].
13184    ///
13185    /// # Example
13186    /// ```ignore,no_run
13187    /// # use google_cloud_netapp_v1::model::Volume;
13188    /// let x = Volume::new().set_labels([
13189    ///     ("key0", "abc"),
13190    ///     ("key1", "xyz"),
13191    /// ]);
13192    /// ```
13193    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
13194    where
13195        T: std::iter::IntoIterator<Item = (K, V)>,
13196        K: std::convert::Into<std::string::String>,
13197        V: std::convert::Into<std::string::String>,
13198    {
13199        use std::iter::Iterator;
13200        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13201        self
13202    }
13203
13204    /// Sets the value of [description][crate::model::Volume::description].
13205    ///
13206    /// # Example
13207    /// ```ignore,no_run
13208    /// # use google_cloud_netapp_v1::model::Volume;
13209    /// let x = Volume::new().set_description("example");
13210    /// ```
13211    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13212        self.description = v.into();
13213        self
13214    }
13215
13216    /// Sets the value of [snapshot_policy][crate::model::Volume::snapshot_policy].
13217    ///
13218    /// # Example
13219    /// ```ignore,no_run
13220    /// # use google_cloud_netapp_v1::model::Volume;
13221    /// use google_cloud_netapp_v1::model::SnapshotPolicy;
13222    /// let x = Volume::new().set_snapshot_policy(SnapshotPolicy::default()/* use setters */);
13223    /// ```
13224    pub fn set_snapshot_policy<T>(mut self, v: T) -> Self
13225    where
13226        T: std::convert::Into<crate::model::SnapshotPolicy>,
13227    {
13228        self.snapshot_policy = std::option::Option::Some(v.into());
13229        self
13230    }
13231
13232    /// Sets or clears the value of [snapshot_policy][crate::model::Volume::snapshot_policy].
13233    ///
13234    /// # Example
13235    /// ```ignore,no_run
13236    /// # use google_cloud_netapp_v1::model::Volume;
13237    /// use google_cloud_netapp_v1::model::SnapshotPolicy;
13238    /// let x = Volume::new().set_or_clear_snapshot_policy(Some(SnapshotPolicy::default()/* use setters */));
13239    /// let x = Volume::new().set_or_clear_snapshot_policy(None::<SnapshotPolicy>);
13240    /// ```
13241    pub fn set_or_clear_snapshot_policy<T>(mut self, v: std::option::Option<T>) -> Self
13242    where
13243        T: std::convert::Into<crate::model::SnapshotPolicy>,
13244    {
13245        self.snapshot_policy = v.map(|x| x.into());
13246        self
13247    }
13248
13249    /// Sets the value of [snap_reserve][crate::model::Volume::snap_reserve].
13250    ///
13251    /// # Example
13252    /// ```ignore,no_run
13253    /// # use google_cloud_netapp_v1::model::Volume;
13254    /// let x = Volume::new().set_snap_reserve(42.0);
13255    /// ```
13256    pub fn set_snap_reserve<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
13257        self.snap_reserve = v.into();
13258        self
13259    }
13260
13261    /// Sets the value of [snapshot_directory][crate::model::Volume::snapshot_directory].
13262    ///
13263    /// # Example
13264    /// ```ignore,no_run
13265    /// # use google_cloud_netapp_v1::model::Volume;
13266    /// let x = Volume::new().set_snapshot_directory(true);
13267    /// ```
13268    pub fn set_snapshot_directory<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13269        self.snapshot_directory = v.into();
13270        self
13271    }
13272
13273    /// Sets the value of [used_gib][crate::model::Volume::used_gib].
13274    ///
13275    /// # Example
13276    /// ```ignore,no_run
13277    /// # use google_cloud_netapp_v1::model::Volume;
13278    /// let x = Volume::new().set_used_gib(42);
13279    /// ```
13280    pub fn set_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13281        self.used_gib = v.into();
13282        self
13283    }
13284
13285    /// Sets the value of [security_style][crate::model::Volume::security_style].
13286    ///
13287    /// # Example
13288    /// ```ignore,no_run
13289    /// # use google_cloud_netapp_v1::model::Volume;
13290    /// use google_cloud_netapp_v1::model::SecurityStyle;
13291    /// let x0 = Volume::new().set_security_style(SecurityStyle::Ntfs);
13292    /// let x1 = Volume::new().set_security_style(SecurityStyle::Unix);
13293    /// ```
13294    pub fn set_security_style<T: std::convert::Into<crate::model::SecurityStyle>>(
13295        mut self,
13296        v: T,
13297    ) -> Self {
13298        self.security_style = v.into();
13299        self
13300    }
13301
13302    /// Sets the value of [kerberos_enabled][crate::model::Volume::kerberos_enabled].
13303    ///
13304    /// # Example
13305    /// ```ignore,no_run
13306    /// # use google_cloud_netapp_v1::model::Volume;
13307    /// let x = Volume::new().set_kerberos_enabled(true);
13308    /// ```
13309    pub fn set_kerberos_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13310        self.kerberos_enabled = v.into();
13311        self
13312    }
13313
13314    /// Sets the value of [ldap_enabled][crate::model::Volume::ldap_enabled].
13315    ///
13316    /// # Example
13317    /// ```ignore,no_run
13318    /// # use google_cloud_netapp_v1::model::Volume;
13319    /// let x = Volume::new().set_ldap_enabled(true);
13320    /// ```
13321    pub fn set_ldap_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13322        self.ldap_enabled = v.into();
13323        self
13324    }
13325
13326    /// Sets the value of [active_directory][crate::model::Volume::active_directory].
13327    ///
13328    /// # Example
13329    /// ```ignore,no_run
13330    /// # use google_cloud_netapp_v1::model::Volume;
13331    /// let x = Volume::new().set_active_directory("example");
13332    /// ```
13333    pub fn set_active_directory<T: std::convert::Into<std::string::String>>(
13334        mut self,
13335        v: T,
13336    ) -> Self {
13337        self.active_directory = v.into();
13338        self
13339    }
13340
13341    /// Sets the value of [restore_parameters][crate::model::Volume::restore_parameters].
13342    ///
13343    /// # Example
13344    /// ```ignore,no_run
13345    /// # use google_cloud_netapp_v1::model::Volume;
13346    /// use google_cloud_netapp_v1::model::RestoreParameters;
13347    /// let x = Volume::new().set_restore_parameters(RestoreParameters::default()/* use setters */);
13348    /// ```
13349    pub fn set_restore_parameters<T>(mut self, v: T) -> Self
13350    where
13351        T: std::convert::Into<crate::model::RestoreParameters>,
13352    {
13353        self.restore_parameters = std::option::Option::Some(v.into());
13354        self
13355    }
13356
13357    /// Sets or clears the value of [restore_parameters][crate::model::Volume::restore_parameters].
13358    ///
13359    /// # Example
13360    /// ```ignore,no_run
13361    /// # use google_cloud_netapp_v1::model::Volume;
13362    /// use google_cloud_netapp_v1::model::RestoreParameters;
13363    /// let x = Volume::new().set_or_clear_restore_parameters(Some(RestoreParameters::default()/* use setters */));
13364    /// let x = Volume::new().set_or_clear_restore_parameters(None::<RestoreParameters>);
13365    /// ```
13366    pub fn set_or_clear_restore_parameters<T>(mut self, v: std::option::Option<T>) -> Self
13367    where
13368        T: std::convert::Into<crate::model::RestoreParameters>,
13369    {
13370        self.restore_parameters = v.map(|x| x.into());
13371        self
13372    }
13373
13374    /// Sets the value of [kms_config][crate::model::Volume::kms_config].
13375    ///
13376    /// # Example
13377    /// ```ignore,no_run
13378    /// # use google_cloud_netapp_v1::model::Volume;
13379    /// let x = Volume::new().set_kms_config("example");
13380    /// ```
13381    pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13382        self.kms_config = v.into();
13383        self
13384    }
13385
13386    /// Sets the value of [encryption_type][crate::model::Volume::encryption_type].
13387    ///
13388    /// # Example
13389    /// ```ignore,no_run
13390    /// # use google_cloud_netapp_v1::model::Volume;
13391    /// use google_cloud_netapp_v1::model::EncryptionType;
13392    /// let x0 = Volume::new().set_encryption_type(EncryptionType::ServiceManaged);
13393    /// let x1 = Volume::new().set_encryption_type(EncryptionType::CloudKms);
13394    /// ```
13395    pub fn set_encryption_type<T: std::convert::Into<crate::model::EncryptionType>>(
13396        mut self,
13397        v: T,
13398    ) -> Self {
13399        self.encryption_type = v.into();
13400        self
13401    }
13402
13403    /// Sets the value of [has_replication][crate::model::Volume::has_replication].
13404    ///
13405    /// # Example
13406    /// ```ignore,no_run
13407    /// # use google_cloud_netapp_v1::model::Volume;
13408    /// let x = Volume::new().set_has_replication(true);
13409    /// ```
13410    pub fn set_has_replication<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13411        self.has_replication = v.into();
13412        self
13413    }
13414
13415    /// Sets the value of [backup_config][crate::model::Volume::backup_config].
13416    ///
13417    /// # Example
13418    /// ```ignore,no_run
13419    /// # use google_cloud_netapp_v1::model::Volume;
13420    /// use google_cloud_netapp_v1::model::BackupConfig;
13421    /// let x = Volume::new().set_backup_config(BackupConfig::default()/* use setters */);
13422    /// ```
13423    pub fn set_backup_config<T>(mut self, v: T) -> Self
13424    where
13425        T: std::convert::Into<crate::model::BackupConfig>,
13426    {
13427        self.backup_config = std::option::Option::Some(v.into());
13428        self
13429    }
13430
13431    /// Sets or clears the value of [backup_config][crate::model::Volume::backup_config].
13432    ///
13433    /// # Example
13434    /// ```ignore,no_run
13435    /// # use google_cloud_netapp_v1::model::Volume;
13436    /// use google_cloud_netapp_v1::model::BackupConfig;
13437    /// let x = Volume::new().set_or_clear_backup_config(Some(BackupConfig::default()/* use setters */));
13438    /// let x = Volume::new().set_or_clear_backup_config(None::<BackupConfig>);
13439    /// ```
13440    pub fn set_or_clear_backup_config<T>(mut self, v: std::option::Option<T>) -> Self
13441    where
13442        T: std::convert::Into<crate::model::BackupConfig>,
13443    {
13444        self.backup_config = v.map(|x| x.into());
13445        self
13446    }
13447
13448    /// Sets the value of [restricted_actions][crate::model::Volume::restricted_actions].
13449    ///
13450    /// # Example
13451    /// ```ignore,no_run
13452    /// # use google_cloud_netapp_v1::model::Volume;
13453    /// use google_cloud_netapp_v1::model::RestrictedAction;
13454    /// let x = Volume::new().set_restricted_actions([
13455    ///     RestrictedAction::Delete,
13456    /// ]);
13457    /// ```
13458    pub fn set_restricted_actions<T, V>(mut self, v: T) -> Self
13459    where
13460        T: std::iter::IntoIterator<Item = V>,
13461        V: std::convert::Into<crate::model::RestrictedAction>,
13462    {
13463        use std::iter::Iterator;
13464        self.restricted_actions = v.into_iter().map(|i| i.into()).collect();
13465        self
13466    }
13467
13468    /// Sets the value of [large_capacity][crate::model::Volume::large_capacity].
13469    ///
13470    /// # Example
13471    /// ```ignore,no_run
13472    /// # use google_cloud_netapp_v1::model::Volume;
13473    /// let x = Volume::new().set_large_capacity(true);
13474    /// ```
13475    pub fn set_large_capacity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13476        self.large_capacity = v.into();
13477        self
13478    }
13479
13480    /// Sets the value of [multiple_endpoints][crate::model::Volume::multiple_endpoints].
13481    ///
13482    /// # Example
13483    /// ```ignore,no_run
13484    /// # use google_cloud_netapp_v1::model::Volume;
13485    /// let x = Volume::new().set_multiple_endpoints(true);
13486    /// ```
13487    pub fn set_multiple_endpoints<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13488        self.multiple_endpoints = v.into();
13489        self
13490    }
13491
13492    /// Sets the value of [tiering_policy][crate::model::Volume::tiering_policy].
13493    ///
13494    /// # Example
13495    /// ```ignore,no_run
13496    /// # use google_cloud_netapp_v1::model::Volume;
13497    /// use google_cloud_netapp_v1::model::TieringPolicy;
13498    /// let x = Volume::new().set_tiering_policy(TieringPolicy::default()/* use setters */);
13499    /// ```
13500    pub fn set_tiering_policy<T>(mut self, v: T) -> Self
13501    where
13502        T: std::convert::Into<crate::model::TieringPolicy>,
13503    {
13504        self.tiering_policy = std::option::Option::Some(v.into());
13505        self
13506    }
13507
13508    /// Sets or clears the value of [tiering_policy][crate::model::Volume::tiering_policy].
13509    ///
13510    /// # Example
13511    /// ```ignore,no_run
13512    /// # use google_cloud_netapp_v1::model::Volume;
13513    /// use google_cloud_netapp_v1::model::TieringPolicy;
13514    /// let x = Volume::new().set_or_clear_tiering_policy(Some(TieringPolicy::default()/* use setters */));
13515    /// let x = Volume::new().set_or_clear_tiering_policy(None::<TieringPolicy>);
13516    /// ```
13517    pub fn set_or_clear_tiering_policy<T>(mut self, v: std::option::Option<T>) -> Self
13518    where
13519        T: std::convert::Into<crate::model::TieringPolicy>,
13520    {
13521        self.tiering_policy = v.map(|x| x.into());
13522        self
13523    }
13524
13525    /// Sets the value of [replica_zone][crate::model::Volume::replica_zone].
13526    ///
13527    /// # Example
13528    /// ```ignore,no_run
13529    /// # use google_cloud_netapp_v1::model::Volume;
13530    /// let x = Volume::new().set_replica_zone("example");
13531    /// ```
13532    pub fn set_replica_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13533        self.replica_zone = v.into();
13534        self
13535    }
13536
13537    /// Sets the value of [zone][crate::model::Volume::zone].
13538    ///
13539    /// # Example
13540    /// ```ignore,no_run
13541    /// # use google_cloud_netapp_v1::model::Volume;
13542    /// let x = Volume::new().set_zone("example");
13543    /// ```
13544    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13545        self.zone = v.into();
13546        self
13547    }
13548
13549    /// Sets the value of [cold_tier_size_gib][crate::model::Volume::cold_tier_size_gib].
13550    ///
13551    /// # Example
13552    /// ```ignore,no_run
13553    /// # use google_cloud_netapp_v1::model::Volume;
13554    /// let x = Volume::new().set_cold_tier_size_gib(42);
13555    /// ```
13556    pub fn set_cold_tier_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13557        self.cold_tier_size_gib = v.into();
13558        self
13559    }
13560
13561    /// Sets the value of [hybrid_replication_parameters][crate::model::Volume::hybrid_replication_parameters].
13562    ///
13563    /// # Example
13564    /// ```ignore,no_run
13565    /// # use google_cloud_netapp_v1::model::Volume;
13566    /// use google_cloud_netapp_v1::model::HybridReplicationParameters;
13567    /// let x = Volume::new().set_hybrid_replication_parameters(HybridReplicationParameters::default()/* use setters */);
13568    /// ```
13569    pub fn set_hybrid_replication_parameters<T>(mut self, v: T) -> Self
13570    where
13571        T: std::convert::Into<crate::model::HybridReplicationParameters>,
13572    {
13573        self.hybrid_replication_parameters = std::option::Option::Some(v.into());
13574        self
13575    }
13576
13577    /// Sets or clears the value of [hybrid_replication_parameters][crate::model::Volume::hybrid_replication_parameters].
13578    ///
13579    /// # Example
13580    /// ```ignore,no_run
13581    /// # use google_cloud_netapp_v1::model::Volume;
13582    /// use google_cloud_netapp_v1::model::HybridReplicationParameters;
13583    /// let x = Volume::new().set_or_clear_hybrid_replication_parameters(Some(HybridReplicationParameters::default()/* use setters */));
13584    /// let x = Volume::new().set_or_clear_hybrid_replication_parameters(None::<HybridReplicationParameters>);
13585    /// ```
13586    pub fn set_or_clear_hybrid_replication_parameters<T>(
13587        mut self,
13588        v: std::option::Option<T>,
13589    ) -> Self
13590    where
13591        T: std::convert::Into<crate::model::HybridReplicationParameters>,
13592    {
13593        self.hybrid_replication_parameters = v.map(|x| x.into());
13594        self
13595    }
13596
13597    /// Sets the value of [throughput_mibps][crate::model::Volume::throughput_mibps].
13598    ///
13599    /// # Example
13600    /// ```ignore,no_run
13601    /// # use google_cloud_netapp_v1::model::Volume;
13602    /// let x = Volume::new().set_throughput_mibps(42.0);
13603    /// ```
13604    pub fn set_throughput_mibps<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
13605        self.throughput_mibps = v.into();
13606        self
13607    }
13608
13609    /// Sets the value of [cache_parameters][crate::model::Volume::cache_parameters].
13610    ///
13611    /// # Example
13612    /// ```ignore,no_run
13613    /// # use google_cloud_netapp_v1::model::Volume;
13614    /// use google_cloud_netapp_v1::model::CacheParameters;
13615    /// let x = Volume::new().set_cache_parameters(CacheParameters::default()/* use setters */);
13616    /// ```
13617    pub fn set_cache_parameters<T>(mut self, v: T) -> Self
13618    where
13619        T: std::convert::Into<crate::model::CacheParameters>,
13620    {
13621        self.cache_parameters = std::option::Option::Some(v.into());
13622        self
13623    }
13624
13625    /// Sets or clears the value of [cache_parameters][crate::model::Volume::cache_parameters].
13626    ///
13627    /// # Example
13628    /// ```ignore,no_run
13629    /// # use google_cloud_netapp_v1::model::Volume;
13630    /// use google_cloud_netapp_v1::model::CacheParameters;
13631    /// let x = Volume::new().set_or_clear_cache_parameters(Some(CacheParameters::default()/* use setters */));
13632    /// let x = Volume::new().set_or_clear_cache_parameters(None::<CacheParameters>);
13633    /// ```
13634    pub fn set_or_clear_cache_parameters<T>(mut self, v: std::option::Option<T>) -> Self
13635    where
13636        T: std::convert::Into<crate::model::CacheParameters>,
13637    {
13638        self.cache_parameters = v.map(|x| x.into());
13639        self
13640    }
13641
13642    /// Sets the value of [hot_tier_size_used_gib][crate::model::Volume::hot_tier_size_used_gib].
13643    ///
13644    /// # Example
13645    /// ```ignore,no_run
13646    /// # use google_cloud_netapp_v1::model::Volume;
13647    /// let x = Volume::new().set_hot_tier_size_used_gib(42);
13648    /// ```
13649    pub fn set_hot_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13650        self.hot_tier_size_used_gib = v.into();
13651        self
13652    }
13653
13654    /// Sets the value of [block_devices][crate::model::Volume::block_devices].
13655    ///
13656    /// # Example
13657    /// ```ignore,no_run
13658    /// # use google_cloud_netapp_v1::model::Volume;
13659    /// use google_cloud_netapp_v1::model::BlockDevice;
13660    /// let x = Volume::new()
13661    ///     .set_block_devices([
13662    ///         BlockDevice::default()/* use setters */,
13663    ///         BlockDevice::default()/* use (different) setters */,
13664    ///     ]);
13665    /// ```
13666    pub fn set_block_devices<T, V>(mut self, v: T) -> Self
13667    where
13668        T: std::iter::IntoIterator<Item = V>,
13669        V: std::convert::Into<crate::model::BlockDevice>,
13670    {
13671        use std::iter::Iterator;
13672        self.block_devices = v.into_iter().map(|i| i.into()).collect();
13673        self
13674    }
13675}
13676
13677impl wkt::message::Message for Volume {
13678    fn typename() -> &'static str {
13679        "type.googleapis.com/google.cloud.netapp.v1.Volume"
13680    }
13681}
13682
13683/// Defines additional types related to [Volume].
13684pub mod volume {
13685    #[allow(unused_imports)]
13686    use super::*;
13687
13688    /// The volume states
13689    ///
13690    /// # Working with unknown values
13691    ///
13692    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13693    /// additional enum variants at any time. Adding new variants is not considered
13694    /// a breaking change. Applications should write their code in anticipation of:
13695    ///
13696    /// - New values appearing in future releases of the client library, **and**
13697    /// - New values received dynamically, without application changes.
13698    ///
13699    /// Please consult the [Working with enums] section in the user guide for some
13700    /// guidelines.
13701    ///
13702    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13703    #[derive(Clone, Debug, PartialEq)]
13704    #[non_exhaustive]
13705    pub enum State {
13706        /// Unspecified Volume State
13707        Unspecified,
13708        /// Volume State is Ready
13709        Ready,
13710        /// Volume State is Creating
13711        Creating,
13712        /// Volume State is Deleting
13713        Deleting,
13714        /// Volume State is Updating
13715        Updating,
13716        /// Volume State is Restoring
13717        Restoring,
13718        /// Volume State is Disabled
13719        Disabled,
13720        /// Volume State is Error
13721        Error,
13722        /// Volume State is Preparing. Note that this is different from CREATING
13723        /// where CREATING means the volume is being created, while PREPARING means
13724        /// the volume is created and now being prepared for the replication.
13725        Preparing,
13726        /// Volume State is Read Only
13727        ReadOnly,
13728        /// If set, the enum was initialized with an unknown value.
13729        ///
13730        /// Applications can examine the value using [State::value] or
13731        /// [State::name].
13732        UnknownValue(state::UnknownValue),
13733    }
13734
13735    #[doc(hidden)]
13736    pub mod state {
13737        #[allow(unused_imports)]
13738        use super::*;
13739        #[derive(Clone, Debug, PartialEq)]
13740        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13741    }
13742
13743    impl State {
13744        /// Gets the enum value.
13745        ///
13746        /// Returns `None` if the enum contains an unknown value deserialized from
13747        /// the string representation of enums.
13748        pub fn value(&self) -> std::option::Option<i32> {
13749            match self {
13750                Self::Unspecified => std::option::Option::Some(0),
13751                Self::Ready => std::option::Option::Some(1),
13752                Self::Creating => std::option::Option::Some(2),
13753                Self::Deleting => std::option::Option::Some(3),
13754                Self::Updating => std::option::Option::Some(4),
13755                Self::Restoring => std::option::Option::Some(5),
13756                Self::Disabled => std::option::Option::Some(6),
13757                Self::Error => std::option::Option::Some(7),
13758                Self::Preparing => std::option::Option::Some(8),
13759                Self::ReadOnly => std::option::Option::Some(9),
13760                Self::UnknownValue(u) => u.0.value(),
13761            }
13762        }
13763
13764        /// Gets the enum value as a string.
13765        ///
13766        /// Returns `None` if the enum contains an unknown value deserialized from
13767        /// the integer representation of enums.
13768        pub fn name(&self) -> std::option::Option<&str> {
13769            match self {
13770                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13771                Self::Ready => std::option::Option::Some("READY"),
13772                Self::Creating => std::option::Option::Some("CREATING"),
13773                Self::Deleting => std::option::Option::Some("DELETING"),
13774                Self::Updating => std::option::Option::Some("UPDATING"),
13775                Self::Restoring => std::option::Option::Some("RESTORING"),
13776                Self::Disabled => std::option::Option::Some("DISABLED"),
13777                Self::Error => std::option::Option::Some("ERROR"),
13778                Self::Preparing => std::option::Option::Some("PREPARING"),
13779                Self::ReadOnly => std::option::Option::Some("READ_ONLY"),
13780                Self::UnknownValue(u) => u.0.name(),
13781            }
13782        }
13783    }
13784
13785    impl std::default::Default for State {
13786        fn default() -> Self {
13787            use std::convert::From;
13788            Self::from(0)
13789        }
13790    }
13791
13792    impl std::fmt::Display for State {
13793        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13794            wkt::internal::display_enum(f, self.name(), self.value())
13795        }
13796    }
13797
13798    impl std::convert::From<i32> for State {
13799        fn from(value: i32) -> Self {
13800            match value {
13801                0 => Self::Unspecified,
13802                1 => Self::Ready,
13803                2 => Self::Creating,
13804                3 => Self::Deleting,
13805                4 => Self::Updating,
13806                5 => Self::Restoring,
13807                6 => Self::Disabled,
13808                7 => Self::Error,
13809                8 => Self::Preparing,
13810                9 => Self::ReadOnly,
13811                _ => Self::UnknownValue(state::UnknownValue(
13812                    wkt::internal::UnknownEnumValue::Integer(value),
13813                )),
13814            }
13815        }
13816    }
13817
13818    impl std::convert::From<&str> for State {
13819        fn from(value: &str) -> Self {
13820            use std::string::ToString;
13821            match value {
13822                "STATE_UNSPECIFIED" => Self::Unspecified,
13823                "READY" => Self::Ready,
13824                "CREATING" => Self::Creating,
13825                "DELETING" => Self::Deleting,
13826                "UPDATING" => Self::Updating,
13827                "RESTORING" => Self::Restoring,
13828                "DISABLED" => Self::Disabled,
13829                "ERROR" => Self::Error,
13830                "PREPARING" => Self::Preparing,
13831                "READ_ONLY" => Self::ReadOnly,
13832                _ => Self::UnknownValue(state::UnknownValue(
13833                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13834                )),
13835            }
13836        }
13837    }
13838
13839    impl serde::ser::Serialize for State {
13840        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13841        where
13842            S: serde::Serializer,
13843        {
13844            match self {
13845                Self::Unspecified => serializer.serialize_i32(0),
13846                Self::Ready => serializer.serialize_i32(1),
13847                Self::Creating => serializer.serialize_i32(2),
13848                Self::Deleting => serializer.serialize_i32(3),
13849                Self::Updating => serializer.serialize_i32(4),
13850                Self::Restoring => serializer.serialize_i32(5),
13851                Self::Disabled => serializer.serialize_i32(6),
13852                Self::Error => serializer.serialize_i32(7),
13853                Self::Preparing => serializer.serialize_i32(8),
13854                Self::ReadOnly => serializer.serialize_i32(9),
13855                Self::UnknownValue(u) => u.0.serialize(serializer),
13856            }
13857        }
13858    }
13859
13860    impl<'de> serde::de::Deserialize<'de> for State {
13861        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13862        where
13863            D: serde::Deserializer<'de>,
13864        {
13865            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13866                ".google.cloud.netapp.v1.Volume.State",
13867            ))
13868        }
13869    }
13870}
13871
13872/// Defines the export policy for the volume.
13873#[derive(Clone, Default, PartialEq)]
13874#[non_exhaustive]
13875pub struct ExportPolicy {
13876    /// Required. List of export policy rules
13877    pub rules: std::vec::Vec<crate::model::SimpleExportPolicyRule>,
13878
13879    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13880}
13881
13882impl ExportPolicy {
13883    pub fn new() -> Self {
13884        std::default::Default::default()
13885    }
13886
13887    /// Sets the value of [rules][crate::model::ExportPolicy::rules].
13888    ///
13889    /// # Example
13890    /// ```ignore,no_run
13891    /// # use google_cloud_netapp_v1::model::ExportPolicy;
13892    /// use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
13893    /// let x = ExportPolicy::new()
13894    ///     .set_rules([
13895    ///         SimpleExportPolicyRule::default()/* use setters */,
13896    ///         SimpleExportPolicyRule::default()/* use (different) setters */,
13897    ///     ]);
13898    /// ```
13899    pub fn set_rules<T, V>(mut self, v: T) -> Self
13900    where
13901        T: std::iter::IntoIterator<Item = V>,
13902        V: std::convert::Into<crate::model::SimpleExportPolicyRule>,
13903    {
13904        use std::iter::Iterator;
13905        self.rules = v.into_iter().map(|i| i.into()).collect();
13906        self
13907    }
13908}
13909
13910impl wkt::message::Message for ExportPolicy {
13911    fn typename() -> &'static str {
13912        "type.googleapis.com/google.cloud.netapp.v1.ExportPolicy"
13913    }
13914}
13915
13916/// An export policy rule describing various export options.
13917#[derive(Clone, Default, PartialEq)]
13918#[non_exhaustive]
13919pub struct SimpleExportPolicyRule {
13920    /// Comma separated list of allowed clients IP addresses
13921    pub allowed_clients: std::option::Option<std::string::String>,
13922
13923    /// Whether Unix root access will be granted.
13924    pub has_root_access: std::option::Option<std::string::String>,
13925
13926    /// Access type (ReadWrite, ReadOnly, None)
13927    pub access_type: std::option::Option<crate::model::AccessType>,
13928
13929    /// NFS V3 protocol.
13930    pub nfsv3: std::option::Option<bool>,
13931
13932    /// NFS V4 protocol.
13933    pub nfsv4: std::option::Option<bool>,
13934
13935    /// If enabled (true) the rule defines a read only access for clients matching
13936    /// the 'allowedClients' specification. It enables nfs clients to mount using
13937    /// 'authentication' kerberos security mode.
13938    pub kerberos_5_read_only: std::option::Option<bool>,
13939
13940    /// If enabled (true) the rule defines read and write access for clients
13941    /// matching the 'allowedClients' specification. It enables nfs clients to
13942    /// mount using 'authentication' kerberos security mode. The
13943    /// 'kerberos5ReadOnly' value be ignored if this is enabled.
13944    pub kerberos_5_read_write: std::option::Option<bool>,
13945
13946    /// If enabled (true) the rule defines a read only access for clients matching
13947    /// the 'allowedClients' specification. It enables nfs clients to mount using
13948    /// 'integrity' kerberos security mode.
13949    pub kerberos_5i_read_only: std::option::Option<bool>,
13950
13951    /// If enabled (true) the rule defines read and write access for clients
13952    /// matching the 'allowedClients' specification. It enables nfs clients to
13953    /// mount using 'integrity' kerberos security mode. The 'kerberos5iReadOnly'
13954    /// value be ignored if this is enabled.
13955    pub kerberos_5i_read_write: std::option::Option<bool>,
13956
13957    /// If enabled (true) the rule defines a read only access for clients matching
13958    /// the 'allowedClients' specification. It enables nfs clients to mount using
13959    /// 'privacy' kerberos security mode.
13960    pub kerberos_5p_read_only: std::option::Option<bool>,
13961
13962    /// If enabled (true) the rule defines read and write access for clients
13963    /// matching the 'allowedClients' specification. It enables nfs clients to
13964    /// mount using 'privacy' kerberos security mode. The 'kerberos5pReadOnly'
13965    /// value be ignored if this is enabled.
13966    pub kerberos_5p_read_write: std::option::Option<bool>,
13967
13968    /// Optional. Defines how user identity squashing is applied for this export
13969    /// rule. This field is the preferred way to configure squashing behavior and
13970    /// takes precedence over `has_root_access` if both are provided.
13971    pub squash_mode: std::option::Option<crate::model::simple_export_policy_rule::SquashMode>,
13972
13973    /// Optional. An integer representing the anonymous user ID. Range is 0 to
13974    /// `4294967295`. Required when `squash_mode` is `ROOT_SQUASH` or `ALL_SQUASH`.
13975    pub anon_uid: std::option::Option<i64>,
13976
13977    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13978}
13979
13980impl SimpleExportPolicyRule {
13981    pub fn new() -> Self {
13982        std::default::Default::default()
13983    }
13984
13985    /// Sets the value of [allowed_clients][crate::model::SimpleExportPolicyRule::allowed_clients].
13986    ///
13987    /// # Example
13988    /// ```ignore,no_run
13989    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
13990    /// let x = SimpleExportPolicyRule::new().set_allowed_clients("example");
13991    /// ```
13992    pub fn set_allowed_clients<T>(mut self, v: T) -> Self
13993    where
13994        T: std::convert::Into<std::string::String>,
13995    {
13996        self.allowed_clients = std::option::Option::Some(v.into());
13997        self
13998    }
13999
14000    /// Sets or clears the value of [allowed_clients][crate::model::SimpleExportPolicyRule::allowed_clients].
14001    ///
14002    /// # Example
14003    /// ```ignore,no_run
14004    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14005    /// let x = SimpleExportPolicyRule::new().set_or_clear_allowed_clients(Some("example"));
14006    /// let x = SimpleExportPolicyRule::new().set_or_clear_allowed_clients(None::<String>);
14007    /// ```
14008    pub fn set_or_clear_allowed_clients<T>(mut self, v: std::option::Option<T>) -> Self
14009    where
14010        T: std::convert::Into<std::string::String>,
14011    {
14012        self.allowed_clients = v.map(|x| x.into());
14013        self
14014    }
14015
14016    /// Sets the value of [has_root_access][crate::model::SimpleExportPolicyRule::has_root_access].
14017    ///
14018    /// # Example
14019    /// ```ignore,no_run
14020    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14021    /// let x = SimpleExportPolicyRule::new().set_has_root_access("example");
14022    /// ```
14023    pub fn set_has_root_access<T>(mut self, v: T) -> Self
14024    where
14025        T: std::convert::Into<std::string::String>,
14026    {
14027        self.has_root_access = std::option::Option::Some(v.into());
14028        self
14029    }
14030
14031    /// Sets or clears the value of [has_root_access][crate::model::SimpleExportPolicyRule::has_root_access].
14032    ///
14033    /// # Example
14034    /// ```ignore,no_run
14035    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14036    /// let x = SimpleExportPolicyRule::new().set_or_clear_has_root_access(Some("example"));
14037    /// let x = SimpleExportPolicyRule::new().set_or_clear_has_root_access(None::<String>);
14038    /// ```
14039    pub fn set_or_clear_has_root_access<T>(mut self, v: std::option::Option<T>) -> Self
14040    where
14041        T: std::convert::Into<std::string::String>,
14042    {
14043        self.has_root_access = v.map(|x| x.into());
14044        self
14045    }
14046
14047    /// Sets the value of [access_type][crate::model::SimpleExportPolicyRule::access_type].
14048    ///
14049    /// # Example
14050    /// ```ignore,no_run
14051    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14052    /// use google_cloud_netapp_v1::model::AccessType;
14053    /// let x0 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadOnly);
14054    /// let x1 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadWrite);
14055    /// let x2 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadNone);
14056    /// ```
14057    pub fn set_access_type<T>(mut self, v: T) -> Self
14058    where
14059        T: std::convert::Into<crate::model::AccessType>,
14060    {
14061        self.access_type = std::option::Option::Some(v.into());
14062        self
14063    }
14064
14065    /// Sets or clears the value of [access_type][crate::model::SimpleExportPolicyRule::access_type].
14066    ///
14067    /// # Example
14068    /// ```ignore,no_run
14069    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14070    /// use google_cloud_netapp_v1::model::AccessType;
14071    /// let x0 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadOnly));
14072    /// let x1 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadWrite));
14073    /// let x2 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadNone));
14074    /// let x_none = SimpleExportPolicyRule::new().set_or_clear_access_type(None::<AccessType>);
14075    /// ```
14076    pub fn set_or_clear_access_type<T>(mut self, v: std::option::Option<T>) -> Self
14077    where
14078        T: std::convert::Into<crate::model::AccessType>,
14079    {
14080        self.access_type = v.map(|x| x.into());
14081        self
14082    }
14083
14084    /// Sets the value of [nfsv3][crate::model::SimpleExportPolicyRule::nfsv3].
14085    ///
14086    /// # Example
14087    /// ```ignore,no_run
14088    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14089    /// let x = SimpleExportPolicyRule::new().set_nfsv3(true);
14090    /// ```
14091    pub fn set_nfsv3<T>(mut self, v: T) -> Self
14092    where
14093        T: std::convert::Into<bool>,
14094    {
14095        self.nfsv3 = std::option::Option::Some(v.into());
14096        self
14097    }
14098
14099    /// Sets or clears the value of [nfsv3][crate::model::SimpleExportPolicyRule::nfsv3].
14100    ///
14101    /// # Example
14102    /// ```ignore,no_run
14103    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14104    /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv3(Some(false));
14105    /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv3(None::<bool>);
14106    /// ```
14107    pub fn set_or_clear_nfsv3<T>(mut self, v: std::option::Option<T>) -> Self
14108    where
14109        T: std::convert::Into<bool>,
14110    {
14111        self.nfsv3 = v.map(|x| x.into());
14112        self
14113    }
14114
14115    /// Sets the value of [nfsv4][crate::model::SimpleExportPolicyRule::nfsv4].
14116    ///
14117    /// # Example
14118    /// ```ignore,no_run
14119    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14120    /// let x = SimpleExportPolicyRule::new().set_nfsv4(true);
14121    /// ```
14122    pub fn set_nfsv4<T>(mut self, v: T) -> Self
14123    where
14124        T: std::convert::Into<bool>,
14125    {
14126        self.nfsv4 = std::option::Option::Some(v.into());
14127        self
14128    }
14129
14130    /// Sets or clears the value of [nfsv4][crate::model::SimpleExportPolicyRule::nfsv4].
14131    ///
14132    /// # Example
14133    /// ```ignore,no_run
14134    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14135    /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv4(Some(false));
14136    /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv4(None::<bool>);
14137    /// ```
14138    pub fn set_or_clear_nfsv4<T>(mut self, v: std::option::Option<T>) -> Self
14139    where
14140        T: std::convert::Into<bool>,
14141    {
14142        self.nfsv4 = v.map(|x| x.into());
14143        self
14144    }
14145
14146    /// Sets the value of [kerberos_5_read_only][crate::model::SimpleExportPolicyRule::kerberos_5_read_only].
14147    ///
14148    /// # Example
14149    /// ```ignore,no_run
14150    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14151    /// let x = SimpleExportPolicyRule::new().set_kerberos_5_read_only(true);
14152    /// ```
14153    pub fn set_kerberos_5_read_only<T>(mut self, v: T) -> Self
14154    where
14155        T: std::convert::Into<bool>,
14156    {
14157        self.kerberos_5_read_only = std::option::Option::Some(v.into());
14158        self
14159    }
14160
14161    /// Sets or clears the value of [kerberos_5_read_only][crate::model::SimpleExportPolicyRule::kerberos_5_read_only].
14162    ///
14163    /// # Example
14164    /// ```ignore,no_run
14165    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14166    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_only(Some(false));
14167    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_only(None::<bool>);
14168    /// ```
14169    pub fn set_or_clear_kerberos_5_read_only<T>(mut self, v: std::option::Option<T>) -> Self
14170    where
14171        T: std::convert::Into<bool>,
14172    {
14173        self.kerberos_5_read_only = v.map(|x| x.into());
14174        self
14175    }
14176
14177    /// Sets the value of [kerberos_5_read_write][crate::model::SimpleExportPolicyRule::kerberos_5_read_write].
14178    ///
14179    /// # Example
14180    /// ```ignore,no_run
14181    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14182    /// let x = SimpleExportPolicyRule::new().set_kerberos_5_read_write(true);
14183    /// ```
14184    pub fn set_kerberos_5_read_write<T>(mut self, v: T) -> Self
14185    where
14186        T: std::convert::Into<bool>,
14187    {
14188        self.kerberos_5_read_write = std::option::Option::Some(v.into());
14189        self
14190    }
14191
14192    /// Sets or clears the value of [kerberos_5_read_write][crate::model::SimpleExportPolicyRule::kerberos_5_read_write].
14193    ///
14194    /// # Example
14195    /// ```ignore,no_run
14196    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14197    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_write(Some(false));
14198    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_write(None::<bool>);
14199    /// ```
14200    pub fn set_or_clear_kerberos_5_read_write<T>(mut self, v: std::option::Option<T>) -> Self
14201    where
14202        T: std::convert::Into<bool>,
14203    {
14204        self.kerberos_5_read_write = v.map(|x| x.into());
14205        self
14206    }
14207
14208    /// Sets the value of [kerberos_5i_read_only][crate::model::SimpleExportPolicyRule::kerberos_5i_read_only].
14209    ///
14210    /// # Example
14211    /// ```ignore,no_run
14212    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14213    /// let x = SimpleExportPolicyRule::new().set_kerberos_5i_read_only(true);
14214    /// ```
14215    pub fn set_kerberos_5i_read_only<T>(mut self, v: T) -> Self
14216    where
14217        T: std::convert::Into<bool>,
14218    {
14219        self.kerberos_5i_read_only = std::option::Option::Some(v.into());
14220        self
14221    }
14222
14223    /// Sets or clears the value of [kerberos_5i_read_only][crate::model::SimpleExportPolicyRule::kerberos_5i_read_only].
14224    ///
14225    /// # Example
14226    /// ```ignore,no_run
14227    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14228    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_only(Some(false));
14229    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_only(None::<bool>);
14230    /// ```
14231    pub fn set_or_clear_kerberos_5i_read_only<T>(mut self, v: std::option::Option<T>) -> Self
14232    where
14233        T: std::convert::Into<bool>,
14234    {
14235        self.kerberos_5i_read_only = v.map(|x| x.into());
14236        self
14237    }
14238
14239    /// Sets the value of [kerberos_5i_read_write][crate::model::SimpleExportPolicyRule::kerberos_5i_read_write].
14240    ///
14241    /// # Example
14242    /// ```ignore,no_run
14243    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14244    /// let x = SimpleExportPolicyRule::new().set_kerberos_5i_read_write(true);
14245    /// ```
14246    pub fn set_kerberos_5i_read_write<T>(mut self, v: T) -> Self
14247    where
14248        T: std::convert::Into<bool>,
14249    {
14250        self.kerberos_5i_read_write = std::option::Option::Some(v.into());
14251        self
14252    }
14253
14254    /// Sets or clears the value of [kerberos_5i_read_write][crate::model::SimpleExportPolicyRule::kerberos_5i_read_write].
14255    ///
14256    /// # Example
14257    /// ```ignore,no_run
14258    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14259    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_write(Some(false));
14260    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_write(None::<bool>);
14261    /// ```
14262    pub fn set_or_clear_kerberos_5i_read_write<T>(mut self, v: std::option::Option<T>) -> Self
14263    where
14264        T: std::convert::Into<bool>,
14265    {
14266        self.kerberos_5i_read_write = v.map(|x| x.into());
14267        self
14268    }
14269
14270    /// Sets the value of [kerberos_5p_read_only][crate::model::SimpleExportPolicyRule::kerberos_5p_read_only].
14271    ///
14272    /// # Example
14273    /// ```ignore,no_run
14274    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14275    /// let x = SimpleExportPolicyRule::new().set_kerberos_5p_read_only(true);
14276    /// ```
14277    pub fn set_kerberos_5p_read_only<T>(mut self, v: T) -> Self
14278    where
14279        T: std::convert::Into<bool>,
14280    {
14281        self.kerberos_5p_read_only = std::option::Option::Some(v.into());
14282        self
14283    }
14284
14285    /// Sets or clears the value of [kerberos_5p_read_only][crate::model::SimpleExportPolicyRule::kerberos_5p_read_only].
14286    ///
14287    /// # Example
14288    /// ```ignore,no_run
14289    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14290    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_only(Some(false));
14291    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_only(None::<bool>);
14292    /// ```
14293    pub fn set_or_clear_kerberos_5p_read_only<T>(mut self, v: std::option::Option<T>) -> Self
14294    where
14295        T: std::convert::Into<bool>,
14296    {
14297        self.kerberos_5p_read_only = v.map(|x| x.into());
14298        self
14299    }
14300
14301    /// Sets the value of [kerberos_5p_read_write][crate::model::SimpleExportPolicyRule::kerberos_5p_read_write].
14302    ///
14303    /// # Example
14304    /// ```ignore,no_run
14305    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14306    /// let x = SimpleExportPolicyRule::new().set_kerberos_5p_read_write(true);
14307    /// ```
14308    pub fn set_kerberos_5p_read_write<T>(mut self, v: T) -> Self
14309    where
14310        T: std::convert::Into<bool>,
14311    {
14312        self.kerberos_5p_read_write = std::option::Option::Some(v.into());
14313        self
14314    }
14315
14316    /// Sets or clears the value of [kerberos_5p_read_write][crate::model::SimpleExportPolicyRule::kerberos_5p_read_write].
14317    ///
14318    /// # Example
14319    /// ```ignore,no_run
14320    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14321    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_write(Some(false));
14322    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_write(None::<bool>);
14323    /// ```
14324    pub fn set_or_clear_kerberos_5p_read_write<T>(mut self, v: std::option::Option<T>) -> Self
14325    where
14326        T: std::convert::Into<bool>,
14327    {
14328        self.kerberos_5p_read_write = v.map(|x| x.into());
14329        self
14330    }
14331
14332    /// Sets the value of [squash_mode][crate::model::SimpleExportPolicyRule::squash_mode].
14333    ///
14334    /// # Example
14335    /// ```ignore,no_run
14336    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14337    /// use google_cloud_netapp_v1::model::simple_export_policy_rule::SquashMode;
14338    /// let x0 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::NoRootSquash);
14339    /// let x1 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::RootSquash);
14340    /// let x2 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::AllSquash);
14341    /// ```
14342    pub fn set_squash_mode<T>(mut self, v: T) -> Self
14343    where
14344        T: std::convert::Into<crate::model::simple_export_policy_rule::SquashMode>,
14345    {
14346        self.squash_mode = std::option::Option::Some(v.into());
14347        self
14348    }
14349
14350    /// Sets or clears the value of [squash_mode][crate::model::SimpleExportPolicyRule::squash_mode].
14351    ///
14352    /// # Example
14353    /// ```ignore,no_run
14354    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14355    /// use google_cloud_netapp_v1::model::simple_export_policy_rule::SquashMode;
14356    /// let x0 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::NoRootSquash));
14357    /// let x1 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::RootSquash));
14358    /// let x2 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::AllSquash));
14359    /// let x_none = SimpleExportPolicyRule::new().set_or_clear_squash_mode(None::<SquashMode>);
14360    /// ```
14361    pub fn set_or_clear_squash_mode<T>(mut self, v: std::option::Option<T>) -> Self
14362    where
14363        T: std::convert::Into<crate::model::simple_export_policy_rule::SquashMode>,
14364    {
14365        self.squash_mode = v.map(|x| x.into());
14366        self
14367    }
14368
14369    /// Sets the value of [anon_uid][crate::model::SimpleExportPolicyRule::anon_uid].
14370    ///
14371    /// # Example
14372    /// ```ignore,no_run
14373    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14374    /// let x = SimpleExportPolicyRule::new().set_anon_uid(42);
14375    /// ```
14376    pub fn set_anon_uid<T>(mut self, v: T) -> Self
14377    where
14378        T: std::convert::Into<i64>,
14379    {
14380        self.anon_uid = std::option::Option::Some(v.into());
14381        self
14382    }
14383
14384    /// Sets or clears the value of [anon_uid][crate::model::SimpleExportPolicyRule::anon_uid].
14385    ///
14386    /// # Example
14387    /// ```ignore,no_run
14388    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14389    /// let x = SimpleExportPolicyRule::new().set_or_clear_anon_uid(Some(42));
14390    /// let x = SimpleExportPolicyRule::new().set_or_clear_anon_uid(None::<i32>);
14391    /// ```
14392    pub fn set_or_clear_anon_uid<T>(mut self, v: std::option::Option<T>) -> Self
14393    where
14394        T: std::convert::Into<i64>,
14395    {
14396        self.anon_uid = v.map(|x| x.into());
14397        self
14398    }
14399}
14400
14401impl wkt::message::Message for SimpleExportPolicyRule {
14402    fn typename() -> &'static str {
14403        "type.googleapis.com/google.cloud.netapp.v1.SimpleExportPolicyRule"
14404    }
14405}
14406
14407/// Defines additional types related to [SimpleExportPolicyRule].
14408pub mod simple_export_policy_rule {
14409    #[allow(unused_imports)]
14410    use super::*;
14411
14412    /// `SquashMode` defines how remote user privileges are restricted when
14413    /// accessing an NFS export. It controls how user identities (like root) are
14414    /// mapped to anonymous users to limit access and enforce security.
14415    ///
14416    /// # Working with unknown values
14417    ///
14418    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14419    /// additional enum variants at any time. Adding new variants is not considered
14420    /// a breaking change. Applications should write their code in anticipation of:
14421    ///
14422    /// - New values appearing in future releases of the client library, **and**
14423    /// - New values received dynamically, without application changes.
14424    ///
14425    /// Please consult the [Working with enums] section in the user guide for some
14426    /// guidelines.
14427    ///
14428    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14429    #[derive(Clone, Debug, PartialEq)]
14430    #[non_exhaustive]
14431    pub enum SquashMode {
14432        /// Defaults to `NO_ROOT_SQUASH`.
14433        Unspecified,
14434        /// The root user (UID 0) retains full access. Other users are
14435        /// unaffected.
14436        NoRootSquash,
14437        /// The root user (UID 0) is squashed to anonymous user ID. Other users are
14438        /// unaffected.
14439        RootSquash,
14440        /// All users are squashed to anonymous user ID.
14441        AllSquash,
14442        /// If set, the enum was initialized with an unknown value.
14443        ///
14444        /// Applications can examine the value using [SquashMode::value] or
14445        /// [SquashMode::name].
14446        UnknownValue(squash_mode::UnknownValue),
14447    }
14448
14449    #[doc(hidden)]
14450    pub mod squash_mode {
14451        #[allow(unused_imports)]
14452        use super::*;
14453        #[derive(Clone, Debug, PartialEq)]
14454        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14455    }
14456
14457    impl SquashMode {
14458        /// Gets the enum value.
14459        ///
14460        /// Returns `None` if the enum contains an unknown value deserialized from
14461        /// the string representation of enums.
14462        pub fn value(&self) -> std::option::Option<i32> {
14463            match self {
14464                Self::Unspecified => std::option::Option::Some(0),
14465                Self::NoRootSquash => std::option::Option::Some(1),
14466                Self::RootSquash => std::option::Option::Some(2),
14467                Self::AllSquash => std::option::Option::Some(3),
14468                Self::UnknownValue(u) => u.0.value(),
14469            }
14470        }
14471
14472        /// Gets the enum value as a string.
14473        ///
14474        /// Returns `None` if the enum contains an unknown value deserialized from
14475        /// the integer representation of enums.
14476        pub fn name(&self) -> std::option::Option<&str> {
14477            match self {
14478                Self::Unspecified => std::option::Option::Some("SQUASH_MODE_UNSPECIFIED"),
14479                Self::NoRootSquash => std::option::Option::Some("NO_ROOT_SQUASH"),
14480                Self::RootSquash => std::option::Option::Some("ROOT_SQUASH"),
14481                Self::AllSquash => std::option::Option::Some("ALL_SQUASH"),
14482                Self::UnknownValue(u) => u.0.name(),
14483            }
14484        }
14485    }
14486
14487    impl std::default::Default for SquashMode {
14488        fn default() -> Self {
14489            use std::convert::From;
14490            Self::from(0)
14491        }
14492    }
14493
14494    impl std::fmt::Display for SquashMode {
14495        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14496            wkt::internal::display_enum(f, self.name(), self.value())
14497        }
14498    }
14499
14500    impl std::convert::From<i32> for SquashMode {
14501        fn from(value: i32) -> Self {
14502            match value {
14503                0 => Self::Unspecified,
14504                1 => Self::NoRootSquash,
14505                2 => Self::RootSquash,
14506                3 => Self::AllSquash,
14507                _ => Self::UnknownValue(squash_mode::UnknownValue(
14508                    wkt::internal::UnknownEnumValue::Integer(value),
14509                )),
14510            }
14511        }
14512    }
14513
14514    impl std::convert::From<&str> for SquashMode {
14515        fn from(value: &str) -> Self {
14516            use std::string::ToString;
14517            match value {
14518                "SQUASH_MODE_UNSPECIFIED" => Self::Unspecified,
14519                "NO_ROOT_SQUASH" => Self::NoRootSquash,
14520                "ROOT_SQUASH" => Self::RootSquash,
14521                "ALL_SQUASH" => Self::AllSquash,
14522                _ => Self::UnknownValue(squash_mode::UnknownValue(
14523                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14524                )),
14525            }
14526        }
14527    }
14528
14529    impl serde::ser::Serialize for SquashMode {
14530        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14531        where
14532            S: serde::Serializer,
14533        {
14534            match self {
14535                Self::Unspecified => serializer.serialize_i32(0),
14536                Self::NoRootSquash => serializer.serialize_i32(1),
14537                Self::RootSquash => serializer.serialize_i32(2),
14538                Self::AllSquash => serializer.serialize_i32(3),
14539                Self::UnknownValue(u) => u.0.serialize(serializer),
14540            }
14541        }
14542    }
14543
14544    impl<'de> serde::de::Deserialize<'de> for SquashMode {
14545        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14546        where
14547            D: serde::Deserializer<'de>,
14548        {
14549            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SquashMode>::new(
14550                ".google.cloud.netapp.v1.SimpleExportPolicyRule.SquashMode",
14551            ))
14552        }
14553    }
14554}
14555
14556/// Snapshot Policy for a volume.
14557#[derive(Clone, Default, PartialEq)]
14558#[non_exhaustive]
14559pub struct SnapshotPolicy {
14560    /// If enabled, make snapshots automatically according to the schedules.
14561    /// Default is false.
14562    pub enabled: std::option::Option<bool>,
14563
14564    /// Hourly schedule policy.
14565    pub hourly_schedule: std::option::Option<crate::model::HourlySchedule>,
14566
14567    /// Daily schedule policy.
14568    pub daily_schedule: std::option::Option<crate::model::DailySchedule>,
14569
14570    /// Weekly schedule policy.
14571    pub weekly_schedule: std::option::Option<crate::model::WeeklySchedule>,
14572
14573    /// Monthly schedule policy.
14574    pub monthly_schedule: std::option::Option<crate::model::MonthlySchedule>,
14575
14576    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14577}
14578
14579impl SnapshotPolicy {
14580    pub fn new() -> Self {
14581        std::default::Default::default()
14582    }
14583
14584    /// Sets the value of [enabled][crate::model::SnapshotPolicy::enabled].
14585    ///
14586    /// # Example
14587    /// ```ignore,no_run
14588    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14589    /// let x = SnapshotPolicy::new().set_enabled(true);
14590    /// ```
14591    pub fn set_enabled<T>(mut self, v: T) -> Self
14592    where
14593        T: std::convert::Into<bool>,
14594    {
14595        self.enabled = std::option::Option::Some(v.into());
14596        self
14597    }
14598
14599    /// Sets or clears the value of [enabled][crate::model::SnapshotPolicy::enabled].
14600    ///
14601    /// # Example
14602    /// ```ignore,no_run
14603    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14604    /// let x = SnapshotPolicy::new().set_or_clear_enabled(Some(false));
14605    /// let x = SnapshotPolicy::new().set_or_clear_enabled(None::<bool>);
14606    /// ```
14607    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
14608    where
14609        T: std::convert::Into<bool>,
14610    {
14611        self.enabled = v.map(|x| x.into());
14612        self
14613    }
14614
14615    /// Sets the value of [hourly_schedule][crate::model::SnapshotPolicy::hourly_schedule].
14616    ///
14617    /// # Example
14618    /// ```ignore,no_run
14619    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14620    /// use google_cloud_netapp_v1::model::HourlySchedule;
14621    /// let x = SnapshotPolicy::new().set_hourly_schedule(HourlySchedule::default()/* use setters */);
14622    /// ```
14623    pub fn set_hourly_schedule<T>(mut self, v: T) -> Self
14624    where
14625        T: std::convert::Into<crate::model::HourlySchedule>,
14626    {
14627        self.hourly_schedule = std::option::Option::Some(v.into());
14628        self
14629    }
14630
14631    /// Sets or clears the value of [hourly_schedule][crate::model::SnapshotPolicy::hourly_schedule].
14632    ///
14633    /// # Example
14634    /// ```ignore,no_run
14635    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14636    /// use google_cloud_netapp_v1::model::HourlySchedule;
14637    /// let x = SnapshotPolicy::new().set_or_clear_hourly_schedule(Some(HourlySchedule::default()/* use setters */));
14638    /// let x = SnapshotPolicy::new().set_or_clear_hourly_schedule(None::<HourlySchedule>);
14639    /// ```
14640    pub fn set_or_clear_hourly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
14641    where
14642        T: std::convert::Into<crate::model::HourlySchedule>,
14643    {
14644        self.hourly_schedule = v.map(|x| x.into());
14645        self
14646    }
14647
14648    /// Sets the value of [daily_schedule][crate::model::SnapshotPolicy::daily_schedule].
14649    ///
14650    /// # Example
14651    /// ```ignore,no_run
14652    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14653    /// use google_cloud_netapp_v1::model::DailySchedule;
14654    /// let x = SnapshotPolicy::new().set_daily_schedule(DailySchedule::default()/* use setters */);
14655    /// ```
14656    pub fn set_daily_schedule<T>(mut self, v: T) -> Self
14657    where
14658        T: std::convert::Into<crate::model::DailySchedule>,
14659    {
14660        self.daily_schedule = std::option::Option::Some(v.into());
14661        self
14662    }
14663
14664    /// Sets or clears the value of [daily_schedule][crate::model::SnapshotPolicy::daily_schedule].
14665    ///
14666    /// # Example
14667    /// ```ignore,no_run
14668    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14669    /// use google_cloud_netapp_v1::model::DailySchedule;
14670    /// let x = SnapshotPolicy::new().set_or_clear_daily_schedule(Some(DailySchedule::default()/* use setters */));
14671    /// let x = SnapshotPolicy::new().set_or_clear_daily_schedule(None::<DailySchedule>);
14672    /// ```
14673    pub fn set_or_clear_daily_schedule<T>(mut self, v: std::option::Option<T>) -> Self
14674    where
14675        T: std::convert::Into<crate::model::DailySchedule>,
14676    {
14677        self.daily_schedule = v.map(|x| x.into());
14678        self
14679    }
14680
14681    /// Sets the value of [weekly_schedule][crate::model::SnapshotPolicy::weekly_schedule].
14682    ///
14683    /// # Example
14684    /// ```ignore,no_run
14685    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14686    /// use google_cloud_netapp_v1::model::WeeklySchedule;
14687    /// let x = SnapshotPolicy::new().set_weekly_schedule(WeeklySchedule::default()/* use setters */);
14688    /// ```
14689    pub fn set_weekly_schedule<T>(mut self, v: T) -> Self
14690    where
14691        T: std::convert::Into<crate::model::WeeklySchedule>,
14692    {
14693        self.weekly_schedule = std::option::Option::Some(v.into());
14694        self
14695    }
14696
14697    /// Sets or clears the value of [weekly_schedule][crate::model::SnapshotPolicy::weekly_schedule].
14698    ///
14699    /// # Example
14700    /// ```ignore,no_run
14701    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14702    /// use google_cloud_netapp_v1::model::WeeklySchedule;
14703    /// let x = SnapshotPolicy::new().set_or_clear_weekly_schedule(Some(WeeklySchedule::default()/* use setters */));
14704    /// let x = SnapshotPolicy::new().set_or_clear_weekly_schedule(None::<WeeklySchedule>);
14705    /// ```
14706    pub fn set_or_clear_weekly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
14707    where
14708        T: std::convert::Into<crate::model::WeeklySchedule>,
14709    {
14710        self.weekly_schedule = v.map(|x| x.into());
14711        self
14712    }
14713
14714    /// Sets the value of [monthly_schedule][crate::model::SnapshotPolicy::monthly_schedule].
14715    ///
14716    /// # Example
14717    /// ```ignore,no_run
14718    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14719    /// use google_cloud_netapp_v1::model::MonthlySchedule;
14720    /// let x = SnapshotPolicy::new().set_monthly_schedule(MonthlySchedule::default()/* use setters */);
14721    /// ```
14722    pub fn set_monthly_schedule<T>(mut self, v: T) -> Self
14723    where
14724        T: std::convert::Into<crate::model::MonthlySchedule>,
14725    {
14726        self.monthly_schedule = std::option::Option::Some(v.into());
14727        self
14728    }
14729
14730    /// Sets or clears the value of [monthly_schedule][crate::model::SnapshotPolicy::monthly_schedule].
14731    ///
14732    /// # Example
14733    /// ```ignore,no_run
14734    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14735    /// use google_cloud_netapp_v1::model::MonthlySchedule;
14736    /// let x = SnapshotPolicy::new().set_or_clear_monthly_schedule(Some(MonthlySchedule::default()/* use setters */));
14737    /// let x = SnapshotPolicy::new().set_or_clear_monthly_schedule(None::<MonthlySchedule>);
14738    /// ```
14739    pub fn set_or_clear_monthly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
14740    where
14741        T: std::convert::Into<crate::model::MonthlySchedule>,
14742    {
14743        self.monthly_schedule = v.map(|x| x.into());
14744        self
14745    }
14746}
14747
14748impl wkt::message::Message for SnapshotPolicy {
14749    fn typename() -> &'static str {
14750        "type.googleapis.com/google.cloud.netapp.v1.SnapshotPolicy"
14751    }
14752}
14753
14754/// Make a snapshot every hour e.g. at 04:00, 05:00, 06:00.
14755#[derive(Clone, Default, PartialEq)]
14756#[non_exhaustive]
14757pub struct HourlySchedule {
14758    /// The maximum number of Snapshots to keep for the hourly schedule
14759    pub snapshots_to_keep: std::option::Option<f64>,
14760
14761    /// Set the minute of the hour to start the snapshot (0-59), defaults to the
14762    /// top of the hour (0).
14763    pub minute: std::option::Option<f64>,
14764
14765    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14766}
14767
14768impl HourlySchedule {
14769    pub fn new() -> Self {
14770        std::default::Default::default()
14771    }
14772
14773    /// Sets the value of [snapshots_to_keep][crate::model::HourlySchedule::snapshots_to_keep].
14774    ///
14775    /// # Example
14776    /// ```ignore,no_run
14777    /// # use google_cloud_netapp_v1::model::HourlySchedule;
14778    /// let x = HourlySchedule::new().set_snapshots_to_keep(42.0);
14779    /// ```
14780    pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
14781    where
14782        T: std::convert::Into<f64>,
14783    {
14784        self.snapshots_to_keep = std::option::Option::Some(v.into());
14785        self
14786    }
14787
14788    /// Sets or clears the value of [snapshots_to_keep][crate::model::HourlySchedule::snapshots_to_keep].
14789    ///
14790    /// # Example
14791    /// ```ignore,no_run
14792    /// # use google_cloud_netapp_v1::model::HourlySchedule;
14793    /// let x = HourlySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
14794    /// let x = HourlySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
14795    /// ```
14796    pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
14797    where
14798        T: std::convert::Into<f64>,
14799    {
14800        self.snapshots_to_keep = v.map(|x| x.into());
14801        self
14802    }
14803
14804    /// Sets the value of [minute][crate::model::HourlySchedule::minute].
14805    ///
14806    /// # Example
14807    /// ```ignore,no_run
14808    /// # use google_cloud_netapp_v1::model::HourlySchedule;
14809    /// let x = HourlySchedule::new().set_minute(42.0);
14810    /// ```
14811    pub fn set_minute<T>(mut self, v: T) -> Self
14812    where
14813        T: std::convert::Into<f64>,
14814    {
14815        self.minute = std::option::Option::Some(v.into());
14816        self
14817    }
14818
14819    /// Sets or clears the value of [minute][crate::model::HourlySchedule::minute].
14820    ///
14821    /// # Example
14822    /// ```ignore,no_run
14823    /// # use google_cloud_netapp_v1::model::HourlySchedule;
14824    /// let x = HourlySchedule::new().set_or_clear_minute(Some(42.0));
14825    /// let x = HourlySchedule::new().set_or_clear_minute(None::<f32>);
14826    /// ```
14827    pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
14828    where
14829        T: std::convert::Into<f64>,
14830    {
14831        self.minute = v.map(|x| x.into());
14832        self
14833    }
14834}
14835
14836impl wkt::message::Message for HourlySchedule {
14837    fn typename() -> &'static str {
14838        "type.googleapis.com/google.cloud.netapp.v1.HourlySchedule"
14839    }
14840}
14841
14842/// Make a snapshot every day e.g. at 04:00, 05:20, 23:50
14843#[derive(Clone, Default, PartialEq)]
14844#[non_exhaustive]
14845pub struct DailySchedule {
14846    /// The maximum number of Snapshots to keep for the hourly schedule
14847    pub snapshots_to_keep: std::option::Option<f64>,
14848
14849    /// Set the minute of the hour to start the snapshot (0-59), defaults to the
14850    /// top of the hour (0).
14851    pub minute: std::option::Option<f64>,
14852
14853    /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
14854    pub hour: std::option::Option<f64>,
14855
14856    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14857}
14858
14859impl DailySchedule {
14860    pub fn new() -> Self {
14861        std::default::Default::default()
14862    }
14863
14864    /// Sets the value of [snapshots_to_keep][crate::model::DailySchedule::snapshots_to_keep].
14865    ///
14866    /// # Example
14867    /// ```ignore,no_run
14868    /// # use google_cloud_netapp_v1::model::DailySchedule;
14869    /// let x = DailySchedule::new().set_snapshots_to_keep(42.0);
14870    /// ```
14871    pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
14872    where
14873        T: std::convert::Into<f64>,
14874    {
14875        self.snapshots_to_keep = std::option::Option::Some(v.into());
14876        self
14877    }
14878
14879    /// Sets or clears the value of [snapshots_to_keep][crate::model::DailySchedule::snapshots_to_keep].
14880    ///
14881    /// # Example
14882    /// ```ignore,no_run
14883    /// # use google_cloud_netapp_v1::model::DailySchedule;
14884    /// let x = DailySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
14885    /// let x = DailySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
14886    /// ```
14887    pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
14888    where
14889        T: std::convert::Into<f64>,
14890    {
14891        self.snapshots_to_keep = v.map(|x| x.into());
14892        self
14893    }
14894
14895    /// Sets the value of [minute][crate::model::DailySchedule::minute].
14896    ///
14897    /// # Example
14898    /// ```ignore,no_run
14899    /// # use google_cloud_netapp_v1::model::DailySchedule;
14900    /// let x = DailySchedule::new().set_minute(42.0);
14901    /// ```
14902    pub fn set_minute<T>(mut self, v: T) -> Self
14903    where
14904        T: std::convert::Into<f64>,
14905    {
14906        self.minute = std::option::Option::Some(v.into());
14907        self
14908    }
14909
14910    /// Sets or clears the value of [minute][crate::model::DailySchedule::minute].
14911    ///
14912    /// # Example
14913    /// ```ignore,no_run
14914    /// # use google_cloud_netapp_v1::model::DailySchedule;
14915    /// let x = DailySchedule::new().set_or_clear_minute(Some(42.0));
14916    /// let x = DailySchedule::new().set_or_clear_minute(None::<f32>);
14917    /// ```
14918    pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
14919    where
14920        T: std::convert::Into<f64>,
14921    {
14922        self.minute = v.map(|x| x.into());
14923        self
14924    }
14925
14926    /// Sets the value of [hour][crate::model::DailySchedule::hour].
14927    ///
14928    /// # Example
14929    /// ```ignore,no_run
14930    /// # use google_cloud_netapp_v1::model::DailySchedule;
14931    /// let x = DailySchedule::new().set_hour(42.0);
14932    /// ```
14933    pub fn set_hour<T>(mut self, v: T) -> Self
14934    where
14935        T: std::convert::Into<f64>,
14936    {
14937        self.hour = std::option::Option::Some(v.into());
14938        self
14939    }
14940
14941    /// Sets or clears the value of [hour][crate::model::DailySchedule::hour].
14942    ///
14943    /// # Example
14944    /// ```ignore,no_run
14945    /// # use google_cloud_netapp_v1::model::DailySchedule;
14946    /// let x = DailySchedule::new().set_or_clear_hour(Some(42.0));
14947    /// let x = DailySchedule::new().set_or_clear_hour(None::<f32>);
14948    /// ```
14949    pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
14950    where
14951        T: std::convert::Into<f64>,
14952    {
14953        self.hour = v.map(|x| x.into());
14954        self
14955    }
14956}
14957
14958impl wkt::message::Message for DailySchedule {
14959    fn typename() -> &'static str {
14960        "type.googleapis.com/google.cloud.netapp.v1.DailySchedule"
14961    }
14962}
14963
14964/// Make a snapshot every week e.g. at Monday 04:00, Wednesday 05:20, Sunday
14965/// 23:50
14966#[derive(Clone, Default, PartialEq)]
14967#[non_exhaustive]
14968pub struct WeeklySchedule {
14969    /// The maximum number of Snapshots to keep for the hourly schedule
14970    pub snapshots_to_keep: std::option::Option<f64>,
14971
14972    /// Set the minute of the hour to start the snapshot (0-59), defaults to the
14973    /// top of the hour (0).
14974    pub minute: std::option::Option<f64>,
14975
14976    /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
14977    pub hour: std::option::Option<f64>,
14978
14979    /// Set the day or days of the week to make a snapshot. Accepts a comma
14980    /// separated days of the week. Defaults to 'Sunday'.
14981    pub day: std::option::Option<std::string::String>,
14982
14983    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14984}
14985
14986impl WeeklySchedule {
14987    pub fn new() -> Self {
14988        std::default::Default::default()
14989    }
14990
14991    /// Sets the value of [snapshots_to_keep][crate::model::WeeklySchedule::snapshots_to_keep].
14992    ///
14993    /// # Example
14994    /// ```ignore,no_run
14995    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
14996    /// let x = WeeklySchedule::new().set_snapshots_to_keep(42.0);
14997    /// ```
14998    pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
14999    where
15000        T: std::convert::Into<f64>,
15001    {
15002        self.snapshots_to_keep = std::option::Option::Some(v.into());
15003        self
15004    }
15005
15006    /// Sets or clears the value of [snapshots_to_keep][crate::model::WeeklySchedule::snapshots_to_keep].
15007    ///
15008    /// # Example
15009    /// ```ignore,no_run
15010    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15011    /// let x = WeeklySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
15012    /// let x = WeeklySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
15013    /// ```
15014    pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
15015    where
15016        T: std::convert::Into<f64>,
15017    {
15018        self.snapshots_to_keep = v.map(|x| x.into());
15019        self
15020    }
15021
15022    /// Sets the value of [minute][crate::model::WeeklySchedule::minute].
15023    ///
15024    /// # Example
15025    /// ```ignore,no_run
15026    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15027    /// let x = WeeklySchedule::new().set_minute(42.0);
15028    /// ```
15029    pub fn set_minute<T>(mut self, v: T) -> Self
15030    where
15031        T: std::convert::Into<f64>,
15032    {
15033        self.minute = std::option::Option::Some(v.into());
15034        self
15035    }
15036
15037    /// Sets or clears the value of [minute][crate::model::WeeklySchedule::minute].
15038    ///
15039    /// # Example
15040    /// ```ignore,no_run
15041    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15042    /// let x = WeeklySchedule::new().set_or_clear_minute(Some(42.0));
15043    /// let x = WeeklySchedule::new().set_or_clear_minute(None::<f32>);
15044    /// ```
15045    pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
15046    where
15047        T: std::convert::Into<f64>,
15048    {
15049        self.minute = v.map(|x| x.into());
15050        self
15051    }
15052
15053    /// Sets the value of [hour][crate::model::WeeklySchedule::hour].
15054    ///
15055    /// # Example
15056    /// ```ignore,no_run
15057    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15058    /// let x = WeeklySchedule::new().set_hour(42.0);
15059    /// ```
15060    pub fn set_hour<T>(mut self, v: T) -> Self
15061    where
15062        T: std::convert::Into<f64>,
15063    {
15064        self.hour = std::option::Option::Some(v.into());
15065        self
15066    }
15067
15068    /// Sets or clears the value of [hour][crate::model::WeeklySchedule::hour].
15069    ///
15070    /// # Example
15071    /// ```ignore,no_run
15072    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15073    /// let x = WeeklySchedule::new().set_or_clear_hour(Some(42.0));
15074    /// let x = WeeklySchedule::new().set_or_clear_hour(None::<f32>);
15075    /// ```
15076    pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
15077    where
15078        T: std::convert::Into<f64>,
15079    {
15080        self.hour = v.map(|x| x.into());
15081        self
15082    }
15083
15084    /// Sets the value of [day][crate::model::WeeklySchedule::day].
15085    ///
15086    /// # Example
15087    /// ```ignore,no_run
15088    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15089    /// let x = WeeklySchedule::new().set_day("example");
15090    /// ```
15091    pub fn set_day<T>(mut self, v: T) -> Self
15092    where
15093        T: std::convert::Into<std::string::String>,
15094    {
15095        self.day = std::option::Option::Some(v.into());
15096        self
15097    }
15098
15099    /// Sets or clears the value of [day][crate::model::WeeklySchedule::day].
15100    ///
15101    /// # Example
15102    /// ```ignore,no_run
15103    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15104    /// let x = WeeklySchedule::new().set_or_clear_day(Some("example"));
15105    /// let x = WeeklySchedule::new().set_or_clear_day(None::<String>);
15106    /// ```
15107    pub fn set_or_clear_day<T>(mut self, v: std::option::Option<T>) -> Self
15108    where
15109        T: std::convert::Into<std::string::String>,
15110    {
15111        self.day = v.map(|x| x.into());
15112        self
15113    }
15114}
15115
15116impl wkt::message::Message for WeeklySchedule {
15117    fn typename() -> &'static str {
15118        "type.googleapis.com/google.cloud.netapp.v1.WeeklySchedule"
15119    }
15120}
15121
15122/// Make a snapshot once a month e.g. at 2nd 04:00, 7th 05:20, 24th 23:50
15123#[derive(Clone, Default, PartialEq)]
15124#[non_exhaustive]
15125pub struct MonthlySchedule {
15126    /// The maximum number of Snapshots to keep for the hourly schedule
15127    pub snapshots_to_keep: std::option::Option<f64>,
15128
15129    /// Set the minute of the hour to start the snapshot (0-59), defaults to the
15130    /// top of the hour (0).
15131    pub minute: std::option::Option<f64>,
15132
15133    /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
15134    pub hour: std::option::Option<f64>,
15135
15136    /// Set the day or days of the month to make a snapshot (1-31). Accepts a
15137    /// comma separated number of days. Defaults to '1'.
15138    pub days_of_month: std::option::Option<std::string::String>,
15139
15140    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15141}
15142
15143impl MonthlySchedule {
15144    pub fn new() -> Self {
15145        std::default::Default::default()
15146    }
15147
15148    /// Sets the value of [snapshots_to_keep][crate::model::MonthlySchedule::snapshots_to_keep].
15149    ///
15150    /// # Example
15151    /// ```ignore,no_run
15152    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15153    /// let x = MonthlySchedule::new().set_snapshots_to_keep(42.0);
15154    /// ```
15155    pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
15156    where
15157        T: std::convert::Into<f64>,
15158    {
15159        self.snapshots_to_keep = std::option::Option::Some(v.into());
15160        self
15161    }
15162
15163    /// Sets or clears the value of [snapshots_to_keep][crate::model::MonthlySchedule::snapshots_to_keep].
15164    ///
15165    /// # Example
15166    /// ```ignore,no_run
15167    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15168    /// let x = MonthlySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
15169    /// let x = MonthlySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
15170    /// ```
15171    pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
15172    where
15173        T: std::convert::Into<f64>,
15174    {
15175        self.snapshots_to_keep = v.map(|x| x.into());
15176        self
15177    }
15178
15179    /// Sets the value of [minute][crate::model::MonthlySchedule::minute].
15180    ///
15181    /// # Example
15182    /// ```ignore,no_run
15183    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15184    /// let x = MonthlySchedule::new().set_minute(42.0);
15185    /// ```
15186    pub fn set_minute<T>(mut self, v: T) -> Self
15187    where
15188        T: std::convert::Into<f64>,
15189    {
15190        self.minute = std::option::Option::Some(v.into());
15191        self
15192    }
15193
15194    /// Sets or clears the value of [minute][crate::model::MonthlySchedule::minute].
15195    ///
15196    /// # Example
15197    /// ```ignore,no_run
15198    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15199    /// let x = MonthlySchedule::new().set_or_clear_minute(Some(42.0));
15200    /// let x = MonthlySchedule::new().set_or_clear_minute(None::<f32>);
15201    /// ```
15202    pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
15203    where
15204        T: std::convert::Into<f64>,
15205    {
15206        self.minute = v.map(|x| x.into());
15207        self
15208    }
15209
15210    /// Sets the value of [hour][crate::model::MonthlySchedule::hour].
15211    ///
15212    /// # Example
15213    /// ```ignore,no_run
15214    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15215    /// let x = MonthlySchedule::new().set_hour(42.0);
15216    /// ```
15217    pub fn set_hour<T>(mut self, v: T) -> Self
15218    where
15219        T: std::convert::Into<f64>,
15220    {
15221        self.hour = std::option::Option::Some(v.into());
15222        self
15223    }
15224
15225    /// Sets or clears the value of [hour][crate::model::MonthlySchedule::hour].
15226    ///
15227    /// # Example
15228    /// ```ignore,no_run
15229    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15230    /// let x = MonthlySchedule::new().set_or_clear_hour(Some(42.0));
15231    /// let x = MonthlySchedule::new().set_or_clear_hour(None::<f32>);
15232    /// ```
15233    pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
15234    where
15235        T: std::convert::Into<f64>,
15236    {
15237        self.hour = v.map(|x| x.into());
15238        self
15239    }
15240
15241    /// Sets the value of [days_of_month][crate::model::MonthlySchedule::days_of_month].
15242    ///
15243    /// # Example
15244    /// ```ignore,no_run
15245    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15246    /// let x = MonthlySchedule::new().set_days_of_month("example");
15247    /// ```
15248    pub fn set_days_of_month<T>(mut self, v: T) -> Self
15249    where
15250        T: std::convert::Into<std::string::String>,
15251    {
15252        self.days_of_month = std::option::Option::Some(v.into());
15253        self
15254    }
15255
15256    /// Sets or clears the value of [days_of_month][crate::model::MonthlySchedule::days_of_month].
15257    ///
15258    /// # Example
15259    /// ```ignore,no_run
15260    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15261    /// let x = MonthlySchedule::new().set_or_clear_days_of_month(Some("example"));
15262    /// let x = MonthlySchedule::new().set_or_clear_days_of_month(None::<String>);
15263    /// ```
15264    pub fn set_or_clear_days_of_month<T>(mut self, v: std::option::Option<T>) -> Self
15265    where
15266        T: std::convert::Into<std::string::String>,
15267    {
15268        self.days_of_month = v.map(|x| x.into());
15269        self
15270    }
15271}
15272
15273impl wkt::message::Message for MonthlySchedule {
15274    fn typename() -> &'static str {
15275        "type.googleapis.com/google.cloud.netapp.v1.MonthlySchedule"
15276    }
15277}
15278
15279/// View only mount options for a volume.
15280#[derive(Clone, Default, PartialEq)]
15281#[non_exhaustive]
15282pub struct MountOption {
15283    /// Export string
15284    pub export: std::string::String,
15285
15286    /// Full export string
15287    pub export_full: std::string::String,
15288
15289    /// Protocol to mount with.
15290    pub protocol: crate::model::Protocols,
15291
15292    /// Instructions for mounting
15293    pub instructions: std::string::String,
15294
15295    /// Output only. IP Address.
15296    pub ip_address: std::string::String,
15297
15298    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15299}
15300
15301impl MountOption {
15302    pub fn new() -> Self {
15303        std::default::Default::default()
15304    }
15305
15306    /// Sets the value of [export][crate::model::MountOption::export].
15307    ///
15308    /// # Example
15309    /// ```ignore,no_run
15310    /// # use google_cloud_netapp_v1::model::MountOption;
15311    /// let x = MountOption::new().set_export("example");
15312    /// ```
15313    pub fn set_export<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15314        self.export = v.into();
15315        self
15316    }
15317
15318    /// Sets the value of [export_full][crate::model::MountOption::export_full].
15319    ///
15320    /// # Example
15321    /// ```ignore,no_run
15322    /// # use google_cloud_netapp_v1::model::MountOption;
15323    /// let x = MountOption::new().set_export_full("example");
15324    /// ```
15325    pub fn set_export_full<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15326        self.export_full = v.into();
15327        self
15328    }
15329
15330    /// Sets the value of [protocol][crate::model::MountOption::protocol].
15331    ///
15332    /// # Example
15333    /// ```ignore,no_run
15334    /// # use google_cloud_netapp_v1::model::MountOption;
15335    /// use google_cloud_netapp_v1::model::Protocols;
15336    /// let x0 = MountOption::new().set_protocol(Protocols::Nfsv3);
15337    /// let x1 = MountOption::new().set_protocol(Protocols::Nfsv4);
15338    /// let x2 = MountOption::new().set_protocol(Protocols::Smb);
15339    /// ```
15340    pub fn set_protocol<T: std::convert::Into<crate::model::Protocols>>(mut self, v: T) -> Self {
15341        self.protocol = v.into();
15342        self
15343    }
15344
15345    /// Sets the value of [instructions][crate::model::MountOption::instructions].
15346    ///
15347    /// # Example
15348    /// ```ignore,no_run
15349    /// # use google_cloud_netapp_v1::model::MountOption;
15350    /// let x = MountOption::new().set_instructions("example");
15351    /// ```
15352    pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15353        self.instructions = v.into();
15354        self
15355    }
15356
15357    /// Sets the value of [ip_address][crate::model::MountOption::ip_address].
15358    ///
15359    /// # Example
15360    /// ```ignore,no_run
15361    /// # use google_cloud_netapp_v1::model::MountOption;
15362    /// let x = MountOption::new().set_ip_address("example");
15363    /// ```
15364    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15365        self.ip_address = v.into();
15366        self
15367    }
15368}
15369
15370impl wkt::message::Message for MountOption {
15371    fn typename() -> &'static str {
15372        "type.googleapis.com/google.cloud.netapp.v1.MountOption"
15373    }
15374}
15375
15376/// The RestoreParameters if volume is created from a snapshot or backup.
15377#[derive(Clone, Default, PartialEq)]
15378#[non_exhaustive]
15379pub struct RestoreParameters {
15380    /// The source that the volume is created from.
15381    pub source: std::option::Option<crate::model::restore_parameters::Source>,
15382
15383    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15384}
15385
15386impl RestoreParameters {
15387    pub fn new() -> Self {
15388        std::default::Default::default()
15389    }
15390
15391    /// Sets the value of [source][crate::model::RestoreParameters::source].
15392    ///
15393    /// Note that all the setters affecting `source` are mutually
15394    /// exclusive.
15395    ///
15396    /// # Example
15397    /// ```ignore,no_run
15398    /// # use google_cloud_netapp_v1::model::RestoreParameters;
15399    /// use google_cloud_netapp_v1::model::restore_parameters::Source;
15400    /// let x = RestoreParameters::new().set_source(Some(Source::SourceSnapshot("example".to_string())));
15401    /// ```
15402    pub fn set_source<
15403        T: std::convert::Into<std::option::Option<crate::model::restore_parameters::Source>>,
15404    >(
15405        mut self,
15406        v: T,
15407    ) -> Self {
15408        self.source = v.into();
15409        self
15410    }
15411
15412    /// The value of [source][crate::model::RestoreParameters::source]
15413    /// if it holds a `SourceSnapshot`, `None` if the field is not set or
15414    /// holds a different branch.
15415    pub fn source_snapshot(&self) -> std::option::Option<&std::string::String> {
15416        #[allow(unreachable_patterns)]
15417        self.source.as_ref().and_then(|v| match v {
15418            crate::model::restore_parameters::Source::SourceSnapshot(v) => {
15419                std::option::Option::Some(v)
15420            }
15421            _ => std::option::Option::None,
15422        })
15423    }
15424
15425    /// Sets the value of [source][crate::model::RestoreParameters::source]
15426    /// to hold a `SourceSnapshot`.
15427    ///
15428    /// Note that all the setters affecting `source` are
15429    /// mutually exclusive.
15430    ///
15431    /// # Example
15432    /// ```ignore,no_run
15433    /// # use google_cloud_netapp_v1::model::RestoreParameters;
15434    /// let x = RestoreParameters::new().set_source_snapshot("example");
15435    /// assert!(x.source_snapshot().is_some());
15436    /// assert!(x.source_backup().is_none());
15437    /// ```
15438    pub fn set_source_snapshot<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15439        self.source = std::option::Option::Some(
15440            crate::model::restore_parameters::Source::SourceSnapshot(v.into()),
15441        );
15442        self
15443    }
15444
15445    /// The value of [source][crate::model::RestoreParameters::source]
15446    /// if it holds a `SourceBackup`, `None` if the field is not set or
15447    /// holds a different branch.
15448    pub fn source_backup(&self) -> std::option::Option<&std::string::String> {
15449        #[allow(unreachable_patterns)]
15450        self.source.as_ref().and_then(|v| match v {
15451            crate::model::restore_parameters::Source::SourceBackup(v) => {
15452                std::option::Option::Some(v)
15453            }
15454            _ => std::option::Option::None,
15455        })
15456    }
15457
15458    /// Sets the value of [source][crate::model::RestoreParameters::source]
15459    /// to hold a `SourceBackup`.
15460    ///
15461    /// Note that all the setters affecting `source` are
15462    /// mutually exclusive.
15463    ///
15464    /// # Example
15465    /// ```ignore,no_run
15466    /// # use google_cloud_netapp_v1::model::RestoreParameters;
15467    /// let x = RestoreParameters::new().set_source_backup("example");
15468    /// assert!(x.source_backup().is_some());
15469    /// assert!(x.source_snapshot().is_none());
15470    /// ```
15471    pub fn set_source_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15472        self.source = std::option::Option::Some(
15473            crate::model::restore_parameters::Source::SourceBackup(v.into()),
15474        );
15475        self
15476    }
15477}
15478
15479impl wkt::message::Message for RestoreParameters {
15480    fn typename() -> &'static str {
15481        "type.googleapis.com/google.cloud.netapp.v1.RestoreParameters"
15482    }
15483}
15484
15485/// Defines additional types related to [RestoreParameters].
15486pub mod restore_parameters {
15487    #[allow(unused_imports)]
15488    use super::*;
15489
15490    /// The source that the volume is created from.
15491    #[derive(Clone, Debug, PartialEq)]
15492    #[non_exhaustive]
15493    pub enum Source {
15494        /// Full name of the snapshot resource.
15495        /// Format:
15496        /// projects/{project}/locations/{location}/volumes/{volume}/snapshots/{snapshot}
15497        SourceSnapshot(std::string::String),
15498        /// Full name of the backup resource.
15499        /// Format:
15500        /// projects/{project}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}
15501        SourceBackup(std::string::String),
15502    }
15503}
15504
15505/// BackupConfig contains backup related config on a volume.
15506#[derive(Clone, Default, PartialEq)]
15507#[non_exhaustive]
15508pub struct BackupConfig {
15509    /// Optional. When specified, schedule backups will be created based on the
15510    /// policy configuration.
15511    pub backup_policies: std::vec::Vec<std::string::String>,
15512
15513    /// Optional. Name of backup vault.
15514    /// Format:
15515    /// projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}
15516    pub backup_vault: std::string::String,
15517
15518    /// Optional. When set to true, scheduled backup is enabled on the volume.
15519    /// This field should be nil when there's no backup policy attached.
15520    pub scheduled_backup_enabled: std::option::Option<bool>,
15521
15522    /// Output only. Total size of all backups in a chain in bytes = baseline
15523    /// backup size + sum(incremental backup size).
15524    pub backup_chain_bytes: std::option::Option<i64>,
15525
15526    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15527}
15528
15529impl BackupConfig {
15530    pub fn new() -> Self {
15531        std::default::Default::default()
15532    }
15533
15534    /// Sets the value of [backup_policies][crate::model::BackupConfig::backup_policies].
15535    ///
15536    /// # Example
15537    /// ```ignore,no_run
15538    /// # use google_cloud_netapp_v1::model::BackupConfig;
15539    /// let x = BackupConfig::new().set_backup_policies(["a", "b", "c"]);
15540    /// ```
15541    pub fn set_backup_policies<T, V>(mut self, v: T) -> Self
15542    where
15543        T: std::iter::IntoIterator<Item = V>,
15544        V: std::convert::Into<std::string::String>,
15545    {
15546        use std::iter::Iterator;
15547        self.backup_policies = v.into_iter().map(|i| i.into()).collect();
15548        self
15549    }
15550
15551    /// Sets the value of [backup_vault][crate::model::BackupConfig::backup_vault].
15552    ///
15553    /// # Example
15554    /// ```ignore,no_run
15555    /// # use google_cloud_netapp_v1::model::BackupConfig;
15556    /// let x = BackupConfig::new().set_backup_vault("example");
15557    /// ```
15558    pub fn set_backup_vault<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15559        self.backup_vault = v.into();
15560        self
15561    }
15562
15563    /// Sets the value of [scheduled_backup_enabled][crate::model::BackupConfig::scheduled_backup_enabled].
15564    ///
15565    /// # Example
15566    /// ```ignore,no_run
15567    /// # use google_cloud_netapp_v1::model::BackupConfig;
15568    /// let x = BackupConfig::new().set_scheduled_backup_enabled(true);
15569    /// ```
15570    pub fn set_scheduled_backup_enabled<T>(mut self, v: T) -> Self
15571    where
15572        T: std::convert::Into<bool>,
15573    {
15574        self.scheduled_backup_enabled = std::option::Option::Some(v.into());
15575        self
15576    }
15577
15578    /// Sets or clears the value of [scheduled_backup_enabled][crate::model::BackupConfig::scheduled_backup_enabled].
15579    ///
15580    /// # Example
15581    /// ```ignore,no_run
15582    /// # use google_cloud_netapp_v1::model::BackupConfig;
15583    /// let x = BackupConfig::new().set_or_clear_scheduled_backup_enabled(Some(false));
15584    /// let x = BackupConfig::new().set_or_clear_scheduled_backup_enabled(None::<bool>);
15585    /// ```
15586    pub fn set_or_clear_scheduled_backup_enabled<T>(mut self, v: std::option::Option<T>) -> Self
15587    where
15588        T: std::convert::Into<bool>,
15589    {
15590        self.scheduled_backup_enabled = v.map(|x| x.into());
15591        self
15592    }
15593
15594    /// Sets the value of [backup_chain_bytes][crate::model::BackupConfig::backup_chain_bytes].
15595    ///
15596    /// # Example
15597    /// ```ignore,no_run
15598    /// # use google_cloud_netapp_v1::model::BackupConfig;
15599    /// let x = BackupConfig::new().set_backup_chain_bytes(42);
15600    /// ```
15601    pub fn set_backup_chain_bytes<T>(mut self, v: T) -> Self
15602    where
15603        T: std::convert::Into<i64>,
15604    {
15605        self.backup_chain_bytes = std::option::Option::Some(v.into());
15606        self
15607    }
15608
15609    /// Sets or clears the value of [backup_chain_bytes][crate::model::BackupConfig::backup_chain_bytes].
15610    ///
15611    /// # Example
15612    /// ```ignore,no_run
15613    /// # use google_cloud_netapp_v1::model::BackupConfig;
15614    /// let x = BackupConfig::new().set_or_clear_backup_chain_bytes(Some(42));
15615    /// let x = BackupConfig::new().set_or_clear_backup_chain_bytes(None::<i32>);
15616    /// ```
15617    pub fn set_or_clear_backup_chain_bytes<T>(mut self, v: std::option::Option<T>) -> Self
15618    where
15619        T: std::convert::Into<i64>,
15620    {
15621        self.backup_chain_bytes = v.map(|x| x.into());
15622        self
15623    }
15624}
15625
15626impl wkt::message::Message for BackupConfig {
15627    fn typename() -> &'static str {
15628        "type.googleapis.com/google.cloud.netapp.v1.BackupConfig"
15629    }
15630}
15631
15632/// Defines tiering policy for the volume.
15633#[derive(Clone, Default, PartialEq)]
15634#[non_exhaustive]
15635pub struct TieringPolicy {
15636    /// Optional. Flag indicating if the volume has tiering policy enable/pause.
15637    /// Default is PAUSED.
15638    pub tier_action: std::option::Option<crate::model::tiering_policy::TierAction>,
15639
15640    /// Optional. Time in days to mark the volume's data block as cold and make it
15641    /// eligible for tiering, can be range from 2-183. Default is 31.
15642    pub cooling_threshold_days: std::option::Option<i32>,
15643
15644    /// Optional. Flag indicating that the hot tier bypass mode is enabled. Default
15645    /// is false. This is only applicable to Flex service level.
15646    pub hot_tier_bypass_mode_enabled: std::option::Option<bool>,
15647
15648    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15649}
15650
15651impl TieringPolicy {
15652    pub fn new() -> Self {
15653        std::default::Default::default()
15654    }
15655
15656    /// Sets the value of [tier_action][crate::model::TieringPolicy::tier_action].
15657    ///
15658    /// # Example
15659    /// ```ignore,no_run
15660    /// # use google_cloud_netapp_v1::model::TieringPolicy;
15661    /// use google_cloud_netapp_v1::model::tiering_policy::TierAction;
15662    /// let x0 = TieringPolicy::new().set_tier_action(TierAction::Enabled);
15663    /// let x1 = TieringPolicy::new().set_tier_action(TierAction::Paused);
15664    /// ```
15665    pub fn set_tier_action<T>(mut self, v: T) -> Self
15666    where
15667        T: std::convert::Into<crate::model::tiering_policy::TierAction>,
15668    {
15669        self.tier_action = std::option::Option::Some(v.into());
15670        self
15671    }
15672
15673    /// Sets or clears the value of [tier_action][crate::model::TieringPolicy::tier_action].
15674    ///
15675    /// # Example
15676    /// ```ignore,no_run
15677    /// # use google_cloud_netapp_v1::model::TieringPolicy;
15678    /// use google_cloud_netapp_v1::model::tiering_policy::TierAction;
15679    /// let x0 = TieringPolicy::new().set_or_clear_tier_action(Some(TierAction::Enabled));
15680    /// let x1 = TieringPolicy::new().set_or_clear_tier_action(Some(TierAction::Paused));
15681    /// let x_none = TieringPolicy::new().set_or_clear_tier_action(None::<TierAction>);
15682    /// ```
15683    pub fn set_or_clear_tier_action<T>(mut self, v: std::option::Option<T>) -> Self
15684    where
15685        T: std::convert::Into<crate::model::tiering_policy::TierAction>,
15686    {
15687        self.tier_action = v.map(|x| x.into());
15688        self
15689    }
15690
15691    /// Sets the value of [cooling_threshold_days][crate::model::TieringPolicy::cooling_threshold_days].
15692    ///
15693    /// # Example
15694    /// ```ignore,no_run
15695    /// # use google_cloud_netapp_v1::model::TieringPolicy;
15696    /// let x = TieringPolicy::new().set_cooling_threshold_days(42);
15697    /// ```
15698    pub fn set_cooling_threshold_days<T>(mut self, v: T) -> Self
15699    where
15700        T: std::convert::Into<i32>,
15701    {
15702        self.cooling_threshold_days = std::option::Option::Some(v.into());
15703        self
15704    }
15705
15706    /// Sets or clears the value of [cooling_threshold_days][crate::model::TieringPolicy::cooling_threshold_days].
15707    ///
15708    /// # Example
15709    /// ```ignore,no_run
15710    /// # use google_cloud_netapp_v1::model::TieringPolicy;
15711    /// let x = TieringPolicy::new().set_or_clear_cooling_threshold_days(Some(42));
15712    /// let x = TieringPolicy::new().set_or_clear_cooling_threshold_days(None::<i32>);
15713    /// ```
15714    pub fn set_or_clear_cooling_threshold_days<T>(mut self, v: std::option::Option<T>) -> Self
15715    where
15716        T: std::convert::Into<i32>,
15717    {
15718        self.cooling_threshold_days = v.map(|x| x.into());
15719        self
15720    }
15721
15722    /// Sets the value of [hot_tier_bypass_mode_enabled][crate::model::TieringPolicy::hot_tier_bypass_mode_enabled].
15723    ///
15724    /// # Example
15725    /// ```ignore,no_run
15726    /// # use google_cloud_netapp_v1::model::TieringPolicy;
15727    /// let x = TieringPolicy::new().set_hot_tier_bypass_mode_enabled(true);
15728    /// ```
15729    pub fn set_hot_tier_bypass_mode_enabled<T>(mut self, v: T) -> Self
15730    where
15731        T: std::convert::Into<bool>,
15732    {
15733        self.hot_tier_bypass_mode_enabled = std::option::Option::Some(v.into());
15734        self
15735    }
15736
15737    /// Sets or clears the value of [hot_tier_bypass_mode_enabled][crate::model::TieringPolicy::hot_tier_bypass_mode_enabled].
15738    ///
15739    /// # Example
15740    /// ```ignore,no_run
15741    /// # use google_cloud_netapp_v1::model::TieringPolicy;
15742    /// let x = TieringPolicy::new().set_or_clear_hot_tier_bypass_mode_enabled(Some(false));
15743    /// let x = TieringPolicy::new().set_or_clear_hot_tier_bypass_mode_enabled(None::<bool>);
15744    /// ```
15745    pub fn set_or_clear_hot_tier_bypass_mode_enabled<T>(mut self, v: std::option::Option<T>) -> Self
15746    where
15747        T: std::convert::Into<bool>,
15748    {
15749        self.hot_tier_bypass_mode_enabled = v.map(|x| x.into());
15750        self
15751    }
15752}
15753
15754impl wkt::message::Message for TieringPolicy {
15755    fn typename() -> &'static str {
15756        "type.googleapis.com/google.cloud.netapp.v1.TieringPolicy"
15757    }
15758}
15759
15760/// Defines additional types related to [TieringPolicy].
15761pub mod tiering_policy {
15762    #[allow(unused_imports)]
15763    use super::*;
15764
15765    /// Tier action for the volume.
15766    ///
15767    /// # Working with unknown values
15768    ///
15769    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15770    /// additional enum variants at any time. Adding new variants is not considered
15771    /// a breaking change. Applications should write their code in anticipation of:
15772    ///
15773    /// - New values appearing in future releases of the client library, **and**
15774    /// - New values received dynamically, without application changes.
15775    ///
15776    /// Please consult the [Working with enums] section in the user guide for some
15777    /// guidelines.
15778    ///
15779    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15780    #[derive(Clone, Debug, PartialEq)]
15781    #[non_exhaustive]
15782    pub enum TierAction {
15783        /// Unspecified.
15784        Unspecified,
15785        /// When tiering is enabled, new cold data will be tiered.
15786        Enabled,
15787        /// When paused, tiering won't be performed on new data. Existing data stays
15788        /// tiered until accessed.
15789        Paused,
15790        /// If set, the enum was initialized with an unknown value.
15791        ///
15792        /// Applications can examine the value using [TierAction::value] or
15793        /// [TierAction::name].
15794        UnknownValue(tier_action::UnknownValue),
15795    }
15796
15797    #[doc(hidden)]
15798    pub mod tier_action {
15799        #[allow(unused_imports)]
15800        use super::*;
15801        #[derive(Clone, Debug, PartialEq)]
15802        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15803    }
15804
15805    impl TierAction {
15806        /// Gets the enum value.
15807        ///
15808        /// Returns `None` if the enum contains an unknown value deserialized from
15809        /// the string representation of enums.
15810        pub fn value(&self) -> std::option::Option<i32> {
15811            match self {
15812                Self::Unspecified => std::option::Option::Some(0),
15813                Self::Enabled => std::option::Option::Some(1),
15814                Self::Paused => std::option::Option::Some(2),
15815                Self::UnknownValue(u) => u.0.value(),
15816            }
15817        }
15818
15819        /// Gets the enum value as a string.
15820        ///
15821        /// Returns `None` if the enum contains an unknown value deserialized from
15822        /// the integer representation of enums.
15823        pub fn name(&self) -> std::option::Option<&str> {
15824            match self {
15825                Self::Unspecified => std::option::Option::Some("TIER_ACTION_UNSPECIFIED"),
15826                Self::Enabled => std::option::Option::Some("ENABLED"),
15827                Self::Paused => std::option::Option::Some("PAUSED"),
15828                Self::UnknownValue(u) => u.0.name(),
15829            }
15830        }
15831    }
15832
15833    impl std::default::Default for TierAction {
15834        fn default() -> Self {
15835            use std::convert::From;
15836            Self::from(0)
15837        }
15838    }
15839
15840    impl std::fmt::Display for TierAction {
15841        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15842            wkt::internal::display_enum(f, self.name(), self.value())
15843        }
15844    }
15845
15846    impl std::convert::From<i32> for TierAction {
15847        fn from(value: i32) -> Self {
15848            match value {
15849                0 => Self::Unspecified,
15850                1 => Self::Enabled,
15851                2 => Self::Paused,
15852                _ => Self::UnknownValue(tier_action::UnknownValue(
15853                    wkt::internal::UnknownEnumValue::Integer(value),
15854                )),
15855            }
15856        }
15857    }
15858
15859    impl std::convert::From<&str> for TierAction {
15860        fn from(value: &str) -> Self {
15861            use std::string::ToString;
15862            match value {
15863                "TIER_ACTION_UNSPECIFIED" => Self::Unspecified,
15864                "ENABLED" => Self::Enabled,
15865                "PAUSED" => Self::Paused,
15866                _ => Self::UnknownValue(tier_action::UnknownValue(
15867                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15868                )),
15869            }
15870        }
15871    }
15872
15873    impl serde::ser::Serialize for TierAction {
15874        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15875        where
15876            S: serde::Serializer,
15877        {
15878            match self {
15879                Self::Unspecified => serializer.serialize_i32(0),
15880                Self::Enabled => serializer.serialize_i32(1),
15881                Self::Paused => serializer.serialize_i32(2),
15882                Self::UnknownValue(u) => u.0.serialize(serializer),
15883            }
15884        }
15885    }
15886
15887    impl<'de> serde::de::Deserialize<'de> for TierAction {
15888        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15889        where
15890            D: serde::Deserializer<'de>,
15891        {
15892            deserializer.deserialize_any(wkt::internal::EnumVisitor::<TierAction>::new(
15893                ".google.cloud.netapp.v1.TieringPolicy.TierAction",
15894            ))
15895        }
15896    }
15897}
15898
15899/// The Hybrid Replication parameters for the volume.
15900#[derive(Clone, Default, PartialEq)]
15901#[non_exhaustive]
15902pub struct HybridReplicationParameters {
15903    /// Required. Desired name for the replication of this volume.
15904    pub replication: std::string::String,
15905
15906    /// Required. Name of the user's local source volume to be peered with the
15907    /// destination volume.
15908    pub peer_volume_name: std::string::String,
15909
15910    /// Required. Name of the user's local source cluster to be peered with the
15911    /// destination cluster.
15912    pub peer_cluster_name: std::string::String,
15913
15914    /// Required. Name of the user's local source vserver svm to be peered with the
15915    /// destination vserver svm.
15916    pub peer_svm_name: std::string::String,
15917
15918    /// Required. List of node ip addresses to be peered with.
15919    pub peer_ip_addresses: std::vec::Vec<std::string::String>,
15920
15921    /// Optional. Name of source cluster location associated with the Hybrid
15922    /// replication. This is a free-form field for the display purpose only.
15923    pub cluster_location: std::string::String,
15924
15925    /// Optional. Description of the replication.
15926    pub description: std::string::String,
15927
15928    /// Optional. Labels to be added to the replication as the key value pairs.
15929    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
15930
15931    /// Optional. Replication Schedule for the replication created.
15932    pub replication_schedule: crate::model::HybridReplicationSchedule,
15933
15934    /// Optional. Type of the hybrid replication.
15935    pub hybrid_replication_type:
15936        crate::model::hybrid_replication_parameters::VolumeHybridReplicationType,
15937
15938    /// Optional. Constituent volume count for large volume.
15939    pub large_volume_constituent_count: i32,
15940
15941    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15942}
15943
15944impl HybridReplicationParameters {
15945    pub fn new() -> Self {
15946        std::default::Default::default()
15947    }
15948
15949    /// Sets the value of [replication][crate::model::HybridReplicationParameters::replication].
15950    ///
15951    /// # Example
15952    /// ```ignore,no_run
15953    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
15954    /// let x = HybridReplicationParameters::new().set_replication("example");
15955    /// ```
15956    pub fn set_replication<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15957        self.replication = v.into();
15958        self
15959    }
15960
15961    /// Sets the value of [peer_volume_name][crate::model::HybridReplicationParameters::peer_volume_name].
15962    ///
15963    /// # Example
15964    /// ```ignore,no_run
15965    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
15966    /// let x = HybridReplicationParameters::new().set_peer_volume_name("example");
15967    /// ```
15968    pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
15969        mut self,
15970        v: T,
15971    ) -> Self {
15972        self.peer_volume_name = v.into();
15973        self
15974    }
15975
15976    /// Sets the value of [peer_cluster_name][crate::model::HybridReplicationParameters::peer_cluster_name].
15977    ///
15978    /// # Example
15979    /// ```ignore,no_run
15980    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
15981    /// let x = HybridReplicationParameters::new().set_peer_cluster_name("example");
15982    /// ```
15983    pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
15984        mut self,
15985        v: T,
15986    ) -> Self {
15987        self.peer_cluster_name = v.into();
15988        self
15989    }
15990
15991    /// Sets the value of [peer_svm_name][crate::model::HybridReplicationParameters::peer_svm_name].
15992    ///
15993    /// # Example
15994    /// ```ignore,no_run
15995    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
15996    /// let x = HybridReplicationParameters::new().set_peer_svm_name("example");
15997    /// ```
15998    pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15999        self.peer_svm_name = v.into();
16000        self
16001    }
16002
16003    /// Sets the value of [peer_ip_addresses][crate::model::HybridReplicationParameters::peer_ip_addresses].
16004    ///
16005    /// # Example
16006    /// ```ignore,no_run
16007    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16008    /// let x = HybridReplicationParameters::new().set_peer_ip_addresses(["a", "b", "c"]);
16009    /// ```
16010    pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
16011    where
16012        T: std::iter::IntoIterator<Item = V>,
16013        V: std::convert::Into<std::string::String>,
16014    {
16015        use std::iter::Iterator;
16016        self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
16017        self
16018    }
16019
16020    /// Sets the value of [cluster_location][crate::model::HybridReplicationParameters::cluster_location].
16021    ///
16022    /// # Example
16023    /// ```ignore,no_run
16024    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16025    /// let x = HybridReplicationParameters::new().set_cluster_location("example");
16026    /// ```
16027    pub fn set_cluster_location<T: std::convert::Into<std::string::String>>(
16028        mut self,
16029        v: T,
16030    ) -> Self {
16031        self.cluster_location = v.into();
16032        self
16033    }
16034
16035    /// Sets the value of [description][crate::model::HybridReplicationParameters::description].
16036    ///
16037    /// # Example
16038    /// ```ignore,no_run
16039    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16040    /// let x = HybridReplicationParameters::new().set_description("example");
16041    /// ```
16042    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16043        self.description = v.into();
16044        self
16045    }
16046
16047    /// Sets the value of [labels][crate::model::HybridReplicationParameters::labels].
16048    ///
16049    /// # Example
16050    /// ```ignore,no_run
16051    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16052    /// let x = HybridReplicationParameters::new().set_labels([
16053    ///     ("key0", "abc"),
16054    ///     ("key1", "xyz"),
16055    /// ]);
16056    /// ```
16057    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
16058    where
16059        T: std::iter::IntoIterator<Item = (K, V)>,
16060        K: std::convert::Into<std::string::String>,
16061        V: std::convert::Into<std::string::String>,
16062    {
16063        use std::iter::Iterator;
16064        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16065        self
16066    }
16067
16068    /// Sets the value of [replication_schedule][crate::model::HybridReplicationParameters::replication_schedule].
16069    ///
16070    /// # Example
16071    /// ```ignore,no_run
16072    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16073    /// use google_cloud_netapp_v1::model::HybridReplicationSchedule;
16074    /// let x0 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Every10Minutes);
16075    /// let x1 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Hourly);
16076    /// let x2 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Daily);
16077    /// ```
16078    pub fn set_replication_schedule<
16079        T: std::convert::Into<crate::model::HybridReplicationSchedule>,
16080    >(
16081        mut self,
16082        v: T,
16083    ) -> Self {
16084        self.replication_schedule = v.into();
16085        self
16086    }
16087
16088    /// Sets the value of [hybrid_replication_type][crate::model::HybridReplicationParameters::hybrid_replication_type].
16089    ///
16090    /// # Example
16091    /// ```ignore,no_run
16092    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16093    /// use google_cloud_netapp_v1::model::hybrid_replication_parameters::VolumeHybridReplicationType;
16094    /// let x0 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::Migration);
16095    /// let x1 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::ContinuousReplication);
16096    /// let x2 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::OnpremReplication);
16097    /// ```
16098    pub fn set_hybrid_replication_type<
16099        T: std::convert::Into<
16100                crate::model::hybrid_replication_parameters::VolumeHybridReplicationType,
16101            >,
16102    >(
16103        mut self,
16104        v: T,
16105    ) -> Self {
16106        self.hybrid_replication_type = v.into();
16107        self
16108    }
16109
16110    /// Sets the value of [large_volume_constituent_count][crate::model::HybridReplicationParameters::large_volume_constituent_count].
16111    ///
16112    /// # Example
16113    /// ```ignore,no_run
16114    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16115    /// let x = HybridReplicationParameters::new().set_large_volume_constituent_count(42);
16116    /// ```
16117    pub fn set_large_volume_constituent_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16118        self.large_volume_constituent_count = v.into();
16119        self
16120    }
16121}
16122
16123impl wkt::message::Message for HybridReplicationParameters {
16124    fn typename() -> &'static str {
16125        "type.googleapis.com/google.cloud.netapp.v1.HybridReplicationParameters"
16126    }
16127}
16128
16129/// Defines additional types related to [HybridReplicationParameters].
16130pub mod hybrid_replication_parameters {
16131    #[allow(unused_imports)]
16132    use super::*;
16133
16134    /// Type of the volume's hybrid replication.
16135    ///
16136    /// # Working with unknown values
16137    ///
16138    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16139    /// additional enum variants at any time. Adding new variants is not considered
16140    /// a breaking change. Applications should write their code in anticipation of:
16141    ///
16142    /// - New values appearing in future releases of the client library, **and**
16143    /// - New values received dynamically, without application changes.
16144    ///
16145    /// Please consult the [Working with enums] section in the user guide for some
16146    /// guidelines.
16147    ///
16148    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16149    #[derive(Clone, Debug, PartialEq)]
16150    #[non_exhaustive]
16151    pub enum VolumeHybridReplicationType {
16152        /// Unspecified hybrid replication type.
16153        Unspecified,
16154        /// Hybrid replication type for migration.
16155        Migration,
16156        /// Hybrid replication type for continuous replication.
16157        ContinuousReplication,
16158        /// New field for reversible OnPrem replication, to be used for data
16159        /// protection.
16160        OnpremReplication,
16161        /// New field for reversible OnPrem replication, to be used for data
16162        /// protection.
16163        ReverseOnpremReplication,
16164        /// If set, the enum was initialized with an unknown value.
16165        ///
16166        /// Applications can examine the value using [VolumeHybridReplicationType::value] or
16167        /// [VolumeHybridReplicationType::name].
16168        UnknownValue(volume_hybrid_replication_type::UnknownValue),
16169    }
16170
16171    #[doc(hidden)]
16172    pub mod volume_hybrid_replication_type {
16173        #[allow(unused_imports)]
16174        use super::*;
16175        #[derive(Clone, Debug, PartialEq)]
16176        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16177    }
16178
16179    impl VolumeHybridReplicationType {
16180        /// Gets the enum value.
16181        ///
16182        /// Returns `None` if the enum contains an unknown value deserialized from
16183        /// the string representation of enums.
16184        pub fn value(&self) -> std::option::Option<i32> {
16185            match self {
16186                Self::Unspecified => std::option::Option::Some(0),
16187                Self::Migration => std::option::Option::Some(1),
16188                Self::ContinuousReplication => std::option::Option::Some(2),
16189                Self::OnpremReplication => std::option::Option::Some(3),
16190                Self::ReverseOnpremReplication => std::option::Option::Some(4),
16191                Self::UnknownValue(u) => u.0.value(),
16192            }
16193        }
16194
16195        /// Gets the enum value as a string.
16196        ///
16197        /// Returns `None` if the enum contains an unknown value deserialized from
16198        /// the integer representation of enums.
16199        pub fn name(&self) -> std::option::Option<&str> {
16200            match self {
16201                Self::Unspecified => {
16202                    std::option::Option::Some("VOLUME_HYBRID_REPLICATION_TYPE_UNSPECIFIED")
16203                }
16204                Self::Migration => std::option::Option::Some("MIGRATION"),
16205                Self::ContinuousReplication => std::option::Option::Some("CONTINUOUS_REPLICATION"),
16206                Self::OnpremReplication => std::option::Option::Some("ONPREM_REPLICATION"),
16207                Self::ReverseOnpremReplication => {
16208                    std::option::Option::Some("REVERSE_ONPREM_REPLICATION")
16209                }
16210                Self::UnknownValue(u) => u.0.name(),
16211            }
16212        }
16213    }
16214
16215    impl std::default::Default for VolumeHybridReplicationType {
16216        fn default() -> Self {
16217            use std::convert::From;
16218            Self::from(0)
16219        }
16220    }
16221
16222    impl std::fmt::Display for VolumeHybridReplicationType {
16223        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16224            wkt::internal::display_enum(f, self.name(), self.value())
16225        }
16226    }
16227
16228    impl std::convert::From<i32> for VolumeHybridReplicationType {
16229        fn from(value: i32) -> Self {
16230            match value {
16231                0 => Self::Unspecified,
16232                1 => Self::Migration,
16233                2 => Self::ContinuousReplication,
16234                3 => Self::OnpremReplication,
16235                4 => Self::ReverseOnpremReplication,
16236                _ => Self::UnknownValue(volume_hybrid_replication_type::UnknownValue(
16237                    wkt::internal::UnknownEnumValue::Integer(value),
16238                )),
16239            }
16240        }
16241    }
16242
16243    impl std::convert::From<&str> for VolumeHybridReplicationType {
16244        fn from(value: &str) -> Self {
16245            use std::string::ToString;
16246            match value {
16247                "VOLUME_HYBRID_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
16248                "MIGRATION" => Self::Migration,
16249                "CONTINUOUS_REPLICATION" => Self::ContinuousReplication,
16250                "ONPREM_REPLICATION" => Self::OnpremReplication,
16251                "REVERSE_ONPREM_REPLICATION" => Self::ReverseOnpremReplication,
16252                _ => Self::UnknownValue(volume_hybrid_replication_type::UnknownValue(
16253                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16254                )),
16255            }
16256        }
16257    }
16258
16259    impl serde::ser::Serialize for VolumeHybridReplicationType {
16260        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16261        where
16262            S: serde::Serializer,
16263        {
16264            match self {
16265                Self::Unspecified => serializer.serialize_i32(0),
16266                Self::Migration => serializer.serialize_i32(1),
16267                Self::ContinuousReplication => serializer.serialize_i32(2),
16268                Self::OnpremReplication => serializer.serialize_i32(3),
16269                Self::ReverseOnpremReplication => serializer.serialize_i32(4),
16270                Self::UnknownValue(u) => u.0.serialize(serializer),
16271            }
16272        }
16273    }
16274
16275    impl<'de> serde::de::Deserialize<'de> for VolumeHybridReplicationType {
16276        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16277        where
16278            D: serde::Deserializer<'de>,
16279        {
16280            deserializer.deserialize_any(wkt::internal::EnumVisitor::<VolumeHybridReplicationType>::new(
16281                ".google.cloud.netapp.v1.HybridReplicationParameters.VolumeHybridReplicationType"))
16282        }
16283    }
16284}
16285
16286/// Cache Parameters for the volume.
16287#[derive(Clone, Default, PartialEq)]
16288#[non_exhaustive]
16289pub struct CacheParameters {
16290    /// Required. Name of the origin volume for the cache volume.
16291    pub peer_volume_name: std::string::String,
16292
16293    /// Required. Name of the origin volume's ONTAP cluster.
16294    pub peer_cluster_name: std::string::String,
16295
16296    /// Required. Name of the origin volume's SVM.
16297    pub peer_svm_name: std::string::String,
16298
16299    /// Required. List of IC LIF addresses of the origin volume's ONTAP cluster.
16300    pub peer_ip_addresses: std::vec::Vec<std::string::String>,
16301
16302    /// Optional. Indicates whether the cache volume has global file lock enabled.
16303    pub enable_global_file_lock: std::option::Option<bool>,
16304
16305    /// Optional. Configuration of the cache volume.
16306    pub cache_config: std::option::Option<crate::model::CacheConfig>,
16307
16308    /// Output only. State of the cache volume indicating the peering status.
16309    pub cache_state: crate::model::cache_parameters::CacheState,
16310
16311    /// Output only. Copy-paste-able commands to be used on user's ONTAP to accept
16312    /// peering requests.
16313    pub command: std::string::String,
16314
16315    /// Optional. Expiration time for the peering command to be executed on user's
16316    /// ONTAP.
16317    pub peering_command_expiry_time: std::option::Option<wkt::Timestamp>,
16318
16319    /// Output only. Temporary passphrase generated to accept cluster peering
16320    /// command.
16321    pub passphrase: std::string::String,
16322
16323    /// Output only. Detailed description of the current cache state.
16324    pub state_details: std::string::String,
16325
16326    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16327}
16328
16329impl CacheParameters {
16330    pub fn new() -> Self {
16331        std::default::Default::default()
16332    }
16333
16334    /// Sets the value of [peer_volume_name][crate::model::CacheParameters::peer_volume_name].
16335    ///
16336    /// # Example
16337    /// ```ignore,no_run
16338    /// # use google_cloud_netapp_v1::model::CacheParameters;
16339    /// let x = CacheParameters::new().set_peer_volume_name("example");
16340    /// ```
16341    pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
16342        mut self,
16343        v: T,
16344    ) -> Self {
16345        self.peer_volume_name = v.into();
16346        self
16347    }
16348
16349    /// Sets the value of [peer_cluster_name][crate::model::CacheParameters::peer_cluster_name].
16350    ///
16351    /// # Example
16352    /// ```ignore,no_run
16353    /// # use google_cloud_netapp_v1::model::CacheParameters;
16354    /// let x = CacheParameters::new().set_peer_cluster_name("example");
16355    /// ```
16356    pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
16357        mut self,
16358        v: T,
16359    ) -> Self {
16360        self.peer_cluster_name = v.into();
16361        self
16362    }
16363
16364    /// Sets the value of [peer_svm_name][crate::model::CacheParameters::peer_svm_name].
16365    ///
16366    /// # Example
16367    /// ```ignore,no_run
16368    /// # use google_cloud_netapp_v1::model::CacheParameters;
16369    /// let x = CacheParameters::new().set_peer_svm_name("example");
16370    /// ```
16371    pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16372        self.peer_svm_name = v.into();
16373        self
16374    }
16375
16376    /// Sets the value of [peer_ip_addresses][crate::model::CacheParameters::peer_ip_addresses].
16377    ///
16378    /// # Example
16379    /// ```ignore,no_run
16380    /// # use google_cloud_netapp_v1::model::CacheParameters;
16381    /// let x = CacheParameters::new().set_peer_ip_addresses(["a", "b", "c"]);
16382    /// ```
16383    pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
16384    where
16385        T: std::iter::IntoIterator<Item = V>,
16386        V: std::convert::Into<std::string::String>,
16387    {
16388        use std::iter::Iterator;
16389        self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
16390        self
16391    }
16392
16393    /// Sets the value of [enable_global_file_lock][crate::model::CacheParameters::enable_global_file_lock].
16394    ///
16395    /// # Example
16396    /// ```ignore,no_run
16397    /// # use google_cloud_netapp_v1::model::CacheParameters;
16398    /// let x = CacheParameters::new().set_enable_global_file_lock(true);
16399    /// ```
16400    pub fn set_enable_global_file_lock<T>(mut self, v: T) -> Self
16401    where
16402        T: std::convert::Into<bool>,
16403    {
16404        self.enable_global_file_lock = std::option::Option::Some(v.into());
16405        self
16406    }
16407
16408    /// Sets or clears the value of [enable_global_file_lock][crate::model::CacheParameters::enable_global_file_lock].
16409    ///
16410    /// # Example
16411    /// ```ignore,no_run
16412    /// # use google_cloud_netapp_v1::model::CacheParameters;
16413    /// let x = CacheParameters::new().set_or_clear_enable_global_file_lock(Some(false));
16414    /// let x = CacheParameters::new().set_or_clear_enable_global_file_lock(None::<bool>);
16415    /// ```
16416    pub fn set_or_clear_enable_global_file_lock<T>(mut self, v: std::option::Option<T>) -> Self
16417    where
16418        T: std::convert::Into<bool>,
16419    {
16420        self.enable_global_file_lock = v.map(|x| x.into());
16421        self
16422    }
16423
16424    /// Sets the value of [cache_config][crate::model::CacheParameters::cache_config].
16425    ///
16426    /// # Example
16427    /// ```ignore,no_run
16428    /// # use google_cloud_netapp_v1::model::CacheParameters;
16429    /// use google_cloud_netapp_v1::model::CacheConfig;
16430    /// let x = CacheParameters::new().set_cache_config(CacheConfig::default()/* use setters */);
16431    /// ```
16432    pub fn set_cache_config<T>(mut self, v: T) -> Self
16433    where
16434        T: std::convert::Into<crate::model::CacheConfig>,
16435    {
16436        self.cache_config = std::option::Option::Some(v.into());
16437        self
16438    }
16439
16440    /// Sets or clears the value of [cache_config][crate::model::CacheParameters::cache_config].
16441    ///
16442    /// # Example
16443    /// ```ignore,no_run
16444    /// # use google_cloud_netapp_v1::model::CacheParameters;
16445    /// use google_cloud_netapp_v1::model::CacheConfig;
16446    /// let x = CacheParameters::new().set_or_clear_cache_config(Some(CacheConfig::default()/* use setters */));
16447    /// let x = CacheParameters::new().set_or_clear_cache_config(None::<CacheConfig>);
16448    /// ```
16449    pub fn set_or_clear_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
16450    where
16451        T: std::convert::Into<crate::model::CacheConfig>,
16452    {
16453        self.cache_config = v.map(|x| x.into());
16454        self
16455    }
16456
16457    /// Sets the value of [cache_state][crate::model::CacheParameters::cache_state].
16458    ///
16459    /// # Example
16460    /// ```ignore,no_run
16461    /// # use google_cloud_netapp_v1::model::CacheParameters;
16462    /// use google_cloud_netapp_v1::model::cache_parameters::CacheState;
16463    /// let x0 = CacheParameters::new().set_cache_state(CacheState::PendingClusterPeering);
16464    /// let x1 = CacheParameters::new().set_cache_state(CacheState::PendingSvmPeering);
16465    /// let x2 = CacheParameters::new().set_cache_state(CacheState::Peered);
16466    /// ```
16467    pub fn set_cache_state<T: std::convert::Into<crate::model::cache_parameters::CacheState>>(
16468        mut self,
16469        v: T,
16470    ) -> Self {
16471        self.cache_state = v.into();
16472        self
16473    }
16474
16475    /// Sets the value of [command][crate::model::CacheParameters::command].
16476    ///
16477    /// # Example
16478    /// ```ignore,no_run
16479    /// # use google_cloud_netapp_v1::model::CacheParameters;
16480    /// let x = CacheParameters::new().set_command("example");
16481    /// ```
16482    pub fn set_command<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16483        self.command = v.into();
16484        self
16485    }
16486
16487    /// Sets the value of [peering_command_expiry_time][crate::model::CacheParameters::peering_command_expiry_time].
16488    ///
16489    /// # Example
16490    /// ```ignore,no_run
16491    /// # use google_cloud_netapp_v1::model::CacheParameters;
16492    /// use wkt::Timestamp;
16493    /// let x = CacheParameters::new().set_peering_command_expiry_time(Timestamp::default()/* use setters */);
16494    /// ```
16495    pub fn set_peering_command_expiry_time<T>(mut self, v: T) -> Self
16496    where
16497        T: std::convert::Into<wkt::Timestamp>,
16498    {
16499        self.peering_command_expiry_time = std::option::Option::Some(v.into());
16500        self
16501    }
16502
16503    /// Sets or clears the value of [peering_command_expiry_time][crate::model::CacheParameters::peering_command_expiry_time].
16504    ///
16505    /// # Example
16506    /// ```ignore,no_run
16507    /// # use google_cloud_netapp_v1::model::CacheParameters;
16508    /// use wkt::Timestamp;
16509    /// let x = CacheParameters::new().set_or_clear_peering_command_expiry_time(Some(Timestamp::default()/* use setters */));
16510    /// let x = CacheParameters::new().set_or_clear_peering_command_expiry_time(None::<Timestamp>);
16511    /// ```
16512    pub fn set_or_clear_peering_command_expiry_time<T>(mut self, v: std::option::Option<T>) -> Self
16513    where
16514        T: std::convert::Into<wkt::Timestamp>,
16515    {
16516        self.peering_command_expiry_time = v.map(|x| x.into());
16517        self
16518    }
16519
16520    /// Sets the value of [passphrase][crate::model::CacheParameters::passphrase].
16521    ///
16522    /// # Example
16523    /// ```ignore,no_run
16524    /// # use google_cloud_netapp_v1::model::CacheParameters;
16525    /// let x = CacheParameters::new().set_passphrase("example");
16526    /// ```
16527    pub fn set_passphrase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16528        self.passphrase = v.into();
16529        self
16530    }
16531
16532    /// Sets the value of [state_details][crate::model::CacheParameters::state_details].
16533    ///
16534    /// # Example
16535    /// ```ignore,no_run
16536    /// # use google_cloud_netapp_v1::model::CacheParameters;
16537    /// let x = CacheParameters::new().set_state_details("example");
16538    /// ```
16539    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16540        self.state_details = v.into();
16541        self
16542    }
16543}
16544
16545impl wkt::message::Message for CacheParameters {
16546    fn typename() -> &'static str {
16547        "type.googleapis.com/google.cloud.netapp.v1.CacheParameters"
16548    }
16549}
16550
16551/// Defines additional types related to [CacheParameters].
16552pub mod cache_parameters {
16553    #[allow(unused_imports)]
16554    use super::*;
16555
16556    /// State of the cache volume indicating the peering status.
16557    ///
16558    /// # Working with unknown values
16559    ///
16560    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16561    /// additional enum variants at any time. Adding new variants is not considered
16562    /// a breaking change. Applications should write their code in anticipation of:
16563    ///
16564    /// - New values appearing in future releases of the client library, **and**
16565    /// - New values received dynamically, without application changes.
16566    ///
16567    /// Please consult the [Working with enums] section in the user guide for some
16568    /// guidelines.
16569    ///
16570    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16571    #[derive(Clone, Debug, PartialEq)]
16572    #[non_exhaustive]
16573    pub enum CacheState {
16574        /// Default unspecified state.
16575        Unspecified,
16576        /// State indicating waiting for cluster peering to be established.
16577        PendingClusterPeering,
16578        /// State indicating waiting for SVM peering to be established.
16579        PendingSvmPeering,
16580        /// State indicating successful establishment of peering with origin
16581        /// volumes's ONTAP cluster.
16582        Peered,
16583        /// Terminal state wherein peering with origin volume's ONTAP cluster
16584        /// has failed.
16585        Error,
16586        /// If set, the enum was initialized with an unknown value.
16587        ///
16588        /// Applications can examine the value using [CacheState::value] or
16589        /// [CacheState::name].
16590        UnknownValue(cache_state::UnknownValue),
16591    }
16592
16593    #[doc(hidden)]
16594    pub mod cache_state {
16595        #[allow(unused_imports)]
16596        use super::*;
16597        #[derive(Clone, Debug, PartialEq)]
16598        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16599    }
16600
16601    impl CacheState {
16602        /// Gets the enum value.
16603        ///
16604        /// Returns `None` if the enum contains an unknown value deserialized from
16605        /// the string representation of enums.
16606        pub fn value(&self) -> std::option::Option<i32> {
16607            match self {
16608                Self::Unspecified => std::option::Option::Some(0),
16609                Self::PendingClusterPeering => std::option::Option::Some(1),
16610                Self::PendingSvmPeering => std::option::Option::Some(2),
16611                Self::Peered => std::option::Option::Some(3),
16612                Self::Error => std::option::Option::Some(4),
16613                Self::UnknownValue(u) => u.0.value(),
16614            }
16615        }
16616
16617        /// Gets the enum value as a string.
16618        ///
16619        /// Returns `None` if the enum contains an unknown value deserialized from
16620        /// the integer representation of enums.
16621        pub fn name(&self) -> std::option::Option<&str> {
16622            match self {
16623                Self::Unspecified => std::option::Option::Some("CACHE_STATE_UNSPECIFIED"),
16624                Self::PendingClusterPeering => std::option::Option::Some("PENDING_CLUSTER_PEERING"),
16625                Self::PendingSvmPeering => std::option::Option::Some("PENDING_SVM_PEERING"),
16626                Self::Peered => std::option::Option::Some("PEERED"),
16627                Self::Error => std::option::Option::Some("ERROR"),
16628                Self::UnknownValue(u) => u.0.name(),
16629            }
16630        }
16631    }
16632
16633    impl std::default::Default for CacheState {
16634        fn default() -> Self {
16635            use std::convert::From;
16636            Self::from(0)
16637        }
16638    }
16639
16640    impl std::fmt::Display for CacheState {
16641        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16642            wkt::internal::display_enum(f, self.name(), self.value())
16643        }
16644    }
16645
16646    impl std::convert::From<i32> for CacheState {
16647        fn from(value: i32) -> Self {
16648            match value {
16649                0 => Self::Unspecified,
16650                1 => Self::PendingClusterPeering,
16651                2 => Self::PendingSvmPeering,
16652                3 => Self::Peered,
16653                4 => Self::Error,
16654                _ => Self::UnknownValue(cache_state::UnknownValue(
16655                    wkt::internal::UnknownEnumValue::Integer(value),
16656                )),
16657            }
16658        }
16659    }
16660
16661    impl std::convert::From<&str> for CacheState {
16662        fn from(value: &str) -> Self {
16663            use std::string::ToString;
16664            match value {
16665                "CACHE_STATE_UNSPECIFIED" => Self::Unspecified,
16666                "PENDING_CLUSTER_PEERING" => Self::PendingClusterPeering,
16667                "PENDING_SVM_PEERING" => Self::PendingSvmPeering,
16668                "PEERED" => Self::Peered,
16669                "ERROR" => Self::Error,
16670                _ => Self::UnknownValue(cache_state::UnknownValue(
16671                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16672                )),
16673            }
16674        }
16675    }
16676
16677    impl serde::ser::Serialize for CacheState {
16678        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16679        where
16680            S: serde::Serializer,
16681        {
16682            match self {
16683                Self::Unspecified => serializer.serialize_i32(0),
16684                Self::PendingClusterPeering => serializer.serialize_i32(1),
16685                Self::PendingSvmPeering => serializer.serialize_i32(2),
16686                Self::Peered => serializer.serialize_i32(3),
16687                Self::Error => serializer.serialize_i32(4),
16688                Self::UnknownValue(u) => u.0.serialize(serializer),
16689            }
16690        }
16691    }
16692
16693    impl<'de> serde::de::Deserialize<'de> for CacheState {
16694        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16695        where
16696            D: serde::Deserializer<'de>,
16697        {
16698            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CacheState>::new(
16699                ".google.cloud.netapp.v1.CacheParameters.CacheState",
16700            ))
16701        }
16702    }
16703}
16704
16705/// Configuration of the cache volume.
16706#[derive(Clone, Default, PartialEq)]
16707#[non_exhaustive]
16708pub struct CacheConfig {
16709    /// Optional. Pre-populate cache volume with data from the origin volume.
16710    pub cache_pre_populate: std::option::Option<crate::model::CachePrePopulate>,
16711
16712    /// Optional. Flag indicating whether writeback is enabled for the FlexCache
16713    /// volume.
16714    pub writeback_enabled: std::option::Option<bool>,
16715
16716    /// Optional. Flag indicating whether a CIFS change notification is enabled for
16717    /// the FlexCache volume.
16718    pub cifs_change_notify_enabled: std::option::Option<bool>,
16719
16720    /// Output only. State of the prepopulation job indicating how the
16721    /// prepopulation is progressing.
16722    pub cache_pre_populate_state: crate::model::cache_config::CachePrePopulateState,
16723
16724    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16725}
16726
16727impl CacheConfig {
16728    pub fn new() -> Self {
16729        std::default::Default::default()
16730    }
16731
16732    /// Sets the value of [cache_pre_populate][crate::model::CacheConfig::cache_pre_populate].
16733    ///
16734    /// # Example
16735    /// ```ignore,no_run
16736    /// # use google_cloud_netapp_v1::model::CacheConfig;
16737    /// use google_cloud_netapp_v1::model::CachePrePopulate;
16738    /// let x = CacheConfig::new().set_cache_pre_populate(CachePrePopulate::default()/* use setters */);
16739    /// ```
16740    pub fn set_cache_pre_populate<T>(mut self, v: T) -> Self
16741    where
16742        T: std::convert::Into<crate::model::CachePrePopulate>,
16743    {
16744        self.cache_pre_populate = std::option::Option::Some(v.into());
16745        self
16746    }
16747
16748    /// Sets or clears the value of [cache_pre_populate][crate::model::CacheConfig::cache_pre_populate].
16749    ///
16750    /// # Example
16751    /// ```ignore,no_run
16752    /// # use google_cloud_netapp_v1::model::CacheConfig;
16753    /// use google_cloud_netapp_v1::model::CachePrePopulate;
16754    /// let x = CacheConfig::new().set_or_clear_cache_pre_populate(Some(CachePrePopulate::default()/* use setters */));
16755    /// let x = CacheConfig::new().set_or_clear_cache_pre_populate(None::<CachePrePopulate>);
16756    /// ```
16757    pub fn set_or_clear_cache_pre_populate<T>(mut self, v: std::option::Option<T>) -> Self
16758    where
16759        T: std::convert::Into<crate::model::CachePrePopulate>,
16760    {
16761        self.cache_pre_populate = v.map(|x| x.into());
16762        self
16763    }
16764
16765    /// Sets the value of [writeback_enabled][crate::model::CacheConfig::writeback_enabled].
16766    ///
16767    /// # Example
16768    /// ```ignore,no_run
16769    /// # use google_cloud_netapp_v1::model::CacheConfig;
16770    /// let x = CacheConfig::new().set_writeback_enabled(true);
16771    /// ```
16772    pub fn set_writeback_enabled<T>(mut self, v: T) -> Self
16773    where
16774        T: std::convert::Into<bool>,
16775    {
16776        self.writeback_enabled = std::option::Option::Some(v.into());
16777        self
16778    }
16779
16780    /// Sets or clears the value of [writeback_enabled][crate::model::CacheConfig::writeback_enabled].
16781    ///
16782    /// # Example
16783    /// ```ignore,no_run
16784    /// # use google_cloud_netapp_v1::model::CacheConfig;
16785    /// let x = CacheConfig::new().set_or_clear_writeback_enabled(Some(false));
16786    /// let x = CacheConfig::new().set_or_clear_writeback_enabled(None::<bool>);
16787    /// ```
16788    pub fn set_or_clear_writeback_enabled<T>(mut self, v: std::option::Option<T>) -> Self
16789    where
16790        T: std::convert::Into<bool>,
16791    {
16792        self.writeback_enabled = v.map(|x| x.into());
16793        self
16794    }
16795
16796    /// Sets the value of [cifs_change_notify_enabled][crate::model::CacheConfig::cifs_change_notify_enabled].
16797    ///
16798    /// # Example
16799    /// ```ignore,no_run
16800    /// # use google_cloud_netapp_v1::model::CacheConfig;
16801    /// let x = CacheConfig::new().set_cifs_change_notify_enabled(true);
16802    /// ```
16803    pub fn set_cifs_change_notify_enabled<T>(mut self, v: T) -> Self
16804    where
16805        T: std::convert::Into<bool>,
16806    {
16807        self.cifs_change_notify_enabled = std::option::Option::Some(v.into());
16808        self
16809    }
16810
16811    /// Sets or clears the value of [cifs_change_notify_enabled][crate::model::CacheConfig::cifs_change_notify_enabled].
16812    ///
16813    /// # Example
16814    /// ```ignore,no_run
16815    /// # use google_cloud_netapp_v1::model::CacheConfig;
16816    /// let x = CacheConfig::new().set_or_clear_cifs_change_notify_enabled(Some(false));
16817    /// let x = CacheConfig::new().set_or_clear_cifs_change_notify_enabled(None::<bool>);
16818    /// ```
16819    pub fn set_or_clear_cifs_change_notify_enabled<T>(mut self, v: std::option::Option<T>) -> Self
16820    where
16821        T: std::convert::Into<bool>,
16822    {
16823        self.cifs_change_notify_enabled = v.map(|x| x.into());
16824        self
16825    }
16826
16827    /// Sets the value of [cache_pre_populate_state][crate::model::CacheConfig::cache_pre_populate_state].
16828    ///
16829    /// # Example
16830    /// ```ignore,no_run
16831    /// # use google_cloud_netapp_v1::model::CacheConfig;
16832    /// use google_cloud_netapp_v1::model::cache_config::CachePrePopulateState;
16833    /// let x0 = CacheConfig::new().set_cache_pre_populate_state(CachePrePopulateState::NotNeeded);
16834    /// let x1 = CacheConfig::new().set_cache_pre_populate_state(CachePrePopulateState::InProgress);
16835    /// let x2 = CacheConfig::new().set_cache_pre_populate_state(CachePrePopulateState::Complete);
16836    /// ```
16837    pub fn set_cache_pre_populate_state<
16838        T: std::convert::Into<crate::model::cache_config::CachePrePopulateState>,
16839    >(
16840        mut self,
16841        v: T,
16842    ) -> Self {
16843        self.cache_pre_populate_state = v.into();
16844        self
16845    }
16846}
16847
16848impl wkt::message::Message for CacheConfig {
16849    fn typename() -> &'static str {
16850        "type.googleapis.com/google.cloud.netapp.v1.CacheConfig"
16851    }
16852}
16853
16854/// Defines additional types related to [CacheConfig].
16855pub mod cache_config {
16856    #[allow(unused_imports)]
16857    use super::*;
16858
16859    /// State of the prepopulation job indicating how the prepopulation is
16860    /// progressing.
16861    ///
16862    /// # Working with unknown values
16863    ///
16864    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16865    /// additional enum variants at any time. Adding new variants is not considered
16866    /// a breaking change. Applications should write their code in anticipation of:
16867    ///
16868    /// - New values appearing in future releases of the client library, **and**
16869    /// - New values received dynamically, without application changes.
16870    ///
16871    /// Please consult the [Working with enums] section in the user guide for some
16872    /// guidelines.
16873    ///
16874    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16875    #[derive(Clone, Debug, PartialEq)]
16876    #[non_exhaustive]
16877    pub enum CachePrePopulateState {
16878        /// Default unspecified state.
16879        Unspecified,
16880        /// State representing when the most recent create or update request did not
16881        /// require a prepopulation job.
16882        NotNeeded,
16883        /// State representing when the most recent update request requested a
16884        /// prepopulation job but it has not yet completed.
16885        InProgress,
16886        /// State representing when the most recent update request requested a
16887        /// prepopulation job and it has completed successfully.
16888        Complete,
16889        /// State representing when the most recent update request requested a
16890        /// prepopulation job but the prepopulate job failed.
16891        Error,
16892        /// If set, the enum was initialized with an unknown value.
16893        ///
16894        /// Applications can examine the value using [CachePrePopulateState::value] or
16895        /// [CachePrePopulateState::name].
16896        UnknownValue(cache_pre_populate_state::UnknownValue),
16897    }
16898
16899    #[doc(hidden)]
16900    pub mod cache_pre_populate_state {
16901        #[allow(unused_imports)]
16902        use super::*;
16903        #[derive(Clone, Debug, PartialEq)]
16904        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16905    }
16906
16907    impl CachePrePopulateState {
16908        /// Gets the enum value.
16909        ///
16910        /// Returns `None` if the enum contains an unknown value deserialized from
16911        /// the string representation of enums.
16912        pub fn value(&self) -> std::option::Option<i32> {
16913            match self {
16914                Self::Unspecified => std::option::Option::Some(0),
16915                Self::NotNeeded => std::option::Option::Some(1),
16916                Self::InProgress => std::option::Option::Some(2),
16917                Self::Complete => std::option::Option::Some(3),
16918                Self::Error => std::option::Option::Some(4),
16919                Self::UnknownValue(u) => u.0.value(),
16920            }
16921        }
16922
16923        /// Gets the enum value as a string.
16924        ///
16925        /// Returns `None` if the enum contains an unknown value deserialized from
16926        /// the integer representation of enums.
16927        pub fn name(&self) -> std::option::Option<&str> {
16928            match self {
16929                Self::Unspecified => {
16930                    std::option::Option::Some("CACHE_PRE_POPULATE_STATE_UNSPECIFIED")
16931                }
16932                Self::NotNeeded => std::option::Option::Some("NOT_NEEDED"),
16933                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
16934                Self::Complete => std::option::Option::Some("COMPLETE"),
16935                Self::Error => std::option::Option::Some("ERROR"),
16936                Self::UnknownValue(u) => u.0.name(),
16937            }
16938        }
16939    }
16940
16941    impl std::default::Default for CachePrePopulateState {
16942        fn default() -> Self {
16943            use std::convert::From;
16944            Self::from(0)
16945        }
16946    }
16947
16948    impl std::fmt::Display for CachePrePopulateState {
16949        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16950            wkt::internal::display_enum(f, self.name(), self.value())
16951        }
16952    }
16953
16954    impl std::convert::From<i32> for CachePrePopulateState {
16955        fn from(value: i32) -> Self {
16956            match value {
16957                0 => Self::Unspecified,
16958                1 => Self::NotNeeded,
16959                2 => Self::InProgress,
16960                3 => Self::Complete,
16961                4 => Self::Error,
16962                _ => Self::UnknownValue(cache_pre_populate_state::UnknownValue(
16963                    wkt::internal::UnknownEnumValue::Integer(value),
16964                )),
16965            }
16966        }
16967    }
16968
16969    impl std::convert::From<&str> for CachePrePopulateState {
16970        fn from(value: &str) -> Self {
16971            use std::string::ToString;
16972            match value {
16973                "CACHE_PRE_POPULATE_STATE_UNSPECIFIED" => Self::Unspecified,
16974                "NOT_NEEDED" => Self::NotNeeded,
16975                "IN_PROGRESS" => Self::InProgress,
16976                "COMPLETE" => Self::Complete,
16977                "ERROR" => Self::Error,
16978                _ => Self::UnknownValue(cache_pre_populate_state::UnknownValue(
16979                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16980                )),
16981            }
16982        }
16983    }
16984
16985    impl serde::ser::Serialize for CachePrePopulateState {
16986        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16987        where
16988            S: serde::Serializer,
16989        {
16990            match self {
16991                Self::Unspecified => serializer.serialize_i32(0),
16992                Self::NotNeeded => serializer.serialize_i32(1),
16993                Self::InProgress => serializer.serialize_i32(2),
16994                Self::Complete => serializer.serialize_i32(3),
16995                Self::Error => serializer.serialize_i32(4),
16996                Self::UnknownValue(u) => u.0.serialize(serializer),
16997            }
16998        }
16999    }
17000
17001    impl<'de> serde::de::Deserialize<'de> for CachePrePopulateState {
17002        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17003        where
17004            D: serde::Deserializer<'de>,
17005        {
17006            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CachePrePopulateState>::new(
17007                ".google.cloud.netapp.v1.CacheConfig.CachePrePopulateState",
17008            ))
17009        }
17010    }
17011}
17012
17013/// Pre-populate cache volume with data from the origin volume.
17014#[derive(Clone, Default, PartialEq)]
17015#[non_exhaustive]
17016pub struct CachePrePopulate {
17017    /// Optional. List of directory-paths to be pre-populated for the FlexCache
17018    /// volume.
17019    pub path_list: std::vec::Vec<std::string::String>,
17020
17021    /// Optional. List of directory-paths to be excluded for pre-population for the
17022    /// FlexCache volume.
17023    pub exclude_path_list: std::vec::Vec<std::string::String>,
17024
17025    /// Optional. Flag indicating whether the directories listed with the
17026    /// `path_list` need to be recursively pre-populated.
17027    pub recursion: std::option::Option<bool>,
17028
17029    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17030}
17031
17032impl CachePrePopulate {
17033    pub fn new() -> Self {
17034        std::default::Default::default()
17035    }
17036
17037    /// Sets the value of [path_list][crate::model::CachePrePopulate::path_list].
17038    ///
17039    /// # Example
17040    /// ```ignore,no_run
17041    /// # use google_cloud_netapp_v1::model::CachePrePopulate;
17042    /// let x = CachePrePopulate::new().set_path_list(["a", "b", "c"]);
17043    /// ```
17044    pub fn set_path_list<T, V>(mut self, v: T) -> Self
17045    where
17046        T: std::iter::IntoIterator<Item = V>,
17047        V: std::convert::Into<std::string::String>,
17048    {
17049        use std::iter::Iterator;
17050        self.path_list = v.into_iter().map(|i| i.into()).collect();
17051        self
17052    }
17053
17054    /// Sets the value of [exclude_path_list][crate::model::CachePrePopulate::exclude_path_list].
17055    ///
17056    /// # Example
17057    /// ```ignore,no_run
17058    /// # use google_cloud_netapp_v1::model::CachePrePopulate;
17059    /// let x = CachePrePopulate::new().set_exclude_path_list(["a", "b", "c"]);
17060    /// ```
17061    pub fn set_exclude_path_list<T, V>(mut self, v: T) -> Self
17062    where
17063        T: std::iter::IntoIterator<Item = V>,
17064        V: std::convert::Into<std::string::String>,
17065    {
17066        use std::iter::Iterator;
17067        self.exclude_path_list = v.into_iter().map(|i| i.into()).collect();
17068        self
17069    }
17070
17071    /// Sets the value of [recursion][crate::model::CachePrePopulate::recursion].
17072    ///
17073    /// # Example
17074    /// ```ignore,no_run
17075    /// # use google_cloud_netapp_v1::model::CachePrePopulate;
17076    /// let x = CachePrePopulate::new().set_recursion(true);
17077    /// ```
17078    pub fn set_recursion<T>(mut self, v: T) -> Self
17079    where
17080        T: std::convert::Into<bool>,
17081    {
17082        self.recursion = std::option::Option::Some(v.into());
17083        self
17084    }
17085
17086    /// Sets or clears the value of [recursion][crate::model::CachePrePopulate::recursion].
17087    ///
17088    /// # Example
17089    /// ```ignore,no_run
17090    /// # use google_cloud_netapp_v1::model::CachePrePopulate;
17091    /// let x = CachePrePopulate::new().set_or_clear_recursion(Some(false));
17092    /// let x = CachePrePopulate::new().set_or_clear_recursion(None::<bool>);
17093    /// ```
17094    pub fn set_or_clear_recursion<T>(mut self, v: std::option::Option<T>) -> Self
17095    where
17096        T: std::convert::Into<bool>,
17097    {
17098        self.recursion = v.map(|x| x.into());
17099        self
17100    }
17101}
17102
17103impl wkt::message::Message for CachePrePopulate {
17104    fn typename() -> &'static str {
17105        "type.googleapis.com/google.cloud.netapp.v1.CachePrePopulate"
17106    }
17107}
17108
17109/// Block device represents the device(s) which are stored in the block volume.
17110#[derive(Clone, Default, PartialEq)]
17111#[non_exhaustive]
17112pub struct BlockDevice {
17113    /// Optional. User-defined name for the block device, unique within the volume.
17114    /// In case no user input is provided, name will be auto-generated in the
17115    /// backend. The name must meet the following requirements:
17116    ///
17117    /// * Be between 1 and 255 characters long.
17118    /// * Contain only uppercase or lowercase letters (A-Z, a-z), numbers (0-9),
17119    ///   and the following special characters: "-", "_", "}", "{", ".".
17120    /// * Spaces are not allowed.
17121    pub name: std::option::Option<std::string::String>,
17122
17123    /// Optional. A list of host groups that identify hosts that can mount the
17124    /// block volume. Format:
17125    /// `projects/{project_id}/locations/{location}/hostGroups/{host_group_id}`
17126    /// This field can be updated after the block device is created.
17127    pub host_groups: std::vec::Vec<std::string::String>,
17128
17129    /// Output only. Device identifier of the block volume. This represents
17130    /// `lun_serial_number` for iSCSI volumes.
17131    pub identifier: std::string::String,
17132
17133    /// Optional. The size of the block device in GiB.
17134    /// Any value provided for the `size_gib` field during volume creation is
17135    /// ignored. The block device's size is system-managed and will be set to match
17136    /// the parent Volume's `capacity_gib`.
17137    pub size_gib: std::option::Option<i64>,
17138
17139    /// Required. Immutable. The OS type of the volume.
17140    /// This field can't be changed after the block device is created.
17141    pub os_type: crate::model::OsType,
17142
17143    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17144}
17145
17146impl BlockDevice {
17147    pub fn new() -> Self {
17148        std::default::Default::default()
17149    }
17150
17151    /// Sets the value of [name][crate::model::BlockDevice::name].
17152    ///
17153    /// # Example
17154    /// ```ignore,no_run
17155    /// # use google_cloud_netapp_v1::model::BlockDevice;
17156    /// let x = BlockDevice::new().set_name("example");
17157    /// ```
17158    pub fn set_name<T>(mut self, v: T) -> Self
17159    where
17160        T: std::convert::Into<std::string::String>,
17161    {
17162        self.name = std::option::Option::Some(v.into());
17163        self
17164    }
17165
17166    /// Sets or clears the value of [name][crate::model::BlockDevice::name].
17167    ///
17168    /// # Example
17169    /// ```ignore,no_run
17170    /// # use google_cloud_netapp_v1::model::BlockDevice;
17171    /// let x = BlockDevice::new().set_or_clear_name(Some("example"));
17172    /// let x = BlockDevice::new().set_or_clear_name(None::<String>);
17173    /// ```
17174    pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
17175    where
17176        T: std::convert::Into<std::string::String>,
17177    {
17178        self.name = v.map(|x| x.into());
17179        self
17180    }
17181
17182    /// Sets the value of [host_groups][crate::model::BlockDevice::host_groups].
17183    ///
17184    /// # Example
17185    /// ```ignore,no_run
17186    /// # use google_cloud_netapp_v1::model::BlockDevice;
17187    /// let x = BlockDevice::new().set_host_groups(["a", "b", "c"]);
17188    /// ```
17189    pub fn set_host_groups<T, V>(mut self, v: T) -> Self
17190    where
17191        T: std::iter::IntoIterator<Item = V>,
17192        V: std::convert::Into<std::string::String>,
17193    {
17194        use std::iter::Iterator;
17195        self.host_groups = v.into_iter().map(|i| i.into()).collect();
17196        self
17197    }
17198
17199    /// Sets the value of [identifier][crate::model::BlockDevice::identifier].
17200    ///
17201    /// # Example
17202    /// ```ignore,no_run
17203    /// # use google_cloud_netapp_v1::model::BlockDevice;
17204    /// let x = BlockDevice::new().set_identifier("example");
17205    /// ```
17206    pub fn set_identifier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17207        self.identifier = v.into();
17208        self
17209    }
17210
17211    /// Sets the value of [size_gib][crate::model::BlockDevice::size_gib].
17212    ///
17213    /// # Example
17214    /// ```ignore,no_run
17215    /// # use google_cloud_netapp_v1::model::BlockDevice;
17216    /// let x = BlockDevice::new().set_size_gib(42);
17217    /// ```
17218    pub fn set_size_gib<T>(mut self, v: T) -> Self
17219    where
17220        T: std::convert::Into<i64>,
17221    {
17222        self.size_gib = std::option::Option::Some(v.into());
17223        self
17224    }
17225
17226    /// Sets or clears the value of [size_gib][crate::model::BlockDevice::size_gib].
17227    ///
17228    /// # Example
17229    /// ```ignore,no_run
17230    /// # use google_cloud_netapp_v1::model::BlockDevice;
17231    /// let x = BlockDevice::new().set_or_clear_size_gib(Some(42));
17232    /// let x = BlockDevice::new().set_or_clear_size_gib(None::<i32>);
17233    /// ```
17234    pub fn set_or_clear_size_gib<T>(mut self, v: std::option::Option<T>) -> Self
17235    where
17236        T: std::convert::Into<i64>,
17237    {
17238        self.size_gib = v.map(|x| x.into());
17239        self
17240    }
17241
17242    /// Sets the value of [os_type][crate::model::BlockDevice::os_type].
17243    ///
17244    /// # Example
17245    /// ```ignore,no_run
17246    /// # use google_cloud_netapp_v1::model::BlockDevice;
17247    /// use google_cloud_netapp_v1::model::OsType;
17248    /// let x0 = BlockDevice::new().set_os_type(OsType::Linux);
17249    /// let x1 = BlockDevice::new().set_os_type(OsType::Windows);
17250    /// let x2 = BlockDevice::new().set_os_type(OsType::Esxi);
17251    /// ```
17252    pub fn set_os_type<T: std::convert::Into<crate::model::OsType>>(mut self, v: T) -> Self {
17253        self.os_type = v.into();
17254        self
17255    }
17256}
17257
17258impl wkt::message::Message for BlockDevice {
17259    fn typename() -> &'static str {
17260        "type.googleapis.com/google.cloud.netapp.v1.BlockDevice"
17261    }
17262}
17263
17264/// RestoreBackupFilesRequest restores files from a backup to a volume.
17265#[derive(Clone, Default, PartialEq)]
17266#[non_exhaustive]
17267pub struct RestoreBackupFilesRequest {
17268    /// Required. The volume resource name, in the format
17269    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
17270    pub name: std::string::String,
17271
17272    /// Required. The backup resource name, in the format
17273    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
17274    pub backup: std::string::String,
17275
17276    /// Required. List of files to be restored, specified by their absolute path in
17277    /// the source volume.
17278    pub file_list: std::vec::Vec<std::string::String>,
17279
17280    /// Optional. Absolute directory path in the destination volume. This is
17281    /// required if the `file_list` is provided.
17282    pub restore_destination_path: std::string::String,
17283
17284    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17285}
17286
17287impl RestoreBackupFilesRequest {
17288    pub fn new() -> Self {
17289        std::default::Default::default()
17290    }
17291
17292    /// Sets the value of [name][crate::model::RestoreBackupFilesRequest::name].
17293    ///
17294    /// # Example
17295    /// ```ignore,no_run
17296    /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
17297    /// let x = RestoreBackupFilesRequest::new().set_name("example");
17298    /// ```
17299    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17300        self.name = v.into();
17301        self
17302    }
17303
17304    /// Sets the value of [backup][crate::model::RestoreBackupFilesRequest::backup].
17305    ///
17306    /// # Example
17307    /// ```ignore,no_run
17308    /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
17309    /// let x = RestoreBackupFilesRequest::new().set_backup("example");
17310    /// ```
17311    pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17312        self.backup = v.into();
17313        self
17314    }
17315
17316    /// Sets the value of [file_list][crate::model::RestoreBackupFilesRequest::file_list].
17317    ///
17318    /// # Example
17319    /// ```ignore,no_run
17320    /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
17321    /// let x = RestoreBackupFilesRequest::new().set_file_list(["a", "b", "c"]);
17322    /// ```
17323    pub fn set_file_list<T, V>(mut self, v: T) -> Self
17324    where
17325        T: std::iter::IntoIterator<Item = V>,
17326        V: std::convert::Into<std::string::String>,
17327    {
17328        use std::iter::Iterator;
17329        self.file_list = v.into_iter().map(|i| i.into()).collect();
17330        self
17331    }
17332
17333    /// Sets the value of [restore_destination_path][crate::model::RestoreBackupFilesRequest::restore_destination_path].
17334    ///
17335    /// # Example
17336    /// ```ignore,no_run
17337    /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
17338    /// let x = RestoreBackupFilesRequest::new().set_restore_destination_path("example");
17339    /// ```
17340    pub fn set_restore_destination_path<T: std::convert::Into<std::string::String>>(
17341        mut self,
17342        v: T,
17343    ) -> Self {
17344        self.restore_destination_path = v.into();
17345        self
17346    }
17347}
17348
17349impl wkt::message::Message for RestoreBackupFilesRequest {
17350    fn typename() -> &'static str {
17351        "type.googleapis.com/google.cloud.netapp.v1.RestoreBackupFilesRequest"
17352    }
17353}
17354
17355/// RestoreBackupFilesResponse is the result of RestoreBackupFilesRequest.
17356#[derive(Clone, Default, PartialEq)]
17357#[non_exhaustive]
17358pub struct RestoreBackupFilesResponse {
17359    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17360}
17361
17362impl RestoreBackupFilesResponse {
17363    pub fn new() -> Self {
17364        std::default::Default::default()
17365    }
17366}
17367
17368impl wkt::message::Message for RestoreBackupFilesResponse {
17369    fn typename() -> &'static str {
17370        "type.googleapis.com/google.cloud.netapp.v1.RestoreBackupFilesResponse"
17371    }
17372}
17373
17374/// The service level of a storage pool and its volumes.
17375///
17376/// # Working with unknown values
17377///
17378/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17379/// additional enum variants at any time. Adding new variants is not considered
17380/// a breaking change. Applications should write their code in anticipation of:
17381///
17382/// - New values appearing in future releases of the client library, **and**
17383/// - New values received dynamically, without application changes.
17384///
17385/// Please consult the [Working with enums] section in the user guide for some
17386/// guidelines.
17387///
17388/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17389#[derive(Clone, Debug, PartialEq)]
17390#[non_exhaustive]
17391pub enum ServiceLevel {
17392    /// Unspecified service level.
17393    Unspecified,
17394    /// Premium service level.
17395    Premium,
17396    /// Extreme service level.
17397    Extreme,
17398    /// Standard service level.
17399    Standard,
17400    /// Flex service level.
17401    Flex,
17402    /// If set, the enum was initialized with an unknown value.
17403    ///
17404    /// Applications can examine the value using [ServiceLevel::value] or
17405    /// [ServiceLevel::name].
17406    UnknownValue(service_level::UnknownValue),
17407}
17408
17409#[doc(hidden)]
17410pub mod service_level {
17411    #[allow(unused_imports)]
17412    use super::*;
17413    #[derive(Clone, Debug, PartialEq)]
17414    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17415}
17416
17417impl ServiceLevel {
17418    /// Gets the enum value.
17419    ///
17420    /// Returns `None` if the enum contains an unknown value deserialized from
17421    /// the string representation of enums.
17422    pub fn value(&self) -> std::option::Option<i32> {
17423        match self {
17424            Self::Unspecified => std::option::Option::Some(0),
17425            Self::Premium => std::option::Option::Some(1),
17426            Self::Extreme => std::option::Option::Some(2),
17427            Self::Standard => std::option::Option::Some(3),
17428            Self::Flex => std::option::Option::Some(4),
17429            Self::UnknownValue(u) => u.0.value(),
17430        }
17431    }
17432
17433    /// Gets the enum value as a string.
17434    ///
17435    /// Returns `None` if the enum contains an unknown value deserialized from
17436    /// the integer representation of enums.
17437    pub fn name(&self) -> std::option::Option<&str> {
17438        match self {
17439            Self::Unspecified => std::option::Option::Some("SERVICE_LEVEL_UNSPECIFIED"),
17440            Self::Premium => std::option::Option::Some("PREMIUM"),
17441            Self::Extreme => std::option::Option::Some("EXTREME"),
17442            Self::Standard => std::option::Option::Some("STANDARD"),
17443            Self::Flex => std::option::Option::Some("FLEX"),
17444            Self::UnknownValue(u) => u.0.name(),
17445        }
17446    }
17447}
17448
17449impl std::default::Default for ServiceLevel {
17450    fn default() -> Self {
17451        use std::convert::From;
17452        Self::from(0)
17453    }
17454}
17455
17456impl std::fmt::Display for ServiceLevel {
17457    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17458        wkt::internal::display_enum(f, self.name(), self.value())
17459    }
17460}
17461
17462impl std::convert::From<i32> for ServiceLevel {
17463    fn from(value: i32) -> Self {
17464        match value {
17465            0 => Self::Unspecified,
17466            1 => Self::Premium,
17467            2 => Self::Extreme,
17468            3 => Self::Standard,
17469            4 => Self::Flex,
17470            _ => Self::UnknownValue(service_level::UnknownValue(
17471                wkt::internal::UnknownEnumValue::Integer(value),
17472            )),
17473        }
17474    }
17475}
17476
17477impl std::convert::From<&str> for ServiceLevel {
17478    fn from(value: &str) -> Self {
17479        use std::string::ToString;
17480        match value {
17481            "SERVICE_LEVEL_UNSPECIFIED" => Self::Unspecified,
17482            "PREMIUM" => Self::Premium,
17483            "EXTREME" => Self::Extreme,
17484            "STANDARD" => Self::Standard,
17485            "FLEX" => Self::Flex,
17486            _ => Self::UnknownValue(service_level::UnknownValue(
17487                wkt::internal::UnknownEnumValue::String(value.to_string()),
17488            )),
17489        }
17490    }
17491}
17492
17493impl serde::ser::Serialize for ServiceLevel {
17494    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17495    where
17496        S: serde::Serializer,
17497    {
17498        match self {
17499            Self::Unspecified => serializer.serialize_i32(0),
17500            Self::Premium => serializer.serialize_i32(1),
17501            Self::Extreme => serializer.serialize_i32(2),
17502            Self::Standard => serializer.serialize_i32(3),
17503            Self::Flex => serializer.serialize_i32(4),
17504            Self::UnknownValue(u) => u.0.serialize(serializer),
17505        }
17506    }
17507}
17508
17509impl<'de> serde::de::Deserialize<'de> for ServiceLevel {
17510    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17511    where
17512        D: serde::Deserializer<'de>,
17513    {
17514        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ServiceLevel>::new(
17515            ".google.cloud.netapp.v1.ServiceLevel",
17516        ))
17517    }
17518}
17519
17520/// Flex Storage Pool performance.
17521///
17522/// # Working with unknown values
17523///
17524/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17525/// additional enum variants at any time. Adding new variants is not considered
17526/// a breaking change. Applications should write their code in anticipation of:
17527///
17528/// - New values appearing in future releases of the client library, **and**
17529/// - New values received dynamically, without application changes.
17530///
17531/// Please consult the [Working with enums] section in the user guide for some
17532/// guidelines.
17533///
17534/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17535#[derive(Clone, Debug, PartialEq)]
17536#[non_exhaustive]
17537pub enum FlexPerformance {
17538    /// Unspecified flex performance.
17539    Unspecified,
17540    /// Flex Storage Pool with default performance.
17541    Default,
17542    /// Flex Storage Pool with custom performance.
17543    Custom,
17544    /// If set, the enum was initialized with an unknown value.
17545    ///
17546    /// Applications can examine the value using [FlexPerformance::value] or
17547    /// [FlexPerformance::name].
17548    UnknownValue(flex_performance::UnknownValue),
17549}
17550
17551#[doc(hidden)]
17552pub mod flex_performance {
17553    #[allow(unused_imports)]
17554    use super::*;
17555    #[derive(Clone, Debug, PartialEq)]
17556    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17557}
17558
17559impl FlexPerformance {
17560    /// Gets the enum value.
17561    ///
17562    /// Returns `None` if the enum contains an unknown value deserialized from
17563    /// the string representation of enums.
17564    pub fn value(&self) -> std::option::Option<i32> {
17565        match self {
17566            Self::Unspecified => std::option::Option::Some(0),
17567            Self::Default => std::option::Option::Some(1),
17568            Self::Custom => std::option::Option::Some(2),
17569            Self::UnknownValue(u) => u.0.value(),
17570        }
17571    }
17572
17573    /// Gets the enum value as a string.
17574    ///
17575    /// Returns `None` if the enum contains an unknown value deserialized from
17576    /// the integer representation of enums.
17577    pub fn name(&self) -> std::option::Option<&str> {
17578        match self {
17579            Self::Unspecified => std::option::Option::Some("FLEX_PERFORMANCE_UNSPECIFIED"),
17580            Self::Default => std::option::Option::Some("FLEX_PERFORMANCE_DEFAULT"),
17581            Self::Custom => std::option::Option::Some("FLEX_PERFORMANCE_CUSTOM"),
17582            Self::UnknownValue(u) => u.0.name(),
17583        }
17584    }
17585}
17586
17587impl std::default::Default for FlexPerformance {
17588    fn default() -> Self {
17589        use std::convert::From;
17590        Self::from(0)
17591    }
17592}
17593
17594impl std::fmt::Display for FlexPerformance {
17595    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17596        wkt::internal::display_enum(f, self.name(), self.value())
17597    }
17598}
17599
17600impl std::convert::From<i32> for FlexPerformance {
17601    fn from(value: i32) -> Self {
17602        match value {
17603            0 => Self::Unspecified,
17604            1 => Self::Default,
17605            2 => Self::Custom,
17606            _ => Self::UnknownValue(flex_performance::UnknownValue(
17607                wkt::internal::UnknownEnumValue::Integer(value),
17608            )),
17609        }
17610    }
17611}
17612
17613impl std::convert::From<&str> for FlexPerformance {
17614    fn from(value: &str) -> Self {
17615        use std::string::ToString;
17616        match value {
17617            "FLEX_PERFORMANCE_UNSPECIFIED" => Self::Unspecified,
17618            "FLEX_PERFORMANCE_DEFAULT" => Self::Default,
17619            "FLEX_PERFORMANCE_CUSTOM" => Self::Custom,
17620            _ => Self::UnknownValue(flex_performance::UnknownValue(
17621                wkt::internal::UnknownEnumValue::String(value.to_string()),
17622            )),
17623        }
17624    }
17625}
17626
17627impl serde::ser::Serialize for FlexPerformance {
17628    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17629    where
17630        S: serde::Serializer,
17631    {
17632        match self {
17633            Self::Unspecified => serializer.serialize_i32(0),
17634            Self::Default => serializer.serialize_i32(1),
17635            Self::Custom => serializer.serialize_i32(2),
17636            Self::UnknownValue(u) => u.0.serialize(serializer),
17637        }
17638    }
17639}
17640
17641impl<'de> serde::de::Deserialize<'de> for FlexPerformance {
17642    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17643    where
17644        D: serde::Deserializer<'de>,
17645    {
17646        deserializer.deserialize_any(wkt::internal::EnumVisitor::<FlexPerformance>::new(
17647            ".google.cloud.netapp.v1.FlexPerformance",
17648        ))
17649    }
17650}
17651
17652/// The volume encryption key source.
17653///
17654/// # Working with unknown values
17655///
17656/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17657/// additional enum variants at any time. Adding new variants is not considered
17658/// a breaking change. Applications should write their code in anticipation of:
17659///
17660/// - New values appearing in future releases of the client library, **and**
17661/// - New values received dynamically, without application changes.
17662///
17663/// Please consult the [Working with enums] section in the user guide for some
17664/// guidelines.
17665///
17666/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17667#[derive(Clone, Debug, PartialEq)]
17668#[non_exhaustive]
17669pub enum EncryptionType {
17670    /// The source of the encryption key is not specified.
17671    Unspecified,
17672    /// Google managed encryption key.
17673    ServiceManaged,
17674    /// Customer managed encryption key, which is stored in KMS.
17675    CloudKms,
17676    /// If set, the enum was initialized with an unknown value.
17677    ///
17678    /// Applications can examine the value using [EncryptionType::value] or
17679    /// [EncryptionType::name].
17680    UnknownValue(encryption_type::UnknownValue),
17681}
17682
17683#[doc(hidden)]
17684pub mod encryption_type {
17685    #[allow(unused_imports)]
17686    use super::*;
17687    #[derive(Clone, Debug, PartialEq)]
17688    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17689}
17690
17691impl EncryptionType {
17692    /// Gets the enum value.
17693    ///
17694    /// Returns `None` if the enum contains an unknown value deserialized from
17695    /// the string representation of enums.
17696    pub fn value(&self) -> std::option::Option<i32> {
17697        match self {
17698            Self::Unspecified => std::option::Option::Some(0),
17699            Self::ServiceManaged => std::option::Option::Some(1),
17700            Self::CloudKms => std::option::Option::Some(2),
17701            Self::UnknownValue(u) => u.0.value(),
17702        }
17703    }
17704
17705    /// Gets the enum value as a string.
17706    ///
17707    /// Returns `None` if the enum contains an unknown value deserialized from
17708    /// the integer representation of enums.
17709    pub fn name(&self) -> std::option::Option<&str> {
17710        match self {
17711            Self::Unspecified => std::option::Option::Some("ENCRYPTION_TYPE_UNSPECIFIED"),
17712            Self::ServiceManaged => std::option::Option::Some("SERVICE_MANAGED"),
17713            Self::CloudKms => std::option::Option::Some("CLOUD_KMS"),
17714            Self::UnknownValue(u) => u.0.name(),
17715        }
17716    }
17717}
17718
17719impl std::default::Default for EncryptionType {
17720    fn default() -> Self {
17721        use std::convert::From;
17722        Self::from(0)
17723    }
17724}
17725
17726impl std::fmt::Display for EncryptionType {
17727    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17728        wkt::internal::display_enum(f, self.name(), self.value())
17729    }
17730}
17731
17732impl std::convert::From<i32> for EncryptionType {
17733    fn from(value: i32) -> Self {
17734        match value {
17735            0 => Self::Unspecified,
17736            1 => Self::ServiceManaged,
17737            2 => Self::CloudKms,
17738            _ => Self::UnknownValue(encryption_type::UnknownValue(
17739                wkt::internal::UnknownEnumValue::Integer(value),
17740            )),
17741        }
17742    }
17743}
17744
17745impl std::convert::From<&str> for EncryptionType {
17746    fn from(value: &str) -> Self {
17747        use std::string::ToString;
17748        match value {
17749            "ENCRYPTION_TYPE_UNSPECIFIED" => Self::Unspecified,
17750            "SERVICE_MANAGED" => Self::ServiceManaged,
17751            "CLOUD_KMS" => Self::CloudKms,
17752            _ => Self::UnknownValue(encryption_type::UnknownValue(
17753                wkt::internal::UnknownEnumValue::String(value.to_string()),
17754            )),
17755        }
17756    }
17757}
17758
17759impl serde::ser::Serialize for EncryptionType {
17760    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17761    where
17762        S: serde::Serializer,
17763    {
17764        match self {
17765            Self::Unspecified => serializer.serialize_i32(0),
17766            Self::ServiceManaged => serializer.serialize_i32(1),
17767            Self::CloudKms => serializer.serialize_i32(2),
17768            Self::UnknownValue(u) => u.0.serialize(serializer),
17769        }
17770    }
17771}
17772
17773impl<'de> serde::de::Deserialize<'de> for EncryptionType {
17774    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17775    where
17776        D: serde::Deserializer<'de>,
17777    {
17778        deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionType>::new(
17779            ".google.cloud.netapp.v1.EncryptionType",
17780        ))
17781    }
17782}
17783
17784/// Type of directory service
17785///
17786/// # Working with unknown values
17787///
17788/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17789/// additional enum variants at any time. Adding new variants is not considered
17790/// a breaking change. Applications should write their code in anticipation of:
17791///
17792/// - New values appearing in future releases of the client library, **and**
17793/// - New values received dynamically, without application changes.
17794///
17795/// Please consult the [Working with enums] section in the user guide for some
17796/// guidelines.
17797///
17798/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17799#[derive(Clone, Debug, PartialEq)]
17800#[non_exhaustive]
17801pub enum DirectoryServiceType {
17802    /// Directory service type is not specified.
17803    Unspecified,
17804    /// Active directory policy attached to the storage pool.
17805    ActiveDirectory,
17806    /// If set, the enum was initialized with an unknown value.
17807    ///
17808    /// Applications can examine the value using [DirectoryServiceType::value] or
17809    /// [DirectoryServiceType::name].
17810    UnknownValue(directory_service_type::UnknownValue),
17811}
17812
17813#[doc(hidden)]
17814pub mod directory_service_type {
17815    #[allow(unused_imports)]
17816    use super::*;
17817    #[derive(Clone, Debug, PartialEq)]
17818    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17819}
17820
17821impl DirectoryServiceType {
17822    /// Gets the enum value.
17823    ///
17824    /// Returns `None` if the enum contains an unknown value deserialized from
17825    /// the string representation of enums.
17826    pub fn value(&self) -> std::option::Option<i32> {
17827        match self {
17828            Self::Unspecified => std::option::Option::Some(0),
17829            Self::ActiveDirectory => std::option::Option::Some(1),
17830            Self::UnknownValue(u) => u.0.value(),
17831        }
17832    }
17833
17834    /// Gets the enum value as a string.
17835    ///
17836    /// Returns `None` if the enum contains an unknown value deserialized from
17837    /// the integer representation of enums.
17838    pub fn name(&self) -> std::option::Option<&str> {
17839        match self {
17840            Self::Unspecified => std::option::Option::Some("DIRECTORY_SERVICE_TYPE_UNSPECIFIED"),
17841            Self::ActiveDirectory => std::option::Option::Some("ACTIVE_DIRECTORY"),
17842            Self::UnknownValue(u) => u.0.name(),
17843        }
17844    }
17845}
17846
17847impl std::default::Default for DirectoryServiceType {
17848    fn default() -> Self {
17849        use std::convert::From;
17850        Self::from(0)
17851    }
17852}
17853
17854impl std::fmt::Display for DirectoryServiceType {
17855    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17856        wkt::internal::display_enum(f, self.name(), self.value())
17857    }
17858}
17859
17860impl std::convert::From<i32> for DirectoryServiceType {
17861    fn from(value: i32) -> Self {
17862        match value {
17863            0 => Self::Unspecified,
17864            1 => Self::ActiveDirectory,
17865            _ => Self::UnknownValue(directory_service_type::UnknownValue(
17866                wkt::internal::UnknownEnumValue::Integer(value),
17867            )),
17868        }
17869    }
17870}
17871
17872impl std::convert::From<&str> for DirectoryServiceType {
17873    fn from(value: &str) -> Self {
17874        use std::string::ToString;
17875        match value {
17876            "DIRECTORY_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
17877            "ACTIVE_DIRECTORY" => Self::ActiveDirectory,
17878            _ => Self::UnknownValue(directory_service_type::UnknownValue(
17879                wkt::internal::UnknownEnumValue::String(value.to_string()),
17880            )),
17881        }
17882    }
17883}
17884
17885impl serde::ser::Serialize for DirectoryServiceType {
17886    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17887    where
17888        S: serde::Serializer,
17889    {
17890        match self {
17891            Self::Unspecified => serializer.serialize_i32(0),
17892            Self::ActiveDirectory => serializer.serialize_i32(1),
17893            Self::UnknownValue(u) => u.0.serialize(serializer),
17894        }
17895    }
17896}
17897
17898impl<'de> serde::de::Deserialize<'de> for DirectoryServiceType {
17899    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17900    where
17901        D: serde::Deserializer<'de>,
17902    {
17903        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DirectoryServiceType>::new(
17904            ".google.cloud.netapp.v1.DirectoryServiceType",
17905        ))
17906    }
17907}
17908
17909/// Type of storage pool
17910///
17911/// # Working with unknown values
17912///
17913/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17914/// additional enum variants at any time. Adding new variants is not considered
17915/// a breaking change. Applications should write their code in anticipation of:
17916///
17917/// - New values appearing in future releases of the client library, **and**
17918/// - New values received dynamically, without application changes.
17919///
17920/// Please consult the [Working with enums] section in the user guide for some
17921/// guidelines.
17922///
17923/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17924#[derive(Clone, Debug, PartialEq)]
17925#[non_exhaustive]
17926pub enum StoragePoolType {
17927    /// Storage pool type is not specified.
17928    Unspecified,
17929    /// Storage pool type is file.
17930    File,
17931    /// Storage pool type is unified.
17932    Unified,
17933    /// Storage pool type is unified large capacity.
17934    UnifiedLargeCapacity,
17935    /// If set, the enum was initialized with an unknown value.
17936    ///
17937    /// Applications can examine the value using [StoragePoolType::value] or
17938    /// [StoragePoolType::name].
17939    UnknownValue(storage_pool_type::UnknownValue),
17940}
17941
17942#[doc(hidden)]
17943pub mod storage_pool_type {
17944    #[allow(unused_imports)]
17945    use super::*;
17946    #[derive(Clone, Debug, PartialEq)]
17947    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17948}
17949
17950impl StoragePoolType {
17951    /// Gets the enum value.
17952    ///
17953    /// Returns `None` if the enum contains an unknown value deserialized from
17954    /// the string representation of enums.
17955    pub fn value(&self) -> std::option::Option<i32> {
17956        match self {
17957            Self::Unspecified => std::option::Option::Some(0),
17958            Self::File => std::option::Option::Some(1),
17959            Self::Unified => std::option::Option::Some(2),
17960            Self::UnifiedLargeCapacity => std::option::Option::Some(3),
17961            Self::UnknownValue(u) => u.0.value(),
17962        }
17963    }
17964
17965    /// Gets the enum value as a string.
17966    ///
17967    /// Returns `None` if the enum contains an unknown value deserialized from
17968    /// the integer representation of enums.
17969    pub fn name(&self) -> std::option::Option<&str> {
17970        match self {
17971            Self::Unspecified => std::option::Option::Some("STORAGE_POOL_TYPE_UNSPECIFIED"),
17972            Self::File => std::option::Option::Some("FILE"),
17973            Self::Unified => std::option::Option::Some("UNIFIED"),
17974            Self::UnifiedLargeCapacity => std::option::Option::Some("UNIFIED_LARGE_CAPACITY"),
17975            Self::UnknownValue(u) => u.0.name(),
17976        }
17977    }
17978}
17979
17980impl std::default::Default for StoragePoolType {
17981    fn default() -> Self {
17982        use std::convert::From;
17983        Self::from(0)
17984    }
17985}
17986
17987impl std::fmt::Display for StoragePoolType {
17988    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17989        wkt::internal::display_enum(f, self.name(), self.value())
17990    }
17991}
17992
17993impl std::convert::From<i32> for StoragePoolType {
17994    fn from(value: i32) -> Self {
17995        match value {
17996            0 => Self::Unspecified,
17997            1 => Self::File,
17998            2 => Self::Unified,
17999            3 => Self::UnifiedLargeCapacity,
18000            _ => Self::UnknownValue(storage_pool_type::UnknownValue(
18001                wkt::internal::UnknownEnumValue::Integer(value),
18002            )),
18003        }
18004    }
18005}
18006
18007impl std::convert::From<&str> for StoragePoolType {
18008    fn from(value: &str) -> Self {
18009        use std::string::ToString;
18010        match value {
18011            "STORAGE_POOL_TYPE_UNSPECIFIED" => Self::Unspecified,
18012            "FILE" => Self::File,
18013            "UNIFIED" => Self::Unified,
18014            "UNIFIED_LARGE_CAPACITY" => Self::UnifiedLargeCapacity,
18015            _ => Self::UnknownValue(storage_pool_type::UnknownValue(
18016                wkt::internal::UnknownEnumValue::String(value.to_string()),
18017            )),
18018        }
18019    }
18020}
18021
18022impl serde::ser::Serialize for StoragePoolType {
18023    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18024    where
18025        S: serde::Serializer,
18026    {
18027        match self {
18028            Self::Unspecified => serializer.serialize_i32(0),
18029            Self::File => serializer.serialize_i32(1),
18030            Self::Unified => serializer.serialize_i32(2),
18031            Self::UnifiedLargeCapacity => serializer.serialize_i32(3),
18032            Self::UnknownValue(u) => u.0.serialize(serializer),
18033        }
18034    }
18035}
18036
18037impl<'de> serde::de::Deserialize<'de> for StoragePoolType {
18038    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18039    where
18040        D: serde::Deserializer<'de>,
18041    {
18042        deserializer.deserialize_any(wkt::internal::EnumVisitor::<StoragePoolType>::new(
18043            ".google.cloud.netapp.v1.StoragePoolType",
18044        ))
18045    }
18046}
18047
18048/// Schedule for Hybrid Replication.
18049/// New enum values may be added in future to support different frequency of
18050/// replication.
18051///
18052/// # Working with unknown values
18053///
18054/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18055/// additional enum variants at any time. Adding new variants is not considered
18056/// a breaking change. Applications should write their code in anticipation of:
18057///
18058/// - New values appearing in future releases of the client library, **and**
18059/// - New values received dynamically, without application changes.
18060///
18061/// Please consult the [Working with enums] section in the user guide for some
18062/// guidelines.
18063///
18064/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18065#[derive(Clone, Debug, PartialEq)]
18066#[non_exhaustive]
18067pub enum HybridReplicationSchedule {
18068    /// Unspecified HybridReplicationSchedule
18069    Unspecified,
18070    /// Replication happens once every 10 minutes.
18071    Every10Minutes,
18072    /// Replication happens once every hour.
18073    Hourly,
18074    /// Replication happens once every day.
18075    Daily,
18076    /// If set, the enum was initialized with an unknown value.
18077    ///
18078    /// Applications can examine the value using [HybridReplicationSchedule::value] or
18079    /// [HybridReplicationSchedule::name].
18080    UnknownValue(hybrid_replication_schedule::UnknownValue),
18081}
18082
18083#[doc(hidden)]
18084pub mod hybrid_replication_schedule {
18085    #[allow(unused_imports)]
18086    use super::*;
18087    #[derive(Clone, Debug, PartialEq)]
18088    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18089}
18090
18091impl HybridReplicationSchedule {
18092    /// Gets the enum value.
18093    ///
18094    /// Returns `None` if the enum contains an unknown value deserialized from
18095    /// the string representation of enums.
18096    pub fn value(&self) -> std::option::Option<i32> {
18097        match self {
18098            Self::Unspecified => std::option::Option::Some(0),
18099            Self::Every10Minutes => std::option::Option::Some(1),
18100            Self::Hourly => std::option::Option::Some(2),
18101            Self::Daily => std::option::Option::Some(3),
18102            Self::UnknownValue(u) => u.0.value(),
18103        }
18104    }
18105
18106    /// Gets the enum value as a string.
18107    ///
18108    /// Returns `None` if the enum contains an unknown value deserialized from
18109    /// the integer representation of enums.
18110    pub fn name(&self) -> std::option::Option<&str> {
18111        match self {
18112            Self::Unspecified => {
18113                std::option::Option::Some("HYBRID_REPLICATION_SCHEDULE_UNSPECIFIED")
18114            }
18115            Self::Every10Minutes => std::option::Option::Some("EVERY_10_MINUTES"),
18116            Self::Hourly => std::option::Option::Some("HOURLY"),
18117            Self::Daily => std::option::Option::Some("DAILY"),
18118            Self::UnknownValue(u) => u.0.name(),
18119        }
18120    }
18121}
18122
18123impl std::default::Default for HybridReplicationSchedule {
18124    fn default() -> Self {
18125        use std::convert::From;
18126        Self::from(0)
18127    }
18128}
18129
18130impl std::fmt::Display for HybridReplicationSchedule {
18131    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18132        wkt::internal::display_enum(f, self.name(), self.value())
18133    }
18134}
18135
18136impl std::convert::From<i32> for HybridReplicationSchedule {
18137    fn from(value: i32) -> Self {
18138        match value {
18139            0 => Self::Unspecified,
18140            1 => Self::Every10Minutes,
18141            2 => Self::Hourly,
18142            3 => Self::Daily,
18143            _ => Self::UnknownValue(hybrid_replication_schedule::UnknownValue(
18144                wkt::internal::UnknownEnumValue::Integer(value),
18145            )),
18146        }
18147    }
18148}
18149
18150impl std::convert::From<&str> for HybridReplicationSchedule {
18151    fn from(value: &str) -> Self {
18152        use std::string::ToString;
18153        match value {
18154            "HYBRID_REPLICATION_SCHEDULE_UNSPECIFIED" => Self::Unspecified,
18155            "EVERY_10_MINUTES" => Self::Every10Minutes,
18156            "HOURLY" => Self::Hourly,
18157            "DAILY" => Self::Daily,
18158            _ => Self::UnknownValue(hybrid_replication_schedule::UnknownValue(
18159                wkt::internal::UnknownEnumValue::String(value.to_string()),
18160            )),
18161        }
18162    }
18163}
18164
18165impl serde::ser::Serialize for HybridReplicationSchedule {
18166    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18167    where
18168        S: serde::Serializer,
18169    {
18170        match self {
18171            Self::Unspecified => serializer.serialize_i32(0),
18172            Self::Every10Minutes => serializer.serialize_i32(1),
18173            Self::Hourly => serializer.serialize_i32(2),
18174            Self::Daily => serializer.serialize_i32(3),
18175            Self::UnknownValue(u) => u.0.serialize(serializer),
18176        }
18177    }
18178}
18179
18180impl<'de> serde::de::Deserialize<'de> for HybridReplicationSchedule {
18181    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18182    where
18183        D: serde::Deserializer<'de>,
18184    {
18185        deserializer.deserialize_any(
18186            wkt::internal::EnumVisitor::<HybridReplicationSchedule>::new(
18187                ".google.cloud.netapp.v1.HybridReplicationSchedule",
18188            ),
18189        )
18190    }
18191}
18192
18193/// QoS (Quality of Service) Types of the storage pool
18194///
18195/// # Working with unknown values
18196///
18197/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18198/// additional enum variants at any time. Adding new variants is not considered
18199/// a breaking change. Applications should write their code in anticipation of:
18200///
18201/// - New values appearing in future releases of the client library, **and**
18202/// - New values received dynamically, without application changes.
18203///
18204/// Please consult the [Working with enums] section in the user guide for some
18205/// guidelines.
18206///
18207/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18208#[derive(Clone, Debug, PartialEq)]
18209#[non_exhaustive]
18210pub enum QosType {
18211    /// Unspecified QoS Type
18212    Unspecified,
18213    /// QoS Type is Auto
18214    Auto,
18215    /// QoS Type is Manual
18216    Manual,
18217    /// If set, the enum was initialized with an unknown value.
18218    ///
18219    /// Applications can examine the value using [QosType::value] or
18220    /// [QosType::name].
18221    UnknownValue(qos_type::UnknownValue),
18222}
18223
18224#[doc(hidden)]
18225pub mod qos_type {
18226    #[allow(unused_imports)]
18227    use super::*;
18228    #[derive(Clone, Debug, PartialEq)]
18229    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18230}
18231
18232impl QosType {
18233    /// Gets the enum value.
18234    ///
18235    /// Returns `None` if the enum contains an unknown value deserialized from
18236    /// the string representation of enums.
18237    pub fn value(&self) -> std::option::Option<i32> {
18238        match self {
18239            Self::Unspecified => std::option::Option::Some(0),
18240            Self::Auto => std::option::Option::Some(1),
18241            Self::Manual => std::option::Option::Some(2),
18242            Self::UnknownValue(u) => u.0.value(),
18243        }
18244    }
18245
18246    /// Gets the enum value as a string.
18247    ///
18248    /// Returns `None` if the enum contains an unknown value deserialized from
18249    /// the integer representation of enums.
18250    pub fn name(&self) -> std::option::Option<&str> {
18251        match self {
18252            Self::Unspecified => std::option::Option::Some("QOS_TYPE_UNSPECIFIED"),
18253            Self::Auto => std::option::Option::Some("AUTO"),
18254            Self::Manual => std::option::Option::Some("MANUAL"),
18255            Self::UnknownValue(u) => u.0.name(),
18256        }
18257    }
18258}
18259
18260impl std::default::Default for QosType {
18261    fn default() -> Self {
18262        use std::convert::From;
18263        Self::from(0)
18264    }
18265}
18266
18267impl std::fmt::Display for QosType {
18268    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18269        wkt::internal::display_enum(f, self.name(), self.value())
18270    }
18271}
18272
18273impl std::convert::From<i32> for QosType {
18274    fn from(value: i32) -> Self {
18275        match value {
18276            0 => Self::Unspecified,
18277            1 => Self::Auto,
18278            2 => Self::Manual,
18279            _ => Self::UnknownValue(qos_type::UnknownValue(
18280                wkt::internal::UnknownEnumValue::Integer(value),
18281            )),
18282        }
18283    }
18284}
18285
18286impl std::convert::From<&str> for QosType {
18287    fn from(value: &str) -> Self {
18288        use std::string::ToString;
18289        match value {
18290            "QOS_TYPE_UNSPECIFIED" => Self::Unspecified,
18291            "AUTO" => Self::Auto,
18292            "MANUAL" => Self::Manual,
18293            _ => Self::UnknownValue(qos_type::UnknownValue(
18294                wkt::internal::UnknownEnumValue::String(value.to_string()),
18295            )),
18296        }
18297    }
18298}
18299
18300impl serde::ser::Serialize for QosType {
18301    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18302    where
18303        S: serde::Serializer,
18304    {
18305        match self {
18306            Self::Unspecified => serializer.serialize_i32(0),
18307            Self::Auto => serializer.serialize_i32(1),
18308            Self::Manual => serializer.serialize_i32(2),
18309            Self::UnknownValue(u) => u.0.serialize(serializer),
18310        }
18311    }
18312}
18313
18314impl<'de> serde::de::Deserialize<'de> for QosType {
18315    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18316    where
18317        D: serde::Deserializer<'de>,
18318    {
18319        deserializer.deserialize_any(wkt::internal::EnumVisitor::<QosType>::new(
18320            ".google.cloud.netapp.v1.QosType",
18321        ))
18322    }
18323}
18324
18325/// OS types for the host group
18326///
18327/// # Working with unknown values
18328///
18329/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18330/// additional enum variants at any time. Adding new variants is not considered
18331/// a breaking change. Applications should write their code in anticipation of:
18332///
18333/// - New values appearing in future releases of the client library, **and**
18334/// - New values received dynamically, without application changes.
18335///
18336/// Please consult the [Working with enums] section in the user guide for some
18337/// guidelines.
18338///
18339/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18340#[derive(Clone, Debug, PartialEq)]
18341#[non_exhaustive]
18342pub enum OsType {
18343    /// Unspecified OS Type
18344    Unspecified,
18345    /// OS Type is Linux
18346    Linux,
18347    /// OS Type is Windows
18348    Windows,
18349    /// OS Type is VMware ESXi
18350    Esxi,
18351    /// If set, the enum was initialized with an unknown value.
18352    ///
18353    /// Applications can examine the value using [OsType::value] or
18354    /// [OsType::name].
18355    UnknownValue(os_type::UnknownValue),
18356}
18357
18358#[doc(hidden)]
18359pub mod os_type {
18360    #[allow(unused_imports)]
18361    use super::*;
18362    #[derive(Clone, Debug, PartialEq)]
18363    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18364}
18365
18366impl OsType {
18367    /// Gets the enum value.
18368    ///
18369    /// Returns `None` if the enum contains an unknown value deserialized from
18370    /// the string representation of enums.
18371    pub fn value(&self) -> std::option::Option<i32> {
18372        match self {
18373            Self::Unspecified => std::option::Option::Some(0),
18374            Self::Linux => std::option::Option::Some(1),
18375            Self::Windows => std::option::Option::Some(2),
18376            Self::Esxi => std::option::Option::Some(3),
18377            Self::UnknownValue(u) => u.0.value(),
18378        }
18379    }
18380
18381    /// Gets the enum value as a string.
18382    ///
18383    /// Returns `None` if the enum contains an unknown value deserialized from
18384    /// the integer representation of enums.
18385    pub fn name(&self) -> std::option::Option<&str> {
18386        match self {
18387            Self::Unspecified => std::option::Option::Some("OS_TYPE_UNSPECIFIED"),
18388            Self::Linux => std::option::Option::Some("LINUX"),
18389            Self::Windows => std::option::Option::Some("WINDOWS"),
18390            Self::Esxi => std::option::Option::Some("ESXI"),
18391            Self::UnknownValue(u) => u.0.name(),
18392        }
18393    }
18394}
18395
18396impl std::default::Default for OsType {
18397    fn default() -> Self {
18398        use std::convert::From;
18399        Self::from(0)
18400    }
18401}
18402
18403impl std::fmt::Display for OsType {
18404    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18405        wkt::internal::display_enum(f, self.name(), self.value())
18406    }
18407}
18408
18409impl std::convert::From<i32> for OsType {
18410    fn from(value: i32) -> Self {
18411        match value {
18412            0 => Self::Unspecified,
18413            1 => Self::Linux,
18414            2 => Self::Windows,
18415            3 => Self::Esxi,
18416            _ => Self::UnknownValue(os_type::UnknownValue(
18417                wkt::internal::UnknownEnumValue::Integer(value),
18418            )),
18419        }
18420    }
18421}
18422
18423impl std::convert::From<&str> for OsType {
18424    fn from(value: &str) -> Self {
18425        use std::string::ToString;
18426        match value {
18427            "OS_TYPE_UNSPECIFIED" => Self::Unspecified,
18428            "LINUX" => Self::Linux,
18429            "WINDOWS" => Self::Windows,
18430            "ESXI" => Self::Esxi,
18431            _ => Self::UnknownValue(os_type::UnknownValue(
18432                wkt::internal::UnknownEnumValue::String(value.to_string()),
18433            )),
18434        }
18435    }
18436}
18437
18438impl serde::ser::Serialize for OsType {
18439    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18440    where
18441        S: serde::Serializer,
18442    {
18443        match self {
18444            Self::Unspecified => serializer.serialize_i32(0),
18445            Self::Linux => serializer.serialize_i32(1),
18446            Self::Windows => serializer.serialize_i32(2),
18447            Self::Esxi => serializer.serialize_i32(3),
18448            Self::UnknownValue(u) => u.0.serialize(serializer),
18449        }
18450    }
18451}
18452
18453impl<'de> serde::de::Deserialize<'de> for OsType {
18454    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18455    where
18456        D: serde::Deserializer<'de>,
18457    {
18458        deserializer.deserialize_any(wkt::internal::EnumVisitor::<OsType>::new(
18459            ".google.cloud.netapp.v1.OsType",
18460        ))
18461    }
18462}
18463
18464/// Protocols is an enum of all the supported network protocols for a volume.
18465///
18466/// # Working with unknown values
18467///
18468/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18469/// additional enum variants at any time. Adding new variants is not considered
18470/// a breaking change. Applications should write their code in anticipation of:
18471///
18472/// - New values appearing in future releases of the client library, **and**
18473/// - New values received dynamically, without application changes.
18474///
18475/// Please consult the [Working with enums] section in the user guide for some
18476/// guidelines.
18477///
18478/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18479#[derive(Clone, Debug, PartialEq)]
18480#[non_exhaustive]
18481pub enum Protocols {
18482    /// Unspecified protocol
18483    Unspecified,
18484    /// NFS V3 protocol
18485    Nfsv3,
18486    /// NFS V4 protocol
18487    Nfsv4,
18488    /// SMB protocol
18489    Smb,
18490    /// ISCSI protocol
18491    Iscsi,
18492    /// If set, the enum was initialized with an unknown value.
18493    ///
18494    /// Applications can examine the value using [Protocols::value] or
18495    /// [Protocols::name].
18496    UnknownValue(protocols::UnknownValue),
18497}
18498
18499#[doc(hidden)]
18500pub mod protocols {
18501    #[allow(unused_imports)]
18502    use super::*;
18503    #[derive(Clone, Debug, PartialEq)]
18504    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18505}
18506
18507impl Protocols {
18508    /// Gets the enum value.
18509    ///
18510    /// Returns `None` if the enum contains an unknown value deserialized from
18511    /// the string representation of enums.
18512    pub fn value(&self) -> std::option::Option<i32> {
18513        match self {
18514            Self::Unspecified => std::option::Option::Some(0),
18515            Self::Nfsv3 => std::option::Option::Some(1),
18516            Self::Nfsv4 => std::option::Option::Some(2),
18517            Self::Smb => std::option::Option::Some(3),
18518            Self::Iscsi => std::option::Option::Some(4),
18519            Self::UnknownValue(u) => u.0.value(),
18520        }
18521    }
18522
18523    /// Gets the enum value as a string.
18524    ///
18525    /// Returns `None` if the enum contains an unknown value deserialized from
18526    /// the integer representation of enums.
18527    pub fn name(&self) -> std::option::Option<&str> {
18528        match self {
18529            Self::Unspecified => std::option::Option::Some("PROTOCOLS_UNSPECIFIED"),
18530            Self::Nfsv3 => std::option::Option::Some("NFSV3"),
18531            Self::Nfsv4 => std::option::Option::Some("NFSV4"),
18532            Self::Smb => std::option::Option::Some("SMB"),
18533            Self::Iscsi => std::option::Option::Some("ISCSI"),
18534            Self::UnknownValue(u) => u.0.name(),
18535        }
18536    }
18537}
18538
18539impl std::default::Default for Protocols {
18540    fn default() -> Self {
18541        use std::convert::From;
18542        Self::from(0)
18543    }
18544}
18545
18546impl std::fmt::Display for Protocols {
18547    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18548        wkt::internal::display_enum(f, self.name(), self.value())
18549    }
18550}
18551
18552impl std::convert::From<i32> for Protocols {
18553    fn from(value: i32) -> Self {
18554        match value {
18555            0 => Self::Unspecified,
18556            1 => Self::Nfsv3,
18557            2 => Self::Nfsv4,
18558            3 => Self::Smb,
18559            4 => Self::Iscsi,
18560            _ => Self::UnknownValue(protocols::UnknownValue(
18561                wkt::internal::UnknownEnumValue::Integer(value),
18562            )),
18563        }
18564    }
18565}
18566
18567impl std::convert::From<&str> for Protocols {
18568    fn from(value: &str) -> Self {
18569        use std::string::ToString;
18570        match value {
18571            "PROTOCOLS_UNSPECIFIED" => Self::Unspecified,
18572            "NFSV3" => Self::Nfsv3,
18573            "NFSV4" => Self::Nfsv4,
18574            "SMB" => Self::Smb,
18575            "ISCSI" => Self::Iscsi,
18576            _ => Self::UnknownValue(protocols::UnknownValue(
18577                wkt::internal::UnknownEnumValue::String(value.to_string()),
18578            )),
18579        }
18580    }
18581}
18582
18583impl serde::ser::Serialize for Protocols {
18584    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18585    where
18586        S: serde::Serializer,
18587    {
18588        match self {
18589            Self::Unspecified => serializer.serialize_i32(0),
18590            Self::Nfsv3 => serializer.serialize_i32(1),
18591            Self::Nfsv4 => serializer.serialize_i32(2),
18592            Self::Smb => serializer.serialize_i32(3),
18593            Self::Iscsi => serializer.serialize_i32(4),
18594            Self::UnknownValue(u) => u.0.serialize(serializer),
18595        }
18596    }
18597}
18598
18599impl<'de> serde::de::Deserialize<'de> for Protocols {
18600    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18601    where
18602        D: serde::Deserializer<'de>,
18603    {
18604        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocols>::new(
18605            ".google.cloud.netapp.v1.Protocols",
18606        ))
18607    }
18608}
18609
18610/// AccessType is an enum of all the supported access types for a volume.
18611///
18612/// # Working with unknown values
18613///
18614/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18615/// additional enum variants at any time. Adding new variants is not considered
18616/// a breaking change. Applications should write their code in anticipation of:
18617///
18618/// - New values appearing in future releases of the client library, **and**
18619/// - New values received dynamically, without application changes.
18620///
18621/// Please consult the [Working with enums] section in the user guide for some
18622/// guidelines.
18623///
18624/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18625#[derive(Clone, Debug, PartialEq)]
18626#[non_exhaustive]
18627pub enum AccessType {
18628    /// Unspecified Access Type
18629    Unspecified,
18630    /// Read Only
18631    ReadOnly,
18632    /// Read Write
18633    ReadWrite,
18634    /// None
18635    ReadNone,
18636    /// If set, the enum was initialized with an unknown value.
18637    ///
18638    /// Applications can examine the value using [AccessType::value] or
18639    /// [AccessType::name].
18640    UnknownValue(access_type::UnknownValue),
18641}
18642
18643#[doc(hidden)]
18644pub mod access_type {
18645    #[allow(unused_imports)]
18646    use super::*;
18647    #[derive(Clone, Debug, PartialEq)]
18648    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18649}
18650
18651impl AccessType {
18652    /// Gets the enum value.
18653    ///
18654    /// Returns `None` if the enum contains an unknown value deserialized from
18655    /// the string representation of enums.
18656    pub fn value(&self) -> std::option::Option<i32> {
18657        match self {
18658            Self::Unspecified => std::option::Option::Some(0),
18659            Self::ReadOnly => std::option::Option::Some(1),
18660            Self::ReadWrite => std::option::Option::Some(2),
18661            Self::ReadNone => std::option::Option::Some(3),
18662            Self::UnknownValue(u) => u.0.value(),
18663        }
18664    }
18665
18666    /// Gets the enum value as a string.
18667    ///
18668    /// Returns `None` if the enum contains an unknown value deserialized from
18669    /// the integer representation of enums.
18670    pub fn name(&self) -> std::option::Option<&str> {
18671        match self {
18672            Self::Unspecified => std::option::Option::Some("ACCESS_TYPE_UNSPECIFIED"),
18673            Self::ReadOnly => std::option::Option::Some("READ_ONLY"),
18674            Self::ReadWrite => std::option::Option::Some("READ_WRITE"),
18675            Self::ReadNone => std::option::Option::Some("READ_NONE"),
18676            Self::UnknownValue(u) => u.0.name(),
18677        }
18678    }
18679}
18680
18681impl std::default::Default for AccessType {
18682    fn default() -> Self {
18683        use std::convert::From;
18684        Self::from(0)
18685    }
18686}
18687
18688impl std::fmt::Display for AccessType {
18689    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18690        wkt::internal::display_enum(f, self.name(), self.value())
18691    }
18692}
18693
18694impl std::convert::From<i32> for AccessType {
18695    fn from(value: i32) -> Self {
18696        match value {
18697            0 => Self::Unspecified,
18698            1 => Self::ReadOnly,
18699            2 => Self::ReadWrite,
18700            3 => Self::ReadNone,
18701            _ => Self::UnknownValue(access_type::UnknownValue(
18702                wkt::internal::UnknownEnumValue::Integer(value),
18703            )),
18704        }
18705    }
18706}
18707
18708impl std::convert::From<&str> for AccessType {
18709    fn from(value: &str) -> Self {
18710        use std::string::ToString;
18711        match value {
18712            "ACCESS_TYPE_UNSPECIFIED" => Self::Unspecified,
18713            "READ_ONLY" => Self::ReadOnly,
18714            "READ_WRITE" => Self::ReadWrite,
18715            "READ_NONE" => Self::ReadNone,
18716            _ => Self::UnknownValue(access_type::UnknownValue(
18717                wkt::internal::UnknownEnumValue::String(value.to_string()),
18718            )),
18719        }
18720    }
18721}
18722
18723impl serde::ser::Serialize for AccessType {
18724    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18725    where
18726        S: serde::Serializer,
18727    {
18728        match self {
18729            Self::Unspecified => serializer.serialize_i32(0),
18730            Self::ReadOnly => serializer.serialize_i32(1),
18731            Self::ReadWrite => serializer.serialize_i32(2),
18732            Self::ReadNone => serializer.serialize_i32(3),
18733            Self::UnknownValue(u) => u.0.serialize(serializer),
18734        }
18735    }
18736}
18737
18738impl<'de> serde::de::Deserialize<'de> for AccessType {
18739    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18740    where
18741        D: serde::Deserializer<'de>,
18742    {
18743        deserializer.deserialize_any(wkt::internal::EnumVisitor::<AccessType>::new(
18744            ".google.cloud.netapp.v1.AccessType",
18745        ))
18746    }
18747}
18748
18749/// SMBSettings
18750/// Modifies the behaviour of a SMB volume.
18751///
18752/// # Working with unknown values
18753///
18754/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18755/// additional enum variants at any time. Adding new variants is not considered
18756/// a breaking change. Applications should write their code in anticipation of:
18757///
18758/// - New values appearing in future releases of the client library, **and**
18759/// - New values received dynamically, without application changes.
18760///
18761/// Please consult the [Working with enums] section in the user guide for some
18762/// guidelines.
18763///
18764/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18765#[derive(Clone, Debug, PartialEq)]
18766#[non_exhaustive]
18767pub enum SMBSettings {
18768    /// Unspecified default option
18769    Unspecified,
18770    /// SMB setting encrypt data
18771    EncryptData,
18772    /// SMB setting browsable
18773    Browsable,
18774    /// SMB setting notify change
18775    ChangeNotify,
18776    /// SMB setting not to notify change
18777    NonBrowsable,
18778    /// SMB setting oplocks
18779    Oplocks,
18780    /// SMB setting to show snapshots
18781    ShowSnapshot,
18782    /// SMB setting to show previous versions
18783    ShowPreviousVersions,
18784    /// SMB setting to access volume based on enumerartion
18785    AccessBasedEnumeration,
18786    /// Continuously available enumeration
18787    ContinuouslyAvailable,
18788    /// If set, the enum was initialized with an unknown value.
18789    ///
18790    /// Applications can examine the value using [SMBSettings::value] or
18791    /// [SMBSettings::name].
18792    UnknownValue(smb_settings::UnknownValue),
18793}
18794
18795#[doc(hidden)]
18796pub mod smb_settings {
18797    #[allow(unused_imports)]
18798    use super::*;
18799    #[derive(Clone, Debug, PartialEq)]
18800    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18801}
18802
18803impl SMBSettings {
18804    /// Gets the enum value.
18805    ///
18806    /// Returns `None` if the enum contains an unknown value deserialized from
18807    /// the string representation of enums.
18808    pub fn value(&self) -> std::option::Option<i32> {
18809        match self {
18810            Self::Unspecified => std::option::Option::Some(0),
18811            Self::EncryptData => std::option::Option::Some(1),
18812            Self::Browsable => std::option::Option::Some(2),
18813            Self::ChangeNotify => std::option::Option::Some(3),
18814            Self::NonBrowsable => std::option::Option::Some(4),
18815            Self::Oplocks => std::option::Option::Some(5),
18816            Self::ShowSnapshot => std::option::Option::Some(6),
18817            Self::ShowPreviousVersions => std::option::Option::Some(7),
18818            Self::AccessBasedEnumeration => std::option::Option::Some(8),
18819            Self::ContinuouslyAvailable => std::option::Option::Some(9),
18820            Self::UnknownValue(u) => u.0.value(),
18821        }
18822    }
18823
18824    /// Gets the enum value as a string.
18825    ///
18826    /// Returns `None` if the enum contains an unknown value deserialized from
18827    /// the integer representation of enums.
18828    pub fn name(&self) -> std::option::Option<&str> {
18829        match self {
18830            Self::Unspecified => std::option::Option::Some("SMB_SETTINGS_UNSPECIFIED"),
18831            Self::EncryptData => std::option::Option::Some("ENCRYPT_DATA"),
18832            Self::Browsable => std::option::Option::Some("BROWSABLE"),
18833            Self::ChangeNotify => std::option::Option::Some("CHANGE_NOTIFY"),
18834            Self::NonBrowsable => std::option::Option::Some("NON_BROWSABLE"),
18835            Self::Oplocks => std::option::Option::Some("OPLOCKS"),
18836            Self::ShowSnapshot => std::option::Option::Some("SHOW_SNAPSHOT"),
18837            Self::ShowPreviousVersions => std::option::Option::Some("SHOW_PREVIOUS_VERSIONS"),
18838            Self::AccessBasedEnumeration => std::option::Option::Some("ACCESS_BASED_ENUMERATION"),
18839            Self::ContinuouslyAvailable => std::option::Option::Some("CONTINUOUSLY_AVAILABLE"),
18840            Self::UnknownValue(u) => u.0.name(),
18841        }
18842    }
18843}
18844
18845impl std::default::Default for SMBSettings {
18846    fn default() -> Self {
18847        use std::convert::From;
18848        Self::from(0)
18849    }
18850}
18851
18852impl std::fmt::Display for SMBSettings {
18853    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18854        wkt::internal::display_enum(f, self.name(), self.value())
18855    }
18856}
18857
18858impl std::convert::From<i32> for SMBSettings {
18859    fn from(value: i32) -> Self {
18860        match value {
18861            0 => Self::Unspecified,
18862            1 => Self::EncryptData,
18863            2 => Self::Browsable,
18864            3 => Self::ChangeNotify,
18865            4 => Self::NonBrowsable,
18866            5 => Self::Oplocks,
18867            6 => Self::ShowSnapshot,
18868            7 => Self::ShowPreviousVersions,
18869            8 => Self::AccessBasedEnumeration,
18870            9 => Self::ContinuouslyAvailable,
18871            _ => Self::UnknownValue(smb_settings::UnknownValue(
18872                wkt::internal::UnknownEnumValue::Integer(value),
18873            )),
18874        }
18875    }
18876}
18877
18878impl std::convert::From<&str> for SMBSettings {
18879    fn from(value: &str) -> Self {
18880        use std::string::ToString;
18881        match value {
18882            "SMB_SETTINGS_UNSPECIFIED" => Self::Unspecified,
18883            "ENCRYPT_DATA" => Self::EncryptData,
18884            "BROWSABLE" => Self::Browsable,
18885            "CHANGE_NOTIFY" => Self::ChangeNotify,
18886            "NON_BROWSABLE" => Self::NonBrowsable,
18887            "OPLOCKS" => Self::Oplocks,
18888            "SHOW_SNAPSHOT" => Self::ShowSnapshot,
18889            "SHOW_PREVIOUS_VERSIONS" => Self::ShowPreviousVersions,
18890            "ACCESS_BASED_ENUMERATION" => Self::AccessBasedEnumeration,
18891            "CONTINUOUSLY_AVAILABLE" => Self::ContinuouslyAvailable,
18892            _ => Self::UnknownValue(smb_settings::UnknownValue(
18893                wkt::internal::UnknownEnumValue::String(value.to_string()),
18894            )),
18895        }
18896    }
18897}
18898
18899impl serde::ser::Serialize for SMBSettings {
18900    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18901    where
18902        S: serde::Serializer,
18903    {
18904        match self {
18905            Self::Unspecified => serializer.serialize_i32(0),
18906            Self::EncryptData => serializer.serialize_i32(1),
18907            Self::Browsable => serializer.serialize_i32(2),
18908            Self::ChangeNotify => serializer.serialize_i32(3),
18909            Self::NonBrowsable => serializer.serialize_i32(4),
18910            Self::Oplocks => serializer.serialize_i32(5),
18911            Self::ShowSnapshot => serializer.serialize_i32(6),
18912            Self::ShowPreviousVersions => serializer.serialize_i32(7),
18913            Self::AccessBasedEnumeration => serializer.serialize_i32(8),
18914            Self::ContinuouslyAvailable => serializer.serialize_i32(9),
18915            Self::UnknownValue(u) => u.0.serialize(serializer),
18916        }
18917    }
18918}
18919
18920impl<'de> serde::de::Deserialize<'de> for SMBSettings {
18921    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18922    where
18923        D: serde::Deserializer<'de>,
18924    {
18925        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SMBSettings>::new(
18926            ".google.cloud.netapp.v1.SMBSettings",
18927        ))
18928    }
18929}
18930
18931/// The security style of the volume, can be either UNIX or NTFS.
18932///
18933/// # Working with unknown values
18934///
18935/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18936/// additional enum variants at any time. Adding new variants is not considered
18937/// a breaking change. Applications should write their code in anticipation of:
18938///
18939/// - New values appearing in future releases of the client library, **and**
18940/// - New values received dynamically, without application changes.
18941///
18942/// Please consult the [Working with enums] section in the user guide for some
18943/// guidelines.
18944///
18945/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18946#[derive(Clone, Debug, PartialEq)]
18947#[non_exhaustive]
18948pub enum SecurityStyle {
18949    /// SecurityStyle is unspecified
18950    Unspecified,
18951    /// SecurityStyle uses NTFS
18952    Ntfs,
18953    /// SecurityStyle uses UNIX
18954    Unix,
18955    /// If set, the enum was initialized with an unknown value.
18956    ///
18957    /// Applications can examine the value using [SecurityStyle::value] or
18958    /// [SecurityStyle::name].
18959    UnknownValue(security_style::UnknownValue),
18960}
18961
18962#[doc(hidden)]
18963pub mod security_style {
18964    #[allow(unused_imports)]
18965    use super::*;
18966    #[derive(Clone, Debug, PartialEq)]
18967    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18968}
18969
18970impl SecurityStyle {
18971    /// Gets the enum value.
18972    ///
18973    /// Returns `None` if the enum contains an unknown value deserialized from
18974    /// the string representation of enums.
18975    pub fn value(&self) -> std::option::Option<i32> {
18976        match self {
18977            Self::Unspecified => std::option::Option::Some(0),
18978            Self::Ntfs => std::option::Option::Some(1),
18979            Self::Unix => std::option::Option::Some(2),
18980            Self::UnknownValue(u) => u.0.value(),
18981        }
18982    }
18983
18984    /// Gets the enum value as a string.
18985    ///
18986    /// Returns `None` if the enum contains an unknown value deserialized from
18987    /// the integer representation of enums.
18988    pub fn name(&self) -> std::option::Option<&str> {
18989        match self {
18990            Self::Unspecified => std::option::Option::Some("SECURITY_STYLE_UNSPECIFIED"),
18991            Self::Ntfs => std::option::Option::Some("NTFS"),
18992            Self::Unix => std::option::Option::Some("UNIX"),
18993            Self::UnknownValue(u) => u.0.name(),
18994        }
18995    }
18996}
18997
18998impl std::default::Default for SecurityStyle {
18999    fn default() -> Self {
19000        use std::convert::From;
19001        Self::from(0)
19002    }
19003}
19004
19005impl std::fmt::Display for SecurityStyle {
19006    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19007        wkt::internal::display_enum(f, self.name(), self.value())
19008    }
19009}
19010
19011impl std::convert::From<i32> for SecurityStyle {
19012    fn from(value: i32) -> Self {
19013        match value {
19014            0 => Self::Unspecified,
19015            1 => Self::Ntfs,
19016            2 => Self::Unix,
19017            _ => Self::UnknownValue(security_style::UnknownValue(
19018                wkt::internal::UnknownEnumValue::Integer(value),
19019            )),
19020        }
19021    }
19022}
19023
19024impl std::convert::From<&str> for SecurityStyle {
19025    fn from(value: &str) -> Self {
19026        use std::string::ToString;
19027        match value {
19028            "SECURITY_STYLE_UNSPECIFIED" => Self::Unspecified,
19029            "NTFS" => Self::Ntfs,
19030            "UNIX" => Self::Unix,
19031            _ => Self::UnknownValue(security_style::UnknownValue(
19032                wkt::internal::UnknownEnumValue::String(value.to_string()),
19033            )),
19034        }
19035    }
19036}
19037
19038impl serde::ser::Serialize for SecurityStyle {
19039    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19040    where
19041        S: serde::Serializer,
19042    {
19043        match self {
19044            Self::Unspecified => serializer.serialize_i32(0),
19045            Self::Ntfs => serializer.serialize_i32(1),
19046            Self::Unix => serializer.serialize_i32(2),
19047            Self::UnknownValue(u) => u.0.serialize(serializer),
19048        }
19049    }
19050}
19051
19052impl<'de> serde::de::Deserialize<'de> for SecurityStyle {
19053    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19054    where
19055        D: serde::Deserializer<'de>,
19056    {
19057        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SecurityStyle>::new(
19058            ".google.cloud.netapp.v1.SecurityStyle",
19059        ))
19060    }
19061}
19062
19063/// Actions to be restricted for a volume.
19064///
19065/// # Working with unknown values
19066///
19067/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19068/// additional enum variants at any time. Adding new variants is not considered
19069/// a breaking change. Applications should write their code in anticipation of:
19070///
19071/// - New values appearing in future releases of the client library, **and**
19072/// - New values received dynamically, without application changes.
19073///
19074/// Please consult the [Working with enums] section in the user guide for some
19075/// guidelines.
19076///
19077/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19078#[derive(Clone, Debug, PartialEq)]
19079#[non_exhaustive]
19080pub enum RestrictedAction {
19081    /// Unspecified restricted action
19082    Unspecified,
19083    /// Prevent volume from being deleted when mounted.
19084    Delete,
19085    /// If set, the enum was initialized with an unknown value.
19086    ///
19087    /// Applications can examine the value using [RestrictedAction::value] or
19088    /// [RestrictedAction::name].
19089    UnknownValue(restricted_action::UnknownValue),
19090}
19091
19092#[doc(hidden)]
19093pub mod restricted_action {
19094    #[allow(unused_imports)]
19095    use super::*;
19096    #[derive(Clone, Debug, PartialEq)]
19097    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19098}
19099
19100impl RestrictedAction {
19101    /// Gets the enum value.
19102    ///
19103    /// Returns `None` if the enum contains an unknown value deserialized from
19104    /// the string representation of enums.
19105    pub fn value(&self) -> std::option::Option<i32> {
19106        match self {
19107            Self::Unspecified => std::option::Option::Some(0),
19108            Self::Delete => std::option::Option::Some(1),
19109            Self::UnknownValue(u) => u.0.value(),
19110        }
19111    }
19112
19113    /// Gets the enum value as a string.
19114    ///
19115    /// Returns `None` if the enum contains an unknown value deserialized from
19116    /// the integer representation of enums.
19117    pub fn name(&self) -> std::option::Option<&str> {
19118        match self {
19119            Self::Unspecified => std::option::Option::Some("RESTRICTED_ACTION_UNSPECIFIED"),
19120            Self::Delete => std::option::Option::Some("DELETE"),
19121            Self::UnknownValue(u) => u.0.name(),
19122        }
19123    }
19124}
19125
19126impl std::default::Default for RestrictedAction {
19127    fn default() -> Self {
19128        use std::convert::From;
19129        Self::from(0)
19130    }
19131}
19132
19133impl std::fmt::Display for RestrictedAction {
19134    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19135        wkt::internal::display_enum(f, self.name(), self.value())
19136    }
19137}
19138
19139impl std::convert::From<i32> for RestrictedAction {
19140    fn from(value: i32) -> Self {
19141        match value {
19142            0 => Self::Unspecified,
19143            1 => Self::Delete,
19144            _ => Self::UnknownValue(restricted_action::UnknownValue(
19145                wkt::internal::UnknownEnumValue::Integer(value),
19146            )),
19147        }
19148    }
19149}
19150
19151impl std::convert::From<&str> for RestrictedAction {
19152    fn from(value: &str) -> Self {
19153        use std::string::ToString;
19154        match value {
19155            "RESTRICTED_ACTION_UNSPECIFIED" => Self::Unspecified,
19156            "DELETE" => Self::Delete,
19157            _ => Self::UnknownValue(restricted_action::UnknownValue(
19158                wkt::internal::UnknownEnumValue::String(value.to_string()),
19159            )),
19160        }
19161    }
19162}
19163
19164impl serde::ser::Serialize for RestrictedAction {
19165    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19166    where
19167        S: serde::Serializer,
19168    {
19169        match self {
19170            Self::Unspecified => serializer.serialize_i32(0),
19171            Self::Delete => serializer.serialize_i32(1),
19172            Self::UnknownValue(u) => u.0.serialize(serializer),
19173        }
19174    }
19175}
19176
19177impl<'de> serde::de::Deserialize<'de> for RestrictedAction {
19178    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19179    where
19180        D: serde::Deserializer<'de>,
19181    {
19182        deserializer.deserialize_any(wkt::internal::EnumVisitor::<RestrictedAction>::new(
19183            ".google.cloud.netapp.v1.RestrictedAction",
19184        ))
19185    }
19186}