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::bare_urls)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![allow(rustdoc::invalid_html_tags)]
20#![allow(rustdoc::redundant_explicit_links)]
21#![no_implicit_prelude]
22extern crate async_trait;
23extern crate bytes;
24extern crate gaxi;
25extern crate google_cloud_gax;
26extern crate google_cloud_location;
27extern crate google_cloud_longrunning;
28extern crate google_cloud_lro;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// ListActiveDirectoriesRequest for requesting multiple active directories.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct ListActiveDirectoriesRequest {
44    /// Required. Parent value for ListActiveDirectoriesRequest
45    pub parent: std::string::String,
46
47    /// Requested page size. Server may return fewer items than requested.
48    /// If unspecified, the server will pick an appropriate default.
49    pub page_size: i32,
50
51    /// A token identifying a page of results the server should return.
52    pub page_token: std::string::String,
53
54    /// Filtering results
55    pub filter: std::string::String,
56
57    /// Hint for how to order the results
58    pub order_by: std::string::String,
59
60    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
61}
62
63impl ListActiveDirectoriesRequest {
64    /// Creates a new default instance.
65    pub fn new() -> Self {
66        std::default::Default::default()
67    }
68
69    /// Sets the value of [parent][crate::model::ListActiveDirectoriesRequest::parent].
70    ///
71    /// # Example
72    /// ```ignore,no_run
73    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
74    /// # let project_id = "project_id";
75    /// # let location_id = "location_id";
76    /// let x = ListActiveDirectoriesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
77    /// ```
78    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
79        self.parent = v.into();
80        self
81    }
82
83    /// Sets the value of [page_size][crate::model::ListActiveDirectoriesRequest::page_size].
84    ///
85    /// # Example
86    /// ```ignore,no_run
87    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
88    /// let x = ListActiveDirectoriesRequest::new().set_page_size(42);
89    /// ```
90    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
91        self.page_size = v.into();
92        self
93    }
94
95    /// Sets the value of [page_token][crate::model::ListActiveDirectoriesRequest::page_token].
96    ///
97    /// # Example
98    /// ```ignore,no_run
99    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
100    /// let x = ListActiveDirectoriesRequest::new().set_page_token("example");
101    /// ```
102    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
103        self.page_token = v.into();
104        self
105    }
106
107    /// Sets the value of [filter][crate::model::ListActiveDirectoriesRequest::filter].
108    ///
109    /// # Example
110    /// ```ignore,no_run
111    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
112    /// let x = ListActiveDirectoriesRequest::new().set_filter("example");
113    /// ```
114    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
115        self.filter = v.into();
116        self
117    }
118
119    /// Sets the value of [order_by][crate::model::ListActiveDirectoriesRequest::order_by].
120    ///
121    /// # Example
122    /// ```ignore,no_run
123    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
124    /// let x = ListActiveDirectoriesRequest::new().set_order_by("example");
125    /// ```
126    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
127        self.order_by = v.into();
128        self
129    }
130}
131
132impl wkt::message::Message for ListActiveDirectoriesRequest {
133    fn typename() -> &'static str {
134        "type.googleapis.com/google.cloud.netapp.v1.ListActiveDirectoriesRequest"
135    }
136}
137
138/// ListActiveDirectoriesResponse contains all the active directories requested.
139#[derive(Clone, Default, PartialEq)]
140#[non_exhaustive]
141pub struct ListActiveDirectoriesResponse {
142    /// The list of active directories.
143    pub active_directories: std::vec::Vec<crate::model::ActiveDirectory>,
144
145    /// A token identifying a page of results the server should return.
146    pub next_page_token: std::string::String,
147
148    /// Locations that could not be reached.
149    pub unreachable: std::vec::Vec<std::string::String>,
150
151    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
152}
153
154impl ListActiveDirectoriesResponse {
155    /// Creates a new default instance.
156    pub fn new() -> Self {
157        std::default::Default::default()
158    }
159
160    /// Sets the value of [active_directories][crate::model::ListActiveDirectoriesResponse::active_directories].
161    ///
162    /// # Example
163    /// ```ignore,no_run
164    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesResponse;
165    /// use google_cloud_netapp_v1::model::ActiveDirectory;
166    /// let x = ListActiveDirectoriesResponse::new()
167    ///     .set_active_directories([
168    ///         ActiveDirectory::default()/* use setters */,
169    ///         ActiveDirectory::default()/* use (different) setters */,
170    ///     ]);
171    /// ```
172    pub fn set_active_directories<T, V>(mut self, v: T) -> Self
173    where
174        T: std::iter::IntoIterator<Item = V>,
175        V: std::convert::Into<crate::model::ActiveDirectory>,
176    {
177        use std::iter::Iterator;
178        self.active_directories = v.into_iter().map(|i| i.into()).collect();
179        self
180    }
181
182    /// Sets the value of [next_page_token][crate::model::ListActiveDirectoriesResponse::next_page_token].
183    ///
184    /// # Example
185    /// ```ignore,no_run
186    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesResponse;
187    /// let x = ListActiveDirectoriesResponse::new().set_next_page_token("example");
188    /// ```
189    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
190        self.next_page_token = v.into();
191        self
192    }
193
194    /// Sets the value of [unreachable][crate::model::ListActiveDirectoriesResponse::unreachable].
195    ///
196    /// # Example
197    /// ```ignore,no_run
198    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesResponse;
199    /// let x = ListActiveDirectoriesResponse::new().set_unreachable(["a", "b", "c"]);
200    /// ```
201    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
202    where
203        T: std::iter::IntoIterator<Item = V>,
204        V: std::convert::Into<std::string::String>,
205    {
206        use std::iter::Iterator;
207        self.unreachable = v.into_iter().map(|i| i.into()).collect();
208        self
209    }
210}
211
212impl wkt::message::Message for ListActiveDirectoriesResponse {
213    fn typename() -> &'static str {
214        "type.googleapis.com/google.cloud.netapp.v1.ListActiveDirectoriesResponse"
215    }
216}
217
218#[doc(hidden)]
219impl google_cloud_gax::paginator::internal::PageableResponse for ListActiveDirectoriesResponse {
220    type PageItem = crate::model::ActiveDirectory;
221
222    fn items(self) -> std::vec::Vec<Self::PageItem> {
223        self.active_directories
224    }
225
226    fn next_page_token(&self) -> std::string::String {
227        use std::clone::Clone;
228        self.next_page_token.clone()
229    }
230}
231
232/// GetActiveDirectory for getting a single active directory.
233#[derive(Clone, Default, PartialEq)]
234#[non_exhaustive]
235pub struct GetActiveDirectoryRequest {
236    /// Required. Name of the active directory.
237    pub name: std::string::String,
238
239    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
240}
241
242impl GetActiveDirectoryRequest {
243    /// Creates a new default instance.
244    pub fn new() -> Self {
245        std::default::Default::default()
246    }
247
248    /// Sets the value of [name][crate::model::GetActiveDirectoryRequest::name].
249    ///
250    /// # Example
251    /// ```ignore,no_run
252    /// # use google_cloud_netapp_v1::model::GetActiveDirectoryRequest;
253    /// # let project_id = "project_id";
254    /// # let location_id = "location_id";
255    /// # let active_directory_id = "active_directory_id";
256    /// let x = GetActiveDirectoryRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/activeDirectories/{active_directory_id}"));
257    /// ```
258    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
259        self.name = v.into();
260        self
261    }
262}
263
264impl wkt::message::Message for GetActiveDirectoryRequest {
265    fn typename() -> &'static str {
266        "type.googleapis.com/google.cloud.netapp.v1.GetActiveDirectoryRequest"
267    }
268}
269
270/// CreateActiveDirectoryRequest for creating an active directory.
271#[derive(Clone, Default, PartialEq)]
272#[non_exhaustive]
273pub struct CreateActiveDirectoryRequest {
274    /// Required. Value for parent.
275    pub parent: std::string::String,
276
277    /// Required. Fields of the to be created active directory.
278    pub active_directory: std::option::Option<crate::model::ActiveDirectory>,
279
280    /// Required. ID of the active directory to create. Must be unique within the
281    /// parent resource. Must contain only letters, numbers and hyphen, with the
282    /// first character a letter , the last a letter or a number, and a 63
283    /// character maximum.
284    pub active_directory_id: std::string::String,
285
286    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
287}
288
289impl CreateActiveDirectoryRequest {
290    /// Creates a new default instance.
291    pub fn new() -> Self {
292        std::default::Default::default()
293    }
294
295    /// Sets the value of [parent][crate::model::CreateActiveDirectoryRequest::parent].
296    ///
297    /// # Example
298    /// ```ignore,no_run
299    /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
300    /// # let project_id = "project_id";
301    /// # let location_id = "location_id";
302    /// let x = CreateActiveDirectoryRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
303    /// ```
304    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
305        self.parent = v.into();
306        self
307    }
308
309    /// Sets the value of [active_directory][crate::model::CreateActiveDirectoryRequest::active_directory].
310    ///
311    /// # Example
312    /// ```ignore,no_run
313    /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
314    /// use google_cloud_netapp_v1::model::ActiveDirectory;
315    /// let x = CreateActiveDirectoryRequest::new().set_active_directory(ActiveDirectory::default()/* use setters */);
316    /// ```
317    pub fn set_active_directory<T>(mut self, v: T) -> Self
318    where
319        T: std::convert::Into<crate::model::ActiveDirectory>,
320    {
321        self.active_directory = std::option::Option::Some(v.into());
322        self
323    }
324
325    /// Sets or clears the value of [active_directory][crate::model::CreateActiveDirectoryRequest::active_directory].
326    ///
327    /// # Example
328    /// ```ignore,no_run
329    /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
330    /// use google_cloud_netapp_v1::model::ActiveDirectory;
331    /// let x = CreateActiveDirectoryRequest::new().set_or_clear_active_directory(Some(ActiveDirectory::default()/* use setters */));
332    /// let x = CreateActiveDirectoryRequest::new().set_or_clear_active_directory(None::<ActiveDirectory>);
333    /// ```
334    pub fn set_or_clear_active_directory<T>(mut self, v: std::option::Option<T>) -> Self
335    where
336        T: std::convert::Into<crate::model::ActiveDirectory>,
337    {
338        self.active_directory = v.map(|x| x.into());
339        self
340    }
341
342    /// Sets the value of [active_directory_id][crate::model::CreateActiveDirectoryRequest::active_directory_id].
343    ///
344    /// # Example
345    /// ```ignore,no_run
346    /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
347    /// let x = CreateActiveDirectoryRequest::new().set_active_directory_id("example");
348    /// ```
349    pub fn set_active_directory_id<T: std::convert::Into<std::string::String>>(
350        mut self,
351        v: T,
352    ) -> Self {
353        self.active_directory_id = v.into();
354        self
355    }
356}
357
358impl wkt::message::Message for CreateActiveDirectoryRequest {
359    fn typename() -> &'static str {
360        "type.googleapis.com/google.cloud.netapp.v1.CreateActiveDirectoryRequest"
361    }
362}
363
364/// UpdateActiveDirectoryRequest for updating an active directory.
365#[derive(Clone, Default, PartialEq)]
366#[non_exhaustive]
367pub struct UpdateActiveDirectoryRequest {
368    /// Required. Field mask is used to specify the fields to be overwritten in the
369    /// Active Directory resource by the update.
370    /// The fields specified in the update_mask are relative to the resource, not
371    /// the full request. A field will be overwritten if it is in the mask. If the
372    /// user does not provide a mask then all fields will be overwritten.
373    pub update_mask: std::option::Option<wkt::FieldMask>,
374
375    /// Required. The volume being updated
376    pub active_directory: std::option::Option<crate::model::ActiveDirectory>,
377
378    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
379}
380
381impl UpdateActiveDirectoryRequest {
382    /// Creates a new default instance.
383    pub fn new() -> Self {
384        std::default::Default::default()
385    }
386
387    /// Sets the value of [update_mask][crate::model::UpdateActiveDirectoryRequest::update_mask].
388    ///
389    /// # Example
390    /// ```ignore,no_run
391    /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
392    /// use wkt::FieldMask;
393    /// let x = UpdateActiveDirectoryRequest::new().set_update_mask(FieldMask::default()/* use setters */);
394    /// ```
395    pub fn set_update_mask<T>(mut self, v: T) -> Self
396    where
397        T: std::convert::Into<wkt::FieldMask>,
398    {
399        self.update_mask = std::option::Option::Some(v.into());
400        self
401    }
402
403    /// Sets or clears the value of [update_mask][crate::model::UpdateActiveDirectoryRequest::update_mask].
404    ///
405    /// # Example
406    /// ```ignore,no_run
407    /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
408    /// use wkt::FieldMask;
409    /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
410    /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_update_mask(None::<FieldMask>);
411    /// ```
412    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
413    where
414        T: std::convert::Into<wkt::FieldMask>,
415    {
416        self.update_mask = v.map(|x| x.into());
417        self
418    }
419
420    /// Sets the value of [active_directory][crate::model::UpdateActiveDirectoryRequest::active_directory].
421    ///
422    /// # Example
423    /// ```ignore,no_run
424    /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
425    /// use google_cloud_netapp_v1::model::ActiveDirectory;
426    /// let x = UpdateActiveDirectoryRequest::new().set_active_directory(ActiveDirectory::default()/* use setters */);
427    /// ```
428    pub fn set_active_directory<T>(mut self, v: T) -> Self
429    where
430        T: std::convert::Into<crate::model::ActiveDirectory>,
431    {
432        self.active_directory = std::option::Option::Some(v.into());
433        self
434    }
435
436    /// Sets or clears the value of [active_directory][crate::model::UpdateActiveDirectoryRequest::active_directory].
437    ///
438    /// # Example
439    /// ```ignore,no_run
440    /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
441    /// use google_cloud_netapp_v1::model::ActiveDirectory;
442    /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_active_directory(Some(ActiveDirectory::default()/* use setters */));
443    /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_active_directory(None::<ActiveDirectory>);
444    /// ```
445    pub fn set_or_clear_active_directory<T>(mut self, v: std::option::Option<T>) -> Self
446    where
447        T: std::convert::Into<crate::model::ActiveDirectory>,
448    {
449        self.active_directory = v.map(|x| x.into());
450        self
451    }
452}
453
454impl wkt::message::Message for UpdateActiveDirectoryRequest {
455    fn typename() -> &'static str {
456        "type.googleapis.com/google.cloud.netapp.v1.UpdateActiveDirectoryRequest"
457    }
458}
459
460/// DeleteActiveDirectoryRequest for deleting a single active directory.
461#[derive(Clone, Default, PartialEq)]
462#[non_exhaustive]
463pub struct DeleteActiveDirectoryRequest {
464    /// Required. Name of the active directory.
465    pub name: std::string::String,
466
467    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
468}
469
470impl DeleteActiveDirectoryRequest {
471    /// Creates a new default instance.
472    pub fn new() -> Self {
473        std::default::Default::default()
474    }
475
476    /// Sets the value of [name][crate::model::DeleteActiveDirectoryRequest::name].
477    ///
478    /// # Example
479    /// ```ignore,no_run
480    /// # use google_cloud_netapp_v1::model::DeleteActiveDirectoryRequest;
481    /// # let project_id = "project_id";
482    /// # let location_id = "location_id";
483    /// # let active_directory_id = "active_directory_id";
484    /// let x = DeleteActiveDirectoryRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/activeDirectories/{active_directory_id}"));
485    /// ```
486    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
487        self.name = v.into();
488        self
489    }
490}
491
492impl wkt::message::Message for DeleteActiveDirectoryRequest {
493    fn typename() -> &'static str {
494        "type.googleapis.com/google.cloud.netapp.v1.DeleteActiveDirectoryRequest"
495    }
496}
497
498/// ActiveDirectory is the public representation of the active directory config.
499#[derive(Clone, Default, PartialEq)]
500#[non_exhaustive]
501pub struct ActiveDirectory {
502    /// Identifier. The resource name of the active directory.
503    /// Format:
504    /// `projects/{project_number}/locations/{location_id}/activeDirectories/{active_directory_id}`.
505    pub name: std::string::String,
506
507    /// Output only. Create time of the active directory.
508    pub create_time: std::option::Option<wkt::Timestamp>,
509
510    /// Output only. The state of the AD.
511    pub state: crate::model::active_directory::State,
512
513    /// Required. Name of the Active Directory domain
514    pub domain: std::string::String,
515
516    /// The Active Directory site the service will limit Domain Controller
517    /// discovery too.
518    pub site: std::string::String,
519
520    /// Required. Comma separated list of DNS server IP addresses for the Active
521    /// Directory domain.
522    pub dns: std::string::String,
523
524    /// Required. NetBIOSPrefix is used as a prefix for SMB server name.
525    pub net_bios_prefix: std::string::String,
526
527    /// The Organizational Unit (OU) within the Windows Active Directory the user
528    /// belongs to.
529    pub organizational_unit: std::string::String,
530
531    /// If enabled, AES encryption will be enabled for SMB communication.
532    pub aes_encryption: bool,
533
534    /// Required. Username of the Active Directory domain administrator.
535    pub username: std::string::String,
536
537    /// Required. Password of the Active Directory domain administrator.
538    pub password: std::string::String,
539
540    /// Optional. Users to be added to the Built-in Backup Operator active
541    /// directory group.
542    pub backup_operators: std::vec::Vec<std::string::String>,
543
544    /// Optional. Users to be added to the Built-in Admininstrators group.
545    pub administrators: std::vec::Vec<std::string::String>,
546
547    /// Optional. Domain users to be given the SeSecurityPrivilege.
548    pub security_operators: std::vec::Vec<std::string::String>,
549
550    /// Name of the active directory machine. This optional parameter is used only
551    /// while creating kerberos volume
552    pub kdc_hostname: std::string::String,
553
554    /// KDC server IP address for the active directory machine.
555    pub kdc_ip: std::string::String,
556
557    /// If enabled, will allow access to local users and LDAP users. If access is
558    /// needed for only LDAP users, it has to be disabled.
559    pub nfs_users_with_ldap: bool,
560
561    /// Description of the active directory.
562    pub description: std::string::String,
563
564    /// Specifies whether or not the LDAP traffic needs to be signed.
565    pub ldap_signing: bool,
566
567    /// If enabled, traffic between the SMB server to Domain Controller (DC) will
568    /// be encrypted.
569    pub encrypt_dc_connections: bool,
570
571    /// Labels for the active directory.
572    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
573
574    /// Output only. The state details of the Active Directory.
575    pub state_details: std::string::String,
576
577    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
578}
579
580impl ActiveDirectory {
581    /// Creates a new default instance.
582    pub fn new() -> Self {
583        std::default::Default::default()
584    }
585
586    /// Sets the value of [name][crate::model::ActiveDirectory::name].
587    ///
588    /// # Example
589    /// ```ignore,no_run
590    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
591    /// # let project_id = "project_id";
592    /// # let location_id = "location_id";
593    /// # let active_directory_id = "active_directory_id";
594    /// let x = ActiveDirectory::new().set_name(format!("projects/{project_id}/locations/{location_id}/activeDirectories/{active_directory_id}"));
595    /// ```
596    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
597        self.name = v.into();
598        self
599    }
600
601    /// Sets the value of [create_time][crate::model::ActiveDirectory::create_time].
602    ///
603    /// # Example
604    /// ```ignore,no_run
605    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
606    /// use wkt::Timestamp;
607    /// let x = ActiveDirectory::new().set_create_time(Timestamp::default()/* use setters */);
608    /// ```
609    pub fn set_create_time<T>(mut self, v: T) -> Self
610    where
611        T: std::convert::Into<wkt::Timestamp>,
612    {
613        self.create_time = std::option::Option::Some(v.into());
614        self
615    }
616
617    /// Sets or clears the value of [create_time][crate::model::ActiveDirectory::create_time].
618    ///
619    /// # Example
620    /// ```ignore,no_run
621    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
622    /// use wkt::Timestamp;
623    /// let x = ActiveDirectory::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
624    /// let x = ActiveDirectory::new().set_or_clear_create_time(None::<Timestamp>);
625    /// ```
626    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
627    where
628        T: std::convert::Into<wkt::Timestamp>,
629    {
630        self.create_time = v.map(|x| x.into());
631        self
632    }
633
634    /// Sets the value of [state][crate::model::ActiveDirectory::state].
635    ///
636    /// # Example
637    /// ```ignore,no_run
638    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
639    /// use google_cloud_netapp_v1::model::active_directory::State;
640    /// let x0 = ActiveDirectory::new().set_state(State::Creating);
641    /// let x1 = ActiveDirectory::new().set_state(State::Ready);
642    /// let x2 = ActiveDirectory::new().set_state(State::Updating);
643    /// ```
644    pub fn set_state<T: std::convert::Into<crate::model::active_directory::State>>(
645        mut self,
646        v: T,
647    ) -> Self {
648        self.state = v.into();
649        self
650    }
651
652    /// Sets the value of [domain][crate::model::ActiveDirectory::domain].
653    ///
654    /// # Example
655    /// ```ignore,no_run
656    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
657    /// let x = ActiveDirectory::new().set_domain("example");
658    /// ```
659    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
660        self.domain = v.into();
661        self
662    }
663
664    /// Sets the value of [site][crate::model::ActiveDirectory::site].
665    ///
666    /// # Example
667    /// ```ignore,no_run
668    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
669    /// let x = ActiveDirectory::new().set_site("example");
670    /// ```
671    pub fn set_site<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
672        self.site = v.into();
673        self
674    }
675
676    /// Sets the value of [dns][crate::model::ActiveDirectory::dns].
677    ///
678    /// # Example
679    /// ```ignore,no_run
680    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
681    /// let x = ActiveDirectory::new().set_dns("example");
682    /// ```
683    pub fn set_dns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
684        self.dns = v.into();
685        self
686    }
687
688    /// Sets the value of [net_bios_prefix][crate::model::ActiveDirectory::net_bios_prefix].
689    ///
690    /// # Example
691    /// ```ignore,no_run
692    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
693    /// let x = ActiveDirectory::new().set_net_bios_prefix("example");
694    /// ```
695    pub fn set_net_bios_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
696        self.net_bios_prefix = v.into();
697        self
698    }
699
700    /// Sets the value of [organizational_unit][crate::model::ActiveDirectory::organizational_unit].
701    ///
702    /// # Example
703    /// ```ignore,no_run
704    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
705    /// let x = ActiveDirectory::new().set_organizational_unit("example");
706    /// ```
707    pub fn set_organizational_unit<T: std::convert::Into<std::string::String>>(
708        mut self,
709        v: T,
710    ) -> Self {
711        self.organizational_unit = v.into();
712        self
713    }
714
715    /// Sets the value of [aes_encryption][crate::model::ActiveDirectory::aes_encryption].
716    ///
717    /// # Example
718    /// ```ignore,no_run
719    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
720    /// let x = ActiveDirectory::new().set_aes_encryption(true);
721    /// ```
722    pub fn set_aes_encryption<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
723        self.aes_encryption = v.into();
724        self
725    }
726
727    /// Sets the value of [username][crate::model::ActiveDirectory::username].
728    ///
729    /// # Example
730    /// ```ignore,no_run
731    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
732    /// let x = ActiveDirectory::new().set_username("example");
733    /// ```
734    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
735        self.username = v.into();
736        self
737    }
738
739    /// Sets the value of [password][crate::model::ActiveDirectory::password].
740    ///
741    /// # Example
742    /// ```ignore,no_run
743    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
744    /// let x = ActiveDirectory::new().set_password("example");
745    /// ```
746    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
747        self.password = v.into();
748        self
749    }
750
751    /// Sets the value of [backup_operators][crate::model::ActiveDirectory::backup_operators].
752    ///
753    /// # Example
754    /// ```ignore,no_run
755    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
756    /// let x = ActiveDirectory::new().set_backup_operators(["a", "b", "c"]);
757    /// ```
758    pub fn set_backup_operators<T, V>(mut self, v: T) -> Self
759    where
760        T: std::iter::IntoIterator<Item = V>,
761        V: std::convert::Into<std::string::String>,
762    {
763        use std::iter::Iterator;
764        self.backup_operators = v.into_iter().map(|i| i.into()).collect();
765        self
766    }
767
768    /// Sets the value of [administrators][crate::model::ActiveDirectory::administrators].
769    ///
770    /// # Example
771    /// ```ignore,no_run
772    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
773    /// let x = ActiveDirectory::new().set_administrators(["a", "b", "c"]);
774    /// ```
775    pub fn set_administrators<T, V>(mut self, v: T) -> Self
776    where
777        T: std::iter::IntoIterator<Item = V>,
778        V: std::convert::Into<std::string::String>,
779    {
780        use std::iter::Iterator;
781        self.administrators = v.into_iter().map(|i| i.into()).collect();
782        self
783    }
784
785    /// Sets the value of [security_operators][crate::model::ActiveDirectory::security_operators].
786    ///
787    /// # Example
788    /// ```ignore,no_run
789    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
790    /// let x = ActiveDirectory::new().set_security_operators(["a", "b", "c"]);
791    /// ```
792    pub fn set_security_operators<T, V>(mut self, v: T) -> Self
793    where
794        T: std::iter::IntoIterator<Item = V>,
795        V: std::convert::Into<std::string::String>,
796    {
797        use std::iter::Iterator;
798        self.security_operators = v.into_iter().map(|i| i.into()).collect();
799        self
800    }
801
802    /// Sets the value of [kdc_hostname][crate::model::ActiveDirectory::kdc_hostname].
803    ///
804    /// # Example
805    /// ```ignore,no_run
806    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
807    /// let x = ActiveDirectory::new().set_kdc_hostname("example");
808    /// ```
809    pub fn set_kdc_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
810        self.kdc_hostname = v.into();
811        self
812    }
813
814    /// Sets the value of [kdc_ip][crate::model::ActiveDirectory::kdc_ip].
815    ///
816    /// # Example
817    /// ```ignore,no_run
818    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
819    /// let x = ActiveDirectory::new().set_kdc_ip("example");
820    /// ```
821    pub fn set_kdc_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
822        self.kdc_ip = v.into();
823        self
824    }
825
826    /// Sets the value of [nfs_users_with_ldap][crate::model::ActiveDirectory::nfs_users_with_ldap].
827    ///
828    /// # Example
829    /// ```ignore,no_run
830    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
831    /// let x = ActiveDirectory::new().set_nfs_users_with_ldap(true);
832    /// ```
833    pub fn set_nfs_users_with_ldap<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
834        self.nfs_users_with_ldap = v.into();
835        self
836    }
837
838    /// Sets the value of [description][crate::model::ActiveDirectory::description].
839    ///
840    /// # Example
841    /// ```ignore,no_run
842    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
843    /// let x = ActiveDirectory::new().set_description("example");
844    /// ```
845    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
846        self.description = v.into();
847        self
848    }
849
850    /// Sets the value of [ldap_signing][crate::model::ActiveDirectory::ldap_signing].
851    ///
852    /// # Example
853    /// ```ignore,no_run
854    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
855    /// let x = ActiveDirectory::new().set_ldap_signing(true);
856    /// ```
857    pub fn set_ldap_signing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
858        self.ldap_signing = v.into();
859        self
860    }
861
862    /// Sets the value of [encrypt_dc_connections][crate::model::ActiveDirectory::encrypt_dc_connections].
863    ///
864    /// # Example
865    /// ```ignore,no_run
866    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
867    /// let x = ActiveDirectory::new().set_encrypt_dc_connections(true);
868    /// ```
869    pub fn set_encrypt_dc_connections<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
870        self.encrypt_dc_connections = v.into();
871        self
872    }
873
874    /// Sets the value of [labels][crate::model::ActiveDirectory::labels].
875    ///
876    /// # Example
877    /// ```ignore,no_run
878    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
879    /// let x = ActiveDirectory::new().set_labels([
880    ///     ("key0", "abc"),
881    ///     ("key1", "xyz"),
882    /// ]);
883    /// ```
884    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
885    where
886        T: std::iter::IntoIterator<Item = (K, V)>,
887        K: std::convert::Into<std::string::String>,
888        V: std::convert::Into<std::string::String>,
889    {
890        use std::iter::Iterator;
891        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
892        self
893    }
894
895    /// Sets the value of [state_details][crate::model::ActiveDirectory::state_details].
896    ///
897    /// # Example
898    /// ```ignore,no_run
899    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
900    /// let x = ActiveDirectory::new().set_state_details("example");
901    /// ```
902    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
903        self.state_details = v.into();
904        self
905    }
906}
907
908impl wkt::message::Message for ActiveDirectory {
909    fn typename() -> &'static str {
910        "type.googleapis.com/google.cloud.netapp.v1.ActiveDirectory"
911    }
912}
913
914/// Defines additional types related to [ActiveDirectory].
915pub mod active_directory {
916    #[allow(unused_imports)]
917    use super::*;
918
919    /// The Active Directory States
920    ///
921    /// # Working with unknown values
922    ///
923    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
924    /// additional enum variants at any time. Adding new variants is not considered
925    /// a breaking change. Applications should write their code in anticipation of:
926    ///
927    /// - New values appearing in future releases of the client library, **and**
928    /// - New values received dynamically, without application changes.
929    ///
930    /// Please consult the [Working with enums] section in the user guide for some
931    /// guidelines.
932    ///
933    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
934    #[derive(Clone, Debug, PartialEq)]
935    #[non_exhaustive]
936    pub enum State {
937        /// Unspecified Active Directory State
938        Unspecified,
939        /// Active Directory State is Creating
940        Creating,
941        /// Active Directory State is Ready
942        Ready,
943        /// Active Directory State is Updating
944        Updating,
945        /// Active Directory State is In use
946        InUse,
947        /// Active Directory State is Deleting
948        Deleting,
949        /// Active Directory State is Error
950        Error,
951        /// Active Directory State is Diagnosing.
952        Diagnosing,
953        /// If set, the enum was initialized with an unknown value.
954        ///
955        /// Applications can examine the value using [State::value] or
956        /// [State::name].
957        UnknownValue(state::UnknownValue),
958    }
959
960    #[doc(hidden)]
961    pub mod state {
962        #[allow(unused_imports)]
963        use super::*;
964        #[derive(Clone, Debug, PartialEq)]
965        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
966    }
967
968    impl State {
969        /// Gets the enum value.
970        ///
971        /// Returns `None` if the enum contains an unknown value deserialized from
972        /// the string representation of enums.
973        pub fn value(&self) -> std::option::Option<i32> {
974            match self {
975                Self::Unspecified => std::option::Option::Some(0),
976                Self::Creating => std::option::Option::Some(1),
977                Self::Ready => std::option::Option::Some(2),
978                Self::Updating => std::option::Option::Some(3),
979                Self::InUse => std::option::Option::Some(4),
980                Self::Deleting => std::option::Option::Some(5),
981                Self::Error => std::option::Option::Some(6),
982                Self::Diagnosing => std::option::Option::Some(7),
983                Self::UnknownValue(u) => u.0.value(),
984            }
985        }
986
987        /// Gets the enum value as a string.
988        ///
989        /// Returns `None` if the enum contains an unknown value deserialized from
990        /// the integer representation of enums.
991        pub fn name(&self) -> std::option::Option<&str> {
992            match self {
993                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
994                Self::Creating => std::option::Option::Some("CREATING"),
995                Self::Ready => std::option::Option::Some("READY"),
996                Self::Updating => std::option::Option::Some("UPDATING"),
997                Self::InUse => std::option::Option::Some("IN_USE"),
998                Self::Deleting => std::option::Option::Some("DELETING"),
999                Self::Error => std::option::Option::Some("ERROR"),
1000                Self::Diagnosing => std::option::Option::Some("DIAGNOSING"),
1001                Self::UnknownValue(u) => u.0.name(),
1002            }
1003        }
1004    }
1005
1006    impl std::default::Default for State {
1007        fn default() -> Self {
1008            use std::convert::From;
1009            Self::from(0)
1010        }
1011    }
1012
1013    impl std::fmt::Display for State {
1014        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1015            wkt::internal::display_enum(f, self.name(), self.value())
1016        }
1017    }
1018
1019    impl std::convert::From<i32> for State {
1020        fn from(value: i32) -> Self {
1021            match value {
1022                0 => Self::Unspecified,
1023                1 => Self::Creating,
1024                2 => Self::Ready,
1025                3 => Self::Updating,
1026                4 => Self::InUse,
1027                5 => Self::Deleting,
1028                6 => Self::Error,
1029                7 => Self::Diagnosing,
1030                _ => Self::UnknownValue(state::UnknownValue(
1031                    wkt::internal::UnknownEnumValue::Integer(value),
1032                )),
1033            }
1034        }
1035    }
1036
1037    impl std::convert::From<&str> for State {
1038        fn from(value: &str) -> Self {
1039            use std::string::ToString;
1040            match value {
1041                "STATE_UNSPECIFIED" => Self::Unspecified,
1042                "CREATING" => Self::Creating,
1043                "READY" => Self::Ready,
1044                "UPDATING" => Self::Updating,
1045                "IN_USE" => Self::InUse,
1046                "DELETING" => Self::Deleting,
1047                "ERROR" => Self::Error,
1048                "DIAGNOSING" => Self::Diagnosing,
1049                _ => Self::UnknownValue(state::UnknownValue(
1050                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1051                )),
1052            }
1053        }
1054    }
1055
1056    impl serde::ser::Serialize for State {
1057        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1058        where
1059            S: serde::Serializer,
1060        {
1061            match self {
1062                Self::Unspecified => serializer.serialize_i32(0),
1063                Self::Creating => serializer.serialize_i32(1),
1064                Self::Ready => serializer.serialize_i32(2),
1065                Self::Updating => serializer.serialize_i32(3),
1066                Self::InUse => serializer.serialize_i32(4),
1067                Self::Deleting => serializer.serialize_i32(5),
1068                Self::Error => serializer.serialize_i32(6),
1069                Self::Diagnosing => serializer.serialize_i32(7),
1070                Self::UnknownValue(u) => u.0.serialize(serializer),
1071            }
1072        }
1073    }
1074
1075    impl<'de> serde::de::Deserialize<'de> for State {
1076        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1077        where
1078            D: serde::Deserializer<'de>,
1079        {
1080            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1081                ".google.cloud.netapp.v1.ActiveDirectory.State",
1082            ))
1083        }
1084    }
1085}
1086
1087/// A NetApp Backup.
1088#[derive(Clone, Default, PartialEq)]
1089#[non_exhaustive]
1090pub struct Backup {
1091    /// Identifier. The resource name of the backup.
1092    /// Format:
1093    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`.
1094    pub name: std::string::String,
1095
1096    /// Output only. The backup state.
1097    pub state: crate::model::backup::State,
1098
1099    /// A description of the backup with 2048 characters or less.
1100    /// Requests with longer descriptions will be rejected.
1101    pub description: std::string::String,
1102
1103    /// Output only. Size of the file system when the backup was created. When
1104    /// creating a new volume from the backup, the volume capacity will have to be
1105    /// at least as big.
1106    pub volume_usage_bytes: i64,
1107
1108    /// Output only. Type of backup, manually created or created by a backup
1109    /// policy.
1110    pub backup_type: crate::model::backup::Type,
1111
1112    /// Volume full name of this backup belongs to.
1113    /// Either source_volume or ontap_source should be provided.
1114    /// Format:
1115    /// `projects/{projects_id}/locations/{location}/volumes/{volume_id}`
1116    pub source_volume: std::string::String,
1117
1118    /// If specified, backup will be created from the given snapshot.
1119    /// If not specified, there will be a new snapshot taken to initiate the backup
1120    /// creation. Format:
1121    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`
1122    pub source_snapshot: std::option::Option<std::string::String>,
1123
1124    /// Output only. The time when the backup was created.
1125    pub create_time: std::option::Option<wkt::Timestamp>,
1126
1127    /// Resource labels to represent user provided metadata.
1128    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1129
1130    /// Output only. Total size of all backups in a chain in bytes = baseline
1131    /// backup size + sum(incremental backup size)
1132    pub chain_storage_bytes: i64,
1133
1134    /// Output only. Reserved for future use
1135    pub satisfies_pzs: bool,
1136
1137    /// Output only. Reserved for future use
1138    pub satisfies_pzi: bool,
1139
1140    /// Output only. Region of the volume from which the backup was created.
1141    /// Format: `projects/{project_id}/locations/{location}`
1142    pub volume_region: std::string::String,
1143
1144    /// Output only. Region in which backup is stored.
1145    /// Format: `projects/{project_id}/locations/{location}`
1146    pub backup_region: std::string::String,
1147
1148    /// Output only. The time until which the backup is not deletable.
1149    pub enforced_retention_end_time: std::option::Option<wkt::Timestamp>,
1150
1151    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1152}
1153
1154impl Backup {
1155    /// Creates a new default instance.
1156    pub fn new() -> Self {
1157        std::default::Default::default()
1158    }
1159
1160    /// Sets the value of [name][crate::model::Backup::name].
1161    ///
1162    /// # Example
1163    /// ```ignore,no_run
1164    /// # use google_cloud_netapp_v1::model::Backup;
1165    /// # let project_id = "project_id";
1166    /// # let location_id = "location_id";
1167    /// # let backup_vault_id = "backup_vault_id";
1168    /// # let backup_id = "backup_id";
1169    /// let x = Backup::new().set_name(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}/backups/{backup_id}"));
1170    /// ```
1171    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1172        self.name = v.into();
1173        self
1174    }
1175
1176    /// Sets the value of [state][crate::model::Backup::state].
1177    ///
1178    /// # Example
1179    /// ```ignore,no_run
1180    /// # use google_cloud_netapp_v1::model::Backup;
1181    /// use google_cloud_netapp_v1::model::backup::State;
1182    /// let x0 = Backup::new().set_state(State::Creating);
1183    /// let x1 = Backup::new().set_state(State::Uploading);
1184    /// let x2 = Backup::new().set_state(State::Ready);
1185    /// ```
1186    pub fn set_state<T: std::convert::Into<crate::model::backup::State>>(mut self, v: T) -> Self {
1187        self.state = v.into();
1188        self
1189    }
1190
1191    /// Sets the value of [description][crate::model::Backup::description].
1192    ///
1193    /// # Example
1194    /// ```ignore,no_run
1195    /// # use google_cloud_netapp_v1::model::Backup;
1196    /// let x = Backup::new().set_description("example");
1197    /// ```
1198    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1199        self.description = v.into();
1200        self
1201    }
1202
1203    /// Sets the value of [volume_usage_bytes][crate::model::Backup::volume_usage_bytes].
1204    ///
1205    /// # Example
1206    /// ```ignore,no_run
1207    /// # use google_cloud_netapp_v1::model::Backup;
1208    /// let x = Backup::new().set_volume_usage_bytes(42);
1209    /// ```
1210    pub fn set_volume_usage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1211        self.volume_usage_bytes = v.into();
1212        self
1213    }
1214
1215    /// Sets the value of [backup_type][crate::model::Backup::backup_type].
1216    ///
1217    /// # Example
1218    /// ```ignore,no_run
1219    /// # use google_cloud_netapp_v1::model::Backup;
1220    /// use google_cloud_netapp_v1::model::backup::Type;
1221    /// let x0 = Backup::new().set_backup_type(Type::Manual);
1222    /// let x1 = Backup::new().set_backup_type(Type::Scheduled);
1223    /// ```
1224    pub fn set_backup_type<T: std::convert::Into<crate::model::backup::Type>>(
1225        mut self,
1226        v: T,
1227    ) -> Self {
1228        self.backup_type = v.into();
1229        self
1230    }
1231
1232    /// Sets the value of [source_volume][crate::model::Backup::source_volume].
1233    ///
1234    /// # Example
1235    /// ```ignore,no_run
1236    /// # use google_cloud_netapp_v1::model::Backup;
1237    /// # let project_id = "project_id";
1238    /// # let location_id = "location_id";
1239    /// # let volume_id = "volume_id";
1240    /// let x = Backup::new().set_source_volume(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
1241    /// ```
1242    pub fn set_source_volume<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1243        self.source_volume = v.into();
1244        self
1245    }
1246
1247    /// Sets the value of [source_snapshot][crate::model::Backup::source_snapshot].
1248    ///
1249    /// # Example
1250    /// ```ignore,no_run
1251    /// # use google_cloud_netapp_v1::model::Backup;
1252    /// # let project_id = "project_id";
1253    /// # let location_id = "location_id";
1254    /// # let volume_id = "volume_id";
1255    /// # let snapshot_id = "snapshot_id";
1256    /// let x = Backup::new().set_source_snapshot(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}"));
1257    /// ```
1258    pub fn set_source_snapshot<T>(mut self, v: T) -> Self
1259    where
1260        T: std::convert::Into<std::string::String>,
1261    {
1262        self.source_snapshot = std::option::Option::Some(v.into());
1263        self
1264    }
1265
1266    /// Sets or clears the value of [source_snapshot][crate::model::Backup::source_snapshot].
1267    ///
1268    /// # Example
1269    /// ```ignore,no_run
1270    /// # use google_cloud_netapp_v1::model::Backup;
1271    /// # let project_id = "project_id";
1272    /// # let location_id = "location_id";
1273    /// # let volume_id = "volume_id";
1274    /// # let snapshot_id = "snapshot_id";
1275    /// let x = Backup::new().set_or_clear_source_snapshot(Some(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}")));
1276    /// let x = Backup::new().set_or_clear_source_snapshot(None::<String>);
1277    /// ```
1278    pub fn set_or_clear_source_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
1279    where
1280        T: std::convert::Into<std::string::String>,
1281    {
1282        self.source_snapshot = v.map(|x| x.into());
1283        self
1284    }
1285
1286    /// Sets the value of [create_time][crate::model::Backup::create_time].
1287    ///
1288    /// # Example
1289    /// ```ignore,no_run
1290    /// # use google_cloud_netapp_v1::model::Backup;
1291    /// use wkt::Timestamp;
1292    /// let x = Backup::new().set_create_time(Timestamp::default()/* use setters */);
1293    /// ```
1294    pub fn set_create_time<T>(mut self, v: T) -> Self
1295    where
1296        T: std::convert::Into<wkt::Timestamp>,
1297    {
1298        self.create_time = std::option::Option::Some(v.into());
1299        self
1300    }
1301
1302    /// Sets or clears the value of [create_time][crate::model::Backup::create_time].
1303    ///
1304    /// # Example
1305    /// ```ignore,no_run
1306    /// # use google_cloud_netapp_v1::model::Backup;
1307    /// use wkt::Timestamp;
1308    /// let x = Backup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1309    /// let x = Backup::new().set_or_clear_create_time(None::<Timestamp>);
1310    /// ```
1311    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1312    where
1313        T: std::convert::Into<wkt::Timestamp>,
1314    {
1315        self.create_time = v.map(|x| x.into());
1316        self
1317    }
1318
1319    /// Sets the value of [labels][crate::model::Backup::labels].
1320    ///
1321    /// # Example
1322    /// ```ignore,no_run
1323    /// # use google_cloud_netapp_v1::model::Backup;
1324    /// let x = Backup::new().set_labels([
1325    ///     ("key0", "abc"),
1326    ///     ("key1", "xyz"),
1327    /// ]);
1328    /// ```
1329    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1330    where
1331        T: std::iter::IntoIterator<Item = (K, V)>,
1332        K: std::convert::Into<std::string::String>,
1333        V: std::convert::Into<std::string::String>,
1334    {
1335        use std::iter::Iterator;
1336        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1337        self
1338    }
1339
1340    /// Sets the value of [chain_storage_bytes][crate::model::Backup::chain_storage_bytes].
1341    ///
1342    /// # Example
1343    /// ```ignore,no_run
1344    /// # use google_cloud_netapp_v1::model::Backup;
1345    /// let x = Backup::new().set_chain_storage_bytes(42);
1346    /// ```
1347    pub fn set_chain_storage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1348        self.chain_storage_bytes = v.into();
1349        self
1350    }
1351
1352    /// Sets the value of [satisfies_pzs][crate::model::Backup::satisfies_pzs].
1353    ///
1354    /// # Example
1355    /// ```ignore,no_run
1356    /// # use google_cloud_netapp_v1::model::Backup;
1357    /// let x = Backup::new().set_satisfies_pzs(true);
1358    /// ```
1359    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1360        self.satisfies_pzs = v.into();
1361        self
1362    }
1363
1364    /// Sets the value of [satisfies_pzi][crate::model::Backup::satisfies_pzi].
1365    ///
1366    /// # Example
1367    /// ```ignore,no_run
1368    /// # use google_cloud_netapp_v1::model::Backup;
1369    /// let x = Backup::new().set_satisfies_pzi(true);
1370    /// ```
1371    pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1372        self.satisfies_pzi = v.into();
1373        self
1374    }
1375
1376    /// Sets the value of [volume_region][crate::model::Backup::volume_region].
1377    ///
1378    /// # Example
1379    /// ```ignore,no_run
1380    /// # use google_cloud_netapp_v1::model::Backup;
1381    /// let x = Backup::new().set_volume_region("example");
1382    /// ```
1383    pub fn set_volume_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1384        self.volume_region = v.into();
1385        self
1386    }
1387
1388    /// Sets the value of [backup_region][crate::model::Backup::backup_region].
1389    ///
1390    /// # Example
1391    /// ```ignore,no_run
1392    /// # use google_cloud_netapp_v1::model::Backup;
1393    /// let x = Backup::new().set_backup_region("example");
1394    /// ```
1395    pub fn set_backup_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1396        self.backup_region = v.into();
1397        self
1398    }
1399
1400    /// Sets the value of [enforced_retention_end_time][crate::model::Backup::enforced_retention_end_time].
1401    ///
1402    /// # Example
1403    /// ```ignore,no_run
1404    /// # use google_cloud_netapp_v1::model::Backup;
1405    /// use wkt::Timestamp;
1406    /// let x = Backup::new().set_enforced_retention_end_time(Timestamp::default()/* use setters */);
1407    /// ```
1408    pub fn set_enforced_retention_end_time<T>(mut self, v: T) -> Self
1409    where
1410        T: std::convert::Into<wkt::Timestamp>,
1411    {
1412        self.enforced_retention_end_time = std::option::Option::Some(v.into());
1413        self
1414    }
1415
1416    /// Sets or clears the value of [enforced_retention_end_time][crate::model::Backup::enforced_retention_end_time].
1417    ///
1418    /// # Example
1419    /// ```ignore,no_run
1420    /// # use google_cloud_netapp_v1::model::Backup;
1421    /// use wkt::Timestamp;
1422    /// let x = Backup::new().set_or_clear_enforced_retention_end_time(Some(Timestamp::default()/* use setters */));
1423    /// let x = Backup::new().set_or_clear_enforced_retention_end_time(None::<Timestamp>);
1424    /// ```
1425    pub fn set_or_clear_enforced_retention_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1426    where
1427        T: std::convert::Into<wkt::Timestamp>,
1428    {
1429        self.enforced_retention_end_time = v.map(|x| x.into());
1430        self
1431    }
1432}
1433
1434impl wkt::message::Message for Backup {
1435    fn typename() -> &'static str {
1436        "type.googleapis.com/google.cloud.netapp.v1.Backup"
1437    }
1438}
1439
1440/// Defines additional types related to [Backup].
1441pub mod backup {
1442    #[allow(unused_imports)]
1443    use super::*;
1444
1445    /// The Backup States
1446    ///
1447    /// # Working with unknown values
1448    ///
1449    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1450    /// additional enum variants at any time. Adding new variants is not considered
1451    /// a breaking change. Applications should write their code in anticipation of:
1452    ///
1453    /// - New values appearing in future releases of the client library, **and**
1454    /// - New values received dynamically, without application changes.
1455    ///
1456    /// Please consult the [Working with enums] section in the user guide for some
1457    /// guidelines.
1458    ///
1459    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1460    #[derive(Clone, Debug, PartialEq)]
1461    #[non_exhaustive]
1462    pub enum State {
1463        /// State not set.
1464        Unspecified,
1465        /// Backup is being created. While in this state, the snapshot for the backup
1466        /// point-in-time may not have been created yet, and so the point-in-time may
1467        /// not have been fixed.
1468        Creating,
1469        /// Backup is being uploaded. While in this state, none of the writes to the
1470        /// volume will be included in the backup.
1471        Uploading,
1472        /// Backup is available for use.
1473        Ready,
1474        /// Backup is being deleted.
1475        Deleting,
1476        /// Backup is not valid and cannot be used for creating new volumes or
1477        /// restoring existing volumes.
1478        Error,
1479        /// Backup is being updated.
1480        Updating,
1481        /// If set, the enum was initialized with an unknown value.
1482        ///
1483        /// Applications can examine the value using [State::value] or
1484        /// [State::name].
1485        UnknownValue(state::UnknownValue),
1486    }
1487
1488    #[doc(hidden)]
1489    pub mod state {
1490        #[allow(unused_imports)]
1491        use super::*;
1492        #[derive(Clone, Debug, PartialEq)]
1493        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1494    }
1495
1496    impl State {
1497        /// Gets the enum value.
1498        ///
1499        /// Returns `None` if the enum contains an unknown value deserialized from
1500        /// the string representation of enums.
1501        pub fn value(&self) -> std::option::Option<i32> {
1502            match self {
1503                Self::Unspecified => std::option::Option::Some(0),
1504                Self::Creating => std::option::Option::Some(1),
1505                Self::Uploading => std::option::Option::Some(2),
1506                Self::Ready => std::option::Option::Some(3),
1507                Self::Deleting => std::option::Option::Some(4),
1508                Self::Error => std::option::Option::Some(5),
1509                Self::Updating => std::option::Option::Some(6),
1510                Self::UnknownValue(u) => u.0.value(),
1511            }
1512        }
1513
1514        /// Gets the enum value as a string.
1515        ///
1516        /// Returns `None` if the enum contains an unknown value deserialized from
1517        /// the integer representation of enums.
1518        pub fn name(&self) -> std::option::Option<&str> {
1519            match self {
1520                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1521                Self::Creating => std::option::Option::Some("CREATING"),
1522                Self::Uploading => std::option::Option::Some("UPLOADING"),
1523                Self::Ready => std::option::Option::Some("READY"),
1524                Self::Deleting => std::option::Option::Some("DELETING"),
1525                Self::Error => std::option::Option::Some("ERROR"),
1526                Self::Updating => std::option::Option::Some("UPDATING"),
1527                Self::UnknownValue(u) => u.0.name(),
1528            }
1529        }
1530    }
1531
1532    impl std::default::Default for State {
1533        fn default() -> Self {
1534            use std::convert::From;
1535            Self::from(0)
1536        }
1537    }
1538
1539    impl std::fmt::Display for State {
1540        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1541            wkt::internal::display_enum(f, self.name(), self.value())
1542        }
1543    }
1544
1545    impl std::convert::From<i32> for State {
1546        fn from(value: i32) -> Self {
1547            match value {
1548                0 => Self::Unspecified,
1549                1 => Self::Creating,
1550                2 => Self::Uploading,
1551                3 => Self::Ready,
1552                4 => Self::Deleting,
1553                5 => Self::Error,
1554                6 => Self::Updating,
1555                _ => Self::UnknownValue(state::UnknownValue(
1556                    wkt::internal::UnknownEnumValue::Integer(value),
1557                )),
1558            }
1559        }
1560    }
1561
1562    impl std::convert::From<&str> for State {
1563        fn from(value: &str) -> Self {
1564            use std::string::ToString;
1565            match value {
1566                "STATE_UNSPECIFIED" => Self::Unspecified,
1567                "CREATING" => Self::Creating,
1568                "UPLOADING" => Self::Uploading,
1569                "READY" => Self::Ready,
1570                "DELETING" => Self::Deleting,
1571                "ERROR" => Self::Error,
1572                "UPDATING" => Self::Updating,
1573                _ => Self::UnknownValue(state::UnknownValue(
1574                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1575                )),
1576            }
1577        }
1578    }
1579
1580    impl serde::ser::Serialize for State {
1581        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1582        where
1583            S: serde::Serializer,
1584        {
1585            match self {
1586                Self::Unspecified => serializer.serialize_i32(0),
1587                Self::Creating => serializer.serialize_i32(1),
1588                Self::Uploading => serializer.serialize_i32(2),
1589                Self::Ready => serializer.serialize_i32(3),
1590                Self::Deleting => serializer.serialize_i32(4),
1591                Self::Error => serializer.serialize_i32(5),
1592                Self::Updating => serializer.serialize_i32(6),
1593                Self::UnknownValue(u) => u.0.serialize(serializer),
1594            }
1595        }
1596    }
1597
1598    impl<'de> serde::de::Deserialize<'de> for State {
1599        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1600        where
1601            D: serde::Deserializer<'de>,
1602        {
1603            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1604                ".google.cloud.netapp.v1.Backup.State",
1605            ))
1606        }
1607    }
1608
1609    /// Backup types.
1610    ///
1611    /// # Working with unknown values
1612    ///
1613    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1614    /// additional enum variants at any time. Adding new variants is not considered
1615    /// a breaking change. Applications should write their code in anticipation of:
1616    ///
1617    /// - New values appearing in future releases of the client library, **and**
1618    /// - New values received dynamically, without application changes.
1619    ///
1620    /// Please consult the [Working with enums] section in the user guide for some
1621    /// guidelines.
1622    ///
1623    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1624    #[derive(Clone, Debug, PartialEq)]
1625    #[non_exhaustive]
1626    pub enum Type {
1627        /// Unspecified backup type.
1628        Unspecified,
1629        /// Manual backup type.
1630        Manual,
1631        /// Scheduled backup type.
1632        Scheduled,
1633        /// If set, the enum was initialized with an unknown value.
1634        ///
1635        /// Applications can examine the value using [Type::value] or
1636        /// [Type::name].
1637        UnknownValue(r#type::UnknownValue),
1638    }
1639
1640    #[doc(hidden)]
1641    pub mod r#type {
1642        #[allow(unused_imports)]
1643        use super::*;
1644        #[derive(Clone, Debug, PartialEq)]
1645        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1646    }
1647
1648    impl Type {
1649        /// Gets the enum value.
1650        ///
1651        /// Returns `None` if the enum contains an unknown value deserialized from
1652        /// the string representation of enums.
1653        pub fn value(&self) -> std::option::Option<i32> {
1654            match self {
1655                Self::Unspecified => std::option::Option::Some(0),
1656                Self::Manual => std::option::Option::Some(1),
1657                Self::Scheduled => std::option::Option::Some(2),
1658                Self::UnknownValue(u) => u.0.value(),
1659            }
1660        }
1661
1662        /// Gets the enum value as a string.
1663        ///
1664        /// Returns `None` if the enum contains an unknown value deserialized from
1665        /// the integer representation of enums.
1666        pub fn name(&self) -> std::option::Option<&str> {
1667            match self {
1668                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
1669                Self::Manual => std::option::Option::Some("MANUAL"),
1670                Self::Scheduled => std::option::Option::Some("SCHEDULED"),
1671                Self::UnknownValue(u) => u.0.name(),
1672            }
1673        }
1674    }
1675
1676    impl std::default::Default for Type {
1677        fn default() -> Self {
1678            use std::convert::From;
1679            Self::from(0)
1680        }
1681    }
1682
1683    impl std::fmt::Display for Type {
1684        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1685            wkt::internal::display_enum(f, self.name(), self.value())
1686        }
1687    }
1688
1689    impl std::convert::From<i32> for Type {
1690        fn from(value: i32) -> Self {
1691            match value {
1692                0 => Self::Unspecified,
1693                1 => Self::Manual,
1694                2 => Self::Scheduled,
1695                _ => Self::UnknownValue(r#type::UnknownValue(
1696                    wkt::internal::UnknownEnumValue::Integer(value),
1697                )),
1698            }
1699        }
1700    }
1701
1702    impl std::convert::From<&str> for Type {
1703        fn from(value: &str) -> Self {
1704            use std::string::ToString;
1705            match value {
1706                "TYPE_UNSPECIFIED" => Self::Unspecified,
1707                "MANUAL" => Self::Manual,
1708                "SCHEDULED" => Self::Scheduled,
1709                _ => Self::UnknownValue(r#type::UnknownValue(
1710                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1711                )),
1712            }
1713        }
1714    }
1715
1716    impl serde::ser::Serialize for Type {
1717        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1718        where
1719            S: serde::Serializer,
1720        {
1721            match self {
1722                Self::Unspecified => serializer.serialize_i32(0),
1723                Self::Manual => serializer.serialize_i32(1),
1724                Self::Scheduled => serializer.serialize_i32(2),
1725                Self::UnknownValue(u) => u.0.serialize(serializer),
1726            }
1727        }
1728    }
1729
1730    impl<'de> serde::de::Deserialize<'de> for Type {
1731        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1732        where
1733            D: serde::Deserializer<'de>,
1734        {
1735            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
1736                ".google.cloud.netapp.v1.Backup.Type",
1737            ))
1738        }
1739    }
1740}
1741
1742/// ListBackupsRequest lists backups.
1743#[derive(Clone, Default, PartialEq)]
1744#[non_exhaustive]
1745pub struct ListBackupsRequest {
1746    /// Required. The backupVault for which to retrieve backup information,
1747    /// in the format
1748    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`.
1749    /// To retrieve backup information for all locations, use "-" for the
1750    /// `{location}` value.
1751    /// To retrieve backup information for all backupVaults, use "-" for the
1752    /// `{backup_vault_id}` value.
1753    /// To retrieve backup information for a volume, use "-" for the
1754    /// `{backup_vault_id}` value and specify volume full name with the filter.
1755    pub parent: std::string::String,
1756
1757    /// The maximum number of items to return. The service may return fewer
1758    /// than this value. The maximum value
1759    /// is 1000; values above 1000 will be coerced to 1000.
1760    pub page_size: i32,
1761
1762    /// The next_page_token value to use if there are additional
1763    /// results to retrieve for this list request.
1764    pub page_token: std::string::String,
1765
1766    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
1767    pub order_by: std::string::String,
1768
1769    /// The standard list filter.
1770    /// If specified, backups will be returned based on the attribute name that
1771    /// matches the filter expression. If empty, then no backups are filtered out.
1772    /// See <https://google.aip.dev/160>
1773    pub filter: std::string::String,
1774
1775    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1776}
1777
1778impl ListBackupsRequest {
1779    /// Creates a new default instance.
1780    pub fn new() -> Self {
1781        std::default::Default::default()
1782    }
1783
1784    /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
1785    ///
1786    /// # Example
1787    /// ```ignore,no_run
1788    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1789    /// # let project_id = "project_id";
1790    /// # let location_id = "location_id";
1791    /// # let backup_vault_id = "backup_vault_id";
1792    /// let x = ListBackupsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}"));
1793    /// ```
1794    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1795        self.parent = v.into();
1796        self
1797    }
1798
1799    /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
1800    ///
1801    /// # Example
1802    /// ```ignore,no_run
1803    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1804    /// let x = ListBackupsRequest::new().set_page_size(42);
1805    /// ```
1806    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1807        self.page_size = v.into();
1808        self
1809    }
1810
1811    /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
1812    ///
1813    /// # Example
1814    /// ```ignore,no_run
1815    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1816    /// let x = ListBackupsRequest::new().set_page_token("example");
1817    /// ```
1818    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1819        self.page_token = v.into();
1820        self
1821    }
1822
1823    /// Sets the value of [order_by][crate::model::ListBackupsRequest::order_by].
1824    ///
1825    /// # Example
1826    /// ```ignore,no_run
1827    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1828    /// let x = ListBackupsRequest::new().set_order_by("example");
1829    /// ```
1830    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1831        self.order_by = v.into();
1832        self
1833    }
1834
1835    /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
1836    ///
1837    /// # Example
1838    /// ```ignore,no_run
1839    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1840    /// let x = ListBackupsRequest::new().set_filter("example");
1841    /// ```
1842    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1843        self.filter = v.into();
1844        self
1845    }
1846}
1847
1848impl wkt::message::Message for ListBackupsRequest {
1849    fn typename() -> &'static str {
1850        "type.googleapis.com/google.cloud.netapp.v1.ListBackupsRequest"
1851    }
1852}
1853
1854/// ListBackupsResponse is the result of ListBackupsRequest.
1855#[derive(Clone, Default, PartialEq)]
1856#[non_exhaustive]
1857pub struct ListBackupsResponse {
1858    /// A list of backups in the project.
1859    pub backups: std::vec::Vec<crate::model::Backup>,
1860
1861    /// The token you can use to retrieve the next page of results. Not returned
1862    /// if there are no more results in the list.
1863    pub next_page_token: std::string::String,
1864
1865    /// Locations that could not be reached.
1866    pub unreachable: std::vec::Vec<std::string::String>,
1867
1868    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1869}
1870
1871impl ListBackupsResponse {
1872    /// Creates a new default instance.
1873    pub fn new() -> Self {
1874        std::default::Default::default()
1875    }
1876
1877    /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
1878    ///
1879    /// # Example
1880    /// ```ignore,no_run
1881    /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1882    /// use google_cloud_netapp_v1::model::Backup;
1883    /// let x = ListBackupsResponse::new()
1884    ///     .set_backups([
1885    ///         Backup::default()/* use setters */,
1886    ///         Backup::default()/* use (different) setters */,
1887    ///     ]);
1888    /// ```
1889    pub fn set_backups<T, V>(mut self, v: T) -> Self
1890    where
1891        T: std::iter::IntoIterator<Item = V>,
1892        V: std::convert::Into<crate::model::Backup>,
1893    {
1894        use std::iter::Iterator;
1895        self.backups = v.into_iter().map(|i| i.into()).collect();
1896        self
1897    }
1898
1899    /// Sets the value of [next_page_token][crate::model::ListBackupsResponse::next_page_token].
1900    ///
1901    /// # Example
1902    /// ```ignore,no_run
1903    /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1904    /// let x = ListBackupsResponse::new().set_next_page_token("example");
1905    /// ```
1906    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1907        self.next_page_token = v.into();
1908        self
1909    }
1910
1911    /// Sets the value of [unreachable][crate::model::ListBackupsResponse::unreachable].
1912    ///
1913    /// # Example
1914    /// ```ignore,no_run
1915    /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1916    /// let x = ListBackupsResponse::new().set_unreachable(["a", "b", "c"]);
1917    /// ```
1918    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1919    where
1920        T: std::iter::IntoIterator<Item = V>,
1921        V: std::convert::Into<std::string::String>,
1922    {
1923        use std::iter::Iterator;
1924        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1925        self
1926    }
1927}
1928
1929impl wkt::message::Message for ListBackupsResponse {
1930    fn typename() -> &'static str {
1931        "type.googleapis.com/google.cloud.netapp.v1.ListBackupsResponse"
1932    }
1933}
1934
1935#[doc(hidden)]
1936impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupsResponse {
1937    type PageItem = crate::model::Backup;
1938
1939    fn items(self) -> std::vec::Vec<Self::PageItem> {
1940        self.backups
1941    }
1942
1943    fn next_page_token(&self) -> std::string::String {
1944        use std::clone::Clone;
1945        self.next_page_token.clone()
1946    }
1947}
1948
1949/// GetBackupRequest gets the state of a backup.
1950#[derive(Clone, Default, PartialEq)]
1951#[non_exhaustive]
1952pub struct GetBackupRequest {
1953    /// Required. The backup resource name, in the format
1954    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
1955    pub name: std::string::String,
1956
1957    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1958}
1959
1960impl GetBackupRequest {
1961    /// Creates a new default instance.
1962    pub fn new() -> Self {
1963        std::default::Default::default()
1964    }
1965
1966    /// Sets the value of [name][crate::model::GetBackupRequest::name].
1967    ///
1968    /// # Example
1969    /// ```ignore,no_run
1970    /// # use google_cloud_netapp_v1::model::GetBackupRequest;
1971    /// # let project_id = "project_id";
1972    /// # let location_id = "location_id";
1973    /// # let backup_vault_id = "backup_vault_id";
1974    /// # let backup_id = "backup_id";
1975    /// let x = GetBackupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}/backups/{backup_id}"));
1976    /// ```
1977    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1978        self.name = v.into();
1979        self
1980    }
1981}
1982
1983impl wkt::message::Message for GetBackupRequest {
1984    fn typename() -> &'static str {
1985        "type.googleapis.com/google.cloud.netapp.v1.GetBackupRequest"
1986    }
1987}
1988
1989/// CreateBackupRequest creates a backup.
1990#[derive(Clone, Default, PartialEq)]
1991#[non_exhaustive]
1992pub struct CreateBackupRequest {
1993    /// Required. The NetApp backupVault to create the backups of, in the format
1994    /// `projects/*/locations/*/backupVaults/{backup_vault_id}`
1995    pub parent: std::string::String,
1996
1997    /// Required. The ID to use for the backup.
1998    /// The ID must be unique within the specified backupVault.
1999    /// Must contain only letters, numbers and hyphen, with the first
2000    /// character a letter, the last a letter or a
2001    /// number, and a 63 character maximum.
2002    pub backup_id: std::string::String,
2003
2004    /// Required. A backup resource
2005    pub backup: std::option::Option<crate::model::Backup>,
2006
2007    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2008}
2009
2010impl CreateBackupRequest {
2011    /// Creates a new default instance.
2012    pub fn new() -> Self {
2013        std::default::Default::default()
2014    }
2015
2016    /// Sets the value of [parent][crate::model::CreateBackupRequest::parent].
2017    ///
2018    /// # Example
2019    /// ```ignore,no_run
2020    /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
2021    /// # let project_id = "project_id";
2022    /// # let location_id = "location_id";
2023    /// # let backup_vault_id = "backup_vault_id";
2024    /// let x = CreateBackupRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}"));
2025    /// ```
2026    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2027        self.parent = v.into();
2028        self
2029    }
2030
2031    /// Sets the value of [backup_id][crate::model::CreateBackupRequest::backup_id].
2032    ///
2033    /// # Example
2034    /// ```ignore,no_run
2035    /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
2036    /// let x = CreateBackupRequest::new().set_backup_id("example");
2037    /// ```
2038    pub fn set_backup_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2039        self.backup_id = v.into();
2040        self
2041    }
2042
2043    /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
2044    ///
2045    /// # Example
2046    /// ```ignore,no_run
2047    /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
2048    /// use google_cloud_netapp_v1::model::Backup;
2049    /// let x = CreateBackupRequest::new().set_backup(Backup::default()/* use setters */);
2050    /// ```
2051    pub fn set_backup<T>(mut self, v: T) -> Self
2052    where
2053        T: std::convert::Into<crate::model::Backup>,
2054    {
2055        self.backup = std::option::Option::Some(v.into());
2056        self
2057    }
2058
2059    /// Sets or clears the value of [backup][crate::model::CreateBackupRequest::backup].
2060    ///
2061    /// # Example
2062    /// ```ignore,no_run
2063    /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
2064    /// use google_cloud_netapp_v1::model::Backup;
2065    /// let x = CreateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
2066    /// let x = CreateBackupRequest::new().set_or_clear_backup(None::<Backup>);
2067    /// ```
2068    pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
2069    where
2070        T: std::convert::Into<crate::model::Backup>,
2071    {
2072        self.backup = v.map(|x| x.into());
2073        self
2074    }
2075}
2076
2077impl wkt::message::Message for CreateBackupRequest {
2078    fn typename() -> &'static str {
2079        "type.googleapis.com/google.cloud.netapp.v1.CreateBackupRequest"
2080    }
2081}
2082
2083/// DeleteBackupRequest deletes a backup.
2084#[derive(Clone, Default, PartialEq)]
2085#[non_exhaustive]
2086pub struct DeleteBackupRequest {
2087    /// Required. The backup resource name, in the format
2088    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
2089    pub name: std::string::String,
2090
2091    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2092}
2093
2094impl DeleteBackupRequest {
2095    /// Creates a new default instance.
2096    pub fn new() -> Self {
2097        std::default::Default::default()
2098    }
2099
2100    /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
2101    ///
2102    /// # Example
2103    /// ```ignore,no_run
2104    /// # use google_cloud_netapp_v1::model::DeleteBackupRequest;
2105    /// # let project_id = "project_id";
2106    /// # let location_id = "location_id";
2107    /// # let backup_vault_id = "backup_vault_id";
2108    /// # let backup_id = "backup_id";
2109    /// let x = DeleteBackupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}/backups/{backup_id}"));
2110    /// ```
2111    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2112        self.name = v.into();
2113        self
2114    }
2115}
2116
2117impl wkt::message::Message for DeleteBackupRequest {
2118    fn typename() -> &'static str {
2119        "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupRequest"
2120    }
2121}
2122
2123/// UpdateBackupRequest updates description and/or labels for a backup.
2124#[derive(Clone, Default, PartialEq)]
2125#[non_exhaustive]
2126pub struct UpdateBackupRequest {
2127    /// Required. Field mask is used to specify the fields to be overwritten in the
2128    /// Backup resource to be updated.
2129    /// The fields specified in the update_mask are relative to the resource, not
2130    /// the full request. A field will be overwritten if it is in the mask. If the
2131    /// user does not provide a mask then all fields will be overwritten.
2132    pub update_mask: std::option::Option<wkt::FieldMask>,
2133
2134    /// Required. The backup being updated
2135    pub backup: std::option::Option<crate::model::Backup>,
2136
2137    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2138}
2139
2140impl UpdateBackupRequest {
2141    /// Creates a new default instance.
2142    pub fn new() -> Self {
2143        std::default::Default::default()
2144    }
2145
2146    /// Sets the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
2147    ///
2148    /// # Example
2149    /// ```ignore,no_run
2150    /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2151    /// use wkt::FieldMask;
2152    /// let x = UpdateBackupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2153    /// ```
2154    pub fn set_update_mask<T>(mut self, v: T) -> Self
2155    where
2156        T: std::convert::Into<wkt::FieldMask>,
2157    {
2158        self.update_mask = std::option::Option::Some(v.into());
2159        self
2160    }
2161
2162    /// Sets or clears the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
2163    ///
2164    /// # Example
2165    /// ```ignore,no_run
2166    /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2167    /// use wkt::FieldMask;
2168    /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2169    /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2170    /// ```
2171    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2172    where
2173        T: std::convert::Into<wkt::FieldMask>,
2174    {
2175        self.update_mask = v.map(|x| x.into());
2176        self
2177    }
2178
2179    /// Sets the value of [backup][crate::model::UpdateBackupRequest::backup].
2180    ///
2181    /// # Example
2182    /// ```ignore,no_run
2183    /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2184    /// use google_cloud_netapp_v1::model::Backup;
2185    /// let x = UpdateBackupRequest::new().set_backup(Backup::default()/* use setters */);
2186    /// ```
2187    pub fn set_backup<T>(mut self, v: T) -> Self
2188    where
2189        T: std::convert::Into<crate::model::Backup>,
2190    {
2191        self.backup = std::option::Option::Some(v.into());
2192        self
2193    }
2194
2195    /// Sets or clears the value of [backup][crate::model::UpdateBackupRequest::backup].
2196    ///
2197    /// # Example
2198    /// ```ignore,no_run
2199    /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2200    /// use google_cloud_netapp_v1::model::Backup;
2201    /// let x = UpdateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
2202    /// let x = UpdateBackupRequest::new().set_or_clear_backup(None::<Backup>);
2203    /// ```
2204    pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
2205    where
2206        T: std::convert::Into<crate::model::Backup>,
2207    {
2208        self.backup = v.map(|x| x.into());
2209        self
2210    }
2211}
2212
2213impl wkt::message::Message for UpdateBackupRequest {
2214    fn typename() -> &'static str {
2215        "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupRequest"
2216    }
2217}
2218
2219/// Backup Policy.
2220#[derive(Clone, Default, PartialEq)]
2221#[non_exhaustive]
2222pub struct BackupPolicy {
2223    /// Identifier. The resource name of the backup policy.
2224    /// Format:
2225    /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`.
2226    pub name: std::string::String,
2227
2228    /// Number of daily backups to keep. Note that the minimum daily backup limit
2229    /// is 2.
2230    pub daily_backup_limit: std::option::Option<i32>,
2231
2232    /// Number of weekly backups to keep. Note that the sum of daily, weekly and
2233    /// monthly backups should be greater than 1.
2234    pub weekly_backup_limit: std::option::Option<i32>,
2235
2236    /// Number of monthly backups to keep. Note that the sum of daily, weekly and
2237    /// monthly backups should be greater than 1.
2238    pub monthly_backup_limit: std::option::Option<i32>,
2239
2240    /// Description of the backup policy.
2241    pub description: std::option::Option<std::string::String>,
2242
2243    /// If enabled, make backups automatically according to the schedules.
2244    /// This will be applied to all volumes that have this policy attached and
2245    /// enforced on volume level. If not specified, default is true.
2246    pub enabled: std::option::Option<bool>,
2247
2248    /// Output only. The total number of volumes assigned by this backup policy.
2249    pub assigned_volume_count: std::option::Option<i32>,
2250
2251    /// Output only. The time when the backup policy was created.
2252    pub create_time: std::option::Option<wkt::Timestamp>,
2253
2254    /// Resource labels to represent user provided metadata.
2255    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2256
2257    /// Output only. The backup policy state.
2258    pub state: crate::model::backup_policy::State,
2259
2260    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2261}
2262
2263impl BackupPolicy {
2264    /// Creates a new default instance.
2265    pub fn new() -> Self {
2266        std::default::Default::default()
2267    }
2268
2269    /// Sets the value of [name][crate::model::BackupPolicy::name].
2270    ///
2271    /// # Example
2272    /// ```ignore,no_run
2273    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2274    /// # let project_id = "project_id";
2275    /// # let location_id = "location_id";
2276    /// # let backup_policy_id = "backup_policy_id";
2277    /// let x = BackupPolicy::new().set_name(format!("projects/{project_id}/locations/{location_id}/backupPolicies/{backup_policy_id}"));
2278    /// ```
2279    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2280        self.name = v.into();
2281        self
2282    }
2283
2284    /// Sets the value of [daily_backup_limit][crate::model::BackupPolicy::daily_backup_limit].
2285    ///
2286    /// # Example
2287    /// ```ignore,no_run
2288    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2289    /// let x = BackupPolicy::new().set_daily_backup_limit(42);
2290    /// ```
2291    pub fn set_daily_backup_limit<T>(mut self, v: T) -> Self
2292    where
2293        T: std::convert::Into<i32>,
2294    {
2295        self.daily_backup_limit = std::option::Option::Some(v.into());
2296        self
2297    }
2298
2299    /// Sets or clears the value of [daily_backup_limit][crate::model::BackupPolicy::daily_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_daily_backup_limit(Some(42));
2305    /// let x = BackupPolicy::new().set_or_clear_daily_backup_limit(None::<i32>);
2306    /// ```
2307    pub fn set_or_clear_daily_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2308    where
2309        T: std::convert::Into<i32>,
2310    {
2311        self.daily_backup_limit = v.map(|x| x.into());
2312        self
2313    }
2314
2315    /// Sets the value of [weekly_backup_limit][crate::model::BackupPolicy::weekly_backup_limit].
2316    ///
2317    /// # Example
2318    /// ```ignore,no_run
2319    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2320    /// let x = BackupPolicy::new().set_weekly_backup_limit(42);
2321    /// ```
2322    pub fn set_weekly_backup_limit<T>(mut self, v: T) -> Self
2323    where
2324        T: std::convert::Into<i32>,
2325    {
2326        self.weekly_backup_limit = std::option::Option::Some(v.into());
2327        self
2328    }
2329
2330    /// Sets or clears the value of [weekly_backup_limit][crate::model::BackupPolicy::weekly_backup_limit].
2331    ///
2332    /// # Example
2333    /// ```ignore,no_run
2334    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2335    /// let x = BackupPolicy::new().set_or_clear_weekly_backup_limit(Some(42));
2336    /// let x = BackupPolicy::new().set_or_clear_weekly_backup_limit(None::<i32>);
2337    /// ```
2338    pub fn set_or_clear_weekly_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2339    where
2340        T: std::convert::Into<i32>,
2341    {
2342        self.weekly_backup_limit = v.map(|x| x.into());
2343        self
2344    }
2345
2346    /// Sets the value of [monthly_backup_limit][crate::model::BackupPolicy::monthly_backup_limit].
2347    ///
2348    /// # Example
2349    /// ```ignore,no_run
2350    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2351    /// let x = BackupPolicy::new().set_monthly_backup_limit(42);
2352    /// ```
2353    pub fn set_monthly_backup_limit<T>(mut self, v: T) -> Self
2354    where
2355        T: std::convert::Into<i32>,
2356    {
2357        self.monthly_backup_limit = std::option::Option::Some(v.into());
2358        self
2359    }
2360
2361    /// Sets or clears the value of [monthly_backup_limit][crate::model::BackupPolicy::monthly_backup_limit].
2362    ///
2363    /// # Example
2364    /// ```ignore,no_run
2365    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2366    /// let x = BackupPolicy::new().set_or_clear_monthly_backup_limit(Some(42));
2367    /// let x = BackupPolicy::new().set_or_clear_monthly_backup_limit(None::<i32>);
2368    /// ```
2369    pub fn set_or_clear_monthly_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2370    where
2371        T: std::convert::Into<i32>,
2372    {
2373        self.monthly_backup_limit = v.map(|x| x.into());
2374        self
2375    }
2376
2377    /// Sets the value of [description][crate::model::BackupPolicy::description].
2378    ///
2379    /// # Example
2380    /// ```ignore,no_run
2381    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2382    /// let x = BackupPolicy::new().set_description("example");
2383    /// ```
2384    pub fn set_description<T>(mut self, v: T) -> Self
2385    where
2386        T: std::convert::Into<std::string::String>,
2387    {
2388        self.description = std::option::Option::Some(v.into());
2389        self
2390    }
2391
2392    /// Sets or clears the value of [description][crate::model::BackupPolicy::description].
2393    ///
2394    /// # Example
2395    /// ```ignore,no_run
2396    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2397    /// let x = BackupPolicy::new().set_or_clear_description(Some("example"));
2398    /// let x = BackupPolicy::new().set_or_clear_description(None::<String>);
2399    /// ```
2400    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
2401    where
2402        T: std::convert::Into<std::string::String>,
2403    {
2404        self.description = v.map(|x| x.into());
2405        self
2406    }
2407
2408    /// Sets the value of [enabled][crate::model::BackupPolicy::enabled].
2409    ///
2410    /// # Example
2411    /// ```ignore,no_run
2412    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2413    /// let x = BackupPolicy::new().set_enabled(true);
2414    /// ```
2415    pub fn set_enabled<T>(mut self, v: T) -> Self
2416    where
2417        T: std::convert::Into<bool>,
2418    {
2419        self.enabled = std::option::Option::Some(v.into());
2420        self
2421    }
2422
2423    /// Sets or clears the value of [enabled][crate::model::BackupPolicy::enabled].
2424    ///
2425    /// # Example
2426    /// ```ignore,no_run
2427    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2428    /// let x = BackupPolicy::new().set_or_clear_enabled(Some(false));
2429    /// let x = BackupPolicy::new().set_or_clear_enabled(None::<bool>);
2430    /// ```
2431    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
2432    where
2433        T: std::convert::Into<bool>,
2434    {
2435        self.enabled = v.map(|x| x.into());
2436        self
2437    }
2438
2439    /// Sets the value of [assigned_volume_count][crate::model::BackupPolicy::assigned_volume_count].
2440    ///
2441    /// # Example
2442    /// ```ignore,no_run
2443    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2444    /// let x = BackupPolicy::new().set_assigned_volume_count(42);
2445    /// ```
2446    pub fn set_assigned_volume_count<T>(mut self, v: T) -> Self
2447    where
2448        T: std::convert::Into<i32>,
2449    {
2450        self.assigned_volume_count = std::option::Option::Some(v.into());
2451        self
2452    }
2453
2454    /// Sets or clears the value of [assigned_volume_count][crate::model::BackupPolicy::assigned_volume_count].
2455    ///
2456    /// # Example
2457    /// ```ignore,no_run
2458    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2459    /// let x = BackupPolicy::new().set_or_clear_assigned_volume_count(Some(42));
2460    /// let x = BackupPolicy::new().set_or_clear_assigned_volume_count(None::<i32>);
2461    /// ```
2462    pub fn set_or_clear_assigned_volume_count<T>(mut self, v: std::option::Option<T>) -> Self
2463    where
2464        T: std::convert::Into<i32>,
2465    {
2466        self.assigned_volume_count = v.map(|x| x.into());
2467        self
2468    }
2469
2470    /// Sets the value of [create_time][crate::model::BackupPolicy::create_time].
2471    ///
2472    /// # Example
2473    /// ```ignore,no_run
2474    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2475    /// use wkt::Timestamp;
2476    /// let x = BackupPolicy::new().set_create_time(Timestamp::default()/* use setters */);
2477    /// ```
2478    pub fn set_create_time<T>(mut self, v: T) -> Self
2479    where
2480        T: std::convert::Into<wkt::Timestamp>,
2481    {
2482        self.create_time = std::option::Option::Some(v.into());
2483        self
2484    }
2485
2486    /// Sets or clears the value of [create_time][crate::model::BackupPolicy::create_time].
2487    ///
2488    /// # Example
2489    /// ```ignore,no_run
2490    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2491    /// use wkt::Timestamp;
2492    /// let x = BackupPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2493    /// let x = BackupPolicy::new().set_or_clear_create_time(None::<Timestamp>);
2494    /// ```
2495    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2496    where
2497        T: std::convert::Into<wkt::Timestamp>,
2498    {
2499        self.create_time = v.map(|x| x.into());
2500        self
2501    }
2502
2503    /// Sets the value of [labels][crate::model::BackupPolicy::labels].
2504    ///
2505    /// # Example
2506    /// ```ignore,no_run
2507    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2508    /// let x = BackupPolicy::new().set_labels([
2509    ///     ("key0", "abc"),
2510    ///     ("key1", "xyz"),
2511    /// ]);
2512    /// ```
2513    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2514    where
2515        T: std::iter::IntoIterator<Item = (K, V)>,
2516        K: std::convert::Into<std::string::String>,
2517        V: std::convert::Into<std::string::String>,
2518    {
2519        use std::iter::Iterator;
2520        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2521        self
2522    }
2523
2524    /// Sets the value of [state][crate::model::BackupPolicy::state].
2525    ///
2526    /// # Example
2527    /// ```ignore,no_run
2528    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2529    /// use google_cloud_netapp_v1::model::backup_policy::State;
2530    /// let x0 = BackupPolicy::new().set_state(State::Creating);
2531    /// let x1 = BackupPolicy::new().set_state(State::Ready);
2532    /// let x2 = BackupPolicy::new().set_state(State::Deleting);
2533    /// ```
2534    pub fn set_state<T: std::convert::Into<crate::model::backup_policy::State>>(
2535        mut self,
2536        v: T,
2537    ) -> Self {
2538        self.state = v.into();
2539        self
2540    }
2541}
2542
2543impl wkt::message::Message for BackupPolicy {
2544    fn typename() -> &'static str {
2545        "type.googleapis.com/google.cloud.netapp.v1.BackupPolicy"
2546    }
2547}
2548
2549/// Defines additional types related to [BackupPolicy].
2550pub mod backup_policy {
2551    #[allow(unused_imports)]
2552    use super::*;
2553
2554    /// Enum for [State].
2555    ///
2556    /// # Working with unknown values
2557    ///
2558    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2559    /// additional enum variants at any time. Adding new variants is not considered
2560    /// a breaking change. Applications should write their code in anticipation of:
2561    ///
2562    /// - New values appearing in future releases of the client library, **and**
2563    /// - New values received dynamically, without application changes.
2564    ///
2565    /// Please consult the [Working with enums] section in the user guide for some
2566    /// guidelines.
2567    ///
2568    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2569    #[derive(Clone, Debug, PartialEq)]
2570    #[non_exhaustive]
2571    pub enum State {
2572        /// State not set.
2573        Unspecified,
2574        /// BackupPolicy is being created.
2575        Creating,
2576        /// BackupPolicy is available for use.
2577        Ready,
2578        /// BackupPolicy is being deleted.
2579        Deleting,
2580        /// BackupPolicy is not valid and cannot be used.
2581        Error,
2582        /// BackupPolicy is being updated.
2583        Updating,
2584        /// If set, the enum was initialized with an unknown value.
2585        ///
2586        /// Applications can examine the value using [State::value] or
2587        /// [State::name].
2588        UnknownValue(state::UnknownValue),
2589    }
2590
2591    #[doc(hidden)]
2592    pub mod state {
2593        #[allow(unused_imports)]
2594        use super::*;
2595        #[derive(Clone, Debug, PartialEq)]
2596        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2597    }
2598
2599    impl State {
2600        /// Gets the enum value.
2601        ///
2602        /// Returns `None` if the enum contains an unknown value deserialized from
2603        /// the string representation of enums.
2604        pub fn value(&self) -> std::option::Option<i32> {
2605            match self {
2606                Self::Unspecified => std::option::Option::Some(0),
2607                Self::Creating => std::option::Option::Some(1),
2608                Self::Ready => std::option::Option::Some(2),
2609                Self::Deleting => std::option::Option::Some(3),
2610                Self::Error => std::option::Option::Some(4),
2611                Self::Updating => std::option::Option::Some(5),
2612                Self::UnknownValue(u) => u.0.value(),
2613            }
2614        }
2615
2616        /// Gets the enum value as a string.
2617        ///
2618        /// Returns `None` if the enum contains an unknown value deserialized from
2619        /// the integer representation of enums.
2620        pub fn name(&self) -> std::option::Option<&str> {
2621            match self {
2622                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2623                Self::Creating => std::option::Option::Some("CREATING"),
2624                Self::Ready => std::option::Option::Some("READY"),
2625                Self::Deleting => std::option::Option::Some("DELETING"),
2626                Self::Error => std::option::Option::Some("ERROR"),
2627                Self::Updating => std::option::Option::Some("UPDATING"),
2628                Self::UnknownValue(u) => u.0.name(),
2629            }
2630        }
2631    }
2632
2633    impl std::default::Default for State {
2634        fn default() -> Self {
2635            use std::convert::From;
2636            Self::from(0)
2637        }
2638    }
2639
2640    impl std::fmt::Display for State {
2641        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2642            wkt::internal::display_enum(f, self.name(), self.value())
2643        }
2644    }
2645
2646    impl std::convert::From<i32> for State {
2647        fn from(value: i32) -> Self {
2648            match value {
2649                0 => Self::Unspecified,
2650                1 => Self::Creating,
2651                2 => Self::Ready,
2652                3 => Self::Deleting,
2653                4 => Self::Error,
2654                5 => Self::Updating,
2655                _ => Self::UnknownValue(state::UnknownValue(
2656                    wkt::internal::UnknownEnumValue::Integer(value),
2657                )),
2658            }
2659        }
2660    }
2661
2662    impl std::convert::From<&str> for State {
2663        fn from(value: &str) -> Self {
2664            use std::string::ToString;
2665            match value {
2666                "STATE_UNSPECIFIED" => Self::Unspecified,
2667                "CREATING" => Self::Creating,
2668                "READY" => Self::Ready,
2669                "DELETING" => Self::Deleting,
2670                "ERROR" => Self::Error,
2671                "UPDATING" => Self::Updating,
2672                _ => Self::UnknownValue(state::UnknownValue(
2673                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2674                )),
2675            }
2676        }
2677    }
2678
2679    impl serde::ser::Serialize for State {
2680        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2681        where
2682            S: serde::Serializer,
2683        {
2684            match self {
2685                Self::Unspecified => serializer.serialize_i32(0),
2686                Self::Creating => serializer.serialize_i32(1),
2687                Self::Ready => serializer.serialize_i32(2),
2688                Self::Deleting => serializer.serialize_i32(3),
2689                Self::Error => serializer.serialize_i32(4),
2690                Self::Updating => serializer.serialize_i32(5),
2691                Self::UnknownValue(u) => u.0.serialize(serializer),
2692            }
2693        }
2694    }
2695
2696    impl<'de> serde::de::Deserialize<'de> for State {
2697        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2698        where
2699            D: serde::Deserializer<'de>,
2700        {
2701            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2702                ".google.cloud.netapp.v1.BackupPolicy.State",
2703            ))
2704        }
2705    }
2706}
2707
2708/// CreateBackupPolicyRequest creates a backupPolicy.
2709#[derive(Clone, Default, PartialEq)]
2710#[non_exhaustive]
2711pub struct CreateBackupPolicyRequest {
2712    /// Required. The location to create the backup policies of, in the format
2713    /// `projects/{project_id}/locations/{location}`
2714    pub parent: std::string::String,
2715
2716    /// Required. A backupPolicy resource
2717    pub backup_policy: std::option::Option<crate::model::BackupPolicy>,
2718
2719    /// Required. The ID to use for the backup policy.
2720    /// The ID must be unique within the specified location.
2721    /// Must contain only letters, numbers and hyphen, with the first
2722    /// character a letter, the last a letter or a
2723    /// number, and a 63 character maximum.
2724    pub backup_policy_id: std::string::String,
2725
2726    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2727}
2728
2729impl CreateBackupPolicyRequest {
2730    /// Creates a new default instance.
2731    pub fn new() -> Self {
2732        std::default::Default::default()
2733    }
2734
2735    /// Sets the value of [parent][crate::model::CreateBackupPolicyRequest::parent].
2736    ///
2737    /// # Example
2738    /// ```ignore,no_run
2739    /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2740    /// # let project_id = "project_id";
2741    /// # let location_id = "location_id";
2742    /// let x = CreateBackupPolicyRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
2743    /// ```
2744    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2745        self.parent = v.into();
2746        self
2747    }
2748
2749    /// Sets the value of [backup_policy][crate::model::CreateBackupPolicyRequest::backup_policy].
2750    ///
2751    /// # Example
2752    /// ```ignore,no_run
2753    /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2754    /// use google_cloud_netapp_v1::model::BackupPolicy;
2755    /// let x = CreateBackupPolicyRequest::new().set_backup_policy(BackupPolicy::default()/* use setters */);
2756    /// ```
2757    pub fn set_backup_policy<T>(mut self, v: T) -> Self
2758    where
2759        T: std::convert::Into<crate::model::BackupPolicy>,
2760    {
2761        self.backup_policy = std::option::Option::Some(v.into());
2762        self
2763    }
2764
2765    /// Sets or clears the value of [backup_policy][crate::model::CreateBackupPolicyRequest::backup_policy].
2766    ///
2767    /// # Example
2768    /// ```ignore,no_run
2769    /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2770    /// use google_cloud_netapp_v1::model::BackupPolicy;
2771    /// let x = CreateBackupPolicyRequest::new().set_or_clear_backup_policy(Some(BackupPolicy::default()/* use setters */));
2772    /// let x = CreateBackupPolicyRequest::new().set_or_clear_backup_policy(None::<BackupPolicy>);
2773    /// ```
2774    pub fn set_or_clear_backup_policy<T>(mut self, v: std::option::Option<T>) -> Self
2775    where
2776        T: std::convert::Into<crate::model::BackupPolicy>,
2777    {
2778        self.backup_policy = v.map(|x| x.into());
2779        self
2780    }
2781
2782    /// Sets the value of [backup_policy_id][crate::model::CreateBackupPolicyRequest::backup_policy_id].
2783    ///
2784    /// # Example
2785    /// ```ignore,no_run
2786    /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2787    /// let x = CreateBackupPolicyRequest::new().set_backup_policy_id("example");
2788    /// ```
2789    pub fn set_backup_policy_id<T: std::convert::Into<std::string::String>>(
2790        mut self,
2791        v: T,
2792    ) -> Self {
2793        self.backup_policy_id = v.into();
2794        self
2795    }
2796}
2797
2798impl wkt::message::Message for CreateBackupPolicyRequest {
2799    fn typename() -> &'static str {
2800        "type.googleapis.com/google.cloud.netapp.v1.CreateBackupPolicyRequest"
2801    }
2802}
2803
2804/// GetBackupPolicyRequest gets the state of a backupPolicy.
2805#[derive(Clone, Default, PartialEq)]
2806#[non_exhaustive]
2807pub struct GetBackupPolicyRequest {
2808    /// Required. The backupPolicy resource name, in the format
2809    /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`
2810    pub name: std::string::String,
2811
2812    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2813}
2814
2815impl GetBackupPolicyRequest {
2816    /// Creates a new default instance.
2817    pub fn new() -> Self {
2818        std::default::Default::default()
2819    }
2820
2821    /// Sets the value of [name][crate::model::GetBackupPolicyRequest::name].
2822    ///
2823    /// # Example
2824    /// ```ignore,no_run
2825    /// # use google_cloud_netapp_v1::model::GetBackupPolicyRequest;
2826    /// # let project_id = "project_id";
2827    /// # let location_id = "location_id";
2828    /// # let backup_policy_id = "backup_policy_id";
2829    /// let x = GetBackupPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/backupPolicies/{backup_policy_id}"));
2830    /// ```
2831    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2832        self.name = v.into();
2833        self
2834    }
2835}
2836
2837impl wkt::message::Message for GetBackupPolicyRequest {
2838    fn typename() -> &'static str {
2839        "type.googleapis.com/google.cloud.netapp.v1.GetBackupPolicyRequest"
2840    }
2841}
2842
2843/// ListBackupPoliciesRequest for requesting multiple backup policies.
2844#[derive(Clone, Default, PartialEq)]
2845#[non_exhaustive]
2846pub struct ListBackupPoliciesRequest {
2847    /// Required. Parent value for ListBackupPoliciesRequest
2848    pub parent: std::string::String,
2849
2850    /// Requested page size. Server may return fewer items than requested.
2851    /// If unspecified, the server will pick an appropriate default.
2852    pub page_size: i32,
2853
2854    /// A token identifying a page of results the server should return.
2855    pub page_token: std::string::String,
2856
2857    /// Filtering results
2858    pub filter: std::string::String,
2859
2860    /// Hint for how to order the results
2861    pub order_by: std::string::String,
2862
2863    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2864}
2865
2866impl ListBackupPoliciesRequest {
2867    /// Creates a new default instance.
2868    pub fn new() -> Self {
2869        std::default::Default::default()
2870    }
2871
2872    /// Sets the value of [parent][crate::model::ListBackupPoliciesRequest::parent].
2873    ///
2874    /// # Example
2875    /// ```ignore,no_run
2876    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2877    /// # let project_id = "project_id";
2878    /// # let location_id = "location_id";
2879    /// let x = ListBackupPoliciesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
2880    /// ```
2881    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2882        self.parent = v.into();
2883        self
2884    }
2885
2886    /// Sets the value of [page_size][crate::model::ListBackupPoliciesRequest::page_size].
2887    ///
2888    /// # Example
2889    /// ```ignore,no_run
2890    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2891    /// let x = ListBackupPoliciesRequest::new().set_page_size(42);
2892    /// ```
2893    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2894        self.page_size = v.into();
2895        self
2896    }
2897
2898    /// Sets the value of [page_token][crate::model::ListBackupPoliciesRequest::page_token].
2899    ///
2900    /// # Example
2901    /// ```ignore,no_run
2902    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2903    /// let x = ListBackupPoliciesRequest::new().set_page_token("example");
2904    /// ```
2905    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2906        self.page_token = v.into();
2907        self
2908    }
2909
2910    /// Sets the value of [filter][crate::model::ListBackupPoliciesRequest::filter].
2911    ///
2912    /// # Example
2913    /// ```ignore,no_run
2914    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2915    /// let x = ListBackupPoliciesRequest::new().set_filter("example");
2916    /// ```
2917    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2918        self.filter = v.into();
2919        self
2920    }
2921
2922    /// Sets the value of [order_by][crate::model::ListBackupPoliciesRequest::order_by].
2923    ///
2924    /// # Example
2925    /// ```ignore,no_run
2926    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2927    /// let x = ListBackupPoliciesRequest::new().set_order_by("example");
2928    /// ```
2929    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2930        self.order_by = v.into();
2931        self
2932    }
2933}
2934
2935impl wkt::message::Message for ListBackupPoliciesRequest {
2936    fn typename() -> &'static str {
2937        "type.googleapis.com/google.cloud.netapp.v1.ListBackupPoliciesRequest"
2938    }
2939}
2940
2941/// ListBackupPoliciesResponse contains all the backup policies requested.
2942#[derive(Clone, Default, PartialEq)]
2943#[non_exhaustive]
2944pub struct ListBackupPoliciesResponse {
2945    /// The list of backup policies.
2946    pub backup_policies: std::vec::Vec<crate::model::BackupPolicy>,
2947
2948    /// A token identifying a page of results the server should return.
2949    pub next_page_token: std::string::String,
2950
2951    /// Locations that could not be reached.
2952    pub unreachable: std::vec::Vec<std::string::String>,
2953
2954    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2955}
2956
2957impl ListBackupPoliciesResponse {
2958    /// Creates a new default instance.
2959    pub fn new() -> Self {
2960        std::default::Default::default()
2961    }
2962
2963    /// Sets the value of [backup_policies][crate::model::ListBackupPoliciesResponse::backup_policies].
2964    ///
2965    /// # Example
2966    /// ```ignore,no_run
2967    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
2968    /// use google_cloud_netapp_v1::model::BackupPolicy;
2969    /// let x = ListBackupPoliciesResponse::new()
2970    ///     .set_backup_policies([
2971    ///         BackupPolicy::default()/* use setters */,
2972    ///         BackupPolicy::default()/* use (different) setters */,
2973    ///     ]);
2974    /// ```
2975    pub fn set_backup_policies<T, V>(mut self, v: T) -> Self
2976    where
2977        T: std::iter::IntoIterator<Item = V>,
2978        V: std::convert::Into<crate::model::BackupPolicy>,
2979    {
2980        use std::iter::Iterator;
2981        self.backup_policies = v.into_iter().map(|i| i.into()).collect();
2982        self
2983    }
2984
2985    /// Sets the value of [next_page_token][crate::model::ListBackupPoliciesResponse::next_page_token].
2986    ///
2987    /// # Example
2988    /// ```ignore,no_run
2989    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
2990    /// let x = ListBackupPoliciesResponse::new().set_next_page_token("example");
2991    /// ```
2992    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2993        self.next_page_token = v.into();
2994        self
2995    }
2996
2997    /// Sets the value of [unreachable][crate::model::ListBackupPoliciesResponse::unreachable].
2998    ///
2999    /// # Example
3000    /// ```ignore,no_run
3001    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
3002    /// let x = ListBackupPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
3003    /// ```
3004    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3005    where
3006        T: std::iter::IntoIterator<Item = V>,
3007        V: std::convert::Into<std::string::String>,
3008    {
3009        use std::iter::Iterator;
3010        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3011        self
3012    }
3013}
3014
3015impl wkt::message::Message for ListBackupPoliciesResponse {
3016    fn typename() -> &'static str {
3017        "type.googleapis.com/google.cloud.netapp.v1.ListBackupPoliciesResponse"
3018    }
3019}
3020
3021#[doc(hidden)]
3022impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupPoliciesResponse {
3023    type PageItem = crate::model::BackupPolicy;
3024
3025    fn items(self) -> std::vec::Vec<Self::PageItem> {
3026        self.backup_policies
3027    }
3028
3029    fn next_page_token(&self) -> std::string::String {
3030        use std::clone::Clone;
3031        self.next_page_token.clone()
3032    }
3033}
3034
3035/// UpdateBackupPolicyRequest for updating a backup policy.
3036#[derive(Clone, Default, PartialEq)]
3037#[non_exhaustive]
3038pub struct UpdateBackupPolicyRequest {
3039    /// Required. Field mask is used to specify the fields to be overwritten in the
3040    /// Backup Policy resource by the update.
3041    /// The fields specified in the update_mask are relative to the resource, not
3042    /// the full request. A field will be overwritten if it is in the mask. If the
3043    /// user does not provide a mask then all fields will be overwritten.
3044    pub update_mask: std::option::Option<wkt::FieldMask>,
3045
3046    /// Required. The backup policy being updated
3047    pub backup_policy: std::option::Option<crate::model::BackupPolicy>,
3048
3049    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3050}
3051
3052impl UpdateBackupPolicyRequest {
3053    /// Creates a new default instance.
3054    pub fn new() -> Self {
3055        std::default::Default::default()
3056    }
3057
3058    /// Sets the value of [update_mask][crate::model::UpdateBackupPolicyRequest::update_mask].
3059    ///
3060    /// # Example
3061    /// ```ignore,no_run
3062    /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3063    /// use wkt::FieldMask;
3064    /// let x = UpdateBackupPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3065    /// ```
3066    pub fn set_update_mask<T>(mut self, v: T) -> Self
3067    where
3068        T: std::convert::Into<wkt::FieldMask>,
3069    {
3070        self.update_mask = std::option::Option::Some(v.into());
3071        self
3072    }
3073
3074    /// Sets or clears the value of [update_mask][crate::model::UpdateBackupPolicyRequest::update_mask].
3075    ///
3076    /// # Example
3077    /// ```ignore,no_run
3078    /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3079    /// use wkt::FieldMask;
3080    /// let x = UpdateBackupPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3081    /// let x = UpdateBackupPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3082    /// ```
3083    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3084    where
3085        T: std::convert::Into<wkt::FieldMask>,
3086    {
3087        self.update_mask = v.map(|x| x.into());
3088        self
3089    }
3090
3091    /// Sets the value of [backup_policy][crate::model::UpdateBackupPolicyRequest::backup_policy].
3092    ///
3093    /// # Example
3094    /// ```ignore,no_run
3095    /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3096    /// use google_cloud_netapp_v1::model::BackupPolicy;
3097    /// let x = UpdateBackupPolicyRequest::new().set_backup_policy(BackupPolicy::default()/* use setters */);
3098    /// ```
3099    pub fn set_backup_policy<T>(mut self, v: T) -> Self
3100    where
3101        T: std::convert::Into<crate::model::BackupPolicy>,
3102    {
3103        self.backup_policy = std::option::Option::Some(v.into());
3104        self
3105    }
3106
3107    /// Sets or clears the value of [backup_policy][crate::model::UpdateBackupPolicyRequest::backup_policy].
3108    ///
3109    /// # Example
3110    /// ```ignore,no_run
3111    /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3112    /// use google_cloud_netapp_v1::model::BackupPolicy;
3113    /// let x = UpdateBackupPolicyRequest::new().set_or_clear_backup_policy(Some(BackupPolicy::default()/* use setters */));
3114    /// let x = UpdateBackupPolicyRequest::new().set_or_clear_backup_policy(None::<BackupPolicy>);
3115    /// ```
3116    pub fn set_or_clear_backup_policy<T>(mut self, v: std::option::Option<T>) -> Self
3117    where
3118        T: std::convert::Into<crate::model::BackupPolicy>,
3119    {
3120        self.backup_policy = v.map(|x| x.into());
3121        self
3122    }
3123}
3124
3125impl wkt::message::Message for UpdateBackupPolicyRequest {
3126    fn typename() -> &'static str {
3127        "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupPolicyRequest"
3128    }
3129}
3130
3131/// DeleteBackupPolicyRequest deletes a backup policy.
3132#[derive(Clone, Default, PartialEq)]
3133#[non_exhaustive]
3134pub struct DeleteBackupPolicyRequest {
3135    /// Required. The backup policy resource name, in the format
3136    /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`
3137    pub name: std::string::String,
3138
3139    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3140}
3141
3142impl DeleteBackupPolicyRequest {
3143    /// Creates a new default instance.
3144    pub fn new() -> Self {
3145        std::default::Default::default()
3146    }
3147
3148    /// Sets the value of [name][crate::model::DeleteBackupPolicyRequest::name].
3149    ///
3150    /// # Example
3151    /// ```ignore,no_run
3152    /// # use google_cloud_netapp_v1::model::DeleteBackupPolicyRequest;
3153    /// # let project_id = "project_id";
3154    /// # let location_id = "location_id";
3155    /// # let backup_policy_id = "backup_policy_id";
3156    /// let x = DeleteBackupPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/backupPolicies/{backup_policy_id}"));
3157    /// ```
3158    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3159        self.name = v.into();
3160        self
3161    }
3162}
3163
3164impl wkt::message::Message for DeleteBackupPolicyRequest {
3165    fn typename() -> &'static str {
3166        "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupPolicyRequest"
3167    }
3168}
3169
3170/// A NetApp BackupVault.
3171#[derive(Clone, Default, PartialEq)]
3172#[non_exhaustive]
3173pub struct BackupVault {
3174    /// Identifier. The resource name of the backup vault.
3175    /// Format:
3176    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`.
3177    pub name: std::string::String,
3178
3179    /// Output only. The backup vault state.
3180    pub state: crate::model::backup_vault::State,
3181
3182    /// Output only. Create time of the backup vault.
3183    pub create_time: std::option::Option<wkt::Timestamp>,
3184
3185    /// Description of the backup vault.
3186    pub description: std::string::String,
3187
3188    /// Resource labels to represent user provided metadata.
3189    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3190
3191    /// Optional. Type of backup vault to be created.
3192    /// Default is IN_REGION.
3193    pub backup_vault_type: crate::model::backup_vault::BackupVaultType,
3194
3195    /// Output only. Region in which the backup vault is created.
3196    /// Format: `projects/{project_id}/locations/{location}`
3197    pub source_region: std::string::String,
3198
3199    /// Optional. Region where the backups are stored.
3200    /// Format: `projects/{project_id}/locations/{location}`
3201    pub backup_region: std::string::String,
3202
3203    /// Output only. Name of the Backup vault created in source region.
3204    /// Format:
3205    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
3206    pub source_backup_vault: std::string::String,
3207
3208    /// Output only. Name of the Backup vault created in backup region.
3209    /// Format:
3210    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
3211    pub destination_backup_vault: std::string::String,
3212
3213    /// Optional. Backup retention policy defining the retention of backups.
3214    pub backup_retention_policy:
3215        std::option::Option<crate::model::backup_vault::BackupRetentionPolicy>,
3216
3217    /// Optional. Specifies the Key Management System (KMS) configuration to be
3218    /// used for backup encryption. Format:
3219    /// `projects/{project}/locations/{location}/kmsConfigs/{kms_config}`
3220    pub kms_config: std::string::String,
3221
3222    /// Output only. Field indicating encryption state of CMEK backups.
3223    pub encryption_state: crate::model::backup_vault::EncryptionState,
3224
3225    /// Output only. The crypto key version used to encrypt the backup vault.
3226    /// Format:
3227    /// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`
3228    pub backups_crypto_key_version: std::string::String,
3229
3230    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3231}
3232
3233impl BackupVault {
3234    /// Creates a new default instance.
3235    pub fn new() -> Self {
3236        std::default::Default::default()
3237    }
3238
3239    /// Sets the value of [name][crate::model::BackupVault::name].
3240    ///
3241    /// # Example
3242    /// ```ignore,no_run
3243    /// # use google_cloud_netapp_v1::model::BackupVault;
3244    /// # let project_id = "project_id";
3245    /// # let location_id = "location_id";
3246    /// # let backup_vault_id = "backup_vault_id";
3247    /// let x = BackupVault::new().set_name(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}"));
3248    /// ```
3249    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3250        self.name = v.into();
3251        self
3252    }
3253
3254    /// Sets the value of [state][crate::model::BackupVault::state].
3255    ///
3256    /// # Example
3257    /// ```ignore,no_run
3258    /// # use google_cloud_netapp_v1::model::BackupVault;
3259    /// use google_cloud_netapp_v1::model::backup_vault::State;
3260    /// let x0 = BackupVault::new().set_state(State::Creating);
3261    /// let x1 = BackupVault::new().set_state(State::Ready);
3262    /// let x2 = BackupVault::new().set_state(State::Deleting);
3263    /// ```
3264    pub fn set_state<T: std::convert::Into<crate::model::backup_vault::State>>(
3265        mut self,
3266        v: T,
3267    ) -> Self {
3268        self.state = v.into();
3269        self
3270    }
3271
3272    /// Sets the value of [create_time][crate::model::BackupVault::create_time].
3273    ///
3274    /// # Example
3275    /// ```ignore,no_run
3276    /// # use google_cloud_netapp_v1::model::BackupVault;
3277    /// use wkt::Timestamp;
3278    /// let x = BackupVault::new().set_create_time(Timestamp::default()/* use setters */);
3279    /// ```
3280    pub fn set_create_time<T>(mut self, v: T) -> Self
3281    where
3282        T: std::convert::Into<wkt::Timestamp>,
3283    {
3284        self.create_time = std::option::Option::Some(v.into());
3285        self
3286    }
3287
3288    /// Sets or clears the value of [create_time][crate::model::BackupVault::create_time].
3289    ///
3290    /// # Example
3291    /// ```ignore,no_run
3292    /// # use google_cloud_netapp_v1::model::BackupVault;
3293    /// use wkt::Timestamp;
3294    /// let x = BackupVault::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3295    /// let x = BackupVault::new().set_or_clear_create_time(None::<Timestamp>);
3296    /// ```
3297    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3298    where
3299        T: std::convert::Into<wkt::Timestamp>,
3300    {
3301        self.create_time = v.map(|x| x.into());
3302        self
3303    }
3304
3305    /// Sets the value of [description][crate::model::BackupVault::description].
3306    ///
3307    /// # Example
3308    /// ```ignore,no_run
3309    /// # use google_cloud_netapp_v1::model::BackupVault;
3310    /// let x = BackupVault::new().set_description("example");
3311    /// ```
3312    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3313        self.description = v.into();
3314        self
3315    }
3316
3317    /// Sets the value of [labels][crate::model::BackupVault::labels].
3318    ///
3319    /// # Example
3320    /// ```ignore,no_run
3321    /// # use google_cloud_netapp_v1::model::BackupVault;
3322    /// let x = BackupVault::new().set_labels([
3323    ///     ("key0", "abc"),
3324    ///     ("key1", "xyz"),
3325    /// ]);
3326    /// ```
3327    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3328    where
3329        T: std::iter::IntoIterator<Item = (K, V)>,
3330        K: std::convert::Into<std::string::String>,
3331        V: std::convert::Into<std::string::String>,
3332    {
3333        use std::iter::Iterator;
3334        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3335        self
3336    }
3337
3338    /// Sets the value of [backup_vault_type][crate::model::BackupVault::backup_vault_type].
3339    ///
3340    /// # Example
3341    /// ```ignore,no_run
3342    /// # use google_cloud_netapp_v1::model::BackupVault;
3343    /// use google_cloud_netapp_v1::model::backup_vault::BackupVaultType;
3344    /// let x0 = BackupVault::new().set_backup_vault_type(BackupVaultType::InRegion);
3345    /// let x1 = BackupVault::new().set_backup_vault_type(BackupVaultType::CrossRegion);
3346    /// ```
3347    pub fn set_backup_vault_type<
3348        T: std::convert::Into<crate::model::backup_vault::BackupVaultType>,
3349    >(
3350        mut self,
3351        v: T,
3352    ) -> Self {
3353        self.backup_vault_type = v.into();
3354        self
3355    }
3356
3357    /// Sets the value of [source_region][crate::model::BackupVault::source_region].
3358    ///
3359    /// # Example
3360    /// ```ignore,no_run
3361    /// # use google_cloud_netapp_v1::model::BackupVault;
3362    /// let x = BackupVault::new().set_source_region("example");
3363    /// ```
3364    pub fn set_source_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3365        self.source_region = v.into();
3366        self
3367    }
3368
3369    /// Sets the value of [backup_region][crate::model::BackupVault::backup_region].
3370    ///
3371    /// # Example
3372    /// ```ignore,no_run
3373    /// # use google_cloud_netapp_v1::model::BackupVault;
3374    /// let x = BackupVault::new().set_backup_region("example");
3375    /// ```
3376    pub fn set_backup_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3377        self.backup_region = v.into();
3378        self
3379    }
3380
3381    /// Sets the value of [source_backup_vault][crate::model::BackupVault::source_backup_vault].
3382    ///
3383    /// # Example
3384    /// ```ignore,no_run
3385    /// # use google_cloud_netapp_v1::model::BackupVault;
3386    /// # let project_id = "project_id";
3387    /// # let location_id = "location_id";
3388    /// # let backup_vault_id = "backup_vault_id";
3389    /// let x = BackupVault::new().set_source_backup_vault(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}"));
3390    /// ```
3391    pub fn set_source_backup_vault<T: std::convert::Into<std::string::String>>(
3392        mut self,
3393        v: T,
3394    ) -> Self {
3395        self.source_backup_vault = v.into();
3396        self
3397    }
3398
3399    /// Sets the value of [destination_backup_vault][crate::model::BackupVault::destination_backup_vault].
3400    ///
3401    /// # Example
3402    /// ```ignore,no_run
3403    /// # use google_cloud_netapp_v1::model::BackupVault;
3404    /// # let project_id = "project_id";
3405    /// # let location_id = "location_id";
3406    /// # let backup_vault_id = "backup_vault_id";
3407    /// let x = BackupVault::new().set_destination_backup_vault(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}"));
3408    /// ```
3409    pub fn set_destination_backup_vault<T: std::convert::Into<std::string::String>>(
3410        mut self,
3411        v: T,
3412    ) -> Self {
3413        self.destination_backup_vault = v.into();
3414        self
3415    }
3416
3417    /// Sets the value of [backup_retention_policy][crate::model::BackupVault::backup_retention_policy].
3418    ///
3419    /// # Example
3420    /// ```ignore,no_run
3421    /// # use google_cloud_netapp_v1::model::BackupVault;
3422    /// use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3423    /// let x = BackupVault::new().set_backup_retention_policy(BackupRetentionPolicy::default()/* use setters */);
3424    /// ```
3425    pub fn set_backup_retention_policy<T>(mut self, v: T) -> Self
3426    where
3427        T: std::convert::Into<crate::model::backup_vault::BackupRetentionPolicy>,
3428    {
3429        self.backup_retention_policy = std::option::Option::Some(v.into());
3430        self
3431    }
3432
3433    /// Sets or clears the value of [backup_retention_policy][crate::model::BackupVault::backup_retention_policy].
3434    ///
3435    /// # Example
3436    /// ```ignore,no_run
3437    /// # use google_cloud_netapp_v1::model::BackupVault;
3438    /// use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3439    /// let x = BackupVault::new().set_or_clear_backup_retention_policy(Some(BackupRetentionPolicy::default()/* use setters */));
3440    /// let x = BackupVault::new().set_or_clear_backup_retention_policy(None::<BackupRetentionPolicy>);
3441    /// ```
3442    pub fn set_or_clear_backup_retention_policy<T>(mut self, v: std::option::Option<T>) -> Self
3443    where
3444        T: std::convert::Into<crate::model::backup_vault::BackupRetentionPolicy>,
3445    {
3446        self.backup_retention_policy = v.map(|x| x.into());
3447        self
3448    }
3449
3450    /// Sets the value of [kms_config][crate::model::BackupVault::kms_config].
3451    ///
3452    /// # Example
3453    /// ```ignore,no_run
3454    /// # use google_cloud_netapp_v1::model::BackupVault;
3455    /// # let project_id = "project_id";
3456    /// # let location_id = "location_id";
3457    /// # let kms_config_id = "kms_config_id";
3458    /// let x = BackupVault::new().set_kms_config(format!("projects/{project_id}/locations/{location_id}/kmsConfigs/{kms_config_id}"));
3459    /// ```
3460    pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3461        self.kms_config = v.into();
3462        self
3463    }
3464
3465    /// Sets the value of [encryption_state][crate::model::BackupVault::encryption_state].
3466    ///
3467    /// # Example
3468    /// ```ignore,no_run
3469    /// # use google_cloud_netapp_v1::model::BackupVault;
3470    /// use google_cloud_netapp_v1::model::backup_vault::EncryptionState;
3471    /// let x0 = BackupVault::new().set_encryption_state(EncryptionState::Pending);
3472    /// let x1 = BackupVault::new().set_encryption_state(EncryptionState::Completed);
3473    /// let x2 = BackupVault::new().set_encryption_state(EncryptionState::InProgress);
3474    /// ```
3475    pub fn set_encryption_state<
3476        T: std::convert::Into<crate::model::backup_vault::EncryptionState>,
3477    >(
3478        mut self,
3479        v: T,
3480    ) -> Self {
3481        self.encryption_state = v.into();
3482        self
3483    }
3484
3485    /// Sets the value of [backups_crypto_key_version][crate::model::BackupVault::backups_crypto_key_version].
3486    ///
3487    /// # Example
3488    /// ```ignore,no_run
3489    /// # use google_cloud_netapp_v1::model::BackupVault;
3490    /// let x = BackupVault::new().set_backups_crypto_key_version("example");
3491    /// ```
3492    pub fn set_backups_crypto_key_version<T: std::convert::Into<std::string::String>>(
3493        mut self,
3494        v: T,
3495    ) -> Self {
3496        self.backups_crypto_key_version = v.into();
3497        self
3498    }
3499}
3500
3501impl wkt::message::Message for BackupVault {
3502    fn typename() -> &'static str {
3503        "type.googleapis.com/google.cloud.netapp.v1.BackupVault"
3504    }
3505}
3506
3507/// Defines additional types related to [BackupVault].
3508pub mod backup_vault {
3509    #[allow(unused_imports)]
3510    use super::*;
3511
3512    /// Retention policy for backups in the backup vault
3513    #[derive(Clone, Default, PartialEq)]
3514    #[non_exhaustive]
3515    pub struct BackupRetentionPolicy {
3516        /// Required. Minimum retention duration in days for backups in the backup
3517        /// vault.
3518        pub backup_minimum_enforced_retention_days: i32,
3519
3520        /// Optional. Indicates if the daily backups are immutable.
3521        /// At least one of daily_backup_immutable, weekly_backup_immutable,
3522        /// monthly_backup_immutable and manual_backup_immutable must be true.
3523        pub daily_backup_immutable: bool,
3524
3525        /// Optional. Indicates if the weekly backups are immutable.
3526        /// At least one of daily_backup_immutable, weekly_backup_immutable,
3527        /// monthly_backup_immutable and manual_backup_immutable must be true.
3528        pub weekly_backup_immutable: bool,
3529
3530        /// Optional. Indicates if the monthly backups are immutable.
3531        /// At least one of daily_backup_immutable, weekly_backup_immutable,
3532        /// monthly_backup_immutable and manual_backup_immutable must be true.
3533        pub monthly_backup_immutable: bool,
3534
3535        /// Optional. Indicates if the manual backups are immutable.
3536        /// At least one of daily_backup_immutable, weekly_backup_immutable,
3537        /// monthly_backup_immutable and manual_backup_immutable must be true.
3538        pub manual_backup_immutable: bool,
3539
3540        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3541    }
3542
3543    impl BackupRetentionPolicy {
3544        /// Creates a new default instance.
3545        pub fn new() -> Self {
3546            std::default::Default::default()
3547        }
3548
3549        /// Sets the value of [backup_minimum_enforced_retention_days][crate::model::backup_vault::BackupRetentionPolicy::backup_minimum_enforced_retention_days].
3550        ///
3551        /// # Example
3552        /// ```ignore,no_run
3553        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3554        /// let x = BackupRetentionPolicy::new().set_backup_minimum_enforced_retention_days(42);
3555        /// ```
3556        pub fn set_backup_minimum_enforced_retention_days<T: std::convert::Into<i32>>(
3557            mut self,
3558            v: T,
3559        ) -> Self {
3560            self.backup_minimum_enforced_retention_days = v.into();
3561            self
3562        }
3563
3564        /// Sets the value of [daily_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::daily_backup_immutable].
3565        ///
3566        /// # Example
3567        /// ```ignore,no_run
3568        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3569        /// let x = BackupRetentionPolicy::new().set_daily_backup_immutable(true);
3570        /// ```
3571        pub fn set_daily_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3572            self.daily_backup_immutable = v.into();
3573            self
3574        }
3575
3576        /// Sets the value of [weekly_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::weekly_backup_immutable].
3577        ///
3578        /// # Example
3579        /// ```ignore,no_run
3580        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3581        /// let x = BackupRetentionPolicy::new().set_weekly_backup_immutable(true);
3582        /// ```
3583        pub fn set_weekly_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3584            self.weekly_backup_immutable = v.into();
3585            self
3586        }
3587
3588        /// Sets the value of [monthly_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::monthly_backup_immutable].
3589        ///
3590        /// # Example
3591        /// ```ignore,no_run
3592        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3593        /// let x = BackupRetentionPolicy::new().set_monthly_backup_immutable(true);
3594        /// ```
3595        pub fn set_monthly_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3596            self.monthly_backup_immutable = v.into();
3597            self
3598        }
3599
3600        /// Sets the value of [manual_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::manual_backup_immutable].
3601        ///
3602        /// # Example
3603        /// ```ignore,no_run
3604        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3605        /// let x = BackupRetentionPolicy::new().set_manual_backup_immutable(true);
3606        /// ```
3607        pub fn set_manual_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3608            self.manual_backup_immutable = v.into();
3609            self
3610        }
3611    }
3612
3613    impl wkt::message::Message for BackupRetentionPolicy {
3614        fn typename() -> &'static str {
3615            "type.googleapis.com/google.cloud.netapp.v1.BackupVault.BackupRetentionPolicy"
3616        }
3617    }
3618
3619    /// The Backup Vault States
3620    ///
3621    /// # Working with unknown values
3622    ///
3623    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3624    /// additional enum variants at any time. Adding new variants is not considered
3625    /// a breaking change. Applications should write their code in anticipation of:
3626    ///
3627    /// - New values appearing in future releases of the client library, **and**
3628    /// - New values received dynamically, without application changes.
3629    ///
3630    /// Please consult the [Working with enums] section in the user guide for some
3631    /// guidelines.
3632    ///
3633    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3634    #[derive(Clone, Debug, PartialEq)]
3635    #[non_exhaustive]
3636    pub enum State {
3637        /// State not set.
3638        Unspecified,
3639        /// BackupVault is being created.
3640        Creating,
3641        /// BackupVault is available for use.
3642        Ready,
3643        /// BackupVault is being deleted.
3644        Deleting,
3645        /// BackupVault is not valid and cannot be used.
3646        Error,
3647        /// BackupVault is being updated.
3648        Updating,
3649        /// If set, the enum was initialized with an unknown value.
3650        ///
3651        /// Applications can examine the value using [State::value] or
3652        /// [State::name].
3653        UnknownValue(state::UnknownValue),
3654    }
3655
3656    #[doc(hidden)]
3657    pub mod state {
3658        #[allow(unused_imports)]
3659        use super::*;
3660        #[derive(Clone, Debug, PartialEq)]
3661        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3662    }
3663
3664    impl State {
3665        /// Gets the enum value.
3666        ///
3667        /// Returns `None` if the enum contains an unknown value deserialized from
3668        /// the string representation of enums.
3669        pub fn value(&self) -> std::option::Option<i32> {
3670            match self {
3671                Self::Unspecified => std::option::Option::Some(0),
3672                Self::Creating => std::option::Option::Some(1),
3673                Self::Ready => std::option::Option::Some(2),
3674                Self::Deleting => std::option::Option::Some(3),
3675                Self::Error => std::option::Option::Some(4),
3676                Self::Updating => std::option::Option::Some(5),
3677                Self::UnknownValue(u) => u.0.value(),
3678            }
3679        }
3680
3681        /// Gets the enum value as a string.
3682        ///
3683        /// Returns `None` if the enum contains an unknown value deserialized from
3684        /// the integer representation of enums.
3685        pub fn name(&self) -> std::option::Option<&str> {
3686            match self {
3687                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3688                Self::Creating => std::option::Option::Some("CREATING"),
3689                Self::Ready => std::option::Option::Some("READY"),
3690                Self::Deleting => std::option::Option::Some("DELETING"),
3691                Self::Error => std::option::Option::Some("ERROR"),
3692                Self::Updating => std::option::Option::Some("UPDATING"),
3693                Self::UnknownValue(u) => u.0.name(),
3694            }
3695        }
3696    }
3697
3698    impl std::default::Default for State {
3699        fn default() -> Self {
3700            use std::convert::From;
3701            Self::from(0)
3702        }
3703    }
3704
3705    impl std::fmt::Display for State {
3706        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3707            wkt::internal::display_enum(f, self.name(), self.value())
3708        }
3709    }
3710
3711    impl std::convert::From<i32> for State {
3712        fn from(value: i32) -> Self {
3713            match value {
3714                0 => Self::Unspecified,
3715                1 => Self::Creating,
3716                2 => Self::Ready,
3717                3 => Self::Deleting,
3718                4 => Self::Error,
3719                5 => Self::Updating,
3720                _ => Self::UnknownValue(state::UnknownValue(
3721                    wkt::internal::UnknownEnumValue::Integer(value),
3722                )),
3723            }
3724        }
3725    }
3726
3727    impl std::convert::From<&str> for State {
3728        fn from(value: &str) -> Self {
3729            use std::string::ToString;
3730            match value {
3731                "STATE_UNSPECIFIED" => Self::Unspecified,
3732                "CREATING" => Self::Creating,
3733                "READY" => Self::Ready,
3734                "DELETING" => Self::Deleting,
3735                "ERROR" => Self::Error,
3736                "UPDATING" => Self::Updating,
3737                _ => Self::UnknownValue(state::UnknownValue(
3738                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3739                )),
3740            }
3741        }
3742    }
3743
3744    impl serde::ser::Serialize for State {
3745        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3746        where
3747            S: serde::Serializer,
3748        {
3749            match self {
3750                Self::Unspecified => serializer.serialize_i32(0),
3751                Self::Creating => serializer.serialize_i32(1),
3752                Self::Ready => serializer.serialize_i32(2),
3753                Self::Deleting => serializer.serialize_i32(3),
3754                Self::Error => serializer.serialize_i32(4),
3755                Self::Updating => serializer.serialize_i32(5),
3756                Self::UnknownValue(u) => u.0.serialize(serializer),
3757            }
3758        }
3759    }
3760
3761    impl<'de> serde::de::Deserialize<'de> for State {
3762        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3763        where
3764            D: serde::Deserializer<'de>,
3765        {
3766            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3767                ".google.cloud.netapp.v1.BackupVault.State",
3768            ))
3769        }
3770    }
3771
3772    /// Backup Vault Type.
3773    ///
3774    /// # Working with unknown values
3775    ///
3776    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3777    /// additional enum variants at any time. Adding new variants is not considered
3778    /// a breaking change. Applications should write their code in anticipation of:
3779    ///
3780    /// - New values appearing in future releases of the client library, **and**
3781    /// - New values received dynamically, without application changes.
3782    ///
3783    /// Please consult the [Working with enums] section in the user guide for some
3784    /// guidelines.
3785    ///
3786    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3787    #[derive(Clone, Debug, PartialEq)]
3788    #[non_exhaustive]
3789    pub enum BackupVaultType {
3790        /// BackupVault type not set.
3791        Unspecified,
3792        /// BackupVault type is IN_REGION.
3793        InRegion,
3794        /// BackupVault type is CROSS_REGION.
3795        CrossRegion,
3796        /// If set, the enum was initialized with an unknown value.
3797        ///
3798        /// Applications can examine the value using [BackupVaultType::value] or
3799        /// [BackupVaultType::name].
3800        UnknownValue(backup_vault_type::UnknownValue),
3801    }
3802
3803    #[doc(hidden)]
3804    pub mod backup_vault_type {
3805        #[allow(unused_imports)]
3806        use super::*;
3807        #[derive(Clone, Debug, PartialEq)]
3808        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3809    }
3810
3811    impl BackupVaultType {
3812        /// Gets the enum value.
3813        ///
3814        /// Returns `None` if the enum contains an unknown value deserialized from
3815        /// the string representation of enums.
3816        pub fn value(&self) -> std::option::Option<i32> {
3817            match self {
3818                Self::Unspecified => std::option::Option::Some(0),
3819                Self::InRegion => std::option::Option::Some(1),
3820                Self::CrossRegion => std::option::Option::Some(2),
3821                Self::UnknownValue(u) => u.0.value(),
3822            }
3823        }
3824
3825        /// Gets the enum value as a string.
3826        ///
3827        /// Returns `None` if the enum contains an unknown value deserialized from
3828        /// the integer representation of enums.
3829        pub fn name(&self) -> std::option::Option<&str> {
3830            match self {
3831                Self::Unspecified => std::option::Option::Some("BACKUP_VAULT_TYPE_UNSPECIFIED"),
3832                Self::InRegion => std::option::Option::Some("IN_REGION"),
3833                Self::CrossRegion => std::option::Option::Some("CROSS_REGION"),
3834                Self::UnknownValue(u) => u.0.name(),
3835            }
3836        }
3837    }
3838
3839    impl std::default::Default for BackupVaultType {
3840        fn default() -> Self {
3841            use std::convert::From;
3842            Self::from(0)
3843        }
3844    }
3845
3846    impl std::fmt::Display for BackupVaultType {
3847        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3848            wkt::internal::display_enum(f, self.name(), self.value())
3849        }
3850    }
3851
3852    impl std::convert::From<i32> for BackupVaultType {
3853        fn from(value: i32) -> Self {
3854            match value {
3855                0 => Self::Unspecified,
3856                1 => Self::InRegion,
3857                2 => Self::CrossRegion,
3858                _ => Self::UnknownValue(backup_vault_type::UnknownValue(
3859                    wkt::internal::UnknownEnumValue::Integer(value),
3860                )),
3861            }
3862        }
3863    }
3864
3865    impl std::convert::From<&str> for BackupVaultType {
3866        fn from(value: &str) -> Self {
3867            use std::string::ToString;
3868            match value {
3869                "BACKUP_VAULT_TYPE_UNSPECIFIED" => Self::Unspecified,
3870                "IN_REGION" => Self::InRegion,
3871                "CROSS_REGION" => Self::CrossRegion,
3872                _ => Self::UnknownValue(backup_vault_type::UnknownValue(
3873                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3874                )),
3875            }
3876        }
3877    }
3878
3879    impl serde::ser::Serialize for BackupVaultType {
3880        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3881        where
3882            S: serde::Serializer,
3883        {
3884            match self {
3885                Self::Unspecified => serializer.serialize_i32(0),
3886                Self::InRegion => serializer.serialize_i32(1),
3887                Self::CrossRegion => serializer.serialize_i32(2),
3888                Self::UnknownValue(u) => u.0.serialize(serializer),
3889            }
3890        }
3891    }
3892
3893    impl<'de> serde::de::Deserialize<'de> for BackupVaultType {
3894        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3895        where
3896            D: serde::Deserializer<'de>,
3897        {
3898            deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupVaultType>::new(
3899                ".google.cloud.netapp.v1.BackupVault.BackupVaultType",
3900            ))
3901        }
3902    }
3903
3904    /// Encryption state of customer-managed encryption keys (CMEK) backups.
3905    ///
3906    /// # Working with unknown values
3907    ///
3908    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3909    /// additional enum variants at any time. Adding new variants is not considered
3910    /// a breaking change. Applications should write their code in anticipation of:
3911    ///
3912    /// - New values appearing in future releases of the client library, **and**
3913    /// - New values received dynamically, without application changes.
3914    ///
3915    /// Please consult the [Working with enums] section in the user guide for some
3916    /// guidelines.
3917    ///
3918    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3919    #[derive(Clone, Debug, PartialEq)]
3920    #[non_exhaustive]
3921    pub enum EncryptionState {
3922        /// Encryption state not set.
3923        Unspecified,
3924        /// Encryption state is pending.
3925        Pending,
3926        /// Encryption is complete.
3927        Completed,
3928        /// Encryption is in progress.
3929        InProgress,
3930        /// Encryption has failed.
3931        Failed,
3932        /// If set, the enum was initialized with an unknown value.
3933        ///
3934        /// Applications can examine the value using [EncryptionState::value] or
3935        /// [EncryptionState::name].
3936        UnknownValue(encryption_state::UnknownValue),
3937    }
3938
3939    #[doc(hidden)]
3940    pub mod encryption_state {
3941        #[allow(unused_imports)]
3942        use super::*;
3943        #[derive(Clone, Debug, PartialEq)]
3944        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3945    }
3946
3947    impl EncryptionState {
3948        /// Gets the enum value.
3949        ///
3950        /// Returns `None` if the enum contains an unknown value deserialized from
3951        /// the string representation of enums.
3952        pub fn value(&self) -> std::option::Option<i32> {
3953            match self {
3954                Self::Unspecified => std::option::Option::Some(0),
3955                Self::Pending => std::option::Option::Some(1),
3956                Self::Completed => std::option::Option::Some(2),
3957                Self::InProgress => std::option::Option::Some(3),
3958                Self::Failed => std::option::Option::Some(4),
3959                Self::UnknownValue(u) => u.0.value(),
3960            }
3961        }
3962
3963        /// Gets the enum value as a string.
3964        ///
3965        /// Returns `None` if the enum contains an unknown value deserialized from
3966        /// the integer representation of enums.
3967        pub fn name(&self) -> std::option::Option<&str> {
3968            match self {
3969                Self::Unspecified => std::option::Option::Some("ENCRYPTION_STATE_UNSPECIFIED"),
3970                Self::Pending => std::option::Option::Some("ENCRYPTION_STATE_PENDING"),
3971                Self::Completed => std::option::Option::Some("ENCRYPTION_STATE_COMPLETED"),
3972                Self::InProgress => std::option::Option::Some("ENCRYPTION_STATE_IN_PROGRESS"),
3973                Self::Failed => std::option::Option::Some("ENCRYPTION_STATE_FAILED"),
3974                Self::UnknownValue(u) => u.0.name(),
3975            }
3976        }
3977    }
3978
3979    impl std::default::Default for EncryptionState {
3980        fn default() -> Self {
3981            use std::convert::From;
3982            Self::from(0)
3983        }
3984    }
3985
3986    impl std::fmt::Display for EncryptionState {
3987        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3988            wkt::internal::display_enum(f, self.name(), self.value())
3989        }
3990    }
3991
3992    impl std::convert::From<i32> for EncryptionState {
3993        fn from(value: i32) -> Self {
3994            match value {
3995                0 => Self::Unspecified,
3996                1 => Self::Pending,
3997                2 => Self::Completed,
3998                3 => Self::InProgress,
3999                4 => Self::Failed,
4000                _ => Self::UnknownValue(encryption_state::UnknownValue(
4001                    wkt::internal::UnknownEnumValue::Integer(value),
4002                )),
4003            }
4004        }
4005    }
4006
4007    impl std::convert::From<&str> for EncryptionState {
4008        fn from(value: &str) -> Self {
4009            use std::string::ToString;
4010            match value {
4011                "ENCRYPTION_STATE_UNSPECIFIED" => Self::Unspecified,
4012                "ENCRYPTION_STATE_PENDING" => Self::Pending,
4013                "ENCRYPTION_STATE_COMPLETED" => Self::Completed,
4014                "ENCRYPTION_STATE_IN_PROGRESS" => Self::InProgress,
4015                "ENCRYPTION_STATE_FAILED" => Self::Failed,
4016                _ => Self::UnknownValue(encryption_state::UnknownValue(
4017                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4018                )),
4019            }
4020        }
4021    }
4022
4023    impl serde::ser::Serialize for EncryptionState {
4024        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4025        where
4026            S: serde::Serializer,
4027        {
4028            match self {
4029                Self::Unspecified => serializer.serialize_i32(0),
4030                Self::Pending => serializer.serialize_i32(1),
4031                Self::Completed => serializer.serialize_i32(2),
4032                Self::InProgress => serializer.serialize_i32(3),
4033                Self::Failed => serializer.serialize_i32(4),
4034                Self::UnknownValue(u) => u.0.serialize(serializer),
4035            }
4036        }
4037    }
4038
4039    impl<'de> serde::de::Deserialize<'de> for EncryptionState {
4040        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4041        where
4042            D: serde::Deserializer<'de>,
4043        {
4044            deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionState>::new(
4045                ".google.cloud.netapp.v1.BackupVault.EncryptionState",
4046            ))
4047        }
4048    }
4049}
4050
4051/// GetBackupVaultRequest gets the state of a backupVault.
4052#[derive(Clone, Default, PartialEq)]
4053#[non_exhaustive]
4054pub struct GetBackupVaultRequest {
4055    /// Required. The backupVault resource name, in the format
4056    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
4057    pub name: std::string::String,
4058
4059    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4060}
4061
4062impl GetBackupVaultRequest {
4063    /// Creates a new default instance.
4064    pub fn new() -> Self {
4065        std::default::Default::default()
4066    }
4067
4068    /// Sets the value of [name][crate::model::GetBackupVaultRequest::name].
4069    ///
4070    /// # Example
4071    /// ```ignore,no_run
4072    /// # use google_cloud_netapp_v1::model::GetBackupVaultRequest;
4073    /// # let project_id = "project_id";
4074    /// # let location_id = "location_id";
4075    /// # let backup_vault_id = "backup_vault_id";
4076    /// let x = GetBackupVaultRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}"));
4077    /// ```
4078    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4079        self.name = v.into();
4080        self
4081    }
4082}
4083
4084impl wkt::message::Message for GetBackupVaultRequest {
4085    fn typename() -> &'static str {
4086        "type.googleapis.com/google.cloud.netapp.v1.GetBackupVaultRequest"
4087    }
4088}
4089
4090/// ListBackupVaultsRequest lists backupVaults.
4091#[derive(Clone, Default, PartialEq)]
4092#[non_exhaustive]
4093pub struct ListBackupVaultsRequest {
4094    /// Required. The location for which to retrieve backupVault information,
4095    /// in the format
4096    /// `projects/{project_id}/locations/{location}`.
4097    pub parent: std::string::String,
4098
4099    /// The maximum number of items to return.
4100    pub page_size: i32,
4101
4102    /// The next_page_token value to use if there are additional
4103    /// results to retrieve for this list request.
4104    pub page_token: std::string::String,
4105
4106    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
4107    pub order_by: std::string::String,
4108
4109    /// List filter.
4110    pub filter: std::string::String,
4111
4112    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4113}
4114
4115impl ListBackupVaultsRequest {
4116    /// Creates a new default instance.
4117    pub fn new() -> Self {
4118        std::default::Default::default()
4119    }
4120
4121    /// Sets the value of [parent][crate::model::ListBackupVaultsRequest::parent].
4122    ///
4123    /// # Example
4124    /// ```ignore,no_run
4125    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4126    /// # let project_id = "project_id";
4127    /// # let location_id = "location_id";
4128    /// let x = ListBackupVaultsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
4129    /// ```
4130    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4131        self.parent = v.into();
4132        self
4133    }
4134
4135    /// Sets the value of [page_size][crate::model::ListBackupVaultsRequest::page_size].
4136    ///
4137    /// # Example
4138    /// ```ignore,no_run
4139    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4140    /// let x = ListBackupVaultsRequest::new().set_page_size(42);
4141    /// ```
4142    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4143        self.page_size = v.into();
4144        self
4145    }
4146
4147    /// Sets the value of [page_token][crate::model::ListBackupVaultsRequest::page_token].
4148    ///
4149    /// # Example
4150    /// ```ignore,no_run
4151    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4152    /// let x = ListBackupVaultsRequest::new().set_page_token("example");
4153    /// ```
4154    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4155        self.page_token = v.into();
4156        self
4157    }
4158
4159    /// Sets the value of [order_by][crate::model::ListBackupVaultsRequest::order_by].
4160    ///
4161    /// # Example
4162    /// ```ignore,no_run
4163    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4164    /// let x = ListBackupVaultsRequest::new().set_order_by("example");
4165    /// ```
4166    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4167        self.order_by = v.into();
4168        self
4169    }
4170
4171    /// Sets the value of [filter][crate::model::ListBackupVaultsRequest::filter].
4172    ///
4173    /// # Example
4174    /// ```ignore,no_run
4175    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4176    /// let x = ListBackupVaultsRequest::new().set_filter("example");
4177    /// ```
4178    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4179        self.filter = v.into();
4180        self
4181    }
4182}
4183
4184impl wkt::message::Message for ListBackupVaultsRequest {
4185    fn typename() -> &'static str {
4186        "type.googleapis.com/google.cloud.netapp.v1.ListBackupVaultsRequest"
4187    }
4188}
4189
4190/// ListBackupVaultsResponse is the result of ListBackupVaultsRequest.
4191#[derive(Clone, Default, PartialEq)]
4192#[non_exhaustive]
4193pub struct ListBackupVaultsResponse {
4194    /// A list of backupVaults in the project for the specified location.
4195    pub backup_vaults: std::vec::Vec<crate::model::BackupVault>,
4196
4197    /// The token you can use to retrieve the next page of results. Not returned
4198    /// if there are no more results in the list.
4199    pub next_page_token: std::string::String,
4200
4201    /// Locations that could not be reached.
4202    pub unreachable: std::vec::Vec<std::string::String>,
4203
4204    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4205}
4206
4207impl ListBackupVaultsResponse {
4208    /// Creates a new default instance.
4209    pub fn new() -> Self {
4210        std::default::Default::default()
4211    }
4212
4213    /// Sets the value of [backup_vaults][crate::model::ListBackupVaultsResponse::backup_vaults].
4214    ///
4215    /// # Example
4216    /// ```ignore,no_run
4217    /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
4218    /// use google_cloud_netapp_v1::model::BackupVault;
4219    /// let x = ListBackupVaultsResponse::new()
4220    ///     .set_backup_vaults([
4221    ///         BackupVault::default()/* use setters */,
4222    ///         BackupVault::default()/* use (different) setters */,
4223    ///     ]);
4224    /// ```
4225    pub fn set_backup_vaults<T, V>(mut self, v: T) -> Self
4226    where
4227        T: std::iter::IntoIterator<Item = V>,
4228        V: std::convert::Into<crate::model::BackupVault>,
4229    {
4230        use std::iter::Iterator;
4231        self.backup_vaults = v.into_iter().map(|i| i.into()).collect();
4232        self
4233    }
4234
4235    /// Sets the value of [next_page_token][crate::model::ListBackupVaultsResponse::next_page_token].
4236    ///
4237    /// # Example
4238    /// ```ignore,no_run
4239    /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
4240    /// let x = ListBackupVaultsResponse::new().set_next_page_token("example");
4241    /// ```
4242    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4243        self.next_page_token = v.into();
4244        self
4245    }
4246
4247    /// Sets the value of [unreachable][crate::model::ListBackupVaultsResponse::unreachable].
4248    ///
4249    /// # Example
4250    /// ```ignore,no_run
4251    /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
4252    /// let x = ListBackupVaultsResponse::new().set_unreachable(["a", "b", "c"]);
4253    /// ```
4254    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4255    where
4256        T: std::iter::IntoIterator<Item = V>,
4257        V: std::convert::Into<std::string::String>,
4258    {
4259        use std::iter::Iterator;
4260        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4261        self
4262    }
4263}
4264
4265impl wkt::message::Message for ListBackupVaultsResponse {
4266    fn typename() -> &'static str {
4267        "type.googleapis.com/google.cloud.netapp.v1.ListBackupVaultsResponse"
4268    }
4269}
4270
4271#[doc(hidden)]
4272impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupVaultsResponse {
4273    type PageItem = crate::model::BackupVault;
4274
4275    fn items(self) -> std::vec::Vec<Self::PageItem> {
4276        self.backup_vaults
4277    }
4278
4279    fn next_page_token(&self) -> std::string::String {
4280        use std::clone::Clone;
4281        self.next_page_token.clone()
4282    }
4283}
4284
4285/// CreateBackupVaultRequest creates a backup vault.
4286#[derive(Clone, Default, PartialEq)]
4287#[non_exhaustive]
4288pub struct CreateBackupVaultRequest {
4289    /// Required. The location to create the backup vaults, in the format
4290    /// `projects/{project_id}/locations/{location}`
4291    pub parent: std::string::String,
4292
4293    /// Required. The ID to use for the backupVault.
4294    /// The ID must be unique within the specified location.
4295    /// Must contain only letters, numbers and hyphen, with the first
4296    /// character a letter, the last a letter or a
4297    /// number, and a 63 character maximum.
4298    pub backup_vault_id: std::string::String,
4299
4300    /// Required. A backupVault resource
4301    pub backup_vault: std::option::Option<crate::model::BackupVault>,
4302
4303    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4304}
4305
4306impl CreateBackupVaultRequest {
4307    /// Creates a new default instance.
4308    pub fn new() -> Self {
4309        std::default::Default::default()
4310    }
4311
4312    /// Sets the value of [parent][crate::model::CreateBackupVaultRequest::parent].
4313    ///
4314    /// # Example
4315    /// ```ignore,no_run
4316    /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4317    /// # let project_id = "project_id";
4318    /// # let location_id = "location_id";
4319    /// let x = CreateBackupVaultRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
4320    /// ```
4321    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4322        self.parent = v.into();
4323        self
4324    }
4325
4326    /// Sets the value of [backup_vault_id][crate::model::CreateBackupVaultRequest::backup_vault_id].
4327    ///
4328    /// # Example
4329    /// ```ignore,no_run
4330    /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4331    /// let x = CreateBackupVaultRequest::new().set_backup_vault_id("example");
4332    /// ```
4333    pub fn set_backup_vault_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4334        self.backup_vault_id = v.into();
4335        self
4336    }
4337
4338    /// Sets the value of [backup_vault][crate::model::CreateBackupVaultRequest::backup_vault].
4339    ///
4340    /// # Example
4341    /// ```ignore,no_run
4342    /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4343    /// use google_cloud_netapp_v1::model::BackupVault;
4344    /// let x = CreateBackupVaultRequest::new().set_backup_vault(BackupVault::default()/* use setters */);
4345    /// ```
4346    pub fn set_backup_vault<T>(mut self, v: T) -> Self
4347    where
4348        T: std::convert::Into<crate::model::BackupVault>,
4349    {
4350        self.backup_vault = std::option::Option::Some(v.into());
4351        self
4352    }
4353
4354    /// Sets or clears the value of [backup_vault][crate::model::CreateBackupVaultRequest::backup_vault].
4355    ///
4356    /// # Example
4357    /// ```ignore,no_run
4358    /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4359    /// use google_cloud_netapp_v1::model::BackupVault;
4360    /// let x = CreateBackupVaultRequest::new().set_or_clear_backup_vault(Some(BackupVault::default()/* use setters */));
4361    /// let x = CreateBackupVaultRequest::new().set_or_clear_backup_vault(None::<BackupVault>);
4362    /// ```
4363    pub fn set_or_clear_backup_vault<T>(mut self, v: std::option::Option<T>) -> Self
4364    where
4365        T: std::convert::Into<crate::model::BackupVault>,
4366    {
4367        self.backup_vault = v.map(|x| x.into());
4368        self
4369    }
4370}
4371
4372impl wkt::message::Message for CreateBackupVaultRequest {
4373    fn typename() -> &'static str {
4374        "type.googleapis.com/google.cloud.netapp.v1.CreateBackupVaultRequest"
4375    }
4376}
4377
4378/// DeleteBackupVaultRequest deletes a backupVault.
4379#[derive(Clone, Default, PartialEq)]
4380#[non_exhaustive]
4381pub struct DeleteBackupVaultRequest {
4382    /// Required. The backupVault resource name, in the format
4383    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
4384    pub name: std::string::String,
4385
4386    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4387}
4388
4389impl DeleteBackupVaultRequest {
4390    /// Creates a new default instance.
4391    pub fn new() -> Self {
4392        std::default::Default::default()
4393    }
4394
4395    /// Sets the value of [name][crate::model::DeleteBackupVaultRequest::name].
4396    ///
4397    /// # Example
4398    /// ```ignore,no_run
4399    /// # use google_cloud_netapp_v1::model::DeleteBackupVaultRequest;
4400    /// # let project_id = "project_id";
4401    /// # let location_id = "location_id";
4402    /// # let backup_vault_id = "backup_vault_id";
4403    /// let x = DeleteBackupVaultRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}"));
4404    /// ```
4405    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4406        self.name = v.into();
4407        self
4408    }
4409}
4410
4411impl wkt::message::Message for DeleteBackupVaultRequest {
4412    fn typename() -> &'static str {
4413        "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupVaultRequest"
4414    }
4415}
4416
4417/// UpdateBackupVaultRequest updates description and/or labels for a backupVault.
4418#[derive(Clone, Default, PartialEq)]
4419#[non_exhaustive]
4420pub struct UpdateBackupVaultRequest {
4421    /// Required. Field mask is used to specify the fields to be overwritten in the
4422    /// Backup resource to be updated.
4423    /// The fields specified in the update_mask are relative to the resource, not
4424    /// the full request. A field will be overwritten if it is in the mask. If the
4425    /// user does not provide a mask then all fields will be overwritten.
4426    pub update_mask: std::option::Option<wkt::FieldMask>,
4427
4428    /// Required. The backupVault being updated
4429    pub backup_vault: std::option::Option<crate::model::BackupVault>,
4430
4431    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4432}
4433
4434impl UpdateBackupVaultRequest {
4435    /// Creates a new default instance.
4436    pub fn new() -> Self {
4437        std::default::Default::default()
4438    }
4439
4440    /// Sets the value of [update_mask][crate::model::UpdateBackupVaultRequest::update_mask].
4441    ///
4442    /// # Example
4443    /// ```ignore,no_run
4444    /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4445    /// use wkt::FieldMask;
4446    /// let x = UpdateBackupVaultRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4447    /// ```
4448    pub fn set_update_mask<T>(mut self, v: T) -> Self
4449    where
4450        T: std::convert::Into<wkt::FieldMask>,
4451    {
4452        self.update_mask = std::option::Option::Some(v.into());
4453        self
4454    }
4455
4456    /// Sets or clears the value of [update_mask][crate::model::UpdateBackupVaultRequest::update_mask].
4457    ///
4458    /// # Example
4459    /// ```ignore,no_run
4460    /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4461    /// use wkt::FieldMask;
4462    /// let x = UpdateBackupVaultRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4463    /// let x = UpdateBackupVaultRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4464    /// ```
4465    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4466    where
4467        T: std::convert::Into<wkt::FieldMask>,
4468    {
4469        self.update_mask = v.map(|x| x.into());
4470        self
4471    }
4472
4473    /// Sets the value of [backup_vault][crate::model::UpdateBackupVaultRequest::backup_vault].
4474    ///
4475    /// # Example
4476    /// ```ignore,no_run
4477    /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4478    /// use google_cloud_netapp_v1::model::BackupVault;
4479    /// let x = UpdateBackupVaultRequest::new().set_backup_vault(BackupVault::default()/* use setters */);
4480    /// ```
4481    pub fn set_backup_vault<T>(mut self, v: T) -> Self
4482    where
4483        T: std::convert::Into<crate::model::BackupVault>,
4484    {
4485        self.backup_vault = std::option::Option::Some(v.into());
4486        self
4487    }
4488
4489    /// Sets or clears the value of [backup_vault][crate::model::UpdateBackupVaultRequest::backup_vault].
4490    ///
4491    /// # Example
4492    /// ```ignore,no_run
4493    /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4494    /// use google_cloud_netapp_v1::model::BackupVault;
4495    /// let x = UpdateBackupVaultRequest::new().set_or_clear_backup_vault(Some(BackupVault::default()/* use setters */));
4496    /// let x = UpdateBackupVaultRequest::new().set_or_clear_backup_vault(None::<BackupVault>);
4497    /// ```
4498    pub fn set_or_clear_backup_vault<T>(mut self, v: std::option::Option<T>) -> Self
4499    where
4500        T: std::convert::Into<crate::model::BackupVault>,
4501    {
4502        self.backup_vault = v.map(|x| x.into());
4503        self
4504    }
4505}
4506
4507impl wkt::message::Message for UpdateBackupVaultRequest {
4508    fn typename() -> &'static str {
4509        "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupVaultRequest"
4510    }
4511}
4512
4513/// Represents the metadata of the long-running operation.
4514#[derive(Clone, Default, PartialEq)]
4515#[non_exhaustive]
4516pub struct OperationMetadata {
4517    /// Output only. The time the operation was created.
4518    pub create_time: std::option::Option<wkt::Timestamp>,
4519
4520    /// Output only. The time the operation finished running.
4521    pub end_time: std::option::Option<wkt::Timestamp>,
4522
4523    /// Output only. Server-defined resource path for the target of the operation.
4524    pub target: std::string::String,
4525
4526    /// Output only. Name of the verb executed by the operation.
4527    pub verb: std::string::String,
4528
4529    /// Output only. Human-readable status of the operation, if any.
4530    pub status_message: std::string::String,
4531
4532    /// Output only. Identifies whether the user has requested cancellation
4533    /// of the operation. Operations that have been canceled successfully
4534    /// have [Operation.error][] value with a
4535    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
4536    /// `Code.CANCELLED`.
4537    pub requested_cancellation: bool,
4538
4539    /// Output only. API version used to start the operation.
4540    pub api_version: std::string::String,
4541
4542    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4543}
4544
4545impl OperationMetadata {
4546    /// Creates a new default instance.
4547    pub fn new() -> Self {
4548        std::default::Default::default()
4549    }
4550
4551    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
4552    ///
4553    /// # Example
4554    /// ```ignore,no_run
4555    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4556    /// use wkt::Timestamp;
4557    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
4558    /// ```
4559    pub fn set_create_time<T>(mut self, v: T) -> Self
4560    where
4561        T: std::convert::Into<wkt::Timestamp>,
4562    {
4563        self.create_time = std::option::Option::Some(v.into());
4564        self
4565    }
4566
4567    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
4568    ///
4569    /// # Example
4570    /// ```ignore,no_run
4571    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4572    /// use wkt::Timestamp;
4573    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4574    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
4575    /// ```
4576    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4577    where
4578        T: std::convert::Into<wkt::Timestamp>,
4579    {
4580        self.create_time = v.map(|x| x.into());
4581        self
4582    }
4583
4584    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
4585    ///
4586    /// # Example
4587    /// ```ignore,no_run
4588    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4589    /// use wkt::Timestamp;
4590    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
4591    /// ```
4592    pub fn set_end_time<T>(mut self, v: T) -> Self
4593    where
4594        T: std::convert::Into<wkt::Timestamp>,
4595    {
4596        self.end_time = std::option::Option::Some(v.into());
4597        self
4598    }
4599
4600    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
4601    ///
4602    /// # Example
4603    /// ```ignore,no_run
4604    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4605    /// use wkt::Timestamp;
4606    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
4607    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
4608    /// ```
4609    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4610    where
4611        T: std::convert::Into<wkt::Timestamp>,
4612    {
4613        self.end_time = v.map(|x| x.into());
4614        self
4615    }
4616
4617    /// Sets the value of [target][crate::model::OperationMetadata::target].
4618    ///
4619    /// # Example
4620    /// ```ignore,no_run
4621    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4622    /// let x = OperationMetadata::new().set_target("example");
4623    /// ```
4624    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4625        self.target = v.into();
4626        self
4627    }
4628
4629    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
4630    ///
4631    /// # Example
4632    /// ```ignore,no_run
4633    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4634    /// let x = OperationMetadata::new().set_verb("example");
4635    /// ```
4636    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4637        self.verb = v.into();
4638        self
4639    }
4640
4641    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
4642    ///
4643    /// # Example
4644    /// ```ignore,no_run
4645    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4646    /// let x = OperationMetadata::new().set_status_message("example");
4647    /// ```
4648    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4649        self.status_message = v.into();
4650        self
4651    }
4652
4653    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
4654    ///
4655    /// # Example
4656    /// ```ignore,no_run
4657    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4658    /// let x = OperationMetadata::new().set_requested_cancellation(true);
4659    /// ```
4660    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4661        self.requested_cancellation = v.into();
4662        self
4663    }
4664
4665    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
4666    ///
4667    /// # Example
4668    /// ```ignore,no_run
4669    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4670    /// let x = OperationMetadata::new().set_api_version("example");
4671    /// ```
4672    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4673        self.api_version = v.into();
4674        self
4675    }
4676}
4677
4678impl wkt::message::Message for OperationMetadata {
4679    fn typename() -> &'static str {
4680        "type.googleapis.com/google.cloud.netapp.v1.OperationMetadata"
4681    }
4682}
4683
4684/// Metadata for a given
4685/// [google.cloud.location.Location][google.cloud.location.Location].
4686///
4687/// [google.cloud.location.Location]: google_cloud_location::model::Location
4688#[derive(Clone, Default, PartialEq)]
4689#[non_exhaustive]
4690pub struct LocationMetadata {
4691    /// Output only. Supported service levels in a location.
4692    pub supported_service_levels: std::vec::Vec<crate::model::ServiceLevel>,
4693
4694    /// Output only. Supported flex performance in a location.
4695    pub supported_flex_performance: std::vec::Vec<crate::model::FlexPerformance>,
4696
4697    /// Output only. Indicates if the location has VCP support.
4698    pub has_vcp: bool,
4699
4700    /// Output only. Indicates if the location has ONTAP Proxy support.
4701    pub has_ontap_proxy: bool,
4702
4703    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4704}
4705
4706impl LocationMetadata {
4707    /// Creates a new default instance.
4708    pub fn new() -> Self {
4709        std::default::Default::default()
4710    }
4711
4712    /// Sets the value of [supported_service_levels][crate::model::LocationMetadata::supported_service_levels].
4713    ///
4714    /// # Example
4715    /// ```ignore,no_run
4716    /// # use google_cloud_netapp_v1::model::LocationMetadata;
4717    /// use google_cloud_netapp_v1::model::ServiceLevel;
4718    /// let x = LocationMetadata::new().set_supported_service_levels([
4719    ///     ServiceLevel::Premium,
4720    ///     ServiceLevel::Extreme,
4721    ///     ServiceLevel::Standard,
4722    /// ]);
4723    /// ```
4724    pub fn set_supported_service_levels<T, V>(mut self, v: T) -> Self
4725    where
4726        T: std::iter::IntoIterator<Item = V>,
4727        V: std::convert::Into<crate::model::ServiceLevel>,
4728    {
4729        use std::iter::Iterator;
4730        self.supported_service_levels = v.into_iter().map(|i| i.into()).collect();
4731        self
4732    }
4733
4734    /// Sets the value of [supported_flex_performance][crate::model::LocationMetadata::supported_flex_performance].
4735    ///
4736    /// # Example
4737    /// ```ignore,no_run
4738    /// # use google_cloud_netapp_v1::model::LocationMetadata;
4739    /// use google_cloud_netapp_v1::model::FlexPerformance;
4740    /// let x = LocationMetadata::new().set_supported_flex_performance([
4741    ///     FlexPerformance::Default,
4742    ///     FlexPerformance::Custom,
4743    /// ]);
4744    /// ```
4745    pub fn set_supported_flex_performance<T, V>(mut self, v: T) -> Self
4746    where
4747        T: std::iter::IntoIterator<Item = V>,
4748        V: std::convert::Into<crate::model::FlexPerformance>,
4749    {
4750        use std::iter::Iterator;
4751        self.supported_flex_performance = v.into_iter().map(|i| i.into()).collect();
4752        self
4753    }
4754
4755    /// Sets the value of [has_vcp][crate::model::LocationMetadata::has_vcp].
4756    ///
4757    /// # Example
4758    /// ```ignore,no_run
4759    /// # use google_cloud_netapp_v1::model::LocationMetadata;
4760    /// let x = LocationMetadata::new().set_has_vcp(true);
4761    /// ```
4762    pub fn set_has_vcp<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4763        self.has_vcp = v.into();
4764        self
4765    }
4766
4767    /// Sets the value of [has_ontap_proxy][crate::model::LocationMetadata::has_ontap_proxy].
4768    ///
4769    /// # Example
4770    /// ```ignore,no_run
4771    /// # use google_cloud_netapp_v1::model::LocationMetadata;
4772    /// let x = LocationMetadata::new().set_has_ontap_proxy(true);
4773    /// ```
4774    pub fn set_has_ontap_proxy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4775        self.has_ontap_proxy = v.into();
4776        self
4777    }
4778}
4779
4780impl wkt::message::Message for LocationMetadata {
4781    fn typename() -> &'static str {
4782        "type.googleapis.com/google.cloud.netapp.v1.LocationMetadata"
4783    }
4784}
4785
4786/// UserCommands contains the commands to be executed by the customer.
4787#[derive(Clone, Default, PartialEq)]
4788#[non_exhaustive]
4789pub struct UserCommands {
4790    /// Output only. List of commands to be executed by the customer.
4791    pub commands: std::vec::Vec<std::string::String>,
4792
4793    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4794}
4795
4796impl UserCommands {
4797    /// Creates a new default instance.
4798    pub fn new() -> Self {
4799        std::default::Default::default()
4800    }
4801
4802    /// Sets the value of [commands][crate::model::UserCommands::commands].
4803    ///
4804    /// # Example
4805    /// ```ignore,no_run
4806    /// # use google_cloud_netapp_v1::model::UserCommands;
4807    /// let x = UserCommands::new().set_commands(["a", "b", "c"]);
4808    /// ```
4809    pub fn set_commands<T, V>(mut self, v: T) -> Self
4810    where
4811        T: std::iter::IntoIterator<Item = V>,
4812        V: std::convert::Into<std::string::String>,
4813    {
4814        use std::iter::Iterator;
4815        self.commands = v.into_iter().map(|i| i.into()).collect();
4816        self
4817    }
4818}
4819
4820impl wkt::message::Message for UserCommands {
4821    fn typename() -> &'static str {
4822        "type.googleapis.com/google.cloud.netapp.v1.UserCommands"
4823    }
4824}
4825
4826/// ListHostGroupsRequest for listing host groups.
4827#[derive(Clone, Default, PartialEq)]
4828#[non_exhaustive]
4829pub struct ListHostGroupsRequest {
4830    /// Required. Parent value for ListHostGroupsRequest
4831    pub parent: std::string::String,
4832
4833    /// Optional. Requested page size. Server may return fewer items than
4834    /// requested. If unspecified, the server will pick an appropriate default.
4835    pub page_size: i32,
4836
4837    /// Optional. A token identifying a page of results the server should return.
4838    pub page_token: std::string::String,
4839
4840    /// Optional. Filter to apply to the request.
4841    pub filter: std::string::String,
4842
4843    /// Optional. Hint for how to order the results
4844    pub order_by: std::string::String,
4845
4846    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4847}
4848
4849impl ListHostGroupsRequest {
4850    /// Creates a new default instance.
4851    pub fn new() -> Self {
4852        std::default::Default::default()
4853    }
4854
4855    /// Sets the value of [parent][crate::model::ListHostGroupsRequest::parent].
4856    ///
4857    /// # Example
4858    /// ```ignore,no_run
4859    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4860    /// # let project_id = "project_id";
4861    /// # let location_id = "location_id";
4862    /// let x = ListHostGroupsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
4863    /// ```
4864    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4865        self.parent = v.into();
4866        self
4867    }
4868
4869    /// Sets the value of [page_size][crate::model::ListHostGroupsRequest::page_size].
4870    ///
4871    /// # Example
4872    /// ```ignore,no_run
4873    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4874    /// let x = ListHostGroupsRequest::new().set_page_size(42);
4875    /// ```
4876    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4877        self.page_size = v.into();
4878        self
4879    }
4880
4881    /// Sets the value of [page_token][crate::model::ListHostGroupsRequest::page_token].
4882    ///
4883    /// # Example
4884    /// ```ignore,no_run
4885    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4886    /// let x = ListHostGroupsRequest::new().set_page_token("example");
4887    /// ```
4888    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4889        self.page_token = v.into();
4890        self
4891    }
4892
4893    /// Sets the value of [filter][crate::model::ListHostGroupsRequest::filter].
4894    ///
4895    /// # Example
4896    /// ```ignore,no_run
4897    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4898    /// let x = ListHostGroupsRequest::new().set_filter("example");
4899    /// ```
4900    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4901        self.filter = v.into();
4902        self
4903    }
4904
4905    /// Sets the value of [order_by][crate::model::ListHostGroupsRequest::order_by].
4906    ///
4907    /// # Example
4908    /// ```ignore,no_run
4909    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4910    /// let x = ListHostGroupsRequest::new().set_order_by("example");
4911    /// ```
4912    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4913        self.order_by = v.into();
4914        self
4915    }
4916}
4917
4918impl wkt::message::Message for ListHostGroupsRequest {
4919    fn typename() -> &'static str {
4920        "type.googleapis.com/google.cloud.netapp.v1.ListHostGroupsRequest"
4921    }
4922}
4923
4924/// ListHostGroupsResponse is the response to a ListHostGroupsRequest.
4925#[derive(Clone, Default, PartialEq)]
4926#[non_exhaustive]
4927pub struct ListHostGroupsResponse {
4928    /// The list of host groups.
4929    pub host_groups: std::vec::Vec<crate::model::HostGroup>,
4930
4931    /// A token identifying a page of results the server should return.
4932    pub next_page_token: std::string::String,
4933
4934    /// Locations that could not be reached.
4935    pub unreachable: std::vec::Vec<std::string::String>,
4936
4937    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4938}
4939
4940impl ListHostGroupsResponse {
4941    /// Creates a new default instance.
4942    pub fn new() -> Self {
4943        std::default::Default::default()
4944    }
4945
4946    /// Sets the value of [host_groups][crate::model::ListHostGroupsResponse::host_groups].
4947    ///
4948    /// # Example
4949    /// ```ignore,no_run
4950    /// # use google_cloud_netapp_v1::model::ListHostGroupsResponse;
4951    /// use google_cloud_netapp_v1::model::HostGroup;
4952    /// let x = ListHostGroupsResponse::new()
4953    ///     .set_host_groups([
4954    ///         HostGroup::default()/* use setters */,
4955    ///         HostGroup::default()/* use (different) setters */,
4956    ///     ]);
4957    /// ```
4958    pub fn set_host_groups<T, V>(mut self, v: T) -> Self
4959    where
4960        T: std::iter::IntoIterator<Item = V>,
4961        V: std::convert::Into<crate::model::HostGroup>,
4962    {
4963        use std::iter::Iterator;
4964        self.host_groups = v.into_iter().map(|i| i.into()).collect();
4965        self
4966    }
4967
4968    /// Sets the value of [next_page_token][crate::model::ListHostGroupsResponse::next_page_token].
4969    ///
4970    /// # Example
4971    /// ```ignore,no_run
4972    /// # use google_cloud_netapp_v1::model::ListHostGroupsResponse;
4973    /// let x = ListHostGroupsResponse::new().set_next_page_token("example");
4974    /// ```
4975    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4976        self.next_page_token = v.into();
4977        self
4978    }
4979
4980    /// Sets the value of [unreachable][crate::model::ListHostGroupsResponse::unreachable].
4981    ///
4982    /// # Example
4983    /// ```ignore,no_run
4984    /// # use google_cloud_netapp_v1::model::ListHostGroupsResponse;
4985    /// let x = ListHostGroupsResponse::new().set_unreachable(["a", "b", "c"]);
4986    /// ```
4987    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4988    where
4989        T: std::iter::IntoIterator<Item = V>,
4990        V: std::convert::Into<std::string::String>,
4991    {
4992        use std::iter::Iterator;
4993        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4994        self
4995    }
4996}
4997
4998impl wkt::message::Message for ListHostGroupsResponse {
4999    fn typename() -> &'static str {
5000        "type.googleapis.com/google.cloud.netapp.v1.ListHostGroupsResponse"
5001    }
5002}
5003
5004#[doc(hidden)]
5005impl google_cloud_gax::paginator::internal::PageableResponse for ListHostGroupsResponse {
5006    type PageItem = crate::model::HostGroup;
5007
5008    fn items(self) -> std::vec::Vec<Self::PageItem> {
5009        self.host_groups
5010    }
5011
5012    fn next_page_token(&self) -> std::string::String {
5013        use std::clone::Clone;
5014        self.next_page_token.clone()
5015    }
5016}
5017
5018/// GetHostGroupRequest for getting a host group.
5019#[derive(Clone, Default, PartialEq)]
5020#[non_exhaustive]
5021pub struct GetHostGroupRequest {
5022    /// Required. The resource name of the host group.
5023    /// Format:
5024    /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5025    pub name: std::string::String,
5026
5027    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5028}
5029
5030impl GetHostGroupRequest {
5031    /// Creates a new default instance.
5032    pub fn new() -> Self {
5033        std::default::Default::default()
5034    }
5035
5036    /// Sets the value of [name][crate::model::GetHostGroupRequest::name].
5037    ///
5038    /// # Example
5039    /// ```ignore,no_run
5040    /// # use google_cloud_netapp_v1::model::GetHostGroupRequest;
5041    /// # let project_id = "project_id";
5042    /// # let location_id = "location_id";
5043    /// # let host_group_id = "host_group_id";
5044    /// let x = GetHostGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/hostGroups/{host_group_id}"));
5045    /// ```
5046    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5047        self.name = v.into();
5048        self
5049    }
5050}
5051
5052impl wkt::message::Message for GetHostGroupRequest {
5053    fn typename() -> &'static str {
5054        "type.googleapis.com/google.cloud.netapp.v1.GetHostGroupRequest"
5055    }
5056}
5057
5058/// CreateHostGroupRequest for creating a host group.
5059#[derive(Clone, Default, PartialEq)]
5060#[non_exhaustive]
5061pub struct CreateHostGroupRequest {
5062    /// Required. Parent value for CreateHostGroupRequest
5063    pub parent: std::string::String,
5064
5065    /// Required. Fields of the host group to create.
5066    pub host_group: std::option::Option<crate::model::HostGroup>,
5067
5068    /// Required. ID of the host group to create. Must be unique within the parent
5069    /// resource. Must contain only letters, numbers, and hyphen, with
5070    /// the first character a letter or underscore, the last a letter or underscore
5071    /// or a number, and a 63 character maximum.
5072    pub host_group_id: std::string::String,
5073
5074    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5075}
5076
5077impl CreateHostGroupRequest {
5078    /// Creates a new default instance.
5079    pub fn new() -> Self {
5080        std::default::Default::default()
5081    }
5082
5083    /// Sets the value of [parent][crate::model::CreateHostGroupRequest::parent].
5084    ///
5085    /// # Example
5086    /// ```ignore,no_run
5087    /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
5088    /// # let project_id = "project_id";
5089    /// # let location_id = "location_id";
5090    /// let x = CreateHostGroupRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
5091    /// ```
5092    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5093        self.parent = v.into();
5094        self
5095    }
5096
5097    /// Sets the value of [host_group][crate::model::CreateHostGroupRequest::host_group].
5098    ///
5099    /// # Example
5100    /// ```ignore,no_run
5101    /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
5102    /// use google_cloud_netapp_v1::model::HostGroup;
5103    /// let x = CreateHostGroupRequest::new().set_host_group(HostGroup::default()/* use setters */);
5104    /// ```
5105    pub fn set_host_group<T>(mut self, v: T) -> Self
5106    where
5107        T: std::convert::Into<crate::model::HostGroup>,
5108    {
5109        self.host_group = std::option::Option::Some(v.into());
5110        self
5111    }
5112
5113    /// Sets or clears the value of [host_group][crate::model::CreateHostGroupRequest::host_group].
5114    ///
5115    /// # Example
5116    /// ```ignore,no_run
5117    /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
5118    /// use google_cloud_netapp_v1::model::HostGroup;
5119    /// let x = CreateHostGroupRequest::new().set_or_clear_host_group(Some(HostGroup::default()/* use setters */));
5120    /// let x = CreateHostGroupRequest::new().set_or_clear_host_group(None::<HostGroup>);
5121    /// ```
5122    pub fn set_or_clear_host_group<T>(mut self, v: std::option::Option<T>) -> Self
5123    where
5124        T: std::convert::Into<crate::model::HostGroup>,
5125    {
5126        self.host_group = v.map(|x| x.into());
5127        self
5128    }
5129
5130    /// Sets the value of [host_group_id][crate::model::CreateHostGroupRequest::host_group_id].
5131    ///
5132    /// # Example
5133    /// ```ignore,no_run
5134    /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
5135    /// let x = CreateHostGroupRequest::new().set_host_group_id("example");
5136    /// ```
5137    pub fn set_host_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5138        self.host_group_id = v.into();
5139        self
5140    }
5141}
5142
5143impl wkt::message::Message for CreateHostGroupRequest {
5144    fn typename() -> &'static str {
5145        "type.googleapis.com/google.cloud.netapp.v1.CreateHostGroupRequest"
5146    }
5147}
5148
5149/// UpdateHostGroupRequest for updating a host group.
5150#[derive(Clone, Default, PartialEq)]
5151#[non_exhaustive]
5152pub struct UpdateHostGroupRequest {
5153    /// Required. The host group to update.
5154    /// The host group's `name` field is used to identify the host group.
5155    /// Format:
5156    /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5157    pub host_group: std::option::Option<crate::model::HostGroup>,
5158
5159    /// Optional. The list of fields to update.
5160    pub update_mask: std::option::Option<wkt::FieldMask>,
5161
5162    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5163}
5164
5165impl UpdateHostGroupRequest {
5166    /// Creates a new default instance.
5167    pub fn new() -> Self {
5168        std::default::Default::default()
5169    }
5170
5171    /// Sets the value of [host_group][crate::model::UpdateHostGroupRequest::host_group].
5172    ///
5173    /// # Example
5174    /// ```ignore,no_run
5175    /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5176    /// use google_cloud_netapp_v1::model::HostGroup;
5177    /// let x = UpdateHostGroupRequest::new().set_host_group(HostGroup::default()/* use setters */);
5178    /// ```
5179    pub fn set_host_group<T>(mut self, v: T) -> Self
5180    where
5181        T: std::convert::Into<crate::model::HostGroup>,
5182    {
5183        self.host_group = std::option::Option::Some(v.into());
5184        self
5185    }
5186
5187    /// Sets or clears the value of [host_group][crate::model::UpdateHostGroupRequest::host_group].
5188    ///
5189    /// # Example
5190    /// ```ignore,no_run
5191    /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5192    /// use google_cloud_netapp_v1::model::HostGroup;
5193    /// let x = UpdateHostGroupRequest::new().set_or_clear_host_group(Some(HostGroup::default()/* use setters */));
5194    /// let x = UpdateHostGroupRequest::new().set_or_clear_host_group(None::<HostGroup>);
5195    /// ```
5196    pub fn set_or_clear_host_group<T>(mut self, v: std::option::Option<T>) -> Self
5197    where
5198        T: std::convert::Into<crate::model::HostGroup>,
5199    {
5200        self.host_group = v.map(|x| x.into());
5201        self
5202    }
5203
5204    /// Sets the value of [update_mask][crate::model::UpdateHostGroupRequest::update_mask].
5205    ///
5206    /// # Example
5207    /// ```ignore,no_run
5208    /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5209    /// use wkt::FieldMask;
5210    /// let x = UpdateHostGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5211    /// ```
5212    pub fn set_update_mask<T>(mut self, v: T) -> Self
5213    where
5214        T: std::convert::Into<wkt::FieldMask>,
5215    {
5216        self.update_mask = std::option::Option::Some(v.into());
5217        self
5218    }
5219
5220    /// Sets or clears the value of [update_mask][crate::model::UpdateHostGroupRequest::update_mask].
5221    ///
5222    /// # Example
5223    /// ```ignore,no_run
5224    /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5225    /// use wkt::FieldMask;
5226    /// let x = UpdateHostGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5227    /// let x = UpdateHostGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5228    /// ```
5229    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5230    where
5231        T: std::convert::Into<wkt::FieldMask>,
5232    {
5233        self.update_mask = v.map(|x| x.into());
5234        self
5235    }
5236}
5237
5238impl wkt::message::Message for UpdateHostGroupRequest {
5239    fn typename() -> &'static str {
5240        "type.googleapis.com/google.cloud.netapp.v1.UpdateHostGroupRequest"
5241    }
5242}
5243
5244/// DeleteHostGroupRequest for deleting a single host group.
5245#[derive(Clone, Default, PartialEq)]
5246#[non_exhaustive]
5247pub struct DeleteHostGroupRequest {
5248    /// Required. The resource name of the host group.
5249    /// Format:
5250    /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5251    pub name: std::string::String,
5252
5253    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5254}
5255
5256impl DeleteHostGroupRequest {
5257    /// Creates a new default instance.
5258    pub fn new() -> Self {
5259        std::default::Default::default()
5260    }
5261
5262    /// Sets the value of [name][crate::model::DeleteHostGroupRequest::name].
5263    ///
5264    /// # Example
5265    /// ```ignore,no_run
5266    /// # use google_cloud_netapp_v1::model::DeleteHostGroupRequest;
5267    /// # let project_id = "project_id";
5268    /// # let location_id = "location_id";
5269    /// # let host_group_id = "host_group_id";
5270    /// let x = DeleteHostGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/hostGroups/{host_group_id}"));
5271    /// ```
5272    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5273        self.name = v.into();
5274        self
5275    }
5276}
5277
5278impl wkt::message::Message for DeleteHostGroupRequest {
5279    fn typename() -> &'static str {
5280        "type.googleapis.com/google.cloud.netapp.v1.DeleteHostGroupRequest"
5281    }
5282}
5283
5284/// Host group is a collection of hosts that can be used for accessing a Block
5285/// Volume.
5286#[derive(Clone, Default, PartialEq)]
5287#[non_exhaustive]
5288pub struct HostGroup {
5289    /// Identifier. The resource name of the host group.
5290    /// Format:
5291    /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5292    pub name: std::string::String,
5293
5294    /// Required. Type of the host group.
5295    pub r#type: crate::model::host_group::Type,
5296
5297    /// Output only. State of the host group.
5298    pub state: crate::model::host_group::State,
5299
5300    /// Output only. Create time of the host group.
5301    pub create_time: std::option::Option<wkt::Timestamp>,
5302
5303    /// Required. The list of hosts associated with the host group.
5304    pub hosts: std::vec::Vec<std::string::String>,
5305
5306    /// Required. The OS type of the host group. It indicates the type of operating
5307    /// system used by all of the hosts in the HostGroup. All hosts in a HostGroup
5308    /// must be of the same OS type. This can be set only when creating a
5309    /// HostGroup.
5310    pub os_type: crate::model::OsType,
5311
5312    /// Optional. Description of the host group.
5313    pub description: std::string::String,
5314
5315    /// Optional. Labels of the host group.
5316    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5317
5318    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5319}
5320
5321impl HostGroup {
5322    /// Creates a new default instance.
5323    pub fn new() -> Self {
5324        std::default::Default::default()
5325    }
5326
5327    /// Sets the value of [name][crate::model::HostGroup::name].
5328    ///
5329    /// # Example
5330    /// ```ignore,no_run
5331    /// # use google_cloud_netapp_v1::model::HostGroup;
5332    /// # let project_id = "project_id";
5333    /// # let location_id = "location_id";
5334    /// # let host_group_id = "host_group_id";
5335    /// let x = HostGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/hostGroups/{host_group_id}"));
5336    /// ```
5337    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5338        self.name = v.into();
5339        self
5340    }
5341
5342    /// Sets the value of [r#type][crate::model::HostGroup::type].
5343    ///
5344    /// # Example
5345    /// ```ignore,no_run
5346    /// # use google_cloud_netapp_v1::model::HostGroup;
5347    /// use google_cloud_netapp_v1::model::host_group::Type;
5348    /// let x0 = HostGroup::new().set_type(Type::IscsiInitiator);
5349    /// ```
5350    pub fn set_type<T: std::convert::Into<crate::model::host_group::Type>>(mut self, v: T) -> Self {
5351        self.r#type = v.into();
5352        self
5353    }
5354
5355    /// Sets the value of [state][crate::model::HostGroup::state].
5356    ///
5357    /// # Example
5358    /// ```ignore,no_run
5359    /// # use google_cloud_netapp_v1::model::HostGroup;
5360    /// use google_cloud_netapp_v1::model::host_group::State;
5361    /// let x0 = HostGroup::new().set_state(State::Creating);
5362    /// let x1 = HostGroup::new().set_state(State::Ready);
5363    /// let x2 = HostGroup::new().set_state(State::Updating);
5364    /// ```
5365    pub fn set_state<T: std::convert::Into<crate::model::host_group::State>>(
5366        mut self,
5367        v: T,
5368    ) -> Self {
5369        self.state = v.into();
5370        self
5371    }
5372
5373    /// Sets the value of [create_time][crate::model::HostGroup::create_time].
5374    ///
5375    /// # Example
5376    /// ```ignore,no_run
5377    /// # use google_cloud_netapp_v1::model::HostGroup;
5378    /// use wkt::Timestamp;
5379    /// let x = HostGroup::new().set_create_time(Timestamp::default()/* use setters */);
5380    /// ```
5381    pub fn set_create_time<T>(mut self, v: T) -> Self
5382    where
5383        T: std::convert::Into<wkt::Timestamp>,
5384    {
5385        self.create_time = std::option::Option::Some(v.into());
5386        self
5387    }
5388
5389    /// Sets or clears the value of [create_time][crate::model::HostGroup::create_time].
5390    ///
5391    /// # Example
5392    /// ```ignore,no_run
5393    /// # use google_cloud_netapp_v1::model::HostGroup;
5394    /// use wkt::Timestamp;
5395    /// let x = HostGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5396    /// let x = HostGroup::new().set_or_clear_create_time(None::<Timestamp>);
5397    /// ```
5398    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5399    where
5400        T: std::convert::Into<wkt::Timestamp>,
5401    {
5402        self.create_time = v.map(|x| x.into());
5403        self
5404    }
5405
5406    /// Sets the value of [hosts][crate::model::HostGroup::hosts].
5407    ///
5408    /// # Example
5409    /// ```ignore,no_run
5410    /// # use google_cloud_netapp_v1::model::HostGroup;
5411    /// let x = HostGroup::new().set_hosts(["a", "b", "c"]);
5412    /// ```
5413    pub fn set_hosts<T, V>(mut self, v: T) -> Self
5414    where
5415        T: std::iter::IntoIterator<Item = V>,
5416        V: std::convert::Into<std::string::String>,
5417    {
5418        use std::iter::Iterator;
5419        self.hosts = v.into_iter().map(|i| i.into()).collect();
5420        self
5421    }
5422
5423    /// Sets the value of [os_type][crate::model::HostGroup::os_type].
5424    ///
5425    /// # Example
5426    /// ```ignore,no_run
5427    /// # use google_cloud_netapp_v1::model::HostGroup;
5428    /// use google_cloud_netapp_v1::model::OsType;
5429    /// let x0 = HostGroup::new().set_os_type(OsType::Linux);
5430    /// let x1 = HostGroup::new().set_os_type(OsType::Windows);
5431    /// let x2 = HostGroup::new().set_os_type(OsType::Esxi);
5432    /// ```
5433    pub fn set_os_type<T: std::convert::Into<crate::model::OsType>>(mut self, v: T) -> Self {
5434        self.os_type = v.into();
5435        self
5436    }
5437
5438    /// Sets the value of [description][crate::model::HostGroup::description].
5439    ///
5440    /// # Example
5441    /// ```ignore,no_run
5442    /// # use google_cloud_netapp_v1::model::HostGroup;
5443    /// let x = HostGroup::new().set_description("example");
5444    /// ```
5445    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5446        self.description = v.into();
5447        self
5448    }
5449
5450    /// Sets the value of [labels][crate::model::HostGroup::labels].
5451    ///
5452    /// # Example
5453    /// ```ignore,no_run
5454    /// # use google_cloud_netapp_v1::model::HostGroup;
5455    /// let x = HostGroup::new().set_labels([
5456    ///     ("key0", "abc"),
5457    ///     ("key1", "xyz"),
5458    /// ]);
5459    /// ```
5460    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5461    where
5462        T: std::iter::IntoIterator<Item = (K, V)>,
5463        K: std::convert::Into<std::string::String>,
5464        V: std::convert::Into<std::string::String>,
5465    {
5466        use std::iter::Iterator;
5467        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5468        self
5469    }
5470}
5471
5472impl wkt::message::Message for HostGroup {
5473    fn typename() -> &'static str {
5474        "type.googleapis.com/google.cloud.netapp.v1.HostGroup"
5475    }
5476}
5477
5478/// Defines additional types related to [HostGroup].
5479pub mod host_group {
5480    #[allow(unused_imports)]
5481    use super::*;
5482
5483    /// Types of host group.
5484    ///
5485    /// # Working with unknown values
5486    ///
5487    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5488    /// additional enum variants at any time. Adding new variants is not considered
5489    /// a breaking change. Applications should write their code in anticipation of:
5490    ///
5491    /// - New values appearing in future releases of the client library, **and**
5492    /// - New values received dynamically, without application changes.
5493    ///
5494    /// Please consult the [Working with enums] section in the user guide for some
5495    /// guidelines.
5496    ///
5497    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5498    #[derive(Clone, Debug, PartialEq)]
5499    #[non_exhaustive]
5500    pub enum Type {
5501        /// Unspecified type for host group.
5502        Unspecified,
5503        /// iSCSI initiator host group.
5504        IscsiInitiator,
5505        /// If set, the enum was initialized with an unknown value.
5506        ///
5507        /// Applications can examine the value using [Type::value] or
5508        /// [Type::name].
5509        UnknownValue(r#type::UnknownValue),
5510    }
5511
5512    #[doc(hidden)]
5513    pub mod r#type {
5514        #[allow(unused_imports)]
5515        use super::*;
5516        #[derive(Clone, Debug, PartialEq)]
5517        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5518    }
5519
5520    impl Type {
5521        /// Gets the enum value.
5522        ///
5523        /// Returns `None` if the enum contains an unknown value deserialized from
5524        /// the string representation of enums.
5525        pub fn value(&self) -> std::option::Option<i32> {
5526            match self {
5527                Self::Unspecified => std::option::Option::Some(0),
5528                Self::IscsiInitiator => std::option::Option::Some(1),
5529                Self::UnknownValue(u) => u.0.value(),
5530            }
5531        }
5532
5533        /// Gets the enum value as a string.
5534        ///
5535        /// Returns `None` if the enum contains an unknown value deserialized from
5536        /// the integer representation of enums.
5537        pub fn name(&self) -> std::option::Option<&str> {
5538            match self {
5539                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
5540                Self::IscsiInitiator => std::option::Option::Some("ISCSI_INITIATOR"),
5541                Self::UnknownValue(u) => u.0.name(),
5542            }
5543        }
5544    }
5545
5546    impl std::default::Default for Type {
5547        fn default() -> Self {
5548            use std::convert::From;
5549            Self::from(0)
5550        }
5551    }
5552
5553    impl std::fmt::Display for Type {
5554        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5555            wkt::internal::display_enum(f, self.name(), self.value())
5556        }
5557    }
5558
5559    impl std::convert::From<i32> for Type {
5560        fn from(value: i32) -> Self {
5561            match value {
5562                0 => Self::Unspecified,
5563                1 => Self::IscsiInitiator,
5564                _ => Self::UnknownValue(r#type::UnknownValue(
5565                    wkt::internal::UnknownEnumValue::Integer(value),
5566                )),
5567            }
5568        }
5569    }
5570
5571    impl std::convert::From<&str> for Type {
5572        fn from(value: &str) -> Self {
5573            use std::string::ToString;
5574            match value {
5575                "TYPE_UNSPECIFIED" => Self::Unspecified,
5576                "ISCSI_INITIATOR" => Self::IscsiInitiator,
5577                _ => Self::UnknownValue(r#type::UnknownValue(
5578                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5579                )),
5580            }
5581        }
5582    }
5583
5584    impl serde::ser::Serialize for Type {
5585        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5586        where
5587            S: serde::Serializer,
5588        {
5589            match self {
5590                Self::Unspecified => serializer.serialize_i32(0),
5591                Self::IscsiInitiator => serializer.serialize_i32(1),
5592                Self::UnknownValue(u) => u.0.serialize(serializer),
5593            }
5594        }
5595    }
5596
5597    impl<'de> serde::de::Deserialize<'de> for Type {
5598        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5599        where
5600            D: serde::Deserializer<'de>,
5601        {
5602            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
5603                ".google.cloud.netapp.v1.HostGroup.Type",
5604            ))
5605        }
5606    }
5607
5608    /// Host group states.
5609    ///
5610    /// # Working with unknown values
5611    ///
5612    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5613    /// additional enum variants at any time. Adding new variants is not considered
5614    /// a breaking change. Applications should write their code in anticipation of:
5615    ///
5616    /// - New values appearing in future releases of the client library, **and**
5617    /// - New values received dynamically, without application changes.
5618    ///
5619    /// Please consult the [Working with enums] section in the user guide for some
5620    /// guidelines.
5621    ///
5622    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5623    #[derive(Clone, Debug, PartialEq)]
5624    #[non_exhaustive]
5625    pub enum State {
5626        /// Unspecified state for host group.
5627        Unspecified,
5628        /// Host group is creating.
5629        Creating,
5630        /// Host group is ready.
5631        Ready,
5632        /// Host group is updating.
5633        Updating,
5634        /// Host group is deleting.
5635        Deleting,
5636        /// Host group is disabled.
5637        Disabled,
5638        /// If set, the enum was initialized with an unknown value.
5639        ///
5640        /// Applications can examine the value using [State::value] or
5641        /// [State::name].
5642        UnknownValue(state::UnknownValue),
5643    }
5644
5645    #[doc(hidden)]
5646    pub mod state {
5647        #[allow(unused_imports)]
5648        use super::*;
5649        #[derive(Clone, Debug, PartialEq)]
5650        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5651    }
5652
5653    impl State {
5654        /// Gets the enum value.
5655        ///
5656        /// Returns `None` if the enum contains an unknown value deserialized from
5657        /// the string representation of enums.
5658        pub fn value(&self) -> std::option::Option<i32> {
5659            match self {
5660                Self::Unspecified => std::option::Option::Some(0),
5661                Self::Creating => std::option::Option::Some(1),
5662                Self::Ready => std::option::Option::Some(2),
5663                Self::Updating => std::option::Option::Some(3),
5664                Self::Deleting => std::option::Option::Some(4),
5665                Self::Disabled => std::option::Option::Some(5),
5666                Self::UnknownValue(u) => u.0.value(),
5667            }
5668        }
5669
5670        /// Gets the enum value as a string.
5671        ///
5672        /// Returns `None` if the enum contains an unknown value deserialized from
5673        /// the integer representation of enums.
5674        pub fn name(&self) -> std::option::Option<&str> {
5675            match self {
5676                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5677                Self::Creating => std::option::Option::Some("CREATING"),
5678                Self::Ready => std::option::Option::Some("READY"),
5679                Self::Updating => std::option::Option::Some("UPDATING"),
5680                Self::Deleting => std::option::Option::Some("DELETING"),
5681                Self::Disabled => std::option::Option::Some("DISABLED"),
5682                Self::UnknownValue(u) => u.0.name(),
5683            }
5684        }
5685    }
5686
5687    impl std::default::Default for State {
5688        fn default() -> Self {
5689            use std::convert::From;
5690            Self::from(0)
5691        }
5692    }
5693
5694    impl std::fmt::Display for State {
5695        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5696            wkt::internal::display_enum(f, self.name(), self.value())
5697        }
5698    }
5699
5700    impl std::convert::From<i32> for State {
5701        fn from(value: i32) -> Self {
5702            match value {
5703                0 => Self::Unspecified,
5704                1 => Self::Creating,
5705                2 => Self::Ready,
5706                3 => Self::Updating,
5707                4 => Self::Deleting,
5708                5 => Self::Disabled,
5709                _ => Self::UnknownValue(state::UnknownValue(
5710                    wkt::internal::UnknownEnumValue::Integer(value),
5711                )),
5712            }
5713        }
5714    }
5715
5716    impl std::convert::From<&str> for State {
5717        fn from(value: &str) -> Self {
5718            use std::string::ToString;
5719            match value {
5720                "STATE_UNSPECIFIED" => Self::Unspecified,
5721                "CREATING" => Self::Creating,
5722                "READY" => Self::Ready,
5723                "UPDATING" => Self::Updating,
5724                "DELETING" => Self::Deleting,
5725                "DISABLED" => Self::Disabled,
5726                _ => Self::UnknownValue(state::UnknownValue(
5727                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5728                )),
5729            }
5730        }
5731    }
5732
5733    impl serde::ser::Serialize for State {
5734        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5735        where
5736            S: serde::Serializer,
5737        {
5738            match self {
5739                Self::Unspecified => serializer.serialize_i32(0),
5740                Self::Creating => serializer.serialize_i32(1),
5741                Self::Ready => serializer.serialize_i32(2),
5742                Self::Updating => serializer.serialize_i32(3),
5743                Self::Deleting => serializer.serialize_i32(4),
5744                Self::Disabled => serializer.serialize_i32(5),
5745                Self::UnknownValue(u) => u.0.serialize(serializer),
5746            }
5747        }
5748    }
5749
5750    impl<'de> serde::de::Deserialize<'de> for State {
5751        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5752        where
5753            D: serde::Deserializer<'de>,
5754        {
5755            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5756                ".google.cloud.netapp.v1.HostGroup.State",
5757            ))
5758        }
5759    }
5760}
5761
5762/// GetKmsConfigRequest gets a KMS Config.
5763#[derive(Clone, Default, PartialEq)]
5764#[non_exhaustive]
5765pub struct GetKmsConfigRequest {
5766    /// Required. Name of the KmsConfig
5767    pub name: std::string::String,
5768
5769    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5770}
5771
5772impl GetKmsConfigRequest {
5773    /// Creates a new default instance.
5774    pub fn new() -> Self {
5775        std::default::Default::default()
5776    }
5777
5778    /// Sets the value of [name][crate::model::GetKmsConfigRequest::name].
5779    ///
5780    /// # Example
5781    /// ```ignore,no_run
5782    /// # use google_cloud_netapp_v1::model::GetKmsConfigRequest;
5783    /// # let project_id = "project_id";
5784    /// # let location_id = "location_id";
5785    /// # let kms_config_id = "kms_config_id";
5786    /// let x = GetKmsConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/kmsConfigs/{kms_config_id}"));
5787    /// ```
5788    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5789        self.name = v.into();
5790        self
5791    }
5792}
5793
5794impl wkt::message::Message for GetKmsConfigRequest {
5795    fn typename() -> &'static str {
5796        "type.googleapis.com/google.cloud.netapp.v1.GetKmsConfigRequest"
5797    }
5798}
5799
5800/// ListKmsConfigsRequest lists KMS Configs.
5801#[derive(Clone, Default, PartialEq)]
5802#[non_exhaustive]
5803pub struct ListKmsConfigsRequest {
5804    /// Required. Parent value
5805    pub parent: std::string::String,
5806
5807    /// The maximum number of items to return.
5808    pub page_size: i32,
5809
5810    /// The next_page_token value to use if there are additional
5811    /// results to retrieve for this list request.
5812    pub page_token: std::string::String,
5813
5814    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
5815    pub order_by: std::string::String,
5816
5817    /// List filter.
5818    pub filter: std::string::String,
5819
5820    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5821}
5822
5823impl ListKmsConfigsRequest {
5824    /// Creates a new default instance.
5825    pub fn new() -> Self {
5826        std::default::Default::default()
5827    }
5828
5829    /// Sets the value of [parent][crate::model::ListKmsConfigsRequest::parent].
5830    ///
5831    /// # Example
5832    /// ```ignore,no_run
5833    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5834    /// # let project_id = "project_id";
5835    /// # let location_id = "location_id";
5836    /// let x = ListKmsConfigsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
5837    /// ```
5838    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5839        self.parent = v.into();
5840        self
5841    }
5842
5843    /// Sets the value of [page_size][crate::model::ListKmsConfigsRequest::page_size].
5844    ///
5845    /// # Example
5846    /// ```ignore,no_run
5847    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5848    /// let x = ListKmsConfigsRequest::new().set_page_size(42);
5849    /// ```
5850    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5851        self.page_size = v.into();
5852        self
5853    }
5854
5855    /// Sets the value of [page_token][crate::model::ListKmsConfigsRequest::page_token].
5856    ///
5857    /// # Example
5858    /// ```ignore,no_run
5859    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5860    /// let x = ListKmsConfigsRequest::new().set_page_token("example");
5861    /// ```
5862    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5863        self.page_token = v.into();
5864        self
5865    }
5866
5867    /// Sets the value of [order_by][crate::model::ListKmsConfigsRequest::order_by].
5868    ///
5869    /// # Example
5870    /// ```ignore,no_run
5871    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5872    /// let x = ListKmsConfigsRequest::new().set_order_by("example");
5873    /// ```
5874    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5875        self.order_by = v.into();
5876        self
5877    }
5878
5879    /// Sets the value of [filter][crate::model::ListKmsConfigsRequest::filter].
5880    ///
5881    /// # Example
5882    /// ```ignore,no_run
5883    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5884    /// let x = ListKmsConfigsRequest::new().set_filter("example");
5885    /// ```
5886    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5887        self.filter = v.into();
5888        self
5889    }
5890}
5891
5892impl wkt::message::Message for ListKmsConfigsRequest {
5893    fn typename() -> &'static str {
5894        "type.googleapis.com/google.cloud.netapp.v1.ListKmsConfigsRequest"
5895    }
5896}
5897
5898/// ListKmsConfigsResponse is the response to a ListKmsConfigsRequest.
5899#[derive(Clone, Default, PartialEq)]
5900#[non_exhaustive]
5901pub struct ListKmsConfigsResponse {
5902    /// The list of KmsConfigs
5903    pub kms_configs: std::vec::Vec<crate::model::KmsConfig>,
5904
5905    /// A token identifying a page of results the server should return.
5906    pub next_page_token: std::string::String,
5907
5908    /// Locations that could not be reached.
5909    pub unreachable: std::vec::Vec<std::string::String>,
5910
5911    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5912}
5913
5914impl ListKmsConfigsResponse {
5915    /// Creates a new default instance.
5916    pub fn new() -> Self {
5917        std::default::Default::default()
5918    }
5919
5920    /// Sets the value of [kms_configs][crate::model::ListKmsConfigsResponse::kms_configs].
5921    ///
5922    /// # Example
5923    /// ```ignore,no_run
5924    /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
5925    /// use google_cloud_netapp_v1::model::KmsConfig;
5926    /// let x = ListKmsConfigsResponse::new()
5927    ///     .set_kms_configs([
5928    ///         KmsConfig::default()/* use setters */,
5929    ///         KmsConfig::default()/* use (different) setters */,
5930    ///     ]);
5931    /// ```
5932    pub fn set_kms_configs<T, V>(mut self, v: T) -> Self
5933    where
5934        T: std::iter::IntoIterator<Item = V>,
5935        V: std::convert::Into<crate::model::KmsConfig>,
5936    {
5937        use std::iter::Iterator;
5938        self.kms_configs = v.into_iter().map(|i| i.into()).collect();
5939        self
5940    }
5941
5942    /// Sets the value of [next_page_token][crate::model::ListKmsConfigsResponse::next_page_token].
5943    ///
5944    /// # Example
5945    /// ```ignore,no_run
5946    /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
5947    /// let x = ListKmsConfigsResponse::new().set_next_page_token("example");
5948    /// ```
5949    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5950        self.next_page_token = v.into();
5951        self
5952    }
5953
5954    /// Sets the value of [unreachable][crate::model::ListKmsConfigsResponse::unreachable].
5955    ///
5956    /// # Example
5957    /// ```ignore,no_run
5958    /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
5959    /// let x = ListKmsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
5960    /// ```
5961    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5962    where
5963        T: std::iter::IntoIterator<Item = V>,
5964        V: std::convert::Into<std::string::String>,
5965    {
5966        use std::iter::Iterator;
5967        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5968        self
5969    }
5970}
5971
5972impl wkt::message::Message for ListKmsConfigsResponse {
5973    fn typename() -> &'static str {
5974        "type.googleapis.com/google.cloud.netapp.v1.ListKmsConfigsResponse"
5975    }
5976}
5977
5978#[doc(hidden)]
5979impl google_cloud_gax::paginator::internal::PageableResponse for ListKmsConfigsResponse {
5980    type PageItem = crate::model::KmsConfig;
5981
5982    fn items(self) -> std::vec::Vec<Self::PageItem> {
5983        self.kms_configs
5984    }
5985
5986    fn next_page_token(&self) -> std::string::String {
5987        use std::clone::Clone;
5988        self.next_page_token.clone()
5989    }
5990}
5991
5992/// CreateKmsConfigRequest creates a KMS Config.
5993#[derive(Clone, Default, PartialEq)]
5994#[non_exhaustive]
5995pub struct CreateKmsConfigRequest {
5996    /// Required. Value for parent.
5997    pub parent: std::string::String,
5998
5999    /// Required. Id of the requesting KmsConfig. Must be unique within the parent
6000    /// resource. Must contain only letters, numbers and hyphen, with the first
6001    /// character a letter, the last a letter or a
6002    /// number, and a 63 character maximum.
6003    pub kms_config_id: std::string::String,
6004
6005    /// Required. The required parameters to create a new KmsConfig.
6006    pub kms_config: std::option::Option<crate::model::KmsConfig>,
6007
6008    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6009}
6010
6011impl CreateKmsConfigRequest {
6012    /// Creates a new default instance.
6013    pub fn new() -> Self {
6014        std::default::Default::default()
6015    }
6016
6017    /// Sets the value of [parent][crate::model::CreateKmsConfigRequest::parent].
6018    ///
6019    /// # Example
6020    /// ```ignore,no_run
6021    /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
6022    /// # let project_id = "project_id";
6023    /// # let location_id = "location_id";
6024    /// let x = CreateKmsConfigRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
6025    /// ```
6026    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6027        self.parent = v.into();
6028        self
6029    }
6030
6031    /// Sets the value of [kms_config_id][crate::model::CreateKmsConfigRequest::kms_config_id].
6032    ///
6033    /// # Example
6034    /// ```ignore,no_run
6035    /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
6036    /// let x = CreateKmsConfigRequest::new().set_kms_config_id("example");
6037    /// ```
6038    pub fn set_kms_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6039        self.kms_config_id = v.into();
6040        self
6041    }
6042
6043    /// Sets the value of [kms_config][crate::model::CreateKmsConfigRequest::kms_config].
6044    ///
6045    /// # Example
6046    /// ```ignore,no_run
6047    /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
6048    /// use google_cloud_netapp_v1::model::KmsConfig;
6049    /// let x = CreateKmsConfigRequest::new().set_kms_config(KmsConfig::default()/* use setters */);
6050    /// ```
6051    pub fn set_kms_config<T>(mut self, v: T) -> Self
6052    where
6053        T: std::convert::Into<crate::model::KmsConfig>,
6054    {
6055        self.kms_config = std::option::Option::Some(v.into());
6056        self
6057    }
6058
6059    /// Sets or clears the value of [kms_config][crate::model::CreateKmsConfigRequest::kms_config].
6060    ///
6061    /// # Example
6062    /// ```ignore,no_run
6063    /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
6064    /// use google_cloud_netapp_v1::model::KmsConfig;
6065    /// let x = CreateKmsConfigRequest::new().set_or_clear_kms_config(Some(KmsConfig::default()/* use setters */));
6066    /// let x = CreateKmsConfigRequest::new().set_or_clear_kms_config(None::<KmsConfig>);
6067    /// ```
6068    pub fn set_or_clear_kms_config<T>(mut self, v: std::option::Option<T>) -> Self
6069    where
6070        T: std::convert::Into<crate::model::KmsConfig>,
6071    {
6072        self.kms_config = v.map(|x| x.into());
6073        self
6074    }
6075}
6076
6077impl wkt::message::Message for CreateKmsConfigRequest {
6078    fn typename() -> &'static str {
6079        "type.googleapis.com/google.cloud.netapp.v1.CreateKmsConfigRequest"
6080    }
6081}
6082
6083/// UpdateKmsConfigRequest updates a KMS Config.
6084#[derive(Clone, Default, PartialEq)]
6085#[non_exhaustive]
6086pub struct UpdateKmsConfigRequest {
6087    /// Required. Field mask is used to specify the fields to be overwritten in the
6088    /// KmsConfig resource by the update.
6089    /// The fields specified in the update_mask are relative to the resource, not
6090    /// the full request. A field will be overwritten if it is in the mask. If the
6091    /// user does not provide a mask then all fields will be overwritten.
6092    pub update_mask: std::option::Option<wkt::FieldMask>,
6093
6094    /// Required. The KmsConfig being updated
6095    pub kms_config: std::option::Option<crate::model::KmsConfig>,
6096
6097    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6098}
6099
6100impl UpdateKmsConfigRequest {
6101    /// Creates a new default instance.
6102    pub fn new() -> Self {
6103        std::default::Default::default()
6104    }
6105
6106    /// Sets the value of [update_mask][crate::model::UpdateKmsConfigRequest::update_mask].
6107    ///
6108    /// # Example
6109    /// ```ignore,no_run
6110    /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
6111    /// use wkt::FieldMask;
6112    /// let x = UpdateKmsConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6113    /// ```
6114    pub fn set_update_mask<T>(mut self, v: T) -> Self
6115    where
6116        T: std::convert::Into<wkt::FieldMask>,
6117    {
6118        self.update_mask = std::option::Option::Some(v.into());
6119        self
6120    }
6121
6122    /// Sets or clears the value of [update_mask][crate::model::UpdateKmsConfigRequest::update_mask].
6123    ///
6124    /// # Example
6125    /// ```ignore,no_run
6126    /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
6127    /// use wkt::FieldMask;
6128    /// let x = UpdateKmsConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6129    /// let x = UpdateKmsConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6130    /// ```
6131    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6132    where
6133        T: std::convert::Into<wkt::FieldMask>,
6134    {
6135        self.update_mask = v.map(|x| x.into());
6136        self
6137    }
6138
6139    /// Sets the value of [kms_config][crate::model::UpdateKmsConfigRequest::kms_config].
6140    ///
6141    /// # Example
6142    /// ```ignore,no_run
6143    /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
6144    /// use google_cloud_netapp_v1::model::KmsConfig;
6145    /// let x = UpdateKmsConfigRequest::new().set_kms_config(KmsConfig::default()/* use setters */);
6146    /// ```
6147    pub fn set_kms_config<T>(mut self, v: T) -> Self
6148    where
6149        T: std::convert::Into<crate::model::KmsConfig>,
6150    {
6151        self.kms_config = std::option::Option::Some(v.into());
6152        self
6153    }
6154
6155    /// Sets or clears the value of [kms_config][crate::model::UpdateKmsConfigRequest::kms_config].
6156    ///
6157    /// # Example
6158    /// ```ignore,no_run
6159    /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
6160    /// use google_cloud_netapp_v1::model::KmsConfig;
6161    /// let x = UpdateKmsConfigRequest::new().set_or_clear_kms_config(Some(KmsConfig::default()/* use setters */));
6162    /// let x = UpdateKmsConfigRequest::new().set_or_clear_kms_config(None::<KmsConfig>);
6163    /// ```
6164    pub fn set_or_clear_kms_config<T>(mut self, v: std::option::Option<T>) -> Self
6165    where
6166        T: std::convert::Into<crate::model::KmsConfig>,
6167    {
6168        self.kms_config = v.map(|x| x.into());
6169        self
6170    }
6171}
6172
6173impl wkt::message::Message for UpdateKmsConfigRequest {
6174    fn typename() -> &'static str {
6175        "type.googleapis.com/google.cloud.netapp.v1.UpdateKmsConfigRequest"
6176    }
6177}
6178
6179/// DeleteKmsConfigRequest deletes a KMS Config.
6180#[derive(Clone, Default, PartialEq)]
6181#[non_exhaustive]
6182pub struct DeleteKmsConfigRequest {
6183    /// Required. Name of the KmsConfig.
6184    pub name: std::string::String,
6185
6186    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6187}
6188
6189impl DeleteKmsConfigRequest {
6190    /// Creates a new default instance.
6191    pub fn new() -> Self {
6192        std::default::Default::default()
6193    }
6194
6195    /// Sets the value of [name][crate::model::DeleteKmsConfigRequest::name].
6196    ///
6197    /// # Example
6198    /// ```ignore,no_run
6199    /// # use google_cloud_netapp_v1::model::DeleteKmsConfigRequest;
6200    /// # let project_id = "project_id";
6201    /// # let location_id = "location_id";
6202    /// # let kms_config_id = "kms_config_id";
6203    /// let x = DeleteKmsConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/kmsConfigs/{kms_config_id}"));
6204    /// ```
6205    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6206        self.name = v.into();
6207        self
6208    }
6209}
6210
6211impl wkt::message::Message for DeleteKmsConfigRequest {
6212    fn typename() -> &'static str {
6213        "type.googleapis.com/google.cloud.netapp.v1.DeleteKmsConfigRequest"
6214    }
6215}
6216
6217/// EncryptVolumesRequest specifies the KMS config to encrypt existing volumes.
6218#[derive(Clone, Default, PartialEq)]
6219#[non_exhaustive]
6220pub struct EncryptVolumesRequest {
6221    /// Required. Name of the KmsConfig.
6222    pub name: std::string::String,
6223
6224    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6225}
6226
6227impl EncryptVolumesRequest {
6228    /// Creates a new default instance.
6229    pub fn new() -> Self {
6230        std::default::Default::default()
6231    }
6232
6233    /// Sets the value of [name][crate::model::EncryptVolumesRequest::name].
6234    ///
6235    /// # Example
6236    /// ```ignore,no_run
6237    /// # use google_cloud_netapp_v1::model::EncryptVolumesRequest;
6238    /// # let project_id = "project_id";
6239    /// # let location_id = "location_id";
6240    /// # let kms_config_id = "kms_config_id";
6241    /// let x = EncryptVolumesRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/kmsConfigs/{kms_config_id}"));
6242    /// ```
6243    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6244        self.name = v.into();
6245        self
6246    }
6247}
6248
6249impl wkt::message::Message for EncryptVolumesRequest {
6250    fn typename() -> &'static str {
6251        "type.googleapis.com/google.cloud.netapp.v1.EncryptVolumesRequest"
6252    }
6253}
6254
6255/// VerifyKmsConfigRequest specifies the KMS config to be validated.
6256#[derive(Clone, Default, PartialEq)]
6257#[non_exhaustive]
6258pub struct VerifyKmsConfigRequest {
6259    /// Required. Name of the KMS Config to be verified.
6260    pub name: std::string::String,
6261
6262    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6263}
6264
6265impl VerifyKmsConfigRequest {
6266    /// Creates a new default instance.
6267    pub fn new() -> Self {
6268        std::default::Default::default()
6269    }
6270
6271    /// Sets the value of [name][crate::model::VerifyKmsConfigRequest::name].
6272    ///
6273    /// # Example
6274    /// ```ignore,no_run
6275    /// # use google_cloud_netapp_v1::model::VerifyKmsConfigRequest;
6276    /// # let project_id = "project_id";
6277    /// # let location_id = "location_id";
6278    /// # let kms_config_id = "kms_config_id";
6279    /// let x = VerifyKmsConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/kmsConfigs/{kms_config_id}"));
6280    /// ```
6281    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6282        self.name = v.into();
6283        self
6284    }
6285}
6286
6287impl wkt::message::Message for VerifyKmsConfigRequest {
6288    fn typename() -> &'static str {
6289        "type.googleapis.com/google.cloud.netapp.v1.VerifyKmsConfigRequest"
6290    }
6291}
6292
6293/// VerifyKmsConfigResponse contains the information if the config is correctly
6294/// and error message.
6295#[derive(Clone, Default, PartialEq)]
6296#[non_exhaustive]
6297pub struct VerifyKmsConfigResponse {
6298    /// Output only. If the customer key configured correctly to the encrypt
6299    /// volume.
6300    pub healthy: bool,
6301
6302    /// Output only. Error message if config is not healthy.
6303    pub health_error: std::string::String,
6304
6305    /// Output only. Instructions for the customers to provide the access to the
6306    /// encryption key.
6307    pub instructions: std::string::String,
6308
6309    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6310}
6311
6312impl VerifyKmsConfigResponse {
6313    /// Creates a new default instance.
6314    pub fn new() -> Self {
6315        std::default::Default::default()
6316    }
6317
6318    /// Sets the value of [healthy][crate::model::VerifyKmsConfigResponse::healthy].
6319    ///
6320    /// # Example
6321    /// ```ignore,no_run
6322    /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
6323    /// let x = VerifyKmsConfigResponse::new().set_healthy(true);
6324    /// ```
6325    pub fn set_healthy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6326        self.healthy = v.into();
6327        self
6328    }
6329
6330    /// Sets the value of [health_error][crate::model::VerifyKmsConfigResponse::health_error].
6331    ///
6332    /// # Example
6333    /// ```ignore,no_run
6334    /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
6335    /// let x = VerifyKmsConfigResponse::new().set_health_error("example");
6336    /// ```
6337    pub fn set_health_error<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6338        self.health_error = v.into();
6339        self
6340    }
6341
6342    /// Sets the value of [instructions][crate::model::VerifyKmsConfigResponse::instructions].
6343    ///
6344    /// # Example
6345    /// ```ignore,no_run
6346    /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
6347    /// let x = VerifyKmsConfigResponse::new().set_instructions("example");
6348    /// ```
6349    pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6350        self.instructions = v.into();
6351        self
6352    }
6353}
6354
6355impl wkt::message::Message for VerifyKmsConfigResponse {
6356    fn typename() -> &'static str {
6357        "type.googleapis.com/google.cloud.netapp.v1.VerifyKmsConfigResponse"
6358    }
6359}
6360
6361/// KmsConfig is the customer-managed encryption key(CMEK) configuration.
6362#[derive(Clone, Default, PartialEq)]
6363#[non_exhaustive]
6364pub struct KmsConfig {
6365    /// Identifier. Name of the KmsConfig.
6366    /// Format: `projects/{project}/locations/{location}/kmsConfigs/{kms_config}`
6367    pub name: std::string::String,
6368
6369    /// Required. Customer-managed crypto key resource full name. Format:
6370    /// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`
6371    pub crypto_key_name: std::string::String,
6372
6373    /// Output only. State of the KmsConfig.
6374    pub state: crate::model::kms_config::State,
6375
6376    /// Output only. State details of the KmsConfig.
6377    pub state_details: std::string::String,
6378
6379    /// Output only. Create time of the KmsConfig.
6380    pub create_time: std::option::Option<wkt::Timestamp>,
6381
6382    /// Description of the KmsConfig.
6383    pub description: std::string::String,
6384
6385    /// Labels as key value pairs
6386    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6387
6388    /// Output only. Instructions to provide the access to the customer provided
6389    /// encryption key.
6390    pub instructions: std::string::String,
6391
6392    /// Output only. The Service account which will have access to the customer
6393    /// provided encryption key.
6394    pub service_account: std::string::String,
6395
6396    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6397}
6398
6399impl KmsConfig {
6400    /// Creates a new default instance.
6401    pub fn new() -> Self {
6402        std::default::Default::default()
6403    }
6404
6405    /// Sets the value of [name][crate::model::KmsConfig::name].
6406    ///
6407    /// # Example
6408    /// ```ignore,no_run
6409    /// # use google_cloud_netapp_v1::model::KmsConfig;
6410    /// # let project_id = "project_id";
6411    /// # let location_id = "location_id";
6412    /// # let kms_config_id = "kms_config_id";
6413    /// let x = KmsConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/kmsConfigs/{kms_config_id}"));
6414    /// ```
6415    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6416        self.name = v.into();
6417        self
6418    }
6419
6420    /// Sets the value of [crypto_key_name][crate::model::KmsConfig::crypto_key_name].
6421    ///
6422    /// # Example
6423    /// ```ignore,no_run
6424    /// # use google_cloud_netapp_v1::model::KmsConfig;
6425    /// let x = KmsConfig::new().set_crypto_key_name("example");
6426    /// ```
6427    pub fn set_crypto_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6428        self.crypto_key_name = v.into();
6429        self
6430    }
6431
6432    /// Sets the value of [state][crate::model::KmsConfig::state].
6433    ///
6434    /// # Example
6435    /// ```ignore,no_run
6436    /// # use google_cloud_netapp_v1::model::KmsConfig;
6437    /// use google_cloud_netapp_v1::model::kms_config::State;
6438    /// let x0 = KmsConfig::new().set_state(State::Ready);
6439    /// let x1 = KmsConfig::new().set_state(State::Creating);
6440    /// let x2 = KmsConfig::new().set_state(State::Deleting);
6441    /// ```
6442    pub fn set_state<T: std::convert::Into<crate::model::kms_config::State>>(
6443        mut self,
6444        v: T,
6445    ) -> Self {
6446        self.state = v.into();
6447        self
6448    }
6449
6450    /// Sets the value of [state_details][crate::model::KmsConfig::state_details].
6451    ///
6452    /// # Example
6453    /// ```ignore,no_run
6454    /// # use google_cloud_netapp_v1::model::KmsConfig;
6455    /// let x = KmsConfig::new().set_state_details("example");
6456    /// ```
6457    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6458        self.state_details = v.into();
6459        self
6460    }
6461
6462    /// Sets the value of [create_time][crate::model::KmsConfig::create_time].
6463    ///
6464    /// # Example
6465    /// ```ignore,no_run
6466    /// # use google_cloud_netapp_v1::model::KmsConfig;
6467    /// use wkt::Timestamp;
6468    /// let x = KmsConfig::new().set_create_time(Timestamp::default()/* use setters */);
6469    /// ```
6470    pub fn set_create_time<T>(mut self, v: T) -> Self
6471    where
6472        T: std::convert::Into<wkt::Timestamp>,
6473    {
6474        self.create_time = std::option::Option::Some(v.into());
6475        self
6476    }
6477
6478    /// Sets or clears the value of [create_time][crate::model::KmsConfig::create_time].
6479    ///
6480    /// # Example
6481    /// ```ignore,no_run
6482    /// # use google_cloud_netapp_v1::model::KmsConfig;
6483    /// use wkt::Timestamp;
6484    /// let x = KmsConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6485    /// let x = KmsConfig::new().set_or_clear_create_time(None::<Timestamp>);
6486    /// ```
6487    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6488    where
6489        T: std::convert::Into<wkt::Timestamp>,
6490    {
6491        self.create_time = v.map(|x| x.into());
6492        self
6493    }
6494
6495    /// Sets the value of [description][crate::model::KmsConfig::description].
6496    ///
6497    /// # Example
6498    /// ```ignore,no_run
6499    /// # use google_cloud_netapp_v1::model::KmsConfig;
6500    /// let x = KmsConfig::new().set_description("example");
6501    /// ```
6502    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6503        self.description = v.into();
6504        self
6505    }
6506
6507    /// Sets the value of [labels][crate::model::KmsConfig::labels].
6508    ///
6509    /// # Example
6510    /// ```ignore,no_run
6511    /// # use google_cloud_netapp_v1::model::KmsConfig;
6512    /// let x = KmsConfig::new().set_labels([
6513    ///     ("key0", "abc"),
6514    ///     ("key1", "xyz"),
6515    /// ]);
6516    /// ```
6517    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6518    where
6519        T: std::iter::IntoIterator<Item = (K, V)>,
6520        K: std::convert::Into<std::string::String>,
6521        V: std::convert::Into<std::string::String>,
6522    {
6523        use std::iter::Iterator;
6524        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6525        self
6526    }
6527
6528    /// Sets the value of [instructions][crate::model::KmsConfig::instructions].
6529    ///
6530    /// # Example
6531    /// ```ignore,no_run
6532    /// # use google_cloud_netapp_v1::model::KmsConfig;
6533    /// let x = KmsConfig::new().set_instructions("example");
6534    /// ```
6535    pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6536        self.instructions = v.into();
6537        self
6538    }
6539
6540    /// Sets the value of [service_account][crate::model::KmsConfig::service_account].
6541    ///
6542    /// # Example
6543    /// ```ignore,no_run
6544    /// # use google_cloud_netapp_v1::model::KmsConfig;
6545    /// let x = KmsConfig::new().set_service_account("example");
6546    /// ```
6547    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6548        self.service_account = v.into();
6549        self
6550    }
6551}
6552
6553impl wkt::message::Message for KmsConfig {
6554    fn typename() -> &'static str {
6555        "type.googleapis.com/google.cloud.netapp.v1.KmsConfig"
6556    }
6557}
6558
6559/// Defines additional types related to [KmsConfig].
6560pub mod kms_config {
6561    #[allow(unused_imports)]
6562    use super::*;
6563
6564    /// The KmsConfig States
6565    ///
6566    /// # Working with unknown values
6567    ///
6568    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6569    /// additional enum variants at any time. Adding new variants is not considered
6570    /// a breaking change. Applications should write their code in anticipation of:
6571    ///
6572    /// - New values appearing in future releases of the client library, **and**
6573    /// - New values received dynamically, without application changes.
6574    ///
6575    /// Please consult the [Working with enums] section in the user guide for some
6576    /// guidelines.
6577    ///
6578    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6579    #[derive(Clone, Debug, PartialEq)]
6580    #[non_exhaustive]
6581    pub enum State {
6582        /// Unspecified KmsConfig State
6583        Unspecified,
6584        /// KmsConfig State is Ready
6585        Ready,
6586        /// KmsConfig State is Creating
6587        Creating,
6588        /// KmsConfig State is Deleting
6589        Deleting,
6590        /// KmsConfig State is Updating
6591        Updating,
6592        /// KmsConfig State is In Use.
6593        InUse,
6594        /// KmsConfig State is Error
6595        Error,
6596        /// KmsConfig State is Pending to verify crypto key access.
6597        KeyCheckPending,
6598        /// KmsConfig State is Not accessbile by the SDE service account to the
6599        /// crypto key.
6600        KeyNotReachable,
6601        /// KmsConfig State is Disabling.
6602        Disabling,
6603        /// KmsConfig State is Disabled.
6604        Disabled,
6605        /// KmsConfig State is Migrating.
6606        /// The existing volumes are migrating from SMEK to CMEK.
6607        Migrating,
6608        /// If set, the enum was initialized with an unknown value.
6609        ///
6610        /// Applications can examine the value using [State::value] or
6611        /// [State::name].
6612        UnknownValue(state::UnknownValue),
6613    }
6614
6615    #[doc(hidden)]
6616    pub mod state {
6617        #[allow(unused_imports)]
6618        use super::*;
6619        #[derive(Clone, Debug, PartialEq)]
6620        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6621    }
6622
6623    impl State {
6624        /// Gets the enum value.
6625        ///
6626        /// Returns `None` if the enum contains an unknown value deserialized from
6627        /// the string representation of enums.
6628        pub fn value(&self) -> std::option::Option<i32> {
6629            match self {
6630                Self::Unspecified => std::option::Option::Some(0),
6631                Self::Ready => std::option::Option::Some(1),
6632                Self::Creating => std::option::Option::Some(2),
6633                Self::Deleting => std::option::Option::Some(3),
6634                Self::Updating => std::option::Option::Some(4),
6635                Self::InUse => std::option::Option::Some(5),
6636                Self::Error => std::option::Option::Some(6),
6637                Self::KeyCheckPending => std::option::Option::Some(7),
6638                Self::KeyNotReachable => std::option::Option::Some(8),
6639                Self::Disabling => std::option::Option::Some(9),
6640                Self::Disabled => std::option::Option::Some(10),
6641                Self::Migrating => std::option::Option::Some(11),
6642                Self::UnknownValue(u) => u.0.value(),
6643            }
6644        }
6645
6646        /// Gets the enum value as a string.
6647        ///
6648        /// Returns `None` if the enum contains an unknown value deserialized from
6649        /// the integer representation of enums.
6650        pub fn name(&self) -> std::option::Option<&str> {
6651            match self {
6652                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6653                Self::Ready => std::option::Option::Some("READY"),
6654                Self::Creating => std::option::Option::Some("CREATING"),
6655                Self::Deleting => std::option::Option::Some("DELETING"),
6656                Self::Updating => std::option::Option::Some("UPDATING"),
6657                Self::InUse => std::option::Option::Some("IN_USE"),
6658                Self::Error => std::option::Option::Some("ERROR"),
6659                Self::KeyCheckPending => std::option::Option::Some("KEY_CHECK_PENDING"),
6660                Self::KeyNotReachable => std::option::Option::Some("KEY_NOT_REACHABLE"),
6661                Self::Disabling => std::option::Option::Some("DISABLING"),
6662                Self::Disabled => std::option::Option::Some("DISABLED"),
6663                Self::Migrating => std::option::Option::Some("MIGRATING"),
6664                Self::UnknownValue(u) => u.0.name(),
6665            }
6666        }
6667    }
6668
6669    impl std::default::Default for State {
6670        fn default() -> Self {
6671            use std::convert::From;
6672            Self::from(0)
6673        }
6674    }
6675
6676    impl std::fmt::Display for State {
6677        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6678            wkt::internal::display_enum(f, self.name(), self.value())
6679        }
6680    }
6681
6682    impl std::convert::From<i32> for State {
6683        fn from(value: i32) -> Self {
6684            match value {
6685                0 => Self::Unspecified,
6686                1 => Self::Ready,
6687                2 => Self::Creating,
6688                3 => Self::Deleting,
6689                4 => Self::Updating,
6690                5 => Self::InUse,
6691                6 => Self::Error,
6692                7 => Self::KeyCheckPending,
6693                8 => Self::KeyNotReachable,
6694                9 => Self::Disabling,
6695                10 => Self::Disabled,
6696                11 => Self::Migrating,
6697                _ => Self::UnknownValue(state::UnknownValue(
6698                    wkt::internal::UnknownEnumValue::Integer(value),
6699                )),
6700            }
6701        }
6702    }
6703
6704    impl std::convert::From<&str> for State {
6705        fn from(value: &str) -> Self {
6706            use std::string::ToString;
6707            match value {
6708                "STATE_UNSPECIFIED" => Self::Unspecified,
6709                "READY" => Self::Ready,
6710                "CREATING" => Self::Creating,
6711                "DELETING" => Self::Deleting,
6712                "UPDATING" => Self::Updating,
6713                "IN_USE" => Self::InUse,
6714                "ERROR" => Self::Error,
6715                "KEY_CHECK_PENDING" => Self::KeyCheckPending,
6716                "KEY_NOT_REACHABLE" => Self::KeyNotReachable,
6717                "DISABLING" => Self::Disabling,
6718                "DISABLED" => Self::Disabled,
6719                "MIGRATING" => Self::Migrating,
6720                _ => Self::UnknownValue(state::UnknownValue(
6721                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6722                )),
6723            }
6724        }
6725    }
6726
6727    impl serde::ser::Serialize for State {
6728        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6729        where
6730            S: serde::Serializer,
6731        {
6732            match self {
6733                Self::Unspecified => serializer.serialize_i32(0),
6734                Self::Ready => serializer.serialize_i32(1),
6735                Self::Creating => serializer.serialize_i32(2),
6736                Self::Deleting => serializer.serialize_i32(3),
6737                Self::Updating => serializer.serialize_i32(4),
6738                Self::InUse => serializer.serialize_i32(5),
6739                Self::Error => serializer.serialize_i32(6),
6740                Self::KeyCheckPending => serializer.serialize_i32(7),
6741                Self::KeyNotReachable => serializer.serialize_i32(8),
6742                Self::Disabling => serializer.serialize_i32(9),
6743                Self::Disabled => serializer.serialize_i32(10),
6744                Self::Migrating => serializer.serialize_i32(11),
6745                Self::UnknownValue(u) => u.0.serialize(serializer),
6746            }
6747        }
6748    }
6749
6750    impl<'de> serde::de::Deserialize<'de> for State {
6751        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6752        where
6753            D: serde::Deserializer<'de>,
6754        {
6755            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6756                ".google.cloud.netapp.v1.KmsConfig.State",
6757            ))
6758        }
6759    }
6760}
6761
6762/// Request message for `ExecuteOntapPost` API.
6763#[derive(Clone, Default, PartialEq)]
6764#[non_exhaustive]
6765pub struct ExecuteOntapPostRequest {
6766    /// Required. The raw `JSON` body of the request.
6767    /// The body should be in the format of the ONTAP resource.
6768    /// For example:
6769    ///
6770    /// ```norust
6771    /// {
6772    ///   "body": {
6773    ///     "field1": "value1",
6774    ///     "field2": "value2",
6775    ///   }
6776    /// }
6777    /// ```
6778    pub body: std::option::Option<wkt::Struct>,
6779
6780    /// Required. The resource path of the ONTAP resource.
6781    /// Format:
6782    /// `projects/{project_number}/locations/{location_id}/storagePools/{storage_pool_id}/ontap/{ontap_resource_path}`.
6783    /// For example:
6784    /// `projects/123456789/locations/us-central1/storagePools/my-storage-pool/ontap/api/storage/volumes`.
6785    pub ontap_path: std::string::String,
6786
6787    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6788}
6789
6790impl ExecuteOntapPostRequest {
6791    /// Creates a new default instance.
6792    pub fn new() -> Self {
6793        std::default::Default::default()
6794    }
6795
6796    /// Sets the value of [body][crate::model::ExecuteOntapPostRequest::body].
6797    ///
6798    /// # Example
6799    /// ```ignore,no_run
6800    /// # use google_cloud_netapp_v1::model::ExecuteOntapPostRequest;
6801    /// use wkt::Struct;
6802    /// let x = ExecuteOntapPostRequest::new().set_body(Struct::default()/* use setters */);
6803    /// ```
6804    pub fn set_body<T>(mut self, v: T) -> Self
6805    where
6806        T: std::convert::Into<wkt::Struct>,
6807    {
6808        self.body = std::option::Option::Some(v.into());
6809        self
6810    }
6811
6812    /// Sets or clears the value of [body][crate::model::ExecuteOntapPostRequest::body].
6813    ///
6814    /// # Example
6815    /// ```ignore,no_run
6816    /// # use google_cloud_netapp_v1::model::ExecuteOntapPostRequest;
6817    /// use wkt::Struct;
6818    /// let x = ExecuteOntapPostRequest::new().set_or_clear_body(Some(Struct::default()/* use setters */));
6819    /// let x = ExecuteOntapPostRequest::new().set_or_clear_body(None::<Struct>);
6820    /// ```
6821    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6822    where
6823        T: std::convert::Into<wkt::Struct>,
6824    {
6825        self.body = v.map(|x| x.into());
6826        self
6827    }
6828
6829    /// Sets the value of [ontap_path][crate::model::ExecuteOntapPostRequest::ontap_path].
6830    ///
6831    /// # Example
6832    /// ```ignore,no_run
6833    /// # use google_cloud_netapp_v1::model::ExecuteOntapPostRequest;
6834    /// let x = ExecuteOntapPostRequest::new().set_ontap_path("example");
6835    /// ```
6836    pub fn set_ontap_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6837        self.ontap_path = v.into();
6838        self
6839    }
6840}
6841
6842impl wkt::message::Message for ExecuteOntapPostRequest {
6843    fn typename() -> &'static str {
6844        "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapPostRequest"
6845    }
6846}
6847
6848/// Response message for `ExecuteOntapPost` API.
6849#[derive(Clone, Default, PartialEq)]
6850#[non_exhaustive]
6851pub struct ExecuteOntapPostResponse {
6852    /// The raw `JSON` body of the response.
6853    pub body: std::option::Option<wkt::Struct>,
6854
6855    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6856}
6857
6858impl ExecuteOntapPostResponse {
6859    /// Creates a new default instance.
6860    pub fn new() -> Self {
6861        std::default::Default::default()
6862    }
6863
6864    /// Sets the value of [body][crate::model::ExecuteOntapPostResponse::body].
6865    ///
6866    /// # Example
6867    /// ```ignore,no_run
6868    /// # use google_cloud_netapp_v1::model::ExecuteOntapPostResponse;
6869    /// use wkt::Struct;
6870    /// let x = ExecuteOntapPostResponse::new().set_body(Struct::default()/* use setters */);
6871    /// ```
6872    pub fn set_body<T>(mut self, v: T) -> Self
6873    where
6874        T: std::convert::Into<wkt::Struct>,
6875    {
6876        self.body = std::option::Option::Some(v.into());
6877        self
6878    }
6879
6880    /// Sets or clears the value of [body][crate::model::ExecuteOntapPostResponse::body].
6881    ///
6882    /// # Example
6883    /// ```ignore,no_run
6884    /// # use google_cloud_netapp_v1::model::ExecuteOntapPostResponse;
6885    /// use wkt::Struct;
6886    /// let x = ExecuteOntapPostResponse::new().set_or_clear_body(Some(Struct::default()/* use setters */));
6887    /// let x = ExecuteOntapPostResponse::new().set_or_clear_body(None::<Struct>);
6888    /// ```
6889    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6890    where
6891        T: std::convert::Into<wkt::Struct>,
6892    {
6893        self.body = v.map(|x| x.into());
6894        self
6895    }
6896}
6897
6898impl wkt::message::Message for ExecuteOntapPostResponse {
6899    fn typename() -> &'static str {
6900        "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapPostResponse"
6901    }
6902}
6903
6904/// Request message for `ExecuteOntapGet` API.
6905#[derive(Clone, Default, PartialEq)]
6906#[non_exhaustive]
6907pub struct ExecuteOntapGetRequest {
6908    /// Required. The resource path of the ONTAP resource.
6909    /// Format:
6910    /// `projects/{project_number}/locations/{location_id}/storagePools/{storage_pool_id}/ontap/{ontap_resource_path}`.
6911    /// For example:
6912    /// `projects/123456789/locations/us-central1/storagePools/my-storage-pool/ontap/api/storage/volumes`.
6913    pub ontap_path: std::string::String,
6914
6915    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6916}
6917
6918impl ExecuteOntapGetRequest {
6919    /// Creates a new default instance.
6920    pub fn new() -> Self {
6921        std::default::Default::default()
6922    }
6923
6924    /// Sets the value of [ontap_path][crate::model::ExecuteOntapGetRequest::ontap_path].
6925    ///
6926    /// # Example
6927    /// ```ignore,no_run
6928    /// # use google_cloud_netapp_v1::model::ExecuteOntapGetRequest;
6929    /// let x = ExecuteOntapGetRequest::new().set_ontap_path("example");
6930    /// ```
6931    pub fn set_ontap_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6932        self.ontap_path = v.into();
6933        self
6934    }
6935}
6936
6937impl wkt::message::Message for ExecuteOntapGetRequest {
6938    fn typename() -> &'static str {
6939        "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapGetRequest"
6940    }
6941}
6942
6943/// Response message for `ExecuteOntapGet` API.
6944#[derive(Clone, Default, PartialEq)]
6945#[non_exhaustive]
6946pub struct ExecuteOntapGetResponse {
6947    /// The raw `JSON` body of the response.
6948    pub body: std::option::Option<wkt::Struct>,
6949
6950    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6951}
6952
6953impl ExecuteOntapGetResponse {
6954    /// Creates a new default instance.
6955    pub fn new() -> Self {
6956        std::default::Default::default()
6957    }
6958
6959    /// Sets the value of [body][crate::model::ExecuteOntapGetResponse::body].
6960    ///
6961    /// # Example
6962    /// ```ignore,no_run
6963    /// # use google_cloud_netapp_v1::model::ExecuteOntapGetResponse;
6964    /// use wkt::Struct;
6965    /// let x = ExecuteOntapGetResponse::new().set_body(Struct::default()/* use setters */);
6966    /// ```
6967    pub fn set_body<T>(mut self, v: T) -> Self
6968    where
6969        T: std::convert::Into<wkt::Struct>,
6970    {
6971        self.body = std::option::Option::Some(v.into());
6972        self
6973    }
6974
6975    /// Sets or clears the value of [body][crate::model::ExecuteOntapGetResponse::body].
6976    ///
6977    /// # Example
6978    /// ```ignore,no_run
6979    /// # use google_cloud_netapp_v1::model::ExecuteOntapGetResponse;
6980    /// use wkt::Struct;
6981    /// let x = ExecuteOntapGetResponse::new().set_or_clear_body(Some(Struct::default()/* use setters */));
6982    /// let x = ExecuteOntapGetResponse::new().set_or_clear_body(None::<Struct>);
6983    /// ```
6984    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6985    where
6986        T: std::convert::Into<wkt::Struct>,
6987    {
6988        self.body = v.map(|x| x.into());
6989        self
6990    }
6991}
6992
6993impl wkt::message::Message for ExecuteOntapGetResponse {
6994    fn typename() -> &'static str {
6995        "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapGetResponse"
6996    }
6997}
6998
6999/// Request message for `ExecuteOntapDelete` API.
7000#[derive(Clone, Default, PartialEq)]
7001#[non_exhaustive]
7002pub struct ExecuteOntapDeleteRequest {
7003    /// Required. The resource path of the ONTAP resource.
7004    /// Format:
7005    /// `projects/{project_number}/locations/{location_id}/storagePools/{storage_pool_id}/ontap/{ontap_resource_path}`.
7006    /// For example:
7007    /// `projects/123456789/locations/us-central1/storagePools/my-storage-pool/ontap/api/storage/volumes`.
7008    pub ontap_path: std::string::String,
7009
7010    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7011}
7012
7013impl ExecuteOntapDeleteRequest {
7014    /// Creates a new default instance.
7015    pub fn new() -> Self {
7016        std::default::Default::default()
7017    }
7018
7019    /// Sets the value of [ontap_path][crate::model::ExecuteOntapDeleteRequest::ontap_path].
7020    ///
7021    /// # Example
7022    /// ```ignore,no_run
7023    /// # use google_cloud_netapp_v1::model::ExecuteOntapDeleteRequest;
7024    /// let x = ExecuteOntapDeleteRequest::new().set_ontap_path("example");
7025    /// ```
7026    pub fn set_ontap_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7027        self.ontap_path = v.into();
7028        self
7029    }
7030}
7031
7032impl wkt::message::Message for ExecuteOntapDeleteRequest {
7033    fn typename() -> &'static str {
7034        "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapDeleteRequest"
7035    }
7036}
7037
7038/// Response message for `ExecuteOntapDelete` API.
7039#[derive(Clone, Default, PartialEq)]
7040#[non_exhaustive]
7041pub struct ExecuteOntapDeleteResponse {
7042    /// The raw `JSON` body of the response.
7043    pub body: std::option::Option<wkt::Struct>,
7044
7045    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7046}
7047
7048impl ExecuteOntapDeleteResponse {
7049    /// Creates a new default instance.
7050    pub fn new() -> Self {
7051        std::default::Default::default()
7052    }
7053
7054    /// Sets the value of [body][crate::model::ExecuteOntapDeleteResponse::body].
7055    ///
7056    /// # Example
7057    /// ```ignore,no_run
7058    /// # use google_cloud_netapp_v1::model::ExecuteOntapDeleteResponse;
7059    /// use wkt::Struct;
7060    /// let x = ExecuteOntapDeleteResponse::new().set_body(Struct::default()/* use setters */);
7061    /// ```
7062    pub fn set_body<T>(mut self, v: T) -> Self
7063    where
7064        T: std::convert::Into<wkt::Struct>,
7065    {
7066        self.body = std::option::Option::Some(v.into());
7067        self
7068    }
7069
7070    /// Sets or clears the value of [body][crate::model::ExecuteOntapDeleteResponse::body].
7071    ///
7072    /// # Example
7073    /// ```ignore,no_run
7074    /// # use google_cloud_netapp_v1::model::ExecuteOntapDeleteResponse;
7075    /// use wkt::Struct;
7076    /// let x = ExecuteOntapDeleteResponse::new().set_or_clear_body(Some(Struct::default()/* use setters */));
7077    /// let x = ExecuteOntapDeleteResponse::new().set_or_clear_body(None::<Struct>);
7078    /// ```
7079    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7080    where
7081        T: std::convert::Into<wkt::Struct>,
7082    {
7083        self.body = v.map(|x| x.into());
7084        self
7085    }
7086}
7087
7088impl wkt::message::Message for ExecuteOntapDeleteResponse {
7089    fn typename() -> &'static str {
7090        "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapDeleteResponse"
7091    }
7092}
7093
7094/// Request message for `ExecuteOntapPatch` API.
7095#[derive(Clone, Default, PartialEq)]
7096#[non_exhaustive]
7097pub struct ExecuteOntapPatchRequest {
7098    /// Required. The raw `JSON` body of the request.
7099    /// The body should be in the format of the ONTAP resource.
7100    /// For example:
7101    ///
7102    /// ```norust
7103    /// {
7104    ///   "body": {
7105    ///     "field1": "value1",
7106    ///     "field2": "value2",
7107    ///   }
7108    /// }
7109    /// ```
7110    pub body: std::option::Option<wkt::Struct>,
7111
7112    /// Required. The resource path of the ONTAP resource.
7113    /// Format:
7114    /// `projects/{project_number}/locations/{location_id}/storagePools/{storage_pool_id}/ontap/{ontap_resource_path}`.
7115    /// For example:
7116    /// `projects/123456789/locations/us-central1/storagePools/my-storage-pool/ontap/api/storage/volumes`.
7117    pub ontap_path: std::string::String,
7118
7119    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7120}
7121
7122impl ExecuteOntapPatchRequest {
7123    /// Creates a new default instance.
7124    pub fn new() -> Self {
7125        std::default::Default::default()
7126    }
7127
7128    /// Sets the value of [body][crate::model::ExecuteOntapPatchRequest::body].
7129    ///
7130    /// # Example
7131    /// ```ignore,no_run
7132    /// # use google_cloud_netapp_v1::model::ExecuteOntapPatchRequest;
7133    /// use wkt::Struct;
7134    /// let x = ExecuteOntapPatchRequest::new().set_body(Struct::default()/* use setters */);
7135    /// ```
7136    pub fn set_body<T>(mut self, v: T) -> Self
7137    where
7138        T: std::convert::Into<wkt::Struct>,
7139    {
7140        self.body = std::option::Option::Some(v.into());
7141        self
7142    }
7143
7144    /// Sets or clears the value of [body][crate::model::ExecuteOntapPatchRequest::body].
7145    ///
7146    /// # Example
7147    /// ```ignore,no_run
7148    /// # use google_cloud_netapp_v1::model::ExecuteOntapPatchRequest;
7149    /// use wkt::Struct;
7150    /// let x = ExecuteOntapPatchRequest::new().set_or_clear_body(Some(Struct::default()/* use setters */));
7151    /// let x = ExecuteOntapPatchRequest::new().set_or_clear_body(None::<Struct>);
7152    /// ```
7153    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7154    where
7155        T: std::convert::Into<wkt::Struct>,
7156    {
7157        self.body = v.map(|x| x.into());
7158        self
7159    }
7160
7161    /// Sets the value of [ontap_path][crate::model::ExecuteOntapPatchRequest::ontap_path].
7162    ///
7163    /// # Example
7164    /// ```ignore,no_run
7165    /// # use google_cloud_netapp_v1::model::ExecuteOntapPatchRequest;
7166    /// let x = ExecuteOntapPatchRequest::new().set_ontap_path("example");
7167    /// ```
7168    pub fn set_ontap_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7169        self.ontap_path = v.into();
7170        self
7171    }
7172}
7173
7174impl wkt::message::Message for ExecuteOntapPatchRequest {
7175    fn typename() -> &'static str {
7176        "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapPatchRequest"
7177    }
7178}
7179
7180/// Response message for `ExecuteOntapPatch` API.
7181#[derive(Clone, Default, PartialEq)]
7182#[non_exhaustive]
7183pub struct ExecuteOntapPatchResponse {
7184    /// The raw `JSON` body of the response.
7185    pub body: std::option::Option<wkt::Struct>,
7186
7187    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7188}
7189
7190impl ExecuteOntapPatchResponse {
7191    /// Creates a new default instance.
7192    pub fn new() -> Self {
7193        std::default::Default::default()
7194    }
7195
7196    /// Sets the value of [body][crate::model::ExecuteOntapPatchResponse::body].
7197    ///
7198    /// # Example
7199    /// ```ignore,no_run
7200    /// # use google_cloud_netapp_v1::model::ExecuteOntapPatchResponse;
7201    /// use wkt::Struct;
7202    /// let x = ExecuteOntapPatchResponse::new().set_body(Struct::default()/* use setters */);
7203    /// ```
7204    pub fn set_body<T>(mut self, v: T) -> Self
7205    where
7206        T: std::convert::Into<wkt::Struct>,
7207    {
7208        self.body = std::option::Option::Some(v.into());
7209        self
7210    }
7211
7212    /// Sets or clears the value of [body][crate::model::ExecuteOntapPatchResponse::body].
7213    ///
7214    /// # Example
7215    /// ```ignore,no_run
7216    /// # use google_cloud_netapp_v1::model::ExecuteOntapPatchResponse;
7217    /// use wkt::Struct;
7218    /// let x = ExecuteOntapPatchResponse::new().set_or_clear_body(Some(Struct::default()/* use setters */));
7219    /// let x = ExecuteOntapPatchResponse::new().set_or_clear_body(None::<Struct>);
7220    /// ```
7221    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7222    where
7223        T: std::convert::Into<wkt::Struct>,
7224    {
7225        self.body = v.map(|x| x.into());
7226        self
7227    }
7228}
7229
7230impl wkt::message::Message for ExecuteOntapPatchResponse {
7231    fn typename() -> &'static str {
7232        "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapPatchResponse"
7233    }
7234}
7235
7236/// ListQuotaRulesRequest for listing quota rules.
7237#[derive(Clone, Default, PartialEq)]
7238#[non_exhaustive]
7239pub struct ListQuotaRulesRequest {
7240    /// Required. Parent value for ListQuotaRulesRequest
7241    pub parent: std::string::String,
7242
7243    /// Optional. Requested page size. Server may return fewer items than
7244    /// requested. If unspecified, the server will pick an appropriate default.
7245    pub page_size: i32,
7246
7247    /// Optional. A token identifying a page of results the server should return.
7248    pub page_token: std::string::String,
7249
7250    /// Optional. Filtering results
7251    pub filter: std::string::String,
7252
7253    /// Optional. Hint for how to order the results
7254    pub order_by: std::string::String,
7255
7256    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7257}
7258
7259impl ListQuotaRulesRequest {
7260    /// Creates a new default instance.
7261    pub fn new() -> Self {
7262        std::default::Default::default()
7263    }
7264
7265    /// Sets the value of [parent][crate::model::ListQuotaRulesRequest::parent].
7266    ///
7267    /// # Example
7268    /// ```ignore,no_run
7269    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
7270    /// # let project_id = "project_id";
7271    /// # let location_id = "location_id";
7272    /// # let volume_id = "volume_id";
7273    /// let x = ListQuotaRulesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
7274    /// ```
7275    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7276        self.parent = v.into();
7277        self
7278    }
7279
7280    /// Sets the value of [page_size][crate::model::ListQuotaRulesRequest::page_size].
7281    ///
7282    /// # Example
7283    /// ```ignore,no_run
7284    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
7285    /// let x = ListQuotaRulesRequest::new().set_page_size(42);
7286    /// ```
7287    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7288        self.page_size = v.into();
7289        self
7290    }
7291
7292    /// Sets the value of [page_token][crate::model::ListQuotaRulesRequest::page_token].
7293    ///
7294    /// # Example
7295    /// ```ignore,no_run
7296    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
7297    /// let x = ListQuotaRulesRequest::new().set_page_token("example");
7298    /// ```
7299    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7300        self.page_token = v.into();
7301        self
7302    }
7303
7304    /// Sets the value of [filter][crate::model::ListQuotaRulesRequest::filter].
7305    ///
7306    /// # Example
7307    /// ```ignore,no_run
7308    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
7309    /// let x = ListQuotaRulesRequest::new().set_filter("example");
7310    /// ```
7311    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7312        self.filter = v.into();
7313        self
7314    }
7315
7316    /// Sets the value of [order_by][crate::model::ListQuotaRulesRequest::order_by].
7317    ///
7318    /// # Example
7319    /// ```ignore,no_run
7320    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
7321    /// let x = ListQuotaRulesRequest::new().set_order_by("example");
7322    /// ```
7323    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7324        self.order_by = v.into();
7325        self
7326    }
7327}
7328
7329impl wkt::message::Message for ListQuotaRulesRequest {
7330    fn typename() -> &'static str {
7331        "type.googleapis.com/google.cloud.netapp.v1.ListQuotaRulesRequest"
7332    }
7333}
7334
7335/// ListQuotaRulesResponse is the response to a ListQuotaRulesRequest.
7336#[derive(Clone, Default, PartialEq)]
7337#[non_exhaustive]
7338pub struct ListQuotaRulesResponse {
7339    /// List of quota rules
7340    pub quota_rules: std::vec::Vec<crate::model::QuotaRule>,
7341
7342    /// A token identifying a page of results the server should return.
7343    pub next_page_token: std::string::String,
7344
7345    /// Locations that could not be reached.
7346    pub unreachable: std::vec::Vec<std::string::String>,
7347
7348    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7349}
7350
7351impl ListQuotaRulesResponse {
7352    /// Creates a new default instance.
7353    pub fn new() -> Self {
7354        std::default::Default::default()
7355    }
7356
7357    /// Sets the value of [quota_rules][crate::model::ListQuotaRulesResponse::quota_rules].
7358    ///
7359    /// # Example
7360    /// ```ignore,no_run
7361    /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
7362    /// use google_cloud_netapp_v1::model::QuotaRule;
7363    /// let x = ListQuotaRulesResponse::new()
7364    ///     .set_quota_rules([
7365    ///         QuotaRule::default()/* use setters */,
7366    ///         QuotaRule::default()/* use (different) setters */,
7367    ///     ]);
7368    /// ```
7369    pub fn set_quota_rules<T, V>(mut self, v: T) -> Self
7370    where
7371        T: std::iter::IntoIterator<Item = V>,
7372        V: std::convert::Into<crate::model::QuotaRule>,
7373    {
7374        use std::iter::Iterator;
7375        self.quota_rules = v.into_iter().map(|i| i.into()).collect();
7376        self
7377    }
7378
7379    /// Sets the value of [next_page_token][crate::model::ListQuotaRulesResponse::next_page_token].
7380    ///
7381    /// # Example
7382    /// ```ignore,no_run
7383    /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
7384    /// let x = ListQuotaRulesResponse::new().set_next_page_token("example");
7385    /// ```
7386    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7387        self.next_page_token = v.into();
7388        self
7389    }
7390
7391    /// Sets the value of [unreachable][crate::model::ListQuotaRulesResponse::unreachable].
7392    ///
7393    /// # Example
7394    /// ```ignore,no_run
7395    /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
7396    /// let x = ListQuotaRulesResponse::new().set_unreachable(["a", "b", "c"]);
7397    /// ```
7398    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7399    where
7400        T: std::iter::IntoIterator<Item = V>,
7401        V: std::convert::Into<std::string::String>,
7402    {
7403        use std::iter::Iterator;
7404        self.unreachable = v.into_iter().map(|i| i.into()).collect();
7405        self
7406    }
7407}
7408
7409impl wkt::message::Message for ListQuotaRulesResponse {
7410    fn typename() -> &'static str {
7411        "type.googleapis.com/google.cloud.netapp.v1.ListQuotaRulesResponse"
7412    }
7413}
7414
7415#[doc(hidden)]
7416impl google_cloud_gax::paginator::internal::PageableResponse for ListQuotaRulesResponse {
7417    type PageItem = crate::model::QuotaRule;
7418
7419    fn items(self) -> std::vec::Vec<Self::PageItem> {
7420        self.quota_rules
7421    }
7422
7423    fn next_page_token(&self) -> std::string::String {
7424        use std::clone::Clone;
7425        self.next_page_token.clone()
7426    }
7427}
7428
7429/// GetQuotaRuleRequest for getting a quota rule.
7430#[derive(Clone, Default, PartialEq)]
7431#[non_exhaustive]
7432pub struct GetQuotaRuleRequest {
7433    /// Required. Name of the quota rule
7434    pub name: std::string::String,
7435
7436    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7437}
7438
7439impl GetQuotaRuleRequest {
7440    /// Creates a new default instance.
7441    pub fn new() -> Self {
7442        std::default::Default::default()
7443    }
7444
7445    /// Sets the value of [name][crate::model::GetQuotaRuleRequest::name].
7446    ///
7447    /// # Example
7448    /// ```ignore,no_run
7449    /// # use google_cloud_netapp_v1::model::GetQuotaRuleRequest;
7450    /// # let project_id = "project_id";
7451    /// # let location_id = "location_id";
7452    /// # let volume_id = "volume_id";
7453    /// # let quota_rule_id = "quota_rule_id";
7454    /// let x = GetQuotaRuleRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/quotaRules/{quota_rule_id}"));
7455    /// ```
7456    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7457        self.name = v.into();
7458        self
7459    }
7460}
7461
7462impl wkt::message::Message for GetQuotaRuleRequest {
7463    fn typename() -> &'static str {
7464        "type.googleapis.com/google.cloud.netapp.v1.GetQuotaRuleRequest"
7465    }
7466}
7467
7468/// CreateQuotaRuleRequest for creating a quota rule.
7469#[derive(Clone, Default, PartialEq)]
7470#[non_exhaustive]
7471pub struct CreateQuotaRuleRequest {
7472    /// Required. Parent value for CreateQuotaRuleRequest
7473    pub parent: std::string::String,
7474
7475    /// Required. Fields of the to be created quota rule.
7476    pub quota_rule: std::option::Option<crate::model::QuotaRule>,
7477
7478    /// Required. ID of the quota rule to create. Must be unique within the parent
7479    /// resource. Must contain only letters, numbers, underscore and hyphen, with
7480    /// the first character a letter or underscore, the last a letter or underscore
7481    /// or a number, and a 63 character maximum.
7482    pub quota_rule_id: std::string::String,
7483
7484    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7485}
7486
7487impl CreateQuotaRuleRequest {
7488    /// Creates a new default instance.
7489    pub fn new() -> Self {
7490        std::default::Default::default()
7491    }
7492
7493    /// Sets the value of [parent][crate::model::CreateQuotaRuleRequest::parent].
7494    ///
7495    /// # Example
7496    /// ```ignore,no_run
7497    /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
7498    /// # let project_id = "project_id";
7499    /// # let location_id = "location_id";
7500    /// # let volume_id = "volume_id";
7501    /// let x = CreateQuotaRuleRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
7502    /// ```
7503    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7504        self.parent = v.into();
7505        self
7506    }
7507
7508    /// Sets the value of [quota_rule][crate::model::CreateQuotaRuleRequest::quota_rule].
7509    ///
7510    /// # Example
7511    /// ```ignore,no_run
7512    /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
7513    /// use google_cloud_netapp_v1::model::QuotaRule;
7514    /// let x = CreateQuotaRuleRequest::new().set_quota_rule(QuotaRule::default()/* use setters */);
7515    /// ```
7516    pub fn set_quota_rule<T>(mut self, v: T) -> Self
7517    where
7518        T: std::convert::Into<crate::model::QuotaRule>,
7519    {
7520        self.quota_rule = std::option::Option::Some(v.into());
7521        self
7522    }
7523
7524    /// Sets or clears the value of [quota_rule][crate::model::CreateQuotaRuleRequest::quota_rule].
7525    ///
7526    /// # Example
7527    /// ```ignore,no_run
7528    /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
7529    /// use google_cloud_netapp_v1::model::QuotaRule;
7530    /// let x = CreateQuotaRuleRequest::new().set_or_clear_quota_rule(Some(QuotaRule::default()/* use setters */));
7531    /// let x = CreateQuotaRuleRequest::new().set_or_clear_quota_rule(None::<QuotaRule>);
7532    /// ```
7533    pub fn set_or_clear_quota_rule<T>(mut self, v: std::option::Option<T>) -> Self
7534    where
7535        T: std::convert::Into<crate::model::QuotaRule>,
7536    {
7537        self.quota_rule = v.map(|x| x.into());
7538        self
7539    }
7540
7541    /// Sets the value of [quota_rule_id][crate::model::CreateQuotaRuleRequest::quota_rule_id].
7542    ///
7543    /// # Example
7544    /// ```ignore,no_run
7545    /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
7546    /// let x = CreateQuotaRuleRequest::new().set_quota_rule_id("example");
7547    /// ```
7548    pub fn set_quota_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7549        self.quota_rule_id = v.into();
7550        self
7551    }
7552}
7553
7554impl wkt::message::Message for CreateQuotaRuleRequest {
7555    fn typename() -> &'static str {
7556        "type.googleapis.com/google.cloud.netapp.v1.CreateQuotaRuleRequest"
7557    }
7558}
7559
7560/// UpdateQuotaRuleRequest for updating a quota rule.
7561#[derive(Clone, Default, PartialEq)]
7562#[non_exhaustive]
7563pub struct UpdateQuotaRuleRequest {
7564    /// Optional. Field mask is used to specify the fields to be overwritten in the
7565    /// Quota Rule resource by the update.
7566    /// The fields specified in the update_mask are relative to the resource, not
7567    /// the full request. A field will be overwritten if it is in the mask. If the
7568    /// user does not provide a mask then all fields will be overwritten.
7569    pub update_mask: std::option::Option<wkt::FieldMask>,
7570
7571    /// Required. The quota rule being updated
7572    pub quota_rule: std::option::Option<crate::model::QuotaRule>,
7573
7574    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7575}
7576
7577impl UpdateQuotaRuleRequest {
7578    /// Creates a new default instance.
7579    pub fn new() -> Self {
7580        std::default::Default::default()
7581    }
7582
7583    /// Sets the value of [update_mask][crate::model::UpdateQuotaRuleRequest::update_mask].
7584    ///
7585    /// # Example
7586    /// ```ignore,no_run
7587    /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
7588    /// use wkt::FieldMask;
7589    /// let x = UpdateQuotaRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7590    /// ```
7591    pub fn set_update_mask<T>(mut self, v: T) -> Self
7592    where
7593        T: std::convert::Into<wkt::FieldMask>,
7594    {
7595        self.update_mask = std::option::Option::Some(v.into());
7596        self
7597    }
7598
7599    /// Sets or clears the value of [update_mask][crate::model::UpdateQuotaRuleRequest::update_mask].
7600    ///
7601    /// # Example
7602    /// ```ignore,no_run
7603    /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
7604    /// use wkt::FieldMask;
7605    /// let x = UpdateQuotaRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7606    /// let x = UpdateQuotaRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7607    /// ```
7608    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7609    where
7610        T: std::convert::Into<wkt::FieldMask>,
7611    {
7612        self.update_mask = v.map(|x| x.into());
7613        self
7614    }
7615
7616    /// Sets the value of [quota_rule][crate::model::UpdateQuotaRuleRequest::quota_rule].
7617    ///
7618    /// # Example
7619    /// ```ignore,no_run
7620    /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
7621    /// use google_cloud_netapp_v1::model::QuotaRule;
7622    /// let x = UpdateQuotaRuleRequest::new().set_quota_rule(QuotaRule::default()/* use setters */);
7623    /// ```
7624    pub fn set_quota_rule<T>(mut self, v: T) -> Self
7625    where
7626        T: std::convert::Into<crate::model::QuotaRule>,
7627    {
7628        self.quota_rule = std::option::Option::Some(v.into());
7629        self
7630    }
7631
7632    /// Sets or clears the value of [quota_rule][crate::model::UpdateQuotaRuleRequest::quota_rule].
7633    ///
7634    /// # Example
7635    /// ```ignore,no_run
7636    /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
7637    /// use google_cloud_netapp_v1::model::QuotaRule;
7638    /// let x = UpdateQuotaRuleRequest::new().set_or_clear_quota_rule(Some(QuotaRule::default()/* use setters */));
7639    /// let x = UpdateQuotaRuleRequest::new().set_or_clear_quota_rule(None::<QuotaRule>);
7640    /// ```
7641    pub fn set_or_clear_quota_rule<T>(mut self, v: std::option::Option<T>) -> Self
7642    where
7643        T: std::convert::Into<crate::model::QuotaRule>,
7644    {
7645        self.quota_rule = v.map(|x| x.into());
7646        self
7647    }
7648}
7649
7650impl wkt::message::Message for UpdateQuotaRuleRequest {
7651    fn typename() -> &'static str {
7652        "type.googleapis.com/google.cloud.netapp.v1.UpdateQuotaRuleRequest"
7653    }
7654}
7655
7656/// DeleteQuotaRuleRequest for deleting a single quota rule.
7657#[derive(Clone, Default, PartialEq)]
7658#[non_exhaustive]
7659pub struct DeleteQuotaRuleRequest {
7660    /// Required. Name of the quota rule.
7661    pub name: std::string::String,
7662
7663    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7664}
7665
7666impl DeleteQuotaRuleRequest {
7667    /// Creates a new default instance.
7668    pub fn new() -> Self {
7669        std::default::Default::default()
7670    }
7671
7672    /// Sets the value of [name][crate::model::DeleteQuotaRuleRequest::name].
7673    ///
7674    /// # Example
7675    /// ```ignore,no_run
7676    /// # use google_cloud_netapp_v1::model::DeleteQuotaRuleRequest;
7677    /// # let project_id = "project_id";
7678    /// # let location_id = "location_id";
7679    /// # let volume_id = "volume_id";
7680    /// # let quota_rule_id = "quota_rule_id";
7681    /// let x = DeleteQuotaRuleRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/quotaRules/{quota_rule_id}"));
7682    /// ```
7683    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7684        self.name = v.into();
7685        self
7686    }
7687}
7688
7689impl wkt::message::Message for DeleteQuotaRuleRequest {
7690    fn typename() -> &'static str {
7691        "type.googleapis.com/google.cloud.netapp.v1.DeleteQuotaRuleRequest"
7692    }
7693}
7694
7695/// QuotaRule specifies the maximum disk space a user or group can use within a
7696/// volume. They can be used for creating default and individual quota rules.
7697#[derive(Clone, Default, PartialEq)]
7698#[non_exhaustive]
7699pub struct QuotaRule {
7700    /// Identifier. The resource name of the quota rule.
7701    /// Format:
7702    /// `projects/{project_number}/locations/{location_id}/volumes/volumes/{volume_id}/quotaRules/{quota_rule_id}`.
7703    pub name: std::string::String,
7704
7705    /// Optional. The quota rule applies to the specified user or group, identified
7706    /// by a Unix UID/GID, Windows SID, or null for default.
7707    pub target: std::string::String,
7708
7709    /// Required. The type of quota rule.
7710    pub r#type: crate::model::quota_rule::Type,
7711
7712    /// Required. The maximum allowed disk space in MiB.
7713    pub disk_limit_mib: i32,
7714
7715    /// Output only. State of the quota rule
7716    pub state: crate::model::quota_rule::State,
7717
7718    /// Output only. State details of the quota rule
7719    pub state_details: std::string::String,
7720
7721    /// Output only. Create time of the quota rule
7722    pub create_time: std::option::Option<wkt::Timestamp>,
7723
7724    /// Optional. Description of the quota rule
7725    pub description: std::string::String,
7726
7727    /// Optional. Labels of the quota rule
7728    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7729
7730    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7731}
7732
7733impl QuotaRule {
7734    /// Creates a new default instance.
7735    pub fn new() -> Self {
7736        std::default::Default::default()
7737    }
7738
7739    /// Sets the value of [name][crate::model::QuotaRule::name].
7740    ///
7741    /// # Example
7742    /// ```ignore,no_run
7743    /// # use google_cloud_netapp_v1::model::QuotaRule;
7744    /// # let project_id = "project_id";
7745    /// # let location_id = "location_id";
7746    /// # let volume_id = "volume_id";
7747    /// # let quota_rule_id = "quota_rule_id";
7748    /// let x = QuotaRule::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/quotaRules/{quota_rule_id}"));
7749    /// ```
7750    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7751        self.name = v.into();
7752        self
7753    }
7754
7755    /// Sets the value of [target][crate::model::QuotaRule::target].
7756    ///
7757    /// # Example
7758    /// ```ignore,no_run
7759    /// # use google_cloud_netapp_v1::model::QuotaRule;
7760    /// let x = QuotaRule::new().set_target("example");
7761    /// ```
7762    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7763        self.target = v.into();
7764        self
7765    }
7766
7767    /// Sets the value of [r#type][crate::model::QuotaRule::type].
7768    ///
7769    /// # Example
7770    /// ```ignore,no_run
7771    /// # use google_cloud_netapp_v1::model::QuotaRule;
7772    /// use google_cloud_netapp_v1::model::quota_rule::Type;
7773    /// let x0 = QuotaRule::new().set_type(Type::IndividualUserQuota);
7774    /// let x1 = QuotaRule::new().set_type(Type::IndividualGroupQuota);
7775    /// let x2 = QuotaRule::new().set_type(Type::DefaultUserQuota);
7776    /// ```
7777    pub fn set_type<T: std::convert::Into<crate::model::quota_rule::Type>>(mut self, v: T) -> Self {
7778        self.r#type = v.into();
7779        self
7780    }
7781
7782    /// Sets the value of [disk_limit_mib][crate::model::QuotaRule::disk_limit_mib].
7783    ///
7784    /// # Example
7785    /// ```ignore,no_run
7786    /// # use google_cloud_netapp_v1::model::QuotaRule;
7787    /// let x = QuotaRule::new().set_disk_limit_mib(42);
7788    /// ```
7789    pub fn set_disk_limit_mib<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7790        self.disk_limit_mib = v.into();
7791        self
7792    }
7793
7794    /// Sets the value of [state][crate::model::QuotaRule::state].
7795    ///
7796    /// # Example
7797    /// ```ignore,no_run
7798    /// # use google_cloud_netapp_v1::model::QuotaRule;
7799    /// use google_cloud_netapp_v1::model::quota_rule::State;
7800    /// let x0 = QuotaRule::new().set_state(State::Creating);
7801    /// let x1 = QuotaRule::new().set_state(State::Updating);
7802    /// let x2 = QuotaRule::new().set_state(State::Deleting);
7803    /// ```
7804    pub fn set_state<T: std::convert::Into<crate::model::quota_rule::State>>(
7805        mut self,
7806        v: T,
7807    ) -> Self {
7808        self.state = v.into();
7809        self
7810    }
7811
7812    /// Sets the value of [state_details][crate::model::QuotaRule::state_details].
7813    ///
7814    /// # Example
7815    /// ```ignore,no_run
7816    /// # use google_cloud_netapp_v1::model::QuotaRule;
7817    /// let x = QuotaRule::new().set_state_details("example");
7818    /// ```
7819    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7820        self.state_details = v.into();
7821        self
7822    }
7823
7824    /// Sets the value of [create_time][crate::model::QuotaRule::create_time].
7825    ///
7826    /// # Example
7827    /// ```ignore,no_run
7828    /// # use google_cloud_netapp_v1::model::QuotaRule;
7829    /// use wkt::Timestamp;
7830    /// let x = QuotaRule::new().set_create_time(Timestamp::default()/* use setters */);
7831    /// ```
7832    pub fn set_create_time<T>(mut self, v: T) -> Self
7833    where
7834        T: std::convert::Into<wkt::Timestamp>,
7835    {
7836        self.create_time = std::option::Option::Some(v.into());
7837        self
7838    }
7839
7840    /// Sets or clears the value of [create_time][crate::model::QuotaRule::create_time].
7841    ///
7842    /// # Example
7843    /// ```ignore,no_run
7844    /// # use google_cloud_netapp_v1::model::QuotaRule;
7845    /// use wkt::Timestamp;
7846    /// let x = QuotaRule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7847    /// let x = QuotaRule::new().set_or_clear_create_time(None::<Timestamp>);
7848    /// ```
7849    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7850    where
7851        T: std::convert::Into<wkt::Timestamp>,
7852    {
7853        self.create_time = v.map(|x| x.into());
7854        self
7855    }
7856
7857    /// Sets the value of [description][crate::model::QuotaRule::description].
7858    ///
7859    /// # Example
7860    /// ```ignore,no_run
7861    /// # use google_cloud_netapp_v1::model::QuotaRule;
7862    /// let x = QuotaRule::new().set_description("example");
7863    /// ```
7864    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7865        self.description = v.into();
7866        self
7867    }
7868
7869    /// Sets the value of [labels][crate::model::QuotaRule::labels].
7870    ///
7871    /// # Example
7872    /// ```ignore,no_run
7873    /// # use google_cloud_netapp_v1::model::QuotaRule;
7874    /// let x = QuotaRule::new().set_labels([
7875    ///     ("key0", "abc"),
7876    ///     ("key1", "xyz"),
7877    /// ]);
7878    /// ```
7879    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7880    where
7881        T: std::iter::IntoIterator<Item = (K, V)>,
7882        K: std::convert::Into<std::string::String>,
7883        V: std::convert::Into<std::string::String>,
7884    {
7885        use std::iter::Iterator;
7886        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7887        self
7888    }
7889}
7890
7891impl wkt::message::Message for QuotaRule {
7892    fn typename() -> &'static str {
7893        "type.googleapis.com/google.cloud.netapp.v1.QuotaRule"
7894    }
7895}
7896
7897/// Defines additional types related to [QuotaRule].
7898pub mod quota_rule {
7899    #[allow(unused_imports)]
7900    use super::*;
7901
7902    /// Types of Quota Rule
7903    ///
7904    /// # Working with unknown values
7905    ///
7906    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7907    /// additional enum variants at any time. Adding new variants is not considered
7908    /// a breaking change. Applications should write their code in anticipation of:
7909    ///
7910    /// - New values appearing in future releases of the client library, **and**
7911    /// - New values received dynamically, without application changes.
7912    ///
7913    /// Please consult the [Working with enums] section in the user guide for some
7914    /// guidelines.
7915    ///
7916    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7917    #[derive(Clone, Debug, PartialEq)]
7918    #[non_exhaustive]
7919    pub enum Type {
7920        /// Unspecified type for quota rule
7921        Unspecified,
7922        /// Individual user quota rule
7923        IndividualUserQuota,
7924        /// Individual group quota rule
7925        IndividualGroupQuota,
7926        /// Default user quota rule
7927        DefaultUserQuota,
7928        /// Default group quota rule
7929        DefaultGroupQuota,
7930        /// If set, the enum was initialized with an unknown value.
7931        ///
7932        /// Applications can examine the value using [Type::value] or
7933        /// [Type::name].
7934        UnknownValue(r#type::UnknownValue),
7935    }
7936
7937    #[doc(hidden)]
7938    pub mod r#type {
7939        #[allow(unused_imports)]
7940        use super::*;
7941        #[derive(Clone, Debug, PartialEq)]
7942        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7943    }
7944
7945    impl Type {
7946        /// Gets the enum value.
7947        ///
7948        /// Returns `None` if the enum contains an unknown value deserialized from
7949        /// the string representation of enums.
7950        pub fn value(&self) -> std::option::Option<i32> {
7951            match self {
7952                Self::Unspecified => std::option::Option::Some(0),
7953                Self::IndividualUserQuota => std::option::Option::Some(1),
7954                Self::IndividualGroupQuota => std::option::Option::Some(2),
7955                Self::DefaultUserQuota => std::option::Option::Some(3),
7956                Self::DefaultGroupQuota => std::option::Option::Some(4),
7957                Self::UnknownValue(u) => u.0.value(),
7958            }
7959        }
7960
7961        /// Gets the enum value as a string.
7962        ///
7963        /// Returns `None` if the enum contains an unknown value deserialized from
7964        /// the integer representation of enums.
7965        pub fn name(&self) -> std::option::Option<&str> {
7966            match self {
7967                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
7968                Self::IndividualUserQuota => std::option::Option::Some("INDIVIDUAL_USER_QUOTA"),
7969                Self::IndividualGroupQuota => std::option::Option::Some("INDIVIDUAL_GROUP_QUOTA"),
7970                Self::DefaultUserQuota => std::option::Option::Some("DEFAULT_USER_QUOTA"),
7971                Self::DefaultGroupQuota => std::option::Option::Some("DEFAULT_GROUP_QUOTA"),
7972                Self::UnknownValue(u) => u.0.name(),
7973            }
7974        }
7975    }
7976
7977    impl std::default::Default for Type {
7978        fn default() -> Self {
7979            use std::convert::From;
7980            Self::from(0)
7981        }
7982    }
7983
7984    impl std::fmt::Display for Type {
7985        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7986            wkt::internal::display_enum(f, self.name(), self.value())
7987        }
7988    }
7989
7990    impl std::convert::From<i32> for Type {
7991        fn from(value: i32) -> Self {
7992            match value {
7993                0 => Self::Unspecified,
7994                1 => Self::IndividualUserQuota,
7995                2 => Self::IndividualGroupQuota,
7996                3 => Self::DefaultUserQuota,
7997                4 => Self::DefaultGroupQuota,
7998                _ => Self::UnknownValue(r#type::UnknownValue(
7999                    wkt::internal::UnknownEnumValue::Integer(value),
8000                )),
8001            }
8002        }
8003    }
8004
8005    impl std::convert::From<&str> for Type {
8006        fn from(value: &str) -> Self {
8007            use std::string::ToString;
8008            match value {
8009                "TYPE_UNSPECIFIED" => Self::Unspecified,
8010                "INDIVIDUAL_USER_QUOTA" => Self::IndividualUserQuota,
8011                "INDIVIDUAL_GROUP_QUOTA" => Self::IndividualGroupQuota,
8012                "DEFAULT_USER_QUOTA" => Self::DefaultUserQuota,
8013                "DEFAULT_GROUP_QUOTA" => Self::DefaultGroupQuota,
8014                _ => Self::UnknownValue(r#type::UnknownValue(
8015                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8016                )),
8017            }
8018        }
8019    }
8020
8021    impl serde::ser::Serialize for Type {
8022        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8023        where
8024            S: serde::Serializer,
8025        {
8026            match self {
8027                Self::Unspecified => serializer.serialize_i32(0),
8028                Self::IndividualUserQuota => serializer.serialize_i32(1),
8029                Self::IndividualGroupQuota => serializer.serialize_i32(2),
8030                Self::DefaultUserQuota => serializer.serialize_i32(3),
8031                Self::DefaultGroupQuota => serializer.serialize_i32(4),
8032                Self::UnknownValue(u) => u.0.serialize(serializer),
8033            }
8034        }
8035    }
8036
8037    impl<'de> serde::de::Deserialize<'de> for Type {
8038        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8039        where
8040            D: serde::Deserializer<'de>,
8041        {
8042            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
8043                ".google.cloud.netapp.v1.QuotaRule.Type",
8044            ))
8045        }
8046    }
8047
8048    /// Quota Rule states
8049    ///
8050    /// # Working with unknown values
8051    ///
8052    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8053    /// additional enum variants at any time. Adding new variants is not considered
8054    /// a breaking change. Applications should write their code in anticipation of:
8055    ///
8056    /// - New values appearing in future releases of the client library, **and**
8057    /// - New values received dynamically, without application changes.
8058    ///
8059    /// Please consult the [Working with enums] section in the user guide for some
8060    /// guidelines.
8061    ///
8062    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8063    #[derive(Clone, Debug, PartialEq)]
8064    #[non_exhaustive]
8065    pub enum State {
8066        /// Unspecified state for quota rule
8067        Unspecified,
8068        /// Quota rule is creating
8069        Creating,
8070        /// Quota rule is updating
8071        Updating,
8072        /// Quota rule is deleting
8073        Deleting,
8074        /// Quota rule is ready
8075        Ready,
8076        /// Quota rule is in error state.
8077        Error,
8078        /// If set, the enum was initialized with an unknown value.
8079        ///
8080        /// Applications can examine the value using [State::value] or
8081        /// [State::name].
8082        UnknownValue(state::UnknownValue),
8083    }
8084
8085    #[doc(hidden)]
8086    pub mod state {
8087        #[allow(unused_imports)]
8088        use super::*;
8089        #[derive(Clone, Debug, PartialEq)]
8090        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8091    }
8092
8093    impl State {
8094        /// Gets the enum value.
8095        ///
8096        /// Returns `None` if the enum contains an unknown value deserialized from
8097        /// the string representation of enums.
8098        pub fn value(&self) -> std::option::Option<i32> {
8099            match self {
8100                Self::Unspecified => std::option::Option::Some(0),
8101                Self::Creating => std::option::Option::Some(1),
8102                Self::Updating => std::option::Option::Some(2),
8103                Self::Deleting => std::option::Option::Some(3),
8104                Self::Ready => std::option::Option::Some(4),
8105                Self::Error => std::option::Option::Some(5),
8106                Self::UnknownValue(u) => u.0.value(),
8107            }
8108        }
8109
8110        /// Gets the enum value as a string.
8111        ///
8112        /// Returns `None` if the enum contains an unknown value deserialized from
8113        /// the integer representation of enums.
8114        pub fn name(&self) -> std::option::Option<&str> {
8115            match self {
8116                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8117                Self::Creating => std::option::Option::Some("CREATING"),
8118                Self::Updating => std::option::Option::Some("UPDATING"),
8119                Self::Deleting => std::option::Option::Some("DELETING"),
8120                Self::Ready => std::option::Option::Some("READY"),
8121                Self::Error => std::option::Option::Some("ERROR"),
8122                Self::UnknownValue(u) => u.0.name(),
8123            }
8124        }
8125    }
8126
8127    impl std::default::Default for State {
8128        fn default() -> Self {
8129            use std::convert::From;
8130            Self::from(0)
8131        }
8132    }
8133
8134    impl std::fmt::Display for State {
8135        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8136            wkt::internal::display_enum(f, self.name(), self.value())
8137        }
8138    }
8139
8140    impl std::convert::From<i32> for State {
8141        fn from(value: i32) -> Self {
8142            match value {
8143                0 => Self::Unspecified,
8144                1 => Self::Creating,
8145                2 => Self::Updating,
8146                3 => Self::Deleting,
8147                4 => Self::Ready,
8148                5 => Self::Error,
8149                _ => Self::UnknownValue(state::UnknownValue(
8150                    wkt::internal::UnknownEnumValue::Integer(value),
8151                )),
8152            }
8153        }
8154    }
8155
8156    impl std::convert::From<&str> for State {
8157        fn from(value: &str) -> Self {
8158            use std::string::ToString;
8159            match value {
8160                "STATE_UNSPECIFIED" => Self::Unspecified,
8161                "CREATING" => Self::Creating,
8162                "UPDATING" => Self::Updating,
8163                "DELETING" => Self::Deleting,
8164                "READY" => Self::Ready,
8165                "ERROR" => Self::Error,
8166                _ => Self::UnknownValue(state::UnknownValue(
8167                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8168                )),
8169            }
8170        }
8171    }
8172
8173    impl serde::ser::Serialize for State {
8174        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8175        where
8176            S: serde::Serializer,
8177        {
8178            match self {
8179                Self::Unspecified => serializer.serialize_i32(0),
8180                Self::Creating => serializer.serialize_i32(1),
8181                Self::Updating => serializer.serialize_i32(2),
8182                Self::Deleting => serializer.serialize_i32(3),
8183                Self::Ready => serializer.serialize_i32(4),
8184                Self::Error => serializer.serialize_i32(5),
8185                Self::UnknownValue(u) => u.0.serialize(serializer),
8186            }
8187        }
8188    }
8189
8190    impl<'de> serde::de::Deserialize<'de> for State {
8191        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8192        where
8193            D: serde::Deserializer<'de>,
8194        {
8195            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8196                ".google.cloud.netapp.v1.QuotaRule.State",
8197            ))
8198        }
8199    }
8200}
8201
8202/// TransferStats reports all statistics related to replication transfer.
8203#[derive(Clone, Default, PartialEq)]
8204#[non_exhaustive]
8205pub struct TransferStats {
8206    /// Cumulative bytes transferred so far for the replication relationship.
8207    pub transfer_bytes: std::option::Option<i64>,
8208
8209    /// Cumulative time taken across all transfers for the replication
8210    /// relationship.
8211    pub total_transfer_duration: std::option::Option<wkt::Duration>,
8212
8213    /// Last transfer size in bytes.
8214    pub last_transfer_bytes: std::option::Option<i64>,
8215
8216    /// Time taken during last transfer.
8217    pub last_transfer_duration: std::option::Option<wkt::Duration>,
8218
8219    /// Lag duration indicates the duration by which Destination region volume
8220    /// content lags behind the primary region volume content.
8221    pub lag_duration: std::option::Option<wkt::Duration>,
8222
8223    /// Time when progress was updated last.
8224    pub update_time: std::option::Option<wkt::Timestamp>,
8225
8226    /// Time when last transfer completed.
8227    pub last_transfer_end_time: std::option::Option<wkt::Timestamp>,
8228
8229    /// A message describing the cause of the last transfer failure.
8230    pub last_transfer_error: std::option::Option<std::string::String>,
8231
8232    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8233}
8234
8235impl TransferStats {
8236    /// Creates a new default instance.
8237    pub fn new() -> Self {
8238        std::default::Default::default()
8239    }
8240
8241    /// Sets the value of [transfer_bytes][crate::model::TransferStats::transfer_bytes].
8242    ///
8243    /// # Example
8244    /// ```ignore,no_run
8245    /// # use google_cloud_netapp_v1::model::TransferStats;
8246    /// let x = TransferStats::new().set_transfer_bytes(42);
8247    /// ```
8248    pub fn set_transfer_bytes<T>(mut self, v: T) -> Self
8249    where
8250        T: std::convert::Into<i64>,
8251    {
8252        self.transfer_bytes = std::option::Option::Some(v.into());
8253        self
8254    }
8255
8256    /// Sets or clears the value of [transfer_bytes][crate::model::TransferStats::transfer_bytes].
8257    ///
8258    /// # Example
8259    /// ```ignore,no_run
8260    /// # use google_cloud_netapp_v1::model::TransferStats;
8261    /// let x = TransferStats::new().set_or_clear_transfer_bytes(Some(42));
8262    /// let x = TransferStats::new().set_or_clear_transfer_bytes(None::<i32>);
8263    /// ```
8264    pub fn set_or_clear_transfer_bytes<T>(mut self, v: std::option::Option<T>) -> Self
8265    where
8266        T: std::convert::Into<i64>,
8267    {
8268        self.transfer_bytes = v.map(|x| x.into());
8269        self
8270    }
8271
8272    /// Sets the value of [total_transfer_duration][crate::model::TransferStats::total_transfer_duration].
8273    ///
8274    /// # Example
8275    /// ```ignore,no_run
8276    /// # use google_cloud_netapp_v1::model::TransferStats;
8277    /// use wkt::Duration;
8278    /// let x = TransferStats::new().set_total_transfer_duration(Duration::default()/* use setters */);
8279    /// ```
8280    pub fn set_total_transfer_duration<T>(mut self, v: T) -> Self
8281    where
8282        T: std::convert::Into<wkt::Duration>,
8283    {
8284        self.total_transfer_duration = std::option::Option::Some(v.into());
8285        self
8286    }
8287
8288    /// Sets or clears the value of [total_transfer_duration][crate::model::TransferStats::total_transfer_duration].
8289    ///
8290    /// # Example
8291    /// ```ignore,no_run
8292    /// # use google_cloud_netapp_v1::model::TransferStats;
8293    /// use wkt::Duration;
8294    /// let x = TransferStats::new().set_or_clear_total_transfer_duration(Some(Duration::default()/* use setters */));
8295    /// let x = TransferStats::new().set_or_clear_total_transfer_duration(None::<Duration>);
8296    /// ```
8297    pub fn set_or_clear_total_transfer_duration<T>(mut self, v: std::option::Option<T>) -> Self
8298    where
8299        T: std::convert::Into<wkt::Duration>,
8300    {
8301        self.total_transfer_duration = v.map(|x| x.into());
8302        self
8303    }
8304
8305    /// Sets the value of [last_transfer_bytes][crate::model::TransferStats::last_transfer_bytes].
8306    ///
8307    /// # Example
8308    /// ```ignore,no_run
8309    /// # use google_cloud_netapp_v1::model::TransferStats;
8310    /// let x = TransferStats::new().set_last_transfer_bytes(42);
8311    /// ```
8312    pub fn set_last_transfer_bytes<T>(mut self, v: T) -> Self
8313    where
8314        T: std::convert::Into<i64>,
8315    {
8316        self.last_transfer_bytes = std::option::Option::Some(v.into());
8317        self
8318    }
8319
8320    /// Sets or clears the value of [last_transfer_bytes][crate::model::TransferStats::last_transfer_bytes].
8321    ///
8322    /// # Example
8323    /// ```ignore,no_run
8324    /// # use google_cloud_netapp_v1::model::TransferStats;
8325    /// let x = TransferStats::new().set_or_clear_last_transfer_bytes(Some(42));
8326    /// let x = TransferStats::new().set_or_clear_last_transfer_bytes(None::<i32>);
8327    /// ```
8328    pub fn set_or_clear_last_transfer_bytes<T>(mut self, v: std::option::Option<T>) -> Self
8329    where
8330        T: std::convert::Into<i64>,
8331    {
8332        self.last_transfer_bytes = v.map(|x| x.into());
8333        self
8334    }
8335
8336    /// Sets the value of [last_transfer_duration][crate::model::TransferStats::last_transfer_duration].
8337    ///
8338    /// # Example
8339    /// ```ignore,no_run
8340    /// # use google_cloud_netapp_v1::model::TransferStats;
8341    /// use wkt::Duration;
8342    /// let x = TransferStats::new().set_last_transfer_duration(Duration::default()/* use setters */);
8343    /// ```
8344    pub fn set_last_transfer_duration<T>(mut self, v: T) -> Self
8345    where
8346        T: std::convert::Into<wkt::Duration>,
8347    {
8348        self.last_transfer_duration = std::option::Option::Some(v.into());
8349        self
8350    }
8351
8352    /// Sets or clears the value of [last_transfer_duration][crate::model::TransferStats::last_transfer_duration].
8353    ///
8354    /// # Example
8355    /// ```ignore,no_run
8356    /// # use google_cloud_netapp_v1::model::TransferStats;
8357    /// use wkt::Duration;
8358    /// let x = TransferStats::new().set_or_clear_last_transfer_duration(Some(Duration::default()/* use setters */));
8359    /// let x = TransferStats::new().set_or_clear_last_transfer_duration(None::<Duration>);
8360    /// ```
8361    pub fn set_or_clear_last_transfer_duration<T>(mut self, v: std::option::Option<T>) -> Self
8362    where
8363        T: std::convert::Into<wkt::Duration>,
8364    {
8365        self.last_transfer_duration = v.map(|x| x.into());
8366        self
8367    }
8368
8369    /// Sets the value of [lag_duration][crate::model::TransferStats::lag_duration].
8370    ///
8371    /// # Example
8372    /// ```ignore,no_run
8373    /// # use google_cloud_netapp_v1::model::TransferStats;
8374    /// use wkt::Duration;
8375    /// let x = TransferStats::new().set_lag_duration(Duration::default()/* use setters */);
8376    /// ```
8377    pub fn set_lag_duration<T>(mut self, v: T) -> Self
8378    where
8379        T: std::convert::Into<wkt::Duration>,
8380    {
8381        self.lag_duration = std::option::Option::Some(v.into());
8382        self
8383    }
8384
8385    /// Sets or clears the value of [lag_duration][crate::model::TransferStats::lag_duration].
8386    ///
8387    /// # Example
8388    /// ```ignore,no_run
8389    /// # use google_cloud_netapp_v1::model::TransferStats;
8390    /// use wkt::Duration;
8391    /// let x = TransferStats::new().set_or_clear_lag_duration(Some(Duration::default()/* use setters */));
8392    /// let x = TransferStats::new().set_or_clear_lag_duration(None::<Duration>);
8393    /// ```
8394    pub fn set_or_clear_lag_duration<T>(mut self, v: std::option::Option<T>) -> Self
8395    where
8396        T: std::convert::Into<wkt::Duration>,
8397    {
8398        self.lag_duration = v.map(|x| x.into());
8399        self
8400    }
8401
8402    /// Sets the value of [update_time][crate::model::TransferStats::update_time].
8403    ///
8404    /// # Example
8405    /// ```ignore,no_run
8406    /// # use google_cloud_netapp_v1::model::TransferStats;
8407    /// use wkt::Timestamp;
8408    /// let x = TransferStats::new().set_update_time(Timestamp::default()/* use setters */);
8409    /// ```
8410    pub fn set_update_time<T>(mut self, v: T) -> Self
8411    where
8412        T: std::convert::Into<wkt::Timestamp>,
8413    {
8414        self.update_time = std::option::Option::Some(v.into());
8415        self
8416    }
8417
8418    /// Sets or clears the value of [update_time][crate::model::TransferStats::update_time].
8419    ///
8420    /// # Example
8421    /// ```ignore,no_run
8422    /// # use google_cloud_netapp_v1::model::TransferStats;
8423    /// use wkt::Timestamp;
8424    /// let x = TransferStats::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8425    /// let x = TransferStats::new().set_or_clear_update_time(None::<Timestamp>);
8426    /// ```
8427    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8428    where
8429        T: std::convert::Into<wkt::Timestamp>,
8430    {
8431        self.update_time = v.map(|x| x.into());
8432        self
8433    }
8434
8435    /// Sets the value of [last_transfer_end_time][crate::model::TransferStats::last_transfer_end_time].
8436    ///
8437    /// # Example
8438    /// ```ignore,no_run
8439    /// # use google_cloud_netapp_v1::model::TransferStats;
8440    /// use wkt::Timestamp;
8441    /// let x = TransferStats::new().set_last_transfer_end_time(Timestamp::default()/* use setters */);
8442    /// ```
8443    pub fn set_last_transfer_end_time<T>(mut self, v: T) -> Self
8444    where
8445        T: std::convert::Into<wkt::Timestamp>,
8446    {
8447        self.last_transfer_end_time = std::option::Option::Some(v.into());
8448        self
8449    }
8450
8451    /// Sets or clears the value of [last_transfer_end_time][crate::model::TransferStats::last_transfer_end_time].
8452    ///
8453    /// # Example
8454    /// ```ignore,no_run
8455    /// # use google_cloud_netapp_v1::model::TransferStats;
8456    /// use wkt::Timestamp;
8457    /// let x = TransferStats::new().set_or_clear_last_transfer_end_time(Some(Timestamp::default()/* use setters */));
8458    /// let x = TransferStats::new().set_or_clear_last_transfer_end_time(None::<Timestamp>);
8459    /// ```
8460    pub fn set_or_clear_last_transfer_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8461    where
8462        T: std::convert::Into<wkt::Timestamp>,
8463    {
8464        self.last_transfer_end_time = v.map(|x| x.into());
8465        self
8466    }
8467
8468    /// Sets the value of [last_transfer_error][crate::model::TransferStats::last_transfer_error].
8469    ///
8470    /// # Example
8471    /// ```ignore,no_run
8472    /// # use google_cloud_netapp_v1::model::TransferStats;
8473    /// let x = TransferStats::new().set_last_transfer_error("example");
8474    /// ```
8475    pub fn set_last_transfer_error<T>(mut self, v: T) -> Self
8476    where
8477        T: std::convert::Into<std::string::String>,
8478    {
8479        self.last_transfer_error = std::option::Option::Some(v.into());
8480        self
8481    }
8482
8483    /// Sets or clears the value of [last_transfer_error][crate::model::TransferStats::last_transfer_error].
8484    ///
8485    /// # Example
8486    /// ```ignore,no_run
8487    /// # use google_cloud_netapp_v1::model::TransferStats;
8488    /// let x = TransferStats::new().set_or_clear_last_transfer_error(Some("example"));
8489    /// let x = TransferStats::new().set_or_clear_last_transfer_error(None::<String>);
8490    /// ```
8491    pub fn set_or_clear_last_transfer_error<T>(mut self, v: std::option::Option<T>) -> Self
8492    where
8493        T: std::convert::Into<std::string::String>,
8494    {
8495        self.last_transfer_error = v.map(|x| x.into());
8496        self
8497    }
8498}
8499
8500impl wkt::message::Message for TransferStats {
8501    fn typename() -> &'static str {
8502        "type.googleapis.com/google.cloud.netapp.v1.TransferStats"
8503    }
8504}
8505
8506/// Replication is a nested resource under Volume, that describes a
8507/// cross-region replication relationship between 2 volumes in different
8508/// regions.
8509#[derive(Clone, Default, PartialEq)]
8510#[non_exhaustive]
8511pub struct Replication {
8512    /// Identifier. The resource name of the Replication.
8513    /// Format:
8514    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}`.
8515    pub name: std::string::String,
8516
8517    /// Output only. State of the replication.
8518    pub state: crate::model::replication::State,
8519
8520    /// Output only. State details of the replication.
8521    pub state_details: std::string::String,
8522
8523    /// Output only. Indicates whether this points to source or destination.
8524    pub role: crate::model::replication::ReplicationRole,
8525
8526    /// Required. Indicates the schedule for replication.
8527    pub replication_schedule: crate::model::replication::ReplicationSchedule,
8528
8529    /// Output only. Indicates the state of mirroring.
8530    pub mirror_state: crate::model::replication::MirrorState,
8531
8532    /// Output only. Condition of the relationship. Can be one of the following:
8533    ///
8534    /// - true: The replication relationship is healthy. It has not missed the most
8535    ///   recent scheduled transfer.
8536    /// - false: The replication relationship is not healthy. It has missed the
8537    ///   most recent scheduled transfer.
8538    pub healthy: std::option::Option<bool>,
8539
8540    /// Output only. Replication create time.
8541    pub create_time: std::option::Option<wkt::Timestamp>,
8542
8543    /// Output only. Full name of destination volume resource.
8544    /// Example : "projects/{project}/locations/{location}/volumes/{volume_id}"
8545    pub destination_volume: std::string::String,
8546
8547    /// Output only. Replication transfer statistics.
8548    pub transfer_stats: std::option::Option<crate::model::TransferStats>,
8549
8550    /// Resource labels to represent user provided metadata.
8551    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8552
8553    /// A description about this replication relationship.
8554    pub description: std::option::Option<std::string::String>,
8555
8556    /// Required. Input only. Destination volume parameters
8557    pub destination_volume_parameters:
8558        std::option::Option<crate::model::DestinationVolumeParameters>,
8559
8560    /// Output only. Full name of source volume resource.
8561    /// Example : "projects/{project}/locations/{location}/volumes/{volume_id}"
8562    pub source_volume: std::string::String,
8563
8564    /// Output only. Hybrid peering details.
8565    pub hybrid_peering_details: std::option::Option<crate::model::HybridPeeringDetails>,
8566
8567    /// Optional. Location of the user cluster.
8568    pub cluster_location: std::string::String,
8569
8570    /// Output only. Type of the hybrid replication.
8571    pub hybrid_replication_type: crate::model::replication::HybridReplicationType,
8572
8573    /// Output only. Copy pastable snapmirror commands to be executed on onprem
8574    /// cluster by the customer.
8575    pub hybrid_replication_user_commands: std::option::Option<crate::model::UserCommands>,
8576
8577    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8578}
8579
8580impl Replication {
8581    /// Creates a new default instance.
8582    pub fn new() -> Self {
8583        std::default::Default::default()
8584    }
8585
8586    /// Sets the value of [name][crate::model::Replication::name].
8587    ///
8588    /// # Example
8589    /// ```ignore,no_run
8590    /// # use google_cloud_netapp_v1::model::Replication;
8591    /// # let project_id = "project_id";
8592    /// # let location_id = "location_id";
8593    /// # let volume_id = "volume_id";
8594    /// # let replication_id = "replication_id";
8595    /// let x = Replication::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/replications/{replication_id}"));
8596    /// ```
8597    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8598        self.name = v.into();
8599        self
8600    }
8601
8602    /// Sets the value of [state][crate::model::Replication::state].
8603    ///
8604    /// # Example
8605    /// ```ignore,no_run
8606    /// # use google_cloud_netapp_v1::model::Replication;
8607    /// use google_cloud_netapp_v1::model::replication::State;
8608    /// let x0 = Replication::new().set_state(State::Creating);
8609    /// let x1 = Replication::new().set_state(State::Ready);
8610    /// let x2 = Replication::new().set_state(State::Updating);
8611    /// ```
8612    pub fn set_state<T: std::convert::Into<crate::model::replication::State>>(
8613        mut self,
8614        v: T,
8615    ) -> Self {
8616        self.state = v.into();
8617        self
8618    }
8619
8620    /// Sets the value of [state_details][crate::model::Replication::state_details].
8621    ///
8622    /// # Example
8623    /// ```ignore,no_run
8624    /// # use google_cloud_netapp_v1::model::Replication;
8625    /// let x = Replication::new().set_state_details("example");
8626    /// ```
8627    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8628        self.state_details = v.into();
8629        self
8630    }
8631
8632    /// Sets the value of [role][crate::model::Replication::role].
8633    ///
8634    /// # Example
8635    /// ```ignore,no_run
8636    /// # use google_cloud_netapp_v1::model::Replication;
8637    /// use google_cloud_netapp_v1::model::replication::ReplicationRole;
8638    /// let x0 = Replication::new().set_role(ReplicationRole::Source);
8639    /// let x1 = Replication::new().set_role(ReplicationRole::Destination);
8640    /// ```
8641    pub fn set_role<T: std::convert::Into<crate::model::replication::ReplicationRole>>(
8642        mut self,
8643        v: T,
8644    ) -> Self {
8645        self.role = v.into();
8646        self
8647    }
8648
8649    /// Sets the value of [replication_schedule][crate::model::Replication::replication_schedule].
8650    ///
8651    /// # Example
8652    /// ```ignore,no_run
8653    /// # use google_cloud_netapp_v1::model::Replication;
8654    /// use google_cloud_netapp_v1::model::replication::ReplicationSchedule;
8655    /// let x0 = Replication::new().set_replication_schedule(ReplicationSchedule::Every10Minutes);
8656    /// let x1 = Replication::new().set_replication_schedule(ReplicationSchedule::Hourly);
8657    /// let x2 = Replication::new().set_replication_schedule(ReplicationSchedule::Daily);
8658    /// ```
8659    pub fn set_replication_schedule<
8660        T: std::convert::Into<crate::model::replication::ReplicationSchedule>,
8661    >(
8662        mut self,
8663        v: T,
8664    ) -> Self {
8665        self.replication_schedule = v.into();
8666        self
8667    }
8668
8669    /// Sets the value of [mirror_state][crate::model::Replication::mirror_state].
8670    ///
8671    /// # Example
8672    /// ```ignore,no_run
8673    /// # use google_cloud_netapp_v1::model::Replication;
8674    /// use google_cloud_netapp_v1::model::replication::MirrorState;
8675    /// let x0 = Replication::new().set_mirror_state(MirrorState::Preparing);
8676    /// let x1 = Replication::new().set_mirror_state(MirrorState::Mirrored);
8677    /// let x2 = Replication::new().set_mirror_state(MirrorState::Stopped);
8678    /// ```
8679    pub fn set_mirror_state<T: std::convert::Into<crate::model::replication::MirrorState>>(
8680        mut self,
8681        v: T,
8682    ) -> Self {
8683        self.mirror_state = v.into();
8684        self
8685    }
8686
8687    /// Sets the value of [healthy][crate::model::Replication::healthy].
8688    ///
8689    /// # Example
8690    /// ```ignore,no_run
8691    /// # use google_cloud_netapp_v1::model::Replication;
8692    /// let x = Replication::new().set_healthy(true);
8693    /// ```
8694    pub fn set_healthy<T>(mut self, v: T) -> Self
8695    where
8696        T: std::convert::Into<bool>,
8697    {
8698        self.healthy = std::option::Option::Some(v.into());
8699        self
8700    }
8701
8702    /// Sets or clears the value of [healthy][crate::model::Replication::healthy].
8703    ///
8704    /// # Example
8705    /// ```ignore,no_run
8706    /// # use google_cloud_netapp_v1::model::Replication;
8707    /// let x = Replication::new().set_or_clear_healthy(Some(false));
8708    /// let x = Replication::new().set_or_clear_healthy(None::<bool>);
8709    /// ```
8710    pub fn set_or_clear_healthy<T>(mut self, v: std::option::Option<T>) -> Self
8711    where
8712        T: std::convert::Into<bool>,
8713    {
8714        self.healthy = v.map(|x| x.into());
8715        self
8716    }
8717
8718    /// Sets the value of [create_time][crate::model::Replication::create_time].
8719    ///
8720    /// # Example
8721    /// ```ignore,no_run
8722    /// # use google_cloud_netapp_v1::model::Replication;
8723    /// use wkt::Timestamp;
8724    /// let x = Replication::new().set_create_time(Timestamp::default()/* use setters */);
8725    /// ```
8726    pub fn set_create_time<T>(mut self, v: T) -> Self
8727    where
8728        T: std::convert::Into<wkt::Timestamp>,
8729    {
8730        self.create_time = std::option::Option::Some(v.into());
8731        self
8732    }
8733
8734    /// Sets or clears the value of [create_time][crate::model::Replication::create_time].
8735    ///
8736    /// # Example
8737    /// ```ignore,no_run
8738    /// # use google_cloud_netapp_v1::model::Replication;
8739    /// use wkt::Timestamp;
8740    /// let x = Replication::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8741    /// let x = Replication::new().set_or_clear_create_time(None::<Timestamp>);
8742    /// ```
8743    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8744    where
8745        T: std::convert::Into<wkt::Timestamp>,
8746    {
8747        self.create_time = v.map(|x| x.into());
8748        self
8749    }
8750
8751    /// Sets the value of [destination_volume][crate::model::Replication::destination_volume].
8752    ///
8753    /// # Example
8754    /// ```ignore,no_run
8755    /// # use google_cloud_netapp_v1::model::Replication;
8756    /// # let project_id = "project_id";
8757    /// # let location_id = "location_id";
8758    /// # let volume_id = "volume_id";
8759    /// let x = Replication::new().set_destination_volume(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
8760    /// ```
8761    pub fn set_destination_volume<T: std::convert::Into<std::string::String>>(
8762        mut self,
8763        v: T,
8764    ) -> Self {
8765        self.destination_volume = v.into();
8766        self
8767    }
8768
8769    /// Sets the value of [transfer_stats][crate::model::Replication::transfer_stats].
8770    ///
8771    /// # Example
8772    /// ```ignore,no_run
8773    /// # use google_cloud_netapp_v1::model::Replication;
8774    /// use google_cloud_netapp_v1::model::TransferStats;
8775    /// let x = Replication::new().set_transfer_stats(TransferStats::default()/* use setters */);
8776    /// ```
8777    pub fn set_transfer_stats<T>(mut self, v: T) -> Self
8778    where
8779        T: std::convert::Into<crate::model::TransferStats>,
8780    {
8781        self.transfer_stats = std::option::Option::Some(v.into());
8782        self
8783    }
8784
8785    /// Sets or clears the value of [transfer_stats][crate::model::Replication::transfer_stats].
8786    ///
8787    /// # Example
8788    /// ```ignore,no_run
8789    /// # use google_cloud_netapp_v1::model::Replication;
8790    /// use google_cloud_netapp_v1::model::TransferStats;
8791    /// let x = Replication::new().set_or_clear_transfer_stats(Some(TransferStats::default()/* use setters */));
8792    /// let x = Replication::new().set_or_clear_transfer_stats(None::<TransferStats>);
8793    /// ```
8794    pub fn set_or_clear_transfer_stats<T>(mut self, v: std::option::Option<T>) -> Self
8795    where
8796        T: std::convert::Into<crate::model::TransferStats>,
8797    {
8798        self.transfer_stats = v.map(|x| x.into());
8799        self
8800    }
8801
8802    /// Sets the value of [labels][crate::model::Replication::labels].
8803    ///
8804    /// # Example
8805    /// ```ignore,no_run
8806    /// # use google_cloud_netapp_v1::model::Replication;
8807    /// let x = Replication::new().set_labels([
8808    ///     ("key0", "abc"),
8809    ///     ("key1", "xyz"),
8810    /// ]);
8811    /// ```
8812    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8813    where
8814        T: std::iter::IntoIterator<Item = (K, V)>,
8815        K: std::convert::Into<std::string::String>,
8816        V: std::convert::Into<std::string::String>,
8817    {
8818        use std::iter::Iterator;
8819        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8820        self
8821    }
8822
8823    /// Sets the value of [description][crate::model::Replication::description].
8824    ///
8825    /// # Example
8826    /// ```ignore,no_run
8827    /// # use google_cloud_netapp_v1::model::Replication;
8828    /// let x = Replication::new().set_description("example");
8829    /// ```
8830    pub fn set_description<T>(mut self, v: T) -> Self
8831    where
8832        T: std::convert::Into<std::string::String>,
8833    {
8834        self.description = std::option::Option::Some(v.into());
8835        self
8836    }
8837
8838    /// Sets or clears the value of [description][crate::model::Replication::description].
8839    ///
8840    /// # Example
8841    /// ```ignore,no_run
8842    /// # use google_cloud_netapp_v1::model::Replication;
8843    /// let x = Replication::new().set_or_clear_description(Some("example"));
8844    /// let x = Replication::new().set_or_clear_description(None::<String>);
8845    /// ```
8846    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
8847    where
8848        T: std::convert::Into<std::string::String>,
8849    {
8850        self.description = v.map(|x| x.into());
8851        self
8852    }
8853
8854    /// Sets the value of [destination_volume_parameters][crate::model::Replication::destination_volume_parameters].
8855    ///
8856    /// # Example
8857    /// ```ignore,no_run
8858    /// # use google_cloud_netapp_v1::model::Replication;
8859    /// use google_cloud_netapp_v1::model::DestinationVolumeParameters;
8860    /// let x = Replication::new().set_destination_volume_parameters(DestinationVolumeParameters::default()/* use setters */);
8861    /// ```
8862    pub fn set_destination_volume_parameters<T>(mut self, v: T) -> Self
8863    where
8864        T: std::convert::Into<crate::model::DestinationVolumeParameters>,
8865    {
8866        self.destination_volume_parameters = std::option::Option::Some(v.into());
8867        self
8868    }
8869
8870    /// Sets or clears the value of [destination_volume_parameters][crate::model::Replication::destination_volume_parameters].
8871    ///
8872    /// # Example
8873    /// ```ignore,no_run
8874    /// # use google_cloud_netapp_v1::model::Replication;
8875    /// use google_cloud_netapp_v1::model::DestinationVolumeParameters;
8876    /// let x = Replication::new().set_or_clear_destination_volume_parameters(Some(DestinationVolumeParameters::default()/* use setters */));
8877    /// let x = Replication::new().set_or_clear_destination_volume_parameters(None::<DestinationVolumeParameters>);
8878    /// ```
8879    pub fn set_or_clear_destination_volume_parameters<T>(
8880        mut self,
8881        v: std::option::Option<T>,
8882    ) -> Self
8883    where
8884        T: std::convert::Into<crate::model::DestinationVolumeParameters>,
8885    {
8886        self.destination_volume_parameters = v.map(|x| x.into());
8887        self
8888    }
8889
8890    /// Sets the value of [source_volume][crate::model::Replication::source_volume].
8891    ///
8892    /// # Example
8893    /// ```ignore,no_run
8894    /// # use google_cloud_netapp_v1::model::Replication;
8895    /// # let project_id = "project_id";
8896    /// # let location_id = "location_id";
8897    /// # let volume_id = "volume_id";
8898    /// let x = Replication::new().set_source_volume(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
8899    /// ```
8900    pub fn set_source_volume<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8901        self.source_volume = v.into();
8902        self
8903    }
8904
8905    /// Sets the value of [hybrid_peering_details][crate::model::Replication::hybrid_peering_details].
8906    ///
8907    /// # Example
8908    /// ```ignore,no_run
8909    /// # use google_cloud_netapp_v1::model::Replication;
8910    /// use google_cloud_netapp_v1::model::HybridPeeringDetails;
8911    /// let x = Replication::new().set_hybrid_peering_details(HybridPeeringDetails::default()/* use setters */);
8912    /// ```
8913    pub fn set_hybrid_peering_details<T>(mut self, v: T) -> Self
8914    where
8915        T: std::convert::Into<crate::model::HybridPeeringDetails>,
8916    {
8917        self.hybrid_peering_details = std::option::Option::Some(v.into());
8918        self
8919    }
8920
8921    /// Sets or clears the value of [hybrid_peering_details][crate::model::Replication::hybrid_peering_details].
8922    ///
8923    /// # Example
8924    /// ```ignore,no_run
8925    /// # use google_cloud_netapp_v1::model::Replication;
8926    /// use google_cloud_netapp_v1::model::HybridPeeringDetails;
8927    /// let x = Replication::new().set_or_clear_hybrid_peering_details(Some(HybridPeeringDetails::default()/* use setters */));
8928    /// let x = Replication::new().set_or_clear_hybrid_peering_details(None::<HybridPeeringDetails>);
8929    /// ```
8930    pub fn set_or_clear_hybrid_peering_details<T>(mut self, v: std::option::Option<T>) -> Self
8931    where
8932        T: std::convert::Into<crate::model::HybridPeeringDetails>,
8933    {
8934        self.hybrid_peering_details = v.map(|x| x.into());
8935        self
8936    }
8937
8938    /// Sets the value of [cluster_location][crate::model::Replication::cluster_location].
8939    ///
8940    /// # Example
8941    /// ```ignore,no_run
8942    /// # use google_cloud_netapp_v1::model::Replication;
8943    /// let x = Replication::new().set_cluster_location("example");
8944    /// ```
8945    pub fn set_cluster_location<T: std::convert::Into<std::string::String>>(
8946        mut self,
8947        v: T,
8948    ) -> Self {
8949        self.cluster_location = v.into();
8950        self
8951    }
8952
8953    /// Sets the value of [hybrid_replication_type][crate::model::Replication::hybrid_replication_type].
8954    ///
8955    /// # Example
8956    /// ```ignore,no_run
8957    /// # use google_cloud_netapp_v1::model::Replication;
8958    /// use google_cloud_netapp_v1::model::replication::HybridReplicationType;
8959    /// let x0 = Replication::new().set_hybrid_replication_type(HybridReplicationType::Migration);
8960    /// let x1 = Replication::new().set_hybrid_replication_type(HybridReplicationType::ContinuousReplication);
8961    /// let x2 = Replication::new().set_hybrid_replication_type(HybridReplicationType::OnpremReplication);
8962    /// ```
8963    pub fn set_hybrid_replication_type<
8964        T: std::convert::Into<crate::model::replication::HybridReplicationType>,
8965    >(
8966        mut self,
8967        v: T,
8968    ) -> Self {
8969        self.hybrid_replication_type = v.into();
8970        self
8971    }
8972
8973    /// Sets the value of [hybrid_replication_user_commands][crate::model::Replication::hybrid_replication_user_commands].
8974    ///
8975    /// # Example
8976    /// ```ignore,no_run
8977    /// # use google_cloud_netapp_v1::model::Replication;
8978    /// use google_cloud_netapp_v1::model::UserCommands;
8979    /// let x = Replication::new().set_hybrid_replication_user_commands(UserCommands::default()/* use setters */);
8980    /// ```
8981    pub fn set_hybrid_replication_user_commands<T>(mut self, v: T) -> Self
8982    where
8983        T: std::convert::Into<crate::model::UserCommands>,
8984    {
8985        self.hybrid_replication_user_commands = std::option::Option::Some(v.into());
8986        self
8987    }
8988
8989    /// Sets or clears the value of [hybrid_replication_user_commands][crate::model::Replication::hybrid_replication_user_commands].
8990    ///
8991    /// # Example
8992    /// ```ignore,no_run
8993    /// # use google_cloud_netapp_v1::model::Replication;
8994    /// use google_cloud_netapp_v1::model::UserCommands;
8995    /// let x = Replication::new().set_or_clear_hybrid_replication_user_commands(Some(UserCommands::default()/* use setters */));
8996    /// let x = Replication::new().set_or_clear_hybrid_replication_user_commands(None::<UserCommands>);
8997    /// ```
8998    pub fn set_or_clear_hybrid_replication_user_commands<T>(
8999        mut self,
9000        v: std::option::Option<T>,
9001    ) -> Self
9002    where
9003        T: std::convert::Into<crate::model::UserCommands>,
9004    {
9005        self.hybrid_replication_user_commands = v.map(|x| x.into());
9006        self
9007    }
9008}
9009
9010impl wkt::message::Message for Replication {
9011    fn typename() -> &'static str {
9012        "type.googleapis.com/google.cloud.netapp.v1.Replication"
9013    }
9014}
9015
9016/// Defines additional types related to [Replication].
9017pub mod replication {
9018    #[allow(unused_imports)]
9019    use super::*;
9020
9021    /// The replication states
9022    /// New enum values may be added in future to indicate possible new states.
9023    ///
9024    /// # Working with unknown values
9025    ///
9026    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9027    /// additional enum variants at any time. Adding new variants is not considered
9028    /// a breaking change. Applications should write their code in anticipation of:
9029    ///
9030    /// - New values appearing in future releases of the client library, **and**
9031    /// - New values received dynamically, without application changes.
9032    ///
9033    /// Please consult the [Working with enums] section in the user guide for some
9034    /// guidelines.
9035    ///
9036    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9037    #[derive(Clone, Debug, PartialEq)]
9038    #[non_exhaustive]
9039    pub enum State {
9040        /// Unspecified replication State
9041        Unspecified,
9042        /// Replication is creating.
9043        Creating,
9044        /// Replication is ready.
9045        Ready,
9046        /// Replication is updating.
9047        Updating,
9048        /// Replication is deleting.
9049        Deleting,
9050        /// Replication is in error state.
9051        Error,
9052        /// Replication is waiting for cluster peering to be established.
9053        PendingClusterPeering,
9054        /// Replication is waiting for SVM peering to be established.
9055        PendingSvmPeering,
9056        /// Replication is waiting for Commands to be executed on Onprem ONTAP.
9057        PendingRemoteResync,
9058        /// Onprem ONTAP is destination and Replication can only be managed from
9059        /// Onprem.
9060        ExternallyManagedReplication,
9061        /// If set, the enum was initialized with an unknown value.
9062        ///
9063        /// Applications can examine the value using [State::value] or
9064        /// [State::name].
9065        UnknownValue(state::UnknownValue),
9066    }
9067
9068    #[doc(hidden)]
9069    pub mod state {
9070        #[allow(unused_imports)]
9071        use super::*;
9072        #[derive(Clone, Debug, PartialEq)]
9073        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9074    }
9075
9076    impl State {
9077        /// Gets the enum value.
9078        ///
9079        /// Returns `None` if the enum contains an unknown value deserialized from
9080        /// the string representation of enums.
9081        pub fn value(&self) -> std::option::Option<i32> {
9082            match self {
9083                Self::Unspecified => std::option::Option::Some(0),
9084                Self::Creating => std::option::Option::Some(1),
9085                Self::Ready => std::option::Option::Some(2),
9086                Self::Updating => std::option::Option::Some(3),
9087                Self::Deleting => std::option::Option::Some(5),
9088                Self::Error => std::option::Option::Some(6),
9089                Self::PendingClusterPeering => std::option::Option::Some(8),
9090                Self::PendingSvmPeering => std::option::Option::Some(9),
9091                Self::PendingRemoteResync => std::option::Option::Some(10),
9092                Self::ExternallyManagedReplication => std::option::Option::Some(11),
9093                Self::UnknownValue(u) => u.0.value(),
9094            }
9095        }
9096
9097        /// Gets the enum value as a string.
9098        ///
9099        /// Returns `None` if the enum contains an unknown value deserialized from
9100        /// the integer representation of enums.
9101        pub fn name(&self) -> std::option::Option<&str> {
9102            match self {
9103                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9104                Self::Creating => std::option::Option::Some("CREATING"),
9105                Self::Ready => std::option::Option::Some("READY"),
9106                Self::Updating => std::option::Option::Some("UPDATING"),
9107                Self::Deleting => std::option::Option::Some("DELETING"),
9108                Self::Error => std::option::Option::Some("ERROR"),
9109                Self::PendingClusterPeering => std::option::Option::Some("PENDING_CLUSTER_PEERING"),
9110                Self::PendingSvmPeering => std::option::Option::Some("PENDING_SVM_PEERING"),
9111                Self::PendingRemoteResync => std::option::Option::Some("PENDING_REMOTE_RESYNC"),
9112                Self::ExternallyManagedReplication => {
9113                    std::option::Option::Some("EXTERNALLY_MANAGED_REPLICATION")
9114                }
9115                Self::UnknownValue(u) => u.0.name(),
9116            }
9117        }
9118    }
9119
9120    impl std::default::Default for State {
9121        fn default() -> Self {
9122            use std::convert::From;
9123            Self::from(0)
9124        }
9125    }
9126
9127    impl std::fmt::Display for State {
9128        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9129            wkt::internal::display_enum(f, self.name(), self.value())
9130        }
9131    }
9132
9133    impl std::convert::From<i32> for State {
9134        fn from(value: i32) -> Self {
9135            match value {
9136                0 => Self::Unspecified,
9137                1 => Self::Creating,
9138                2 => Self::Ready,
9139                3 => Self::Updating,
9140                5 => Self::Deleting,
9141                6 => Self::Error,
9142                8 => Self::PendingClusterPeering,
9143                9 => Self::PendingSvmPeering,
9144                10 => Self::PendingRemoteResync,
9145                11 => Self::ExternallyManagedReplication,
9146                _ => Self::UnknownValue(state::UnknownValue(
9147                    wkt::internal::UnknownEnumValue::Integer(value),
9148                )),
9149            }
9150        }
9151    }
9152
9153    impl std::convert::From<&str> for State {
9154        fn from(value: &str) -> Self {
9155            use std::string::ToString;
9156            match value {
9157                "STATE_UNSPECIFIED" => Self::Unspecified,
9158                "CREATING" => Self::Creating,
9159                "READY" => Self::Ready,
9160                "UPDATING" => Self::Updating,
9161                "DELETING" => Self::Deleting,
9162                "ERROR" => Self::Error,
9163                "PENDING_CLUSTER_PEERING" => Self::PendingClusterPeering,
9164                "PENDING_SVM_PEERING" => Self::PendingSvmPeering,
9165                "PENDING_REMOTE_RESYNC" => Self::PendingRemoteResync,
9166                "EXTERNALLY_MANAGED_REPLICATION" => Self::ExternallyManagedReplication,
9167                _ => Self::UnknownValue(state::UnknownValue(
9168                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9169                )),
9170            }
9171        }
9172    }
9173
9174    impl serde::ser::Serialize for State {
9175        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9176        where
9177            S: serde::Serializer,
9178        {
9179            match self {
9180                Self::Unspecified => serializer.serialize_i32(0),
9181                Self::Creating => serializer.serialize_i32(1),
9182                Self::Ready => serializer.serialize_i32(2),
9183                Self::Updating => serializer.serialize_i32(3),
9184                Self::Deleting => serializer.serialize_i32(5),
9185                Self::Error => serializer.serialize_i32(6),
9186                Self::PendingClusterPeering => serializer.serialize_i32(8),
9187                Self::PendingSvmPeering => serializer.serialize_i32(9),
9188                Self::PendingRemoteResync => serializer.serialize_i32(10),
9189                Self::ExternallyManagedReplication => serializer.serialize_i32(11),
9190                Self::UnknownValue(u) => u.0.serialize(serializer),
9191            }
9192        }
9193    }
9194
9195    impl<'de> serde::de::Deserialize<'de> for State {
9196        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9197        where
9198            D: serde::Deserializer<'de>,
9199        {
9200            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9201                ".google.cloud.netapp.v1.Replication.State",
9202            ))
9203        }
9204    }
9205
9206    /// New enum values may be added in future to support different replication
9207    /// topology.
9208    ///
9209    /// # Working with unknown values
9210    ///
9211    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9212    /// additional enum variants at any time. Adding new variants is not considered
9213    /// a breaking change. Applications should write their code in anticipation of:
9214    ///
9215    /// - New values appearing in future releases of the client library, **and**
9216    /// - New values received dynamically, without application changes.
9217    ///
9218    /// Please consult the [Working with enums] section in the user guide for some
9219    /// guidelines.
9220    ///
9221    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9222    #[derive(Clone, Debug, PartialEq)]
9223    #[non_exhaustive]
9224    pub enum ReplicationRole {
9225        /// Unspecified replication role
9226        Unspecified,
9227        /// Indicates Source volume.
9228        Source,
9229        /// Indicates Destination volume.
9230        Destination,
9231        /// If set, the enum was initialized with an unknown value.
9232        ///
9233        /// Applications can examine the value using [ReplicationRole::value] or
9234        /// [ReplicationRole::name].
9235        UnknownValue(replication_role::UnknownValue),
9236    }
9237
9238    #[doc(hidden)]
9239    pub mod replication_role {
9240        #[allow(unused_imports)]
9241        use super::*;
9242        #[derive(Clone, Debug, PartialEq)]
9243        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9244    }
9245
9246    impl ReplicationRole {
9247        /// Gets the enum value.
9248        ///
9249        /// Returns `None` if the enum contains an unknown value deserialized from
9250        /// the string representation of enums.
9251        pub fn value(&self) -> std::option::Option<i32> {
9252            match self {
9253                Self::Unspecified => std::option::Option::Some(0),
9254                Self::Source => std::option::Option::Some(1),
9255                Self::Destination => std::option::Option::Some(2),
9256                Self::UnknownValue(u) => u.0.value(),
9257            }
9258        }
9259
9260        /// Gets the enum value as a string.
9261        ///
9262        /// Returns `None` if the enum contains an unknown value deserialized from
9263        /// the integer representation of enums.
9264        pub fn name(&self) -> std::option::Option<&str> {
9265            match self {
9266                Self::Unspecified => std::option::Option::Some("REPLICATION_ROLE_UNSPECIFIED"),
9267                Self::Source => std::option::Option::Some("SOURCE"),
9268                Self::Destination => std::option::Option::Some("DESTINATION"),
9269                Self::UnknownValue(u) => u.0.name(),
9270            }
9271        }
9272    }
9273
9274    impl std::default::Default for ReplicationRole {
9275        fn default() -> Self {
9276            use std::convert::From;
9277            Self::from(0)
9278        }
9279    }
9280
9281    impl std::fmt::Display for ReplicationRole {
9282        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9283            wkt::internal::display_enum(f, self.name(), self.value())
9284        }
9285    }
9286
9287    impl std::convert::From<i32> for ReplicationRole {
9288        fn from(value: i32) -> Self {
9289            match value {
9290                0 => Self::Unspecified,
9291                1 => Self::Source,
9292                2 => Self::Destination,
9293                _ => Self::UnknownValue(replication_role::UnknownValue(
9294                    wkt::internal::UnknownEnumValue::Integer(value),
9295                )),
9296            }
9297        }
9298    }
9299
9300    impl std::convert::From<&str> for ReplicationRole {
9301        fn from(value: &str) -> Self {
9302            use std::string::ToString;
9303            match value {
9304                "REPLICATION_ROLE_UNSPECIFIED" => Self::Unspecified,
9305                "SOURCE" => Self::Source,
9306                "DESTINATION" => Self::Destination,
9307                _ => Self::UnknownValue(replication_role::UnknownValue(
9308                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9309                )),
9310            }
9311        }
9312    }
9313
9314    impl serde::ser::Serialize for ReplicationRole {
9315        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9316        where
9317            S: serde::Serializer,
9318        {
9319            match self {
9320                Self::Unspecified => serializer.serialize_i32(0),
9321                Self::Source => serializer.serialize_i32(1),
9322                Self::Destination => serializer.serialize_i32(2),
9323                Self::UnknownValue(u) => u.0.serialize(serializer),
9324            }
9325        }
9326    }
9327
9328    impl<'de> serde::de::Deserialize<'de> for ReplicationRole {
9329        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9330        where
9331            D: serde::Deserializer<'de>,
9332        {
9333            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicationRole>::new(
9334                ".google.cloud.netapp.v1.Replication.ReplicationRole",
9335            ))
9336        }
9337    }
9338
9339    /// Schedule for Replication.
9340    /// New enum values may be added in future to support different frequency of
9341    /// replication.
9342    ///
9343    /// # Working with unknown values
9344    ///
9345    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9346    /// additional enum variants at any time. Adding new variants is not considered
9347    /// a breaking change. Applications should write their code in anticipation of:
9348    ///
9349    /// - New values appearing in future releases of the client library, **and**
9350    /// - New values received dynamically, without application changes.
9351    ///
9352    /// Please consult the [Working with enums] section in the user guide for some
9353    /// guidelines.
9354    ///
9355    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9356    #[derive(Clone, Debug, PartialEq)]
9357    #[non_exhaustive]
9358    pub enum ReplicationSchedule {
9359        /// Unspecified ReplicationSchedule
9360        Unspecified,
9361        /// Replication happens once every 10 minutes.
9362        Every10Minutes,
9363        /// Replication happens once every hour.
9364        Hourly,
9365        /// Replication happens once every day.
9366        Daily,
9367        /// If set, the enum was initialized with an unknown value.
9368        ///
9369        /// Applications can examine the value using [ReplicationSchedule::value] or
9370        /// [ReplicationSchedule::name].
9371        UnknownValue(replication_schedule::UnknownValue),
9372    }
9373
9374    #[doc(hidden)]
9375    pub mod replication_schedule {
9376        #[allow(unused_imports)]
9377        use super::*;
9378        #[derive(Clone, Debug, PartialEq)]
9379        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9380    }
9381
9382    impl ReplicationSchedule {
9383        /// Gets the enum value.
9384        ///
9385        /// Returns `None` if the enum contains an unknown value deserialized from
9386        /// the string representation of enums.
9387        pub fn value(&self) -> std::option::Option<i32> {
9388            match self {
9389                Self::Unspecified => std::option::Option::Some(0),
9390                Self::Every10Minutes => std::option::Option::Some(1),
9391                Self::Hourly => std::option::Option::Some(2),
9392                Self::Daily => std::option::Option::Some(3),
9393                Self::UnknownValue(u) => u.0.value(),
9394            }
9395        }
9396
9397        /// Gets the enum value as a string.
9398        ///
9399        /// Returns `None` if the enum contains an unknown value deserialized from
9400        /// the integer representation of enums.
9401        pub fn name(&self) -> std::option::Option<&str> {
9402            match self {
9403                Self::Unspecified => std::option::Option::Some("REPLICATION_SCHEDULE_UNSPECIFIED"),
9404                Self::Every10Minutes => std::option::Option::Some("EVERY_10_MINUTES"),
9405                Self::Hourly => std::option::Option::Some("HOURLY"),
9406                Self::Daily => std::option::Option::Some("DAILY"),
9407                Self::UnknownValue(u) => u.0.name(),
9408            }
9409        }
9410    }
9411
9412    impl std::default::Default for ReplicationSchedule {
9413        fn default() -> Self {
9414            use std::convert::From;
9415            Self::from(0)
9416        }
9417    }
9418
9419    impl std::fmt::Display for ReplicationSchedule {
9420        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9421            wkt::internal::display_enum(f, self.name(), self.value())
9422        }
9423    }
9424
9425    impl std::convert::From<i32> for ReplicationSchedule {
9426        fn from(value: i32) -> Self {
9427            match value {
9428                0 => Self::Unspecified,
9429                1 => Self::Every10Minutes,
9430                2 => Self::Hourly,
9431                3 => Self::Daily,
9432                _ => Self::UnknownValue(replication_schedule::UnknownValue(
9433                    wkt::internal::UnknownEnumValue::Integer(value),
9434                )),
9435            }
9436        }
9437    }
9438
9439    impl std::convert::From<&str> for ReplicationSchedule {
9440        fn from(value: &str) -> Self {
9441            use std::string::ToString;
9442            match value {
9443                "REPLICATION_SCHEDULE_UNSPECIFIED" => Self::Unspecified,
9444                "EVERY_10_MINUTES" => Self::Every10Minutes,
9445                "HOURLY" => Self::Hourly,
9446                "DAILY" => Self::Daily,
9447                _ => Self::UnknownValue(replication_schedule::UnknownValue(
9448                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9449                )),
9450            }
9451        }
9452    }
9453
9454    impl serde::ser::Serialize for ReplicationSchedule {
9455        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9456        where
9457            S: serde::Serializer,
9458        {
9459            match self {
9460                Self::Unspecified => serializer.serialize_i32(0),
9461                Self::Every10Minutes => serializer.serialize_i32(1),
9462                Self::Hourly => serializer.serialize_i32(2),
9463                Self::Daily => serializer.serialize_i32(3),
9464                Self::UnknownValue(u) => u.0.serialize(serializer),
9465            }
9466        }
9467    }
9468
9469    impl<'de> serde::de::Deserialize<'de> for ReplicationSchedule {
9470        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9471        where
9472            D: serde::Deserializer<'de>,
9473        {
9474            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicationSchedule>::new(
9475                ".google.cloud.netapp.v1.Replication.ReplicationSchedule",
9476            ))
9477        }
9478    }
9479
9480    /// Mirroring states.
9481    /// No new value is expected to be added in future.
9482    ///
9483    /// # Working with unknown values
9484    ///
9485    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9486    /// additional enum variants at any time. Adding new variants is not considered
9487    /// a breaking change. Applications should write their code in anticipation of:
9488    ///
9489    /// - New values appearing in future releases of the client library, **and**
9490    /// - New values received dynamically, without application changes.
9491    ///
9492    /// Please consult the [Working with enums] section in the user guide for some
9493    /// guidelines.
9494    ///
9495    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9496    #[derive(Clone, Debug, PartialEq)]
9497    #[non_exhaustive]
9498    pub enum MirrorState {
9499        /// Unspecified MirrorState
9500        Unspecified,
9501        /// Destination volume is being prepared.
9502        Preparing,
9503        /// Destination volume has been initialized and is ready to receive
9504        /// replication transfers.
9505        Mirrored,
9506        /// Destination volume is not receiving replication transfers.
9507        Stopped,
9508        /// Incremental replication is in progress.
9509        Transferring,
9510        /// Baseline replication is in progress.
9511        BaselineTransferring,
9512        /// Replication is aborted.
9513        Aborted,
9514        /// Replication is being managed from Onprem ONTAP.
9515        ExternallyManaged,
9516        /// Peering is yet to be established.
9517        PendingPeering,
9518        /// If set, the enum was initialized with an unknown value.
9519        ///
9520        /// Applications can examine the value using [MirrorState::value] or
9521        /// [MirrorState::name].
9522        UnknownValue(mirror_state::UnknownValue),
9523    }
9524
9525    #[doc(hidden)]
9526    pub mod mirror_state {
9527        #[allow(unused_imports)]
9528        use super::*;
9529        #[derive(Clone, Debug, PartialEq)]
9530        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9531    }
9532
9533    impl MirrorState {
9534        /// Gets the enum value.
9535        ///
9536        /// Returns `None` if the enum contains an unknown value deserialized from
9537        /// the string representation of enums.
9538        pub fn value(&self) -> std::option::Option<i32> {
9539            match self {
9540                Self::Unspecified => std::option::Option::Some(0),
9541                Self::Preparing => std::option::Option::Some(1),
9542                Self::Mirrored => std::option::Option::Some(2),
9543                Self::Stopped => std::option::Option::Some(3),
9544                Self::Transferring => std::option::Option::Some(4),
9545                Self::BaselineTransferring => std::option::Option::Some(5),
9546                Self::Aborted => std::option::Option::Some(6),
9547                Self::ExternallyManaged => std::option::Option::Some(7),
9548                Self::PendingPeering => std::option::Option::Some(8),
9549                Self::UnknownValue(u) => u.0.value(),
9550            }
9551        }
9552
9553        /// Gets the enum value as a string.
9554        ///
9555        /// Returns `None` if the enum contains an unknown value deserialized from
9556        /// the integer representation of enums.
9557        pub fn name(&self) -> std::option::Option<&str> {
9558            match self {
9559                Self::Unspecified => std::option::Option::Some("MIRROR_STATE_UNSPECIFIED"),
9560                Self::Preparing => std::option::Option::Some("PREPARING"),
9561                Self::Mirrored => std::option::Option::Some("MIRRORED"),
9562                Self::Stopped => std::option::Option::Some("STOPPED"),
9563                Self::Transferring => std::option::Option::Some("TRANSFERRING"),
9564                Self::BaselineTransferring => std::option::Option::Some("BASELINE_TRANSFERRING"),
9565                Self::Aborted => std::option::Option::Some("ABORTED"),
9566                Self::ExternallyManaged => std::option::Option::Some("EXTERNALLY_MANAGED"),
9567                Self::PendingPeering => std::option::Option::Some("PENDING_PEERING"),
9568                Self::UnknownValue(u) => u.0.name(),
9569            }
9570        }
9571    }
9572
9573    impl std::default::Default for MirrorState {
9574        fn default() -> Self {
9575            use std::convert::From;
9576            Self::from(0)
9577        }
9578    }
9579
9580    impl std::fmt::Display for MirrorState {
9581        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9582            wkt::internal::display_enum(f, self.name(), self.value())
9583        }
9584    }
9585
9586    impl std::convert::From<i32> for MirrorState {
9587        fn from(value: i32) -> Self {
9588            match value {
9589                0 => Self::Unspecified,
9590                1 => Self::Preparing,
9591                2 => Self::Mirrored,
9592                3 => Self::Stopped,
9593                4 => Self::Transferring,
9594                5 => Self::BaselineTransferring,
9595                6 => Self::Aborted,
9596                7 => Self::ExternallyManaged,
9597                8 => Self::PendingPeering,
9598                _ => Self::UnknownValue(mirror_state::UnknownValue(
9599                    wkt::internal::UnknownEnumValue::Integer(value),
9600                )),
9601            }
9602        }
9603    }
9604
9605    impl std::convert::From<&str> for MirrorState {
9606        fn from(value: &str) -> Self {
9607            use std::string::ToString;
9608            match value {
9609                "MIRROR_STATE_UNSPECIFIED" => Self::Unspecified,
9610                "PREPARING" => Self::Preparing,
9611                "MIRRORED" => Self::Mirrored,
9612                "STOPPED" => Self::Stopped,
9613                "TRANSFERRING" => Self::Transferring,
9614                "BASELINE_TRANSFERRING" => Self::BaselineTransferring,
9615                "ABORTED" => Self::Aborted,
9616                "EXTERNALLY_MANAGED" => Self::ExternallyManaged,
9617                "PENDING_PEERING" => Self::PendingPeering,
9618                _ => Self::UnknownValue(mirror_state::UnknownValue(
9619                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9620                )),
9621            }
9622        }
9623    }
9624
9625    impl serde::ser::Serialize for MirrorState {
9626        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9627        where
9628            S: serde::Serializer,
9629        {
9630            match self {
9631                Self::Unspecified => serializer.serialize_i32(0),
9632                Self::Preparing => serializer.serialize_i32(1),
9633                Self::Mirrored => serializer.serialize_i32(2),
9634                Self::Stopped => serializer.serialize_i32(3),
9635                Self::Transferring => serializer.serialize_i32(4),
9636                Self::BaselineTransferring => serializer.serialize_i32(5),
9637                Self::Aborted => serializer.serialize_i32(6),
9638                Self::ExternallyManaged => serializer.serialize_i32(7),
9639                Self::PendingPeering => serializer.serialize_i32(8),
9640                Self::UnknownValue(u) => u.0.serialize(serializer),
9641            }
9642        }
9643    }
9644
9645    impl<'de> serde::de::Deserialize<'de> for MirrorState {
9646        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9647        where
9648            D: serde::Deserializer<'de>,
9649        {
9650            deserializer.deserialize_any(wkt::internal::EnumVisitor::<MirrorState>::new(
9651                ".google.cloud.netapp.v1.Replication.MirrorState",
9652            ))
9653        }
9654    }
9655
9656    /// Hybrid replication type.
9657    ///
9658    /// # Working with unknown values
9659    ///
9660    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9661    /// additional enum variants at any time. Adding new variants is not considered
9662    /// a breaking change. Applications should write their code in anticipation of:
9663    ///
9664    /// - New values appearing in future releases of the client library, **and**
9665    /// - New values received dynamically, without application changes.
9666    ///
9667    /// Please consult the [Working with enums] section in the user guide for some
9668    /// guidelines.
9669    ///
9670    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9671    #[derive(Clone, Debug, PartialEq)]
9672    #[non_exhaustive]
9673    pub enum HybridReplicationType {
9674        /// Unspecified hybrid replication type.
9675        Unspecified,
9676        /// Hybrid replication type for migration.
9677        Migration,
9678        /// Hybrid replication type for continuous replication.
9679        ContinuousReplication,
9680        /// New field for reversible OnPrem replication, to be used for data
9681        /// protection.
9682        OnpremReplication,
9683        /// Hybrid replication type for incremental Transfer in the reverse direction
9684        /// (GCNV is source and Onprem is destination)
9685        ReverseOnpremReplication,
9686        /// If set, the enum was initialized with an unknown value.
9687        ///
9688        /// Applications can examine the value using [HybridReplicationType::value] or
9689        /// [HybridReplicationType::name].
9690        UnknownValue(hybrid_replication_type::UnknownValue),
9691    }
9692
9693    #[doc(hidden)]
9694    pub mod hybrid_replication_type {
9695        #[allow(unused_imports)]
9696        use super::*;
9697        #[derive(Clone, Debug, PartialEq)]
9698        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9699    }
9700
9701    impl HybridReplicationType {
9702        /// Gets the enum value.
9703        ///
9704        /// Returns `None` if the enum contains an unknown value deserialized from
9705        /// the string representation of enums.
9706        pub fn value(&self) -> std::option::Option<i32> {
9707            match self {
9708                Self::Unspecified => std::option::Option::Some(0),
9709                Self::Migration => std::option::Option::Some(1),
9710                Self::ContinuousReplication => std::option::Option::Some(2),
9711                Self::OnpremReplication => std::option::Option::Some(3),
9712                Self::ReverseOnpremReplication => std::option::Option::Some(4),
9713                Self::UnknownValue(u) => u.0.value(),
9714            }
9715        }
9716
9717        /// Gets the enum value as a string.
9718        ///
9719        /// Returns `None` if the enum contains an unknown value deserialized from
9720        /// the integer representation of enums.
9721        pub fn name(&self) -> std::option::Option<&str> {
9722            match self {
9723                Self::Unspecified => {
9724                    std::option::Option::Some("HYBRID_REPLICATION_TYPE_UNSPECIFIED")
9725                }
9726                Self::Migration => std::option::Option::Some("MIGRATION"),
9727                Self::ContinuousReplication => std::option::Option::Some("CONTINUOUS_REPLICATION"),
9728                Self::OnpremReplication => std::option::Option::Some("ONPREM_REPLICATION"),
9729                Self::ReverseOnpremReplication => {
9730                    std::option::Option::Some("REVERSE_ONPREM_REPLICATION")
9731                }
9732                Self::UnknownValue(u) => u.0.name(),
9733            }
9734        }
9735    }
9736
9737    impl std::default::Default for HybridReplicationType {
9738        fn default() -> Self {
9739            use std::convert::From;
9740            Self::from(0)
9741        }
9742    }
9743
9744    impl std::fmt::Display for HybridReplicationType {
9745        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9746            wkt::internal::display_enum(f, self.name(), self.value())
9747        }
9748    }
9749
9750    impl std::convert::From<i32> for HybridReplicationType {
9751        fn from(value: i32) -> Self {
9752            match value {
9753                0 => Self::Unspecified,
9754                1 => Self::Migration,
9755                2 => Self::ContinuousReplication,
9756                3 => Self::OnpremReplication,
9757                4 => Self::ReverseOnpremReplication,
9758                _ => Self::UnknownValue(hybrid_replication_type::UnknownValue(
9759                    wkt::internal::UnknownEnumValue::Integer(value),
9760                )),
9761            }
9762        }
9763    }
9764
9765    impl std::convert::From<&str> for HybridReplicationType {
9766        fn from(value: &str) -> Self {
9767            use std::string::ToString;
9768            match value {
9769                "HYBRID_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
9770                "MIGRATION" => Self::Migration,
9771                "CONTINUOUS_REPLICATION" => Self::ContinuousReplication,
9772                "ONPREM_REPLICATION" => Self::OnpremReplication,
9773                "REVERSE_ONPREM_REPLICATION" => Self::ReverseOnpremReplication,
9774                _ => Self::UnknownValue(hybrid_replication_type::UnknownValue(
9775                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9776                )),
9777            }
9778        }
9779    }
9780
9781    impl serde::ser::Serialize for HybridReplicationType {
9782        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9783        where
9784            S: serde::Serializer,
9785        {
9786            match self {
9787                Self::Unspecified => serializer.serialize_i32(0),
9788                Self::Migration => serializer.serialize_i32(1),
9789                Self::ContinuousReplication => serializer.serialize_i32(2),
9790                Self::OnpremReplication => serializer.serialize_i32(3),
9791                Self::ReverseOnpremReplication => serializer.serialize_i32(4),
9792                Self::UnknownValue(u) => u.0.serialize(serializer),
9793            }
9794        }
9795    }
9796
9797    impl<'de> serde::de::Deserialize<'de> for HybridReplicationType {
9798        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9799        where
9800            D: serde::Deserializer<'de>,
9801        {
9802            deserializer.deserialize_any(wkt::internal::EnumVisitor::<HybridReplicationType>::new(
9803                ".google.cloud.netapp.v1.Replication.HybridReplicationType",
9804            ))
9805        }
9806    }
9807}
9808
9809/// HybridPeeringDetails contains details about the hybrid peering.
9810#[derive(Clone, Default, PartialEq)]
9811#[non_exhaustive]
9812pub struct HybridPeeringDetails {
9813    /// Output only. IP address of the subnet.
9814    pub subnet_ip: std::string::String,
9815
9816    /// Output only. Copy-paste-able commands to be used on user's ONTAP to accept
9817    /// peering requests.
9818    pub command: std::string::String,
9819
9820    /// Output only. Expiration time for the peering command to be executed on
9821    /// user's ONTAP.
9822    pub command_expiry_time: std::option::Option<wkt::Timestamp>,
9823
9824    /// Output only. Temporary passphrase generated to accept cluster peering
9825    /// command.
9826    pub passphrase: std::string::String,
9827
9828    /// Output only. Name of the user's local source volume to be peered with the
9829    /// destination volume.
9830    pub peer_volume_name: std::string::String,
9831
9832    /// Output only. Name of the user's local source cluster to be peered with the
9833    /// destination cluster.
9834    pub peer_cluster_name: std::string::String,
9835
9836    /// Output only. Name of the user's local source vserver svm to be peered with
9837    /// the destination vserver svm.
9838    pub peer_svm_name: std::string::String,
9839
9840    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9841}
9842
9843impl HybridPeeringDetails {
9844    /// Creates a new default instance.
9845    pub fn new() -> Self {
9846        std::default::Default::default()
9847    }
9848
9849    /// Sets the value of [subnet_ip][crate::model::HybridPeeringDetails::subnet_ip].
9850    ///
9851    /// # Example
9852    /// ```ignore,no_run
9853    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9854    /// let x = HybridPeeringDetails::new().set_subnet_ip("example");
9855    /// ```
9856    pub fn set_subnet_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9857        self.subnet_ip = v.into();
9858        self
9859    }
9860
9861    /// Sets the value of [command][crate::model::HybridPeeringDetails::command].
9862    ///
9863    /// # Example
9864    /// ```ignore,no_run
9865    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9866    /// let x = HybridPeeringDetails::new().set_command("example");
9867    /// ```
9868    pub fn set_command<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9869        self.command = v.into();
9870        self
9871    }
9872
9873    /// Sets the value of [command_expiry_time][crate::model::HybridPeeringDetails::command_expiry_time].
9874    ///
9875    /// # Example
9876    /// ```ignore,no_run
9877    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9878    /// use wkt::Timestamp;
9879    /// let x = HybridPeeringDetails::new().set_command_expiry_time(Timestamp::default()/* use setters */);
9880    /// ```
9881    pub fn set_command_expiry_time<T>(mut self, v: T) -> Self
9882    where
9883        T: std::convert::Into<wkt::Timestamp>,
9884    {
9885        self.command_expiry_time = std::option::Option::Some(v.into());
9886        self
9887    }
9888
9889    /// Sets or clears the value of [command_expiry_time][crate::model::HybridPeeringDetails::command_expiry_time].
9890    ///
9891    /// # Example
9892    /// ```ignore,no_run
9893    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9894    /// use wkt::Timestamp;
9895    /// let x = HybridPeeringDetails::new().set_or_clear_command_expiry_time(Some(Timestamp::default()/* use setters */));
9896    /// let x = HybridPeeringDetails::new().set_or_clear_command_expiry_time(None::<Timestamp>);
9897    /// ```
9898    pub fn set_or_clear_command_expiry_time<T>(mut self, v: std::option::Option<T>) -> Self
9899    where
9900        T: std::convert::Into<wkt::Timestamp>,
9901    {
9902        self.command_expiry_time = v.map(|x| x.into());
9903        self
9904    }
9905
9906    /// Sets the value of [passphrase][crate::model::HybridPeeringDetails::passphrase].
9907    ///
9908    /// # Example
9909    /// ```ignore,no_run
9910    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9911    /// let x = HybridPeeringDetails::new().set_passphrase("example");
9912    /// ```
9913    pub fn set_passphrase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9914        self.passphrase = v.into();
9915        self
9916    }
9917
9918    /// Sets the value of [peer_volume_name][crate::model::HybridPeeringDetails::peer_volume_name].
9919    ///
9920    /// # Example
9921    /// ```ignore,no_run
9922    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9923    /// let x = HybridPeeringDetails::new().set_peer_volume_name("example");
9924    /// ```
9925    pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
9926        mut self,
9927        v: T,
9928    ) -> Self {
9929        self.peer_volume_name = v.into();
9930        self
9931    }
9932
9933    /// Sets the value of [peer_cluster_name][crate::model::HybridPeeringDetails::peer_cluster_name].
9934    ///
9935    /// # Example
9936    /// ```ignore,no_run
9937    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9938    /// let x = HybridPeeringDetails::new().set_peer_cluster_name("example");
9939    /// ```
9940    pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
9941        mut self,
9942        v: T,
9943    ) -> Self {
9944        self.peer_cluster_name = v.into();
9945        self
9946    }
9947
9948    /// Sets the value of [peer_svm_name][crate::model::HybridPeeringDetails::peer_svm_name].
9949    ///
9950    /// # Example
9951    /// ```ignore,no_run
9952    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9953    /// let x = HybridPeeringDetails::new().set_peer_svm_name("example");
9954    /// ```
9955    pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9956        self.peer_svm_name = v.into();
9957        self
9958    }
9959}
9960
9961impl wkt::message::Message for HybridPeeringDetails {
9962    fn typename() -> &'static str {
9963        "type.googleapis.com/google.cloud.netapp.v1.HybridPeeringDetails"
9964    }
9965}
9966
9967/// ListReplications lists replications.
9968#[derive(Clone, Default, PartialEq)]
9969#[non_exhaustive]
9970pub struct ListReplicationsRequest {
9971    /// Required. The volume for which to retrieve replication information,
9972    /// in the format
9973    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`.
9974    pub parent: std::string::String,
9975
9976    /// The maximum number of items to return.
9977    pub page_size: i32,
9978
9979    /// The next_page_token value to use if there are additional
9980    /// results to retrieve for this list request.
9981    pub page_token: std::string::String,
9982
9983    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
9984    pub order_by: std::string::String,
9985
9986    /// List filter.
9987    pub filter: std::string::String,
9988
9989    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9990}
9991
9992impl ListReplicationsRequest {
9993    /// Creates a new default instance.
9994    pub fn new() -> Self {
9995        std::default::Default::default()
9996    }
9997
9998    /// Sets the value of [parent][crate::model::ListReplicationsRequest::parent].
9999    ///
10000    /// # Example
10001    /// ```ignore,no_run
10002    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
10003    /// # let project_id = "project_id";
10004    /// # let location_id = "location_id";
10005    /// # let volume_id = "volume_id";
10006    /// let x = ListReplicationsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
10007    /// ```
10008    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10009        self.parent = v.into();
10010        self
10011    }
10012
10013    /// Sets the value of [page_size][crate::model::ListReplicationsRequest::page_size].
10014    ///
10015    /// # Example
10016    /// ```ignore,no_run
10017    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
10018    /// let x = ListReplicationsRequest::new().set_page_size(42);
10019    /// ```
10020    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10021        self.page_size = v.into();
10022        self
10023    }
10024
10025    /// Sets the value of [page_token][crate::model::ListReplicationsRequest::page_token].
10026    ///
10027    /// # Example
10028    /// ```ignore,no_run
10029    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
10030    /// let x = ListReplicationsRequest::new().set_page_token("example");
10031    /// ```
10032    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10033        self.page_token = v.into();
10034        self
10035    }
10036
10037    /// Sets the value of [order_by][crate::model::ListReplicationsRequest::order_by].
10038    ///
10039    /// # Example
10040    /// ```ignore,no_run
10041    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
10042    /// let x = ListReplicationsRequest::new().set_order_by("example");
10043    /// ```
10044    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10045        self.order_by = v.into();
10046        self
10047    }
10048
10049    /// Sets the value of [filter][crate::model::ListReplicationsRequest::filter].
10050    ///
10051    /// # Example
10052    /// ```ignore,no_run
10053    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
10054    /// let x = ListReplicationsRequest::new().set_filter("example");
10055    /// ```
10056    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10057        self.filter = v.into();
10058        self
10059    }
10060}
10061
10062impl wkt::message::Message for ListReplicationsRequest {
10063    fn typename() -> &'static str {
10064        "type.googleapis.com/google.cloud.netapp.v1.ListReplicationsRequest"
10065    }
10066}
10067
10068/// ListReplicationsResponse is the result of ListReplicationsRequest.
10069#[derive(Clone, Default, PartialEq)]
10070#[non_exhaustive]
10071pub struct ListReplicationsResponse {
10072    /// A list of replications in the project for the specified volume.
10073    pub replications: std::vec::Vec<crate::model::Replication>,
10074
10075    /// The token you can use to retrieve the next page of results. Not returned
10076    /// if there are no more results in the list.
10077    pub next_page_token: std::string::String,
10078
10079    /// Locations that could not be reached.
10080    pub unreachable: std::vec::Vec<std::string::String>,
10081
10082    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10083}
10084
10085impl ListReplicationsResponse {
10086    /// Creates a new default instance.
10087    pub fn new() -> Self {
10088        std::default::Default::default()
10089    }
10090
10091    /// Sets the value of [replications][crate::model::ListReplicationsResponse::replications].
10092    ///
10093    /// # Example
10094    /// ```ignore,no_run
10095    /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
10096    /// use google_cloud_netapp_v1::model::Replication;
10097    /// let x = ListReplicationsResponse::new()
10098    ///     .set_replications([
10099    ///         Replication::default()/* use setters */,
10100    ///         Replication::default()/* use (different) setters */,
10101    ///     ]);
10102    /// ```
10103    pub fn set_replications<T, V>(mut self, v: T) -> Self
10104    where
10105        T: std::iter::IntoIterator<Item = V>,
10106        V: std::convert::Into<crate::model::Replication>,
10107    {
10108        use std::iter::Iterator;
10109        self.replications = v.into_iter().map(|i| i.into()).collect();
10110        self
10111    }
10112
10113    /// Sets the value of [next_page_token][crate::model::ListReplicationsResponse::next_page_token].
10114    ///
10115    /// # Example
10116    /// ```ignore,no_run
10117    /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
10118    /// let x = ListReplicationsResponse::new().set_next_page_token("example");
10119    /// ```
10120    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10121        self.next_page_token = v.into();
10122        self
10123    }
10124
10125    /// Sets the value of [unreachable][crate::model::ListReplicationsResponse::unreachable].
10126    ///
10127    /// # Example
10128    /// ```ignore,no_run
10129    /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
10130    /// let x = ListReplicationsResponse::new().set_unreachable(["a", "b", "c"]);
10131    /// ```
10132    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10133    where
10134        T: std::iter::IntoIterator<Item = V>,
10135        V: std::convert::Into<std::string::String>,
10136    {
10137        use std::iter::Iterator;
10138        self.unreachable = v.into_iter().map(|i| i.into()).collect();
10139        self
10140    }
10141}
10142
10143impl wkt::message::Message for ListReplicationsResponse {
10144    fn typename() -> &'static str {
10145        "type.googleapis.com/google.cloud.netapp.v1.ListReplicationsResponse"
10146    }
10147}
10148
10149#[doc(hidden)]
10150impl google_cloud_gax::paginator::internal::PageableResponse for ListReplicationsResponse {
10151    type PageItem = crate::model::Replication;
10152
10153    fn items(self) -> std::vec::Vec<Self::PageItem> {
10154        self.replications
10155    }
10156
10157    fn next_page_token(&self) -> std::string::String {
10158        use std::clone::Clone;
10159        self.next_page_token.clone()
10160    }
10161}
10162
10163/// GetReplicationRequest gets the state of a replication.
10164#[derive(Clone, Default, PartialEq)]
10165#[non_exhaustive]
10166pub struct GetReplicationRequest {
10167    /// Required. The replication resource name, in the format
10168    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}`
10169    pub name: std::string::String,
10170
10171    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10172}
10173
10174impl GetReplicationRequest {
10175    /// Creates a new default instance.
10176    pub fn new() -> Self {
10177        std::default::Default::default()
10178    }
10179
10180    /// Sets the value of [name][crate::model::GetReplicationRequest::name].
10181    ///
10182    /// # Example
10183    /// ```ignore,no_run
10184    /// # use google_cloud_netapp_v1::model::GetReplicationRequest;
10185    /// # let project_id = "project_id";
10186    /// # let location_id = "location_id";
10187    /// # let volume_id = "volume_id";
10188    /// # let replication_id = "replication_id";
10189    /// let x = GetReplicationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/replications/{replication_id}"));
10190    /// ```
10191    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10192        self.name = v.into();
10193        self
10194    }
10195}
10196
10197impl wkt::message::Message for GetReplicationRequest {
10198    fn typename() -> &'static str {
10199        "type.googleapis.com/google.cloud.netapp.v1.GetReplicationRequest"
10200    }
10201}
10202
10203/// DestinationVolumeParameters specify input parameters used for creating
10204/// destination volume.
10205#[derive(Clone, Default, PartialEq)]
10206#[non_exhaustive]
10207pub struct DestinationVolumeParameters {
10208    /// Required. Existing destination StoragePool name.
10209    pub storage_pool: std::string::String,
10210
10211    /// Desired destination volume resource id. If not specified, source volume's
10212    /// resource id will be used.
10213    /// This value must start with a lowercase letter followed by up to 62
10214    /// lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
10215    pub volume_id: std::string::String,
10216
10217    /// Destination volume's share name. If not specified, source volume's share
10218    /// name will be used.
10219    pub share_name: std::string::String,
10220
10221    /// Description for the destination volume.
10222    pub description: std::option::Option<std::string::String>,
10223
10224    /// Optional. Tiering policy for the volume.
10225    pub tiering_policy: std::option::Option<crate::model::TieringPolicy>,
10226
10227    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10228}
10229
10230impl DestinationVolumeParameters {
10231    /// Creates a new default instance.
10232    pub fn new() -> Self {
10233        std::default::Default::default()
10234    }
10235
10236    /// Sets the value of [storage_pool][crate::model::DestinationVolumeParameters::storage_pool].
10237    ///
10238    /// # Example
10239    /// ```ignore,no_run
10240    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10241    /// # let project_id = "project_id";
10242    /// # let location_id = "location_id";
10243    /// # let storage_pool_id = "storage_pool_id";
10244    /// let x = DestinationVolumeParameters::new().set_storage_pool(format!("projects/{project_id}/locations/{location_id}/storagePools/{storage_pool_id}"));
10245    /// ```
10246    pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10247        self.storage_pool = v.into();
10248        self
10249    }
10250
10251    /// Sets the value of [volume_id][crate::model::DestinationVolumeParameters::volume_id].
10252    ///
10253    /// # Example
10254    /// ```ignore,no_run
10255    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10256    /// let x = DestinationVolumeParameters::new().set_volume_id("example");
10257    /// ```
10258    pub fn set_volume_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10259        self.volume_id = v.into();
10260        self
10261    }
10262
10263    /// Sets the value of [share_name][crate::model::DestinationVolumeParameters::share_name].
10264    ///
10265    /// # Example
10266    /// ```ignore,no_run
10267    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10268    /// let x = DestinationVolumeParameters::new().set_share_name("example");
10269    /// ```
10270    pub fn set_share_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10271        self.share_name = v.into();
10272        self
10273    }
10274
10275    /// Sets the value of [description][crate::model::DestinationVolumeParameters::description].
10276    ///
10277    /// # Example
10278    /// ```ignore,no_run
10279    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10280    /// let x = DestinationVolumeParameters::new().set_description("example");
10281    /// ```
10282    pub fn set_description<T>(mut self, v: T) -> Self
10283    where
10284        T: std::convert::Into<std::string::String>,
10285    {
10286        self.description = std::option::Option::Some(v.into());
10287        self
10288    }
10289
10290    /// Sets or clears the value of [description][crate::model::DestinationVolumeParameters::description].
10291    ///
10292    /// # Example
10293    /// ```ignore,no_run
10294    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10295    /// let x = DestinationVolumeParameters::new().set_or_clear_description(Some("example"));
10296    /// let x = DestinationVolumeParameters::new().set_or_clear_description(None::<String>);
10297    /// ```
10298    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
10299    where
10300        T: std::convert::Into<std::string::String>,
10301    {
10302        self.description = v.map(|x| x.into());
10303        self
10304    }
10305
10306    /// Sets the value of [tiering_policy][crate::model::DestinationVolumeParameters::tiering_policy].
10307    ///
10308    /// # Example
10309    /// ```ignore,no_run
10310    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10311    /// use google_cloud_netapp_v1::model::TieringPolicy;
10312    /// let x = DestinationVolumeParameters::new().set_tiering_policy(TieringPolicy::default()/* use setters */);
10313    /// ```
10314    pub fn set_tiering_policy<T>(mut self, v: T) -> Self
10315    where
10316        T: std::convert::Into<crate::model::TieringPolicy>,
10317    {
10318        self.tiering_policy = std::option::Option::Some(v.into());
10319        self
10320    }
10321
10322    /// Sets or clears the value of [tiering_policy][crate::model::DestinationVolumeParameters::tiering_policy].
10323    ///
10324    /// # Example
10325    /// ```ignore,no_run
10326    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10327    /// use google_cloud_netapp_v1::model::TieringPolicy;
10328    /// let x = DestinationVolumeParameters::new().set_or_clear_tiering_policy(Some(TieringPolicy::default()/* use setters */));
10329    /// let x = DestinationVolumeParameters::new().set_or_clear_tiering_policy(None::<TieringPolicy>);
10330    /// ```
10331    pub fn set_or_clear_tiering_policy<T>(mut self, v: std::option::Option<T>) -> Self
10332    where
10333        T: std::convert::Into<crate::model::TieringPolicy>,
10334    {
10335        self.tiering_policy = v.map(|x| x.into());
10336        self
10337    }
10338}
10339
10340impl wkt::message::Message for DestinationVolumeParameters {
10341    fn typename() -> &'static str {
10342        "type.googleapis.com/google.cloud.netapp.v1.DestinationVolumeParameters"
10343    }
10344}
10345
10346/// CreateReplicationRequest creates a replication.
10347#[derive(Clone, Default, PartialEq)]
10348#[non_exhaustive]
10349pub struct CreateReplicationRequest {
10350    /// Required. The NetApp volume to create the replications of, in the format
10351    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
10352    pub parent: std::string::String,
10353
10354    /// Required. A replication resource
10355    pub replication: std::option::Option<crate::model::Replication>,
10356
10357    /// Required. ID of the replication to create. Must be unique within the parent
10358    /// resource. Must contain only letters, numbers and hyphen, with the first
10359    /// character a letter, the last a letter or a
10360    /// number, and a 63 character maximum.
10361    pub replication_id: std::string::String,
10362
10363    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10364}
10365
10366impl CreateReplicationRequest {
10367    /// Creates a new default instance.
10368    pub fn new() -> Self {
10369        std::default::Default::default()
10370    }
10371
10372    /// Sets the value of [parent][crate::model::CreateReplicationRequest::parent].
10373    ///
10374    /// # Example
10375    /// ```ignore,no_run
10376    /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
10377    /// # let project_id = "project_id";
10378    /// # let location_id = "location_id";
10379    /// # let volume_id = "volume_id";
10380    /// let x = CreateReplicationRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
10381    /// ```
10382    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10383        self.parent = v.into();
10384        self
10385    }
10386
10387    /// Sets the value of [replication][crate::model::CreateReplicationRequest::replication].
10388    ///
10389    /// # Example
10390    /// ```ignore,no_run
10391    /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
10392    /// use google_cloud_netapp_v1::model::Replication;
10393    /// let x = CreateReplicationRequest::new().set_replication(Replication::default()/* use setters */);
10394    /// ```
10395    pub fn set_replication<T>(mut self, v: T) -> Self
10396    where
10397        T: std::convert::Into<crate::model::Replication>,
10398    {
10399        self.replication = std::option::Option::Some(v.into());
10400        self
10401    }
10402
10403    /// Sets or clears the value of [replication][crate::model::CreateReplicationRequest::replication].
10404    ///
10405    /// # Example
10406    /// ```ignore,no_run
10407    /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
10408    /// use google_cloud_netapp_v1::model::Replication;
10409    /// let x = CreateReplicationRequest::new().set_or_clear_replication(Some(Replication::default()/* use setters */));
10410    /// let x = CreateReplicationRequest::new().set_or_clear_replication(None::<Replication>);
10411    /// ```
10412    pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
10413    where
10414        T: std::convert::Into<crate::model::Replication>,
10415    {
10416        self.replication = v.map(|x| x.into());
10417        self
10418    }
10419
10420    /// Sets the value of [replication_id][crate::model::CreateReplicationRequest::replication_id].
10421    ///
10422    /// # Example
10423    /// ```ignore,no_run
10424    /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
10425    /// let x = CreateReplicationRequest::new().set_replication_id("example");
10426    /// ```
10427    pub fn set_replication_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10428        self.replication_id = v.into();
10429        self
10430    }
10431}
10432
10433impl wkt::message::Message for CreateReplicationRequest {
10434    fn typename() -> &'static str {
10435        "type.googleapis.com/google.cloud.netapp.v1.CreateReplicationRequest"
10436    }
10437}
10438
10439/// DeleteReplicationRequest deletes a replication.
10440#[derive(Clone, Default, PartialEq)]
10441#[non_exhaustive]
10442pub struct DeleteReplicationRequest {
10443    /// Required. The replication resource name, in the format
10444    /// `projects/*/locations/*/volumes/*/replications/{replication_id}`
10445    pub name: std::string::String,
10446
10447    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10448}
10449
10450impl DeleteReplicationRequest {
10451    /// Creates a new default instance.
10452    pub fn new() -> Self {
10453        std::default::Default::default()
10454    }
10455
10456    /// Sets the value of [name][crate::model::DeleteReplicationRequest::name].
10457    ///
10458    /// # Example
10459    /// ```ignore,no_run
10460    /// # use google_cloud_netapp_v1::model::DeleteReplicationRequest;
10461    /// # let project_id = "project_id";
10462    /// # let location_id = "location_id";
10463    /// # let volume_id = "volume_id";
10464    /// # let replication_id = "replication_id";
10465    /// let x = DeleteReplicationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/replications/{replication_id}"));
10466    /// ```
10467    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10468        self.name = v.into();
10469        self
10470    }
10471}
10472
10473impl wkt::message::Message for DeleteReplicationRequest {
10474    fn typename() -> &'static str {
10475        "type.googleapis.com/google.cloud.netapp.v1.DeleteReplicationRequest"
10476    }
10477}
10478
10479/// UpdateReplicationRequest updates description and/or labels for a replication.
10480#[derive(Clone, Default, PartialEq)]
10481#[non_exhaustive]
10482pub struct UpdateReplicationRequest {
10483    /// Required. Mask of fields to update.  At least one path must be supplied in
10484    /// this field.
10485    pub update_mask: std::option::Option<wkt::FieldMask>,
10486
10487    /// Required. A replication resource
10488    pub replication: std::option::Option<crate::model::Replication>,
10489
10490    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10491}
10492
10493impl UpdateReplicationRequest {
10494    /// Creates a new default instance.
10495    pub fn new() -> Self {
10496        std::default::Default::default()
10497    }
10498
10499    /// Sets the value of [update_mask][crate::model::UpdateReplicationRequest::update_mask].
10500    ///
10501    /// # Example
10502    /// ```ignore,no_run
10503    /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
10504    /// use wkt::FieldMask;
10505    /// let x = UpdateReplicationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10506    /// ```
10507    pub fn set_update_mask<T>(mut self, v: T) -> Self
10508    where
10509        T: std::convert::Into<wkt::FieldMask>,
10510    {
10511        self.update_mask = std::option::Option::Some(v.into());
10512        self
10513    }
10514
10515    /// Sets or clears the value of [update_mask][crate::model::UpdateReplicationRequest::update_mask].
10516    ///
10517    /// # Example
10518    /// ```ignore,no_run
10519    /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
10520    /// use wkt::FieldMask;
10521    /// let x = UpdateReplicationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10522    /// let x = UpdateReplicationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10523    /// ```
10524    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10525    where
10526        T: std::convert::Into<wkt::FieldMask>,
10527    {
10528        self.update_mask = v.map(|x| x.into());
10529        self
10530    }
10531
10532    /// Sets the value of [replication][crate::model::UpdateReplicationRequest::replication].
10533    ///
10534    /// # Example
10535    /// ```ignore,no_run
10536    /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
10537    /// use google_cloud_netapp_v1::model::Replication;
10538    /// let x = UpdateReplicationRequest::new().set_replication(Replication::default()/* use setters */);
10539    /// ```
10540    pub fn set_replication<T>(mut self, v: T) -> Self
10541    where
10542        T: std::convert::Into<crate::model::Replication>,
10543    {
10544        self.replication = std::option::Option::Some(v.into());
10545        self
10546    }
10547
10548    /// Sets or clears the value of [replication][crate::model::UpdateReplicationRequest::replication].
10549    ///
10550    /// # Example
10551    /// ```ignore,no_run
10552    /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
10553    /// use google_cloud_netapp_v1::model::Replication;
10554    /// let x = UpdateReplicationRequest::new().set_or_clear_replication(Some(Replication::default()/* use setters */));
10555    /// let x = UpdateReplicationRequest::new().set_or_clear_replication(None::<Replication>);
10556    /// ```
10557    pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
10558    where
10559        T: std::convert::Into<crate::model::Replication>,
10560    {
10561        self.replication = v.map(|x| x.into());
10562        self
10563    }
10564}
10565
10566impl wkt::message::Message for UpdateReplicationRequest {
10567    fn typename() -> &'static str {
10568        "type.googleapis.com/google.cloud.netapp.v1.UpdateReplicationRequest"
10569    }
10570}
10571
10572/// StopReplicationRequest stops a replication until resumed.
10573#[derive(Clone, Default, PartialEq)]
10574#[non_exhaustive]
10575pub struct StopReplicationRequest {
10576    /// Required. The resource name of the replication, in the format of
10577    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10578    pub name: std::string::String,
10579
10580    /// Indicates whether to stop replication forcefully while data transfer is in
10581    /// progress.
10582    /// Warning! if force is true, this will abort any current transfers
10583    /// and can lead to data loss due to partial transfer.
10584    /// If force is false, stop replication will fail while data transfer is in
10585    /// progress and you will need to retry later.
10586    pub force: bool,
10587
10588    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10589}
10590
10591impl StopReplicationRequest {
10592    /// Creates a new default instance.
10593    pub fn new() -> Self {
10594        std::default::Default::default()
10595    }
10596
10597    /// Sets the value of [name][crate::model::StopReplicationRequest::name].
10598    ///
10599    /// # Example
10600    /// ```ignore,no_run
10601    /// # use google_cloud_netapp_v1::model::StopReplicationRequest;
10602    /// # let project_id = "project_id";
10603    /// # let location_id = "location_id";
10604    /// # let volume_id = "volume_id";
10605    /// # let replication_id = "replication_id";
10606    /// let x = StopReplicationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/replications/{replication_id}"));
10607    /// ```
10608    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10609        self.name = v.into();
10610        self
10611    }
10612
10613    /// Sets the value of [force][crate::model::StopReplicationRequest::force].
10614    ///
10615    /// # Example
10616    /// ```ignore,no_run
10617    /// # use google_cloud_netapp_v1::model::StopReplicationRequest;
10618    /// let x = StopReplicationRequest::new().set_force(true);
10619    /// ```
10620    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10621        self.force = v.into();
10622        self
10623    }
10624}
10625
10626impl wkt::message::Message for StopReplicationRequest {
10627    fn typename() -> &'static str {
10628        "type.googleapis.com/google.cloud.netapp.v1.StopReplicationRequest"
10629    }
10630}
10631
10632/// ResumeReplicationRequest resumes a stopped replication.
10633#[derive(Clone, Default, PartialEq)]
10634#[non_exhaustive]
10635pub struct ResumeReplicationRequest {
10636    /// Required. The resource name of the replication, in the format of
10637    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10638    pub name: std::string::String,
10639
10640    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10641}
10642
10643impl ResumeReplicationRequest {
10644    /// Creates a new default instance.
10645    pub fn new() -> Self {
10646        std::default::Default::default()
10647    }
10648
10649    /// Sets the value of [name][crate::model::ResumeReplicationRequest::name].
10650    ///
10651    /// # Example
10652    /// ```ignore,no_run
10653    /// # use google_cloud_netapp_v1::model::ResumeReplicationRequest;
10654    /// # let project_id = "project_id";
10655    /// # let location_id = "location_id";
10656    /// # let volume_id = "volume_id";
10657    /// # let replication_id = "replication_id";
10658    /// let x = ResumeReplicationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/replications/{replication_id}"));
10659    /// ```
10660    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10661        self.name = v.into();
10662        self
10663    }
10664}
10665
10666impl wkt::message::Message for ResumeReplicationRequest {
10667    fn typename() -> &'static str {
10668        "type.googleapis.com/google.cloud.netapp.v1.ResumeReplicationRequest"
10669    }
10670}
10671
10672/// ReverseReplicationDirectionRequest reverses direction of replication. Source
10673/// becomes destination and destination becomes source.
10674#[derive(Clone, Default, PartialEq)]
10675#[non_exhaustive]
10676pub struct ReverseReplicationDirectionRequest {
10677    /// Required. The resource name of the replication, in the format of
10678    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10679    pub name: std::string::String,
10680
10681    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10682}
10683
10684impl ReverseReplicationDirectionRequest {
10685    /// Creates a new default instance.
10686    pub fn new() -> Self {
10687        std::default::Default::default()
10688    }
10689
10690    /// Sets the value of [name][crate::model::ReverseReplicationDirectionRequest::name].
10691    ///
10692    /// # Example
10693    /// ```ignore,no_run
10694    /// # use google_cloud_netapp_v1::model::ReverseReplicationDirectionRequest;
10695    /// # let project_id = "project_id";
10696    /// # let location_id = "location_id";
10697    /// # let volume_id = "volume_id";
10698    /// # let replication_id = "replication_id";
10699    /// let x = ReverseReplicationDirectionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/replications/{replication_id}"));
10700    /// ```
10701    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10702        self.name = v.into();
10703        self
10704    }
10705}
10706
10707impl wkt::message::Message for ReverseReplicationDirectionRequest {
10708    fn typename() -> &'static str {
10709        "type.googleapis.com/google.cloud.netapp.v1.ReverseReplicationDirectionRequest"
10710    }
10711}
10712
10713/// EstablishPeeringRequest establishes cluster and svm peerings between the
10714/// source and the destination replications.
10715#[derive(Clone, Default, PartialEq)]
10716#[non_exhaustive]
10717pub struct EstablishPeeringRequest {
10718    /// Required. The resource name of the replication, in the format of
10719    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10720    pub name: std::string::String,
10721
10722    /// Required. Name of the user's local source cluster to be peered with the
10723    /// destination cluster.
10724    pub peer_cluster_name: std::string::String,
10725
10726    /// Required. Name of the user's local source vserver svm to be peered with the
10727    /// destination vserver svm.
10728    pub peer_svm_name: std::string::String,
10729
10730    /// Optional. List of IPv4 ip addresses to be used for peering.
10731    pub peer_ip_addresses: std::vec::Vec<std::string::String>,
10732
10733    /// Required. Name of the user's local source volume to be peered with the
10734    /// destination volume.
10735    pub peer_volume_name: std::string::String,
10736
10737    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10738}
10739
10740impl EstablishPeeringRequest {
10741    /// Creates a new default instance.
10742    pub fn new() -> Self {
10743        std::default::Default::default()
10744    }
10745
10746    /// Sets the value of [name][crate::model::EstablishPeeringRequest::name].
10747    ///
10748    /// # Example
10749    /// ```ignore,no_run
10750    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10751    /// # let project_id = "project_id";
10752    /// # let location_id = "location_id";
10753    /// # let volume_id = "volume_id";
10754    /// # let replication_id = "replication_id";
10755    /// let x = EstablishPeeringRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/replications/{replication_id}"));
10756    /// ```
10757    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10758        self.name = v.into();
10759        self
10760    }
10761
10762    /// Sets the value of [peer_cluster_name][crate::model::EstablishPeeringRequest::peer_cluster_name].
10763    ///
10764    /// # Example
10765    /// ```ignore,no_run
10766    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10767    /// let x = EstablishPeeringRequest::new().set_peer_cluster_name("example");
10768    /// ```
10769    pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
10770        mut self,
10771        v: T,
10772    ) -> Self {
10773        self.peer_cluster_name = v.into();
10774        self
10775    }
10776
10777    /// Sets the value of [peer_svm_name][crate::model::EstablishPeeringRequest::peer_svm_name].
10778    ///
10779    /// # Example
10780    /// ```ignore,no_run
10781    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10782    /// let x = EstablishPeeringRequest::new().set_peer_svm_name("example");
10783    /// ```
10784    pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10785        self.peer_svm_name = v.into();
10786        self
10787    }
10788
10789    /// Sets the value of [peer_ip_addresses][crate::model::EstablishPeeringRequest::peer_ip_addresses].
10790    ///
10791    /// # Example
10792    /// ```ignore,no_run
10793    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10794    /// let x = EstablishPeeringRequest::new().set_peer_ip_addresses(["a", "b", "c"]);
10795    /// ```
10796    pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
10797    where
10798        T: std::iter::IntoIterator<Item = V>,
10799        V: std::convert::Into<std::string::String>,
10800    {
10801        use std::iter::Iterator;
10802        self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
10803        self
10804    }
10805
10806    /// Sets the value of [peer_volume_name][crate::model::EstablishPeeringRequest::peer_volume_name].
10807    ///
10808    /// # Example
10809    /// ```ignore,no_run
10810    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10811    /// let x = EstablishPeeringRequest::new().set_peer_volume_name("example");
10812    /// ```
10813    pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
10814        mut self,
10815        v: T,
10816    ) -> Self {
10817        self.peer_volume_name = v.into();
10818        self
10819    }
10820}
10821
10822impl wkt::message::Message for EstablishPeeringRequest {
10823    fn typename() -> &'static str {
10824        "type.googleapis.com/google.cloud.netapp.v1.EstablishPeeringRequest"
10825    }
10826}
10827
10828/// SyncReplicationRequest syncs the replication from source to destination.
10829#[derive(Clone, Default, PartialEq)]
10830#[non_exhaustive]
10831pub struct SyncReplicationRequest {
10832    /// Required. The resource name of the replication, in the format of
10833    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10834    pub name: std::string::String,
10835
10836    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10837}
10838
10839impl SyncReplicationRequest {
10840    /// Creates a new default instance.
10841    pub fn new() -> Self {
10842        std::default::Default::default()
10843    }
10844
10845    /// Sets the value of [name][crate::model::SyncReplicationRequest::name].
10846    ///
10847    /// # Example
10848    /// ```ignore,no_run
10849    /// # use google_cloud_netapp_v1::model::SyncReplicationRequest;
10850    /// # let project_id = "project_id";
10851    /// # let location_id = "location_id";
10852    /// # let volume_id = "volume_id";
10853    /// # let replication_id = "replication_id";
10854    /// let x = SyncReplicationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/replications/{replication_id}"));
10855    /// ```
10856    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10857        self.name = v.into();
10858        self
10859    }
10860}
10861
10862impl wkt::message::Message for SyncReplicationRequest {
10863    fn typename() -> &'static str {
10864        "type.googleapis.com/google.cloud.netapp.v1.SyncReplicationRequest"
10865    }
10866}
10867
10868/// ListSnapshotsRequest lists snapshots.
10869#[derive(Clone, Default, PartialEq)]
10870#[non_exhaustive]
10871pub struct ListSnapshotsRequest {
10872    /// Required. The volume for which to retrieve snapshot information,
10873    /// in the format
10874    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`.
10875    pub parent: std::string::String,
10876
10877    /// The maximum number of items to return.
10878    pub page_size: i32,
10879
10880    /// The next_page_token value to use if there are additional
10881    /// results to retrieve for this list request.
10882    pub page_token: std::string::String,
10883
10884    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
10885    pub order_by: std::string::String,
10886
10887    /// List filter.
10888    pub filter: std::string::String,
10889
10890    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10891}
10892
10893impl ListSnapshotsRequest {
10894    /// Creates a new default instance.
10895    pub fn new() -> Self {
10896        std::default::Default::default()
10897    }
10898
10899    /// Sets the value of [parent][crate::model::ListSnapshotsRequest::parent].
10900    ///
10901    /// # Example
10902    /// ```ignore,no_run
10903    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10904    /// # let project_id = "project_id";
10905    /// # let location_id = "location_id";
10906    /// # let volume_id = "volume_id";
10907    /// let x = ListSnapshotsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
10908    /// ```
10909    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10910        self.parent = v.into();
10911        self
10912    }
10913
10914    /// Sets the value of [page_size][crate::model::ListSnapshotsRequest::page_size].
10915    ///
10916    /// # Example
10917    /// ```ignore,no_run
10918    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10919    /// let x = ListSnapshotsRequest::new().set_page_size(42);
10920    /// ```
10921    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10922        self.page_size = v.into();
10923        self
10924    }
10925
10926    /// Sets the value of [page_token][crate::model::ListSnapshotsRequest::page_token].
10927    ///
10928    /// # Example
10929    /// ```ignore,no_run
10930    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10931    /// let x = ListSnapshotsRequest::new().set_page_token("example");
10932    /// ```
10933    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10934        self.page_token = v.into();
10935        self
10936    }
10937
10938    /// Sets the value of [order_by][crate::model::ListSnapshotsRequest::order_by].
10939    ///
10940    /// # Example
10941    /// ```ignore,no_run
10942    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10943    /// let x = ListSnapshotsRequest::new().set_order_by("example");
10944    /// ```
10945    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10946        self.order_by = v.into();
10947        self
10948    }
10949
10950    /// Sets the value of [filter][crate::model::ListSnapshotsRequest::filter].
10951    ///
10952    /// # Example
10953    /// ```ignore,no_run
10954    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10955    /// let x = ListSnapshotsRequest::new().set_filter("example");
10956    /// ```
10957    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10958        self.filter = v.into();
10959        self
10960    }
10961}
10962
10963impl wkt::message::Message for ListSnapshotsRequest {
10964    fn typename() -> &'static str {
10965        "type.googleapis.com/google.cloud.netapp.v1.ListSnapshotsRequest"
10966    }
10967}
10968
10969/// ListSnapshotsResponse is the result of ListSnapshotsRequest.
10970#[derive(Clone, Default, PartialEq)]
10971#[non_exhaustive]
10972pub struct ListSnapshotsResponse {
10973    /// A list of snapshots in the project for the specified volume.
10974    pub snapshots: std::vec::Vec<crate::model::Snapshot>,
10975
10976    /// The token you can use to retrieve the next page of results. Not returned
10977    /// if there are no more results in the list.
10978    pub next_page_token: std::string::String,
10979
10980    /// Locations that could not be reached.
10981    pub unreachable: std::vec::Vec<std::string::String>,
10982
10983    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10984}
10985
10986impl ListSnapshotsResponse {
10987    /// Creates a new default instance.
10988    pub fn new() -> Self {
10989        std::default::Default::default()
10990    }
10991
10992    /// Sets the value of [snapshots][crate::model::ListSnapshotsResponse::snapshots].
10993    ///
10994    /// # Example
10995    /// ```ignore,no_run
10996    /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
10997    /// use google_cloud_netapp_v1::model::Snapshot;
10998    /// let x = ListSnapshotsResponse::new()
10999    ///     .set_snapshots([
11000    ///         Snapshot::default()/* use setters */,
11001    ///         Snapshot::default()/* use (different) setters */,
11002    ///     ]);
11003    /// ```
11004    pub fn set_snapshots<T, V>(mut self, v: T) -> Self
11005    where
11006        T: std::iter::IntoIterator<Item = V>,
11007        V: std::convert::Into<crate::model::Snapshot>,
11008    {
11009        use std::iter::Iterator;
11010        self.snapshots = v.into_iter().map(|i| i.into()).collect();
11011        self
11012    }
11013
11014    /// Sets the value of [next_page_token][crate::model::ListSnapshotsResponse::next_page_token].
11015    ///
11016    /// # Example
11017    /// ```ignore,no_run
11018    /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
11019    /// let x = ListSnapshotsResponse::new().set_next_page_token("example");
11020    /// ```
11021    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11022        self.next_page_token = v.into();
11023        self
11024    }
11025
11026    /// Sets the value of [unreachable][crate::model::ListSnapshotsResponse::unreachable].
11027    ///
11028    /// # Example
11029    /// ```ignore,no_run
11030    /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
11031    /// let x = ListSnapshotsResponse::new().set_unreachable(["a", "b", "c"]);
11032    /// ```
11033    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11034    where
11035        T: std::iter::IntoIterator<Item = V>,
11036        V: std::convert::Into<std::string::String>,
11037    {
11038        use std::iter::Iterator;
11039        self.unreachable = v.into_iter().map(|i| i.into()).collect();
11040        self
11041    }
11042}
11043
11044impl wkt::message::Message for ListSnapshotsResponse {
11045    fn typename() -> &'static str {
11046        "type.googleapis.com/google.cloud.netapp.v1.ListSnapshotsResponse"
11047    }
11048}
11049
11050#[doc(hidden)]
11051impl google_cloud_gax::paginator::internal::PageableResponse for ListSnapshotsResponse {
11052    type PageItem = crate::model::Snapshot;
11053
11054    fn items(self) -> std::vec::Vec<Self::PageItem> {
11055        self.snapshots
11056    }
11057
11058    fn next_page_token(&self) -> std::string::String {
11059        use std::clone::Clone;
11060        self.next_page_token.clone()
11061    }
11062}
11063
11064/// GetSnapshotRequest gets the state of a snapshot.
11065#[derive(Clone, Default, PartialEq)]
11066#[non_exhaustive]
11067pub struct GetSnapshotRequest {
11068    /// Required. The snapshot resource name, in the format
11069    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`
11070    pub name: std::string::String,
11071
11072    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11073}
11074
11075impl GetSnapshotRequest {
11076    /// Creates a new default instance.
11077    pub fn new() -> Self {
11078        std::default::Default::default()
11079    }
11080
11081    /// Sets the value of [name][crate::model::GetSnapshotRequest::name].
11082    ///
11083    /// # Example
11084    /// ```ignore,no_run
11085    /// # use google_cloud_netapp_v1::model::GetSnapshotRequest;
11086    /// # let project_id = "project_id";
11087    /// # let location_id = "location_id";
11088    /// # let volume_id = "volume_id";
11089    /// # let snapshot_id = "snapshot_id";
11090    /// let x = GetSnapshotRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}"));
11091    /// ```
11092    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11093        self.name = v.into();
11094        self
11095    }
11096}
11097
11098impl wkt::message::Message for GetSnapshotRequest {
11099    fn typename() -> &'static str {
11100        "type.googleapis.com/google.cloud.netapp.v1.GetSnapshotRequest"
11101    }
11102}
11103
11104/// CreateSnapshotRequest creates a snapshot.
11105#[derive(Clone, Default, PartialEq)]
11106#[non_exhaustive]
11107pub struct CreateSnapshotRequest {
11108    /// Required. The NetApp volume to create the snapshots of, in the format
11109    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
11110    pub parent: std::string::String,
11111
11112    /// Required. A snapshot resource
11113    pub snapshot: std::option::Option<crate::model::Snapshot>,
11114
11115    /// Required. ID of the snapshot to create. Must be unique within the parent
11116    /// resource. Must contain only letters, numbers and hyphen, with the first
11117    /// character a letter, the last a letter or a
11118    /// number, and a 63 character maximum.
11119    pub snapshot_id: std::string::String,
11120
11121    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11122}
11123
11124impl CreateSnapshotRequest {
11125    /// Creates a new default instance.
11126    pub fn new() -> Self {
11127        std::default::Default::default()
11128    }
11129
11130    /// Sets the value of [parent][crate::model::CreateSnapshotRequest::parent].
11131    ///
11132    /// # Example
11133    /// ```ignore,no_run
11134    /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
11135    /// # let project_id = "project_id";
11136    /// # let location_id = "location_id";
11137    /// # let volume_id = "volume_id";
11138    /// let x = CreateSnapshotRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
11139    /// ```
11140    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11141        self.parent = v.into();
11142        self
11143    }
11144
11145    /// Sets the value of [snapshot][crate::model::CreateSnapshotRequest::snapshot].
11146    ///
11147    /// # Example
11148    /// ```ignore,no_run
11149    /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
11150    /// use google_cloud_netapp_v1::model::Snapshot;
11151    /// let x = CreateSnapshotRequest::new().set_snapshot(Snapshot::default()/* use setters */);
11152    /// ```
11153    pub fn set_snapshot<T>(mut self, v: T) -> Self
11154    where
11155        T: std::convert::Into<crate::model::Snapshot>,
11156    {
11157        self.snapshot = std::option::Option::Some(v.into());
11158        self
11159    }
11160
11161    /// Sets or clears the value of [snapshot][crate::model::CreateSnapshotRequest::snapshot].
11162    ///
11163    /// # Example
11164    /// ```ignore,no_run
11165    /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
11166    /// use google_cloud_netapp_v1::model::Snapshot;
11167    /// let x = CreateSnapshotRequest::new().set_or_clear_snapshot(Some(Snapshot::default()/* use setters */));
11168    /// let x = CreateSnapshotRequest::new().set_or_clear_snapshot(None::<Snapshot>);
11169    /// ```
11170    pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
11171    where
11172        T: std::convert::Into<crate::model::Snapshot>,
11173    {
11174        self.snapshot = v.map(|x| x.into());
11175        self
11176    }
11177
11178    /// Sets the value of [snapshot_id][crate::model::CreateSnapshotRequest::snapshot_id].
11179    ///
11180    /// # Example
11181    /// ```ignore,no_run
11182    /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
11183    /// let x = CreateSnapshotRequest::new().set_snapshot_id("example");
11184    /// ```
11185    pub fn set_snapshot_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11186        self.snapshot_id = v.into();
11187        self
11188    }
11189}
11190
11191impl wkt::message::Message for CreateSnapshotRequest {
11192    fn typename() -> &'static str {
11193        "type.googleapis.com/google.cloud.netapp.v1.CreateSnapshotRequest"
11194    }
11195}
11196
11197/// DeleteSnapshotRequest deletes a snapshot.
11198#[derive(Clone, Default, PartialEq)]
11199#[non_exhaustive]
11200pub struct DeleteSnapshotRequest {
11201    /// Required. The snapshot resource name, in the format
11202    /// `projects/*/locations/*/volumes/*/snapshots/{snapshot_id}`
11203    pub name: std::string::String,
11204
11205    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11206}
11207
11208impl DeleteSnapshotRequest {
11209    /// Creates a new default instance.
11210    pub fn new() -> Self {
11211        std::default::Default::default()
11212    }
11213
11214    /// Sets the value of [name][crate::model::DeleteSnapshotRequest::name].
11215    ///
11216    /// # Example
11217    /// ```ignore,no_run
11218    /// # use google_cloud_netapp_v1::model::DeleteSnapshotRequest;
11219    /// # let project_id = "project_id";
11220    /// # let location_id = "location_id";
11221    /// # let volume_id = "volume_id";
11222    /// # let snapshot_id = "snapshot_id";
11223    /// let x = DeleteSnapshotRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}"));
11224    /// ```
11225    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11226        self.name = v.into();
11227        self
11228    }
11229}
11230
11231impl wkt::message::Message for DeleteSnapshotRequest {
11232    fn typename() -> &'static str {
11233        "type.googleapis.com/google.cloud.netapp.v1.DeleteSnapshotRequest"
11234    }
11235}
11236
11237/// UpdateSnapshotRequest updates description and/or labels for a snapshot.
11238#[derive(Clone, Default, PartialEq)]
11239#[non_exhaustive]
11240pub struct UpdateSnapshotRequest {
11241    /// Required. Mask of fields to update.  At least one path must be supplied in
11242    /// this field.
11243    pub update_mask: std::option::Option<wkt::FieldMask>,
11244
11245    /// Required. A snapshot resource
11246    pub snapshot: std::option::Option<crate::model::Snapshot>,
11247
11248    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11249}
11250
11251impl UpdateSnapshotRequest {
11252    /// Creates a new default instance.
11253    pub fn new() -> Self {
11254        std::default::Default::default()
11255    }
11256
11257    /// Sets the value of [update_mask][crate::model::UpdateSnapshotRequest::update_mask].
11258    ///
11259    /// # Example
11260    /// ```ignore,no_run
11261    /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
11262    /// use wkt::FieldMask;
11263    /// let x = UpdateSnapshotRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11264    /// ```
11265    pub fn set_update_mask<T>(mut self, v: T) -> Self
11266    where
11267        T: std::convert::Into<wkt::FieldMask>,
11268    {
11269        self.update_mask = std::option::Option::Some(v.into());
11270        self
11271    }
11272
11273    /// Sets or clears the value of [update_mask][crate::model::UpdateSnapshotRequest::update_mask].
11274    ///
11275    /// # Example
11276    /// ```ignore,no_run
11277    /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
11278    /// use wkt::FieldMask;
11279    /// let x = UpdateSnapshotRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11280    /// let x = UpdateSnapshotRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11281    /// ```
11282    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11283    where
11284        T: std::convert::Into<wkt::FieldMask>,
11285    {
11286        self.update_mask = v.map(|x| x.into());
11287        self
11288    }
11289
11290    /// Sets the value of [snapshot][crate::model::UpdateSnapshotRequest::snapshot].
11291    ///
11292    /// # Example
11293    /// ```ignore,no_run
11294    /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
11295    /// use google_cloud_netapp_v1::model::Snapshot;
11296    /// let x = UpdateSnapshotRequest::new().set_snapshot(Snapshot::default()/* use setters */);
11297    /// ```
11298    pub fn set_snapshot<T>(mut self, v: T) -> Self
11299    where
11300        T: std::convert::Into<crate::model::Snapshot>,
11301    {
11302        self.snapshot = std::option::Option::Some(v.into());
11303        self
11304    }
11305
11306    /// Sets or clears the value of [snapshot][crate::model::UpdateSnapshotRequest::snapshot].
11307    ///
11308    /// # Example
11309    /// ```ignore,no_run
11310    /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
11311    /// use google_cloud_netapp_v1::model::Snapshot;
11312    /// let x = UpdateSnapshotRequest::new().set_or_clear_snapshot(Some(Snapshot::default()/* use setters */));
11313    /// let x = UpdateSnapshotRequest::new().set_or_clear_snapshot(None::<Snapshot>);
11314    /// ```
11315    pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
11316    where
11317        T: std::convert::Into<crate::model::Snapshot>,
11318    {
11319        self.snapshot = v.map(|x| x.into());
11320        self
11321    }
11322}
11323
11324impl wkt::message::Message for UpdateSnapshotRequest {
11325    fn typename() -> &'static str {
11326        "type.googleapis.com/google.cloud.netapp.v1.UpdateSnapshotRequest"
11327    }
11328}
11329
11330/// Snapshot is a point-in-time version of a Volume's content.
11331#[derive(Clone, Default, PartialEq)]
11332#[non_exhaustive]
11333pub struct Snapshot {
11334    /// Identifier. The resource name of the snapshot.
11335    /// Format:
11336    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`.
11337    pub name: std::string::String,
11338
11339    /// Output only. The snapshot state.
11340    pub state: crate::model::snapshot::State,
11341
11342    /// Output only. State details of the storage pool
11343    pub state_details: std::string::String,
11344
11345    /// A description of the snapshot with 2048 characters or less.
11346    /// Requests with longer descriptions will be rejected.
11347    pub description: std::string::String,
11348
11349    /// Output only. Current storage usage for the snapshot in bytes.
11350    pub used_bytes: f64,
11351
11352    /// Output only. The time when the snapshot was created.
11353    pub create_time: std::option::Option<wkt::Timestamp>,
11354
11355    /// Resource labels to represent user provided metadata.
11356    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11357
11358    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11359}
11360
11361impl Snapshot {
11362    /// Creates a new default instance.
11363    pub fn new() -> Self {
11364        std::default::Default::default()
11365    }
11366
11367    /// Sets the value of [name][crate::model::Snapshot::name].
11368    ///
11369    /// # Example
11370    /// ```ignore,no_run
11371    /// # use google_cloud_netapp_v1::model::Snapshot;
11372    /// # let project_id = "project_id";
11373    /// # let location_id = "location_id";
11374    /// # let volume_id = "volume_id";
11375    /// # let snapshot_id = "snapshot_id";
11376    /// let x = Snapshot::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}"));
11377    /// ```
11378    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11379        self.name = v.into();
11380        self
11381    }
11382
11383    /// Sets the value of [state][crate::model::Snapshot::state].
11384    ///
11385    /// # Example
11386    /// ```ignore,no_run
11387    /// # use google_cloud_netapp_v1::model::Snapshot;
11388    /// use google_cloud_netapp_v1::model::snapshot::State;
11389    /// let x0 = Snapshot::new().set_state(State::Ready);
11390    /// let x1 = Snapshot::new().set_state(State::Creating);
11391    /// let x2 = Snapshot::new().set_state(State::Deleting);
11392    /// ```
11393    pub fn set_state<T: std::convert::Into<crate::model::snapshot::State>>(mut self, v: T) -> Self {
11394        self.state = v.into();
11395        self
11396    }
11397
11398    /// Sets the value of [state_details][crate::model::Snapshot::state_details].
11399    ///
11400    /// # Example
11401    /// ```ignore,no_run
11402    /// # use google_cloud_netapp_v1::model::Snapshot;
11403    /// let x = Snapshot::new().set_state_details("example");
11404    /// ```
11405    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11406        self.state_details = v.into();
11407        self
11408    }
11409
11410    /// Sets the value of [description][crate::model::Snapshot::description].
11411    ///
11412    /// # Example
11413    /// ```ignore,no_run
11414    /// # use google_cloud_netapp_v1::model::Snapshot;
11415    /// let x = Snapshot::new().set_description("example");
11416    /// ```
11417    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11418        self.description = v.into();
11419        self
11420    }
11421
11422    /// Sets the value of [used_bytes][crate::model::Snapshot::used_bytes].
11423    ///
11424    /// # Example
11425    /// ```ignore,no_run
11426    /// # use google_cloud_netapp_v1::model::Snapshot;
11427    /// let x = Snapshot::new().set_used_bytes(42.0);
11428    /// ```
11429    pub fn set_used_bytes<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11430        self.used_bytes = v.into();
11431        self
11432    }
11433
11434    /// Sets the value of [create_time][crate::model::Snapshot::create_time].
11435    ///
11436    /// # Example
11437    /// ```ignore,no_run
11438    /// # use google_cloud_netapp_v1::model::Snapshot;
11439    /// use wkt::Timestamp;
11440    /// let x = Snapshot::new().set_create_time(Timestamp::default()/* use setters */);
11441    /// ```
11442    pub fn set_create_time<T>(mut self, v: T) -> Self
11443    where
11444        T: std::convert::Into<wkt::Timestamp>,
11445    {
11446        self.create_time = std::option::Option::Some(v.into());
11447        self
11448    }
11449
11450    /// Sets or clears the value of [create_time][crate::model::Snapshot::create_time].
11451    ///
11452    /// # Example
11453    /// ```ignore,no_run
11454    /// # use google_cloud_netapp_v1::model::Snapshot;
11455    /// use wkt::Timestamp;
11456    /// let x = Snapshot::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11457    /// let x = Snapshot::new().set_or_clear_create_time(None::<Timestamp>);
11458    /// ```
11459    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11460    where
11461        T: std::convert::Into<wkt::Timestamp>,
11462    {
11463        self.create_time = v.map(|x| x.into());
11464        self
11465    }
11466
11467    /// Sets the value of [labels][crate::model::Snapshot::labels].
11468    ///
11469    /// # Example
11470    /// ```ignore,no_run
11471    /// # use google_cloud_netapp_v1::model::Snapshot;
11472    /// let x = Snapshot::new().set_labels([
11473    ///     ("key0", "abc"),
11474    ///     ("key1", "xyz"),
11475    /// ]);
11476    /// ```
11477    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11478    where
11479        T: std::iter::IntoIterator<Item = (K, V)>,
11480        K: std::convert::Into<std::string::String>,
11481        V: std::convert::Into<std::string::String>,
11482    {
11483        use std::iter::Iterator;
11484        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11485        self
11486    }
11487}
11488
11489impl wkt::message::Message for Snapshot {
11490    fn typename() -> &'static str {
11491        "type.googleapis.com/google.cloud.netapp.v1.Snapshot"
11492    }
11493}
11494
11495/// Defines additional types related to [Snapshot].
11496pub mod snapshot {
11497    #[allow(unused_imports)]
11498    use super::*;
11499
11500    /// The Snapshot States
11501    ///
11502    /// # Working with unknown values
11503    ///
11504    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11505    /// additional enum variants at any time. Adding new variants is not considered
11506    /// a breaking change. Applications should write their code in anticipation of:
11507    ///
11508    /// - New values appearing in future releases of the client library, **and**
11509    /// - New values received dynamically, without application changes.
11510    ///
11511    /// Please consult the [Working with enums] section in the user guide for some
11512    /// guidelines.
11513    ///
11514    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11515    #[derive(Clone, Debug, PartialEq)]
11516    #[non_exhaustive]
11517    pub enum State {
11518        /// Unspecified Snapshot State
11519        Unspecified,
11520        /// Snapshot State is Ready
11521        Ready,
11522        /// Snapshot State is Creating
11523        Creating,
11524        /// Snapshot State is Deleting
11525        Deleting,
11526        /// Snapshot State is Updating
11527        Updating,
11528        /// Snapshot State is Disabled
11529        Disabled,
11530        /// Snapshot State is Error
11531        Error,
11532        /// If set, the enum was initialized with an unknown value.
11533        ///
11534        /// Applications can examine the value using [State::value] or
11535        /// [State::name].
11536        UnknownValue(state::UnknownValue),
11537    }
11538
11539    #[doc(hidden)]
11540    pub mod state {
11541        #[allow(unused_imports)]
11542        use super::*;
11543        #[derive(Clone, Debug, PartialEq)]
11544        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11545    }
11546
11547    impl State {
11548        /// Gets the enum value.
11549        ///
11550        /// Returns `None` if the enum contains an unknown value deserialized from
11551        /// the string representation of enums.
11552        pub fn value(&self) -> std::option::Option<i32> {
11553            match self {
11554                Self::Unspecified => std::option::Option::Some(0),
11555                Self::Ready => std::option::Option::Some(1),
11556                Self::Creating => std::option::Option::Some(2),
11557                Self::Deleting => std::option::Option::Some(3),
11558                Self::Updating => std::option::Option::Some(4),
11559                Self::Disabled => std::option::Option::Some(5),
11560                Self::Error => std::option::Option::Some(6),
11561                Self::UnknownValue(u) => u.0.value(),
11562            }
11563        }
11564
11565        /// Gets the enum value as a string.
11566        ///
11567        /// Returns `None` if the enum contains an unknown value deserialized from
11568        /// the integer representation of enums.
11569        pub fn name(&self) -> std::option::Option<&str> {
11570            match self {
11571                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11572                Self::Ready => std::option::Option::Some("READY"),
11573                Self::Creating => std::option::Option::Some("CREATING"),
11574                Self::Deleting => std::option::Option::Some("DELETING"),
11575                Self::Updating => std::option::Option::Some("UPDATING"),
11576                Self::Disabled => std::option::Option::Some("DISABLED"),
11577                Self::Error => std::option::Option::Some("ERROR"),
11578                Self::UnknownValue(u) => u.0.name(),
11579            }
11580        }
11581    }
11582
11583    impl std::default::Default for State {
11584        fn default() -> Self {
11585            use std::convert::From;
11586            Self::from(0)
11587        }
11588    }
11589
11590    impl std::fmt::Display for State {
11591        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11592            wkt::internal::display_enum(f, self.name(), self.value())
11593        }
11594    }
11595
11596    impl std::convert::From<i32> for State {
11597        fn from(value: i32) -> Self {
11598            match value {
11599                0 => Self::Unspecified,
11600                1 => Self::Ready,
11601                2 => Self::Creating,
11602                3 => Self::Deleting,
11603                4 => Self::Updating,
11604                5 => Self::Disabled,
11605                6 => Self::Error,
11606                _ => Self::UnknownValue(state::UnknownValue(
11607                    wkt::internal::UnknownEnumValue::Integer(value),
11608                )),
11609            }
11610        }
11611    }
11612
11613    impl std::convert::From<&str> for State {
11614        fn from(value: &str) -> Self {
11615            use std::string::ToString;
11616            match value {
11617                "STATE_UNSPECIFIED" => Self::Unspecified,
11618                "READY" => Self::Ready,
11619                "CREATING" => Self::Creating,
11620                "DELETING" => Self::Deleting,
11621                "UPDATING" => Self::Updating,
11622                "DISABLED" => Self::Disabled,
11623                "ERROR" => Self::Error,
11624                _ => Self::UnknownValue(state::UnknownValue(
11625                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11626                )),
11627            }
11628        }
11629    }
11630
11631    impl serde::ser::Serialize for State {
11632        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11633        where
11634            S: serde::Serializer,
11635        {
11636            match self {
11637                Self::Unspecified => serializer.serialize_i32(0),
11638                Self::Ready => serializer.serialize_i32(1),
11639                Self::Creating => serializer.serialize_i32(2),
11640                Self::Deleting => serializer.serialize_i32(3),
11641                Self::Updating => serializer.serialize_i32(4),
11642                Self::Disabled => serializer.serialize_i32(5),
11643                Self::Error => serializer.serialize_i32(6),
11644                Self::UnknownValue(u) => u.0.serialize(serializer),
11645            }
11646        }
11647    }
11648
11649    impl<'de> serde::de::Deserialize<'de> for State {
11650        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11651        where
11652            D: serde::Deserializer<'de>,
11653        {
11654            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11655                ".google.cloud.netapp.v1.Snapshot.State",
11656            ))
11657        }
11658    }
11659}
11660
11661/// GetStoragePoolRequest gets a Storage Pool.
11662#[derive(Clone, Default, PartialEq)]
11663#[non_exhaustive]
11664pub struct GetStoragePoolRequest {
11665    /// Required. Name of the storage pool
11666    pub name: std::string::String,
11667
11668    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11669}
11670
11671impl GetStoragePoolRequest {
11672    /// Creates a new default instance.
11673    pub fn new() -> Self {
11674        std::default::Default::default()
11675    }
11676
11677    /// Sets the value of [name][crate::model::GetStoragePoolRequest::name].
11678    ///
11679    /// # Example
11680    /// ```ignore,no_run
11681    /// # use google_cloud_netapp_v1::model::GetStoragePoolRequest;
11682    /// # let project_id = "project_id";
11683    /// # let location_id = "location_id";
11684    /// # let storage_pool_id = "storage_pool_id";
11685    /// let x = GetStoragePoolRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/storagePools/{storage_pool_id}"));
11686    /// ```
11687    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11688        self.name = v.into();
11689        self
11690    }
11691}
11692
11693impl wkt::message::Message for GetStoragePoolRequest {
11694    fn typename() -> &'static str {
11695        "type.googleapis.com/google.cloud.netapp.v1.GetStoragePoolRequest"
11696    }
11697}
11698
11699/// ListStoragePoolsRequest lists Storage Pools.
11700#[derive(Clone, Default, PartialEq)]
11701#[non_exhaustive]
11702pub struct ListStoragePoolsRequest {
11703    /// Required. Parent value
11704    pub parent: std::string::String,
11705
11706    /// Optional. The maximum number of items to return.
11707    pub page_size: i32,
11708
11709    /// Optional. The next_page_token value to use if there are additional
11710    /// results to retrieve for this list request.
11711    pub page_token: std::string::String,
11712
11713    /// Optional. Sort results. Supported values are "name", "name desc" or ""
11714    /// (unsorted).
11715    pub order_by: std::string::String,
11716
11717    /// Optional. List filter.
11718    pub filter: std::string::String,
11719
11720    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11721}
11722
11723impl ListStoragePoolsRequest {
11724    /// Creates a new default instance.
11725    pub fn new() -> Self {
11726        std::default::Default::default()
11727    }
11728
11729    /// Sets the value of [parent][crate::model::ListStoragePoolsRequest::parent].
11730    ///
11731    /// # Example
11732    /// ```ignore,no_run
11733    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11734    /// # let project_id = "project_id";
11735    /// # let location_id = "location_id";
11736    /// let x = ListStoragePoolsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
11737    /// ```
11738    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11739        self.parent = v.into();
11740        self
11741    }
11742
11743    /// Sets the value of [page_size][crate::model::ListStoragePoolsRequest::page_size].
11744    ///
11745    /// # Example
11746    /// ```ignore,no_run
11747    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11748    /// let x = ListStoragePoolsRequest::new().set_page_size(42);
11749    /// ```
11750    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11751        self.page_size = v.into();
11752        self
11753    }
11754
11755    /// Sets the value of [page_token][crate::model::ListStoragePoolsRequest::page_token].
11756    ///
11757    /// # Example
11758    /// ```ignore,no_run
11759    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11760    /// let x = ListStoragePoolsRequest::new().set_page_token("example");
11761    /// ```
11762    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11763        self.page_token = v.into();
11764        self
11765    }
11766
11767    /// Sets the value of [order_by][crate::model::ListStoragePoolsRequest::order_by].
11768    ///
11769    /// # Example
11770    /// ```ignore,no_run
11771    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11772    /// let x = ListStoragePoolsRequest::new().set_order_by("example");
11773    /// ```
11774    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11775        self.order_by = v.into();
11776        self
11777    }
11778
11779    /// Sets the value of [filter][crate::model::ListStoragePoolsRequest::filter].
11780    ///
11781    /// # Example
11782    /// ```ignore,no_run
11783    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11784    /// let x = ListStoragePoolsRequest::new().set_filter("example");
11785    /// ```
11786    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11787        self.filter = v.into();
11788        self
11789    }
11790}
11791
11792impl wkt::message::Message for ListStoragePoolsRequest {
11793    fn typename() -> &'static str {
11794        "type.googleapis.com/google.cloud.netapp.v1.ListStoragePoolsRequest"
11795    }
11796}
11797
11798/// ListStoragePoolsResponse is the response to a ListStoragePoolsRequest.
11799#[derive(Clone, Default, PartialEq)]
11800#[non_exhaustive]
11801pub struct ListStoragePoolsResponse {
11802    /// The list of StoragePools
11803    pub storage_pools: std::vec::Vec<crate::model::StoragePool>,
11804
11805    /// A token identifying a page of results the server should return.
11806    pub next_page_token: std::string::String,
11807
11808    /// Locations that could not be reached.
11809    pub unreachable: std::vec::Vec<std::string::String>,
11810
11811    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11812}
11813
11814impl ListStoragePoolsResponse {
11815    /// Creates a new default instance.
11816    pub fn new() -> Self {
11817        std::default::Default::default()
11818    }
11819
11820    /// Sets the value of [storage_pools][crate::model::ListStoragePoolsResponse::storage_pools].
11821    ///
11822    /// # Example
11823    /// ```ignore,no_run
11824    /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
11825    /// use google_cloud_netapp_v1::model::StoragePool;
11826    /// let x = ListStoragePoolsResponse::new()
11827    ///     .set_storage_pools([
11828    ///         StoragePool::default()/* use setters */,
11829    ///         StoragePool::default()/* use (different) setters */,
11830    ///     ]);
11831    /// ```
11832    pub fn set_storage_pools<T, V>(mut self, v: T) -> Self
11833    where
11834        T: std::iter::IntoIterator<Item = V>,
11835        V: std::convert::Into<crate::model::StoragePool>,
11836    {
11837        use std::iter::Iterator;
11838        self.storage_pools = v.into_iter().map(|i| i.into()).collect();
11839        self
11840    }
11841
11842    /// Sets the value of [next_page_token][crate::model::ListStoragePoolsResponse::next_page_token].
11843    ///
11844    /// # Example
11845    /// ```ignore,no_run
11846    /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
11847    /// let x = ListStoragePoolsResponse::new().set_next_page_token("example");
11848    /// ```
11849    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11850        self.next_page_token = v.into();
11851        self
11852    }
11853
11854    /// Sets the value of [unreachable][crate::model::ListStoragePoolsResponse::unreachable].
11855    ///
11856    /// # Example
11857    /// ```ignore,no_run
11858    /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
11859    /// let x = ListStoragePoolsResponse::new().set_unreachable(["a", "b", "c"]);
11860    /// ```
11861    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11862    where
11863        T: std::iter::IntoIterator<Item = V>,
11864        V: std::convert::Into<std::string::String>,
11865    {
11866        use std::iter::Iterator;
11867        self.unreachable = v.into_iter().map(|i| i.into()).collect();
11868        self
11869    }
11870}
11871
11872impl wkt::message::Message for ListStoragePoolsResponse {
11873    fn typename() -> &'static str {
11874        "type.googleapis.com/google.cloud.netapp.v1.ListStoragePoolsResponse"
11875    }
11876}
11877
11878#[doc(hidden)]
11879impl google_cloud_gax::paginator::internal::PageableResponse for ListStoragePoolsResponse {
11880    type PageItem = crate::model::StoragePool;
11881
11882    fn items(self) -> std::vec::Vec<Self::PageItem> {
11883        self.storage_pools
11884    }
11885
11886    fn next_page_token(&self) -> std::string::String {
11887        use std::clone::Clone;
11888        self.next_page_token.clone()
11889    }
11890}
11891
11892/// CreateStoragePoolRequest creates a Storage Pool.
11893#[derive(Clone, Default, PartialEq)]
11894#[non_exhaustive]
11895pub struct CreateStoragePoolRequest {
11896    /// Required. Value for parent.
11897    pub parent: std::string::String,
11898
11899    /// Required. Id of the requesting storage pool. Must be unique within the
11900    /// parent resource. Must contain only letters, numbers and hyphen, with the
11901    /// first character a letter, the last a letter or a number, and a 63 character
11902    /// maximum.
11903    pub storage_pool_id: std::string::String,
11904
11905    /// Required. The required parameters to create a new storage pool.
11906    pub storage_pool: std::option::Option<crate::model::StoragePool>,
11907
11908    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11909}
11910
11911impl CreateStoragePoolRequest {
11912    /// Creates a new default instance.
11913    pub fn new() -> Self {
11914        std::default::Default::default()
11915    }
11916
11917    /// Sets the value of [parent][crate::model::CreateStoragePoolRequest::parent].
11918    ///
11919    /// # Example
11920    /// ```ignore,no_run
11921    /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11922    /// # let project_id = "project_id";
11923    /// # let location_id = "location_id";
11924    /// let x = CreateStoragePoolRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
11925    /// ```
11926    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11927        self.parent = v.into();
11928        self
11929    }
11930
11931    /// Sets the value of [storage_pool_id][crate::model::CreateStoragePoolRequest::storage_pool_id].
11932    ///
11933    /// # Example
11934    /// ```ignore,no_run
11935    /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11936    /// let x = CreateStoragePoolRequest::new().set_storage_pool_id("example");
11937    /// ```
11938    pub fn set_storage_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11939        self.storage_pool_id = v.into();
11940        self
11941    }
11942
11943    /// Sets the value of [storage_pool][crate::model::CreateStoragePoolRequest::storage_pool].
11944    ///
11945    /// # Example
11946    /// ```ignore,no_run
11947    /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11948    /// use google_cloud_netapp_v1::model::StoragePool;
11949    /// let x = CreateStoragePoolRequest::new().set_storage_pool(StoragePool::default()/* use setters */);
11950    /// ```
11951    pub fn set_storage_pool<T>(mut self, v: T) -> Self
11952    where
11953        T: std::convert::Into<crate::model::StoragePool>,
11954    {
11955        self.storage_pool = std::option::Option::Some(v.into());
11956        self
11957    }
11958
11959    /// Sets or clears the value of [storage_pool][crate::model::CreateStoragePoolRequest::storage_pool].
11960    ///
11961    /// # Example
11962    /// ```ignore,no_run
11963    /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11964    /// use google_cloud_netapp_v1::model::StoragePool;
11965    /// let x = CreateStoragePoolRequest::new().set_or_clear_storage_pool(Some(StoragePool::default()/* use setters */));
11966    /// let x = CreateStoragePoolRequest::new().set_or_clear_storage_pool(None::<StoragePool>);
11967    /// ```
11968    pub fn set_or_clear_storage_pool<T>(mut self, v: std::option::Option<T>) -> Self
11969    where
11970        T: std::convert::Into<crate::model::StoragePool>,
11971    {
11972        self.storage_pool = v.map(|x| x.into());
11973        self
11974    }
11975}
11976
11977impl wkt::message::Message for CreateStoragePoolRequest {
11978    fn typename() -> &'static str {
11979        "type.googleapis.com/google.cloud.netapp.v1.CreateStoragePoolRequest"
11980    }
11981}
11982
11983/// UpdateStoragePoolRequest updates a Storage Pool.
11984#[derive(Clone, Default, PartialEq)]
11985#[non_exhaustive]
11986pub struct UpdateStoragePoolRequest {
11987    /// Required. Field mask is used to specify the fields to be overwritten in the
11988    /// StoragePool resource by the update.
11989    /// The fields specified in the update_mask are relative to the resource, not
11990    /// the full request. A field will be overwritten if it is in the mask. If the
11991    /// user does not provide a mask then all fields will be overwritten.
11992    pub update_mask: std::option::Option<wkt::FieldMask>,
11993
11994    /// Required. The pool being updated
11995    pub storage_pool: std::option::Option<crate::model::StoragePool>,
11996
11997    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11998}
11999
12000impl UpdateStoragePoolRequest {
12001    /// Creates a new default instance.
12002    pub fn new() -> Self {
12003        std::default::Default::default()
12004    }
12005
12006    /// Sets the value of [update_mask][crate::model::UpdateStoragePoolRequest::update_mask].
12007    ///
12008    /// # Example
12009    /// ```ignore,no_run
12010    /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
12011    /// use wkt::FieldMask;
12012    /// let x = UpdateStoragePoolRequest::new().set_update_mask(FieldMask::default()/* use setters */);
12013    /// ```
12014    pub fn set_update_mask<T>(mut self, v: T) -> Self
12015    where
12016        T: std::convert::Into<wkt::FieldMask>,
12017    {
12018        self.update_mask = std::option::Option::Some(v.into());
12019        self
12020    }
12021
12022    /// Sets or clears the value of [update_mask][crate::model::UpdateStoragePoolRequest::update_mask].
12023    ///
12024    /// # Example
12025    /// ```ignore,no_run
12026    /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
12027    /// use wkt::FieldMask;
12028    /// let x = UpdateStoragePoolRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
12029    /// let x = UpdateStoragePoolRequest::new().set_or_clear_update_mask(None::<FieldMask>);
12030    /// ```
12031    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12032    where
12033        T: std::convert::Into<wkt::FieldMask>,
12034    {
12035        self.update_mask = v.map(|x| x.into());
12036        self
12037    }
12038
12039    /// Sets the value of [storage_pool][crate::model::UpdateStoragePoolRequest::storage_pool].
12040    ///
12041    /// # Example
12042    /// ```ignore,no_run
12043    /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
12044    /// use google_cloud_netapp_v1::model::StoragePool;
12045    /// let x = UpdateStoragePoolRequest::new().set_storage_pool(StoragePool::default()/* use setters */);
12046    /// ```
12047    pub fn set_storage_pool<T>(mut self, v: T) -> Self
12048    where
12049        T: std::convert::Into<crate::model::StoragePool>,
12050    {
12051        self.storage_pool = std::option::Option::Some(v.into());
12052        self
12053    }
12054
12055    /// Sets or clears the value of [storage_pool][crate::model::UpdateStoragePoolRequest::storage_pool].
12056    ///
12057    /// # Example
12058    /// ```ignore,no_run
12059    /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
12060    /// use google_cloud_netapp_v1::model::StoragePool;
12061    /// let x = UpdateStoragePoolRequest::new().set_or_clear_storage_pool(Some(StoragePool::default()/* use setters */));
12062    /// let x = UpdateStoragePoolRequest::new().set_or_clear_storage_pool(None::<StoragePool>);
12063    /// ```
12064    pub fn set_or_clear_storage_pool<T>(mut self, v: std::option::Option<T>) -> Self
12065    where
12066        T: std::convert::Into<crate::model::StoragePool>,
12067    {
12068        self.storage_pool = v.map(|x| x.into());
12069        self
12070    }
12071}
12072
12073impl wkt::message::Message for UpdateStoragePoolRequest {
12074    fn typename() -> &'static str {
12075        "type.googleapis.com/google.cloud.netapp.v1.UpdateStoragePoolRequest"
12076    }
12077}
12078
12079/// DeleteStoragePoolRequest deletes a Storage Pool.
12080#[derive(Clone, Default, PartialEq)]
12081#[non_exhaustive]
12082pub struct DeleteStoragePoolRequest {
12083    /// Required. Name of the storage pool
12084    pub name: std::string::String,
12085
12086    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12087}
12088
12089impl DeleteStoragePoolRequest {
12090    /// Creates a new default instance.
12091    pub fn new() -> Self {
12092        std::default::Default::default()
12093    }
12094
12095    /// Sets the value of [name][crate::model::DeleteStoragePoolRequest::name].
12096    ///
12097    /// # Example
12098    /// ```ignore,no_run
12099    /// # use google_cloud_netapp_v1::model::DeleteStoragePoolRequest;
12100    /// # let project_id = "project_id";
12101    /// # let location_id = "location_id";
12102    /// # let storage_pool_id = "storage_pool_id";
12103    /// let x = DeleteStoragePoolRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/storagePools/{storage_pool_id}"));
12104    /// ```
12105    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12106        self.name = v.into();
12107        self
12108    }
12109}
12110
12111impl wkt::message::Message for DeleteStoragePoolRequest {
12112    fn typename() -> &'static str {
12113        "type.googleapis.com/google.cloud.netapp.v1.DeleteStoragePoolRequest"
12114    }
12115}
12116
12117/// SwitchActiveReplicaZoneRequest switch the active/replica zone for a regional
12118/// storagePool.
12119#[derive(Clone, Default, PartialEq)]
12120#[non_exhaustive]
12121pub struct SwitchActiveReplicaZoneRequest {
12122    /// Required. Name of the storage pool
12123    pub name: std::string::String,
12124
12125    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12126}
12127
12128impl SwitchActiveReplicaZoneRequest {
12129    /// Creates a new default instance.
12130    pub fn new() -> Self {
12131        std::default::Default::default()
12132    }
12133
12134    /// Sets the value of [name][crate::model::SwitchActiveReplicaZoneRequest::name].
12135    ///
12136    /// # Example
12137    /// ```ignore,no_run
12138    /// # use google_cloud_netapp_v1::model::SwitchActiveReplicaZoneRequest;
12139    /// # let project_id = "project_id";
12140    /// # let location_id = "location_id";
12141    /// # let storage_pool_id = "storage_pool_id";
12142    /// let x = SwitchActiveReplicaZoneRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/storagePools/{storage_pool_id}"));
12143    /// ```
12144    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12145        self.name = v.into();
12146        self
12147    }
12148}
12149
12150impl wkt::message::Message for SwitchActiveReplicaZoneRequest {
12151    fn typename() -> &'static str {
12152        "type.googleapis.com/google.cloud.netapp.v1.SwitchActiveReplicaZoneRequest"
12153    }
12154}
12155
12156/// StoragePool is a container for volumes with a service level and capacity.
12157/// Volumes can be created in a pool of sufficient available capacity.
12158/// StoragePool capacity is what you are billed for.
12159#[derive(Clone, Default, PartialEq)]
12160#[non_exhaustive]
12161pub struct StoragePool {
12162    /// Identifier. Name of the storage pool
12163    pub name: std::string::String,
12164
12165    /// Required. Service level of the storage pool
12166    pub service_level: crate::model::ServiceLevel,
12167
12168    /// Required. Capacity in GIB of the pool
12169    pub capacity_gib: i64,
12170
12171    /// Output only. Allocated size of all volumes in GIB in the storage pool
12172    pub volume_capacity_gib: i64,
12173
12174    /// Output only. Volume count of the storage pool
12175    pub volume_count: i32,
12176
12177    /// Output only. State of the storage pool
12178    pub state: crate::model::storage_pool::State,
12179
12180    /// Output only. State details of the storage pool
12181    pub state_details: std::string::String,
12182
12183    /// Output only. Create time of the storage pool
12184    pub create_time: std::option::Option<wkt::Timestamp>,
12185
12186    /// Optional. Description of the storage pool
12187    pub description: std::string::String,
12188
12189    /// Optional. Labels as key value pairs
12190    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12191
12192    /// Required. VPC Network name.
12193    /// Format: projects/{project}/global/networks/{network}
12194    pub network: std::string::String,
12195
12196    /// Optional. Specifies the Active Directory to be used for creating a SMB
12197    /// volume.
12198    pub active_directory: std::string::String,
12199
12200    /// Optional. Specifies the KMS config to be used for volume encryption.
12201    pub kms_config: std::string::String,
12202
12203    /// Optional. Flag indicating if the pool is NFS LDAP enabled or not.
12204    pub ldap_enabled: bool,
12205
12206    /// Optional. This field is not implemented. The values provided in this field
12207    /// are ignored.
12208    pub psa_range: std::string::String,
12209
12210    /// Output only. Specifies the current pool encryption key source.
12211    pub encryption_type: crate::model::EncryptionType,
12212
12213    /// Deprecated. Used to allow SO pool to access AD or DNS server from other
12214    /// regions.
12215    #[deprecated]
12216    pub global_access_allowed: std::option::Option<bool>,
12217
12218    /// Optional. True if the storage pool supports Auto Tiering enabled volumes.
12219    /// Default is false. Auto-tiering can be enabled after storage pool creation
12220    /// but it can't be disabled once enabled.
12221    pub allow_auto_tiering: bool,
12222
12223    /// Optional. Specifies the replica zone for regional storagePool.
12224    pub replica_zone: std::string::String,
12225
12226    /// Optional. Specifies the active zone for regional storagePool.
12227    pub zone: std::string::String,
12228
12229    /// Output only. Reserved for future use
12230    pub satisfies_pzs: bool,
12231
12232    /// Output only. Reserved for future use
12233    pub satisfies_pzi: bool,
12234
12235    /// Optional. True if using Independent Scaling of capacity and performance
12236    /// (Hyperdisk) By default set to false
12237    pub custom_performance_enabled: bool,
12238
12239    /// Optional. Custom Performance Total Throughput of the pool (in MiBps)
12240    pub total_throughput_mibps: i64,
12241
12242    /// Optional. Custom Performance Total IOPS of the pool
12243    /// if not provided, it will be calculated based on the total_throughput_mibps
12244    pub total_iops: i64,
12245
12246    /// Optional. Total hot tier capacity for the Storage Pool. It is applicable
12247    /// only to Flex service level. It should be less than the minimum storage pool
12248    /// size and cannot be more than the current storage pool size. It cannot be
12249    /// decreased once set.
12250    pub hot_tier_size_gib: i64,
12251
12252    /// Optional. Flag indicating that the hot-tier threshold will be
12253    /// auto-increased by 10% of the hot-tier when it hits 100%. Default is true.
12254    /// The increment will kick in only if the new size after increment is
12255    /// still less than or equal to storage pool size.
12256    pub enable_hot_tier_auto_resize: std::option::Option<bool>,
12257
12258    /// Optional. QoS (Quality of Service) Type of the storage pool
12259    pub qos_type: crate::model::QosType,
12260
12261    /// Output only. Available throughput of the storage pool (in MiB/s).
12262    pub available_throughput_mibps: f64,
12263
12264    /// Output only. Total cold tier data rounded down to the nearest GiB used by
12265    /// the storage pool.
12266    pub cold_tier_size_used_gib: i64,
12267
12268    /// Output only. Total hot tier data rounded down to the nearest GiB used by
12269    /// the storage pool.
12270    pub hot_tier_size_used_gib: i64,
12271
12272    /// Optional. Type of the storage pool. This field is used to control whether
12273    /// the pool supports `FILE` based volumes only or `UNIFIED` (both `FILE` and
12274    /// `BLOCK`) volumes. If not specified during creation, it defaults to `FILE`.
12275    pub r#type: std::option::Option<crate::model::StoragePoolType>,
12276
12277    /// Optional. Mode of the storage pool. This field is used to control whether
12278    /// the user can perform the ONTAP operations on the storage pool using the
12279    /// GCNV ONTAP Mode APIs. If not specified during creation, it defaults to
12280    /// `DEFAULT`.
12281    pub mode: std::option::Option<crate::model::Mode>,
12282
12283    /// Optional. The scale type of the storage pool. Defaults to
12284    /// `SCALE_TYPE_DEFAULT` if not specified.
12285    pub scale_type: crate::model::ScaleType,
12286
12287    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12288}
12289
12290impl StoragePool {
12291    /// Creates a new default instance.
12292    pub fn new() -> Self {
12293        std::default::Default::default()
12294    }
12295
12296    /// Sets the value of [name][crate::model::StoragePool::name].
12297    ///
12298    /// # Example
12299    /// ```ignore,no_run
12300    /// # use google_cloud_netapp_v1::model::StoragePool;
12301    /// # let project_id = "project_id";
12302    /// # let location_id = "location_id";
12303    /// # let storage_pool_id = "storage_pool_id";
12304    /// let x = StoragePool::new().set_name(format!("projects/{project_id}/locations/{location_id}/storagePools/{storage_pool_id}"));
12305    /// ```
12306    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12307        self.name = v.into();
12308        self
12309    }
12310
12311    /// Sets the value of [service_level][crate::model::StoragePool::service_level].
12312    ///
12313    /// # Example
12314    /// ```ignore,no_run
12315    /// # use google_cloud_netapp_v1::model::StoragePool;
12316    /// use google_cloud_netapp_v1::model::ServiceLevel;
12317    /// let x0 = StoragePool::new().set_service_level(ServiceLevel::Premium);
12318    /// let x1 = StoragePool::new().set_service_level(ServiceLevel::Extreme);
12319    /// let x2 = StoragePool::new().set_service_level(ServiceLevel::Standard);
12320    /// ```
12321    pub fn set_service_level<T: std::convert::Into<crate::model::ServiceLevel>>(
12322        mut self,
12323        v: T,
12324    ) -> Self {
12325        self.service_level = v.into();
12326        self
12327    }
12328
12329    /// Sets the value of [capacity_gib][crate::model::StoragePool::capacity_gib].
12330    ///
12331    /// # Example
12332    /// ```ignore,no_run
12333    /// # use google_cloud_netapp_v1::model::StoragePool;
12334    /// let x = StoragePool::new().set_capacity_gib(42);
12335    /// ```
12336    pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12337        self.capacity_gib = v.into();
12338        self
12339    }
12340
12341    /// Sets the value of [volume_capacity_gib][crate::model::StoragePool::volume_capacity_gib].
12342    ///
12343    /// # Example
12344    /// ```ignore,no_run
12345    /// # use google_cloud_netapp_v1::model::StoragePool;
12346    /// let x = StoragePool::new().set_volume_capacity_gib(42);
12347    /// ```
12348    pub fn set_volume_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12349        self.volume_capacity_gib = v.into();
12350        self
12351    }
12352
12353    /// Sets the value of [volume_count][crate::model::StoragePool::volume_count].
12354    ///
12355    /// # Example
12356    /// ```ignore,no_run
12357    /// # use google_cloud_netapp_v1::model::StoragePool;
12358    /// let x = StoragePool::new().set_volume_count(42);
12359    /// ```
12360    pub fn set_volume_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12361        self.volume_count = v.into();
12362        self
12363    }
12364
12365    /// Sets the value of [state][crate::model::StoragePool::state].
12366    ///
12367    /// # Example
12368    /// ```ignore,no_run
12369    /// # use google_cloud_netapp_v1::model::StoragePool;
12370    /// use google_cloud_netapp_v1::model::storage_pool::State;
12371    /// let x0 = StoragePool::new().set_state(State::Ready);
12372    /// let x1 = StoragePool::new().set_state(State::Creating);
12373    /// let x2 = StoragePool::new().set_state(State::Deleting);
12374    /// ```
12375    pub fn set_state<T: std::convert::Into<crate::model::storage_pool::State>>(
12376        mut self,
12377        v: T,
12378    ) -> Self {
12379        self.state = v.into();
12380        self
12381    }
12382
12383    /// Sets the value of [state_details][crate::model::StoragePool::state_details].
12384    ///
12385    /// # Example
12386    /// ```ignore,no_run
12387    /// # use google_cloud_netapp_v1::model::StoragePool;
12388    /// let x = StoragePool::new().set_state_details("example");
12389    /// ```
12390    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12391        self.state_details = v.into();
12392        self
12393    }
12394
12395    /// Sets the value of [create_time][crate::model::StoragePool::create_time].
12396    ///
12397    /// # Example
12398    /// ```ignore,no_run
12399    /// # use google_cloud_netapp_v1::model::StoragePool;
12400    /// use wkt::Timestamp;
12401    /// let x = StoragePool::new().set_create_time(Timestamp::default()/* use setters */);
12402    /// ```
12403    pub fn set_create_time<T>(mut self, v: T) -> Self
12404    where
12405        T: std::convert::Into<wkt::Timestamp>,
12406    {
12407        self.create_time = std::option::Option::Some(v.into());
12408        self
12409    }
12410
12411    /// Sets or clears the value of [create_time][crate::model::StoragePool::create_time].
12412    ///
12413    /// # Example
12414    /// ```ignore,no_run
12415    /// # use google_cloud_netapp_v1::model::StoragePool;
12416    /// use wkt::Timestamp;
12417    /// let x = StoragePool::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
12418    /// let x = StoragePool::new().set_or_clear_create_time(None::<Timestamp>);
12419    /// ```
12420    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12421    where
12422        T: std::convert::Into<wkt::Timestamp>,
12423    {
12424        self.create_time = v.map(|x| x.into());
12425        self
12426    }
12427
12428    /// Sets the value of [description][crate::model::StoragePool::description].
12429    ///
12430    /// # Example
12431    /// ```ignore,no_run
12432    /// # use google_cloud_netapp_v1::model::StoragePool;
12433    /// let x = StoragePool::new().set_description("example");
12434    /// ```
12435    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12436        self.description = v.into();
12437        self
12438    }
12439
12440    /// Sets the value of [labels][crate::model::StoragePool::labels].
12441    ///
12442    /// # Example
12443    /// ```ignore,no_run
12444    /// # use google_cloud_netapp_v1::model::StoragePool;
12445    /// let x = StoragePool::new().set_labels([
12446    ///     ("key0", "abc"),
12447    ///     ("key1", "xyz"),
12448    /// ]);
12449    /// ```
12450    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12451    where
12452        T: std::iter::IntoIterator<Item = (K, V)>,
12453        K: std::convert::Into<std::string::String>,
12454        V: std::convert::Into<std::string::String>,
12455    {
12456        use std::iter::Iterator;
12457        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12458        self
12459    }
12460
12461    /// Sets the value of [network][crate::model::StoragePool::network].
12462    ///
12463    /// # Example
12464    /// ```ignore,no_run
12465    /// # use google_cloud_netapp_v1::model::StoragePool;
12466    /// let x = StoragePool::new().set_network("example");
12467    /// ```
12468    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12469        self.network = v.into();
12470        self
12471    }
12472
12473    /// Sets the value of [active_directory][crate::model::StoragePool::active_directory].
12474    ///
12475    /// # Example
12476    /// ```ignore,no_run
12477    /// # use google_cloud_netapp_v1::model::StoragePool;
12478    /// # let project_id = "project_id";
12479    /// # let location_id = "location_id";
12480    /// # let active_directory_id = "active_directory_id";
12481    /// let x = StoragePool::new().set_active_directory(format!("projects/{project_id}/locations/{location_id}/activeDirectories/{active_directory_id}"));
12482    /// ```
12483    pub fn set_active_directory<T: std::convert::Into<std::string::String>>(
12484        mut self,
12485        v: T,
12486    ) -> Self {
12487        self.active_directory = v.into();
12488        self
12489    }
12490
12491    /// Sets the value of [kms_config][crate::model::StoragePool::kms_config].
12492    ///
12493    /// # Example
12494    /// ```ignore,no_run
12495    /// # use google_cloud_netapp_v1::model::StoragePool;
12496    /// # let project_id = "project_id";
12497    /// # let location_id = "location_id";
12498    /// # let kms_config_id = "kms_config_id";
12499    /// let x = StoragePool::new().set_kms_config(format!("projects/{project_id}/locations/{location_id}/kmsConfigs/{kms_config_id}"));
12500    /// ```
12501    pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12502        self.kms_config = v.into();
12503        self
12504    }
12505
12506    /// Sets the value of [ldap_enabled][crate::model::StoragePool::ldap_enabled].
12507    ///
12508    /// # Example
12509    /// ```ignore,no_run
12510    /// # use google_cloud_netapp_v1::model::StoragePool;
12511    /// let x = StoragePool::new().set_ldap_enabled(true);
12512    /// ```
12513    pub fn set_ldap_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12514        self.ldap_enabled = v.into();
12515        self
12516    }
12517
12518    /// Sets the value of [psa_range][crate::model::StoragePool::psa_range].
12519    ///
12520    /// # Example
12521    /// ```ignore,no_run
12522    /// # use google_cloud_netapp_v1::model::StoragePool;
12523    /// let x = StoragePool::new().set_psa_range("example");
12524    /// ```
12525    pub fn set_psa_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12526        self.psa_range = v.into();
12527        self
12528    }
12529
12530    /// Sets the value of [encryption_type][crate::model::StoragePool::encryption_type].
12531    ///
12532    /// # Example
12533    /// ```ignore,no_run
12534    /// # use google_cloud_netapp_v1::model::StoragePool;
12535    /// use google_cloud_netapp_v1::model::EncryptionType;
12536    /// let x0 = StoragePool::new().set_encryption_type(EncryptionType::ServiceManaged);
12537    /// let x1 = StoragePool::new().set_encryption_type(EncryptionType::CloudKms);
12538    /// ```
12539    pub fn set_encryption_type<T: std::convert::Into<crate::model::EncryptionType>>(
12540        mut self,
12541        v: T,
12542    ) -> Self {
12543        self.encryption_type = v.into();
12544        self
12545    }
12546
12547    /// Sets the value of [global_access_allowed][crate::model::StoragePool::global_access_allowed].
12548    ///
12549    /// # Example
12550    /// ```ignore,no_run
12551    /// # use google_cloud_netapp_v1::model::StoragePool;
12552    /// let x = StoragePool::new().set_global_access_allowed(true);
12553    /// ```
12554    #[deprecated]
12555    pub fn set_global_access_allowed<T>(mut self, v: T) -> Self
12556    where
12557        T: std::convert::Into<bool>,
12558    {
12559        self.global_access_allowed = std::option::Option::Some(v.into());
12560        self
12561    }
12562
12563    /// Sets or clears the value of [global_access_allowed][crate::model::StoragePool::global_access_allowed].
12564    ///
12565    /// # Example
12566    /// ```ignore,no_run
12567    /// # use google_cloud_netapp_v1::model::StoragePool;
12568    /// let x = StoragePool::new().set_or_clear_global_access_allowed(Some(false));
12569    /// let x = StoragePool::new().set_or_clear_global_access_allowed(None::<bool>);
12570    /// ```
12571    #[deprecated]
12572    pub fn set_or_clear_global_access_allowed<T>(mut self, v: std::option::Option<T>) -> Self
12573    where
12574        T: std::convert::Into<bool>,
12575    {
12576        self.global_access_allowed = v.map(|x| x.into());
12577        self
12578    }
12579
12580    /// Sets the value of [allow_auto_tiering][crate::model::StoragePool::allow_auto_tiering].
12581    ///
12582    /// # Example
12583    /// ```ignore,no_run
12584    /// # use google_cloud_netapp_v1::model::StoragePool;
12585    /// let x = StoragePool::new().set_allow_auto_tiering(true);
12586    /// ```
12587    pub fn set_allow_auto_tiering<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12588        self.allow_auto_tiering = v.into();
12589        self
12590    }
12591
12592    /// Sets the value of [replica_zone][crate::model::StoragePool::replica_zone].
12593    ///
12594    /// # Example
12595    /// ```ignore,no_run
12596    /// # use google_cloud_netapp_v1::model::StoragePool;
12597    /// let x = StoragePool::new().set_replica_zone("example");
12598    /// ```
12599    pub fn set_replica_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12600        self.replica_zone = v.into();
12601        self
12602    }
12603
12604    /// Sets the value of [zone][crate::model::StoragePool::zone].
12605    ///
12606    /// # Example
12607    /// ```ignore,no_run
12608    /// # use google_cloud_netapp_v1::model::StoragePool;
12609    /// let x = StoragePool::new().set_zone("example");
12610    /// ```
12611    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12612        self.zone = v.into();
12613        self
12614    }
12615
12616    /// Sets the value of [satisfies_pzs][crate::model::StoragePool::satisfies_pzs].
12617    ///
12618    /// # Example
12619    /// ```ignore,no_run
12620    /// # use google_cloud_netapp_v1::model::StoragePool;
12621    /// let x = StoragePool::new().set_satisfies_pzs(true);
12622    /// ```
12623    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12624        self.satisfies_pzs = v.into();
12625        self
12626    }
12627
12628    /// Sets the value of [satisfies_pzi][crate::model::StoragePool::satisfies_pzi].
12629    ///
12630    /// # Example
12631    /// ```ignore,no_run
12632    /// # use google_cloud_netapp_v1::model::StoragePool;
12633    /// let x = StoragePool::new().set_satisfies_pzi(true);
12634    /// ```
12635    pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12636        self.satisfies_pzi = v.into();
12637        self
12638    }
12639
12640    /// Sets the value of [custom_performance_enabled][crate::model::StoragePool::custom_performance_enabled].
12641    ///
12642    /// # Example
12643    /// ```ignore,no_run
12644    /// # use google_cloud_netapp_v1::model::StoragePool;
12645    /// let x = StoragePool::new().set_custom_performance_enabled(true);
12646    /// ```
12647    pub fn set_custom_performance_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12648        self.custom_performance_enabled = v.into();
12649        self
12650    }
12651
12652    /// Sets the value of [total_throughput_mibps][crate::model::StoragePool::total_throughput_mibps].
12653    ///
12654    /// # Example
12655    /// ```ignore,no_run
12656    /// # use google_cloud_netapp_v1::model::StoragePool;
12657    /// let x = StoragePool::new().set_total_throughput_mibps(42);
12658    /// ```
12659    pub fn set_total_throughput_mibps<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12660        self.total_throughput_mibps = v.into();
12661        self
12662    }
12663
12664    /// Sets the value of [total_iops][crate::model::StoragePool::total_iops].
12665    ///
12666    /// # Example
12667    /// ```ignore,no_run
12668    /// # use google_cloud_netapp_v1::model::StoragePool;
12669    /// let x = StoragePool::new().set_total_iops(42);
12670    /// ```
12671    pub fn set_total_iops<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12672        self.total_iops = v.into();
12673        self
12674    }
12675
12676    /// Sets the value of [hot_tier_size_gib][crate::model::StoragePool::hot_tier_size_gib].
12677    ///
12678    /// # Example
12679    /// ```ignore,no_run
12680    /// # use google_cloud_netapp_v1::model::StoragePool;
12681    /// let x = StoragePool::new().set_hot_tier_size_gib(42);
12682    /// ```
12683    pub fn set_hot_tier_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12684        self.hot_tier_size_gib = v.into();
12685        self
12686    }
12687
12688    /// Sets the value of [enable_hot_tier_auto_resize][crate::model::StoragePool::enable_hot_tier_auto_resize].
12689    ///
12690    /// # Example
12691    /// ```ignore,no_run
12692    /// # use google_cloud_netapp_v1::model::StoragePool;
12693    /// let x = StoragePool::new().set_enable_hot_tier_auto_resize(true);
12694    /// ```
12695    pub fn set_enable_hot_tier_auto_resize<T>(mut self, v: T) -> Self
12696    where
12697        T: std::convert::Into<bool>,
12698    {
12699        self.enable_hot_tier_auto_resize = std::option::Option::Some(v.into());
12700        self
12701    }
12702
12703    /// Sets or clears the value of [enable_hot_tier_auto_resize][crate::model::StoragePool::enable_hot_tier_auto_resize].
12704    ///
12705    /// # Example
12706    /// ```ignore,no_run
12707    /// # use google_cloud_netapp_v1::model::StoragePool;
12708    /// let x = StoragePool::new().set_or_clear_enable_hot_tier_auto_resize(Some(false));
12709    /// let x = StoragePool::new().set_or_clear_enable_hot_tier_auto_resize(None::<bool>);
12710    /// ```
12711    pub fn set_or_clear_enable_hot_tier_auto_resize<T>(mut self, v: std::option::Option<T>) -> Self
12712    where
12713        T: std::convert::Into<bool>,
12714    {
12715        self.enable_hot_tier_auto_resize = v.map(|x| x.into());
12716        self
12717    }
12718
12719    /// Sets the value of [qos_type][crate::model::StoragePool::qos_type].
12720    ///
12721    /// # Example
12722    /// ```ignore,no_run
12723    /// # use google_cloud_netapp_v1::model::StoragePool;
12724    /// use google_cloud_netapp_v1::model::QosType;
12725    /// let x0 = StoragePool::new().set_qos_type(QosType::Auto);
12726    /// let x1 = StoragePool::new().set_qos_type(QosType::Manual);
12727    /// ```
12728    pub fn set_qos_type<T: std::convert::Into<crate::model::QosType>>(mut self, v: T) -> Self {
12729        self.qos_type = v.into();
12730        self
12731    }
12732
12733    /// Sets the value of [available_throughput_mibps][crate::model::StoragePool::available_throughput_mibps].
12734    ///
12735    /// # Example
12736    /// ```ignore,no_run
12737    /// # use google_cloud_netapp_v1::model::StoragePool;
12738    /// let x = StoragePool::new().set_available_throughput_mibps(42.0);
12739    /// ```
12740    pub fn set_available_throughput_mibps<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
12741        self.available_throughput_mibps = v.into();
12742        self
12743    }
12744
12745    /// Sets the value of [cold_tier_size_used_gib][crate::model::StoragePool::cold_tier_size_used_gib].
12746    ///
12747    /// # Example
12748    /// ```ignore,no_run
12749    /// # use google_cloud_netapp_v1::model::StoragePool;
12750    /// let x = StoragePool::new().set_cold_tier_size_used_gib(42);
12751    /// ```
12752    pub fn set_cold_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12753        self.cold_tier_size_used_gib = v.into();
12754        self
12755    }
12756
12757    /// Sets the value of [hot_tier_size_used_gib][crate::model::StoragePool::hot_tier_size_used_gib].
12758    ///
12759    /// # Example
12760    /// ```ignore,no_run
12761    /// # use google_cloud_netapp_v1::model::StoragePool;
12762    /// let x = StoragePool::new().set_hot_tier_size_used_gib(42);
12763    /// ```
12764    pub fn set_hot_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12765        self.hot_tier_size_used_gib = v.into();
12766        self
12767    }
12768
12769    /// Sets the value of [r#type][crate::model::StoragePool::type].
12770    ///
12771    /// # Example
12772    /// ```ignore,no_run
12773    /// # use google_cloud_netapp_v1::model::StoragePool;
12774    /// use google_cloud_netapp_v1::model::StoragePoolType;
12775    /// let x0 = StoragePool::new().set_type(StoragePoolType::File);
12776    /// let x1 = StoragePool::new().set_type(StoragePoolType::Unified);
12777    /// ```
12778    pub fn set_type<T>(mut self, v: T) -> Self
12779    where
12780        T: std::convert::Into<crate::model::StoragePoolType>,
12781    {
12782        self.r#type = std::option::Option::Some(v.into());
12783        self
12784    }
12785
12786    /// Sets or clears the value of [r#type][crate::model::StoragePool::type].
12787    ///
12788    /// # Example
12789    /// ```ignore,no_run
12790    /// # use google_cloud_netapp_v1::model::StoragePool;
12791    /// use google_cloud_netapp_v1::model::StoragePoolType;
12792    /// let x0 = StoragePool::new().set_or_clear_type(Some(StoragePoolType::File));
12793    /// let x1 = StoragePool::new().set_or_clear_type(Some(StoragePoolType::Unified));
12794    /// let x_none = StoragePool::new().set_or_clear_type(None::<StoragePoolType>);
12795    /// ```
12796    pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
12797    where
12798        T: std::convert::Into<crate::model::StoragePoolType>,
12799    {
12800        self.r#type = v.map(|x| x.into());
12801        self
12802    }
12803
12804    /// Sets the value of [mode][crate::model::StoragePool::mode].
12805    ///
12806    /// # Example
12807    /// ```ignore,no_run
12808    /// # use google_cloud_netapp_v1::model::StoragePool;
12809    /// use google_cloud_netapp_v1::model::Mode;
12810    /// let x0 = StoragePool::new().set_mode(Mode::Default);
12811    /// let x1 = StoragePool::new().set_mode(Mode::Ontap);
12812    /// ```
12813    pub fn set_mode<T>(mut self, v: T) -> Self
12814    where
12815        T: std::convert::Into<crate::model::Mode>,
12816    {
12817        self.mode = std::option::Option::Some(v.into());
12818        self
12819    }
12820
12821    /// Sets or clears the value of [mode][crate::model::StoragePool::mode].
12822    ///
12823    /// # Example
12824    /// ```ignore,no_run
12825    /// # use google_cloud_netapp_v1::model::StoragePool;
12826    /// use google_cloud_netapp_v1::model::Mode;
12827    /// let x0 = StoragePool::new().set_or_clear_mode(Some(Mode::Default));
12828    /// let x1 = StoragePool::new().set_or_clear_mode(Some(Mode::Ontap));
12829    /// let x_none = StoragePool::new().set_or_clear_mode(None::<Mode>);
12830    /// ```
12831    pub fn set_or_clear_mode<T>(mut self, v: std::option::Option<T>) -> Self
12832    where
12833        T: std::convert::Into<crate::model::Mode>,
12834    {
12835        self.mode = v.map(|x| x.into());
12836        self
12837    }
12838
12839    /// Sets the value of [scale_type][crate::model::StoragePool::scale_type].
12840    ///
12841    /// # Example
12842    /// ```ignore,no_run
12843    /// # use google_cloud_netapp_v1::model::StoragePool;
12844    /// use google_cloud_netapp_v1::model::ScaleType;
12845    /// let x0 = StoragePool::new().set_scale_type(ScaleType::Default);
12846    /// let x1 = StoragePool::new().set_scale_type(ScaleType::Scaleout);
12847    /// ```
12848    pub fn set_scale_type<T: std::convert::Into<crate::model::ScaleType>>(mut self, v: T) -> Self {
12849        self.scale_type = v.into();
12850        self
12851    }
12852}
12853
12854impl wkt::message::Message for StoragePool {
12855    fn typename() -> &'static str {
12856        "type.googleapis.com/google.cloud.netapp.v1.StoragePool"
12857    }
12858}
12859
12860/// Defines additional types related to [StoragePool].
12861pub mod storage_pool {
12862    #[allow(unused_imports)]
12863    use super::*;
12864
12865    /// The Storage Pool States
12866    ///
12867    /// # Working with unknown values
12868    ///
12869    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12870    /// additional enum variants at any time. Adding new variants is not considered
12871    /// a breaking change. Applications should write their code in anticipation of:
12872    ///
12873    /// - New values appearing in future releases of the client library, **and**
12874    /// - New values received dynamically, without application changes.
12875    ///
12876    /// Please consult the [Working with enums] section in the user guide for some
12877    /// guidelines.
12878    ///
12879    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12880    #[derive(Clone, Debug, PartialEq)]
12881    #[non_exhaustive]
12882    pub enum State {
12883        /// Unspecified Storage Pool State
12884        Unspecified,
12885        /// Storage Pool State is Ready
12886        Ready,
12887        /// Storage Pool State is Creating
12888        Creating,
12889        /// Storage Pool State is Deleting
12890        Deleting,
12891        /// Storage Pool State is Updating
12892        Updating,
12893        /// Storage Pool State is Restoring
12894        Restoring,
12895        /// Storage Pool State is Disabled
12896        Disabled,
12897        /// Storage Pool State is Error
12898        Error,
12899        /// If set, the enum was initialized with an unknown value.
12900        ///
12901        /// Applications can examine the value using [State::value] or
12902        /// [State::name].
12903        UnknownValue(state::UnknownValue),
12904    }
12905
12906    #[doc(hidden)]
12907    pub mod state {
12908        #[allow(unused_imports)]
12909        use super::*;
12910        #[derive(Clone, Debug, PartialEq)]
12911        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12912    }
12913
12914    impl State {
12915        /// Gets the enum value.
12916        ///
12917        /// Returns `None` if the enum contains an unknown value deserialized from
12918        /// the string representation of enums.
12919        pub fn value(&self) -> std::option::Option<i32> {
12920            match self {
12921                Self::Unspecified => std::option::Option::Some(0),
12922                Self::Ready => std::option::Option::Some(1),
12923                Self::Creating => std::option::Option::Some(2),
12924                Self::Deleting => std::option::Option::Some(3),
12925                Self::Updating => std::option::Option::Some(4),
12926                Self::Restoring => std::option::Option::Some(5),
12927                Self::Disabled => std::option::Option::Some(6),
12928                Self::Error => std::option::Option::Some(7),
12929                Self::UnknownValue(u) => u.0.value(),
12930            }
12931        }
12932
12933        /// Gets the enum value as a string.
12934        ///
12935        /// Returns `None` if the enum contains an unknown value deserialized from
12936        /// the integer representation of enums.
12937        pub fn name(&self) -> std::option::Option<&str> {
12938            match self {
12939                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12940                Self::Ready => std::option::Option::Some("READY"),
12941                Self::Creating => std::option::Option::Some("CREATING"),
12942                Self::Deleting => std::option::Option::Some("DELETING"),
12943                Self::Updating => std::option::Option::Some("UPDATING"),
12944                Self::Restoring => std::option::Option::Some("RESTORING"),
12945                Self::Disabled => std::option::Option::Some("DISABLED"),
12946                Self::Error => std::option::Option::Some("ERROR"),
12947                Self::UnknownValue(u) => u.0.name(),
12948            }
12949        }
12950    }
12951
12952    impl std::default::Default for State {
12953        fn default() -> Self {
12954            use std::convert::From;
12955            Self::from(0)
12956        }
12957    }
12958
12959    impl std::fmt::Display for State {
12960        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12961            wkt::internal::display_enum(f, self.name(), self.value())
12962        }
12963    }
12964
12965    impl std::convert::From<i32> for State {
12966        fn from(value: i32) -> Self {
12967            match value {
12968                0 => Self::Unspecified,
12969                1 => Self::Ready,
12970                2 => Self::Creating,
12971                3 => Self::Deleting,
12972                4 => Self::Updating,
12973                5 => Self::Restoring,
12974                6 => Self::Disabled,
12975                7 => Self::Error,
12976                _ => Self::UnknownValue(state::UnknownValue(
12977                    wkt::internal::UnknownEnumValue::Integer(value),
12978                )),
12979            }
12980        }
12981    }
12982
12983    impl std::convert::From<&str> for State {
12984        fn from(value: &str) -> Self {
12985            use std::string::ToString;
12986            match value {
12987                "STATE_UNSPECIFIED" => Self::Unspecified,
12988                "READY" => Self::Ready,
12989                "CREATING" => Self::Creating,
12990                "DELETING" => Self::Deleting,
12991                "UPDATING" => Self::Updating,
12992                "RESTORING" => Self::Restoring,
12993                "DISABLED" => Self::Disabled,
12994                "ERROR" => Self::Error,
12995                _ => Self::UnknownValue(state::UnknownValue(
12996                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12997                )),
12998            }
12999        }
13000    }
13001
13002    impl serde::ser::Serialize for State {
13003        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13004        where
13005            S: serde::Serializer,
13006        {
13007            match self {
13008                Self::Unspecified => serializer.serialize_i32(0),
13009                Self::Ready => serializer.serialize_i32(1),
13010                Self::Creating => serializer.serialize_i32(2),
13011                Self::Deleting => serializer.serialize_i32(3),
13012                Self::Updating => serializer.serialize_i32(4),
13013                Self::Restoring => serializer.serialize_i32(5),
13014                Self::Disabled => serializer.serialize_i32(6),
13015                Self::Error => serializer.serialize_i32(7),
13016                Self::UnknownValue(u) => u.0.serialize(serializer),
13017            }
13018        }
13019    }
13020
13021    impl<'de> serde::de::Deserialize<'de> for State {
13022        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13023        where
13024            D: serde::Deserializer<'de>,
13025        {
13026            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13027                ".google.cloud.netapp.v1.StoragePool.State",
13028            ))
13029        }
13030    }
13031}
13032
13033/// ValidateDirectoryServiceRequest validates the directory service policy
13034/// attached to the storage pool.
13035#[derive(Clone, Default, PartialEq)]
13036#[non_exhaustive]
13037pub struct ValidateDirectoryServiceRequest {
13038    /// Required. Name of the storage pool
13039    pub name: std::string::String,
13040
13041    /// Type of directory service policy attached to the storage pool.
13042    pub directory_service_type: crate::model::DirectoryServiceType,
13043
13044    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13045}
13046
13047impl ValidateDirectoryServiceRequest {
13048    /// Creates a new default instance.
13049    pub fn new() -> Self {
13050        std::default::Default::default()
13051    }
13052
13053    /// Sets the value of [name][crate::model::ValidateDirectoryServiceRequest::name].
13054    ///
13055    /// # Example
13056    /// ```ignore,no_run
13057    /// # use google_cloud_netapp_v1::model::ValidateDirectoryServiceRequest;
13058    /// # let project_id = "project_id";
13059    /// # let location_id = "location_id";
13060    /// # let storage_pool_id = "storage_pool_id";
13061    /// let x = ValidateDirectoryServiceRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/storagePools/{storage_pool_id}"));
13062    /// ```
13063    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13064        self.name = v.into();
13065        self
13066    }
13067
13068    /// Sets the value of [directory_service_type][crate::model::ValidateDirectoryServiceRequest::directory_service_type].
13069    ///
13070    /// # Example
13071    /// ```ignore,no_run
13072    /// # use google_cloud_netapp_v1::model::ValidateDirectoryServiceRequest;
13073    /// use google_cloud_netapp_v1::model::DirectoryServiceType;
13074    /// let x0 = ValidateDirectoryServiceRequest::new().set_directory_service_type(DirectoryServiceType::ActiveDirectory);
13075    /// ```
13076    pub fn set_directory_service_type<T: std::convert::Into<crate::model::DirectoryServiceType>>(
13077        mut self,
13078        v: T,
13079    ) -> Self {
13080        self.directory_service_type = v.into();
13081        self
13082    }
13083}
13084
13085impl wkt::message::Message for ValidateDirectoryServiceRequest {
13086    fn typename() -> &'static str {
13087        "type.googleapis.com/google.cloud.netapp.v1.ValidateDirectoryServiceRequest"
13088    }
13089}
13090
13091/// Message for requesting list of Volumes
13092#[derive(Clone, Default, PartialEq)]
13093#[non_exhaustive]
13094pub struct ListVolumesRequest {
13095    /// Required. Parent value for ListVolumesRequest
13096    pub parent: std::string::String,
13097
13098    /// Requested page size. Server may return fewer items than requested.
13099    /// If unspecified, the server will pick an appropriate default.
13100    pub page_size: i32,
13101
13102    /// A token identifying a page of results the server should return.
13103    pub page_token: std::string::String,
13104
13105    /// Filtering results
13106    pub filter: std::string::String,
13107
13108    /// Hint for how to order the results
13109    pub order_by: std::string::String,
13110
13111    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13112}
13113
13114impl ListVolumesRequest {
13115    /// Creates a new default instance.
13116    pub fn new() -> Self {
13117        std::default::Default::default()
13118    }
13119
13120    /// Sets the value of [parent][crate::model::ListVolumesRequest::parent].
13121    ///
13122    /// # Example
13123    /// ```ignore,no_run
13124    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
13125    /// # let project_id = "project_id";
13126    /// # let location_id = "location_id";
13127    /// let x = ListVolumesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
13128    /// ```
13129    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13130        self.parent = v.into();
13131        self
13132    }
13133
13134    /// Sets the value of [page_size][crate::model::ListVolumesRequest::page_size].
13135    ///
13136    /// # Example
13137    /// ```ignore,no_run
13138    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
13139    /// let x = ListVolumesRequest::new().set_page_size(42);
13140    /// ```
13141    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13142        self.page_size = v.into();
13143        self
13144    }
13145
13146    /// Sets the value of [page_token][crate::model::ListVolumesRequest::page_token].
13147    ///
13148    /// # Example
13149    /// ```ignore,no_run
13150    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
13151    /// let x = ListVolumesRequest::new().set_page_token("example");
13152    /// ```
13153    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13154        self.page_token = v.into();
13155        self
13156    }
13157
13158    /// Sets the value of [filter][crate::model::ListVolumesRequest::filter].
13159    ///
13160    /// # Example
13161    /// ```ignore,no_run
13162    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
13163    /// let x = ListVolumesRequest::new().set_filter("example");
13164    /// ```
13165    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13166        self.filter = v.into();
13167        self
13168    }
13169
13170    /// Sets the value of [order_by][crate::model::ListVolumesRequest::order_by].
13171    ///
13172    /// # Example
13173    /// ```ignore,no_run
13174    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
13175    /// let x = ListVolumesRequest::new().set_order_by("example");
13176    /// ```
13177    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13178        self.order_by = v.into();
13179        self
13180    }
13181}
13182
13183impl wkt::message::Message for ListVolumesRequest {
13184    fn typename() -> &'static str {
13185        "type.googleapis.com/google.cloud.netapp.v1.ListVolumesRequest"
13186    }
13187}
13188
13189/// Message for response to listing Volumes
13190#[derive(Clone, Default, PartialEq)]
13191#[non_exhaustive]
13192pub struct ListVolumesResponse {
13193    /// The list of Volume
13194    pub volumes: std::vec::Vec<crate::model::Volume>,
13195
13196    /// A token identifying a page of results the server should return.
13197    pub next_page_token: std::string::String,
13198
13199    /// Locations that could not be reached.
13200    pub unreachable: std::vec::Vec<std::string::String>,
13201
13202    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13203}
13204
13205impl ListVolumesResponse {
13206    /// Creates a new default instance.
13207    pub fn new() -> Self {
13208        std::default::Default::default()
13209    }
13210
13211    /// Sets the value of [volumes][crate::model::ListVolumesResponse::volumes].
13212    ///
13213    /// # Example
13214    /// ```ignore,no_run
13215    /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
13216    /// use google_cloud_netapp_v1::model::Volume;
13217    /// let x = ListVolumesResponse::new()
13218    ///     .set_volumes([
13219    ///         Volume::default()/* use setters */,
13220    ///         Volume::default()/* use (different) setters */,
13221    ///     ]);
13222    /// ```
13223    pub fn set_volumes<T, V>(mut self, v: T) -> Self
13224    where
13225        T: std::iter::IntoIterator<Item = V>,
13226        V: std::convert::Into<crate::model::Volume>,
13227    {
13228        use std::iter::Iterator;
13229        self.volumes = v.into_iter().map(|i| i.into()).collect();
13230        self
13231    }
13232
13233    /// Sets the value of [next_page_token][crate::model::ListVolumesResponse::next_page_token].
13234    ///
13235    /// # Example
13236    /// ```ignore,no_run
13237    /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
13238    /// let x = ListVolumesResponse::new().set_next_page_token("example");
13239    /// ```
13240    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13241        self.next_page_token = v.into();
13242        self
13243    }
13244
13245    /// Sets the value of [unreachable][crate::model::ListVolumesResponse::unreachable].
13246    ///
13247    /// # Example
13248    /// ```ignore,no_run
13249    /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
13250    /// let x = ListVolumesResponse::new().set_unreachable(["a", "b", "c"]);
13251    /// ```
13252    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13253    where
13254        T: std::iter::IntoIterator<Item = V>,
13255        V: std::convert::Into<std::string::String>,
13256    {
13257        use std::iter::Iterator;
13258        self.unreachable = v.into_iter().map(|i| i.into()).collect();
13259        self
13260    }
13261}
13262
13263impl wkt::message::Message for ListVolumesResponse {
13264    fn typename() -> &'static str {
13265        "type.googleapis.com/google.cloud.netapp.v1.ListVolumesResponse"
13266    }
13267}
13268
13269#[doc(hidden)]
13270impl google_cloud_gax::paginator::internal::PageableResponse for ListVolumesResponse {
13271    type PageItem = crate::model::Volume;
13272
13273    fn items(self) -> std::vec::Vec<Self::PageItem> {
13274        self.volumes
13275    }
13276
13277    fn next_page_token(&self) -> std::string::String {
13278        use std::clone::Clone;
13279        self.next_page_token.clone()
13280    }
13281}
13282
13283/// Message for getting a Volume
13284#[derive(Clone, Default, PartialEq)]
13285#[non_exhaustive]
13286pub struct GetVolumeRequest {
13287    /// Required. Name of the volume
13288    pub name: std::string::String,
13289
13290    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13291}
13292
13293impl GetVolumeRequest {
13294    /// Creates a new default instance.
13295    pub fn new() -> Self {
13296        std::default::Default::default()
13297    }
13298
13299    /// Sets the value of [name][crate::model::GetVolumeRequest::name].
13300    ///
13301    /// # Example
13302    /// ```ignore,no_run
13303    /// # use google_cloud_netapp_v1::model::GetVolumeRequest;
13304    /// # let project_id = "project_id";
13305    /// # let location_id = "location_id";
13306    /// # let volume_id = "volume_id";
13307    /// let x = GetVolumeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
13308    /// ```
13309    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13310        self.name = v.into();
13311        self
13312    }
13313}
13314
13315impl wkt::message::Message for GetVolumeRequest {
13316    fn typename() -> &'static str {
13317        "type.googleapis.com/google.cloud.netapp.v1.GetVolumeRequest"
13318    }
13319}
13320
13321/// Message for creating a Volume
13322#[derive(Clone, Default, PartialEq)]
13323#[non_exhaustive]
13324pub struct CreateVolumeRequest {
13325    /// Required. Value for parent.
13326    pub parent: std::string::String,
13327
13328    /// Required. Id of the requesting volume. Must be unique within the parent
13329    /// resource. Must contain only letters, numbers and hyphen, with the first
13330    /// character a letter, the last a letter or a number,
13331    /// and a 63 character maximum.
13332    pub volume_id: std::string::String,
13333
13334    /// Required. The volume being created.
13335    pub volume: std::option::Option<crate::model::Volume>,
13336
13337    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13338}
13339
13340impl CreateVolumeRequest {
13341    /// Creates a new default instance.
13342    pub fn new() -> Self {
13343        std::default::Default::default()
13344    }
13345
13346    /// Sets the value of [parent][crate::model::CreateVolumeRequest::parent].
13347    ///
13348    /// # Example
13349    /// ```ignore,no_run
13350    /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
13351    /// # let project_id = "project_id";
13352    /// # let location_id = "location_id";
13353    /// let x = CreateVolumeRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
13354    /// ```
13355    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13356        self.parent = v.into();
13357        self
13358    }
13359
13360    /// Sets the value of [volume_id][crate::model::CreateVolumeRequest::volume_id].
13361    ///
13362    /// # Example
13363    /// ```ignore,no_run
13364    /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
13365    /// let x = CreateVolumeRequest::new().set_volume_id("example");
13366    /// ```
13367    pub fn set_volume_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13368        self.volume_id = v.into();
13369        self
13370    }
13371
13372    /// Sets the value of [volume][crate::model::CreateVolumeRequest::volume].
13373    ///
13374    /// # Example
13375    /// ```ignore,no_run
13376    /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
13377    /// use google_cloud_netapp_v1::model::Volume;
13378    /// let x = CreateVolumeRequest::new().set_volume(Volume::default()/* use setters */);
13379    /// ```
13380    pub fn set_volume<T>(mut self, v: T) -> Self
13381    where
13382        T: std::convert::Into<crate::model::Volume>,
13383    {
13384        self.volume = std::option::Option::Some(v.into());
13385        self
13386    }
13387
13388    /// Sets or clears the value of [volume][crate::model::CreateVolumeRequest::volume].
13389    ///
13390    /// # Example
13391    /// ```ignore,no_run
13392    /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
13393    /// use google_cloud_netapp_v1::model::Volume;
13394    /// let x = CreateVolumeRequest::new().set_or_clear_volume(Some(Volume::default()/* use setters */));
13395    /// let x = CreateVolumeRequest::new().set_or_clear_volume(None::<Volume>);
13396    /// ```
13397    pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
13398    where
13399        T: std::convert::Into<crate::model::Volume>,
13400    {
13401        self.volume = v.map(|x| x.into());
13402        self
13403    }
13404}
13405
13406impl wkt::message::Message for CreateVolumeRequest {
13407    fn typename() -> &'static str {
13408        "type.googleapis.com/google.cloud.netapp.v1.CreateVolumeRequest"
13409    }
13410}
13411
13412/// Message for updating a Volume
13413#[derive(Clone, Default, PartialEq)]
13414#[non_exhaustive]
13415pub struct UpdateVolumeRequest {
13416    /// Required. Field mask is used to specify the fields to be overwritten in the
13417    /// Volume resource by the update.
13418    /// The fields specified in the update_mask are relative to the resource, not
13419    /// the full request. A field will be overwritten if it is in the mask. If the
13420    /// user does not provide a mask then all fields will be overwritten.
13421    pub update_mask: std::option::Option<wkt::FieldMask>,
13422
13423    /// Required. The volume being updated
13424    pub volume: std::option::Option<crate::model::Volume>,
13425
13426    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13427}
13428
13429impl UpdateVolumeRequest {
13430    /// Creates a new default instance.
13431    pub fn new() -> Self {
13432        std::default::Default::default()
13433    }
13434
13435    /// Sets the value of [update_mask][crate::model::UpdateVolumeRequest::update_mask].
13436    ///
13437    /// # Example
13438    /// ```ignore,no_run
13439    /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
13440    /// use wkt::FieldMask;
13441    /// let x = UpdateVolumeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
13442    /// ```
13443    pub fn set_update_mask<T>(mut self, v: T) -> Self
13444    where
13445        T: std::convert::Into<wkt::FieldMask>,
13446    {
13447        self.update_mask = std::option::Option::Some(v.into());
13448        self
13449    }
13450
13451    /// Sets or clears the value of [update_mask][crate::model::UpdateVolumeRequest::update_mask].
13452    ///
13453    /// # Example
13454    /// ```ignore,no_run
13455    /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
13456    /// use wkt::FieldMask;
13457    /// let x = UpdateVolumeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
13458    /// let x = UpdateVolumeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
13459    /// ```
13460    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13461    where
13462        T: std::convert::Into<wkt::FieldMask>,
13463    {
13464        self.update_mask = v.map(|x| x.into());
13465        self
13466    }
13467
13468    /// Sets the value of [volume][crate::model::UpdateVolumeRequest::volume].
13469    ///
13470    /// # Example
13471    /// ```ignore,no_run
13472    /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
13473    /// use google_cloud_netapp_v1::model::Volume;
13474    /// let x = UpdateVolumeRequest::new().set_volume(Volume::default()/* use setters */);
13475    /// ```
13476    pub fn set_volume<T>(mut self, v: T) -> Self
13477    where
13478        T: std::convert::Into<crate::model::Volume>,
13479    {
13480        self.volume = std::option::Option::Some(v.into());
13481        self
13482    }
13483
13484    /// Sets or clears the value of [volume][crate::model::UpdateVolumeRequest::volume].
13485    ///
13486    /// # Example
13487    /// ```ignore,no_run
13488    /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
13489    /// use google_cloud_netapp_v1::model::Volume;
13490    /// let x = UpdateVolumeRequest::new().set_or_clear_volume(Some(Volume::default()/* use setters */));
13491    /// let x = UpdateVolumeRequest::new().set_or_clear_volume(None::<Volume>);
13492    /// ```
13493    pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
13494    where
13495        T: std::convert::Into<crate::model::Volume>,
13496    {
13497        self.volume = v.map(|x| x.into());
13498        self
13499    }
13500}
13501
13502impl wkt::message::Message for UpdateVolumeRequest {
13503    fn typename() -> &'static str {
13504        "type.googleapis.com/google.cloud.netapp.v1.UpdateVolumeRequest"
13505    }
13506}
13507
13508/// Message for deleting a Volume
13509#[derive(Clone, Default, PartialEq)]
13510#[non_exhaustive]
13511pub struct DeleteVolumeRequest {
13512    /// Required. Name of the volume
13513    pub name: std::string::String,
13514
13515    /// If this field is set as true, CCFE will not block the volume resource
13516    /// deletion even if it has any snapshots resource. (Otherwise, the request
13517    /// will only work if the volume has no snapshots.)
13518    pub force: bool,
13519
13520    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13521}
13522
13523impl DeleteVolumeRequest {
13524    /// Creates a new default instance.
13525    pub fn new() -> Self {
13526        std::default::Default::default()
13527    }
13528
13529    /// Sets the value of [name][crate::model::DeleteVolumeRequest::name].
13530    ///
13531    /// # Example
13532    /// ```ignore,no_run
13533    /// # use google_cloud_netapp_v1::model::DeleteVolumeRequest;
13534    /// # let project_id = "project_id";
13535    /// # let location_id = "location_id";
13536    /// # let volume_id = "volume_id";
13537    /// let x = DeleteVolumeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
13538    /// ```
13539    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13540        self.name = v.into();
13541        self
13542    }
13543
13544    /// Sets the value of [force][crate::model::DeleteVolumeRequest::force].
13545    ///
13546    /// # Example
13547    /// ```ignore,no_run
13548    /// # use google_cloud_netapp_v1::model::DeleteVolumeRequest;
13549    /// let x = DeleteVolumeRequest::new().set_force(true);
13550    /// ```
13551    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13552        self.force = v.into();
13553        self
13554    }
13555}
13556
13557impl wkt::message::Message for DeleteVolumeRequest {
13558    fn typename() -> &'static str {
13559        "type.googleapis.com/google.cloud.netapp.v1.DeleteVolumeRequest"
13560    }
13561}
13562
13563/// RevertVolumeRequest reverts the given volume to the specified snapshot.
13564#[derive(Clone, Default, PartialEq)]
13565#[non_exhaustive]
13566pub struct RevertVolumeRequest {
13567    /// Required. The resource name of the volume, in the format of
13568    /// projects/{project_id}/locations/{location}/volumes/{volume_id}.
13569    pub name: std::string::String,
13570
13571    /// Required. The snapshot resource ID, in the format 'my-snapshot', where the
13572    /// specified ID is the {snapshot_id} of the fully qualified name like
13573    /// projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}
13574    pub snapshot_id: std::string::String,
13575
13576    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13577}
13578
13579impl RevertVolumeRequest {
13580    /// Creates a new default instance.
13581    pub fn new() -> Self {
13582        std::default::Default::default()
13583    }
13584
13585    /// Sets the value of [name][crate::model::RevertVolumeRequest::name].
13586    ///
13587    /// # Example
13588    /// ```ignore,no_run
13589    /// # use google_cloud_netapp_v1::model::RevertVolumeRequest;
13590    /// # let project_id = "project_id";
13591    /// # let location_id = "location_id";
13592    /// # let volume_id = "volume_id";
13593    /// let x = RevertVolumeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
13594    /// ```
13595    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13596        self.name = v.into();
13597        self
13598    }
13599
13600    /// Sets the value of [snapshot_id][crate::model::RevertVolumeRequest::snapshot_id].
13601    ///
13602    /// # Example
13603    /// ```ignore,no_run
13604    /// # use google_cloud_netapp_v1::model::RevertVolumeRequest;
13605    /// let x = RevertVolumeRequest::new().set_snapshot_id("example");
13606    /// ```
13607    pub fn set_snapshot_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13608        self.snapshot_id = v.into();
13609        self
13610    }
13611}
13612
13613impl wkt::message::Message for RevertVolumeRequest {
13614    fn typename() -> &'static str {
13615        "type.googleapis.com/google.cloud.netapp.v1.RevertVolumeRequest"
13616    }
13617}
13618
13619/// Volume provides a filesystem that you can mount.
13620#[derive(Clone, Default, PartialEq)]
13621#[non_exhaustive]
13622pub struct Volume {
13623    /// Identifier. Name of the volume
13624    pub name: std::string::String,
13625
13626    /// Output only. State of the volume
13627    pub state: crate::model::volume::State,
13628
13629    /// Output only. State details of the volume
13630    pub state_details: std::string::String,
13631
13632    /// Output only. Create time of the volume
13633    pub create_time: std::option::Option<wkt::Timestamp>,
13634
13635    /// Required. Share name of the volume
13636    pub share_name: std::string::String,
13637
13638    /// Output only. This field is not implemented. The values provided in this
13639    /// field are ignored.
13640    pub psa_range: std::string::String,
13641
13642    /// Required. StoragePool name of the volume
13643    pub storage_pool: std::string::String,
13644
13645    /// Output only. VPC Network name.
13646    /// Format: projects/{project}/global/networks/{network}
13647    pub network: std::string::String,
13648
13649    /// Output only. Service level of the volume
13650    pub service_level: crate::model::ServiceLevel,
13651
13652    /// Required. Capacity in GIB of the volume
13653    pub capacity_gib: i64,
13654
13655    /// Optional. Export policy of the volume
13656    pub export_policy: std::option::Option<crate::model::ExportPolicy>,
13657
13658    /// Required. Protocols required for the volume
13659    pub protocols: std::vec::Vec<crate::model::Protocols>,
13660
13661    /// Optional. SMB share settings for the volume.
13662    pub smb_settings: std::vec::Vec<crate::model::SMBSettings>,
13663
13664    /// Output only. Mount options of this volume
13665    pub mount_options: std::vec::Vec<crate::model::MountOption>,
13666
13667    /// Optional. Default unix style permission (e.g. 777) the mount point will be
13668    /// created with. Applicable for NFS protocol types only.
13669    pub unix_permissions: std::string::String,
13670
13671    /// Optional. Labels as key value pairs
13672    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
13673
13674    /// Optional. Description of the volume
13675    pub description: std::string::String,
13676
13677    /// Optional. SnapshotPolicy for a volume.
13678    pub snapshot_policy: std::option::Option<crate::model::SnapshotPolicy>,
13679
13680    /// Optional. Snap_reserve specifies percentage of volume storage reserved for
13681    /// snapshot storage. Default is 0 percent.
13682    pub snap_reserve: f64,
13683
13684    /// Optional. Snapshot_directory if enabled (true) the volume will contain a
13685    /// read-only .snapshot directory which provides access to each of the volume's
13686    /// snapshots.
13687    pub snapshot_directory: bool,
13688
13689    /// Output only. Used capacity in GIB of the volume. This is computed
13690    /// periodically and it does not represent the realtime usage.
13691    pub used_gib: i64,
13692
13693    /// Optional. Security Style of the Volume
13694    pub security_style: crate::model::SecurityStyle,
13695
13696    /// Optional. Flag indicating if the volume is a kerberos volume or not, export
13697    /// policy rules control kerberos security modes (krb5, krb5i, krb5p).
13698    pub kerberos_enabled: bool,
13699
13700    /// Output only. Flag indicating if the volume is NFS LDAP enabled or not.
13701    pub ldap_enabled: bool,
13702
13703    /// Output only. Specifies the ActiveDirectory name of a SMB volume.
13704    pub active_directory: std::string::String,
13705
13706    /// Optional. Specifies the source of the volume to be created from.
13707    pub restore_parameters: std::option::Option<crate::model::RestoreParameters>,
13708
13709    /// Output only. Specifies the KMS config to be used for volume encryption.
13710    pub kms_config: std::string::String,
13711
13712    /// Output only. Specified the current volume encryption key source.
13713    pub encryption_type: crate::model::EncryptionType,
13714
13715    /// Output only. Indicates whether the volume is part of a replication
13716    /// relationship.
13717    pub has_replication: bool,
13718
13719    /// BackupConfig of the volume.
13720    pub backup_config: std::option::Option<crate::model::BackupConfig>,
13721
13722    /// Optional. List of actions that are restricted on this volume.
13723    pub restricted_actions: std::vec::Vec<crate::model::RestrictedAction>,
13724
13725    /// Optional. Flag indicating if the volume will be a large capacity volume or
13726    /// a regular volume. This field is used for legacy FILE pools. For Unified
13727    /// pools, use the `large_capacity_config` field instead. This field and
13728    /// `large_capacity_config` are mutually exclusive.
13729    pub large_capacity: bool,
13730
13731    /// Optional. Flag indicating if the volume will have an IP address per node
13732    /// for volumes supporting multiple IP endpoints. Only the volume with
13733    /// large_capacity will be allowed to have multiple endpoints.
13734    pub multiple_endpoints: bool,
13735
13736    /// Tiering policy for the volume.
13737    pub tiering_policy: std::option::Option<crate::model::TieringPolicy>,
13738
13739    /// Output only. Specifies the replica zone for regional volume.
13740    pub replica_zone: std::string::String,
13741
13742    /// Output only. Specifies the active zone for regional volume.
13743    pub zone: std::string::String,
13744
13745    /// Output only. Size of the volume cold tier data rounded down to the nearest
13746    /// GiB.
13747    pub cold_tier_size_gib: i64,
13748
13749    /// Optional. The Hybrid Replication parameters for the volume.
13750    pub hybrid_replication_parameters:
13751        std::option::Option<crate::model::HybridReplicationParameters>,
13752
13753    /// Optional. Throughput of the volume (in MiB/s)
13754    pub throughput_mibps: f64,
13755
13756    /// Optional. Cache parameters for the volume.
13757    pub cache_parameters: std::option::Option<crate::model::CacheParameters>,
13758
13759    /// Output only. Total hot tier data rounded down to the nearest GiB used by
13760    /// the Volume. This field is only used for flex Service Level
13761    pub hot_tier_size_used_gib: i64,
13762
13763    /// Optional. Block devices for the volume.
13764    /// Currently, only one block device is permitted per Volume.
13765    pub block_devices: std::vec::Vec<crate::model::BlockDevice>,
13766
13767    /// Optional. Large capacity config for the volume.
13768    /// Enables and configures large capacity for volumes in Unified pools with
13769    /// File protocols. Not applicable for Block protocols in Unified pools.
13770    /// This field and the legacy `large_capacity` boolean field
13771    /// are mutually exclusive.
13772    pub large_capacity_config: std::option::Option<crate::model::LargeCapacityConfig>,
13773
13774    /// Output only. If this volume is a clone, this field contains details about
13775    /// the clone.
13776    pub clone_details: std::option::Option<crate::model::volume::CloneDetails>,
13777
13778    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13779}
13780
13781impl Volume {
13782    /// Creates a new default instance.
13783    pub fn new() -> Self {
13784        std::default::Default::default()
13785    }
13786
13787    /// Sets the value of [name][crate::model::Volume::name].
13788    ///
13789    /// # Example
13790    /// ```ignore,no_run
13791    /// # use google_cloud_netapp_v1::model::Volume;
13792    /// # let project_id = "project_id";
13793    /// # let location_id = "location_id";
13794    /// # let volume_id = "volume_id";
13795    /// let x = Volume::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
13796    /// ```
13797    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13798        self.name = v.into();
13799        self
13800    }
13801
13802    /// Sets the value of [state][crate::model::Volume::state].
13803    ///
13804    /// # Example
13805    /// ```ignore,no_run
13806    /// # use google_cloud_netapp_v1::model::Volume;
13807    /// use google_cloud_netapp_v1::model::volume::State;
13808    /// let x0 = Volume::new().set_state(State::Ready);
13809    /// let x1 = Volume::new().set_state(State::Creating);
13810    /// let x2 = Volume::new().set_state(State::Deleting);
13811    /// ```
13812    pub fn set_state<T: std::convert::Into<crate::model::volume::State>>(mut self, v: T) -> Self {
13813        self.state = v.into();
13814        self
13815    }
13816
13817    /// Sets the value of [state_details][crate::model::Volume::state_details].
13818    ///
13819    /// # Example
13820    /// ```ignore,no_run
13821    /// # use google_cloud_netapp_v1::model::Volume;
13822    /// let x = Volume::new().set_state_details("example");
13823    /// ```
13824    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13825        self.state_details = v.into();
13826        self
13827    }
13828
13829    /// Sets the value of [create_time][crate::model::Volume::create_time].
13830    ///
13831    /// # Example
13832    /// ```ignore,no_run
13833    /// # use google_cloud_netapp_v1::model::Volume;
13834    /// use wkt::Timestamp;
13835    /// let x = Volume::new().set_create_time(Timestamp::default()/* use setters */);
13836    /// ```
13837    pub fn set_create_time<T>(mut self, v: T) -> Self
13838    where
13839        T: std::convert::Into<wkt::Timestamp>,
13840    {
13841        self.create_time = std::option::Option::Some(v.into());
13842        self
13843    }
13844
13845    /// Sets or clears the value of [create_time][crate::model::Volume::create_time].
13846    ///
13847    /// # Example
13848    /// ```ignore,no_run
13849    /// # use google_cloud_netapp_v1::model::Volume;
13850    /// use wkt::Timestamp;
13851    /// let x = Volume::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13852    /// let x = Volume::new().set_or_clear_create_time(None::<Timestamp>);
13853    /// ```
13854    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13855    where
13856        T: std::convert::Into<wkt::Timestamp>,
13857    {
13858        self.create_time = v.map(|x| x.into());
13859        self
13860    }
13861
13862    /// Sets the value of [share_name][crate::model::Volume::share_name].
13863    ///
13864    /// # Example
13865    /// ```ignore,no_run
13866    /// # use google_cloud_netapp_v1::model::Volume;
13867    /// let x = Volume::new().set_share_name("example");
13868    /// ```
13869    pub fn set_share_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13870        self.share_name = v.into();
13871        self
13872    }
13873
13874    /// Sets the value of [psa_range][crate::model::Volume::psa_range].
13875    ///
13876    /// # Example
13877    /// ```ignore,no_run
13878    /// # use google_cloud_netapp_v1::model::Volume;
13879    /// let x = Volume::new().set_psa_range("example");
13880    /// ```
13881    pub fn set_psa_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13882        self.psa_range = v.into();
13883        self
13884    }
13885
13886    /// Sets the value of [storage_pool][crate::model::Volume::storage_pool].
13887    ///
13888    /// # Example
13889    /// ```ignore,no_run
13890    /// # use google_cloud_netapp_v1::model::Volume;
13891    /// # let project_id = "project_id";
13892    /// # let location_id = "location_id";
13893    /// # let storage_pool_id = "storage_pool_id";
13894    /// let x = Volume::new().set_storage_pool(format!("projects/{project_id}/locations/{location_id}/storagePools/{storage_pool_id}"));
13895    /// ```
13896    pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13897        self.storage_pool = v.into();
13898        self
13899    }
13900
13901    /// Sets the value of [network][crate::model::Volume::network].
13902    ///
13903    /// # Example
13904    /// ```ignore,no_run
13905    /// # use google_cloud_netapp_v1::model::Volume;
13906    /// let x = Volume::new().set_network("example");
13907    /// ```
13908    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13909        self.network = v.into();
13910        self
13911    }
13912
13913    /// Sets the value of [service_level][crate::model::Volume::service_level].
13914    ///
13915    /// # Example
13916    /// ```ignore,no_run
13917    /// # use google_cloud_netapp_v1::model::Volume;
13918    /// use google_cloud_netapp_v1::model::ServiceLevel;
13919    /// let x0 = Volume::new().set_service_level(ServiceLevel::Premium);
13920    /// let x1 = Volume::new().set_service_level(ServiceLevel::Extreme);
13921    /// let x2 = Volume::new().set_service_level(ServiceLevel::Standard);
13922    /// ```
13923    pub fn set_service_level<T: std::convert::Into<crate::model::ServiceLevel>>(
13924        mut self,
13925        v: T,
13926    ) -> Self {
13927        self.service_level = v.into();
13928        self
13929    }
13930
13931    /// Sets the value of [capacity_gib][crate::model::Volume::capacity_gib].
13932    ///
13933    /// # Example
13934    /// ```ignore,no_run
13935    /// # use google_cloud_netapp_v1::model::Volume;
13936    /// let x = Volume::new().set_capacity_gib(42);
13937    /// ```
13938    pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13939        self.capacity_gib = v.into();
13940        self
13941    }
13942
13943    /// Sets the value of [export_policy][crate::model::Volume::export_policy].
13944    ///
13945    /// # Example
13946    /// ```ignore,no_run
13947    /// # use google_cloud_netapp_v1::model::Volume;
13948    /// use google_cloud_netapp_v1::model::ExportPolicy;
13949    /// let x = Volume::new().set_export_policy(ExportPolicy::default()/* use setters */);
13950    /// ```
13951    pub fn set_export_policy<T>(mut self, v: T) -> Self
13952    where
13953        T: std::convert::Into<crate::model::ExportPolicy>,
13954    {
13955        self.export_policy = std::option::Option::Some(v.into());
13956        self
13957    }
13958
13959    /// Sets or clears the value of [export_policy][crate::model::Volume::export_policy].
13960    ///
13961    /// # Example
13962    /// ```ignore,no_run
13963    /// # use google_cloud_netapp_v1::model::Volume;
13964    /// use google_cloud_netapp_v1::model::ExportPolicy;
13965    /// let x = Volume::new().set_or_clear_export_policy(Some(ExportPolicy::default()/* use setters */));
13966    /// let x = Volume::new().set_or_clear_export_policy(None::<ExportPolicy>);
13967    /// ```
13968    pub fn set_or_clear_export_policy<T>(mut self, v: std::option::Option<T>) -> Self
13969    where
13970        T: std::convert::Into<crate::model::ExportPolicy>,
13971    {
13972        self.export_policy = v.map(|x| x.into());
13973        self
13974    }
13975
13976    /// Sets the value of [protocols][crate::model::Volume::protocols].
13977    ///
13978    /// # Example
13979    /// ```ignore,no_run
13980    /// # use google_cloud_netapp_v1::model::Volume;
13981    /// use google_cloud_netapp_v1::model::Protocols;
13982    /// let x = Volume::new().set_protocols([
13983    ///     Protocols::Nfsv3,
13984    ///     Protocols::Nfsv4,
13985    ///     Protocols::Smb,
13986    /// ]);
13987    /// ```
13988    pub fn set_protocols<T, V>(mut self, v: T) -> Self
13989    where
13990        T: std::iter::IntoIterator<Item = V>,
13991        V: std::convert::Into<crate::model::Protocols>,
13992    {
13993        use std::iter::Iterator;
13994        self.protocols = v.into_iter().map(|i| i.into()).collect();
13995        self
13996    }
13997
13998    /// Sets the value of [smb_settings][crate::model::Volume::smb_settings].
13999    ///
14000    /// # Example
14001    /// ```ignore,no_run
14002    /// # use google_cloud_netapp_v1::model::Volume;
14003    /// use google_cloud_netapp_v1::model::SMBSettings;
14004    /// let x = Volume::new().set_smb_settings([
14005    ///     SMBSettings::EncryptData,
14006    ///     SMBSettings::Browsable,
14007    ///     SMBSettings::ChangeNotify,
14008    /// ]);
14009    /// ```
14010    pub fn set_smb_settings<T, V>(mut self, v: T) -> Self
14011    where
14012        T: std::iter::IntoIterator<Item = V>,
14013        V: std::convert::Into<crate::model::SMBSettings>,
14014    {
14015        use std::iter::Iterator;
14016        self.smb_settings = v.into_iter().map(|i| i.into()).collect();
14017        self
14018    }
14019
14020    /// Sets the value of [mount_options][crate::model::Volume::mount_options].
14021    ///
14022    /// # Example
14023    /// ```ignore,no_run
14024    /// # use google_cloud_netapp_v1::model::Volume;
14025    /// use google_cloud_netapp_v1::model::MountOption;
14026    /// let x = Volume::new()
14027    ///     .set_mount_options([
14028    ///         MountOption::default()/* use setters */,
14029    ///         MountOption::default()/* use (different) setters */,
14030    ///     ]);
14031    /// ```
14032    pub fn set_mount_options<T, V>(mut self, v: T) -> Self
14033    where
14034        T: std::iter::IntoIterator<Item = V>,
14035        V: std::convert::Into<crate::model::MountOption>,
14036    {
14037        use std::iter::Iterator;
14038        self.mount_options = v.into_iter().map(|i| i.into()).collect();
14039        self
14040    }
14041
14042    /// Sets the value of [unix_permissions][crate::model::Volume::unix_permissions].
14043    ///
14044    /// # Example
14045    /// ```ignore,no_run
14046    /// # use google_cloud_netapp_v1::model::Volume;
14047    /// let x = Volume::new().set_unix_permissions("example");
14048    /// ```
14049    pub fn set_unix_permissions<T: std::convert::Into<std::string::String>>(
14050        mut self,
14051        v: T,
14052    ) -> Self {
14053        self.unix_permissions = v.into();
14054        self
14055    }
14056
14057    /// Sets the value of [labels][crate::model::Volume::labels].
14058    ///
14059    /// # Example
14060    /// ```ignore,no_run
14061    /// # use google_cloud_netapp_v1::model::Volume;
14062    /// let x = Volume::new().set_labels([
14063    ///     ("key0", "abc"),
14064    ///     ("key1", "xyz"),
14065    /// ]);
14066    /// ```
14067    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
14068    where
14069        T: std::iter::IntoIterator<Item = (K, V)>,
14070        K: std::convert::Into<std::string::String>,
14071        V: std::convert::Into<std::string::String>,
14072    {
14073        use std::iter::Iterator;
14074        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14075        self
14076    }
14077
14078    /// Sets the value of [description][crate::model::Volume::description].
14079    ///
14080    /// # Example
14081    /// ```ignore,no_run
14082    /// # use google_cloud_netapp_v1::model::Volume;
14083    /// let x = Volume::new().set_description("example");
14084    /// ```
14085    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14086        self.description = v.into();
14087        self
14088    }
14089
14090    /// Sets the value of [snapshot_policy][crate::model::Volume::snapshot_policy].
14091    ///
14092    /// # Example
14093    /// ```ignore,no_run
14094    /// # use google_cloud_netapp_v1::model::Volume;
14095    /// use google_cloud_netapp_v1::model::SnapshotPolicy;
14096    /// let x = Volume::new().set_snapshot_policy(SnapshotPolicy::default()/* use setters */);
14097    /// ```
14098    pub fn set_snapshot_policy<T>(mut self, v: T) -> Self
14099    where
14100        T: std::convert::Into<crate::model::SnapshotPolicy>,
14101    {
14102        self.snapshot_policy = std::option::Option::Some(v.into());
14103        self
14104    }
14105
14106    /// Sets or clears the value of [snapshot_policy][crate::model::Volume::snapshot_policy].
14107    ///
14108    /// # Example
14109    /// ```ignore,no_run
14110    /// # use google_cloud_netapp_v1::model::Volume;
14111    /// use google_cloud_netapp_v1::model::SnapshotPolicy;
14112    /// let x = Volume::new().set_or_clear_snapshot_policy(Some(SnapshotPolicy::default()/* use setters */));
14113    /// let x = Volume::new().set_or_clear_snapshot_policy(None::<SnapshotPolicy>);
14114    /// ```
14115    pub fn set_or_clear_snapshot_policy<T>(mut self, v: std::option::Option<T>) -> Self
14116    where
14117        T: std::convert::Into<crate::model::SnapshotPolicy>,
14118    {
14119        self.snapshot_policy = v.map(|x| x.into());
14120        self
14121    }
14122
14123    /// Sets the value of [snap_reserve][crate::model::Volume::snap_reserve].
14124    ///
14125    /// # Example
14126    /// ```ignore,no_run
14127    /// # use google_cloud_netapp_v1::model::Volume;
14128    /// let x = Volume::new().set_snap_reserve(42.0);
14129    /// ```
14130    pub fn set_snap_reserve<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
14131        self.snap_reserve = v.into();
14132        self
14133    }
14134
14135    /// Sets the value of [snapshot_directory][crate::model::Volume::snapshot_directory].
14136    ///
14137    /// # Example
14138    /// ```ignore,no_run
14139    /// # use google_cloud_netapp_v1::model::Volume;
14140    /// let x = Volume::new().set_snapshot_directory(true);
14141    /// ```
14142    pub fn set_snapshot_directory<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14143        self.snapshot_directory = v.into();
14144        self
14145    }
14146
14147    /// Sets the value of [used_gib][crate::model::Volume::used_gib].
14148    ///
14149    /// # Example
14150    /// ```ignore,no_run
14151    /// # use google_cloud_netapp_v1::model::Volume;
14152    /// let x = Volume::new().set_used_gib(42);
14153    /// ```
14154    pub fn set_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14155        self.used_gib = v.into();
14156        self
14157    }
14158
14159    /// Sets the value of [security_style][crate::model::Volume::security_style].
14160    ///
14161    /// # Example
14162    /// ```ignore,no_run
14163    /// # use google_cloud_netapp_v1::model::Volume;
14164    /// use google_cloud_netapp_v1::model::SecurityStyle;
14165    /// let x0 = Volume::new().set_security_style(SecurityStyle::Ntfs);
14166    /// let x1 = Volume::new().set_security_style(SecurityStyle::Unix);
14167    /// ```
14168    pub fn set_security_style<T: std::convert::Into<crate::model::SecurityStyle>>(
14169        mut self,
14170        v: T,
14171    ) -> Self {
14172        self.security_style = v.into();
14173        self
14174    }
14175
14176    /// Sets the value of [kerberos_enabled][crate::model::Volume::kerberos_enabled].
14177    ///
14178    /// # Example
14179    /// ```ignore,no_run
14180    /// # use google_cloud_netapp_v1::model::Volume;
14181    /// let x = Volume::new().set_kerberos_enabled(true);
14182    /// ```
14183    pub fn set_kerberos_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14184        self.kerberos_enabled = v.into();
14185        self
14186    }
14187
14188    /// Sets the value of [ldap_enabled][crate::model::Volume::ldap_enabled].
14189    ///
14190    /// # Example
14191    /// ```ignore,no_run
14192    /// # use google_cloud_netapp_v1::model::Volume;
14193    /// let x = Volume::new().set_ldap_enabled(true);
14194    /// ```
14195    pub fn set_ldap_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14196        self.ldap_enabled = v.into();
14197        self
14198    }
14199
14200    /// Sets the value of [active_directory][crate::model::Volume::active_directory].
14201    ///
14202    /// # Example
14203    /// ```ignore,no_run
14204    /// # use google_cloud_netapp_v1::model::Volume;
14205    /// # let project_id = "project_id";
14206    /// # let location_id = "location_id";
14207    /// # let active_directory_id = "active_directory_id";
14208    /// let x = Volume::new().set_active_directory(format!("projects/{project_id}/locations/{location_id}/activeDirectories/{active_directory_id}"));
14209    /// ```
14210    pub fn set_active_directory<T: std::convert::Into<std::string::String>>(
14211        mut self,
14212        v: T,
14213    ) -> Self {
14214        self.active_directory = v.into();
14215        self
14216    }
14217
14218    /// Sets the value of [restore_parameters][crate::model::Volume::restore_parameters].
14219    ///
14220    /// # Example
14221    /// ```ignore,no_run
14222    /// # use google_cloud_netapp_v1::model::Volume;
14223    /// use google_cloud_netapp_v1::model::RestoreParameters;
14224    /// let x = Volume::new().set_restore_parameters(RestoreParameters::default()/* use setters */);
14225    /// ```
14226    pub fn set_restore_parameters<T>(mut self, v: T) -> Self
14227    where
14228        T: std::convert::Into<crate::model::RestoreParameters>,
14229    {
14230        self.restore_parameters = std::option::Option::Some(v.into());
14231        self
14232    }
14233
14234    /// Sets or clears the value of [restore_parameters][crate::model::Volume::restore_parameters].
14235    ///
14236    /// # Example
14237    /// ```ignore,no_run
14238    /// # use google_cloud_netapp_v1::model::Volume;
14239    /// use google_cloud_netapp_v1::model::RestoreParameters;
14240    /// let x = Volume::new().set_or_clear_restore_parameters(Some(RestoreParameters::default()/* use setters */));
14241    /// let x = Volume::new().set_or_clear_restore_parameters(None::<RestoreParameters>);
14242    /// ```
14243    pub fn set_or_clear_restore_parameters<T>(mut self, v: std::option::Option<T>) -> Self
14244    where
14245        T: std::convert::Into<crate::model::RestoreParameters>,
14246    {
14247        self.restore_parameters = v.map(|x| x.into());
14248        self
14249    }
14250
14251    /// Sets the value of [kms_config][crate::model::Volume::kms_config].
14252    ///
14253    /// # Example
14254    /// ```ignore,no_run
14255    /// # use google_cloud_netapp_v1::model::Volume;
14256    /// # let project_id = "project_id";
14257    /// # let location_id = "location_id";
14258    /// # let kms_config_id = "kms_config_id";
14259    /// let x = Volume::new().set_kms_config(format!("projects/{project_id}/locations/{location_id}/kmsConfigs/{kms_config_id}"));
14260    /// ```
14261    pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14262        self.kms_config = v.into();
14263        self
14264    }
14265
14266    /// Sets the value of [encryption_type][crate::model::Volume::encryption_type].
14267    ///
14268    /// # Example
14269    /// ```ignore,no_run
14270    /// # use google_cloud_netapp_v1::model::Volume;
14271    /// use google_cloud_netapp_v1::model::EncryptionType;
14272    /// let x0 = Volume::new().set_encryption_type(EncryptionType::ServiceManaged);
14273    /// let x1 = Volume::new().set_encryption_type(EncryptionType::CloudKms);
14274    /// ```
14275    pub fn set_encryption_type<T: std::convert::Into<crate::model::EncryptionType>>(
14276        mut self,
14277        v: T,
14278    ) -> Self {
14279        self.encryption_type = v.into();
14280        self
14281    }
14282
14283    /// Sets the value of [has_replication][crate::model::Volume::has_replication].
14284    ///
14285    /// # Example
14286    /// ```ignore,no_run
14287    /// # use google_cloud_netapp_v1::model::Volume;
14288    /// let x = Volume::new().set_has_replication(true);
14289    /// ```
14290    pub fn set_has_replication<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14291        self.has_replication = v.into();
14292        self
14293    }
14294
14295    /// Sets the value of [backup_config][crate::model::Volume::backup_config].
14296    ///
14297    /// # Example
14298    /// ```ignore,no_run
14299    /// # use google_cloud_netapp_v1::model::Volume;
14300    /// use google_cloud_netapp_v1::model::BackupConfig;
14301    /// let x = Volume::new().set_backup_config(BackupConfig::default()/* use setters */);
14302    /// ```
14303    pub fn set_backup_config<T>(mut self, v: T) -> Self
14304    where
14305        T: std::convert::Into<crate::model::BackupConfig>,
14306    {
14307        self.backup_config = std::option::Option::Some(v.into());
14308        self
14309    }
14310
14311    /// Sets or clears the value of [backup_config][crate::model::Volume::backup_config].
14312    ///
14313    /// # Example
14314    /// ```ignore,no_run
14315    /// # use google_cloud_netapp_v1::model::Volume;
14316    /// use google_cloud_netapp_v1::model::BackupConfig;
14317    /// let x = Volume::new().set_or_clear_backup_config(Some(BackupConfig::default()/* use setters */));
14318    /// let x = Volume::new().set_or_clear_backup_config(None::<BackupConfig>);
14319    /// ```
14320    pub fn set_or_clear_backup_config<T>(mut self, v: std::option::Option<T>) -> Self
14321    where
14322        T: std::convert::Into<crate::model::BackupConfig>,
14323    {
14324        self.backup_config = v.map(|x| x.into());
14325        self
14326    }
14327
14328    /// Sets the value of [restricted_actions][crate::model::Volume::restricted_actions].
14329    ///
14330    /// # Example
14331    /// ```ignore,no_run
14332    /// # use google_cloud_netapp_v1::model::Volume;
14333    /// use google_cloud_netapp_v1::model::RestrictedAction;
14334    /// let x = Volume::new().set_restricted_actions([
14335    ///     RestrictedAction::Delete,
14336    /// ]);
14337    /// ```
14338    pub fn set_restricted_actions<T, V>(mut self, v: T) -> Self
14339    where
14340        T: std::iter::IntoIterator<Item = V>,
14341        V: std::convert::Into<crate::model::RestrictedAction>,
14342    {
14343        use std::iter::Iterator;
14344        self.restricted_actions = v.into_iter().map(|i| i.into()).collect();
14345        self
14346    }
14347
14348    /// Sets the value of [large_capacity][crate::model::Volume::large_capacity].
14349    ///
14350    /// # Example
14351    /// ```ignore,no_run
14352    /// # use google_cloud_netapp_v1::model::Volume;
14353    /// let x = Volume::new().set_large_capacity(true);
14354    /// ```
14355    pub fn set_large_capacity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14356        self.large_capacity = v.into();
14357        self
14358    }
14359
14360    /// Sets the value of [multiple_endpoints][crate::model::Volume::multiple_endpoints].
14361    ///
14362    /// # Example
14363    /// ```ignore,no_run
14364    /// # use google_cloud_netapp_v1::model::Volume;
14365    /// let x = Volume::new().set_multiple_endpoints(true);
14366    /// ```
14367    pub fn set_multiple_endpoints<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14368        self.multiple_endpoints = v.into();
14369        self
14370    }
14371
14372    /// Sets the value of [tiering_policy][crate::model::Volume::tiering_policy].
14373    ///
14374    /// # Example
14375    /// ```ignore,no_run
14376    /// # use google_cloud_netapp_v1::model::Volume;
14377    /// use google_cloud_netapp_v1::model::TieringPolicy;
14378    /// let x = Volume::new().set_tiering_policy(TieringPolicy::default()/* use setters */);
14379    /// ```
14380    pub fn set_tiering_policy<T>(mut self, v: T) -> Self
14381    where
14382        T: std::convert::Into<crate::model::TieringPolicy>,
14383    {
14384        self.tiering_policy = std::option::Option::Some(v.into());
14385        self
14386    }
14387
14388    /// Sets or clears the value of [tiering_policy][crate::model::Volume::tiering_policy].
14389    ///
14390    /// # Example
14391    /// ```ignore,no_run
14392    /// # use google_cloud_netapp_v1::model::Volume;
14393    /// use google_cloud_netapp_v1::model::TieringPolicy;
14394    /// let x = Volume::new().set_or_clear_tiering_policy(Some(TieringPolicy::default()/* use setters */));
14395    /// let x = Volume::new().set_or_clear_tiering_policy(None::<TieringPolicy>);
14396    /// ```
14397    pub fn set_or_clear_tiering_policy<T>(mut self, v: std::option::Option<T>) -> Self
14398    where
14399        T: std::convert::Into<crate::model::TieringPolicy>,
14400    {
14401        self.tiering_policy = v.map(|x| x.into());
14402        self
14403    }
14404
14405    /// Sets the value of [replica_zone][crate::model::Volume::replica_zone].
14406    ///
14407    /// # Example
14408    /// ```ignore,no_run
14409    /// # use google_cloud_netapp_v1::model::Volume;
14410    /// let x = Volume::new().set_replica_zone("example");
14411    /// ```
14412    pub fn set_replica_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14413        self.replica_zone = v.into();
14414        self
14415    }
14416
14417    /// Sets the value of [zone][crate::model::Volume::zone].
14418    ///
14419    /// # Example
14420    /// ```ignore,no_run
14421    /// # use google_cloud_netapp_v1::model::Volume;
14422    /// let x = Volume::new().set_zone("example");
14423    /// ```
14424    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14425        self.zone = v.into();
14426        self
14427    }
14428
14429    /// Sets the value of [cold_tier_size_gib][crate::model::Volume::cold_tier_size_gib].
14430    ///
14431    /// # Example
14432    /// ```ignore,no_run
14433    /// # use google_cloud_netapp_v1::model::Volume;
14434    /// let x = Volume::new().set_cold_tier_size_gib(42);
14435    /// ```
14436    pub fn set_cold_tier_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14437        self.cold_tier_size_gib = v.into();
14438        self
14439    }
14440
14441    /// Sets the value of [hybrid_replication_parameters][crate::model::Volume::hybrid_replication_parameters].
14442    ///
14443    /// # Example
14444    /// ```ignore,no_run
14445    /// # use google_cloud_netapp_v1::model::Volume;
14446    /// use google_cloud_netapp_v1::model::HybridReplicationParameters;
14447    /// let x = Volume::new().set_hybrid_replication_parameters(HybridReplicationParameters::default()/* use setters */);
14448    /// ```
14449    pub fn set_hybrid_replication_parameters<T>(mut self, v: T) -> Self
14450    where
14451        T: std::convert::Into<crate::model::HybridReplicationParameters>,
14452    {
14453        self.hybrid_replication_parameters = std::option::Option::Some(v.into());
14454        self
14455    }
14456
14457    /// Sets or clears the value of [hybrid_replication_parameters][crate::model::Volume::hybrid_replication_parameters].
14458    ///
14459    /// # Example
14460    /// ```ignore,no_run
14461    /// # use google_cloud_netapp_v1::model::Volume;
14462    /// use google_cloud_netapp_v1::model::HybridReplicationParameters;
14463    /// let x = Volume::new().set_or_clear_hybrid_replication_parameters(Some(HybridReplicationParameters::default()/* use setters */));
14464    /// let x = Volume::new().set_or_clear_hybrid_replication_parameters(None::<HybridReplicationParameters>);
14465    /// ```
14466    pub fn set_or_clear_hybrid_replication_parameters<T>(
14467        mut self,
14468        v: std::option::Option<T>,
14469    ) -> Self
14470    where
14471        T: std::convert::Into<crate::model::HybridReplicationParameters>,
14472    {
14473        self.hybrid_replication_parameters = v.map(|x| x.into());
14474        self
14475    }
14476
14477    /// Sets the value of [throughput_mibps][crate::model::Volume::throughput_mibps].
14478    ///
14479    /// # Example
14480    /// ```ignore,no_run
14481    /// # use google_cloud_netapp_v1::model::Volume;
14482    /// let x = Volume::new().set_throughput_mibps(42.0);
14483    /// ```
14484    pub fn set_throughput_mibps<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
14485        self.throughput_mibps = v.into();
14486        self
14487    }
14488
14489    /// Sets the value of [cache_parameters][crate::model::Volume::cache_parameters].
14490    ///
14491    /// # Example
14492    /// ```ignore,no_run
14493    /// # use google_cloud_netapp_v1::model::Volume;
14494    /// use google_cloud_netapp_v1::model::CacheParameters;
14495    /// let x = Volume::new().set_cache_parameters(CacheParameters::default()/* use setters */);
14496    /// ```
14497    pub fn set_cache_parameters<T>(mut self, v: T) -> Self
14498    where
14499        T: std::convert::Into<crate::model::CacheParameters>,
14500    {
14501        self.cache_parameters = std::option::Option::Some(v.into());
14502        self
14503    }
14504
14505    /// Sets or clears the value of [cache_parameters][crate::model::Volume::cache_parameters].
14506    ///
14507    /// # Example
14508    /// ```ignore,no_run
14509    /// # use google_cloud_netapp_v1::model::Volume;
14510    /// use google_cloud_netapp_v1::model::CacheParameters;
14511    /// let x = Volume::new().set_or_clear_cache_parameters(Some(CacheParameters::default()/* use setters */));
14512    /// let x = Volume::new().set_or_clear_cache_parameters(None::<CacheParameters>);
14513    /// ```
14514    pub fn set_or_clear_cache_parameters<T>(mut self, v: std::option::Option<T>) -> Self
14515    where
14516        T: std::convert::Into<crate::model::CacheParameters>,
14517    {
14518        self.cache_parameters = v.map(|x| x.into());
14519        self
14520    }
14521
14522    /// Sets the value of [hot_tier_size_used_gib][crate::model::Volume::hot_tier_size_used_gib].
14523    ///
14524    /// # Example
14525    /// ```ignore,no_run
14526    /// # use google_cloud_netapp_v1::model::Volume;
14527    /// let x = Volume::new().set_hot_tier_size_used_gib(42);
14528    /// ```
14529    pub fn set_hot_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14530        self.hot_tier_size_used_gib = v.into();
14531        self
14532    }
14533
14534    /// Sets the value of [block_devices][crate::model::Volume::block_devices].
14535    ///
14536    /// # Example
14537    /// ```ignore,no_run
14538    /// # use google_cloud_netapp_v1::model::Volume;
14539    /// use google_cloud_netapp_v1::model::BlockDevice;
14540    /// let x = Volume::new()
14541    ///     .set_block_devices([
14542    ///         BlockDevice::default()/* use setters */,
14543    ///         BlockDevice::default()/* use (different) setters */,
14544    ///     ]);
14545    /// ```
14546    pub fn set_block_devices<T, V>(mut self, v: T) -> Self
14547    where
14548        T: std::iter::IntoIterator<Item = V>,
14549        V: std::convert::Into<crate::model::BlockDevice>,
14550    {
14551        use std::iter::Iterator;
14552        self.block_devices = v.into_iter().map(|i| i.into()).collect();
14553        self
14554    }
14555
14556    /// Sets the value of [large_capacity_config][crate::model::Volume::large_capacity_config].
14557    ///
14558    /// # Example
14559    /// ```ignore,no_run
14560    /// # use google_cloud_netapp_v1::model::Volume;
14561    /// use google_cloud_netapp_v1::model::LargeCapacityConfig;
14562    /// let x = Volume::new().set_large_capacity_config(LargeCapacityConfig::default()/* use setters */);
14563    /// ```
14564    pub fn set_large_capacity_config<T>(mut self, v: T) -> Self
14565    where
14566        T: std::convert::Into<crate::model::LargeCapacityConfig>,
14567    {
14568        self.large_capacity_config = std::option::Option::Some(v.into());
14569        self
14570    }
14571
14572    /// Sets or clears the value of [large_capacity_config][crate::model::Volume::large_capacity_config].
14573    ///
14574    /// # Example
14575    /// ```ignore,no_run
14576    /// # use google_cloud_netapp_v1::model::Volume;
14577    /// use google_cloud_netapp_v1::model::LargeCapacityConfig;
14578    /// let x = Volume::new().set_or_clear_large_capacity_config(Some(LargeCapacityConfig::default()/* use setters */));
14579    /// let x = Volume::new().set_or_clear_large_capacity_config(None::<LargeCapacityConfig>);
14580    /// ```
14581    pub fn set_or_clear_large_capacity_config<T>(mut self, v: std::option::Option<T>) -> Self
14582    where
14583        T: std::convert::Into<crate::model::LargeCapacityConfig>,
14584    {
14585        self.large_capacity_config = v.map(|x| x.into());
14586        self
14587    }
14588
14589    /// Sets the value of [clone_details][crate::model::Volume::clone_details].
14590    ///
14591    /// # Example
14592    /// ```ignore,no_run
14593    /// # use google_cloud_netapp_v1::model::Volume;
14594    /// use google_cloud_netapp_v1::model::volume::CloneDetails;
14595    /// let x = Volume::new().set_clone_details(CloneDetails::default()/* use setters */);
14596    /// ```
14597    pub fn set_clone_details<T>(mut self, v: T) -> Self
14598    where
14599        T: std::convert::Into<crate::model::volume::CloneDetails>,
14600    {
14601        self.clone_details = std::option::Option::Some(v.into());
14602        self
14603    }
14604
14605    /// Sets or clears the value of [clone_details][crate::model::Volume::clone_details].
14606    ///
14607    /// # Example
14608    /// ```ignore,no_run
14609    /// # use google_cloud_netapp_v1::model::Volume;
14610    /// use google_cloud_netapp_v1::model::volume::CloneDetails;
14611    /// let x = Volume::new().set_or_clear_clone_details(Some(CloneDetails::default()/* use setters */));
14612    /// let x = Volume::new().set_or_clear_clone_details(None::<CloneDetails>);
14613    /// ```
14614    pub fn set_or_clear_clone_details<T>(mut self, v: std::option::Option<T>) -> Self
14615    where
14616        T: std::convert::Into<crate::model::volume::CloneDetails>,
14617    {
14618        self.clone_details = v.map(|x| x.into());
14619        self
14620    }
14621}
14622
14623impl wkt::message::Message for Volume {
14624    fn typename() -> &'static str {
14625        "type.googleapis.com/google.cloud.netapp.v1.Volume"
14626    }
14627}
14628
14629/// Defines additional types related to [Volume].
14630pub mod volume {
14631    #[allow(unused_imports)]
14632    use super::*;
14633
14634    /// Details about a clone volume.
14635    #[derive(Clone, Default, PartialEq)]
14636    #[non_exhaustive]
14637    pub struct CloneDetails {
14638        /// Output only. Specifies the full resource name of the source snapshot from
14639        /// which this volume was cloned. Format:
14640        /// projects/{project}/locations/{location}/volumes/{volume}/snapshots/{snapshot}
14641        pub source_snapshot: std::string::String,
14642
14643        /// Output only. Full name of the source volume resource.
14644        /// Format:
14645        /// projects/{project}/locations/{location}/volumes/{volume}
14646        pub source_volume: std::string::String,
14647
14648        /// Output only. Shared space in GiB. Determined at volume creation time
14649        /// based on size of source snapshot.
14650        pub shared_space_gib: i64,
14651
14652        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14653    }
14654
14655    impl CloneDetails {
14656        /// Creates a new default instance.
14657        pub fn new() -> Self {
14658            std::default::Default::default()
14659        }
14660
14661        /// Sets the value of [source_snapshot][crate::model::volume::CloneDetails::source_snapshot].
14662        ///
14663        /// # Example
14664        /// ```ignore,no_run
14665        /// # use google_cloud_netapp_v1::model::volume::CloneDetails;
14666        /// # let project_id = "project_id";
14667        /// # let location_id = "location_id";
14668        /// # let volume_id = "volume_id";
14669        /// # let snapshot_id = "snapshot_id";
14670        /// let x = CloneDetails::new().set_source_snapshot(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}"));
14671        /// ```
14672        pub fn set_source_snapshot<T: std::convert::Into<std::string::String>>(
14673            mut self,
14674            v: T,
14675        ) -> Self {
14676            self.source_snapshot = v.into();
14677            self
14678        }
14679
14680        /// Sets the value of [source_volume][crate::model::volume::CloneDetails::source_volume].
14681        ///
14682        /// # Example
14683        /// ```ignore,no_run
14684        /// # use google_cloud_netapp_v1::model::volume::CloneDetails;
14685        /// # let project_id = "project_id";
14686        /// # let location_id = "location_id";
14687        /// # let volume_id = "volume_id";
14688        /// let x = CloneDetails::new().set_source_volume(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
14689        /// ```
14690        pub fn set_source_volume<T: std::convert::Into<std::string::String>>(
14691            mut self,
14692            v: T,
14693        ) -> Self {
14694            self.source_volume = v.into();
14695            self
14696        }
14697
14698        /// Sets the value of [shared_space_gib][crate::model::volume::CloneDetails::shared_space_gib].
14699        ///
14700        /// # Example
14701        /// ```ignore,no_run
14702        /// # use google_cloud_netapp_v1::model::volume::CloneDetails;
14703        /// let x = CloneDetails::new().set_shared_space_gib(42);
14704        /// ```
14705        pub fn set_shared_space_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14706            self.shared_space_gib = v.into();
14707            self
14708        }
14709    }
14710
14711    impl wkt::message::Message for CloneDetails {
14712        fn typename() -> &'static str {
14713            "type.googleapis.com/google.cloud.netapp.v1.Volume.CloneDetails"
14714        }
14715    }
14716
14717    /// The volume states
14718    ///
14719    /// # Working with unknown values
14720    ///
14721    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14722    /// additional enum variants at any time. Adding new variants is not considered
14723    /// a breaking change. Applications should write their code in anticipation of:
14724    ///
14725    /// - New values appearing in future releases of the client library, **and**
14726    /// - New values received dynamically, without application changes.
14727    ///
14728    /// Please consult the [Working with enums] section in the user guide for some
14729    /// guidelines.
14730    ///
14731    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14732    #[derive(Clone, Debug, PartialEq)]
14733    #[non_exhaustive]
14734    pub enum State {
14735        /// Unspecified Volume State
14736        Unspecified,
14737        /// Volume State is Ready
14738        Ready,
14739        /// Volume State is Creating
14740        Creating,
14741        /// Volume State is Deleting
14742        Deleting,
14743        /// Volume State is Updating
14744        Updating,
14745        /// Volume State is Restoring
14746        Restoring,
14747        /// Volume State is Disabled
14748        Disabled,
14749        /// Volume State is Error
14750        Error,
14751        /// Volume State is Preparing. Note that this is different from CREATING
14752        /// where CREATING means the volume is being created, while PREPARING means
14753        /// the volume is created and now being prepared for the replication.
14754        Preparing,
14755        /// Volume State is Read Only
14756        ReadOnly,
14757        /// If set, the enum was initialized with an unknown value.
14758        ///
14759        /// Applications can examine the value using [State::value] or
14760        /// [State::name].
14761        UnknownValue(state::UnknownValue),
14762    }
14763
14764    #[doc(hidden)]
14765    pub mod state {
14766        #[allow(unused_imports)]
14767        use super::*;
14768        #[derive(Clone, Debug, PartialEq)]
14769        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14770    }
14771
14772    impl State {
14773        /// Gets the enum value.
14774        ///
14775        /// Returns `None` if the enum contains an unknown value deserialized from
14776        /// the string representation of enums.
14777        pub fn value(&self) -> std::option::Option<i32> {
14778            match self {
14779                Self::Unspecified => std::option::Option::Some(0),
14780                Self::Ready => std::option::Option::Some(1),
14781                Self::Creating => std::option::Option::Some(2),
14782                Self::Deleting => std::option::Option::Some(3),
14783                Self::Updating => std::option::Option::Some(4),
14784                Self::Restoring => std::option::Option::Some(5),
14785                Self::Disabled => std::option::Option::Some(6),
14786                Self::Error => std::option::Option::Some(7),
14787                Self::Preparing => std::option::Option::Some(8),
14788                Self::ReadOnly => std::option::Option::Some(9),
14789                Self::UnknownValue(u) => u.0.value(),
14790            }
14791        }
14792
14793        /// Gets the enum value as a string.
14794        ///
14795        /// Returns `None` if the enum contains an unknown value deserialized from
14796        /// the integer representation of enums.
14797        pub fn name(&self) -> std::option::Option<&str> {
14798            match self {
14799                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14800                Self::Ready => std::option::Option::Some("READY"),
14801                Self::Creating => std::option::Option::Some("CREATING"),
14802                Self::Deleting => std::option::Option::Some("DELETING"),
14803                Self::Updating => std::option::Option::Some("UPDATING"),
14804                Self::Restoring => std::option::Option::Some("RESTORING"),
14805                Self::Disabled => std::option::Option::Some("DISABLED"),
14806                Self::Error => std::option::Option::Some("ERROR"),
14807                Self::Preparing => std::option::Option::Some("PREPARING"),
14808                Self::ReadOnly => std::option::Option::Some("READ_ONLY"),
14809                Self::UnknownValue(u) => u.0.name(),
14810            }
14811        }
14812    }
14813
14814    impl std::default::Default for State {
14815        fn default() -> Self {
14816            use std::convert::From;
14817            Self::from(0)
14818        }
14819    }
14820
14821    impl std::fmt::Display for State {
14822        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14823            wkt::internal::display_enum(f, self.name(), self.value())
14824        }
14825    }
14826
14827    impl std::convert::From<i32> for State {
14828        fn from(value: i32) -> Self {
14829            match value {
14830                0 => Self::Unspecified,
14831                1 => Self::Ready,
14832                2 => Self::Creating,
14833                3 => Self::Deleting,
14834                4 => Self::Updating,
14835                5 => Self::Restoring,
14836                6 => Self::Disabled,
14837                7 => Self::Error,
14838                8 => Self::Preparing,
14839                9 => Self::ReadOnly,
14840                _ => Self::UnknownValue(state::UnknownValue(
14841                    wkt::internal::UnknownEnumValue::Integer(value),
14842                )),
14843            }
14844        }
14845    }
14846
14847    impl std::convert::From<&str> for State {
14848        fn from(value: &str) -> Self {
14849            use std::string::ToString;
14850            match value {
14851                "STATE_UNSPECIFIED" => Self::Unspecified,
14852                "READY" => Self::Ready,
14853                "CREATING" => Self::Creating,
14854                "DELETING" => Self::Deleting,
14855                "UPDATING" => Self::Updating,
14856                "RESTORING" => Self::Restoring,
14857                "DISABLED" => Self::Disabled,
14858                "ERROR" => Self::Error,
14859                "PREPARING" => Self::Preparing,
14860                "READ_ONLY" => Self::ReadOnly,
14861                _ => Self::UnknownValue(state::UnknownValue(
14862                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14863                )),
14864            }
14865        }
14866    }
14867
14868    impl serde::ser::Serialize for State {
14869        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14870        where
14871            S: serde::Serializer,
14872        {
14873            match self {
14874                Self::Unspecified => serializer.serialize_i32(0),
14875                Self::Ready => serializer.serialize_i32(1),
14876                Self::Creating => serializer.serialize_i32(2),
14877                Self::Deleting => serializer.serialize_i32(3),
14878                Self::Updating => serializer.serialize_i32(4),
14879                Self::Restoring => serializer.serialize_i32(5),
14880                Self::Disabled => serializer.serialize_i32(6),
14881                Self::Error => serializer.serialize_i32(7),
14882                Self::Preparing => serializer.serialize_i32(8),
14883                Self::ReadOnly => serializer.serialize_i32(9),
14884                Self::UnknownValue(u) => u.0.serialize(serializer),
14885            }
14886        }
14887    }
14888
14889    impl<'de> serde::de::Deserialize<'de> for State {
14890        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14891        where
14892            D: serde::Deserializer<'de>,
14893        {
14894            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14895                ".google.cloud.netapp.v1.Volume.State",
14896            ))
14897        }
14898    }
14899}
14900
14901/// Configuration for a Large Capacity Volume. A Large Capacity Volume
14902/// supports sizes ranging from 4.8 TiB to 20 PiB, it is composed of multiple
14903/// internal constituents, and must be created in a large capacity pool.
14904#[derive(Clone, Default, PartialEq)]
14905#[non_exhaustive]
14906pub struct LargeCapacityConfig {
14907    /// Optional. The number of internal constituents (e.g., FlexVols) for this
14908    /// large volume. The minimum number of constituents is 2.
14909    pub constituent_count: i32,
14910
14911    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14912}
14913
14914impl LargeCapacityConfig {
14915    /// Creates a new default instance.
14916    pub fn new() -> Self {
14917        std::default::Default::default()
14918    }
14919
14920    /// Sets the value of [constituent_count][crate::model::LargeCapacityConfig::constituent_count].
14921    ///
14922    /// # Example
14923    /// ```ignore,no_run
14924    /// # use google_cloud_netapp_v1::model::LargeCapacityConfig;
14925    /// let x = LargeCapacityConfig::new().set_constituent_count(42);
14926    /// ```
14927    pub fn set_constituent_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14928        self.constituent_count = v.into();
14929        self
14930    }
14931}
14932
14933impl wkt::message::Message for LargeCapacityConfig {
14934    fn typename() -> &'static str {
14935        "type.googleapis.com/google.cloud.netapp.v1.LargeCapacityConfig"
14936    }
14937}
14938
14939/// Defines the export policy for the volume.
14940#[derive(Clone, Default, PartialEq)]
14941#[non_exhaustive]
14942pub struct ExportPolicy {
14943    /// Required. List of export policy rules
14944    pub rules: std::vec::Vec<crate::model::SimpleExportPolicyRule>,
14945
14946    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14947}
14948
14949impl ExportPolicy {
14950    /// Creates a new default instance.
14951    pub fn new() -> Self {
14952        std::default::Default::default()
14953    }
14954
14955    /// Sets the value of [rules][crate::model::ExportPolicy::rules].
14956    ///
14957    /// # Example
14958    /// ```ignore,no_run
14959    /// # use google_cloud_netapp_v1::model::ExportPolicy;
14960    /// use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14961    /// let x = ExportPolicy::new()
14962    ///     .set_rules([
14963    ///         SimpleExportPolicyRule::default()/* use setters */,
14964    ///         SimpleExportPolicyRule::default()/* use (different) setters */,
14965    ///     ]);
14966    /// ```
14967    pub fn set_rules<T, V>(mut self, v: T) -> Self
14968    where
14969        T: std::iter::IntoIterator<Item = V>,
14970        V: std::convert::Into<crate::model::SimpleExportPolicyRule>,
14971    {
14972        use std::iter::Iterator;
14973        self.rules = v.into_iter().map(|i| i.into()).collect();
14974        self
14975    }
14976}
14977
14978impl wkt::message::Message for ExportPolicy {
14979    fn typename() -> &'static str {
14980        "type.googleapis.com/google.cloud.netapp.v1.ExportPolicy"
14981    }
14982}
14983
14984/// An export policy rule describing various export options.
14985#[derive(Clone, Default, PartialEq)]
14986#[non_exhaustive]
14987pub struct SimpleExportPolicyRule {
14988    /// Comma separated list of allowed clients IP addresses
14989    pub allowed_clients: std::option::Option<std::string::String>,
14990
14991    /// Whether Unix root access will be granted.
14992    pub has_root_access: std::option::Option<std::string::String>,
14993
14994    /// Access type (ReadWrite, ReadOnly, None)
14995    pub access_type: std::option::Option<crate::model::AccessType>,
14996
14997    /// NFS V3 protocol.
14998    pub nfsv3: std::option::Option<bool>,
14999
15000    /// NFS V4 protocol.
15001    pub nfsv4: std::option::Option<bool>,
15002
15003    /// If enabled (true) the rule defines a read only access for clients matching
15004    /// the 'allowedClients' specification. It enables nfs clients to mount using
15005    /// 'authentication' kerberos security mode.
15006    pub kerberos_5_read_only: std::option::Option<bool>,
15007
15008    /// If enabled (true) the rule defines read and write access for clients
15009    /// matching the 'allowedClients' specification. It enables nfs clients to
15010    /// mount using 'authentication' kerberos security mode. The
15011    /// 'kerberos5ReadOnly' value be ignored if this is enabled.
15012    pub kerberos_5_read_write: std::option::Option<bool>,
15013
15014    /// If enabled (true) the rule defines a read only access for clients matching
15015    /// the 'allowedClients' specification. It enables nfs clients to mount using
15016    /// 'integrity' kerberos security mode.
15017    pub kerberos_5i_read_only: std::option::Option<bool>,
15018
15019    /// If enabled (true) the rule defines read and write access for clients
15020    /// matching the 'allowedClients' specification. It enables nfs clients to
15021    /// mount using 'integrity' kerberos security mode. The 'kerberos5iReadOnly'
15022    /// value be ignored if this is enabled.
15023    pub kerberos_5i_read_write: std::option::Option<bool>,
15024
15025    /// If enabled (true) the rule defines a read only access for clients matching
15026    /// the 'allowedClients' specification. It enables nfs clients to mount using
15027    /// 'privacy' kerberos security mode.
15028    pub kerberos_5p_read_only: std::option::Option<bool>,
15029
15030    /// If enabled (true) the rule defines read and write access for clients
15031    /// matching the 'allowedClients' specification. It enables nfs clients to
15032    /// mount using 'privacy' kerberos security mode. The 'kerberos5pReadOnly'
15033    /// value be ignored if this is enabled.
15034    pub kerberos_5p_read_write: std::option::Option<bool>,
15035
15036    /// Optional. Defines how user identity squashing is applied for this export
15037    /// rule. This field is the preferred way to configure squashing behavior and
15038    /// takes precedence over `has_root_access` if both are provided.
15039    pub squash_mode: std::option::Option<crate::model::simple_export_policy_rule::SquashMode>,
15040
15041    /// Optional. An integer representing the anonymous user ID. Range is 0 to
15042    /// `4294967295`. Required when `squash_mode` is `ROOT_SQUASH` or `ALL_SQUASH`.
15043    pub anon_uid: std::option::Option<i64>,
15044
15045    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15046}
15047
15048impl SimpleExportPolicyRule {
15049    /// Creates a new default instance.
15050    pub fn new() -> Self {
15051        std::default::Default::default()
15052    }
15053
15054    /// Sets the value of [allowed_clients][crate::model::SimpleExportPolicyRule::allowed_clients].
15055    ///
15056    /// # Example
15057    /// ```ignore,no_run
15058    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15059    /// let x = SimpleExportPolicyRule::new().set_allowed_clients("example");
15060    /// ```
15061    pub fn set_allowed_clients<T>(mut self, v: T) -> Self
15062    where
15063        T: std::convert::Into<std::string::String>,
15064    {
15065        self.allowed_clients = std::option::Option::Some(v.into());
15066        self
15067    }
15068
15069    /// Sets or clears the value of [allowed_clients][crate::model::SimpleExportPolicyRule::allowed_clients].
15070    ///
15071    /// # Example
15072    /// ```ignore,no_run
15073    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15074    /// let x = SimpleExportPolicyRule::new().set_or_clear_allowed_clients(Some("example"));
15075    /// let x = SimpleExportPolicyRule::new().set_or_clear_allowed_clients(None::<String>);
15076    /// ```
15077    pub fn set_or_clear_allowed_clients<T>(mut self, v: std::option::Option<T>) -> Self
15078    where
15079        T: std::convert::Into<std::string::String>,
15080    {
15081        self.allowed_clients = v.map(|x| x.into());
15082        self
15083    }
15084
15085    /// Sets the value of [has_root_access][crate::model::SimpleExportPolicyRule::has_root_access].
15086    ///
15087    /// # Example
15088    /// ```ignore,no_run
15089    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15090    /// let x = SimpleExportPolicyRule::new().set_has_root_access("example");
15091    /// ```
15092    pub fn set_has_root_access<T>(mut self, v: T) -> Self
15093    where
15094        T: std::convert::Into<std::string::String>,
15095    {
15096        self.has_root_access = std::option::Option::Some(v.into());
15097        self
15098    }
15099
15100    /// Sets or clears the value of [has_root_access][crate::model::SimpleExportPolicyRule::has_root_access].
15101    ///
15102    /// # Example
15103    /// ```ignore,no_run
15104    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15105    /// let x = SimpleExportPolicyRule::new().set_or_clear_has_root_access(Some("example"));
15106    /// let x = SimpleExportPolicyRule::new().set_or_clear_has_root_access(None::<String>);
15107    /// ```
15108    pub fn set_or_clear_has_root_access<T>(mut self, v: std::option::Option<T>) -> Self
15109    where
15110        T: std::convert::Into<std::string::String>,
15111    {
15112        self.has_root_access = v.map(|x| x.into());
15113        self
15114    }
15115
15116    /// Sets the value of [access_type][crate::model::SimpleExportPolicyRule::access_type].
15117    ///
15118    /// # Example
15119    /// ```ignore,no_run
15120    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15121    /// use google_cloud_netapp_v1::model::AccessType;
15122    /// let x0 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadOnly);
15123    /// let x1 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadWrite);
15124    /// let x2 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadNone);
15125    /// ```
15126    pub fn set_access_type<T>(mut self, v: T) -> Self
15127    where
15128        T: std::convert::Into<crate::model::AccessType>,
15129    {
15130        self.access_type = std::option::Option::Some(v.into());
15131        self
15132    }
15133
15134    /// Sets or clears the value of [access_type][crate::model::SimpleExportPolicyRule::access_type].
15135    ///
15136    /// # Example
15137    /// ```ignore,no_run
15138    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15139    /// use google_cloud_netapp_v1::model::AccessType;
15140    /// let x0 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadOnly));
15141    /// let x1 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadWrite));
15142    /// let x2 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadNone));
15143    /// let x_none = SimpleExportPolicyRule::new().set_or_clear_access_type(None::<AccessType>);
15144    /// ```
15145    pub fn set_or_clear_access_type<T>(mut self, v: std::option::Option<T>) -> Self
15146    where
15147        T: std::convert::Into<crate::model::AccessType>,
15148    {
15149        self.access_type = v.map(|x| x.into());
15150        self
15151    }
15152
15153    /// Sets the value of [nfsv3][crate::model::SimpleExportPolicyRule::nfsv3].
15154    ///
15155    /// # Example
15156    /// ```ignore,no_run
15157    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15158    /// let x = SimpleExportPolicyRule::new().set_nfsv3(true);
15159    /// ```
15160    pub fn set_nfsv3<T>(mut self, v: T) -> Self
15161    where
15162        T: std::convert::Into<bool>,
15163    {
15164        self.nfsv3 = std::option::Option::Some(v.into());
15165        self
15166    }
15167
15168    /// Sets or clears the value of [nfsv3][crate::model::SimpleExportPolicyRule::nfsv3].
15169    ///
15170    /// # Example
15171    /// ```ignore,no_run
15172    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15173    /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv3(Some(false));
15174    /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv3(None::<bool>);
15175    /// ```
15176    pub fn set_or_clear_nfsv3<T>(mut self, v: std::option::Option<T>) -> Self
15177    where
15178        T: std::convert::Into<bool>,
15179    {
15180        self.nfsv3 = v.map(|x| x.into());
15181        self
15182    }
15183
15184    /// Sets the value of [nfsv4][crate::model::SimpleExportPolicyRule::nfsv4].
15185    ///
15186    /// # Example
15187    /// ```ignore,no_run
15188    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15189    /// let x = SimpleExportPolicyRule::new().set_nfsv4(true);
15190    /// ```
15191    pub fn set_nfsv4<T>(mut self, v: T) -> Self
15192    where
15193        T: std::convert::Into<bool>,
15194    {
15195        self.nfsv4 = std::option::Option::Some(v.into());
15196        self
15197    }
15198
15199    /// Sets or clears the value of [nfsv4][crate::model::SimpleExportPolicyRule::nfsv4].
15200    ///
15201    /// # Example
15202    /// ```ignore,no_run
15203    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15204    /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv4(Some(false));
15205    /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv4(None::<bool>);
15206    /// ```
15207    pub fn set_or_clear_nfsv4<T>(mut self, v: std::option::Option<T>) -> Self
15208    where
15209        T: std::convert::Into<bool>,
15210    {
15211        self.nfsv4 = v.map(|x| x.into());
15212        self
15213    }
15214
15215    /// Sets the value of [kerberos_5_read_only][crate::model::SimpleExportPolicyRule::kerberos_5_read_only].
15216    ///
15217    /// # Example
15218    /// ```ignore,no_run
15219    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15220    /// let x = SimpleExportPolicyRule::new().set_kerberos_5_read_only(true);
15221    /// ```
15222    pub fn set_kerberos_5_read_only<T>(mut self, v: T) -> Self
15223    where
15224        T: std::convert::Into<bool>,
15225    {
15226        self.kerberos_5_read_only = std::option::Option::Some(v.into());
15227        self
15228    }
15229
15230    /// Sets or clears the value of [kerberos_5_read_only][crate::model::SimpleExportPolicyRule::kerberos_5_read_only].
15231    ///
15232    /// # Example
15233    /// ```ignore,no_run
15234    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15235    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_only(Some(false));
15236    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_only(None::<bool>);
15237    /// ```
15238    pub fn set_or_clear_kerberos_5_read_only<T>(mut self, v: std::option::Option<T>) -> Self
15239    where
15240        T: std::convert::Into<bool>,
15241    {
15242        self.kerberos_5_read_only = v.map(|x| x.into());
15243        self
15244    }
15245
15246    /// Sets the value of [kerberos_5_read_write][crate::model::SimpleExportPolicyRule::kerberos_5_read_write].
15247    ///
15248    /// # Example
15249    /// ```ignore,no_run
15250    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15251    /// let x = SimpleExportPolicyRule::new().set_kerberos_5_read_write(true);
15252    /// ```
15253    pub fn set_kerberos_5_read_write<T>(mut self, v: T) -> Self
15254    where
15255        T: std::convert::Into<bool>,
15256    {
15257        self.kerberos_5_read_write = std::option::Option::Some(v.into());
15258        self
15259    }
15260
15261    /// Sets or clears the value of [kerberos_5_read_write][crate::model::SimpleExportPolicyRule::kerberos_5_read_write].
15262    ///
15263    /// # Example
15264    /// ```ignore,no_run
15265    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15266    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_write(Some(false));
15267    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_write(None::<bool>);
15268    /// ```
15269    pub fn set_or_clear_kerberos_5_read_write<T>(mut self, v: std::option::Option<T>) -> Self
15270    where
15271        T: std::convert::Into<bool>,
15272    {
15273        self.kerberos_5_read_write = v.map(|x| x.into());
15274        self
15275    }
15276
15277    /// Sets the value of [kerberos_5i_read_only][crate::model::SimpleExportPolicyRule::kerberos_5i_read_only].
15278    ///
15279    /// # Example
15280    /// ```ignore,no_run
15281    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15282    /// let x = SimpleExportPolicyRule::new().set_kerberos_5i_read_only(true);
15283    /// ```
15284    pub fn set_kerberos_5i_read_only<T>(mut self, v: T) -> Self
15285    where
15286        T: std::convert::Into<bool>,
15287    {
15288        self.kerberos_5i_read_only = std::option::Option::Some(v.into());
15289        self
15290    }
15291
15292    /// Sets or clears the value of [kerberos_5i_read_only][crate::model::SimpleExportPolicyRule::kerberos_5i_read_only].
15293    ///
15294    /// # Example
15295    /// ```ignore,no_run
15296    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15297    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_only(Some(false));
15298    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_only(None::<bool>);
15299    /// ```
15300    pub fn set_or_clear_kerberos_5i_read_only<T>(mut self, v: std::option::Option<T>) -> Self
15301    where
15302        T: std::convert::Into<bool>,
15303    {
15304        self.kerberos_5i_read_only = v.map(|x| x.into());
15305        self
15306    }
15307
15308    /// Sets the value of [kerberos_5i_read_write][crate::model::SimpleExportPolicyRule::kerberos_5i_read_write].
15309    ///
15310    /// # Example
15311    /// ```ignore,no_run
15312    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15313    /// let x = SimpleExportPolicyRule::new().set_kerberos_5i_read_write(true);
15314    /// ```
15315    pub fn set_kerberos_5i_read_write<T>(mut self, v: T) -> Self
15316    where
15317        T: std::convert::Into<bool>,
15318    {
15319        self.kerberos_5i_read_write = std::option::Option::Some(v.into());
15320        self
15321    }
15322
15323    /// Sets or clears the value of [kerberos_5i_read_write][crate::model::SimpleExportPolicyRule::kerberos_5i_read_write].
15324    ///
15325    /// # Example
15326    /// ```ignore,no_run
15327    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15328    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_write(Some(false));
15329    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_write(None::<bool>);
15330    /// ```
15331    pub fn set_or_clear_kerberos_5i_read_write<T>(mut self, v: std::option::Option<T>) -> Self
15332    where
15333        T: std::convert::Into<bool>,
15334    {
15335        self.kerberos_5i_read_write = v.map(|x| x.into());
15336        self
15337    }
15338
15339    /// Sets the value of [kerberos_5p_read_only][crate::model::SimpleExportPolicyRule::kerberos_5p_read_only].
15340    ///
15341    /// # Example
15342    /// ```ignore,no_run
15343    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15344    /// let x = SimpleExportPolicyRule::new().set_kerberos_5p_read_only(true);
15345    /// ```
15346    pub fn set_kerberos_5p_read_only<T>(mut self, v: T) -> Self
15347    where
15348        T: std::convert::Into<bool>,
15349    {
15350        self.kerberos_5p_read_only = std::option::Option::Some(v.into());
15351        self
15352    }
15353
15354    /// Sets or clears the value of [kerberos_5p_read_only][crate::model::SimpleExportPolicyRule::kerberos_5p_read_only].
15355    ///
15356    /// # Example
15357    /// ```ignore,no_run
15358    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15359    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_only(Some(false));
15360    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_only(None::<bool>);
15361    /// ```
15362    pub fn set_or_clear_kerberos_5p_read_only<T>(mut self, v: std::option::Option<T>) -> Self
15363    where
15364        T: std::convert::Into<bool>,
15365    {
15366        self.kerberos_5p_read_only = v.map(|x| x.into());
15367        self
15368    }
15369
15370    /// Sets the value of [kerberos_5p_read_write][crate::model::SimpleExportPolicyRule::kerberos_5p_read_write].
15371    ///
15372    /// # Example
15373    /// ```ignore,no_run
15374    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15375    /// let x = SimpleExportPolicyRule::new().set_kerberos_5p_read_write(true);
15376    /// ```
15377    pub fn set_kerberos_5p_read_write<T>(mut self, v: T) -> Self
15378    where
15379        T: std::convert::Into<bool>,
15380    {
15381        self.kerberos_5p_read_write = std::option::Option::Some(v.into());
15382        self
15383    }
15384
15385    /// Sets or clears the value of [kerberos_5p_read_write][crate::model::SimpleExportPolicyRule::kerberos_5p_read_write].
15386    ///
15387    /// # Example
15388    /// ```ignore,no_run
15389    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15390    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_write(Some(false));
15391    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_write(None::<bool>);
15392    /// ```
15393    pub fn set_or_clear_kerberos_5p_read_write<T>(mut self, v: std::option::Option<T>) -> Self
15394    where
15395        T: std::convert::Into<bool>,
15396    {
15397        self.kerberos_5p_read_write = v.map(|x| x.into());
15398        self
15399    }
15400
15401    /// Sets the value of [squash_mode][crate::model::SimpleExportPolicyRule::squash_mode].
15402    ///
15403    /// # Example
15404    /// ```ignore,no_run
15405    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15406    /// use google_cloud_netapp_v1::model::simple_export_policy_rule::SquashMode;
15407    /// let x0 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::NoRootSquash);
15408    /// let x1 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::RootSquash);
15409    /// let x2 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::AllSquash);
15410    /// ```
15411    pub fn set_squash_mode<T>(mut self, v: T) -> Self
15412    where
15413        T: std::convert::Into<crate::model::simple_export_policy_rule::SquashMode>,
15414    {
15415        self.squash_mode = std::option::Option::Some(v.into());
15416        self
15417    }
15418
15419    /// Sets or clears the value of [squash_mode][crate::model::SimpleExportPolicyRule::squash_mode].
15420    ///
15421    /// # Example
15422    /// ```ignore,no_run
15423    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15424    /// use google_cloud_netapp_v1::model::simple_export_policy_rule::SquashMode;
15425    /// let x0 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::NoRootSquash));
15426    /// let x1 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::RootSquash));
15427    /// let x2 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::AllSquash));
15428    /// let x_none = SimpleExportPolicyRule::new().set_or_clear_squash_mode(None::<SquashMode>);
15429    /// ```
15430    pub fn set_or_clear_squash_mode<T>(mut self, v: std::option::Option<T>) -> Self
15431    where
15432        T: std::convert::Into<crate::model::simple_export_policy_rule::SquashMode>,
15433    {
15434        self.squash_mode = v.map(|x| x.into());
15435        self
15436    }
15437
15438    /// Sets the value of [anon_uid][crate::model::SimpleExportPolicyRule::anon_uid].
15439    ///
15440    /// # Example
15441    /// ```ignore,no_run
15442    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15443    /// let x = SimpleExportPolicyRule::new().set_anon_uid(42);
15444    /// ```
15445    pub fn set_anon_uid<T>(mut self, v: T) -> Self
15446    where
15447        T: std::convert::Into<i64>,
15448    {
15449        self.anon_uid = std::option::Option::Some(v.into());
15450        self
15451    }
15452
15453    /// Sets or clears the value of [anon_uid][crate::model::SimpleExportPolicyRule::anon_uid].
15454    ///
15455    /// # Example
15456    /// ```ignore,no_run
15457    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15458    /// let x = SimpleExportPolicyRule::new().set_or_clear_anon_uid(Some(42));
15459    /// let x = SimpleExportPolicyRule::new().set_or_clear_anon_uid(None::<i32>);
15460    /// ```
15461    pub fn set_or_clear_anon_uid<T>(mut self, v: std::option::Option<T>) -> Self
15462    where
15463        T: std::convert::Into<i64>,
15464    {
15465        self.anon_uid = v.map(|x| x.into());
15466        self
15467    }
15468}
15469
15470impl wkt::message::Message for SimpleExportPolicyRule {
15471    fn typename() -> &'static str {
15472        "type.googleapis.com/google.cloud.netapp.v1.SimpleExportPolicyRule"
15473    }
15474}
15475
15476/// Defines additional types related to [SimpleExportPolicyRule].
15477pub mod simple_export_policy_rule {
15478    #[allow(unused_imports)]
15479    use super::*;
15480
15481    /// `SquashMode` defines how remote user privileges are restricted when
15482    /// accessing an NFS export. It controls how user identities (like root) are
15483    /// mapped to anonymous users to limit access and enforce security.
15484    ///
15485    /// # Working with unknown values
15486    ///
15487    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15488    /// additional enum variants at any time. Adding new variants is not considered
15489    /// a breaking change. Applications should write their code in anticipation of:
15490    ///
15491    /// - New values appearing in future releases of the client library, **and**
15492    /// - New values received dynamically, without application changes.
15493    ///
15494    /// Please consult the [Working with enums] section in the user guide for some
15495    /// guidelines.
15496    ///
15497    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15498    #[derive(Clone, Debug, PartialEq)]
15499    #[non_exhaustive]
15500    pub enum SquashMode {
15501        /// Defaults to `NO_ROOT_SQUASH`.
15502        Unspecified,
15503        /// The root user (UID 0) retains full access. Other users are
15504        /// unaffected.
15505        NoRootSquash,
15506        /// The root user (UID 0) is squashed to anonymous user ID. Other users are
15507        /// unaffected.
15508        RootSquash,
15509        /// All users are squashed to anonymous user ID.
15510        AllSquash,
15511        /// If set, the enum was initialized with an unknown value.
15512        ///
15513        /// Applications can examine the value using [SquashMode::value] or
15514        /// [SquashMode::name].
15515        UnknownValue(squash_mode::UnknownValue),
15516    }
15517
15518    #[doc(hidden)]
15519    pub mod squash_mode {
15520        #[allow(unused_imports)]
15521        use super::*;
15522        #[derive(Clone, Debug, PartialEq)]
15523        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15524    }
15525
15526    impl SquashMode {
15527        /// Gets the enum value.
15528        ///
15529        /// Returns `None` if the enum contains an unknown value deserialized from
15530        /// the string representation of enums.
15531        pub fn value(&self) -> std::option::Option<i32> {
15532            match self {
15533                Self::Unspecified => std::option::Option::Some(0),
15534                Self::NoRootSquash => std::option::Option::Some(1),
15535                Self::RootSquash => std::option::Option::Some(2),
15536                Self::AllSquash => std::option::Option::Some(3),
15537                Self::UnknownValue(u) => u.0.value(),
15538            }
15539        }
15540
15541        /// Gets the enum value as a string.
15542        ///
15543        /// Returns `None` if the enum contains an unknown value deserialized from
15544        /// the integer representation of enums.
15545        pub fn name(&self) -> std::option::Option<&str> {
15546            match self {
15547                Self::Unspecified => std::option::Option::Some("SQUASH_MODE_UNSPECIFIED"),
15548                Self::NoRootSquash => std::option::Option::Some("NO_ROOT_SQUASH"),
15549                Self::RootSquash => std::option::Option::Some("ROOT_SQUASH"),
15550                Self::AllSquash => std::option::Option::Some("ALL_SQUASH"),
15551                Self::UnknownValue(u) => u.0.name(),
15552            }
15553        }
15554    }
15555
15556    impl std::default::Default for SquashMode {
15557        fn default() -> Self {
15558            use std::convert::From;
15559            Self::from(0)
15560        }
15561    }
15562
15563    impl std::fmt::Display for SquashMode {
15564        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15565            wkt::internal::display_enum(f, self.name(), self.value())
15566        }
15567    }
15568
15569    impl std::convert::From<i32> for SquashMode {
15570        fn from(value: i32) -> Self {
15571            match value {
15572                0 => Self::Unspecified,
15573                1 => Self::NoRootSquash,
15574                2 => Self::RootSquash,
15575                3 => Self::AllSquash,
15576                _ => Self::UnknownValue(squash_mode::UnknownValue(
15577                    wkt::internal::UnknownEnumValue::Integer(value),
15578                )),
15579            }
15580        }
15581    }
15582
15583    impl std::convert::From<&str> for SquashMode {
15584        fn from(value: &str) -> Self {
15585            use std::string::ToString;
15586            match value {
15587                "SQUASH_MODE_UNSPECIFIED" => Self::Unspecified,
15588                "NO_ROOT_SQUASH" => Self::NoRootSquash,
15589                "ROOT_SQUASH" => Self::RootSquash,
15590                "ALL_SQUASH" => Self::AllSquash,
15591                _ => Self::UnknownValue(squash_mode::UnknownValue(
15592                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15593                )),
15594            }
15595        }
15596    }
15597
15598    impl serde::ser::Serialize for SquashMode {
15599        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15600        where
15601            S: serde::Serializer,
15602        {
15603            match self {
15604                Self::Unspecified => serializer.serialize_i32(0),
15605                Self::NoRootSquash => serializer.serialize_i32(1),
15606                Self::RootSquash => serializer.serialize_i32(2),
15607                Self::AllSquash => serializer.serialize_i32(3),
15608                Self::UnknownValue(u) => u.0.serialize(serializer),
15609            }
15610        }
15611    }
15612
15613    impl<'de> serde::de::Deserialize<'de> for SquashMode {
15614        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15615        where
15616            D: serde::Deserializer<'de>,
15617        {
15618            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SquashMode>::new(
15619                ".google.cloud.netapp.v1.SimpleExportPolicyRule.SquashMode",
15620            ))
15621        }
15622    }
15623}
15624
15625/// Snapshot Policy for a volume.
15626#[derive(Clone, Default, PartialEq)]
15627#[non_exhaustive]
15628pub struct SnapshotPolicy {
15629    /// If enabled, make snapshots automatically according to the schedules.
15630    /// Default is false.
15631    pub enabled: std::option::Option<bool>,
15632
15633    /// Hourly schedule policy.
15634    pub hourly_schedule: std::option::Option<crate::model::HourlySchedule>,
15635
15636    /// Daily schedule policy.
15637    pub daily_schedule: std::option::Option<crate::model::DailySchedule>,
15638
15639    /// Weekly schedule policy.
15640    pub weekly_schedule: std::option::Option<crate::model::WeeklySchedule>,
15641
15642    /// Monthly schedule policy.
15643    pub monthly_schedule: std::option::Option<crate::model::MonthlySchedule>,
15644
15645    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15646}
15647
15648impl SnapshotPolicy {
15649    /// Creates a new default instance.
15650    pub fn new() -> Self {
15651        std::default::Default::default()
15652    }
15653
15654    /// Sets the value of [enabled][crate::model::SnapshotPolicy::enabled].
15655    ///
15656    /// # Example
15657    /// ```ignore,no_run
15658    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15659    /// let x = SnapshotPolicy::new().set_enabled(true);
15660    /// ```
15661    pub fn set_enabled<T>(mut self, v: T) -> Self
15662    where
15663        T: std::convert::Into<bool>,
15664    {
15665        self.enabled = std::option::Option::Some(v.into());
15666        self
15667    }
15668
15669    /// Sets or clears the value of [enabled][crate::model::SnapshotPolicy::enabled].
15670    ///
15671    /// # Example
15672    /// ```ignore,no_run
15673    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15674    /// let x = SnapshotPolicy::new().set_or_clear_enabled(Some(false));
15675    /// let x = SnapshotPolicy::new().set_or_clear_enabled(None::<bool>);
15676    /// ```
15677    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
15678    where
15679        T: std::convert::Into<bool>,
15680    {
15681        self.enabled = v.map(|x| x.into());
15682        self
15683    }
15684
15685    /// Sets the value of [hourly_schedule][crate::model::SnapshotPolicy::hourly_schedule].
15686    ///
15687    /// # Example
15688    /// ```ignore,no_run
15689    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15690    /// use google_cloud_netapp_v1::model::HourlySchedule;
15691    /// let x = SnapshotPolicy::new().set_hourly_schedule(HourlySchedule::default()/* use setters */);
15692    /// ```
15693    pub fn set_hourly_schedule<T>(mut self, v: T) -> Self
15694    where
15695        T: std::convert::Into<crate::model::HourlySchedule>,
15696    {
15697        self.hourly_schedule = std::option::Option::Some(v.into());
15698        self
15699    }
15700
15701    /// Sets or clears the value of [hourly_schedule][crate::model::SnapshotPolicy::hourly_schedule].
15702    ///
15703    /// # Example
15704    /// ```ignore,no_run
15705    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15706    /// use google_cloud_netapp_v1::model::HourlySchedule;
15707    /// let x = SnapshotPolicy::new().set_or_clear_hourly_schedule(Some(HourlySchedule::default()/* use setters */));
15708    /// let x = SnapshotPolicy::new().set_or_clear_hourly_schedule(None::<HourlySchedule>);
15709    /// ```
15710    pub fn set_or_clear_hourly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
15711    where
15712        T: std::convert::Into<crate::model::HourlySchedule>,
15713    {
15714        self.hourly_schedule = v.map(|x| x.into());
15715        self
15716    }
15717
15718    /// Sets the value of [daily_schedule][crate::model::SnapshotPolicy::daily_schedule].
15719    ///
15720    /// # Example
15721    /// ```ignore,no_run
15722    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15723    /// use google_cloud_netapp_v1::model::DailySchedule;
15724    /// let x = SnapshotPolicy::new().set_daily_schedule(DailySchedule::default()/* use setters */);
15725    /// ```
15726    pub fn set_daily_schedule<T>(mut self, v: T) -> Self
15727    where
15728        T: std::convert::Into<crate::model::DailySchedule>,
15729    {
15730        self.daily_schedule = std::option::Option::Some(v.into());
15731        self
15732    }
15733
15734    /// Sets or clears the value of [daily_schedule][crate::model::SnapshotPolicy::daily_schedule].
15735    ///
15736    /// # Example
15737    /// ```ignore,no_run
15738    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15739    /// use google_cloud_netapp_v1::model::DailySchedule;
15740    /// let x = SnapshotPolicy::new().set_or_clear_daily_schedule(Some(DailySchedule::default()/* use setters */));
15741    /// let x = SnapshotPolicy::new().set_or_clear_daily_schedule(None::<DailySchedule>);
15742    /// ```
15743    pub fn set_or_clear_daily_schedule<T>(mut self, v: std::option::Option<T>) -> Self
15744    where
15745        T: std::convert::Into<crate::model::DailySchedule>,
15746    {
15747        self.daily_schedule = v.map(|x| x.into());
15748        self
15749    }
15750
15751    /// Sets the value of [weekly_schedule][crate::model::SnapshotPolicy::weekly_schedule].
15752    ///
15753    /// # Example
15754    /// ```ignore,no_run
15755    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15756    /// use google_cloud_netapp_v1::model::WeeklySchedule;
15757    /// let x = SnapshotPolicy::new().set_weekly_schedule(WeeklySchedule::default()/* use setters */);
15758    /// ```
15759    pub fn set_weekly_schedule<T>(mut self, v: T) -> Self
15760    where
15761        T: std::convert::Into<crate::model::WeeklySchedule>,
15762    {
15763        self.weekly_schedule = std::option::Option::Some(v.into());
15764        self
15765    }
15766
15767    /// Sets or clears the value of [weekly_schedule][crate::model::SnapshotPolicy::weekly_schedule].
15768    ///
15769    /// # Example
15770    /// ```ignore,no_run
15771    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15772    /// use google_cloud_netapp_v1::model::WeeklySchedule;
15773    /// let x = SnapshotPolicy::new().set_or_clear_weekly_schedule(Some(WeeklySchedule::default()/* use setters */));
15774    /// let x = SnapshotPolicy::new().set_or_clear_weekly_schedule(None::<WeeklySchedule>);
15775    /// ```
15776    pub fn set_or_clear_weekly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
15777    where
15778        T: std::convert::Into<crate::model::WeeklySchedule>,
15779    {
15780        self.weekly_schedule = v.map(|x| x.into());
15781        self
15782    }
15783
15784    /// Sets the value of [monthly_schedule][crate::model::SnapshotPolicy::monthly_schedule].
15785    ///
15786    /// # Example
15787    /// ```ignore,no_run
15788    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15789    /// use google_cloud_netapp_v1::model::MonthlySchedule;
15790    /// let x = SnapshotPolicy::new().set_monthly_schedule(MonthlySchedule::default()/* use setters */);
15791    /// ```
15792    pub fn set_monthly_schedule<T>(mut self, v: T) -> Self
15793    where
15794        T: std::convert::Into<crate::model::MonthlySchedule>,
15795    {
15796        self.monthly_schedule = std::option::Option::Some(v.into());
15797        self
15798    }
15799
15800    /// Sets or clears the value of [monthly_schedule][crate::model::SnapshotPolicy::monthly_schedule].
15801    ///
15802    /// # Example
15803    /// ```ignore,no_run
15804    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15805    /// use google_cloud_netapp_v1::model::MonthlySchedule;
15806    /// let x = SnapshotPolicy::new().set_or_clear_monthly_schedule(Some(MonthlySchedule::default()/* use setters */));
15807    /// let x = SnapshotPolicy::new().set_or_clear_monthly_schedule(None::<MonthlySchedule>);
15808    /// ```
15809    pub fn set_or_clear_monthly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
15810    where
15811        T: std::convert::Into<crate::model::MonthlySchedule>,
15812    {
15813        self.monthly_schedule = v.map(|x| x.into());
15814        self
15815    }
15816}
15817
15818impl wkt::message::Message for SnapshotPolicy {
15819    fn typename() -> &'static str {
15820        "type.googleapis.com/google.cloud.netapp.v1.SnapshotPolicy"
15821    }
15822}
15823
15824/// Make a snapshot every hour e.g. at 04:00, 05:00, 06:00.
15825#[derive(Clone, Default, PartialEq)]
15826#[non_exhaustive]
15827pub struct HourlySchedule {
15828    /// The maximum number of Snapshots to keep for the hourly schedule
15829    pub snapshots_to_keep: std::option::Option<f64>,
15830
15831    /// Set the minute of the hour to start the snapshot (0-59), defaults to the
15832    /// top of the hour (0).
15833    pub minute: std::option::Option<f64>,
15834
15835    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15836}
15837
15838impl HourlySchedule {
15839    /// Creates a new default instance.
15840    pub fn new() -> Self {
15841        std::default::Default::default()
15842    }
15843
15844    /// Sets the value of [snapshots_to_keep][crate::model::HourlySchedule::snapshots_to_keep].
15845    ///
15846    /// # Example
15847    /// ```ignore,no_run
15848    /// # use google_cloud_netapp_v1::model::HourlySchedule;
15849    /// let x = HourlySchedule::new().set_snapshots_to_keep(42.0);
15850    /// ```
15851    pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
15852    where
15853        T: std::convert::Into<f64>,
15854    {
15855        self.snapshots_to_keep = std::option::Option::Some(v.into());
15856        self
15857    }
15858
15859    /// Sets or clears the value of [snapshots_to_keep][crate::model::HourlySchedule::snapshots_to_keep].
15860    ///
15861    /// # Example
15862    /// ```ignore,no_run
15863    /// # use google_cloud_netapp_v1::model::HourlySchedule;
15864    /// let x = HourlySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
15865    /// let x = HourlySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
15866    /// ```
15867    pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
15868    where
15869        T: std::convert::Into<f64>,
15870    {
15871        self.snapshots_to_keep = v.map(|x| x.into());
15872        self
15873    }
15874
15875    /// Sets the value of [minute][crate::model::HourlySchedule::minute].
15876    ///
15877    /// # Example
15878    /// ```ignore,no_run
15879    /// # use google_cloud_netapp_v1::model::HourlySchedule;
15880    /// let x = HourlySchedule::new().set_minute(42.0);
15881    /// ```
15882    pub fn set_minute<T>(mut self, v: T) -> Self
15883    where
15884        T: std::convert::Into<f64>,
15885    {
15886        self.minute = std::option::Option::Some(v.into());
15887        self
15888    }
15889
15890    /// Sets or clears the value of [minute][crate::model::HourlySchedule::minute].
15891    ///
15892    /// # Example
15893    /// ```ignore,no_run
15894    /// # use google_cloud_netapp_v1::model::HourlySchedule;
15895    /// let x = HourlySchedule::new().set_or_clear_minute(Some(42.0));
15896    /// let x = HourlySchedule::new().set_or_clear_minute(None::<f32>);
15897    /// ```
15898    pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
15899    where
15900        T: std::convert::Into<f64>,
15901    {
15902        self.minute = v.map(|x| x.into());
15903        self
15904    }
15905}
15906
15907impl wkt::message::Message for HourlySchedule {
15908    fn typename() -> &'static str {
15909        "type.googleapis.com/google.cloud.netapp.v1.HourlySchedule"
15910    }
15911}
15912
15913/// Make a snapshot every day e.g. at 04:00, 05:20, 23:50
15914#[derive(Clone, Default, PartialEq)]
15915#[non_exhaustive]
15916pub struct DailySchedule {
15917    /// The maximum number of Snapshots to keep for the hourly schedule
15918    pub snapshots_to_keep: std::option::Option<f64>,
15919
15920    /// Set the minute of the hour to start the snapshot (0-59), defaults to the
15921    /// top of the hour (0).
15922    pub minute: std::option::Option<f64>,
15923
15924    /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
15925    pub hour: std::option::Option<f64>,
15926
15927    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15928}
15929
15930impl DailySchedule {
15931    /// Creates a new default instance.
15932    pub fn new() -> Self {
15933        std::default::Default::default()
15934    }
15935
15936    /// Sets the value of [snapshots_to_keep][crate::model::DailySchedule::snapshots_to_keep].
15937    ///
15938    /// # Example
15939    /// ```ignore,no_run
15940    /// # use google_cloud_netapp_v1::model::DailySchedule;
15941    /// let x = DailySchedule::new().set_snapshots_to_keep(42.0);
15942    /// ```
15943    pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
15944    where
15945        T: std::convert::Into<f64>,
15946    {
15947        self.snapshots_to_keep = std::option::Option::Some(v.into());
15948        self
15949    }
15950
15951    /// Sets or clears the value of [snapshots_to_keep][crate::model::DailySchedule::snapshots_to_keep].
15952    ///
15953    /// # Example
15954    /// ```ignore,no_run
15955    /// # use google_cloud_netapp_v1::model::DailySchedule;
15956    /// let x = DailySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
15957    /// let x = DailySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
15958    /// ```
15959    pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
15960    where
15961        T: std::convert::Into<f64>,
15962    {
15963        self.snapshots_to_keep = v.map(|x| x.into());
15964        self
15965    }
15966
15967    /// Sets the value of [minute][crate::model::DailySchedule::minute].
15968    ///
15969    /// # Example
15970    /// ```ignore,no_run
15971    /// # use google_cloud_netapp_v1::model::DailySchedule;
15972    /// let x = DailySchedule::new().set_minute(42.0);
15973    /// ```
15974    pub fn set_minute<T>(mut self, v: T) -> Self
15975    where
15976        T: std::convert::Into<f64>,
15977    {
15978        self.minute = std::option::Option::Some(v.into());
15979        self
15980    }
15981
15982    /// Sets or clears the value of [minute][crate::model::DailySchedule::minute].
15983    ///
15984    /// # Example
15985    /// ```ignore,no_run
15986    /// # use google_cloud_netapp_v1::model::DailySchedule;
15987    /// let x = DailySchedule::new().set_or_clear_minute(Some(42.0));
15988    /// let x = DailySchedule::new().set_or_clear_minute(None::<f32>);
15989    /// ```
15990    pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
15991    where
15992        T: std::convert::Into<f64>,
15993    {
15994        self.minute = v.map(|x| x.into());
15995        self
15996    }
15997
15998    /// Sets the value of [hour][crate::model::DailySchedule::hour].
15999    ///
16000    /// # Example
16001    /// ```ignore,no_run
16002    /// # use google_cloud_netapp_v1::model::DailySchedule;
16003    /// let x = DailySchedule::new().set_hour(42.0);
16004    /// ```
16005    pub fn set_hour<T>(mut self, v: T) -> Self
16006    where
16007        T: std::convert::Into<f64>,
16008    {
16009        self.hour = std::option::Option::Some(v.into());
16010        self
16011    }
16012
16013    /// Sets or clears the value of [hour][crate::model::DailySchedule::hour].
16014    ///
16015    /// # Example
16016    /// ```ignore,no_run
16017    /// # use google_cloud_netapp_v1::model::DailySchedule;
16018    /// let x = DailySchedule::new().set_or_clear_hour(Some(42.0));
16019    /// let x = DailySchedule::new().set_or_clear_hour(None::<f32>);
16020    /// ```
16021    pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
16022    where
16023        T: std::convert::Into<f64>,
16024    {
16025        self.hour = v.map(|x| x.into());
16026        self
16027    }
16028}
16029
16030impl wkt::message::Message for DailySchedule {
16031    fn typename() -> &'static str {
16032        "type.googleapis.com/google.cloud.netapp.v1.DailySchedule"
16033    }
16034}
16035
16036/// Make a snapshot every week e.g. at Monday 04:00, Wednesday 05:20, Sunday
16037/// 23:50
16038#[derive(Clone, Default, PartialEq)]
16039#[non_exhaustive]
16040pub struct WeeklySchedule {
16041    /// The maximum number of Snapshots to keep for the hourly schedule
16042    pub snapshots_to_keep: std::option::Option<f64>,
16043
16044    /// Set the minute of the hour to start the snapshot (0-59), defaults to the
16045    /// top of the hour (0).
16046    pub minute: std::option::Option<f64>,
16047
16048    /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
16049    pub hour: std::option::Option<f64>,
16050
16051    /// Set the day or days of the week to make a snapshot. Accepts a comma
16052    /// separated days of the week. Defaults to 'Sunday'.
16053    pub day: std::option::Option<std::string::String>,
16054
16055    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16056}
16057
16058impl WeeklySchedule {
16059    /// Creates a new default instance.
16060    pub fn new() -> Self {
16061        std::default::Default::default()
16062    }
16063
16064    /// Sets the value of [snapshots_to_keep][crate::model::WeeklySchedule::snapshots_to_keep].
16065    ///
16066    /// # Example
16067    /// ```ignore,no_run
16068    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
16069    /// let x = WeeklySchedule::new().set_snapshots_to_keep(42.0);
16070    /// ```
16071    pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
16072    where
16073        T: std::convert::Into<f64>,
16074    {
16075        self.snapshots_to_keep = std::option::Option::Some(v.into());
16076        self
16077    }
16078
16079    /// Sets or clears the value of [snapshots_to_keep][crate::model::WeeklySchedule::snapshots_to_keep].
16080    ///
16081    /// # Example
16082    /// ```ignore,no_run
16083    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
16084    /// let x = WeeklySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
16085    /// let x = WeeklySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
16086    /// ```
16087    pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
16088    where
16089        T: std::convert::Into<f64>,
16090    {
16091        self.snapshots_to_keep = v.map(|x| x.into());
16092        self
16093    }
16094
16095    /// Sets the value of [minute][crate::model::WeeklySchedule::minute].
16096    ///
16097    /// # Example
16098    /// ```ignore,no_run
16099    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
16100    /// let x = WeeklySchedule::new().set_minute(42.0);
16101    /// ```
16102    pub fn set_minute<T>(mut self, v: T) -> Self
16103    where
16104        T: std::convert::Into<f64>,
16105    {
16106        self.minute = std::option::Option::Some(v.into());
16107        self
16108    }
16109
16110    /// Sets or clears the value of [minute][crate::model::WeeklySchedule::minute].
16111    ///
16112    /// # Example
16113    /// ```ignore,no_run
16114    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
16115    /// let x = WeeklySchedule::new().set_or_clear_minute(Some(42.0));
16116    /// let x = WeeklySchedule::new().set_or_clear_minute(None::<f32>);
16117    /// ```
16118    pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
16119    where
16120        T: std::convert::Into<f64>,
16121    {
16122        self.minute = v.map(|x| x.into());
16123        self
16124    }
16125
16126    /// Sets the value of [hour][crate::model::WeeklySchedule::hour].
16127    ///
16128    /// # Example
16129    /// ```ignore,no_run
16130    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
16131    /// let x = WeeklySchedule::new().set_hour(42.0);
16132    /// ```
16133    pub fn set_hour<T>(mut self, v: T) -> Self
16134    where
16135        T: std::convert::Into<f64>,
16136    {
16137        self.hour = std::option::Option::Some(v.into());
16138        self
16139    }
16140
16141    /// Sets or clears the value of [hour][crate::model::WeeklySchedule::hour].
16142    ///
16143    /// # Example
16144    /// ```ignore,no_run
16145    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
16146    /// let x = WeeklySchedule::new().set_or_clear_hour(Some(42.0));
16147    /// let x = WeeklySchedule::new().set_or_clear_hour(None::<f32>);
16148    /// ```
16149    pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
16150    where
16151        T: std::convert::Into<f64>,
16152    {
16153        self.hour = v.map(|x| x.into());
16154        self
16155    }
16156
16157    /// Sets the value of [day][crate::model::WeeklySchedule::day].
16158    ///
16159    /// # Example
16160    /// ```ignore,no_run
16161    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
16162    /// let x = WeeklySchedule::new().set_day("example");
16163    /// ```
16164    pub fn set_day<T>(mut self, v: T) -> Self
16165    where
16166        T: std::convert::Into<std::string::String>,
16167    {
16168        self.day = std::option::Option::Some(v.into());
16169        self
16170    }
16171
16172    /// Sets or clears the value of [day][crate::model::WeeklySchedule::day].
16173    ///
16174    /// # Example
16175    /// ```ignore,no_run
16176    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
16177    /// let x = WeeklySchedule::new().set_or_clear_day(Some("example"));
16178    /// let x = WeeklySchedule::new().set_or_clear_day(None::<String>);
16179    /// ```
16180    pub fn set_or_clear_day<T>(mut self, v: std::option::Option<T>) -> Self
16181    where
16182        T: std::convert::Into<std::string::String>,
16183    {
16184        self.day = v.map(|x| x.into());
16185        self
16186    }
16187}
16188
16189impl wkt::message::Message for WeeklySchedule {
16190    fn typename() -> &'static str {
16191        "type.googleapis.com/google.cloud.netapp.v1.WeeklySchedule"
16192    }
16193}
16194
16195/// Make a snapshot once a month e.g. at 2nd 04:00, 7th 05:20, 24th 23:50
16196#[derive(Clone, Default, PartialEq)]
16197#[non_exhaustive]
16198pub struct MonthlySchedule {
16199    /// The maximum number of Snapshots to keep for the hourly schedule
16200    pub snapshots_to_keep: std::option::Option<f64>,
16201
16202    /// Set the minute of the hour to start the snapshot (0-59), defaults to the
16203    /// top of the hour (0).
16204    pub minute: std::option::Option<f64>,
16205
16206    /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
16207    pub hour: std::option::Option<f64>,
16208
16209    /// Set the day or days of the month to make a snapshot (1-31). Accepts a
16210    /// comma separated number of days. Defaults to '1'.
16211    pub days_of_month: std::option::Option<std::string::String>,
16212
16213    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16214}
16215
16216impl MonthlySchedule {
16217    /// Creates a new default instance.
16218    pub fn new() -> Self {
16219        std::default::Default::default()
16220    }
16221
16222    /// Sets the value of [snapshots_to_keep][crate::model::MonthlySchedule::snapshots_to_keep].
16223    ///
16224    /// # Example
16225    /// ```ignore,no_run
16226    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
16227    /// let x = MonthlySchedule::new().set_snapshots_to_keep(42.0);
16228    /// ```
16229    pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
16230    where
16231        T: std::convert::Into<f64>,
16232    {
16233        self.snapshots_to_keep = std::option::Option::Some(v.into());
16234        self
16235    }
16236
16237    /// Sets or clears the value of [snapshots_to_keep][crate::model::MonthlySchedule::snapshots_to_keep].
16238    ///
16239    /// # Example
16240    /// ```ignore,no_run
16241    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
16242    /// let x = MonthlySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
16243    /// let x = MonthlySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
16244    /// ```
16245    pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
16246    where
16247        T: std::convert::Into<f64>,
16248    {
16249        self.snapshots_to_keep = v.map(|x| x.into());
16250        self
16251    }
16252
16253    /// Sets the value of [minute][crate::model::MonthlySchedule::minute].
16254    ///
16255    /// # Example
16256    /// ```ignore,no_run
16257    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
16258    /// let x = MonthlySchedule::new().set_minute(42.0);
16259    /// ```
16260    pub fn set_minute<T>(mut self, v: T) -> Self
16261    where
16262        T: std::convert::Into<f64>,
16263    {
16264        self.minute = std::option::Option::Some(v.into());
16265        self
16266    }
16267
16268    /// Sets or clears the value of [minute][crate::model::MonthlySchedule::minute].
16269    ///
16270    /// # Example
16271    /// ```ignore,no_run
16272    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
16273    /// let x = MonthlySchedule::new().set_or_clear_minute(Some(42.0));
16274    /// let x = MonthlySchedule::new().set_or_clear_minute(None::<f32>);
16275    /// ```
16276    pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
16277    where
16278        T: std::convert::Into<f64>,
16279    {
16280        self.minute = v.map(|x| x.into());
16281        self
16282    }
16283
16284    /// Sets the value of [hour][crate::model::MonthlySchedule::hour].
16285    ///
16286    /// # Example
16287    /// ```ignore,no_run
16288    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
16289    /// let x = MonthlySchedule::new().set_hour(42.0);
16290    /// ```
16291    pub fn set_hour<T>(mut self, v: T) -> Self
16292    where
16293        T: std::convert::Into<f64>,
16294    {
16295        self.hour = std::option::Option::Some(v.into());
16296        self
16297    }
16298
16299    /// Sets or clears the value of [hour][crate::model::MonthlySchedule::hour].
16300    ///
16301    /// # Example
16302    /// ```ignore,no_run
16303    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
16304    /// let x = MonthlySchedule::new().set_or_clear_hour(Some(42.0));
16305    /// let x = MonthlySchedule::new().set_or_clear_hour(None::<f32>);
16306    /// ```
16307    pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
16308    where
16309        T: std::convert::Into<f64>,
16310    {
16311        self.hour = v.map(|x| x.into());
16312        self
16313    }
16314
16315    /// Sets the value of [days_of_month][crate::model::MonthlySchedule::days_of_month].
16316    ///
16317    /// # Example
16318    /// ```ignore,no_run
16319    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
16320    /// let x = MonthlySchedule::new().set_days_of_month("example");
16321    /// ```
16322    pub fn set_days_of_month<T>(mut self, v: T) -> Self
16323    where
16324        T: std::convert::Into<std::string::String>,
16325    {
16326        self.days_of_month = std::option::Option::Some(v.into());
16327        self
16328    }
16329
16330    /// Sets or clears the value of [days_of_month][crate::model::MonthlySchedule::days_of_month].
16331    ///
16332    /// # Example
16333    /// ```ignore,no_run
16334    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
16335    /// let x = MonthlySchedule::new().set_or_clear_days_of_month(Some("example"));
16336    /// let x = MonthlySchedule::new().set_or_clear_days_of_month(None::<String>);
16337    /// ```
16338    pub fn set_or_clear_days_of_month<T>(mut self, v: std::option::Option<T>) -> Self
16339    where
16340        T: std::convert::Into<std::string::String>,
16341    {
16342        self.days_of_month = v.map(|x| x.into());
16343        self
16344    }
16345}
16346
16347impl wkt::message::Message for MonthlySchedule {
16348    fn typename() -> &'static str {
16349        "type.googleapis.com/google.cloud.netapp.v1.MonthlySchedule"
16350    }
16351}
16352
16353/// View only mount options for a volume.
16354#[derive(Clone, Default, PartialEq)]
16355#[non_exhaustive]
16356pub struct MountOption {
16357    /// Export string
16358    pub export: std::string::String,
16359
16360    /// Full export string
16361    pub export_full: std::string::String,
16362
16363    /// Protocol to mount with.
16364    pub protocol: crate::model::Protocols,
16365
16366    /// Instructions for mounting
16367    pub instructions: std::string::String,
16368
16369    /// Output only. IP Address.
16370    pub ip_address: std::string::String,
16371
16372    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16373}
16374
16375impl MountOption {
16376    /// Creates a new default instance.
16377    pub fn new() -> Self {
16378        std::default::Default::default()
16379    }
16380
16381    /// Sets the value of [export][crate::model::MountOption::export].
16382    ///
16383    /// # Example
16384    /// ```ignore,no_run
16385    /// # use google_cloud_netapp_v1::model::MountOption;
16386    /// let x = MountOption::new().set_export("example");
16387    /// ```
16388    pub fn set_export<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16389        self.export = v.into();
16390        self
16391    }
16392
16393    /// Sets the value of [export_full][crate::model::MountOption::export_full].
16394    ///
16395    /// # Example
16396    /// ```ignore,no_run
16397    /// # use google_cloud_netapp_v1::model::MountOption;
16398    /// let x = MountOption::new().set_export_full("example");
16399    /// ```
16400    pub fn set_export_full<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16401        self.export_full = v.into();
16402        self
16403    }
16404
16405    /// Sets the value of [protocol][crate::model::MountOption::protocol].
16406    ///
16407    /// # Example
16408    /// ```ignore,no_run
16409    /// # use google_cloud_netapp_v1::model::MountOption;
16410    /// use google_cloud_netapp_v1::model::Protocols;
16411    /// let x0 = MountOption::new().set_protocol(Protocols::Nfsv3);
16412    /// let x1 = MountOption::new().set_protocol(Protocols::Nfsv4);
16413    /// let x2 = MountOption::new().set_protocol(Protocols::Smb);
16414    /// ```
16415    pub fn set_protocol<T: std::convert::Into<crate::model::Protocols>>(mut self, v: T) -> Self {
16416        self.protocol = v.into();
16417        self
16418    }
16419
16420    /// Sets the value of [instructions][crate::model::MountOption::instructions].
16421    ///
16422    /// # Example
16423    /// ```ignore,no_run
16424    /// # use google_cloud_netapp_v1::model::MountOption;
16425    /// let x = MountOption::new().set_instructions("example");
16426    /// ```
16427    pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16428        self.instructions = v.into();
16429        self
16430    }
16431
16432    /// Sets the value of [ip_address][crate::model::MountOption::ip_address].
16433    ///
16434    /// # Example
16435    /// ```ignore,no_run
16436    /// # use google_cloud_netapp_v1::model::MountOption;
16437    /// let x = MountOption::new().set_ip_address("example");
16438    /// ```
16439    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16440        self.ip_address = v.into();
16441        self
16442    }
16443}
16444
16445impl wkt::message::Message for MountOption {
16446    fn typename() -> &'static str {
16447        "type.googleapis.com/google.cloud.netapp.v1.MountOption"
16448    }
16449}
16450
16451/// The RestoreParameters if volume is created from a snapshot or backup.
16452#[derive(Clone, Default, PartialEq)]
16453#[non_exhaustive]
16454pub struct RestoreParameters {
16455    /// The source that the volume is created from.
16456    pub source: std::option::Option<crate::model::restore_parameters::Source>,
16457
16458    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16459}
16460
16461impl RestoreParameters {
16462    /// Creates a new default instance.
16463    pub fn new() -> Self {
16464        std::default::Default::default()
16465    }
16466
16467    /// Sets the value of [source][crate::model::RestoreParameters::source].
16468    ///
16469    /// Note that all the setters affecting `source` are mutually
16470    /// exclusive.
16471    ///
16472    /// # Example
16473    /// ```ignore,no_run
16474    /// # use google_cloud_netapp_v1::model::RestoreParameters;
16475    /// use google_cloud_netapp_v1::model::restore_parameters::Source;
16476    /// let x = RestoreParameters::new().set_source(Some(Source::SourceSnapshot("example".to_string())));
16477    /// ```
16478    pub fn set_source<
16479        T: std::convert::Into<std::option::Option<crate::model::restore_parameters::Source>>,
16480    >(
16481        mut self,
16482        v: T,
16483    ) -> Self {
16484        self.source = v.into();
16485        self
16486    }
16487
16488    /// The value of [source][crate::model::RestoreParameters::source]
16489    /// if it holds a `SourceSnapshot`, `None` if the field is not set or
16490    /// holds a different branch.
16491    pub fn source_snapshot(&self) -> std::option::Option<&std::string::String> {
16492        #[allow(unreachable_patterns)]
16493        self.source.as_ref().and_then(|v| match v {
16494            crate::model::restore_parameters::Source::SourceSnapshot(v) => {
16495                std::option::Option::Some(v)
16496            }
16497            _ => std::option::Option::None,
16498        })
16499    }
16500
16501    /// Sets the value of [source][crate::model::RestoreParameters::source]
16502    /// to hold a `SourceSnapshot`.
16503    ///
16504    /// Note that all the setters affecting `source` are
16505    /// mutually exclusive.
16506    ///
16507    /// # Example
16508    /// ```ignore,no_run
16509    /// # use google_cloud_netapp_v1::model::RestoreParameters;
16510    /// let x = RestoreParameters::new().set_source_snapshot("example");
16511    /// assert!(x.source_snapshot().is_some());
16512    /// assert!(x.source_backup().is_none());
16513    /// ```
16514    pub fn set_source_snapshot<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16515        self.source = std::option::Option::Some(
16516            crate::model::restore_parameters::Source::SourceSnapshot(v.into()),
16517        );
16518        self
16519    }
16520
16521    /// The value of [source][crate::model::RestoreParameters::source]
16522    /// if it holds a `SourceBackup`, `None` if the field is not set or
16523    /// holds a different branch.
16524    pub fn source_backup(&self) -> std::option::Option<&std::string::String> {
16525        #[allow(unreachable_patterns)]
16526        self.source.as_ref().and_then(|v| match v {
16527            crate::model::restore_parameters::Source::SourceBackup(v) => {
16528                std::option::Option::Some(v)
16529            }
16530            _ => std::option::Option::None,
16531        })
16532    }
16533
16534    /// Sets the value of [source][crate::model::RestoreParameters::source]
16535    /// to hold a `SourceBackup`.
16536    ///
16537    /// Note that all the setters affecting `source` are
16538    /// mutually exclusive.
16539    ///
16540    /// # Example
16541    /// ```ignore,no_run
16542    /// # use google_cloud_netapp_v1::model::RestoreParameters;
16543    /// # let project_id = "project_id";
16544    /// # let location_id = "location_id";
16545    /// # let backup_vault_id = "backup_vault_id";
16546    /// # let backup_id = "backup_id";
16547    /// let x = RestoreParameters::new().set_source_backup(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}/backups/{backup_id}"));
16548    /// assert!(x.source_backup().is_some());
16549    /// assert!(x.source_snapshot().is_none());
16550    /// ```
16551    pub fn set_source_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16552        self.source = std::option::Option::Some(
16553            crate::model::restore_parameters::Source::SourceBackup(v.into()),
16554        );
16555        self
16556    }
16557}
16558
16559impl wkt::message::Message for RestoreParameters {
16560    fn typename() -> &'static str {
16561        "type.googleapis.com/google.cloud.netapp.v1.RestoreParameters"
16562    }
16563}
16564
16565/// Defines additional types related to [RestoreParameters].
16566pub mod restore_parameters {
16567    #[allow(unused_imports)]
16568    use super::*;
16569
16570    /// The source that the volume is created from.
16571    #[derive(Clone, Debug, PartialEq)]
16572    #[non_exhaustive]
16573    pub enum Source {
16574        /// Full name of the snapshot resource.
16575        /// Format:
16576        /// projects/{project}/locations/{location}/volumes/{volume}/snapshots/{snapshot}
16577        SourceSnapshot(std::string::String),
16578        /// Full name of the backup resource.
16579        /// Format for standard backup:
16580        /// projects/{project}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}
16581        /// Format for BackupDR backup:
16582        /// projects/{project}/locations/{location}/backupVaults/{backup_vault}/dataSources/{data_source}/backups/{backup}
16583        SourceBackup(std::string::String),
16584    }
16585}
16586
16587/// BackupConfig contains backup related config on a volume.
16588#[derive(Clone, Default, PartialEq)]
16589#[non_exhaustive]
16590pub struct BackupConfig {
16591    /// Optional. When specified, schedule backups will be created based on the
16592    /// policy configuration.
16593    pub backup_policies: std::vec::Vec<std::string::String>,
16594
16595    /// Optional. Name of backup vault.
16596    /// Format:
16597    /// projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}
16598    pub backup_vault: std::string::String,
16599
16600    /// Optional. When set to true, scheduled backup is enabled on the volume.
16601    /// This field should be nil when there's no backup policy attached.
16602    pub scheduled_backup_enabled: std::option::Option<bool>,
16603
16604    /// Output only. Total size of all backups in a chain in bytes = baseline
16605    /// backup size + sum(incremental backup size).
16606    pub backup_chain_bytes: std::option::Option<i64>,
16607
16608    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16609}
16610
16611impl BackupConfig {
16612    /// Creates a new default instance.
16613    pub fn new() -> Self {
16614        std::default::Default::default()
16615    }
16616
16617    /// Sets the value of [backup_policies][crate::model::BackupConfig::backup_policies].
16618    ///
16619    /// # Example
16620    /// ```ignore,no_run
16621    /// # use google_cloud_netapp_v1::model::BackupConfig;
16622    /// let x = BackupConfig::new().set_backup_policies(["a", "b", "c"]);
16623    /// ```
16624    pub fn set_backup_policies<T, V>(mut self, v: T) -> Self
16625    where
16626        T: std::iter::IntoIterator<Item = V>,
16627        V: std::convert::Into<std::string::String>,
16628    {
16629        use std::iter::Iterator;
16630        self.backup_policies = v.into_iter().map(|i| i.into()).collect();
16631        self
16632    }
16633
16634    /// Sets the value of [backup_vault][crate::model::BackupConfig::backup_vault].
16635    ///
16636    /// # Example
16637    /// ```ignore,no_run
16638    /// # use google_cloud_netapp_v1::model::BackupConfig;
16639    /// # let project_id = "project_id";
16640    /// # let location_id = "location_id";
16641    /// # let backup_vault_id = "backup_vault_id";
16642    /// let x = BackupConfig::new().set_backup_vault(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}"));
16643    /// ```
16644    pub fn set_backup_vault<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16645        self.backup_vault = v.into();
16646        self
16647    }
16648
16649    /// Sets the value of [scheduled_backup_enabled][crate::model::BackupConfig::scheduled_backup_enabled].
16650    ///
16651    /// # Example
16652    /// ```ignore,no_run
16653    /// # use google_cloud_netapp_v1::model::BackupConfig;
16654    /// let x = BackupConfig::new().set_scheduled_backup_enabled(true);
16655    /// ```
16656    pub fn set_scheduled_backup_enabled<T>(mut self, v: T) -> Self
16657    where
16658        T: std::convert::Into<bool>,
16659    {
16660        self.scheduled_backup_enabled = std::option::Option::Some(v.into());
16661        self
16662    }
16663
16664    /// Sets or clears the value of [scheduled_backup_enabled][crate::model::BackupConfig::scheduled_backup_enabled].
16665    ///
16666    /// # Example
16667    /// ```ignore,no_run
16668    /// # use google_cloud_netapp_v1::model::BackupConfig;
16669    /// let x = BackupConfig::new().set_or_clear_scheduled_backup_enabled(Some(false));
16670    /// let x = BackupConfig::new().set_or_clear_scheduled_backup_enabled(None::<bool>);
16671    /// ```
16672    pub fn set_or_clear_scheduled_backup_enabled<T>(mut self, v: std::option::Option<T>) -> Self
16673    where
16674        T: std::convert::Into<bool>,
16675    {
16676        self.scheduled_backup_enabled = v.map(|x| x.into());
16677        self
16678    }
16679
16680    /// Sets the value of [backup_chain_bytes][crate::model::BackupConfig::backup_chain_bytes].
16681    ///
16682    /// # Example
16683    /// ```ignore,no_run
16684    /// # use google_cloud_netapp_v1::model::BackupConfig;
16685    /// let x = BackupConfig::new().set_backup_chain_bytes(42);
16686    /// ```
16687    pub fn set_backup_chain_bytes<T>(mut self, v: T) -> Self
16688    where
16689        T: std::convert::Into<i64>,
16690    {
16691        self.backup_chain_bytes = std::option::Option::Some(v.into());
16692        self
16693    }
16694
16695    /// Sets or clears the value of [backup_chain_bytes][crate::model::BackupConfig::backup_chain_bytes].
16696    ///
16697    /// # Example
16698    /// ```ignore,no_run
16699    /// # use google_cloud_netapp_v1::model::BackupConfig;
16700    /// let x = BackupConfig::new().set_or_clear_backup_chain_bytes(Some(42));
16701    /// let x = BackupConfig::new().set_or_clear_backup_chain_bytes(None::<i32>);
16702    /// ```
16703    pub fn set_or_clear_backup_chain_bytes<T>(mut self, v: std::option::Option<T>) -> Self
16704    where
16705        T: std::convert::Into<i64>,
16706    {
16707        self.backup_chain_bytes = v.map(|x| x.into());
16708        self
16709    }
16710}
16711
16712impl wkt::message::Message for BackupConfig {
16713    fn typename() -> &'static str {
16714        "type.googleapis.com/google.cloud.netapp.v1.BackupConfig"
16715    }
16716}
16717
16718/// Defines tiering policy for the volume.
16719#[derive(Clone, Default, PartialEq)]
16720#[non_exhaustive]
16721pub struct TieringPolicy {
16722    /// Optional. Flag indicating if the volume has tiering policy enable/pause.
16723    /// Default is PAUSED.
16724    pub tier_action: std::option::Option<crate::model::tiering_policy::TierAction>,
16725
16726    /// Optional. Time in days to mark the volume's data block as cold and make it
16727    /// eligible for tiering, can be range from 2-183. Default is 31.
16728    pub cooling_threshold_days: std::option::Option<i32>,
16729
16730    /// Optional. Flag indicating that the hot tier bypass mode is enabled. Default
16731    /// is false. This is only applicable to Flex service level.
16732    pub hot_tier_bypass_mode_enabled: std::option::Option<bool>,
16733
16734    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16735}
16736
16737impl TieringPolicy {
16738    /// Creates a new default instance.
16739    pub fn new() -> Self {
16740        std::default::Default::default()
16741    }
16742
16743    /// Sets the value of [tier_action][crate::model::TieringPolicy::tier_action].
16744    ///
16745    /// # Example
16746    /// ```ignore,no_run
16747    /// # use google_cloud_netapp_v1::model::TieringPolicy;
16748    /// use google_cloud_netapp_v1::model::tiering_policy::TierAction;
16749    /// let x0 = TieringPolicy::new().set_tier_action(TierAction::Enabled);
16750    /// let x1 = TieringPolicy::new().set_tier_action(TierAction::Paused);
16751    /// ```
16752    pub fn set_tier_action<T>(mut self, v: T) -> Self
16753    where
16754        T: std::convert::Into<crate::model::tiering_policy::TierAction>,
16755    {
16756        self.tier_action = std::option::Option::Some(v.into());
16757        self
16758    }
16759
16760    /// Sets or clears the value of [tier_action][crate::model::TieringPolicy::tier_action].
16761    ///
16762    /// # Example
16763    /// ```ignore,no_run
16764    /// # use google_cloud_netapp_v1::model::TieringPolicy;
16765    /// use google_cloud_netapp_v1::model::tiering_policy::TierAction;
16766    /// let x0 = TieringPolicy::new().set_or_clear_tier_action(Some(TierAction::Enabled));
16767    /// let x1 = TieringPolicy::new().set_or_clear_tier_action(Some(TierAction::Paused));
16768    /// let x_none = TieringPolicy::new().set_or_clear_tier_action(None::<TierAction>);
16769    /// ```
16770    pub fn set_or_clear_tier_action<T>(mut self, v: std::option::Option<T>) -> Self
16771    where
16772        T: std::convert::Into<crate::model::tiering_policy::TierAction>,
16773    {
16774        self.tier_action = v.map(|x| x.into());
16775        self
16776    }
16777
16778    /// Sets the value of [cooling_threshold_days][crate::model::TieringPolicy::cooling_threshold_days].
16779    ///
16780    /// # Example
16781    /// ```ignore,no_run
16782    /// # use google_cloud_netapp_v1::model::TieringPolicy;
16783    /// let x = TieringPolicy::new().set_cooling_threshold_days(42);
16784    /// ```
16785    pub fn set_cooling_threshold_days<T>(mut self, v: T) -> Self
16786    where
16787        T: std::convert::Into<i32>,
16788    {
16789        self.cooling_threshold_days = std::option::Option::Some(v.into());
16790        self
16791    }
16792
16793    /// Sets or clears the value of [cooling_threshold_days][crate::model::TieringPolicy::cooling_threshold_days].
16794    ///
16795    /// # Example
16796    /// ```ignore,no_run
16797    /// # use google_cloud_netapp_v1::model::TieringPolicy;
16798    /// let x = TieringPolicy::new().set_or_clear_cooling_threshold_days(Some(42));
16799    /// let x = TieringPolicy::new().set_or_clear_cooling_threshold_days(None::<i32>);
16800    /// ```
16801    pub fn set_or_clear_cooling_threshold_days<T>(mut self, v: std::option::Option<T>) -> Self
16802    where
16803        T: std::convert::Into<i32>,
16804    {
16805        self.cooling_threshold_days = v.map(|x| x.into());
16806        self
16807    }
16808
16809    /// Sets the value of [hot_tier_bypass_mode_enabled][crate::model::TieringPolicy::hot_tier_bypass_mode_enabled].
16810    ///
16811    /// # Example
16812    /// ```ignore,no_run
16813    /// # use google_cloud_netapp_v1::model::TieringPolicy;
16814    /// let x = TieringPolicy::new().set_hot_tier_bypass_mode_enabled(true);
16815    /// ```
16816    pub fn set_hot_tier_bypass_mode_enabled<T>(mut self, v: T) -> Self
16817    where
16818        T: std::convert::Into<bool>,
16819    {
16820        self.hot_tier_bypass_mode_enabled = std::option::Option::Some(v.into());
16821        self
16822    }
16823
16824    /// Sets or clears the value of [hot_tier_bypass_mode_enabled][crate::model::TieringPolicy::hot_tier_bypass_mode_enabled].
16825    ///
16826    /// # Example
16827    /// ```ignore,no_run
16828    /// # use google_cloud_netapp_v1::model::TieringPolicy;
16829    /// let x = TieringPolicy::new().set_or_clear_hot_tier_bypass_mode_enabled(Some(false));
16830    /// let x = TieringPolicy::new().set_or_clear_hot_tier_bypass_mode_enabled(None::<bool>);
16831    /// ```
16832    pub fn set_or_clear_hot_tier_bypass_mode_enabled<T>(mut self, v: std::option::Option<T>) -> Self
16833    where
16834        T: std::convert::Into<bool>,
16835    {
16836        self.hot_tier_bypass_mode_enabled = v.map(|x| x.into());
16837        self
16838    }
16839}
16840
16841impl wkt::message::Message for TieringPolicy {
16842    fn typename() -> &'static str {
16843        "type.googleapis.com/google.cloud.netapp.v1.TieringPolicy"
16844    }
16845}
16846
16847/// Defines additional types related to [TieringPolicy].
16848pub mod tiering_policy {
16849    #[allow(unused_imports)]
16850    use super::*;
16851
16852    /// Tier action for the volume.
16853    ///
16854    /// # Working with unknown values
16855    ///
16856    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16857    /// additional enum variants at any time. Adding new variants is not considered
16858    /// a breaking change. Applications should write their code in anticipation of:
16859    ///
16860    /// - New values appearing in future releases of the client library, **and**
16861    /// - New values received dynamically, without application changes.
16862    ///
16863    /// Please consult the [Working with enums] section in the user guide for some
16864    /// guidelines.
16865    ///
16866    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16867    #[derive(Clone, Debug, PartialEq)]
16868    #[non_exhaustive]
16869    pub enum TierAction {
16870        /// Unspecified.
16871        Unspecified,
16872        /// When tiering is enabled, new cold data will be tiered.
16873        Enabled,
16874        /// When paused, tiering won't be performed on new data. Existing data stays
16875        /// tiered until accessed.
16876        Paused,
16877        /// If set, the enum was initialized with an unknown value.
16878        ///
16879        /// Applications can examine the value using [TierAction::value] or
16880        /// [TierAction::name].
16881        UnknownValue(tier_action::UnknownValue),
16882    }
16883
16884    #[doc(hidden)]
16885    pub mod tier_action {
16886        #[allow(unused_imports)]
16887        use super::*;
16888        #[derive(Clone, Debug, PartialEq)]
16889        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16890    }
16891
16892    impl TierAction {
16893        /// Gets the enum value.
16894        ///
16895        /// Returns `None` if the enum contains an unknown value deserialized from
16896        /// the string representation of enums.
16897        pub fn value(&self) -> std::option::Option<i32> {
16898            match self {
16899                Self::Unspecified => std::option::Option::Some(0),
16900                Self::Enabled => std::option::Option::Some(1),
16901                Self::Paused => std::option::Option::Some(2),
16902                Self::UnknownValue(u) => u.0.value(),
16903            }
16904        }
16905
16906        /// Gets the enum value as a string.
16907        ///
16908        /// Returns `None` if the enum contains an unknown value deserialized from
16909        /// the integer representation of enums.
16910        pub fn name(&self) -> std::option::Option<&str> {
16911            match self {
16912                Self::Unspecified => std::option::Option::Some("TIER_ACTION_UNSPECIFIED"),
16913                Self::Enabled => std::option::Option::Some("ENABLED"),
16914                Self::Paused => std::option::Option::Some("PAUSED"),
16915                Self::UnknownValue(u) => u.0.name(),
16916            }
16917        }
16918    }
16919
16920    impl std::default::Default for TierAction {
16921        fn default() -> Self {
16922            use std::convert::From;
16923            Self::from(0)
16924        }
16925    }
16926
16927    impl std::fmt::Display for TierAction {
16928        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16929            wkt::internal::display_enum(f, self.name(), self.value())
16930        }
16931    }
16932
16933    impl std::convert::From<i32> for TierAction {
16934        fn from(value: i32) -> Self {
16935            match value {
16936                0 => Self::Unspecified,
16937                1 => Self::Enabled,
16938                2 => Self::Paused,
16939                _ => Self::UnknownValue(tier_action::UnknownValue(
16940                    wkt::internal::UnknownEnumValue::Integer(value),
16941                )),
16942            }
16943        }
16944    }
16945
16946    impl std::convert::From<&str> for TierAction {
16947        fn from(value: &str) -> Self {
16948            use std::string::ToString;
16949            match value {
16950                "TIER_ACTION_UNSPECIFIED" => Self::Unspecified,
16951                "ENABLED" => Self::Enabled,
16952                "PAUSED" => Self::Paused,
16953                _ => Self::UnknownValue(tier_action::UnknownValue(
16954                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16955                )),
16956            }
16957        }
16958    }
16959
16960    impl serde::ser::Serialize for TierAction {
16961        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16962        where
16963            S: serde::Serializer,
16964        {
16965            match self {
16966                Self::Unspecified => serializer.serialize_i32(0),
16967                Self::Enabled => serializer.serialize_i32(1),
16968                Self::Paused => serializer.serialize_i32(2),
16969                Self::UnknownValue(u) => u.0.serialize(serializer),
16970            }
16971        }
16972    }
16973
16974    impl<'de> serde::de::Deserialize<'de> for TierAction {
16975        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16976        where
16977            D: serde::Deserializer<'de>,
16978        {
16979            deserializer.deserialize_any(wkt::internal::EnumVisitor::<TierAction>::new(
16980                ".google.cloud.netapp.v1.TieringPolicy.TierAction",
16981            ))
16982        }
16983    }
16984}
16985
16986/// The Hybrid Replication parameters for the volume.
16987#[derive(Clone, Default, PartialEq)]
16988#[non_exhaustive]
16989pub struct HybridReplicationParameters {
16990    /// Required. Desired name for the replication of this volume.
16991    pub replication: std::string::String,
16992
16993    /// Required. Name of the user's local source volume to be peered with the
16994    /// destination volume.
16995    pub peer_volume_name: std::string::String,
16996
16997    /// Required. Name of the user's local source cluster to be peered with the
16998    /// destination cluster.
16999    pub peer_cluster_name: std::string::String,
17000
17001    /// Required. Name of the user's local source vserver svm to be peered with the
17002    /// destination vserver svm.
17003    pub peer_svm_name: std::string::String,
17004
17005    /// Required. List of node ip addresses to be peered with.
17006    pub peer_ip_addresses: std::vec::Vec<std::string::String>,
17007
17008    /// Optional. Name of source cluster location associated with the Hybrid
17009    /// replication. This is a free-form field for the display purpose only.
17010    pub cluster_location: std::string::String,
17011
17012    /// Optional. Description of the replication.
17013    pub description: std::string::String,
17014
17015    /// Optional. Labels to be added to the replication as the key value pairs.
17016    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
17017
17018    /// Optional. Replication Schedule for the replication created.
17019    pub replication_schedule: crate::model::HybridReplicationSchedule,
17020
17021    /// Optional. Type of the hybrid replication.
17022    pub hybrid_replication_type:
17023        crate::model::hybrid_replication_parameters::VolumeHybridReplicationType,
17024
17025    /// Optional. Constituent volume count for large volume.
17026    pub large_volume_constituent_count: i32,
17027
17028    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17029}
17030
17031impl HybridReplicationParameters {
17032    /// Creates a new default instance.
17033    pub fn new() -> Self {
17034        std::default::Default::default()
17035    }
17036
17037    /// Sets the value of [replication][crate::model::HybridReplicationParameters::replication].
17038    ///
17039    /// # Example
17040    /// ```ignore,no_run
17041    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
17042    /// # let project_id = "project_id";
17043    /// # let location_id = "location_id";
17044    /// # let volume_id = "volume_id";
17045    /// # let replication_id = "replication_id";
17046    /// let x = HybridReplicationParameters::new().set_replication(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/replications/{replication_id}"));
17047    /// ```
17048    pub fn set_replication<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17049        self.replication = v.into();
17050        self
17051    }
17052
17053    /// Sets the value of [peer_volume_name][crate::model::HybridReplicationParameters::peer_volume_name].
17054    ///
17055    /// # Example
17056    /// ```ignore,no_run
17057    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
17058    /// let x = HybridReplicationParameters::new().set_peer_volume_name("example");
17059    /// ```
17060    pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
17061        mut self,
17062        v: T,
17063    ) -> Self {
17064        self.peer_volume_name = v.into();
17065        self
17066    }
17067
17068    /// Sets the value of [peer_cluster_name][crate::model::HybridReplicationParameters::peer_cluster_name].
17069    ///
17070    /// # Example
17071    /// ```ignore,no_run
17072    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
17073    /// let x = HybridReplicationParameters::new().set_peer_cluster_name("example");
17074    /// ```
17075    pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
17076        mut self,
17077        v: T,
17078    ) -> Self {
17079        self.peer_cluster_name = v.into();
17080        self
17081    }
17082
17083    /// Sets the value of [peer_svm_name][crate::model::HybridReplicationParameters::peer_svm_name].
17084    ///
17085    /// # Example
17086    /// ```ignore,no_run
17087    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
17088    /// let x = HybridReplicationParameters::new().set_peer_svm_name("example");
17089    /// ```
17090    pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17091        self.peer_svm_name = v.into();
17092        self
17093    }
17094
17095    /// Sets the value of [peer_ip_addresses][crate::model::HybridReplicationParameters::peer_ip_addresses].
17096    ///
17097    /// # Example
17098    /// ```ignore,no_run
17099    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
17100    /// let x = HybridReplicationParameters::new().set_peer_ip_addresses(["a", "b", "c"]);
17101    /// ```
17102    pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
17103    where
17104        T: std::iter::IntoIterator<Item = V>,
17105        V: std::convert::Into<std::string::String>,
17106    {
17107        use std::iter::Iterator;
17108        self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
17109        self
17110    }
17111
17112    /// Sets the value of [cluster_location][crate::model::HybridReplicationParameters::cluster_location].
17113    ///
17114    /// # Example
17115    /// ```ignore,no_run
17116    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
17117    /// let x = HybridReplicationParameters::new().set_cluster_location("example");
17118    /// ```
17119    pub fn set_cluster_location<T: std::convert::Into<std::string::String>>(
17120        mut self,
17121        v: T,
17122    ) -> Self {
17123        self.cluster_location = v.into();
17124        self
17125    }
17126
17127    /// Sets the value of [description][crate::model::HybridReplicationParameters::description].
17128    ///
17129    /// # Example
17130    /// ```ignore,no_run
17131    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
17132    /// let x = HybridReplicationParameters::new().set_description("example");
17133    /// ```
17134    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17135        self.description = v.into();
17136        self
17137    }
17138
17139    /// Sets the value of [labels][crate::model::HybridReplicationParameters::labels].
17140    ///
17141    /// # Example
17142    /// ```ignore,no_run
17143    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
17144    /// let x = HybridReplicationParameters::new().set_labels([
17145    ///     ("key0", "abc"),
17146    ///     ("key1", "xyz"),
17147    /// ]);
17148    /// ```
17149    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
17150    where
17151        T: std::iter::IntoIterator<Item = (K, V)>,
17152        K: std::convert::Into<std::string::String>,
17153        V: std::convert::Into<std::string::String>,
17154    {
17155        use std::iter::Iterator;
17156        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17157        self
17158    }
17159
17160    /// Sets the value of [replication_schedule][crate::model::HybridReplicationParameters::replication_schedule].
17161    ///
17162    /// # Example
17163    /// ```ignore,no_run
17164    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
17165    /// use google_cloud_netapp_v1::model::HybridReplicationSchedule;
17166    /// let x0 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Every10Minutes);
17167    /// let x1 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Hourly);
17168    /// let x2 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Daily);
17169    /// ```
17170    pub fn set_replication_schedule<
17171        T: std::convert::Into<crate::model::HybridReplicationSchedule>,
17172    >(
17173        mut self,
17174        v: T,
17175    ) -> Self {
17176        self.replication_schedule = v.into();
17177        self
17178    }
17179
17180    /// Sets the value of [hybrid_replication_type][crate::model::HybridReplicationParameters::hybrid_replication_type].
17181    ///
17182    /// # Example
17183    /// ```ignore,no_run
17184    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
17185    /// use google_cloud_netapp_v1::model::hybrid_replication_parameters::VolumeHybridReplicationType;
17186    /// let x0 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::Migration);
17187    /// let x1 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::ContinuousReplication);
17188    /// let x2 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::OnpremReplication);
17189    /// ```
17190    pub fn set_hybrid_replication_type<
17191        T: std::convert::Into<
17192                crate::model::hybrid_replication_parameters::VolumeHybridReplicationType,
17193            >,
17194    >(
17195        mut self,
17196        v: T,
17197    ) -> Self {
17198        self.hybrid_replication_type = v.into();
17199        self
17200    }
17201
17202    /// Sets the value of [large_volume_constituent_count][crate::model::HybridReplicationParameters::large_volume_constituent_count].
17203    ///
17204    /// # Example
17205    /// ```ignore,no_run
17206    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
17207    /// let x = HybridReplicationParameters::new().set_large_volume_constituent_count(42);
17208    /// ```
17209    pub fn set_large_volume_constituent_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17210        self.large_volume_constituent_count = v.into();
17211        self
17212    }
17213}
17214
17215impl wkt::message::Message for HybridReplicationParameters {
17216    fn typename() -> &'static str {
17217        "type.googleapis.com/google.cloud.netapp.v1.HybridReplicationParameters"
17218    }
17219}
17220
17221/// Defines additional types related to [HybridReplicationParameters].
17222pub mod hybrid_replication_parameters {
17223    #[allow(unused_imports)]
17224    use super::*;
17225
17226    /// Type of the volume's hybrid replication.
17227    ///
17228    /// # Working with unknown values
17229    ///
17230    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17231    /// additional enum variants at any time. Adding new variants is not considered
17232    /// a breaking change. Applications should write their code in anticipation of:
17233    ///
17234    /// - New values appearing in future releases of the client library, **and**
17235    /// - New values received dynamically, without application changes.
17236    ///
17237    /// Please consult the [Working with enums] section in the user guide for some
17238    /// guidelines.
17239    ///
17240    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17241    #[derive(Clone, Debug, PartialEq)]
17242    #[non_exhaustive]
17243    pub enum VolumeHybridReplicationType {
17244        /// Unspecified hybrid replication type.
17245        Unspecified,
17246        /// Hybrid replication type for migration.
17247        Migration,
17248        /// Hybrid replication type for continuous replication.
17249        ContinuousReplication,
17250        /// New field for reversible OnPrem replication, to be used for data
17251        /// protection.
17252        OnpremReplication,
17253        /// New field for reversible OnPrem replication, to be used for data
17254        /// protection.
17255        ReverseOnpremReplication,
17256        /// If set, the enum was initialized with an unknown value.
17257        ///
17258        /// Applications can examine the value using [VolumeHybridReplicationType::value] or
17259        /// [VolumeHybridReplicationType::name].
17260        UnknownValue(volume_hybrid_replication_type::UnknownValue),
17261    }
17262
17263    #[doc(hidden)]
17264    pub mod volume_hybrid_replication_type {
17265        #[allow(unused_imports)]
17266        use super::*;
17267        #[derive(Clone, Debug, PartialEq)]
17268        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17269    }
17270
17271    impl VolumeHybridReplicationType {
17272        /// Gets the enum value.
17273        ///
17274        /// Returns `None` if the enum contains an unknown value deserialized from
17275        /// the string representation of enums.
17276        pub fn value(&self) -> std::option::Option<i32> {
17277            match self {
17278                Self::Unspecified => std::option::Option::Some(0),
17279                Self::Migration => std::option::Option::Some(1),
17280                Self::ContinuousReplication => std::option::Option::Some(2),
17281                Self::OnpremReplication => std::option::Option::Some(3),
17282                Self::ReverseOnpremReplication => std::option::Option::Some(4),
17283                Self::UnknownValue(u) => u.0.value(),
17284            }
17285        }
17286
17287        /// Gets the enum value as a string.
17288        ///
17289        /// Returns `None` if the enum contains an unknown value deserialized from
17290        /// the integer representation of enums.
17291        pub fn name(&self) -> std::option::Option<&str> {
17292            match self {
17293                Self::Unspecified => {
17294                    std::option::Option::Some("VOLUME_HYBRID_REPLICATION_TYPE_UNSPECIFIED")
17295                }
17296                Self::Migration => std::option::Option::Some("MIGRATION"),
17297                Self::ContinuousReplication => std::option::Option::Some("CONTINUOUS_REPLICATION"),
17298                Self::OnpremReplication => std::option::Option::Some("ONPREM_REPLICATION"),
17299                Self::ReverseOnpremReplication => {
17300                    std::option::Option::Some("REVERSE_ONPREM_REPLICATION")
17301                }
17302                Self::UnknownValue(u) => u.0.name(),
17303            }
17304        }
17305    }
17306
17307    impl std::default::Default for VolumeHybridReplicationType {
17308        fn default() -> Self {
17309            use std::convert::From;
17310            Self::from(0)
17311        }
17312    }
17313
17314    impl std::fmt::Display for VolumeHybridReplicationType {
17315        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17316            wkt::internal::display_enum(f, self.name(), self.value())
17317        }
17318    }
17319
17320    impl std::convert::From<i32> for VolumeHybridReplicationType {
17321        fn from(value: i32) -> Self {
17322            match value {
17323                0 => Self::Unspecified,
17324                1 => Self::Migration,
17325                2 => Self::ContinuousReplication,
17326                3 => Self::OnpremReplication,
17327                4 => Self::ReverseOnpremReplication,
17328                _ => Self::UnknownValue(volume_hybrid_replication_type::UnknownValue(
17329                    wkt::internal::UnknownEnumValue::Integer(value),
17330                )),
17331            }
17332        }
17333    }
17334
17335    impl std::convert::From<&str> for VolumeHybridReplicationType {
17336        fn from(value: &str) -> Self {
17337            use std::string::ToString;
17338            match value {
17339                "VOLUME_HYBRID_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
17340                "MIGRATION" => Self::Migration,
17341                "CONTINUOUS_REPLICATION" => Self::ContinuousReplication,
17342                "ONPREM_REPLICATION" => Self::OnpremReplication,
17343                "REVERSE_ONPREM_REPLICATION" => Self::ReverseOnpremReplication,
17344                _ => Self::UnknownValue(volume_hybrid_replication_type::UnknownValue(
17345                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17346                )),
17347            }
17348        }
17349    }
17350
17351    impl serde::ser::Serialize for VolumeHybridReplicationType {
17352        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17353        where
17354            S: serde::Serializer,
17355        {
17356            match self {
17357                Self::Unspecified => serializer.serialize_i32(0),
17358                Self::Migration => serializer.serialize_i32(1),
17359                Self::ContinuousReplication => serializer.serialize_i32(2),
17360                Self::OnpremReplication => serializer.serialize_i32(3),
17361                Self::ReverseOnpremReplication => serializer.serialize_i32(4),
17362                Self::UnknownValue(u) => u.0.serialize(serializer),
17363            }
17364        }
17365    }
17366
17367    impl<'de> serde::de::Deserialize<'de> for VolumeHybridReplicationType {
17368        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17369        where
17370            D: serde::Deserializer<'de>,
17371        {
17372            deserializer.deserialize_any(wkt::internal::EnumVisitor::<VolumeHybridReplicationType>::new(
17373                ".google.cloud.netapp.v1.HybridReplicationParameters.VolumeHybridReplicationType"))
17374        }
17375    }
17376}
17377
17378/// Cache Parameters for the volume.
17379#[derive(Clone, Default, PartialEq)]
17380#[non_exhaustive]
17381pub struct CacheParameters {
17382    /// Required. Name of the origin volume for the cache volume.
17383    pub peer_volume_name: std::string::String,
17384
17385    /// Required. Name of the origin volume's ONTAP cluster.
17386    pub peer_cluster_name: std::string::String,
17387
17388    /// Required. Name of the origin volume's SVM.
17389    pub peer_svm_name: std::string::String,
17390
17391    /// Required. List of IC LIF addresses of the origin volume's ONTAP cluster.
17392    pub peer_ip_addresses: std::vec::Vec<std::string::String>,
17393
17394    /// Optional. Indicates whether the cache volume has global file lock enabled.
17395    pub enable_global_file_lock: std::option::Option<bool>,
17396
17397    /// Optional. Configuration of the cache volume.
17398    pub cache_config: std::option::Option<crate::model::CacheConfig>,
17399
17400    /// Output only. State of the cache volume indicating the peering status.
17401    pub cache_state: crate::model::cache_parameters::CacheState,
17402
17403    /// Output only. Copy-paste-able commands to be used on user's ONTAP to accept
17404    /// peering requests.
17405    pub command: std::string::String,
17406
17407    /// Optional. Expiration time for the peering command to be executed on user's
17408    /// ONTAP.
17409    pub peering_command_expiry_time: std::option::Option<wkt::Timestamp>,
17410
17411    /// Output only. Temporary passphrase generated to accept cluster peering
17412    /// command.
17413    pub passphrase: std::string::String,
17414
17415    /// Output only. Detailed description of the current cache state.
17416    pub state_details: std::string::String,
17417
17418    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17419}
17420
17421impl CacheParameters {
17422    /// Creates a new default instance.
17423    pub fn new() -> Self {
17424        std::default::Default::default()
17425    }
17426
17427    /// Sets the value of [peer_volume_name][crate::model::CacheParameters::peer_volume_name].
17428    ///
17429    /// # Example
17430    /// ```ignore,no_run
17431    /// # use google_cloud_netapp_v1::model::CacheParameters;
17432    /// let x = CacheParameters::new().set_peer_volume_name("example");
17433    /// ```
17434    pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
17435        mut self,
17436        v: T,
17437    ) -> Self {
17438        self.peer_volume_name = v.into();
17439        self
17440    }
17441
17442    /// Sets the value of [peer_cluster_name][crate::model::CacheParameters::peer_cluster_name].
17443    ///
17444    /// # Example
17445    /// ```ignore,no_run
17446    /// # use google_cloud_netapp_v1::model::CacheParameters;
17447    /// let x = CacheParameters::new().set_peer_cluster_name("example");
17448    /// ```
17449    pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
17450        mut self,
17451        v: T,
17452    ) -> Self {
17453        self.peer_cluster_name = v.into();
17454        self
17455    }
17456
17457    /// Sets the value of [peer_svm_name][crate::model::CacheParameters::peer_svm_name].
17458    ///
17459    /// # Example
17460    /// ```ignore,no_run
17461    /// # use google_cloud_netapp_v1::model::CacheParameters;
17462    /// let x = CacheParameters::new().set_peer_svm_name("example");
17463    /// ```
17464    pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17465        self.peer_svm_name = v.into();
17466        self
17467    }
17468
17469    /// Sets the value of [peer_ip_addresses][crate::model::CacheParameters::peer_ip_addresses].
17470    ///
17471    /// # Example
17472    /// ```ignore,no_run
17473    /// # use google_cloud_netapp_v1::model::CacheParameters;
17474    /// let x = CacheParameters::new().set_peer_ip_addresses(["a", "b", "c"]);
17475    /// ```
17476    pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
17477    where
17478        T: std::iter::IntoIterator<Item = V>,
17479        V: std::convert::Into<std::string::String>,
17480    {
17481        use std::iter::Iterator;
17482        self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
17483        self
17484    }
17485
17486    /// Sets the value of [enable_global_file_lock][crate::model::CacheParameters::enable_global_file_lock].
17487    ///
17488    /// # Example
17489    /// ```ignore,no_run
17490    /// # use google_cloud_netapp_v1::model::CacheParameters;
17491    /// let x = CacheParameters::new().set_enable_global_file_lock(true);
17492    /// ```
17493    pub fn set_enable_global_file_lock<T>(mut self, v: T) -> Self
17494    where
17495        T: std::convert::Into<bool>,
17496    {
17497        self.enable_global_file_lock = std::option::Option::Some(v.into());
17498        self
17499    }
17500
17501    /// Sets or clears the value of [enable_global_file_lock][crate::model::CacheParameters::enable_global_file_lock].
17502    ///
17503    /// # Example
17504    /// ```ignore,no_run
17505    /// # use google_cloud_netapp_v1::model::CacheParameters;
17506    /// let x = CacheParameters::new().set_or_clear_enable_global_file_lock(Some(false));
17507    /// let x = CacheParameters::new().set_or_clear_enable_global_file_lock(None::<bool>);
17508    /// ```
17509    pub fn set_or_clear_enable_global_file_lock<T>(mut self, v: std::option::Option<T>) -> Self
17510    where
17511        T: std::convert::Into<bool>,
17512    {
17513        self.enable_global_file_lock = v.map(|x| x.into());
17514        self
17515    }
17516
17517    /// Sets the value of [cache_config][crate::model::CacheParameters::cache_config].
17518    ///
17519    /// # Example
17520    /// ```ignore,no_run
17521    /// # use google_cloud_netapp_v1::model::CacheParameters;
17522    /// use google_cloud_netapp_v1::model::CacheConfig;
17523    /// let x = CacheParameters::new().set_cache_config(CacheConfig::default()/* use setters */);
17524    /// ```
17525    pub fn set_cache_config<T>(mut self, v: T) -> Self
17526    where
17527        T: std::convert::Into<crate::model::CacheConfig>,
17528    {
17529        self.cache_config = std::option::Option::Some(v.into());
17530        self
17531    }
17532
17533    /// Sets or clears the value of [cache_config][crate::model::CacheParameters::cache_config].
17534    ///
17535    /// # Example
17536    /// ```ignore,no_run
17537    /// # use google_cloud_netapp_v1::model::CacheParameters;
17538    /// use google_cloud_netapp_v1::model::CacheConfig;
17539    /// let x = CacheParameters::new().set_or_clear_cache_config(Some(CacheConfig::default()/* use setters */));
17540    /// let x = CacheParameters::new().set_or_clear_cache_config(None::<CacheConfig>);
17541    /// ```
17542    pub fn set_or_clear_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
17543    where
17544        T: std::convert::Into<crate::model::CacheConfig>,
17545    {
17546        self.cache_config = v.map(|x| x.into());
17547        self
17548    }
17549
17550    /// Sets the value of [cache_state][crate::model::CacheParameters::cache_state].
17551    ///
17552    /// # Example
17553    /// ```ignore,no_run
17554    /// # use google_cloud_netapp_v1::model::CacheParameters;
17555    /// use google_cloud_netapp_v1::model::cache_parameters::CacheState;
17556    /// let x0 = CacheParameters::new().set_cache_state(CacheState::PendingClusterPeering);
17557    /// let x1 = CacheParameters::new().set_cache_state(CacheState::PendingSvmPeering);
17558    /// let x2 = CacheParameters::new().set_cache_state(CacheState::Peered);
17559    /// ```
17560    pub fn set_cache_state<T: std::convert::Into<crate::model::cache_parameters::CacheState>>(
17561        mut self,
17562        v: T,
17563    ) -> Self {
17564        self.cache_state = v.into();
17565        self
17566    }
17567
17568    /// Sets the value of [command][crate::model::CacheParameters::command].
17569    ///
17570    /// # Example
17571    /// ```ignore,no_run
17572    /// # use google_cloud_netapp_v1::model::CacheParameters;
17573    /// let x = CacheParameters::new().set_command("example");
17574    /// ```
17575    pub fn set_command<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17576        self.command = v.into();
17577        self
17578    }
17579
17580    /// Sets the value of [peering_command_expiry_time][crate::model::CacheParameters::peering_command_expiry_time].
17581    ///
17582    /// # Example
17583    /// ```ignore,no_run
17584    /// # use google_cloud_netapp_v1::model::CacheParameters;
17585    /// use wkt::Timestamp;
17586    /// let x = CacheParameters::new().set_peering_command_expiry_time(Timestamp::default()/* use setters */);
17587    /// ```
17588    pub fn set_peering_command_expiry_time<T>(mut self, v: T) -> Self
17589    where
17590        T: std::convert::Into<wkt::Timestamp>,
17591    {
17592        self.peering_command_expiry_time = std::option::Option::Some(v.into());
17593        self
17594    }
17595
17596    /// Sets or clears the value of [peering_command_expiry_time][crate::model::CacheParameters::peering_command_expiry_time].
17597    ///
17598    /// # Example
17599    /// ```ignore,no_run
17600    /// # use google_cloud_netapp_v1::model::CacheParameters;
17601    /// use wkt::Timestamp;
17602    /// let x = CacheParameters::new().set_or_clear_peering_command_expiry_time(Some(Timestamp::default()/* use setters */));
17603    /// let x = CacheParameters::new().set_or_clear_peering_command_expiry_time(None::<Timestamp>);
17604    /// ```
17605    pub fn set_or_clear_peering_command_expiry_time<T>(mut self, v: std::option::Option<T>) -> Self
17606    where
17607        T: std::convert::Into<wkt::Timestamp>,
17608    {
17609        self.peering_command_expiry_time = v.map(|x| x.into());
17610        self
17611    }
17612
17613    /// Sets the value of [passphrase][crate::model::CacheParameters::passphrase].
17614    ///
17615    /// # Example
17616    /// ```ignore,no_run
17617    /// # use google_cloud_netapp_v1::model::CacheParameters;
17618    /// let x = CacheParameters::new().set_passphrase("example");
17619    /// ```
17620    pub fn set_passphrase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17621        self.passphrase = v.into();
17622        self
17623    }
17624
17625    /// Sets the value of [state_details][crate::model::CacheParameters::state_details].
17626    ///
17627    /// # Example
17628    /// ```ignore,no_run
17629    /// # use google_cloud_netapp_v1::model::CacheParameters;
17630    /// let x = CacheParameters::new().set_state_details("example");
17631    /// ```
17632    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17633        self.state_details = v.into();
17634        self
17635    }
17636}
17637
17638impl wkt::message::Message for CacheParameters {
17639    fn typename() -> &'static str {
17640        "type.googleapis.com/google.cloud.netapp.v1.CacheParameters"
17641    }
17642}
17643
17644/// Defines additional types related to [CacheParameters].
17645pub mod cache_parameters {
17646    #[allow(unused_imports)]
17647    use super::*;
17648
17649    /// State of the cache volume indicating the peering status.
17650    ///
17651    /// # Working with unknown values
17652    ///
17653    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17654    /// additional enum variants at any time. Adding new variants is not considered
17655    /// a breaking change. Applications should write their code in anticipation of:
17656    ///
17657    /// - New values appearing in future releases of the client library, **and**
17658    /// - New values received dynamically, without application changes.
17659    ///
17660    /// Please consult the [Working with enums] section in the user guide for some
17661    /// guidelines.
17662    ///
17663    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17664    #[derive(Clone, Debug, PartialEq)]
17665    #[non_exhaustive]
17666    pub enum CacheState {
17667        /// Default unspecified state.
17668        Unspecified,
17669        /// State indicating waiting for cluster peering to be established.
17670        PendingClusterPeering,
17671        /// State indicating waiting for SVM peering to be established.
17672        PendingSvmPeering,
17673        /// State indicating successful establishment of peering with origin
17674        /// volumes's ONTAP cluster.
17675        Peered,
17676        /// Terminal state wherein peering with origin volume's ONTAP cluster
17677        /// has failed.
17678        Error,
17679        /// If set, the enum was initialized with an unknown value.
17680        ///
17681        /// Applications can examine the value using [CacheState::value] or
17682        /// [CacheState::name].
17683        UnknownValue(cache_state::UnknownValue),
17684    }
17685
17686    #[doc(hidden)]
17687    pub mod cache_state {
17688        #[allow(unused_imports)]
17689        use super::*;
17690        #[derive(Clone, Debug, PartialEq)]
17691        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17692    }
17693
17694    impl CacheState {
17695        /// Gets the enum value.
17696        ///
17697        /// Returns `None` if the enum contains an unknown value deserialized from
17698        /// the string representation of enums.
17699        pub fn value(&self) -> std::option::Option<i32> {
17700            match self {
17701                Self::Unspecified => std::option::Option::Some(0),
17702                Self::PendingClusterPeering => std::option::Option::Some(1),
17703                Self::PendingSvmPeering => std::option::Option::Some(2),
17704                Self::Peered => std::option::Option::Some(3),
17705                Self::Error => std::option::Option::Some(4),
17706                Self::UnknownValue(u) => u.0.value(),
17707            }
17708        }
17709
17710        /// Gets the enum value as a string.
17711        ///
17712        /// Returns `None` if the enum contains an unknown value deserialized from
17713        /// the integer representation of enums.
17714        pub fn name(&self) -> std::option::Option<&str> {
17715            match self {
17716                Self::Unspecified => std::option::Option::Some("CACHE_STATE_UNSPECIFIED"),
17717                Self::PendingClusterPeering => std::option::Option::Some("PENDING_CLUSTER_PEERING"),
17718                Self::PendingSvmPeering => std::option::Option::Some("PENDING_SVM_PEERING"),
17719                Self::Peered => std::option::Option::Some("PEERED"),
17720                Self::Error => std::option::Option::Some("ERROR"),
17721                Self::UnknownValue(u) => u.0.name(),
17722            }
17723        }
17724    }
17725
17726    impl std::default::Default for CacheState {
17727        fn default() -> Self {
17728            use std::convert::From;
17729            Self::from(0)
17730        }
17731    }
17732
17733    impl std::fmt::Display for CacheState {
17734        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17735            wkt::internal::display_enum(f, self.name(), self.value())
17736        }
17737    }
17738
17739    impl std::convert::From<i32> for CacheState {
17740        fn from(value: i32) -> Self {
17741            match value {
17742                0 => Self::Unspecified,
17743                1 => Self::PendingClusterPeering,
17744                2 => Self::PendingSvmPeering,
17745                3 => Self::Peered,
17746                4 => Self::Error,
17747                _ => Self::UnknownValue(cache_state::UnknownValue(
17748                    wkt::internal::UnknownEnumValue::Integer(value),
17749                )),
17750            }
17751        }
17752    }
17753
17754    impl std::convert::From<&str> for CacheState {
17755        fn from(value: &str) -> Self {
17756            use std::string::ToString;
17757            match value {
17758                "CACHE_STATE_UNSPECIFIED" => Self::Unspecified,
17759                "PENDING_CLUSTER_PEERING" => Self::PendingClusterPeering,
17760                "PENDING_SVM_PEERING" => Self::PendingSvmPeering,
17761                "PEERED" => Self::Peered,
17762                "ERROR" => Self::Error,
17763                _ => Self::UnknownValue(cache_state::UnknownValue(
17764                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17765                )),
17766            }
17767        }
17768    }
17769
17770    impl serde::ser::Serialize for CacheState {
17771        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17772        where
17773            S: serde::Serializer,
17774        {
17775            match self {
17776                Self::Unspecified => serializer.serialize_i32(0),
17777                Self::PendingClusterPeering => serializer.serialize_i32(1),
17778                Self::PendingSvmPeering => serializer.serialize_i32(2),
17779                Self::Peered => serializer.serialize_i32(3),
17780                Self::Error => serializer.serialize_i32(4),
17781                Self::UnknownValue(u) => u.0.serialize(serializer),
17782            }
17783        }
17784    }
17785
17786    impl<'de> serde::de::Deserialize<'de> for CacheState {
17787        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17788        where
17789            D: serde::Deserializer<'de>,
17790        {
17791            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CacheState>::new(
17792                ".google.cloud.netapp.v1.CacheParameters.CacheState",
17793            ))
17794        }
17795    }
17796}
17797
17798/// Configuration of the cache volume.
17799#[derive(Clone, Default, PartialEq)]
17800#[non_exhaustive]
17801pub struct CacheConfig {
17802    /// Optional. Pre-populate cache volume with data from the origin volume.
17803    pub cache_pre_populate: std::option::Option<crate::model::CachePrePopulate>,
17804
17805    /// Optional. Flag indicating whether writeback is enabled for the FlexCache
17806    /// volume.
17807    pub writeback_enabled: std::option::Option<bool>,
17808
17809    /// Optional. Flag indicating whether a CIFS change notification is enabled for
17810    /// the FlexCache volume.
17811    pub cifs_change_notify_enabled: std::option::Option<bool>,
17812
17813    /// Output only. State of the prepopulation job indicating how the
17814    /// prepopulation is progressing.
17815    pub cache_pre_populate_state: crate::model::cache_config::CachePrePopulateState,
17816
17817    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17818}
17819
17820impl CacheConfig {
17821    /// Creates a new default instance.
17822    pub fn new() -> Self {
17823        std::default::Default::default()
17824    }
17825
17826    /// Sets the value of [cache_pre_populate][crate::model::CacheConfig::cache_pre_populate].
17827    ///
17828    /// # Example
17829    /// ```ignore,no_run
17830    /// # use google_cloud_netapp_v1::model::CacheConfig;
17831    /// use google_cloud_netapp_v1::model::CachePrePopulate;
17832    /// let x = CacheConfig::new().set_cache_pre_populate(CachePrePopulate::default()/* use setters */);
17833    /// ```
17834    pub fn set_cache_pre_populate<T>(mut self, v: T) -> Self
17835    where
17836        T: std::convert::Into<crate::model::CachePrePopulate>,
17837    {
17838        self.cache_pre_populate = std::option::Option::Some(v.into());
17839        self
17840    }
17841
17842    /// Sets or clears the value of [cache_pre_populate][crate::model::CacheConfig::cache_pre_populate].
17843    ///
17844    /// # Example
17845    /// ```ignore,no_run
17846    /// # use google_cloud_netapp_v1::model::CacheConfig;
17847    /// use google_cloud_netapp_v1::model::CachePrePopulate;
17848    /// let x = CacheConfig::new().set_or_clear_cache_pre_populate(Some(CachePrePopulate::default()/* use setters */));
17849    /// let x = CacheConfig::new().set_or_clear_cache_pre_populate(None::<CachePrePopulate>);
17850    /// ```
17851    pub fn set_or_clear_cache_pre_populate<T>(mut self, v: std::option::Option<T>) -> Self
17852    where
17853        T: std::convert::Into<crate::model::CachePrePopulate>,
17854    {
17855        self.cache_pre_populate = v.map(|x| x.into());
17856        self
17857    }
17858
17859    /// Sets the value of [writeback_enabled][crate::model::CacheConfig::writeback_enabled].
17860    ///
17861    /// # Example
17862    /// ```ignore,no_run
17863    /// # use google_cloud_netapp_v1::model::CacheConfig;
17864    /// let x = CacheConfig::new().set_writeback_enabled(true);
17865    /// ```
17866    pub fn set_writeback_enabled<T>(mut self, v: T) -> Self
17867    where
17868        T: std::convert::Into<bool>,
17869    {
17870        self.writeback_enabled = std::option::Option::Some(v.into());
17871        self
17872    }
17873
17874    /// Sets or clears the value of [writeback_enabled][crate::model::CacheConfig::writeback_enabled].
17875    ///
17876    /// # Example
17877    /// ```ignore,no_run
17878    /// # use google_cloud_netapp_v1::model::CacheConfig;
17879    /// let x = CacheConfig::new().set_or_clear_writeback_enabled(Some(false));
17880    /// let x = CacheConfig::new().set_or_clear_writeback_enabled(None::<bool>);
17881    /// ```
17882    pub fn set_or_clear_writeback_enabled<T>(mut self, v: std::option::Option<T>) -> Self
17883    where
17884        T: std::convert::Into<bool>,
17885    {
17886        self.writeback_enabled = v.map(|x| x.into());
17887        self
17888    }
17889
17890    /// Sets the value of [cifs_change_notify_enabled][crate::model::CacheConfig::cifs_change_notify_enabled].
17891    ///
17892    /// # Example
17893    /// ```ignore,no_run
17894    /// # use google_cloud_netapp_v1::model::CacheConfig;
17895    /// let x = CacheConfig::new().set_cifs_change_notify_enabled(true);
17896    /// ```
17897    pub fn set_cifs_change_notify_enabled<T>(mut self, v: T) -> Self
17898    where
17899        T: std::convert::Into<bool>,
17900    {
17901        self.cifs_change_notify_enabled = std::option::Option::Some(v.into());
17902        self
17903    }
17904
17905    /// Sets or clears the value of [cifs_change_notify_enabled][crate::model::CacheConfig::cifs_change_notify_enabled].
17906    ///
17907    /// # Example
17908    /// ```ignore,no_run
17909    /// # use google_cloud_netapp_v1::model::CacheConfig;
17910    /// let x = CacheConfig::new().set_or_clear_cifs_change_notify_enabled(Some(false));
17911    /// let x = CacheConfig::new().set_or_clear_cifs_change_notify_enabled(None::<bool>);
17912    /// ```
17913    pub fn set_or_clear_cifs_change_notify_enabled<T>(mut self, v: std::option::Option<T>) -> Self
17914    where
17915        T: std::convert::Into<bool>,
17916    {
17917        self.cifs_change_notify_enabled = v.map(|x| x.into());
17918        self
17919    }
17920
17921    /// Sets the value of [cache_pre_populate_state][crate::model::CacheConfig::cache_pre_populate_state].
17922    ///
17923    /// # Example
17924    /// ```ignore,no_run
17925    /// # use google_cloud_netapp_v1::model::CacheConfig;
17926    /// use google_cloud_netapp_v1::model::cache_config::CachePrePopulateState;
17927    /// let x0 = CacheConfig::new().set_cache_pre_populate_state(CachePrePopulateState::NotNeeded);
17928    /// let x1 = CacheConfig::new().set_cache_pre_populate_state(CachePrePopulateState::InProgress);
17929    /// let x2 = CacheConfig::new().set_cache_pre_populate_state(CachePrePopulateState::Complete);
17930    /// ```
17931    pub fn set_cache_pre_populate_state<
17932        T: std::convert::Into<crate::model::cache_config::CachePrePopulateState>,
17933    >(
17934        mut self,
17935        v: T,
17936    ) -> Self {
17937        self.cache_pre_populate_state = v.into();
17938        self
17939    }
17940}
17941
17942impl wkt::message::Message for CacheConfig {
17943    fn typename() -> &'static str {
17944        "type.googleapis.com/google.cloud.netapp.v1.CacheConfig"
17945    }
17946}
17947
17948/// Defines additional types related to [CacheConfig].
17949pub mod cache_config {
17950    #[allow(unused_imports)]
17951    use super::*;
17952
17953    /// State of the prepopulation job indicating how the prepopulation is
17954    /// progressing.
17955    ///
17956    /// # Working with unknown values
17957    ///
17958    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17959    /// additional enum variants at any time. Adding new variants is not considered
17960    /// a breaking change. Applications should write their code in anticipation of:
17961    ///
17962    /// - New values appearing in future releases of the client library, **and**
17963    /// - New values received dynamically, without application changes.
17964    ///
17965    /// Please consult the [Working with enums] section in the user guide for some
17966    /// guidelines.
17967    ///
17968    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17969    #[derive(Clone, Debug, PartialEq)]
17970    #[non_exhaustive]
17971    pub enum CachePrePopulateState {
17972        /// Default unspecified state.
17973        Unspecified,
17974        /// State representing when the most recent create or update request did not
17975        /// require a prepopulation job.
17976        NotNeeded,
17977        /// State representing when the most recent update request requested a
17978        /// prepopulation job but it has not yet completed.
17979        InProgress,
17980        /// State representing when the most recent update request requested a
17981        /// prepopulation job and it has completed successfully.
17982        Complete,
17983        /// State representing when the most recent update request requested a
17984        /// prepopulation job but the prepopulate job failed.
17985        Error,
17986        /// If set, the enum was initialized with an unknown value.
17987        ///
17988        /// Applications can examine the value using [CachePrePopulateState::value] or
17989        /// [CachePrePopulateState::name].
17990        UnknownValue(cache_pre_populate_state::UnknownValue),
17991    }
17992
17993    #[doc(hidden)]
17994    pub mod cache_pre_populate_state {
17995        #[allow(unused_imports)]
17996        use super::*;
17997        #[derive(Clone, Debug, PartialEq)]
17998        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17999    }
18000
18001    impl CachePrePopulateState {
18002        /// Gets the enum value.
18003        ///
18004        /// Returns `None` if the enum contains an unknown value deserialized from
18005        /// the string representation of enums.
18006        pub fn value(&self) -> std::option::Option<i32> {
18007            match self {
18008                Self::Unspecified => std::option::Option::Some(0),
18009                Self::NotNeeded => std::option::Option::Some(1),
18010                Self::InProgress => std::option::Option::Some(2),
18011                Self::Complete => std::option::Option::Some(3),
18012                Self::Error => std::option::Option::Some(4),
18013                Self::UnknownValue(u) => u.0.value(),
18014            }
18015        }
18016
18017        /// Gets the enum value as a string.
18018        ///
18019        /// Returns `None` if the enum contains an unknown value deserialized from
18020        /// the integer representation of enums.
18021        pub fn name(&self) -> std::option::Option<&str> {
18022            match self {
18023                Self::Unspecified => {
18024                    std::option::Option::Some("CACHE_PRE_POPULATE_STATE_UNSPECIFIED")
18025                }
18026                Self::NotNeeded => std::option::Option::Some("NOT_NEEDED"),
18027                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
18028                Self::Complete => std::option::Option::Some("COMPLETE"),
18029                Self::Error => std::option::Option::Some("ERROR"),
18030                Self::UnknownValue(u) => u.0.name(),
18031            }
18032        }
18033    }
18034
18035    impl std::default::Default for CachePrePopulateState {
18036        fn default() -> Self {
18037            use std::convert::From;
18038            Self::from(0)
18039        }
18040    }
18041
18042    impl std::fmt::Display for CachePrePopulateState {
18043        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18044            wkt::internal::display_enum(f, self.name(), self.value())
18045        }
18046    }
18047
18048    impl std::convert::From<i32> for CachePrePopulateState {
18049        fn from(value: i32) -> Self {
18050            match value {
18051                0 => Self::Unspecified,
18052                1 => Self::NotNeeded,
18053                2 => Self::InProgress,
18054                3 => Self::Complete,
18055                4 => Self::Error,
18056                _ => Self::UnknownValue(cache_pre_populate_state::UnknownValue(
18057                    wkt::internal::UnknownEnumValue::Integer(value),
18058                )),
18059            }
18060        }
18061    }
18062
18063    impl std::convert::From<&str> for CachePrePopulateState {
18064        fn from(value: &str) -> Self {
18065            use std::string::ToString;
18066            match value {
18067                "CACHE_PRE_POPULATE_STATE_UNSPECIFIED" => Self::Unspecified,
18068                "NOT_NEEDED" => Self::NotNeeded,
18069                "IN_PROGRESS" => Self::InProgress,
18070                "COMPLETE" => Self::Complete,
18071                "ERROR" => Self::Error,
18072                _ => Self::UnknownValue(cache_pre_populate_state::UnknownValue(
18073                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18074                )),
18075            }
18076        }
18077    }
18078
18079    impl serde::ser::Serialize for CachePrePopulateState {
18080        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18081        where
18082            S: serde::Serializer,
18083        {
18084            match self {
18085                Self::Unspecified => serializer.serialize_i32(0),
18086                Self::NotNeeded => serializer.serialize_i32(1),
18087                Self::InProgress => serializer.serialize_i32(2),
18088                Self::Complete => serializer.serialize_i32(3),
18089                Self::Error => serializer.serialize_i32(4),
18090                Self::UnknownValue(u) => u.0.serialize(serializer),
18091            }
18092        }
18093    }
18094
18095    impl<'de> serde::de::Deserialize<'de> for CachePrePopulateState {
18096        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18097        where
18098            D: serde::Deserializer<'de>,
18099        {
18100            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CachePrePopulateState>::new(
18101                ".google.cloud.netapp.v1.CacheConfig.CachePrePopulateState",
18102            ))
18103        }
18104    }
18105}
18106
18107/// Pre-populate cache volume with data from the origin volume.
18108#[derive(Clone, Default, PartialEq)]
18109#[non_exhaustive]
18110pub struct CachePrePopulate {
18111    /// Optional. List of directory-paths to be pre-populated for the FlexCache
18112    /// volume.
18113    pub path_list: std::vec::Vec<std::string::String>,
18114
18115    /// Optional. List of directory-paths to be excluded for pre-population for the
18116    /// FlexCache volume.
18117    pub exclude_path_list: std::vec::Vec<std::string::String>,
18118
18119    /// Optional. Flag indicating whether the directories listed with the
18120    /// `path_list` need to be recursively pre-populated.
18121    pub recursion: std::option::Option<bool>,
18122
18123    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18124}
18125
18126impl CachePrePopulate {
18127    /// Creates a new default instance.
18128    pub fn new() -> Self {
18129        std::default::Default::default()
18130    }
18131
18132    /// Sets the value of [path_list][crate::model::CachePrePopulate::path_list].
18133    ///
18134    /// # Example
18135    /// ```ignore,no_run
18136    /// # use google_cloud_netapp_v1::model::CachePrePopulate;
18137    /// let x = CachePrePopulate::new().set_path_list(["a", "b", "c"]);
18138    /// ```
18139    pub fn set_path_list<T, V>(mut self, v: T) -> Self
18140    where
18141        T: std::iter::IntoIterator<Item = V>,
18142        V: std::convert::Into<std::string::String>,
18143    {
18144        use std::iter::Iterator;
18145        self.path_list = v.into_iter().map(|i| i.into()).collect();
18146        self
18147    }
18148
18149    /// Sets the value of [exclude_path_list][crate::model::CachePrePopulate::exclude_path_list].
18150    ///
18151    /// # Example
18152    /// ```ignore,no_run
18153    /// # use google_cloud_netapp_v1::model::CachePrePopulate;
18154    /// let x = CachePrePopulate::new().set_exclude_path_list(["a", "b", "c"]);
18155    /// ```
18156    pub fn set_exclude_path_list<T, V>(mut self, v: T) -> Self
18157    where
18158        T: std::iter::IntoIterator<Item = V>,
18159        V: std::convert::Into<std::string::String>,
18160    {
18161        use std::iter::Iterator;
18162        self.exclude_path_list = v.into_iter().map(|i| i.into()).collect();
18163        self
18164    }
18165
18166    /// Sets the value of [recursion][crate::model::CachePrePopulate::recursion].
18167    ///
18168    /// # Example
18169    /// ```ignore,no_run
18170    /// # use google_cloud_netapp_v1::model::CachePrePopulate;
18171    /// let x = CachePrePopulate::new().set_recursion(true);
18172    /// ```
18173    pub fn set_recursion<T>(mut self, v: T) -> Self
18174    where
18175        T: std::convert::Into<bool>,
18176    {
18177        self.recursion = std::option::Option::Some(v.into());
18178        self
18179    }
18180
18181    /// Sets or clears the value of [recursion][crate::model::CachePrePopulate::recursion].
18182    ///
18183    /// # Example
18184    /// ```ignore,no_run
18185    /// # use google_cloud_netapp_v1::model::CachePrePopulate;
18186    /// let x = CachePrePopulate::new().set_or_clear_recursion(Some(false));
18187    /// let x = CachePrePopulate::new().set_or_clear_recursion(None::<bool>);
18188    /// ```
18189    pub fn set_or_clear_recursion<T>(mut self, v: std::option::Option<T>) -> Self
18190    where
18191        T: std::convert::Into<bool>,
18192    {
18193        self.recursion = v.map(|x| x.into());
18194        self
18195    }
18196}
18197
18198impl wkt::message::Message for CachePrePopulate {
18199    fn typename() -> &'static str {
18200        "type.googleapis.com/google.cloud.netapp.v1.CachePrePopulate"
18201    }
18202}
18203
18204/// Block device represents the device(s) which are stored in the block volume.
18205#[derive(Clone, Default, PartialEq)]
18206#[non_exhaustive]
18207pub struct BlockDevice {
18208    /// Optional. User-defined name for the block device, unique within the volume.
18209    /// In case no user input is provided, name will be auto-generated in the
18210    /// backend. The name must meet the following requirements:
18211    ///
18212    /// * Be between 1 and 255 characters long.
18213    /// * Contain only uppercase or lowercase letters (A-Z, a-z), numbers (0-9),
18214    ///   and the following special characters: "-", "_", "}", "{", ".".
18215    /// * Spaces are not allowed.
18216    pub name: std::option::Option<std::string::String>,
18217
18218    /// Optional. A list of host groups that identify hosts that can mount the
18219    /// block volume. Format:
18220    /// `projects/{project_id}/locations/{location}/hostGroups/{host_group_id}`
18221    /// This field can be updated after the block device is created.
18222    pub host_groups: std::vec::Vec<std::string::String>,
18223
18224    /// Output only. Device identifier of the block volume. This represents
18225    /// `lun_serial_number` for iSCSI volumes.
18226    pub identifier: std::string::String,
18227
18228    /// Optional. The size of the block device in GiB.
18229    /// Any value provided for the `size_gib` field during volume creation is
18230    /// ignored. The block device's size is system-managed and will be set to match
18231    /// the parent Volume's `capacity_gib`.
18232    pub size_gib: std::option::Option<i64>,
18233
18234    /// Required. Immutable. The OS type of the volume.
18235    /// This field can't be changed after the block device is created.
18236    pub os_type: crate::model::OsType,
18237
18238    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18239}
18240
18241impl BlockDevice {
18242    /// Creates a new default instance.
18243    pub fn new() -> Self {
18244        std::default::Default::default()
18245    }
18246
18247    /// Sets the value of [name][crate::model::BlockDevice::name].
18248    ///
18249    /// # Example
18250    /// ```ignore,no_run
18251    /// # use google_cloud_netapp_v1::model::BlockDevice;
18252    /// let x = BlockDevice::new().set_name("example");
18253    /// ```
18254    pub fn set_name<T>(mut self, v: T) -> Self
18255    where
18256        T: std::convert::Into<std::string::String>,
18257    {
18258        self.name = std::option::Option::Some(v.into());
18259        self
18260    }
18261
18262    /// Sets or clears the value of [name][crate::model::BlockDevice::name].
18263    ///
18264    /// # Example
18265    /// ```ignore,no_run
18266    /// # use google_cloud_netapp_v1::model::BlockDevice;
18267    /// let x = BlockDevice::new().set_or_clear_name(Some("example"));
18268    /// let x = BlockDevice::new().set_or_clear_name(None::<String>);
18269    /// ```
18270    pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
18271    where
18272        T: std::convert::Into<std::string::String>,
18273    {
18274        self.name = v.map(|x| x.into());
18275        self
18276    }
18277
18278    /// Sets the value of [host_groups][crate::model::BlockDevice::host_groups].
18279    ///
18280    /// # Example
18281    /// ```ignore,no_run
18282    /// # use google_cloud_netapp_v1::model::BlockDevice;
18283    /// let x = BlockDevice::new().set_host_groups(["a", "b", "c"]);
18284    /// ```
18285    pub fn set_host_groups<T, V>(mut self, v: T) -> Self
18286    where
18287        T: std::iter::IntoIterator<Item = V>,
18288        V: std::convert::Into<std::string::String>,
18289    {
18290        use std::iter::Iterator;
18291        self.host_groups = v.into_iter().map(|i| i.into()).collect();
18292        self
18293    }
18294
18295    /// Sets the value of [identifier][crate::model::BlockDevice::identifier].
18296    ///
18297    /// # Example
18298    /// ```ignore,no_run
18299    /// # use google_cloud_netapp_v1::model::BlockDevice;
18300    /// let x = BlockDevice::new().set_identifier("example");
18301    /// ```
18302    pub fn set_identifier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18303        self.identifier = v.into();
18304        self
18305    }
18306
18307    /// Sets the value of [size_gib][crate::model::BlockDevice::size_gib].
18308    ///
18309    /// # Example
18310    /// ```ignore,no_run
18311    /// # use google_cloud_netapp_v1::model::BlockDevice;
18312    /// let x = BlockDevice::new().set_size_gib(42);
18313    /// ```
18314    pub fn set_size_gib<T>(mut self, v: T) -> Self
18315    where
18316        T: std::convert::Into<i64>,
18317    {
18318        self.size_gib = std::option::Option::Some(v.into());
18319        self
18320    }
18321
18322    /// Sets or clears the value of [size_gib][crate::model::BlockDevice::size_gib].
18323    ///
18324    /// # Example
18325    /// ```ignore,no_run
18326    /// # use google_cloud_netapp_v1::model::BlockDevice;
18327    /// let x = BlockDevice::new().set_or_clear_size_gib(Some(42));
18328    /// let x = BlockDevice::new().set_or_clear_size_gib(None::<i32>);
18329    /// ```
18330    pub fn set_or_clear_size_gib<T>(mut self, v: std::option::Option<T>) -> Self
18331    where
18332        T: std::convert::Into<i64>,
18333    {
18334        self.size_gib = v.map(|x| x.into());
18335        self
18336    }
18337
18338    /// Sets the value of [os_type][crate::model::BlockDevice::os_type].
18339    ///
18340    /// # Example
18341    /// ```ignore,no_run
18342    /// # use google_cloud_netapp_v1::model::BlockDevice;
18343    /// use google_cloud_netapp_v1::model::OsType;
18344    /// let x0 = BlockDevice::new().set_os_type(OsType::Linux);
18345    /// let x1 = BlockDevice::new().set_os_type(OsType::Windows);
18346    /// let x2 = BlockDevice::new().set_os_type(OsType::Esxi);
18347    /// ```
18348    pub fn set_os_type<T: std::convert::Into<crate::model::OsType>>(mut self, v: T) -> Self {
18349        self.os_type = v.into();
18350        self
18351    }
18352}
18353
18354impl wkt::message::Message for BlockDevice {
18355    fn typename() -> &'static str {
18356        "type.googleapis.com/google.cloud.netapp.v1.BlockDevice"
18357    }
18358}
18359
18360/// RestoreBackupFilesRequest restores files from a backup to a volume.
18361#[derive(Clone, Default, PartialEq)]
18362#[non_exhaustive]
18363pub struct RestoreBackupFilesRequest {
18364    /// Required. The volume resource name, in the format
18365    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
18366    pub name: std::string::String,
18367
18368    /// Required. The backup resource name, in the format
18369    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
18370    pub backup: std::string::String,
18371
18372    /// Required. List of files to be restored, specified by their absolute path in
18373    /// the source volume.
18374    pub file_list: std::vec::Vec<std::string::String>,
18375
18376    /// Optional. Absolute directory path in the destination volume. This is
18377    /// required if the `file_list` is provided.
18378    pub restore_destination_path: std::string::String,
18379
18380    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18381}
18382
18383impl RestoreBackupFilesRequest {
18384    /// Creates a new default instance.
18385    pub fn new() -> Self {
18386        std::default::Default::default()
18387    }
18388
18389    /// Sets the value of [name][crate::model::RestoreBackupFilesRequest::name].
18390    ///
18391    /// # Example
18392    /// ```ignore,no_run
18393    /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
18394    /// # let project_id = "project_id";
18395    /// # let location_id = "location_id";
18396    /// # let volume_id = "volume_id";
18397    /// let x = RestoreBackupFilesRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
18398    /// ```
18399    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18400        self.name = v.into();
18401        self
18402    }
18403
18404    /// Sets the value of [backup][crate::model::RestoreBackupFilesRequest::backup].
18405    ///
18406    /// # Example
18407    /// ```ignore,no_run
18408    /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
18409    /// # let project_id = "project_id";
18410    /// # let location_id = "location_id";
18411    /// # let backup_vault_id = "backup_vault_id";
18412    /// # let backup_id = "backup_id";
18413    /// let x = RestoreBackupFilesRequest::new().set_backup(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}/backups/{backup_id}"));
18414    /// ```
18415    pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18416        self.backup = v.into();
18417        self
18418    }
18419
18420    /// Sets the value of [file_list][crate::model::RestoreBackupFilesRequest::file_list].
18421    ///
18422    /// # Example
18423    /// ```ignore,no_run
18424    /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
18425    /// let x = RestoreBackupFilesRequest::new().set_file_list(["a", "b", "c"]);
18426    /// ```
18427    pub fn set_file_list<T, V>(mut self, v: T) -> Self
18428    where
18429        T: std::iter::IntoIterator<Item = V>,
18430        V: std::convert::Into<std::string::String>,
18431    {
18432        use std::iter::Iterator;
18433        self.file_list = v.into_iter().map(|i| i.into()).collect();
18434        self
18435    }
18436
18437    /// Sets the value of [restore_destination_path][crate::model::RestoreBackupFilesRequest::restore_destination_path].
18438    ///
18439    /// # Example
18440    /// ```ignore,no_run
18441    /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
18442    /// let x = RestoreBackupFilesRequest::new().set_restore_destination_path("example");
18443    /// ```
18444    pub fn set_restore_destination_path<T: std::convert::Into<std::string::String>>(
18445        mut self,
18446        v: T,
18447    ) -> Self {
18448        self.restore_destination_path = v.into();
18449        self
18450    }
18451}
18452
18453impl wkt::message::Message for RestoreBackupFilesRequest {
18454    fn typename() -> &'static str {
18455        "type.googleapis.com/google.cloud.netapp.v1.RestoreBackupFilesRequest"
18456    }
18457}
18458
18459/// RestoreBackupFilesResponse is the result of RestoreBackupFilesRequest.
18460#[derive(Clone, Default, PartialEq)]
18461#[non_exhaustive]
18462pub struct RestoreBackupFilesResponse {
18463    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18464}
18465
18466impl RestoreBackupFilesResponse {
18467    /// Creates a new default instance.
18468    pub fn new() -> Self {
18469        std::default::Default::default()
18470    }
18471}
18472
18473impl wkt::message::Message for RestoreBackupFilesResponse {
18474    fn typename() -> &'static str {
18475        "type.googleapis.com/google.cloud.netapp.v1.RestoreBackupFilesResponse"
18476    }
18477}
18478
18479/// EstablishVolumePeeringRequest establishes cluster and svm peerings between
18480/// the source and destination clusters.
18481#[derive(Clone, Default, PartialEq)]
18482#[non_exhaustive]
18483pub struct EstablishVolumePeeringRequest {
18484    /// Required. The volume resource name, in the format
18485    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
18486    pub name: std::string::String,
18487
18488    /// Required. Name of the user's local source cluster to be peered with the
18489    /// destination cluster.
18490    pub peer_cluster_name: std::string::String,
18491
18492    /// Required. Name of the user's local source vserver svm to be peered with the
18493    /// destination vserver svm.
18494    pub peer_svm_name: std::string::String,
18495
18496    /// Optional. List of IPv4 ip addresses to be used for peering.
18497    pub peer_ip_addresses: std::vec::Vec<std::string::String>,
18498
18499    /// Required. Name of the user's local source volume to be peered with the
18500    /// destination volume.
18501    pub peer_volume_name: std::string::String,
18502
18503    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18504}
18505
18506impl EstablishVolumePeeringRequest {
18507    /// Creates a new default instance.
18508    pub fn new() -> Self {
18509        std::default::Default::default()
18510    }
18511
18512    /// Sets the value of [name][crate::model::EstablishVolumePeeringRequest::name].
18513    ///
18514    /// # Example
18515    /// ```ignore,no_run
18516    /// # use google_cloud_netapp_v1::model::EstablishVolumePeeringRequest;
18517    /// # let project_id = "project_id";
18518    /// # let location_id = "location_id";
18519    /// # let volume_id = "volume_id";
18520    /// let x = EstablishVolumePeeringRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
18521    /// ```
18522    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18523        self.name = v.into();
18524        self
18525    }
18526
18527    /// Sets the value of [peer_cluster_name][crate::model::EstablishVolumePeeringRequest::peer_cluster_name].
18528    ///
18529    /// # Example
18530    /// ```ignore,no_run
18531    /// # use google_cloud_netapp_v1::model::EstablishVolumePeeringRequest;
18532    /// let x = EstablishVolumePeeringRequest::new().set_peer_cluster_name("example");
18533    /// ```
18534    pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
18535        mut self,
18536        v: T,
18537    ) -> Self {
18538        self.peer_cluster_name = v.into();
18539        self
18540    }
18541
18542    /// Sets the value of [peer_svm_name][crate::model::EstablishVolumePeeringRequest::peer_svm_name].
18543    ///
18544    /// # Example
18545    /// ```ignore,no_run
18546    /// # use google_cloud_netapp_v1::model::EstablishVolumePeeringRequest;
18547    /// let x = EstablishVolumePeeringRequest::new().set_peer_svm_name("example");
18548    /// ```
18549    pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18550        self.peer_svm_name = v.into();
18551        self
18552    }
18553
18554    /// Sets the value of [peer_ip_addresses][crate::model::EstablishVolumePeeringRequest::peer_ip_addresses].
18555    ///
18556    /// # Example
18557    /// ```ignore,no_run
18558    /// # use google_cloud_netapp_v1::model::EstablishVolumePeeringRequest;
18559    /// let x = EstablishVolumePeeringRequest::new().set_peer_ip_addresses(["a", "b", "c"]);
18560    /// ```
18561    pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
18562    where
18563        T: std::iter::IntoIterator<Item = V>,
18564        V: std::convert::Into<std::string::String>,
18565    {
18566        use std::iter::Iterator;
18567        self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
18568        self
18569    }
18570
18571    /// Sets the value of [peer_volume_name][crate::model::EstablishVolumePeeringRequest::peer_volume_name].
18572    ///
18573    /// # Example
18574    /// ```ignore,no_run
18575    /// # use google_cloud_netapp_v1::model::EstablishVolumePeeringRequest;
18576    /// let x = EstablishVolumePeeringRequest::new().set_peer_volume_name("example");
18577    /// ```
18578    pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
18579        mut self,
18580        v: T,
18581    ) -> Self {
18582        self.peer_volume_name = v.into();
18583        self
18584    }
18585}
18586
18587impl wkt::message::Message for EstablishVolumePeeringRequest {
18588    fn typename() -> &'static str {
18589        "type.googleapis.com/google.cloud.netapp.v1.EstablishVolumePeeringRequest"
18590    }
18591}
18592
18593/// The service level of a storage pool and its volumes.
18594///
18595/// # Working with unknown values
18596///
18597/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18598/// additional enum variants at any time. Adding new variants is not considered
18599/// a breaking change. Applications should write their code in anticipation of:
18600///
18601/// - New values appearing in future releases of the client library, **and**
18602/// - New values received dynamically, without application changes.
18603///
18604/// Please consult the [Working with enums] section in the user guide for some
18605/// guidelines.
18606///
18607/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18608#[derive(Clone, Debug, PartialEq)]
18609#[non_exhaustive]
18610pub enum ServiceLevel {
18611    /// Unspecified service level.
18612    Unspecified,
18613    /// Premium service level.
18614    Premium,
18615    /// Extreme service level.
18616    Extreme,
18617    /// Standard service level.
18618    Standard,
18619    /// Flex service level.
18620    Flex,
18621    /// If set, the enum was initialized with an unknown value.
18622    ///
18623    /// Applications can examine the value using [ServiceLevel::value] or
18624    /// [ServiceLevel::name].
18625    UnknownValue(service_level::UnknownValue),
18626}
18627
18628#[doc(hidden)]
18629pub mod service_level {
18630    #[allow(unused_imports)]
18631    use super::*;
18632    #[derive(Clone, Debug, PartialEq)]
18633    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18634}
18635
18636impl ServiceLevel {
18637    /// Gets the enum value.
18638    ///
18639    /// Returns `None` if the enum contains an unknown value deserialized from
18640    /// the string representation of enums.
18641    pub fn value(&self) -> std::option::Option<i32> {
18642        match self {
18643            Self::Unspecified => std::option::Option::Some(0),
18644            Self::Premium => std::option::Option::Some(1),
18645            Self::Extreme => std::option::Option::Some(2),
18646            Self::Standard => std::option::Option::Some(3),
18647            Self::Flex => std::option::Option::Some(4),
18648            Self::UnknownValue(u) => u.0.value(),
18649        }
18650    }
18651
18652    /// Gets the enum value as a string.
18653    ///
18654    /// Returns `None` if the enum contains an unknown value deserialized from
18655    /// the integer representation of enums.
18656    pub fn name(&self) -> std::option::Option<&str> {
18657        match self {
18658            Self::Unspecified => std::option::Option::Some("SERVICE_LEVEL_UNSPECIFIED"),
18659            Self::Premium => std::option::Option::Some("PREMIUM"),
18660            Self::Extreme => std::option::Option::Some("EXTREME"),
18661            Self::Standard => std::option::Option::Some("STANDARD"),
18662            Self::Flex => std::option::Option::Some("FLEX"),
18663            Self::UnknownValue(u) => u.0.name(),
18664        }
18665    }
18666}
18667
18668impl std::default::Default for ServiceLevel {
18669    fn default() -> Self {
18670        use std::convert::From;
18671        Self::from(0)
18672    }
18673}
18674
18675impl std::fmt::Display for ServiceLevel {
18676    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18677        wkt::internal::display_enum(f, self.name(), self.value())
18678    }
18679}
18680
18681impl std::convert::From<i32> for ServiceLevel {
18682    fn from(value: i32) -> Self {
18683        match value {
18684            0 => Self::Unspecified,
18685            1 => Self::Premium,
18686            2 => Self::Extreme,
18687            3 => Self::Standard,
18688            4 => Self::Flex,
18689            _ => Self::UnknownValue(service_level::UnknownValue(
18690                wkt::internal::UnknownEnumValue::Integer(value),
18691            )),
18692        }
18693    }
18694}
18695
18696impl std::convert::From<&str> for ServiceLevel {
18697    fn from(value: &str) -> Self {
18698        use std::string::ToString;
18699        match value {
18700            "SERVICE_LEVEL_UNSPECIFIED" => Self::Unspecified,
18701            "PREMIUM" => Self::Premium,
18702            "EXTREME" => Self::Extreme,
18703            "STANDARD" => Self::Standard,
18704            "FLEX" => Self::Flex,
18705            _ => Self::UnknownValue(service_level::UnknownValue(
18706                wkt::internal::UnknownEnumValue::String(value.to_string()),
18707            )),
18708        }
18709    }
18710}
18711
18712impl serde::ser::Serialize for ServiceLevel {
18713    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18714    where
18715        S: serde::Serializer,
18716    {
18717        match self {
18718            Self::Unspecified => serializer.serialize_i32(0),
18719            Self::Premium => serializer.serialize_i32(1),
18720            Self::Extreme => serializer.serialize_i32(2),
18721            Self::Standard => serializer.serialize_i32(3),
18722            Self::Flex => serializer.serialize_i32(4),
18723            Self::UnknownValue(u) => u.0.serialize(serializer),
18724        }
18725    }
18726}
18727
18728impl<'de> serde::de::Deserialize<'de> for ServiceLevel {
18729    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18730    where
18731        D: serde::Deserializer<'de>,
18732    {
18733        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ServiceLevel>::new(
18734            ".google.cloud.netapp.v1.ServiceLevel",
18735        ))
18736    }
18737}
18738
18739/// Flex Storage Pool performance.
18740///
18741/// # Working with unknown values
18742///
18743/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18744/// additional enum variants at any time. Adding new variants is not considered
18745/// a breaking change. Applications should write their code in anticipation of:
18746///
18747/// - New values appearing in future releases of the client library, **and**
18748/// - New values received dynamically, without application changes.
18749///
18750/// Please consult the [Working with enums] section in the user guide for some
18751/// guidelines.
18752///
18753/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18754#[derive(Clone, Debug, PartialEq)]
18755#[non_exhaustive]
18756pub enum FlexPerformance {
18757    /// Unspecified flex performance.
18758    Unspecified,
18759    /// Flex Storage Pool with default performance.
18760    Default,
18761    /// Flex Storage Pool with custom performance.
18762    Custom,
18763    /// If set, the enum was initialized with an unknown value.
18764    ///
18765    /// Applications can examine the value using [FlexPerformance::value] or
18766    /// [FlexPerformance::name].
18767    UnknownValue(flex_performance::UnknownValue),
18768}
18769
18770#[doc(hidden)]
18771pub mod flex_performance {
18772    #[allow(unused_imports)]
18773    use super::*;
18774    #[derive(Clone, Debug, PartialEq)]
18775    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18776}
18777
18778impl FlexPerformance {
18779    /// Gets the enum value.
18780    ///
18781    /// Returns `None` if the enum contains an unknown value deserialized from
18782    /// the string representation of enums.
18783    pub fn value(&self) -> std::option::Option<i32> {
18784        match self {
18785            Self::Unspecified => std::option::Option::Some(0),
18786            Self::Default => std::option::Option::Some(1),
18787            Self::Custom => std::option::Option::Some(2),
18788            Self::UnknownValue(u) => u.0.value(),
18789        }
18790    }
18791
18792    /// Gets the enum value as a string.
18793    ///
18794    /// Returns `None` if the enum contains an unknown value deserialized from
18795    /// the integer representation of enums.
18796    pub fn name(&self) -> std::option::Option<&str> {
18797        match self {
18798            Self::Unspecified => std::option::Option::Some("FLEX_PERFORMANCE_UNSPECIFIED"),
18799            Self::Default => std::option::Option::Some("FLEX_PERFORMANCE_DEFAULT"),
18800            Self::Custom => std::option::Option::Some("FLEX_PERFORMANCE_CUSTOM"),
18801            Self::UnknownValue(u) => u.0.name(),
18802        }
18803    }
18804}
18805
18806impl std::default::Default for FlexPerformance {
18807    fn default() -> Self {
18808        use std::convert::From;
18809        Self::from(0)
18810    }
18811}
18812
18813impl std::fmt::Display for FlexPerformance {
18814    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18815        wkt::internal::display_enum(f, self.name(), self.value())
18816    }
18817}
18818
18819impl std::convert::From<i32> for FlexPerformance {
18820    fn from(value: i32) -> Self {
18821        match value {
18822            0 => Self::Unspecified,
18823            1 => Self::Default,
18824            2 => Self::Custom,
18825            _ => Self::UnknownValue(flex_performance::UnknownValue(
18826                wkt::internal::UnknownEnumValue::Integer(value),
18827            )),
18828        }
18829    }
18830}
18831
18832impl std::convert::From<&str> for FlexPerformance {
18833    fn from(value: &str) -> Self {
18834        use std::string::ToString;
18835        match value {
18836            "FLEX_PERFORMANCE_UNSPECIFIED" => Self::Unspecified,
18837            "FLEX_PERFORMANCE_DEFAULT" => Self::Default,
18838            "FLEX_PERFORMANCE_CUSTOM" => Self::Custom,
18839            _ => Self::UnknownValue(flex_performance::UnknownValue(
18840                wkt::internal::UnknownEnumValue::String(value.to_string()),
18841            )),
18842        }
18843    }
18844}
18845
18846impl serde::ser::Serialize for FlexPerformance {
18847    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18848    where
18849        S: serde::Serializer,
18850    {
18851        match self {
18852            Self::Unspecified => serializer.serialize_i32(0),
18853            Self::Default => serializer.serialize_i32(1),
18854            Self::Custom => serializer.serialize_i32(2),
18855            Self::UnknownValue(u) => u.0.serialize(serializer),
18856        }
18857    }
18858}
18859
18860impl<'de> serde::de::Deserialize<'de> for FlexPerformance {
18861    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18862    where
18863        D: serde::Deserializer<'de>,
18864    {
18865        deserializer.deserialize_any(wkt::internal::EnumVisitor::<FlexPerformance>::new(
18866            ".google.cloud.netapp.v1.FlexPerformance",
18867        ))
18868    }
18869}
18870
18871/// The volume encryption key source.
18872///
18873/// # Working with unknown values
18874///
18875/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18876/// additional enum variants at any time. Adding new variants is not considered
18877/// a breaking change. Applications should write their code in anticipation of:
18878///
18879/// - New values appearing in future releases of the client library, **and**
18880/// - New values received dynamically, without application changes.
18881///
18882/// Please consult the [Working with enums] section in the user guide for some
18883/// guidelines.
18884///
18885/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18886#[derive(Clone, Debug, PartialEq)]
18887#[non_exhaustive]
18888pub enum EncryptionType {
18889    /// The source of the encryption key is not specified.
18890    Unspecified,
18891    /// Google managed encryption key.
18892    ServiceManaged,
18893    /// Customer managed encryption key, which is stored in KMS.
18894    CloudKms,
18895    /// If set, the enum was initialized with an unknown value.
18896    ///
18897    /// Applications can examine the value using [EncryptionType::value] or
18898    /// [EncryptionType::name].
18899    UnknownValue(encryption_type::UnknownValue),
18900}
18901
18902#[doc(hidden)]
18903pub mod encryption_type {
18904    #[allow(unused_imports)]
18905    use super::*;
18906    #[derive(Clone, Debug, PartialEq)]
18907    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18908}
18909
18910impl EncryptionType {
18911    /// Gets the enum value.
18912    ///
18913    /// Returns `None` if the enum contains an unknown value deserialized from
18914    /// the string representation of enums.
18915    pub fn value(&self) -> std::option::Option<i32> {
18916        match self {
18917            Self::Unspecified => std::option::Option::Some(0),
18918            Self::ServiceManaged => std::option::Option::Some(1),
18919            Self::CloudKms => std::option::Option::Some(2),
18920            Self::UnknownValue(u) => u.0.value(),
18921        }
18922    }
18923
18924    /// Gets the enum value as a string.
18925    ///
18926    /// Returns `None` if the enum contains an unknown value deserialized from
18927    /// the integer representation of enums.
18928    pub fn name(&self) -> std::option::Option<&str> {
18929        match self {
18930            Self::Unspecified => std::option::Option::Some("ENCRYPTION_TYPE_UNSPECIFIED"),
18931            Self::ServiceManaged => std::option::Option::Some("SERVICE_MANAGED"),
18932            Self::CloudKms => std::option::Option::Some("CLOUD_KMS"),
18933            Self::UnknownValue(u) => u.0.name(),
18934        }
18935    }
18936}
18937
18938impl std::default::Default for EncryptionType {
18939    fn default() -> Self {
18940        use std::convert::From;
18941        Self::from(0)
18942    }
18943}
18944
18945impl std::fmt::Display for EncryptionType {
18946    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18947        wkt::internal::display_enum(f, self.name(), self.value())
18948    }
18949}
18950
18951impl std::convert::From<i32> for EncryptionType {
18952    fn from(value: i32) -> Self {
18953        match value {
18954            0 => Self::Unspecified,
18955            1 => Self::ServiceManaged,
18956            2 => Self::CloudKms,
18957            _ => Self::UnknownValue(encryption_type::UnknownValue(
18958                wkt::internal::UnknownEnumValue::Integer(value),
18959            )),
18960        }
18961    }
18962}
18963
18964impl std::convert::From<&str> for EncryptionType {
18965    fn from(value: &str) -> Self {
18966        use std::string::ToString;
18967        match value {
18968            "ENCRYPTION_TYPE_UNSPECIFIED" => Self::Unspecified,
18969            "SERVICE_MANAGED" => Self::ServiceManaged,
18970            "CLOUD_KMS" => Self::CloudKms,
18971            _ => Self::UnknownValue(encryption_type::UnknownValue(
18972                wkt::internal::UnknownEnumValue::String(value.to_string()),
18973            )),
18974        }
18975    }
18976}
18977
18978impl serde::ser::Serialize for EncryptionType {
18979    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18980    where
18981        S: serde::Serializer,
18982    {
18983        match self {
18984            Self::Unspecified => serializer.serialize_i32(0),
18985            Self::ServiceManaged => serializer.serialize_i32(1),
18986            Self::CloudKms => serializer.serialize_i32(2),
18987            Self::UnknownValue(u) => u.0.serialize(serializer),
18988        }
18989    }
18990}
18991
18992impl<'de> serde::de::Deserialize<'de> for EncryptionType {
18993    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18994    where
18995        D: serde::Deserializer<'de>,
18996    {
18997        deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionType>::new(
18998            ".google.cloud.netapp.v1.EncryptionType",
18999        ))
19000    }
19001}
19002
19003/// Type of directory service
19004///
19005/// # Working with unknown values
19006///
19007/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19008/// additional enum variants at any time. Adding new variants is not considered
19009/// a breaking change. Applications should write their code in anticipation of:
19010///
19011/// - New values appearing in future releases of the client library, **and**
19012/// - New values received dynamically, without application changes.
19013///
19014/// Please consult the [Working with enums] section in the user guide for some
19015/// guidelines.
19016///
19017/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19018#[derive(Clone, Debug, PartialEq)]
19019#[non_exhaustive]
19020pub enum DirectoryServiceType {
19021    /// Directory service type is not specified.
19022    Unspecified,
19023    /// Active directory policy attached to the storage pool.
19024    ActiveDirectory,
19025    /// If set, the enum was initialized with an unknown value.
19026    ///
19027    /// Applications can examine the value using [DirectoryServiceType::value] or
19028    /// [DirectoryServiceType::name].
19029    UnknownValue(directory_service_type::UnknownValue),
19030}
19031
19032#[doc(hidden)]
19033pub mod directory_service_type {
19034    #[allow(unused_imports)]
19035    use super::*;
19036    #[derive(Clone, Debug, PartialEq)]
19037    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19038}
19039
19040impl DirectoryServiceType {
19041    /// Gets the enum value.
19042    ///
19043    /// Returns `None` if the enum contains an unknown value deserialized from
19044    /// the string representation of enums.
19045    pub fn value(&self) -> std::option::Option<i32> {
19046        match self {
19047            Self::Unspecified => std::option::Option::Some(0),
19048            Self::ActiveDirectory => std::option::Option::Some(1),
19049            Self::UnknownValue(u) => u.0.value(),
19050        }
19051    }
19052
19053    /// Gets the enum value as a string.
19054    ///
19055    /// Returns `None` if the enum contains an unknown value deserialized from
19056    /// the integer representation of enums.
19057    pub fn name(&self) -> std::option::Option<&str> {
19058        match self {
19059            Self::Unspecified => std::option::Option::Some("DIRECTORY_SERVICE_TYPE_UNSPECIFIED"),
19060            Self::ActiveDirectory => std::option::Option::Some("ACTIVE_DIRECTORY"),
19061            Self::UnknownValue(u) => u.0.name(),
19062        }
19063    }
19064}
19065
19066impl std::default::Default for DirectoryServiceType {
19067    fn default() -> Self {
19068        use std::convert::From;
19069        Self::from(0)
19070    }
19071}
19072
19073impl std::fmt::Display for DirectoryServiceType {
19074    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19075        wkt::internal::display_enum(f, self.name(), self.value())
19076    }
19077}
19078
19079impl std::convert::From<i32> for DirectoryServiceType {
19080    fn from(value: i32) -> Self {
19081        match value {
19082            0 => Self::Unspecified,
19083            1 => Self::ActiveDirectory,
19084            _ => Self::UnknownValue(directory_service_type::UnknownValue(
19085                wkt::internal::UnknownEnumValue::Integer(value),
19086            )),
19087        }
19088    }
19089}
19090
19091impl std::convert::From<&str> for DirectoryServiceType {
19092    fn from(value: &str) -> Self {
19093        use std::string::ToString;
19094        match value {
19095            "DIRECTORY_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
19096            "ACTIVE_DIRECTORY" => Self::ActiveDirectory,
19097            _ => Self::UnknownValue(directory_service_type::UnknownValue(
19098                wkt::internal::UnknownEnumValue::String(value.to_string()),
19099            )),
19100        }
19101    }
19102}
19103
19104impl serde::ser::Serialize for DirectoryServiceType {
19105    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19106    where
19107        S: serde::Serializer,
19108    {
19109        match self {
19110            Self::Unspecified => serializer.serialize_i32(0),
19111            Self::ActiveDirectory => serializer.serialize_i32(1),
19112            Self::UnknownValue(u) => u.0.serialize(serializer),
19113        }
19114    }
19115}
19116
19117impl<'de> serde::de::Deserialize<'de> for DirectoryServiceType {
19118    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19119    where
19120        D: serde::Deserializer<'de>,
19121    {
19122        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DirectoryServiceType>::new(
19123            ".google.cloud.netapp.v1.DirectoryServiceType",
19124        ))
19125    }
19126}
19127
19128/// Type of storage pool
19129///
19130/// # Working with unknown values
19131///
19132/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19133/// additional enum variants at any time. Adding new variants is not considered
19134/// a breaking change. Applications should write their code in anticipation of:
19135///
19136/// - New values appearing in future releases of the client library, **and**
19137/// - New values received dynamically, without application changes.
19138///
19139/// Please consult the [Working with enums] section in the user guide for some
19140/// guidelines.
19141///
19142/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19143#[derive(Clone, Debug, PartialEq)]
19144#[non_exhaustive]
19145pub enum StoragePoolType {
19146    /// Storage pool type is not specified.
19147    Unspecified,
19148    /// Storage pool type is file.
19149    File,
19150    /// Storage pool type is unified.
19151    Unified,
19152    /// If set, the enum was initialized with an unknown value.
19153    ///
19154    /// Applications can examine the value using [StoragePoolType::value] or
19155    /// [StoragePoolType::name].
19156    UnknownValue(storage_pool_type::UnknownValue),
19157}
19158
19159#[doc(hidden)]
19160pub mod storage_pool_type {
19161    #[allow(unused_imports)]
19162    use super::*;
19163    #[derive(Clone, Debug, PartialEq)]
19164    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19165}
19166
19167impl StoragePoolType {
19168    /// Gets the enum value.
19169    ///
19170    /// Returns `None` if the enum contains an unknown value deserialized from
19171    /// the string representation of enums.
19172    pub fn value(&self) -> std::option::Option<i32> {
19173        match self {
19174            Self::Unspecified => std::option::Option::Some(0),
19175            Self::File => std::option::Option::Some(1),
19176            Self::Unified => std::option::Option::Some(2),
19177            Self::UnknownValue(u) => u.0.value(),
19178        }
19179    }
19180
19181    /// Gets the enum value as a string.
19182    ///
19183    /// Returns `None` if the enum contains an unknown value deserialized from
19184    /// the integer representation of enums.
19185    pub fn name(&self) -> std::option::Option<&str> {
19186        match self {
19187            Self::Unspecified => std::option::Option::Some("STORAGE_POOL_TYPE_UNSPECIFIED"),
19188            Self::File => std::option::Option::Some("FILE"),
19189            Self::Unified => std::option::Option::Some("UNIFIED"),
19190            Self::UnknownValue(u) => u.0.name(),
19191        }
19192    }
19193}
19194
19195impl std::default::Default for StoragePoolType {
19196    fn default() -> Self {
19197        use std::convert::From;
19198        Self::from(0)
19199    }
19200}
19201
19202impl std::fmt::Display for StoragePoolType {
19203    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19204        wkt::internal::display_enum(f, self.name(), self.value())
19205    }
19206}
19207
19208impl std::convert::From<i32> for StoragePoolType {
19209    fn from(value: i32) -> Self {
19210        match value {
19211            0 => Self::Unspecified,
19212            1 => Self::File,
19213            2 => Self::Unified,
19214            _ => Self::UnknownValue(storage_pool_type::UnknownValue(
19215                wkt::internal::UnknownEnumValue::Integer(value),
19216            )),
19217        }
19218    }
19219}
19220
19221impl std::convert::From<&str> for StoragePoolType {
19222    fn from(value: &str) -> Self {
19223        use std::string::ToString;
19224        match value {
19225            "STORAGE_POOL_TYPE_UNSPECIFIED" => Self::Unspecified,
19226            "FILE" => Self::File,
19227            "UNIFIED" => Self::Unified,
19228            _ => Self::UnknownValue(storage_pool_type::UnknownValue(
19229                wkt::internal::UnknownEnumValue::String(value.to_string()),
19230            )),
19231        }
19232    }
19233}
19234
19235impl serde::ser::Serialize for StoragePoolType {
19236    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19237    where
19238        S: serde::Serializer,
19239    {
19240        match self {
19241            Self::Unspecified => serializer.serialize_i32(0),
19242            Self::File => serializer.serialize_i32(1),
19243            Self::Unified => serializer.serialize_i32(2),
19244            Self::UnknownValue(u) => u.0.serialize(serializer),
19245        }
19246    }
19247}
19248
19249impl<'de> serde::de::Deserialize<'de> for StoragePoolType {
19250    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19251    where
19252        D: serde::Deserializer<'de>,
19253    {
19254        deserializer.deserialize_any(wkt::internal::EnumVisitor::<StoragePoolType>::new(
19255            ".google.cloud.netapp.v1.StoragePoolType",
19256        ))
19257    }
19258}
19259
19260/// Defines the scale-type of a UNIFIED Storage Pool.
19261///
19262/// # Working with unknown values
19263///
19264/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19265/// additional enum variants at any time. Adding new variants is not considered
19266/// a breaking change. Applications should write their code in anticipation of:
19267///
19268/// - New values appearing in future releases of the client library, **and**
19269/// - New values received dynamically, without application changes.
19270///
19271/// Please consult the [Working with enums] section in the user guide for some
19272/// guidelines.
19273///
19274/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19275#[derive(Clone, Debug, PartialEq)]
19276#[non_exhaustive]
19277pub enum ScaleType {
19278    /// Unspecified scale type.
19279    Unspecified,
19280    /// Represents standard capacity and performance scale-type.
19281    /// Suitable for general purpose workloads.
19282    Default,
19283    /// Represents higher capacity and performance scale-type.
19284    /// Suitable for more demanding workloads.
19285    Scaleout,
19286    /// If set, the enum was initialized with an unknown value.
19287    ///
19288    /// Applications can examine the value using [ScaleType::value] or
19289    /// [ScaleType::name].
19290    UnknownValue(scale_type::UnknownValue),
19291}
19292
19293#[doc(hidden)]
19294pub mod scale_type {
19295    #[allow(unused_imports)]
19296    use super::*;
19297    #[derive(Clone, Debug, PartialEq)]
19298    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19299}
19300
19301impl ScaleType {
19302    /// Gets the enum value.
19303    ///
19304    /// Returns `None` if the enum contains an unknown value deserialized from
19305    /// the string representation of enums.
19306    pub fn value(&self) -> std::option::Option<i32> {
19307        match self {
19308            Self::Unspecified => std::option::Option::Some(0),
19309            Self::Default => std::option::Option::Some(1),
19310            Self::Scaleout => std::option::Option::Some(2),
19311            Self::UnknownValue(u) => u.0.value(),
19312        }
19313    }
19314
19315    /// Gets the enum value as a string.
19316    ///
19317    /// Returns `None` if the enum contains an unknown value deserialized from
19318    /// the integer representation of enums.
19319    pub fn name(&self) -> std::option::Option<&str> {
19320        match self {
19321            Self::Unspecified => std::option::Option::Some("SCALE_TYPE_UNSPECIFIED"),
19322            Self::Default => std::option::Option::Some("SCALE_TYPE_DEFAULT"),
19323            Self::Scaleout => std::option::Option::Some("SCALE_TYPE_SCALEOUT"),
19324            Self::UnknownValue(u) => u.0.name(),
19325        }
19326    }
19327}
19328
19329impl std::default::Default for ScaleType {
19330    fn default() -> Self {
19331        use std::convert::From;
19332        Self::from(0)
19333    }
19334}
19335
19336impl std::fmt::Display for ScaleType {
19337    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19338        wkt::internal::display_enum(f, self.name(), self.value())
19339    }
19340}
19341
19342impl std::convert::From<i32> for ScaleType {
19343    fn from(value: i32) -> Self {
19344        match value {
19345            0 => Self::Unspecified,
19346            1 => Self::Default,
19347            2 => Self::Scaleout,
19348            _ => Self::UnknownValue(scale_type::UnknownValue(
19349                wkt::internal::UnknownEnumValue::Integer(value),
19350            )),
19351        }
19352    }
19353}
19354
19355impl std::convert::From<&str> for ScaleType {
19356    fn from(value: &str) -> Self {
19357        use std::string::ToString;
19358        match value {
19359            "SCALE_TYPE_UNSPECIFIED" => Self::Unspecified,
19360            "SCALE_TYPE_DEFAULT" => Self::Default,
19361            "SCALE_TYPE_SCALEOUT" => Self::Scaleout,
19362            _ => Self::UnknownValue(scale_type::UnknownValue(
19363                wkt::internal::UnknownEnumValue::String(value.to_string()),
19364            )),
19365        }
19366    }
19367}
19368
19369impl serde::ser::Serialize for ScaleType {
19370    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19371    where
19372        S: serde::Serializer,
19373    {
19374        match self {
19375            Self::Unspecified => serializer.serialize_i32(0),
19376            Self::Default => serializer.serialize_i32(1),
19377            Self::Scaleout => serializer.serialize_i32(2),
19378            Self::UnknownValue(u) => u.0.serialize(serializer),
19379        }
19380    }
19381}
19382
19383impl<'de> serde::de::Deserialize<'de> for ScaleType {
19384    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19385    where
19386        D: serde::Deserializer<'de>,
19387    {
19388        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ScaleType>::new(
19389            ".google.cloud.netapp.v1.ScaleType",
19390        ))
19391    }
19392}
19393
19394/// Schedule for Hybrid Replication.
19395/// New enum values may be added in future to support different frequency of
19396/// replication.
19397///
19398/// # Working with unknown values
19399///
19400/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19401/// additional enum variants at any time. Adding new variants is not considered
19402/// a breaking change. Applications should write their code in anticipation of:
19403///
19404/// - New values appearing in future releases of the client library, **and**
19405/// - New values received dynamically, without application changes.
19406///
19407/// Please consult the [Working with enums] section in the user guide for some
19408/// guidelines.
19409///
19410/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19411#[derive(Clone, Debug, PartialEq)]
19412#[non_exhaustive]
19413pub enum HybridReplicationSchedule {
19414    /// Unspecified HybridReplicationSchedule
19415    Unspecified,
19416    /// Replication happens once every 10 minutes.
19417    Every10Minutes,
19418    /// Replication happens once every hour.
19419    Hourly,
19420    /// Replication happens once every day.
19421    Daily,
19422    /// If set, the enum was initialized with an unknown value.
19423    ///
19424    /// Applications can examine the value using [HybridReplicationSchedule::value] or
19425    /// [HybridReplicationSchedule::name].
19426    UnknownValue(hybrid_replication_schedule::UnknownValue),
19427}
19428
19429#[doc(hidden)]
19430pub mod hybrid_replication_schedule {
19431    #[allow(unused_imports)]
19432    use super::*;
19433    #[derive(Clone, Debug, PartialEq)]
19434    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19435}
19436
19437impl HybridReplicationSchedule {
19438    /// Gets the enum value.
19439    ///
19440    /// Returns `None` if the enum contains an unknown value deserialized from
19441    /// the string representation of enums.
19442    pub fn value(&self) -> std::option::Option<i32> {
19443        match self {
19444            Self::Unspecified => std::option::Option::Some(0),
19445            Self::Every10Minutes => std::option::Option::Some(1),
19446            Self::Hourly => std::option::Option::Some(2),
19447            Self::Daily => std::option::Option::Some(3),
19448            Self::UnknownValue(u) => u.0.value(),
19449        }
19450    }
19451
19452    /// Gets the enum value as a string.
19453    ///
19454    /// Returns `None` if the enum contains an unknown value deserialized from
19455    /// the integer representation of enums.
19456    pub fn name(&self) -> std::option::Option<&str> {
19457        match self {
19458            Self::Unspecified => {
19459                std::option::Option::Some("HYBRID_REPLICATION_SCHEDULE_UNSPECIFIED")
19460            }
19461            Self::Every10Minutes => std::option::Option::Some("EVERY_10_MINUTES"),
19462            Self::Hourly => std::option::Option::Some("HOURLY"),
19463            Self::Daily => std::option::Option::Some("DAILY"),
19464            Self::UnknownValue(u) => u.0.name(),
19465        }
19466    }
19467}
19468
19469impl std::default::Default for HybridReplicationSchedule {
19470    fn default() -> Self {
19471        use std::convert::From;
19472        Self::from(0)
19473    }
19474}
19475
19476impl std::fmt::Display for HybridReplicationSchedule {
19477    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19478        wkt::internal::display_enum(f, self.name(), self.value())
19479    }
19480}
19481
19482impl std::convert::From<i32> for HybridReplicationSchedule {
19483    fn from(value: i32) -> Self {
19484        match value {
19485            0 => Self::Unspecified,
19486            1 => Self::Every10Minutes,
19487            2 => Self::Hourly,
19488            3 => Self::Daily,
19489            _ => Self::UnknownValue(hybrid_replication_schedule::UnknownValue(
19490                wkt::internal::UnknownEnumValue::Integer(value),
19491            )),
19492        }
19493    }
19494}
19495
19496impl std::convert::From<&str> for HybridReplicationSchedule {
19497    fn from(value: &str) -> Self {
19498        use std::string::ToString;
19499        match value {
19500            "HYBRID_REPLICATION_SCHEDULE_UNSPECIFIED" => Self::Unspecified,
19501            "EVERY_10_MINUTES" => Self::Every10Minutes,
19502            "HOURLY" => Self::Hourly,
19503            "DAILY" => Self::Daily,
19504            _ => Self::UnknownValue(hybrid_replication_schedule::UnknownValue(
19505                wkt::internal::UnknownEnumValue::String(value.to_string()),
19506            )),
19507        }
19508    }
19509}
19510
19511impl serde::ser::Serialize for HybridReplicationSchedule {
19512    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19513    where
19514        S: serde::Serializer,
19515    {
19516        match self {
19517            Self::Unspecified => serializer.serialize_i32(0),
19518            Self::Every10Minutes => serializer.serialize_i32(1),
19519            Self::Hourly => serializer.serialize_i32(2),
19520            Self::Daily => serializer.serialize_i32(3),
19521            Self::UnknownValue(u) => u.0.serialize(serializer),
19522        }
19523    }
19524}
19525
19526impl<'de> serde::de::Deserialize<'de> for HybridReplicationSchedule {
19527    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19528    where
19529        D: serde::Deserializer<'de>,
19530    {
19531        deserializer.deserialize_any(
19532            wkt::internal::EnumVisitor::<HybridReplicationSchedule>::new(
19533                ".google.cloud.netapp.v1.HybridReplicationSchedule",
19534            ),
19535        )
19536    }
19537}
19538
19539/// QoS (Quality of Service) Types of the storage pool
19540///
19541/// # Working with unknown values
19542///
19543/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19544/// additional enum variants at any time. Adding new variants is not considered
19545/// a breaking change. Applications should write their code in anticipation of:
19546///
19547/// - New values appearing in future releases of the client library, **and**
19548/// - New values received dynamically, without application changes.
19549///
19550/// Please consult the [Working with enums] section in the user guide for some
19551/// guidelines.
19552///
19553/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19554#[derive(Clone, Debug, PartialEq)]
19555#[non_exhaustive]
19556pub enum QosType {
19557    /// Unspecified QoS Type
19558    Unspecified,
19559    /// QoS Type is Auto
19560    Auto,
19561    /// QoS Type is Manual
19562    Manual,
19563    /// If set, the enum was initialized with an unknown value.
19564    ///
19565    /// Applications can examine the value using [QosType::value] or
19566    /// [QosType::name].
19567    UnknownValue(qos_type::UnknownValue),
19568}
19569
19570#[doc(hidden)]
19571pub mod qos_type {
19572    #[allow(unused_imports)]
19573    use super::*;
19574    #[derive(Clone, Debug, PartialEq)]
19575    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19576}
19577
19578impl QosType {
19579    /// Gets the enum value.
19580    ///
19581    /// Returns `None` if the enum contains an unknown value deserialized from
19582    /// the string representation of enums.
19583    pub fn value(&self) -> std::option::Option<i32> {
19584        match self {
19585            Self::Unspecified => std::option::Option::Some(0),
19586            Self::Auto => std::option::Option::Some(1),
19587            Self::Manual => std::option::Option::Some(2),
19588            Self::UnknownValue(u) => u.0.value(),
19589        }
19590    }
19591
19592    /// Gets the enum value as a string.
19593    ///
19594    /// Returns `None` if the enum contains an unknown value deserialized from
19595    /// the integer representation of enums.
19596    pub fn name(&self) -> std::option::Option<&str> {
19597        match self {
19598            Self::Unspecified => std::option::Option::Some("QOS_TYPE_UNSPECIFIED"),
19599            Self::Auto => std::option::Option::Some("AUTO"),
19600            Self::Manual => std::option::Option::Some("MANUAL"),
19601            Self::UnknownValue(u) => u.0.name(),
19602        }
19603    }
19604}
19605
19606impl std::default::Default for QosType {
19607    fn default() -> Self {
19608        use std::convert::From;
19609        Self::from(0)
19610    }
19611}
19612
19613impl std::fmt::Display for QosType {
19614    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19615        wkt::internal::display_enum(f, self.name(), self.value())
19616    }
19617}
19618
19619impl std::convert::From<i32> for QosType {
19620    fn from(value: i32) -> Self {
19621        match value {
19622            0 => Self::Unspecified,
19623            1 => Self::Auto,
19624            2 => Self::Manual,
19625            _ => Self::UnknownValue(qos_type::UnknownValue(
19626                wkt::internal::UnknownEnumValue::Integer(value),
19627            )),
19628        }
19629    }
19630}
19631
19632impl std::convert::From<&str> for QosType {
19633    fn from(value: &str) -> Self {
19634        use std::string::ToString;
19635        match value {
19636            "QOS_TYPE_UNSPECIFIED" => Self::Unspecified,
19637            "AUTO" => Self::Auto,
19638            "MANUAL" => Self::Manual,
19639            _ => Self::UnknownValue(qos_type::UnknownValue(
19640                wkt::internal::UnknownEnumValue::String(value.to_string()),
19641            )),
19642        }
19643    }
19644}
19645
19646impl serde::ser::Serialize for QosType {
19647    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19648    where
19649        S: serde::Serializer,
19650    {
19651        match self {
19652            Self::Unspecified => serializer.serialize_i32(0),
19653            Self::Auto => serializer.serialize_i32(1),
19654            Self::Manual => serializer.serialize_i32(2),
19655            Self::UnknownValue(u) => u.0.serialize(serializer),
19656        }
19657    }
19658}
19659
19660impl<'de> serde::de::Deserialize<'de> for QosType {
19661    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19662    where
19663        D: serde::Deserializer<'de>,
19664    {
19665        deserializer.deserialize_any(wkt::internal::EnumVisitor::<QosType>::new(
19666            ".google.cloud.netapp.v1.QosType",
19667        ))
19668    }
19669}
19670
19671/// OS types for the host group
19672///
19673/// # Working with unknown values
19674///
19675/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19676/// additional enum variants at any time. Adding new variants is not considered
19677/// a breaking change. Applications should write their code in anticipation of:
19678///
19679/// - New values appearing in future releases of the client library, **and**
19680/// - New values received dynamically, without application changes.
19681///
19682/// Please consult the [Working with enums] section in the user guide for some
19683/// guidelines.
19684///
19685/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19686#[derive(Clone, Debug, PartialEq)]
19687#[non_exhaustive]
19688pub enum OsType {
19689    /// Unspecified OS Type
19690    Unspecified,
19691    /// OS Type is Linux
19692    Linux,
19693    /// OS Type is Windows
19694    Windows,
19695    /// OS Type is VMware ESXi
19696    Esxi,
19697    /// If set, the enum was initialized with an unknown value.
19698    ///
19699    /// Applications can examine the value using [OsType::value] or
19700    /// [OsType::name].
19701    UnknownValue(os_type::UnknownValue),
19702}
19703
19704#[doc(hidden)]
19705pub mod os_type {
19706    #[allow(unused_imports)]
19707    use super::*;
19708    #[derive(Clone, Debug, PartialEq)]
19709    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19710}
19711
19712impl OsType {
19713    /// Gets the enum value.
19714    ///
19715    /// Returns `None` if the enum contains an unknown value deserialized from
19716    /// the string representation of enums.
19717    pub fn value(&self) -> std::option::Option<i32> {
19718        match self {
19719            Self::Unspecified => std::option::Option::Some(0),
19720            Self::Linux => std::option::Option::Some(1),
19721            Self::Windows => std::option::Option::Some(2),
19722            Self::Esxi => std::option::Option::Some(3),
19723            Self::UnknownValue(u) => u.0.value(),
19724        }
19725    }
19726
19727    /// Gets the enum value as a string.
19728    ///
19729    /// Returns `None` if the enum contains an unknown value deserialized from
19730    /// the integer representation of enums.
19731    pub fn name(&self) -> std::option::Option<&str> {
19732        match self {
19733            Self::Unspecified => std::option::Option::Some("OS_TYPE_UNSPECIFIED"),
19734            Self::Linux => std::option::Option::Some("LINUX"),
19735            Self::Windows => std::option::Option::Some("WINDOWS"),
19736            Self::Esxi => std::option::Option::Some("ESXI"),
19737            Self::UnknownValue(u) => u.0.name(),
19738        }
19739    }
19740}
19741
19742impl std::default::Default for OsType {
19743    fn default() -> Self {
19744        use std::convert::From;
19745        Self::from(0)
19746    }
19747}
19748
19749impl std::fmt::Display for OsType {
19750    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19751        wkt::internal::display_enum(f, self.name(), self.value())
19752    }
19753}
19754
19755impl std::convert::From<i32> for OsType {
19756    fn from(value: i32) -> Self {
19757        match value {
19758            0 => Self::Unspecified,
19759            1 => Self::Linux,
19760            2 => Self::Windows,
19761            3 => Self::Esxi,
19762            _ => Self::UnknownValue(os_type::UnknownValue(
19763                wkt::internal::UnknownEnumValue::Integer(value),
19764            )),
19765        }
19766    }
19767}
19768
19769impl std::convert::From<&str> for OsType {
19770    fn from(value: &str) -> Self {
19771        use std::string::ToString;
19772        match value {
19773            "OS_TYPE_UNSPECIFIED" => Self::Unspecified,
19774            "LINUX" => Self::Linux,
19775            "WINDOWS" => Self::Windows,
19776            "ESXI" => Self::Esxi,
19777            _ => Self::UnknownValue(os_type::UnknownValue(
19778                wkt::internal::UnknownEnumValue::String(value.to_string()),
19779            )),
19780        }
19781    }
19782}
19783
19784impl serde::ser::Serialize for OsType {
19785    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19786    where
19787        S: serde::Serializer,
19788    {
19789        match self {
19790            Self::Unspecified => serializer.serialize_i32(0),
19791            Self::Linux => serializer.serialize_i32(1),
19792            Self::Windows => serializer.serialize_i32(2),
19793            Self::Esxi => serializer.serialize_i32(3),
19794            Self::UnknownValue(u) => u.0.serialize(serializer),
19795        }
19796    }
19797}
19798
19799impl<'de> serde::de::Deserialize<'de> for OsType {
19800    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19801    where
19802        D: serde::Deserializer<'de>,
19803    {
19804        deserializer.deserialize_any(wkt::internal::EnumVisitor::<OsType>::new(
19805            ".google.cloud.netapp.v1.OsType",
19806        ))
19807    }
19808}
19809
19810/// `Mode` of the storage pool or volume. This field is used to control whether
19811/// the resource is managed by the GCNV APIs or the GCNV ONTAP Mode APIs.
19812///
19813/// # Working with unknown values
19814///
19815/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19816/// additional enum variants at any time. Adding new variants is not considered
19817/// a breaking change. Applications should write their code in anticipation of:
19818///
19819/// - New values appearing in future releases of the client library, **and**
19820/// - New values received dynamically, without application changes.
19821///
19822/// Please consult the [Working with enums] section in the user guide for some
19823/// guidelines.
19824///
19825/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19826#[derive(Clone, Debug, PartialEq)]
19827#[non_exhaustive]
19828pub enum Mode {
19829    /// The `Mode` is not specified.
19830    Unspecified,
19831    /// The resource is managed by the GCNV APIs.
19832    Default,
19833    /// The resource is managed by the GCNV ONTAP Mode APIs.
19834    Ontap,
19835    /// If set, the enum was initialized with an unknown value.
19836    ///
19837    /// Applications can examine the value using [Mode::value] or
19838    /// [Mode::name].
19839    UnknownValue(mode::UnknownValue),
19840}
19841
19842#[doc(hidden)]
19843pub mod mode {
19844    #[allow(unused_imports)]
19845    use super::*;
19846    #[derive(Clone, Debug, PartialEq)]
19847    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19848}
19849
19850impl Mode {
19851    /// Gets the enum value.
19852    ///
19853    /// Returns `None` if the enum contains an unknown value deserialized from
19854    /// the string representation of enums.
19855    pub fn value(&self) -> std::option::Option<i32> {
19856        match self {
19857            Self::Unspecified => std::option::Option::Some(0),
19858            Self::Default => std::option::Option::Some(1),
19859            Self::Ontap => std::option::Option::Some(2),
19860            Self::UnknownValue(u) => u.0.value(),
19861        }
19862    }
19863
19864    /// Gets the enum value as a string.
19865    ///
19866    /// Returns `None` if the enum contains an unknown value deserialized from
19867    /// the integer representation of enums.
19868    pub fn name(&self) -> std::option::Option<&str> {
19869        match self {
19870            Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
19871            Self::Default => std::option::Option::Some("DEFAULT"),
19872            Self::Ontap => std::option::Option::Some("ONTAP"),
19873            Self::UnknownValue(u) => u.0.name(),
19874        }
19875    }
19876}
19877
19878impl std::default::Default for Mode {
19879    fn default() -> Self {
19880        use std::convert::From;
19881        Self::from(0)
19882    }
19883}
19884
19885impl std::fmt::Display for Mode {
19886    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19887        wkt::internal::display_enum(f, self.name(), self.value())
19888    }
19889}
19890
19891impl std::convert::From<i32> for Mode {
19892    fn from(value: i32) -> Self {
19893        match value {
19894            0 => Self::Unspecified,
19895            1 => Self::Default,
19896            2 => Self::Ontap,
19897            _ => Self::UnknownValue(mode::UnknownValue(
19898                wkt::internal::UnknownEnumValue::Integer(value),
19899            )),
19900        }
19901    }
19902}
19903
19904impl std::convert::From<&str> for Mode {
19905    fn from(value: &str) -> Self {
19906        use std::string::ToString;
19907        match value {
19908            "MODE_UNSPECIFIED" => Self::Unspecified,
19909            "DEFAULT" => Self::Default,
19910            "ONTAP" => Self::Ontap,
19911            _ => Self::UnknownValue(mode::UnknownValue(wkt::internal::UnknownEnumValue::String(
19912                value.to_string(),
19913            ))),
19914        }
19915    }
19916}
19917
19918impl serde::ser::Serialize for Mode {
19919    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19920    where
19921        S: serde::Serializer,
19922    {
19923        match self {
19924            Self::Unspecified => serializer.serialize_i32(0),
19925            Self::Default => serializer.serialize_i32(1),
19926            Self::Ontap => serializer.serialize_i32(2),
19927            Self::UnknownValue(u) => u.0.serialize(serializer),
19928        }
19929    }
19930}
19931
19932impl<'de> serde::de::Deserialize<'de> for Mode {
19933    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19934    where
19935        D: serde::Deserializer<'de>,
19936    {
19937        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
19938            ".google.cloud.netapp.v1.Mode",
19939        ))
19940    }
19941}
19942
19943/// Protocols is an enum of all the supported network protocols for a volume.
19944///
19945/// # Working with unknown values
19946///
19947/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19948/// additional enum variants at any time. Adding new variants is not considered
19949/// a breaking change. Applications should write their code in anticipation of:
19950///
19951/// - New values appearing in future releases of the client library, **and**
19952/// - New values received dynamically, without application changes.
19953///
19954/// Please consult the [Working with enums] section in the user guide for some
19955/// guidelines.
19956///
19957/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19958#[derive(Clone, Debug, PartialEq)]
19959#[non_exhaustive]
19960pub enum Protocols {
19961    /// Unspecified protocol
19962    Unspecified,
19963    /// NFS V3 protocol
19964    Nfsv3,
19965    /// NFS V4 protocol
19966    Nfsv4,
19967    /// SMB protocol
19968    Smb,
19969    /// ISCSI protocol
19970    Iscsi,
19971    /// If set, the enum was initialized with an unknown value.
19972    ///
19973    /// Applications can examine the value using [Protocols::value] or
19974    /// [Protocols::name].
19975    UnknownValue(protocols::UnknownValue),
19976}
19977
19978#[doc(hidden)]
19979pub mod protocols {
19980    #[allow(unused_imports)]
19981    use super::*;
19982    #[derive(Clone, Debug, PartialEq)]
19983    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19984}
19985
19986impl Protocols {
19987    /// Gets the enum value.
19988    ///
19989    /// Returns `None` if the enum contains an unknown value deserialized from
19990    /// the string representation of enums.
19991    pub fn value(&self) -> std::option::Option<i32> {
19992        match self {
19993            Self::Unspecified => std::option::Option::Some(0),
19994            Self::Nfsv3 => std::option::Option::Some(1),
19995            Self::Nfsv4 => std::option::Option::Some(2),
19996            Self::Smb => std::option::Option::Some(3),
19997            Self::Iscsi => std::option::Option::Some(4),
19998            Self::UnknownValue(u) => u.0.value(),
19999        }
20000    }
20001
20002    /// Gets the enum value as a string.
20003    ///
20004    /// Returns `None` if the enum contains an unknown value deserialized from
20005    /// the integer representation of enums.
20006    pub fn name(&self) -> std::option::Option<&str> {
20007        match self {
20008            Self::Unspecified => std::option::Option::Some("PROTOCOLS_UNSPECIFIED"),
20009            Self::Nfsv3 => std::option::Option::Some("NFSV3"),
20010            Self::Nfsv4 => std::option::Option::Some("NFSV4"),
20011            Self::Smb => std::option::Option::Some("SMB"),
20012            Self::Iscsi => std::option::Option::Some("ISCSI"),
20013            Self::UnknownValue(u) => u.0.name(),
20014        }
20015    }
20016}
20017
20018impl std::default::Default for Protocols {
20019    fn default() -> Self {
20020        use std::convert::From;
20021        Self::from(0)
20022    }
20023}
20024
20025impl std::fmt::Display for Protocols {
20026    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20027        wkt::internal::display_enum(f, self.name(), self.value())
20028    }
20029}
20030
20031impl std::convert::From<i32> for Protocols {
20032    fn from(value: i32) -> Self {
20033        match value {
20034            0 => Self::Unspecified,
20035            1 => Self::Nfsv3,
20036            2 => Self::Nfsv4,
20037            3 => Self::Smb,
20038            4 => Self::Iscsi,
20039            _ => Self::UnknownValue(protocols::UnknownValue(
20040                wkt::internal::UnknownEnumValue::Integer(value),
20041            )),
20042        }
20043    }
20044}
20045
20046impl std::convert::From<&str> for Protocols {
20047    fn from(value: &str) -> Self {
20048        use std::string::ToString;
20049        match value {
20050            "PROTOCOLS_UNSPECIFIED" => Self::Unspecified,
20051            "NFSV3" => Self::Nfsv3,
20052            "NFSV4" => Self::Nfsv4,
20053            "SMB" => Self::Smb,
20054            "ISCSI" => Self::Iscsi,
20055            _ => Self::UnknownValue(protocols::UnknownValue(
20056                wkt::internal::UnknownEnumValue::String(value.to_string()),
20057            )),
20058        }
20059    }
20060}
20061
20062impl serde::ser::Serialize for Protocols {
20063    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20064    where
20065        S: serde::Serializer,
20066    {
20067        match self {
20068            Self::Unspecified => serializer.serialize_i32(0),
20069            Self::Nfsv3 => serializer.serialize_i32(1),
20070            Self::Nfsv4 => serializer.serialize_i32(2),
20071            Self::Smb => serializer.serialize_i32(3),
20072            Self::Iscsi => serializer.serialize_i32(4),
20073            Self::UnknownValue(u) => u.0.serialize(serializer),
20074        }
20075    }
20076}
20077
20078impl<'de> serde::de::Deserialize<'de> for Protocols {
20079    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20080    where
20081        D: serde::Deserializer<'de>,
20082    {
20083        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocols>::new(
20084            ".google.cloud.netapp.v1.Protocols",
20085        ))
20086    }
20087}
20088
20089/// AccessType is an enum of all the supported access types for a volume.
20090///
20091/// # Working with unknown values
20092///
20093/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20094/// additional enum variants at any time. Adding new variants is not considered
20095/// a breaking change. Applications should write their code in anticipation of:
20096///
20097/// - New values appearing in future releases of the client library, **and**
20098/// - New values received dynamically, without application changes.
20099///
20100/// Please consult the [Working with enums] section in the user guide for some
20101/// guidelines.
20102///
20103/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
20104#[derive(Clone, Debug, PartialEq)]
20105#[non_exhaustive]
20106pub enum AccessType {
20107    /// Unspecified Access Type
20108    Unspecified,
20109    /// Read Only
20110    ReadOnly,
20111    /// Read Write
20112    ReadWrite,
20113    /// None
20114    ReadNone,
20115    /// If set, the enum was initialized with an unknown value.
20116    ///
20117    /// Applications can examine the value using [AccessType::value] or
20118    /// [AccessType::name].
20119    UnknownValue(access_type::UnknownValue),
20120}
20121
20122#[doc(hidden)]
20123pub mod access_type {
20124    #[allow(unused_imports)]
20125    use super::*;
20126    #[derive(Clone, Debug, PartialEq)]
20127    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20128}
20129
20130impl AccessType {
20131    /// Gets the enum value.
20132    ///
20133    /// Returns `None` if the enum contains an unknown value deserialized from
20134    /// the string representation of enums.
20135    pub fn value(&self) -> std::option::Option<i32> {
20136        match self {
20137            Self::Unspecified => std::option::Option::Some(0),
20138            Self::ReadOnly => std::option::Option::Some(1),
20139            Self::ReadWrite => std::option::Option::Some(2),
20140            Self::ReadNone => std::option::Option::Some(3),
20141            Self::UnknownValue(u) => u.0.value(),
20142        }
20143    }
20144
20145    /// Gets the enum value as a string.
20146    ///
20147    /// Returns `None` if the enum contains an unknown value deserialized from
20148    /// the integer representation of enums.
20149    pub fn name(&self) -> std::option::Option<&str> {
20150        match self {
20151            Self::Unspecified => std::option::Option::Some("ACCESS_TYPE_UNSPECIFIED"),
20152            Self::ReadOnly => std::option::Option::Some("READ_ONLY"),
20153            Self::ReadWrite => std::option::Option::Some("READ_WRITE"),
20154            Self::ReadNone => std::option::Option::Some("READ_NONE"),
20155            Self::UnknownValue(u) => u.0.name(),
20156        }
20157    }
20158}
20159
20160impl std::default::Default for AccessType {
20161    fn default() -> Self {
20162        use std::convert::From;
20163        Self::from(0)
20164    }
20165}
20166
20167impl std::fmt::Display for AccessType {
20168    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20169        wkt::internal::display_enum(f, self.name(), self.value())
20170    }
20171}
20172
20173impl std::convert::From<i32> for AccessType {
20174    fn from(value: i32) -> Self {
20175        match value {
20176            0 => Self::Unspecified,
20177            1 => Self::ReadOnly,
20178            2 => Self::ReadWrite,
20179            3 => Self::ReadNone,
20180            _ => Self::UnknownValue(access_type::UnknownValue(
20181                wkt::internal::UnknownEnumValue::Integer(value),
20182            )),
20183        }
20184    }
20185}
20186
20187impl std::convert::From<&str> for AccessType {
20188    fn from(value: &str) -> Self {
20189        use std::string::ToString;
20190        match value {
20191            "ACCESS_TYPE_UNSPECIFIED" => Self::Unspecified,
20192            "READ_ONLY" => Self::ReadOnly,
20193            "READ_WRITE" => Self::ReadWrite,
20194            "READ_NONE" => Self::ReadNone,
20195            _ => Self::UnknownValue(access_type::UnknownValue(
20196                wkt::internal::UnknownEnumValue::String(value.to_string()),
20197            )),
20198        }
20199    }
20200}
20201
20202impl serde::ser::Serialize for AccessType {
20203    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20204    where
20205        S: serde::Serializer,
20206    {
20207        match self {
20208            Self::Unspecified => serializer.serialize_i32(0),
20209            Self::ReadOnly => serializer.serialize_i32(1),
20210            Self::ReadWrite => serializer.serialize_i32(2),
20211            Self::ReadNone => serializer.serialize_i32(3),
20212            Self::UnknownValue(u) => u.0.serialize(serializer),
20213        }
20214    }
20215}
20216
20217impl<'de> serde::de::Deserialize<'de> for AccessType {
20218    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20219    where
20220        D: serde::Deserializer<'de>,
20221    {
20222        deserializer.deserialize_any(wkt::internal::EnumVisitor::<AccessType>::new(
20223            ".google.cloud.netapp.v1.AccessType",
20224        ))
20225    }
20226}
20227
20228/// SMBSettings
20229/// Modifies the behaviour of a SMB volume.
20230///
20231/// # Working with unknown values
20232///
20233/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20234/// additional enum variants at any time. Adding new variants is not considered
20235/// a breaking change. Applications should write their code in anticipation of:
20236///
20237/// - New values appearing in future releases of the client library, **and**
20238/// - New values received dynamically, without application changes.
20239///
20240/// Please consult the [Working with enums] section in the user guide for some
20241/// guidelines.
20242///
20243/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
20244#[derive(Clone, Debug, PartialEq)]
20245#[non_exhaustive]
20246pub enum SMBSettings {
20247    /// Unspecified default option
20248    Unspecified,
20249    /// SMB setting encrypt data
20250    EncryptData,
20251    /// SMB setting browsable
20252    Browsable,
20253    /// SMB setting notify change
20254    ChangeNotify,
20255    /// SMB setting not to notify change
20256    NonBrowsable,
20257    /// SMB setting oplocks
20258    Oplocks,
20259    /// SMB setting to show snapshots
20260    ShowSnapshot,
20261    /// SMB setting to show previous versions
20262    ShowPreviousVersions,
20263    /// SMB setting to access volume based on enumerartion
20264    AccessBasedEnumeration,
20265    /// Continuously available enumeration
20266    ContinuouslyAvailable,
20267    /// If set, the enum was initialized with an unknown value.
20268    ///
20269    /// Applications can examine the value using [SMBSettings::value] or
20270    /// [SMBSettings::name].
20271    UnknownValue(smb_settings::UnknownValue),
20272}
20273
20274#[doc(hidden)]
20275pub mod smb_settings {
20276    #[allow(unused_imports)]
20277    use super::*;
20278    #[derive(Clone, Debug, PartialEq)]
20279    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20280}
20281
20282impl SMBSettings {
20283    /// Gets the enum value.
20284    ///
20285    /// Returns `None` if the enum contains an unknown value deserialized from
20286    /// the string representation of enums.
20287    pub fn value(&self) -> std::option::Option<i32> {
20288        match self {
20289            Self::Unspecified => std::option::Option::Some(0),
20290            Self::EncryptData => std::option::Option::Some(1),
20291            Self::Browsable => std::option::Option::Some(2),
20292            Self::ChangeNotify => std::option::Option::Some(3),
20293            Self::NonBrowsable => std::option::Option::Some(4),
20294            Self::Oplocks => std::option::Option::Some(5),
20295            Self::ShowSnapshot => std::option::Option::Some(6),
20296            Self::ShowPreviousVersions => std::option::Option::Some(7),
20297            Self::AccessBasedEnumeration => std::option::Option::Some(8),
20298            Self::ContinuouslyAvailable => std::option::Option::Some(9),
20299            Self::UnknownValue(u) => u.0.value(),
20300        }
20301    }
20302
20303    /// Gets the enum value as a string.
20304    ///
20305    /// Returns `None` if the enum contains an unknown value deserialized from
20306    /// the integer representation of enums.
20307    pub fn name(&self) -> std::option::Option<&str> {
20308        match self {
20309            Self::Unspecified => std::option::Option::Some("SMB_SETTINGS_UNSPECIFIED"),
20310            Self::EncryptData => std::option::Option::Some("ENCRYPT_DATA"),
20311            Self::Browsable => std::option::Option::Some("BROWSABLE"),
20312            Self::ChangeNotify => std::option::Option::Some("CHANGE_NOTIFY"),
20313            Self::NonBrowsable => std::option::Option::Some("NON_BROWSABLE"),
20314            Self::Oplocks => std::option::Option::Some("OPLOCKS"),
20315            Self::ShowSnapshot => std::option::Option::Some("SHOW_SNAPSHOT"),
20316            Self::ShowPreviousVersions => std::option::Option::Some("SHOW_PREVIOUS_VERSIONS"),
20317            Self::AccessBasedEnumeration => std::option::Option::Some("ACCESS_BASED_ENUMERATION"),
20318            Self::ContinuouslyAvailable => std::option::Option::Some("CONTINUOUSLY_AVAILABLE"),
20319            Self::UnknownValue(u) => u.0.name(),
20320        }
20321    }
20322}
20323
20324impl std::default::Default for SMBSettings {
20325    fn default() -> Self {
20326        use std::convert::From;
20327        Self::from(0)
20328    }
20329}
20330
20331impl std::fmt::Display for SMBSettings {
20332    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20333        wkt::internal::display_enum(f, self.name(), self.value())
20334    }
20335}
20336
20337impl std::convert::From<i32> for SMBSettings {
20338    fn from(value: i32) -> Self {
20339        match value {
20340            0 => Self::Unspecified,
20341            1 => Self::EncryptData,
20342            2 => Self::Browsable,
20343            3 => Self::ChangeNotify,
20344            4 => Self::NonBrowsable,
20345            5 => Self::Oplocks,
20346            6 => Self::ShowSnapshot,
20347            7 => Self::ShowPreviousVersions,
20348            8 => Self::AccessBasedEnumeration,
20349            9 => Self::ContinuouslyAvailable,
20350            _ => Self::UnknownValue(smb_settings::UnknownValue(
20351                wkt::internal::UnknownEnumValue::Integer(value),
20352            )),
20353        }
20354    }
20355}
20356
20357impl std::convert::From<&str> for SMBSettings {
20358    fn from(value: &str) -> Self {
20359        use std::string::ToString;
20360        match value {
20361            "SMB_SETTINGS_UNSPECIFIED" => Self::Unspecified,
20362            "ENCRYPT_DATA" => Self::EncryptData,
20363            "BROWSABLE" => Self::Browsable,
20364            "CHANGE_NOTIFY" => Self::ChangeNotify,
20365            "NON_BROWSABLE" => Self::NonBrowsable,
20366            "OPLOCKS" => Self::Oplocks,
20367            "SHOW_SNAPSHOT" => Self::ShowSnapshot,
20368            "SHOW_PREVIOUS_VERSIONS" => Self::ShowPreviousVersions,
20369            "ACCESS_BASED_ENUMERATION" => Self::AccessBasedEnumeration,
20370            "CONTINUOUSLY_AVAILABLE" => Self::ContinuouslyAvailable,
20371            _ => Self::UnknownValue(smb_settings::UnknownValue(
20372                wkt::internal::UnknownEnumValue::String(value.to_string()),
20373            )),
20374        }
20375    }
20376}
20377
20378impl serde::ser::Serialize for SMBSettings {
20379    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20380    where
20381        S: serde::Serializer,
20382    {
20383        match self {
20384            Self::Unspecified => serializer.serialize_i32(0),
20385            Self::EncryptData => serializer.serialize_i32(1),
20386            Self::Browsable => serializer.serialize_i32(2),
20387            Self::ChangeNotify => serializer.serialize_i32(3),
20388            Self::NonBrowsable => serializer.serialize_i32(4),
20389            Self::Oplocks => serializer.serialize_i32(5),
20390            Self::ShowSnapshot => serializer.serialize_i32(6),
20391            Self::ShowPreviousVersions => serializer.serialize_i32(7),
20392            Self::AccessBasedEnumeration => serializer.serialize_i32(8),
20393            Self::ContinuouslyAvailable => serializer.serialize_i32(9),
20394            Self::UnknownValue(u) => u.0.serialize(serializer),
20395        }
20396    }
20397}
20398
20399impl<'de> serde::de::Deserialize<'de> for SMBSettings {
20400    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20401    where
20402        D: serde::Deserializer<'de>,
20403    {
20404        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SMBSettings>::new(
20405            ".google.cloud.netapp.v1.SMBSettings",
20406        ))
20407    }
20408}
20409
20410/// The security style of the volume, can be either UNIX or NTFS.
20411///
20412/// # Working with unknown values
20413///
20414/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20415/// additional enum variants at any time. Adding new variants is not considered
20416/// a breaking change. Applications should write their code in anticipation of:
20417///
20418/// - New values appearing in future releases of the client library, **and**
20419/// - New values received dynamically, without application changes.
20420///
20421/// Please consult the [Working with enums] section in the user guide for some
20422/// guidelines.
20423///
20424/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
20425#[derive(Clone, Debug, PartialEq)]
20426#[non_exhaustive]
20427pub enum SecurityStyle {
20428    /// SecurityStyle is unspecified
20429    Unspecified,
20430    /// SecurityStyle uses NTFS
20431    Ntfs,
20432    /// SecurityStyle uses UNIX
20433    Unix,
20434    /// If set, the enum was initialized with an unknown value.
20435    ///
20436    /// Applications can examine the value using [SecurityStyle::value] or
20437    /// [SecurityStyle::name].
20438    UnknownValue(security_style::UnknownValue),
20439}
20440
20441#[doc(hidden)]
20442pub mod security_style {
20443    #[allow(unused_imports)]
20444    use super::*;
20445    #[derive(Clone, Debug, PartialEq)]
20446    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20447}
20448
20449impl SecurityStyle {
20450    /// Gets the enum value.
20451    ///
20452    /// Returns `None` if the enum contains an unknown value deserialized from
20453    /// the string representation of enums.
20454    pub fn value(&self) -> std::option::Option<i32> {
20455        match self {
20456            Self::Unspecified => std::option::Option::Some(0),
20457            Self::Ntfs => std::option::Option::Some(1),
20458            Self::Unix => std::option::Option::Some(2),
20459            Self::UnknownValue(u) => u.0.value(),
20460        }
20461    }
20462
20463    /// Gets the enum value as a string.
20464    ///
20465    /// Returns `None` if the enum contains an unknown value deserialized from
20466    /// the integer representation of enums.
20467    pub fn name(&self) -> std::option::Option<&str> {
20468        match self {
20469            Self::Unspecified => std::option::Option::Some("SECURITY_STYLE_UNSPECIFIED"),
20470            Self::Ntfs => std::option::Option::Some("NTFS"),
20471            Self::Unix => std::option::Option::Some("UNIX"),
20472            Self::UnknownValue(u) => u.0.name(),
20473        }
20474    }
20475}
20476
20477impl std::default::Default for SecurityStyle {
20478    fn default() -> Self {
20479        use std::convert::From;
20480        Self::from(0)
20481    }
20482}
20483
20484impl std::fmt::Display for SecurityStyle {
20485    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20486        wkt::internal::display_enum(f, self.name(), self.value())
20487    }
20488}
20489
20490impl std::convert::From<i32> for SecurityStyle {
20491    fn from(value: i32) -> Self {
20492        match value {
20493            0 => Self::Unspecified,
20494            1 => Self::Ntfs,
20495            2 => Self::Unix,
20496            _ => Self::UnknownValue(security_style::UnknownValue(
20497                wkt::internal::UnknownEnumValue::Integer(value),
20498            )),
20499        }
20500    }
20501}
20502
20503impl std::convert::From<&str> for SecurityStyle {
20504    fn from(value: &str) -> Self {
20505        use std::string::ToString;
20506        match value {
20507            "SECURITY_STYLE_UNSPECIFIED" => Self::Unspecified,
20508            "NTFS" => Self::Ntfs,
20509            "UNIX" => Self::Unix,
20510            _ => Self::UnknownValue(security_style::UnknownValue(
20511                wkt::internal::UnknownEnumValue::String(value.to_string()),
20512            )),
20513        }
20514    }
20515}
20516
20517impl serde::ser::Serialize for SecurityStyle {
20518    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20519    where
20520        S: serde::Serializer,
20521    {
20522        match self {
20523            Self::Unspecified => serializer.serialize_i32(0),
20524            Self::Ntfs => serializer.serialize_i32(1),
20525            Self::Unix => serializer.serialize_i32(2),
20526            Self::UnknownValue(u) => u.0.serialize(serializer),
20527        }
20528    }
20529}
20530
20531impl<'de> serde::de::Deserialize<'de> for SecurityStyle {
20532    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20533    where
20534        D: serde::Deserializer<'de>,
20535    {
20536        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SecurityStyle>::new(
20537            ".google.cloud.netapp.v1.SecurityStyle",
20538        ))
20539    }
20540}
20541
20542/// Actions to be restricted for a volume.
20543///
20544/// # Working with unknown values
20545///
20546/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20547/// additional enum variants at any time. Adding new variants is not considered
20548/// a breaking change. Applications should write their code in anticipation of:
20549///
20550/// - New values appearing in future releases of the client library, **and**
20551/// - New values received dynamically, without application changes.
20552///
20553/// Please consult the [Working with enums] section in the user guide for some
20554/// guidelines.
20555///
20556/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
20557#[derive(Clone, Debug, PartialEq)]
20558#[non_exhaustive]
20559pub enum RestrictedAction {
20560    /// Unspecified restricted action
20561    Unspecified,
20562    /// Prevent volume from being deleted when mounted.
20563    Delete,
20564    /// If set, the enum was initialized with an unknown value.
20565    ///
20566    /// Applications can examine the value using [RestrictedAction::value] or
20567    /// [RestrictedAction::name].
20568    UnknownValue(restricted_action::UnknownValue),
20569}
20570
20571#[doc(hidden)]
20572pub mod restricted_action {
20573    #[allow(unused_imports)]
20574    use super::*;
20575    #[derive(Clone, Debug, PartialEq)]
20576    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20577}
20578
20579impl RestrictedAction {
20580    /// Gets the enum value.
20581    ///
20582    /// Returns `None` if the enum contains an unknown value deserialized from
20583    /// the string representation of enums.
20584    pub fn value(&self) -> std::option::Option<i32> {
20585        match self {
20586            Self::Unspecified => std::option::Option::Some(0),
20587            Self::Delete => std::option::Option::Some(1),
20588            Self::UnknownValue(u) => u.0.value(),
20589        }
20590    }
20591
20592    /// Gets the enum value as a string.
20593    ///
20594    /// Returns `None` if the enum contains an unknown value deserialized from
20595    /// the integer representation of enums.
20596    pub fn name(&self) -> std::option::Option<&str> {
20597        match self {
20598            Self::Unspecified => std::option::Option::Some("RESTRICTED_ACTION_UNSPECIFIED"),
20599            Self::Delete => std::option::Option::Some("DELETE"),
20600            Self::UnknownValue(u) => u.0.name(),
20601        }
20602    }
20603}
20604
20605impl std::default::Default for RestrictedAction {
20606    fn default() -> Self {
20607        use std::convert::From;
20608        Self::from(0)
20609    }
20610}
20611
20612impl std::fmt::Display for RestrictedAction {
20613    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20614        wkt::internal::display_enum(f, self.name(), self.value())
20615    }
20616}
20617
20618impl std::convert::From<i32> for RestrictedAction {
20619    fn from(value: i32) -> Self {
20620        match value {
20621            0 => Self::Unspecified,
20622            1 => Self::Delete,
20623            _ => Self::UnknownValue(restricted_action::UnknownValue(
20624                wkt::internal::UnknownEnumValue::Integer(value),
20625            )),
20626        }
20627    }
20628}
20629
20630impl std::convert::From<&str> for RestrictedAction {
20631    fn from(value: &str) -> Self {
20632        use std::string::ToString;
20633        match value {
20634            "RESTRICTED_ACTION_UNSPECIFIED" => Self::Unspecified,
20635            "DELETE" => Self::Delete,
20636            _ => Self::UnknownValue(restricted_action::UnknownValue(
20637                wkt::internal::UnknownEnumValue::String(value.to_string()),
20638            )),
20639        }
20640    }
20641}
20642
20643impl serde::ser::Serialize for RestrictedAction {
20644    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20645    where
20646        S: serde::Serializer,
20647    {
20648        match self {
20649            Self::Unspecified => serializer.serialize_i32(0),
20650            Self::Delete => serializer.serialize_i32(1),
20651            Self::UnknownValue(u) => u.0.serialize(serializer),
20652        }
20653    }
20654}
20655
20656impl<'de> serde::de::Deserialize<'de> for RestrictedAction {
20657    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20658    where
20659        D: serde::Deserializer<'de>,
20660    {
20661        deserializer.deserialize_any(wkt::internal::EnumVisitor::<RestrictedAction>::new(
20662            ".google.cloud.netapp.v1.RestrictedAction",
20663        ))
20664    }
20665}