Skip to main content

google_cloud_netapp_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_location;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34mod debug;
35mod deserialize;
36mod serialize;
37
38/// ListActiveDirectoriesRequest for requesting multiple active directories.
39#[derive(Clone, Default, PartialEq)]
40#[non_exhaustive]
41pub struct ListActiveDirectoriesRequest {
42    /// Required. Parent value for ListActiveDirectoriesRequest
43    pub parent: std::string::String,
44
45    /// Requested page size. Server may return fewer items than requested.
46    /// If unspecified, the server will pick an appropriate default.
47    pub page_size: i32,
48
49    /// A token identifying a page of results the server should return.
50    pub page_token: std::string::String,
51
52    /// Filtering results
53    pub filter: std::string::String,
54
55    /// Hint for how to order the results
56    pub order_by: std::string::String,
57
58    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
59}
60
61impl ListActiveDirectoriesRequest {
62    /// Creates a new default instance.
63    pub fn new() -> Self {
64        std::default::Default::default()
65    }
66
67    /// Sets the value of [parent][crate::model::ListActiveDirectoriesRequest::parent].
68    ///
69    /// # Example
70    /// ```ignore,no_run
71    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
72    /// # let project_id = "project_id";
73    /// # let location_id = "location_id";
74    /// let x = ListActiveDirectoriesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
75    /// ```
76    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
77        self.parent = v.into();
78        self
79    }
80
81    /// Sets the value of [page_size][crate::model::ListActiveDirectoriesRequest::page_size].
82    ///
83    /// # Example
84    /// ```ignore,no_run
85    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
86    /// let x = ListActiveDirectoriesRequest::new().set_page_size(42);
87    /// ```
88    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
89        self.page_size = v.into();
90        self
91    }
92
93    /// Sets the value of [page_token][crate::model::ListActiveDirectoriesRequest::page_token].
94    ///
95    /// # Example
96    /// ```ignore,no_run
97    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
98    /// let x = ListActiveDirectoriesRequest::new().set_page_token("example");
99    /// ```
100    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
101        self.page_token = v.into();
102        self
103    }
104
105    /// Sets the value of [filter][crate::model::ListActiveDirectoriesRequest::filter].
106    ///
107    /// # Example
108    /// ```ignore,no_run
109    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
110    /// let x = ListActiveDirectoriesRequest::new().set_filter("example");
111    /// ```
112    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
113        self.filter = v.into();
114        self
115    }
116
117    /// Sets the value of [order_by][crate::model::ListActiveDirectoriesRequest::order_by].
118    ///
119    /// # Example
120    /// ```ignore,no_run
121    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
122    /// let x = ListActiveDirectoriesRequest::new().set_order_by("example");
123    /// ```
124    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
125        self.order_by = v.into();
126        self
127    }
128}
129
130impl wkt::message::Message for ListActiveDirectoriesRequest {
131    fn typename() -> &'static str {
132        "type.googleapis.com/google.cloud.netapp.v1.ListActiveDirectoriesRequest"
133    }
134}
135
136/// ListActiveDirectoriesResponse contains all the active directories requested.
137#[derive(Clone, Default, PartialEq)]
138#[non_exhaustive]
139pub struct ListActiveDirectoriesResponse {
140    /// The list of active directories.
141    pub active_directories: std::vec::Vec<crate::model::ActiveDirectory>,
142
143    /// A token identifying a page of results the server should return.
144    pub next_page_token: std::string::String,
145
146    /// Locations that could not be reached.
147    pub unreachable: std::vec::Vec<std::string::String>,
148
149    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
150}
151
152impl ListActiveDirectoriesResponse {
153    /// Creates a new default instance.
154    pub fn new() -> Self {
155        std::default::Default::default()
156    }
157
158    /// Sets the value of [active_directories][crate::model::ListActiveDirectoriesResponse::active_directories].
159    ///
160    /// # Example
161    /// ```ignore,no_run
162    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesResponse;
163    /// use google_cloud_netapp_v1::model::ActiveDirectory;
164    /// let x = ListActiveDirectoriesResponse::new()
165    ///     .set_active_directories([
166    ///         ActiveDirectory::default()/* use setters */,
167    ///         ActiveDirectory::default()/* use (different) setters */,
168    ///     ]);
169    /// ```
170    pub fn set_active_directories<T, V>(mut self, v: T) -> Self
171    where
172        T: std::iter::IntoIterator<Item = V>,
173        V: std::convert::Into<crate::model::ActiveDirectory>,
174    {
175        use std::iter::Iterator;
176        self.active_directories = v.into_iter().map(|i| i.into()).collect();
177        self
178    }
179
180    /// Sets the value of [next_page_token][crate::model::ListActiveDirectoriesResponse::next_page_token].
181    ///
182    /// # Example
183    /// ```ignore,no_run
184    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesResponse;
185    /// let x = ListActiveDirectoriesResponse::new().set_next_page_token("example");
186    /// ```
187    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
188        self.next_page_token = v.into();
189        self
190    }
191
192    /// Sets the value of [unreachable][crate::model::ListActiveDirectoriesResponse::unreachable].
193    ///
194    /// # Example
195    /// ```ignore,no_run
196    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesResponse;
197    /// let x = ListActiveDirectoriesResponse::new().set_unreachable(["a", "b", "c"]);
198    /// ```
199    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
200    where
201        T: std::iter::IntoIterator<Item = V>,
202        V: std::convert::Into<std::string::String>,
203    {
204        use std::iter::Iterator;
205        self.unreachable = v.into_iter().map(|i| i.into()).collect();
206        self
207    }
208}
209
210impl wkt::message::Message for ListActiveDirectoriesResponse {
211    fn typename() -> &'static str {
212        "type.googleapis.com/google.cloud.netapp.v1.ListActiveDirectoriesResponse"
213    }
214}
215
216#[doc(hidden)]
217impl google_cloud_gax::paginator::internal::PageableResponse for ListActiveDirectoriesResponse {
218    type PageItem = crate::model::ActiveDirectory;
219
220    fn items(self) -> std::vec::Vec<Self::PageItem> {
221        self.active_directories
222    }
223
224    fn next_page_token(&self) -> std::string::String {
225        use std::clone::Clone;
226        self.next_page_token.clone()
227    }
228}
229
230/// GetActiveDirectory for getting a single active directory.
231#[derive(Clone, Default, PartialEq)]
232#[non_exhaustive]
233pub struct GetActiveDirectoryRequest {
234    /// Required. Name of the active directory.
235    pub name: std::string::String,
236
237    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
238}
239
240impl GetActiveDirectoryRequest {
241    /// Creates a new default instance.
242    pub fn new() -> Self {
243        std::default::Default::default()
244    }
245
246    /// Sets the value of [name][crate::model::GetActiveDirectoryRequest::name].
247    ///
248    /// # Example
249    /// ```ignore,no_run
250    /// # use google_cloud_netapp_v1::model::GetActiveDirectoryRequest;
251    /// # let project_id = "project_id";
252    /// # let location_id = "location_id";
253    /// # let active_directory_id = "active_directory_id";
254    /// let x = GetActiveDirectoryRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/activeDirectories/{active_directory_id}"));
255    /// ```
256    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
257        self.name = v.into();
258        self
259    }
260}
261
262impl wkt::message::Message for GetActiveDirectoryRequest {
263    fn typename() -> &'static str {
264        "type.googleapis.com/google.cloud.netapp.v1.GetActiveDirectoryRequest"
265    }
266}
267
268/// CreateActiveDirectoryRequest for creating an active directory.
269#[derive(Clone, Default, PartialEq)]
270#[non_exhaustive]
271pub struct CreateActiveDirectoryRequest {
272    /// Required. Value for parent.
273    pub parent: std::string::String,
274
275    /// Required. Fields of the to be created active directory.
276    pub active_directory: std::option::Option<crate::model::ActiveDirectory>,
277
278    /// Required. ID of the active directory to create. Must be unique within the
279    /// parent resource. Must contain only letters, numbers and hyphen, with the
280    /// first character a letter , the last a letter or a number, and a 63
281    /// character maximum.
282    pub active_directory_id: std::string::String,
283
284    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
285}
286
287impl CreateActiveDirectoryRequest {
288    /// Creates a new default instance.
289    pub fn new() -> Self {
290        std::default::Default::default()
291    }
292
293    /// Sets the value of [parent][crate::model::CreateActiveDirectoryRequest::parent].
294    ///
295    /// # Example
296    /// ```ignore,no_run
297    /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
298    /// # let project_id = "project_id";
299    /// # let location_id = "location_id";
300    /// let x = CreateActiveDirectoryRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
301    /// ```
302    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
303        self.parent = v.into();
304        self
305    }
306
307    /// Sets the value of [active_directory][crate::model::CreateActiveDirectoryRequest::active_directory].
308    ///
309    /// # Example
310    /// ```ignore,no_run
311    /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
312    /// use google_cloud_netapp_v1::model::ActiveDirectory;
313    /// let x = CreateActiveDirectoryRequest::new().set_active_directory(ActiveDirectory::default()/* use setters */);
314    /// ```
315    pub fn set_active_directory<T>(mut self, v: T) -> Self
316    where
317        T: std::convert::Into<crate::model::ActiveDirectory>,
318    {
319        self.active_directory = std::option::Option::Some(v.into());
320        self
321    }
322
323    /// Sets or clears the value of [active_directory][crate::model::CreateActiveDirectoryRequest::active_directory].
324    ///
325    /// # Example
326    /// ```ignore,no_run
327    /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
328    /// use google_cloud_netapp_v1::model::ActiveDirectory;
329    /// let x = CreateActiveDirectoryRequest::new().set_or_clear_active_directory(Some(ActiveDirectory::default()/* use setters */));
330    /// let x = CreateActiveDirectoryRequest::new().set_or_clear_active_directory(None::<ActiveDirectory>);
331    /// ```
332    pub fn set_or_clear_active_directory<T>(mut self, v: std::option::Option<T>) -> Self
333    where
334        T: std::convert::Into<crate::model::ActiveDirectory>,
335    {
336        self.active_directory = v.map(|x| x.into());
337        self
338    }
339
340    /// Sets the value of [active_directory_id][crate::model::CreateActiveDirectoryRequest::active_directory_id].
341    ///
342    /// # Example
343    /// ```ignore,no_run
344    /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
345    /// let x = CreateActiveDirectoryRequest::new().set_active_directory_id("example");
346    /// ```
347    pub fn set_active_directory_id<T: std::convert::Into<std::string::String>>(
348        mut self,
349        v: T,
350    ) -> Self {
351        self.active_directory_id = v.into();
352        self
353    }
354}
355
356impl wkt::message::Message for CreateActiveDirectoryRequest {
357    fn typename() -> &'static str {
358        "type.googleapis.com/google.cloud.netapp.v1.CreateActiveDirectoryRequest"
359    }
360}
361
362/// UpdateActiveDirectoryRequest for updating an active directory.
363#[derive(Clone, Default, PartialEq)]
364#[non_exhaustive]
365pub struct UpdateActiveDirectoryRequest {
366    /// Required. Field mask is used to specify the fields to be overwritten in the
367    /// Active Directory resource by the update.
368    /// The fields specified in the update_mask are relative to the resource, not
369    /// the full request. A field will be overwritten if it is in the mask. If the
370    /// user does not provide a mask then all fields will be overwritten.
371    pub update_mask: std::option::Option<wkt::FieldMask>,
372
373    /// Required. The volume being updated
374    pub active_directory: std::option::Option<crate::model::ActiveDirectory>,
375
376    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
377}
378
379impl UpdateActiveDirectoryRequest {
380    /// Creates a new default instance.
381    pub fn new() -> Self {
382        std::default::Default::default()
383    }
384
385    /// Sets the value of [update_mask][crate::model::UpdateActiveDirectoryRequest::update_mask].
386    ///
387    /// # Example
388    /// ```ignore,no_run
389    /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
390    /// use wkt::FieldMask;
391    /// let x = UpdateActiveDirectoryRequest::new().set_update_mask(FieldMask::default()/* use setters */);
392    /// ```
393    pub fn set_update_mask<T>(mut self, v: T) -> Self
394    where
395        T: std::convert::Into<wkt::FieldMask>,
396    {
397        self.update_mask = std::option::Option::Some(v.into());
398        self
399    }
400
401    /// Sets or clears the value of [update_mask][crate::model::UpdateActiveDirectoryRequest::update_mask].
402    ///
403    /// # Example
404    /// ```ignore,no_run
405    /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
406    /// use wkt::FieldMask;
407    /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
408    /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_update_mask(None::<FieldMask>);
409    /// ```
410    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
411    where
412        T: std::convert::Into<wkt::FieldMask>,
413    {
414        self.update_mask = v.map(|x| x.into());
415        self
416    }
417
418    /// Sets the value of [active_directory][crate::model::UpdateActiveDirectoryRequest::active_directory].
419    ///
420    /// # Example
421    /// ```ignore,no_run
422    /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
423    /// use google_cloud_netapp_v1::model::ActiveDirectory;
424    /// let x = UpdateActiveDirectoryRequest::new().set_active_directory(ActiveDirectory::default()/* use setters */);
425    /// ```
426    pub fn set_active_directory<T>(mut self, v: T) -> Self
427    where
428        T: std::convert::Into<crate::model::ActiveDirectory>,
429    {
430        self.active_directory = std::option::Option::Some(v.into());
431        self
432    }
433
434    /// Sets or clears the value of [active_directory][crate::model::UpdateActiveDirectoryRequest::active_directory].
435    ///
436    /// # Example
437    /// ```ignore,no_run
438    /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
439    /// use google_cloud_netapp_v1::model::ActiveDirectory;
440    /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_active_directory(Some(ActiveDirectory::default()/* use setters */));
441    /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_active_directory(None::<ActiveDirectory>);
442    /// ```
443    pub fn set_or_clear_active_directory<T>(mut self, v: std::option::Option<T>) -> Self
444    where
445        T: std::convert::Into<crate::model::ActiveDirectory>,
446    {
447        self.active_directory = v.map(|x| x.into());
448        self
449    }
450}
451
452impl wkt::message::Message for UpdateActiveDirectoryRequest {
453    fn typename() -> &'static str {
454        "type.googleapis.com/google.cloud.netapp.v1.UpdateActiveDirectoryRequest"
455    }
456}
457
458/// DeleteActiveDirectoryRequest for deleting a single active directory.
459#[derive(Clone, Default, PartialEq)]
460#[non_exhaustive]
461pub struct DeleteActiveDirectoryRequest {
462    /// Required. Name of the active directory.
463    pub name: std::string::String,
464
465    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
466}
467
468impl DeleteActiveDirectoryRequest {
469    /// Creates a new default instance.
470    pub fn new() -> Self {
471        std::default::Default::default()
472    }
473
474    /// Sets the value of [name][crate::model::DeleteActiveDirectoryRequest::name].
475    ///
476    /// # Example
477    /// ```ignore,no_run
478    /// # use google_cloud_netapp_v1::model::DeleteActiveDirectoryRequest;
479    /// # let project_id = "project_id";
480    /// # let location_id = "location_id";
481    /// # let active_directory_id = "active_directory_id";
482    /// let x = DeleteActiveDirectoryRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/activeDirectories/{active_directory_id}"));
483    /// ```
484    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
485        self.name = v.into();
486        self
487    }
488}
489
490impl wkt::message::Message for DeleteActiveDirectoryRequest {
491    fn typename() -> &'static str {
492        "type.googleapis.com/google.cloud.netapp.v1.DeleteActiveDirectoryRequest"
493    }
494}
495
496/// ActiveDirectory is the public representation of the active directory config.
497#[derive(Clone, Default, PartialEq)]
498#[non_exhaustive]
499pub struct ActiveDirectory {
500    /// Identifier. The resource name of the active directory.
501    /// Format:
502    /// `projects/{project_number}/locations/{location_id}/activeDirectories/{active_directory_id}`.
503    pub name: std::string::String,
504
505    /// Output only. Create time of the active directory.
506    pub create_time: std::option::Option<wkt::Timestamp>,
507
508    /// Output only. The state of the AD.
509    pub state: crate::model::active_directory::State,
510
511    /// Required. Name of the Active Directory domain
512    pub domain: std::string::String,
513
514    /// The Active Directory site the service will limit Domain Controller
515    /// discovery too.
516    pub site: std::string::String,
517
518    /// Required. Comma separated list of DNS server IP addresses for the Active
519    /// Directory domain.
520    pub dns: std::string::String,
521
522    /// Required. NetBIOSPrefix is used as a prefix for SMB server name.
523    pub net_bios_prefix: std::string::String,
524
525    /// The Organizational Unit (OU) within the Windows Active Directory the user
526    /// belongs to.
527    pub organizational_unit: std::string::String,
528
529    /// If enabled, AES encryption will be enabled for SMB communication.
530    pub aes_encryption: bool,
531
532    /// Required. Username of the Active Directory domain administrator.
533    pub username: std::string::String,
534
535    /// Required. Password of the Active Directory domain administrator.
536    pub password: std::string::String,
537
538    /// Optional. Users to be added to the Built-in Backup Operator active
539    /// directory group.
540    pub backup_operators: std::vec::Vec<std::string::String>,
541
542    /// Optional. Users to be added to the Built-in Admininstrators group.
543    pub administrators: std::vec::Vec<std::string::String>,
544
545    /// Optional. Domain users to be given the SeSecurityPrivilege.
546    pub security_operators: std::vec::Vec<std::string::String>,
547
548    /// Name of the active directory machine. This optional parameter is used only
549    /// while creating kerberos volume
550    pub kdc_hostname: std::string::String,
551
552    /// KDC server IP address for the active directory machine.
553    pub kdc_ip: std::string::String,
554
555    /// If enabled, will allow access to local users and LDAP users. If access is
556    /// needed for only LDAP users, it has to be disabled.
557    pub nfs_users_with_ldap: bool,
558
559    /// Description of the active directory.
560    pub description: std::string::String,
561
562    /// Specifies whether or not the LDAP traffic needs to be signed.
563    pub ldap_signing: bool,
564
565    /// If enabled, traffic between the SMB server to Domain Controller (DC) will
566    /// be encrypted.
567    pub encrypt_dc_connections: bool,
568
569    /// Labels for the active directory.
570    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
571
572    /// Output only. The state details of the Active Directory.
573    pub state_details: std::string::String,
574
575    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
576}
577
578impl ActiveDirectory {
579    /// Creates a new default instance.
580    pub fn new() -> Self {
581        std::default::Default::default()
582    }
583
584    /// Sets the value of [name][crate::model::ActiveDirectory::name].
585    ///
586    /// # Example
587    /// ```ignore,no_run
588    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
589    /// # let project_id = "project_id";
590    /// # let location_id = "location_id";
591    /// # let active_directory_id = "active_directory_id";
592    /// let x = ActiveDirectory::new().set_name(format!("projects/{project_id}/locations/{location_id}/activeDirectories/{active_directory_id}"));
593    /// ```
594    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
595        self.name = v.into();
596        self
597    }
598
599    /// Sets the value of [create_time][crate::model::ActiveDirectory::create_time].
600    ///
601    /// # Example
602    /// ```ignore,no_run
603    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
604    /// use wkt::Timestamp;
605    /// let x = ActiveDirectory::new().set_create_time(Timestamp::default()/* use setters */);
606    /// ```
607    pub fn set_create_time<T>(mut self, v: T) -> Self
608    where
609        T: std::convert::Into<wkt::Timestamp>,
610    {
611        self.create_time = std::option::Option::Some(v.into());
612        self
613    }
614
615    /// Sets or clears the value of [create_time][crate::model::ActiveDirectory::create_time].
616    ///
617    /// # Example
618    /// ```ignore,no_run
619    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
620    /// use wkt::Timestamp;
621    /// let x = ActiveDirectory::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
622    /// let x = ActiveDirectory::new().set_or_clear_create_time(None::<Timestamp>);
623    /// ```
624    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
625    where
626        T: std::convert::Into<wkt::Timestamp>,
627    {
628        self.create_time = v.map(|x| x.into());
629        self
630    }
631
632    /// Sets the value of [state][crate::model::ActiveDirectory::state].
633    ///
634    /// # Example
635    /// ```ignore,no_run
636    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
637    /// use google_cloud_netapp_v1::model::active_directory::State;
638    /// let x0 = ActiveDirectory::new().set_state(State::Creating);
639    /// let x1 = ActiveDirectory::new().set_state(State::Ready);
640    /// let x2 = ActiveDirectory::new().set_state(State::Updating);
641    /// ```
642    pub fn set_state<T: std::convert::Into<crate::model::active_directory::State>>(
643        mut self,
644        v: T,
645    ) -> Self {
646        self.state = v.into();
647        self
648    }
649
650    /// Sets the value of [domain][crate::model::ActiveDirectory::domain].
651    ///
652    /// # Example
653    /// ```ignore,no_run
654    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
655    /// let x = ActiveDirectory::new().set_domain("example");
656    /// ```
657    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
658        self.domain = v.into();
659        self
660    }
661
662    /// Sets the value of [site][crate::model::ActiveDirectory::site].
663    ///
664    /// # Example
665    /// ```ignore,no_run
666    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
667    /// let x = ActiveDirectory::new().set_site("example");
668    /// ```
669    pub fn set_site<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
670        self.site = v.into();
671        self
672    }
673
674    /// Sets the value of [dns][crate::model::ActiveDirectory::dns].
675    ///
676    /// # Example
677    /// ```ignore,no_run
678    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
679    /// let x = ActiveDirectory::new().set_dns("example");
680    /// ```
681    pub fn set_dns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
682        self.dns = v.into();
683        self
684    }
685
686    /// Sets the value of [net_bios_prefix][crate::model::ActiveDirectory::net_bios_prefix].
687    ///
688    /// # Example
689    /// ```ignore,no_run
690    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
691    /// let x = ActiveDirectory::new().set_net_bios_prefix("example");
692    /// ```
693    pub fn set_net_bios_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
694        self.net_bios_prefix = v.into();
695        self
696    }
697
698    /// Sets the value of [organizational_unit][crate::model::ActiveDirectory::organizational_unit].
699    ///
700    /// # Example
701    /// ```ignore,no_run
702    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
703    /// let x = ActiveDirectory::new().set_organizational_unit("example");
704    /// ```
705    pub fn set_organizational_unit<T: std::convert::Into<std::string::String>>(
706        mut self,
707        v: T,
708    ) -> Self {
709        self.organizational_unit = v.into();
710        self
711    }
712
713    /// Sets the value of [aes_encryption][crate::model::ActiveDirectory::aes_encryption].
714    ///
715    /// # Example
716    /// ```ignore,no_run
717    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
718    /// let x = ActiveDirectory::new().set_aes_encryption(true);
719    /// ```
720    pub fn set_aes_encryption<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
721        self.aes_encryption = v.into();
722        self
723    }
724
725    /// Sets the value of [username][crate::model::ActiveDirectory::username].
726    ///
727    /// # Example
728    /// ```ignore,no_run
729    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
730    /// let x = ActiveDirectory::new().set_username("example");
731    /// ```
732    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
733        self.username = v.into();
734        self
735    }
736
737    /// Sets the value of [password][crate::model::ActiveDirectory::password].
738    ///
739    /// # Example
740    /// ```ignore,no_run
741    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
742    /// let x = ActiveDirectory::new().set_password("example");
743    /// ```
744    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
745        self.password = v.into();
746        self
747    }
748
749    /// Sets the value of [backup_operators][crate::model::ActiveDirectory::backup_operators].
750    ///
751    /// # Example
752    /// ```ignore,no_run
753    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
754    /// let x = ActiveDirectory::new().set_backup_operators(["a", "b", "c"]);
755    /// ```
756    pub fn set_backup_operators<T, V>(mut self, v: T) -> Self
757    where
758        T: std::iter::IntoIterator<Item = V>,
759        V: std::convert::Into<std::string::String>,
760    {
761        use std::iter::Iterator;
762        self.backup_operators = v.into_iter().map(|i| i.into()).collect();
763        self
764    }
765
766    /// Sets the value of [administrators][crate::model::ActiveDirectory::administrators].
767    ///
768    /// # Example
769    /// ```ignore,no_run
770    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
771    /// let x = ActiveDirectory::new().set_administrators(["a", "b", "c"]);
772    /// ```
773    pub fn set_administrators<T, V>(mut self, v: T) -> Self
774    where
775        T: std::iter::IntoIterator<Item = V>,
776        V: std::convert::Into<std::string::String>,
777    {
778        use std::iter::Iterator;
779        self.administrators = v.into_iter().map(|i| i.into()).collect();
780        self
781    }
782
783    /// Sets the value of [security_operators][crate::model::ActiveDirectory::security_operators].
784    ///
785    /// # Example
786    /// ```ignore,no_run
787    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
788    /// let x = ActiveDirectory::new().set_security_operators(["a", "b", "c"]);
789    /// ```
790    pub fn set_security_operators<T, V>(mut self, v: T) -> Self
791    where
792        T: std::iter::IntoIterator<Item = V>,
793        V: std::convert::Into<std::string::String>,
794    {
795        use std::iter::Iterator;
796        self.security_operators = v.into_iter().map(|i| i.into()).collect();
797        self
798    }
799
800    /// Sets the value of [kdc_hostname][crate::model::ActiveDirectory::kdc_hostname].
801    ///
802    /// # Example
803    /// ```ignore,no_run
804    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
805    /// let x = ActiveDirectory::new().set_kdc_hostname("example");
806    /// ```
807    pub fn set_kdc_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
808        self.kdc_hostname = v.into();
809        self
810    }
811
812    /// Sets the value of [kdc_ip][crate::model::ActiveDirectory::kdc_ip].
813    ///
814    /// # Example
815    /// ```ignore,no_run
816    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
817    /// let x = ActiveDirectory::new().set_kdc_ip("example");
818    /// ```
819    pub fn set_kdc_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
820        self.kdc_ip = v.into();
821        self
822    }
823
824    /// Sets the value of [nfs_users_with_ldap][crate::model::ActiveDirectory::nfs_users_with_ldap].
825    ///
826    /// # Example
827    /// ```ignore,no_run
828    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
829    /// let x = ActiveDirectory::new().set_nfs_users_with_ldap(true);
830    /// ```
831    pub fn set_nfs_users_with_ldap<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
832        self.nfs_users_with_ldap = v.into();
833        self
834    }
835
836    /// Sets the value of [description][crate::model::ActiveDirectory::description].
837    ///
838    /// # Example
839    /// ```ignore,no_run
840    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
841    /// let x = ActiveDirectory::new().set_description("example");
842    /// ```
843    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
844        self.description = v.into();
845        self
846    }
847
848    /// Sets the value of [ldap_signing][crate::model::ActiveDirectory::ldap_signing].
849    ///
850    /// # Example
851    /// ```ignore,no_run
852    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
853    /// let x = ActiveDirectory::new().set_ldap_signing(true);
854    /// ```
855    pub fn set_ldap_signing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
856        self.ldap_signing = v.into();
857        self
858    }
859
860    /// Sets the value of [encrypt_dc_connections][crate::model::ActiveDirectory::encrypt_dc_connections].
861    ///
862    /// # Example
863    /// ```ignore,no_run
864    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
865    /// let x = ActiveDirectory::new().set_encrypt_dc_connections(true);
866    /// ```
867    pub fn set_encrypt_dc_connections<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
868        self.encrypt_dc_connections = v.into();
869        self
870    }
871
872    /// Sets the value of [labels][crate::model::ActiveDirectory::labels].
873    ///
874    /// # Example
875    /// ```ignore,no_run
876    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
877    /// let x = ActiveDirectory::new().set_labels([
878    ///     ("key0", "abc"),
879    ///     ("key1", "xyz"),
880    /// ]);
881    /// ```
882    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
883    where
884        T: std::iter::IntoIterator<Item = (K, V)>,
885        K: std::convert::Into<std::string::String>,
886        V: std::convert::Into<std::string::String>,
887    {
888        use std::iter::Iterator;
889        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
890        self
891    }
892
893    /// Sets the value of [state_details][crate::model::ActiveDirectory::state_details].
894    ///
895    /// # Example
896    /// ```ignore,no_run
897    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
898    /// let x = ActiveDirectory::new().set_state_details("example");
899    /// ```
900    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
901        self.state_details = v.into();
902        self
903    }
904}
905
906impl wkt::message::Message for ActiveDirectory {
907    fn typename() -> &'static str {
908        "type.googleapis.com/google.cloud.netapp.v1.ActiveDirectory"
909    }
910}
911
912/// Defines additional types related to [ActiveDirectory].
913pub mod active_directory {
914    #[allow(unused_imports)]
915    use super::*;
916
917    /// The Active Directory States
918    ///
919    /// # Working with unknown values
920    ///
921    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
922    /// additional enum variants at any time. Adding new variants is not considered
923    /// a breaking change. Applications should write their code in anticipation of:
924    ///
925    /// - New values appearing in future releases of the client library, **and**
926    /// - New values received dynamically, without application changes.
927    ///
928    /// Please consult the [Working with enums] section in the user guide for some
929    /// guidelines.
930    ///
931    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
932    #[derive(Clone, Debug, PartialEq)]
933    #[non_exhaustive]
934    pub enum State {
935        /// Unspecified Active Directory State
936        Unspecified,
937        /// Active Directory State is Creating
938        Creating,
939        /// Active Directory State is Ready
940        Ready,
941        /// Active Directory State is Updating
942        Updating,
943        /// Active Directory State is In use
944        InUse,
945        /// Active Directory State is Deleting
946        Deleting,
947        /// Active Directory State is Error
948        Error,
949        /// Active Directory State is Diagnosing.
950        Diagnosing,
951        /// If set, the enum was initialized with an unknown value.
952        ///
953        /// Applications can examine the value using [State::value] or
954        /// [State::name].
955        UnknownValue(state::UnknownValue),
956    }
957
958    #[doc(hidden)]
959    pub mod state {
960        #[allow(unused_imports)]
961        use super::*;
962        #[derive(Clone, Debug, PartialEq)]
963        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
964    }
965
966    impl State {
967        /// Gets the enum value.
968        ///
969        /// Returns `None` if the enum contains an unknown value deserialized from
970        /// the string representation of enums.
971        pub fn value(&self) -> std::option::Option<i32> {
972            match self {
973                Self::Unspecified => std::option::Option::Some(0),
974                Self::Creating => std::option::Option::Some(1),
975                Self::Ready => std::option::Option::Some(2),
976                Self::Updating => std::option::Option::Some(3),
977                Self::InUse => std::option::Option::Some(4),
978                Self::Deleting => std::option::Option::Some(5),
979                Self::Error => std::option::Option::Some(6),
980                Self::Diagnosing => std::option::Option::Some(7),
981                Self::UnknownValue(u) => u.0.value(),
982            }
983        }
984
985        /// Gets the enum value as a string.
986        ///
987        /// Returns `None` if the enum contains an unknown value deserialized from
988        /// the integer representation of enums.
989        pub fn name(&self) -> std::option::Option<&str> {
990            match self {
991                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
992                Self::Creating => std::option::Option::Some("CREATING"),
993                Self::Ready => std::option::Option::Some("READY"),
994                Self::Updating => std::option::Option::Some("UPDATING"),
995                Self::InUse => std::option::Option::Some("IN_USE"),
996                Self::Deleting => std::option::Option::Some("DELETING"),
997                Self::Error => std::option::Option::Some("ERROR"),
998                Self::Diagnosing => std::option::Option::Some("DIAGNOSING"),
999                Self::UnknownValue(u) => u.0.name(),
1000            }
1001        }
1002    }
1003
1004    impl std::default::Default for State {
1005        fn default() -> Self {
1006            use std::convert::From;
1007            Self::from(0)
1008        }
1009    }
1010
1011    impl std::fmt::Display for State {
1012        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1013            wkt::internal::display_enum(f, self.name(), self.value())
1014        }
1015    }
1016
1017    impl std::convert::From<i32> for State {
1018        fn from(value: i32) -> Self {
1019            match value {
1020                0 => Self::Unspecified,
1021                1 => Self::Creating,
1022                2 => Self::Ready,
1023                3 => Self::Updating,
1024                4 => Self::InUse,
1025                5 => Self::Deleting,
1026                6 => Self::Error,
1027                7 => Self::Diagnosing,
1028                _ => Self::UnknownValue(state::UnknownValue(
1029                    wkt::internal::UnknownEnumValue::Integer(value),
1030                )),
1031            }
1032        }
1033    }
1034
1035    impl std::convert::From<&str> for State {
1036        fn from(value: &str) -> Self {
1037            use std::string::ToString;
1038            match value {
1039                "STATE_UNSPECIFIED" => Self::Unspecified,
1040                "CREATING" => Self::Creating,
1041                "READY" => Self::Ready,
1042                "UPDATING" => Self::Updating,
1043                "IN_USE" => Self::InUse,
1044                "DELETING" => Self::Deleting,
1045                "ERROR" => Self::Error,
1046                "DIAGNOSING" => Self::Diagnosing,
1047                _ => Self::UnknownValue(state::UnknownValue(
1048                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1049                )),
1050            }
1051        }
1052    }
1053
1054    impl serde::ser::Serialize for State {
1055        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1056        where
1057            S: serde::Serializer,
1058        {
1059            match self {
1060                Self::Unspecified => serializer.serialize_i32(0),
1061                Self::Creating => serializer.serialize_i32(1),
1062                Self::Ready => serializer.serialize_i32(2),
1063                Self::Updating => serializer.serialize_i32(3),
1064                Self::InUse => serializer.serialize_i32(4),
1065                Self::Deleting => serializer.serialize_i32(5),
1066                Self::Error => serializer.serialize_i32(6),
1067                Self::Diagnosing => serializer.serialize_i32(7),
1068                Self::UnknownValue(u) => u.0.serialize(serializer),
1069            }
1070        }
1071    }
1072
1073    impl<'de> serde::de::Deserialize<'de> for State {
1074        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1075        where
1076            D: serde::Deserializer<'de>,
1077        {
1078            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1079                ".google.cloud.netapp.v1.ActiveDirectory.State",
1080            ))
1081        }
1082    }
1083}
1084
1085/// A NetApp Backup.
1086#[derive(Clone, Default, PartialEq)]
1087#[non_exhaustive]
1088pub struct Backup {
1089    /// Identifier. The resource name of the backup.
1090    /// Format:
1091    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`.
1092    pub name: std::string::String,
1093
1094    /// Output only. The backup state.
1095    pub state: crate::model::backup::State,
1096
1097    /// A description of the backup with 2048 characters or less.
1098    /// Requests with longer descriptions will be rejected.
1099    pub description: std::string::String,
1100
1101    /// Output only. Size of the file system when the backup was created. When
1102    /// creating a new volume from the backup, the volume capacity will have to be
1103    /// at least as big.
1104    pub volume_usage_bytes: i64,
1105
1106    /// Output only. Type of backup, manually created or created by a backup
1107    /// policy.
1108    pub backup_type: crate::model::backup::Type,
1109
1110    /// Volume full name of this backup belongs to.
1111    /// Either source_volume or ontap_source should be provided.
1112    /// Format:
1113    /// `projects/{projects_id}/locations/{location}/volumes/{volume_id}`
1114    pub source_volume: std::string::String,
1115
1116    /// If specified, backup will be created from the given snapshot.
1117    /// If not specified, there will be a new snapshot taken to initiate the backup
1118    /// creation. Format:
1119    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`
1120    pub source_snapshot: std::option::Option<std::string::String>,
1121
1122    /// Output only. The time when the backup was created.
1123    pub create_time: std::option::Option<wkt::Timestamp>,
1124
1125    /// Resource labels to represent user provided metadata.
1126    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1127
1128    /// Output only. Total size of all backups in a chain in bytes = baseline
1129    /// backup size + sum(incremental backup size)
1130    pub chain_storage_bytes: i64,
1131
1132    /// Output only. Reserved for future use
1133    pub satisfies_pzs: bool,
1134
1135    /// Output only. Reserved for future use
1136    pub satisfies_pzi: bool,
1137
1138    /// Output only. Region of the volume from which the backup was created.
1139    /// Format: `projects/{project_id}/locations/{location}`
1140    pub volume_region: std::string::String,
1141
1142    /// Output only. Region in which backup is stored.
1143    /// Format: `projects/{project_id}/locations/{location}`
1144    pub backup_region: std::string::String,
1145
1146    /// Output only. The time until which the backup is not deletable.
1147    pub enforced_retention_end_time: std::option::Option<wkt::Timestamp>,
1148
1149    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1150}
1151
1152impl Backup {
1153    /// Creates a new default instance.
1154    pub fn new() -> Self {
1155        std::default::Default::default()
1156    }
1157
1158    /// Sets the value of [name][crate::model::Backup::name].
1159    ///
1160    /// # Example
1161    /// ```ignore,no_run
1162    /// # use google_cloud_netapp_v1::model::Backup;
1163    /// # let project_id = "project_id";
1164    /// # let location_id = "location_id";
1165    /// # let backup_vault_id = "backup_vault_id";
1166    /// # let backup_id = "backup_id";
1167    /// let x = Backup::new().set_name(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}/backups/{backup_id}"));
1168    /// ```
1169    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1170        self.name = v.into();
1171        self
1172    }
1173
1174    /// Sets the value of [state][crate::model::Backup::state].
1175    ///
1176    /// # Example
1177    /// ```ignore,no_run
1178    /// # use google_cloud_netapp_v1::model::Backup;
1179    /// use google_cloud_netapp_v1::model::backup::State;
1180    /// let x0 = Backup::new().set_state(State::Creating);
1181    /// let x1 = Backup::new().set_state(State::Uploading);
1182    /// let x2 = Backup::new().set_state(State::Ready);
1183    /// ```
1184    pub fn set_state<T: std::convert::Into<crate::model::backup::State>>(mut self, v: T) -> Self {
1185        self.state = v.into();
1186        self
1187    }
1188
1189    /// Sets the value of [description][crate::model::Backup::description].
1190    ///
1191    /// # Example
1192    /// ```ignore,no_run
1193    /// # use google_cloud_netapp_v1::model::Backup;
1194    /// let x = Backup::new().set_description("example");
1195    /// ```
1196    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1197        self.description = v.into();
1198        self
1199    }
1200
1201    /// Sets the value of [volume_usage_bytes][crate::model::Backup::volume_usage_bytes].
1202    ///
1203    /// # Example
1204    /// ```ignore,no_run
1205    /// # use google_cloud_netapp_v1::model::Backup;
1206    /// let x = Backup::new().set_volume_usage_bytes(42);
1207    /// ```
1208    pub fn set_volume_usage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1209        self.volume_usage_bytes = v.into();
1210        self
1211    }
1212
1213    /// Sets the value of [backup_type][crate::model::Backup::backup_type].
1214    ///
1215    /// # Example
1216    /// ```ignore,no_run
1217    /// # use google_cloud_netapp_v1::model::Backup;
1218    /// use google_cloud_netapp_v1::model::backup::Type;
1219    /// let x0 = Backup::new().set_backup_type(Type::Manual);
1220    /// let x1 = Backup::new().set_backup_type(Type::Scheduled);
1221    /// ```
1222    pub fn set_backup_type<T: std::convert::Into<crate::model::backup::Type>>(
1223        mut self,
1224        v: T,
1225    ) -> Self {
1226        self.backup_type = v.into();
1227        self
1228    }
1229
1230    /// Sets the value of [source_volume][crate::model::Backup::source_volume].
1231    ///
1232    /// # Example
1233    /// ```ignore,no_run
1234    /// # use google_cloud_netapp_v1::model::Backup;
1235    /// # let project_id = "project_id";
1236    /// # let location_id = "location_id";
1237    /// # let volume_id = "volume_id";
1238    /// let x = Backup::new().set_source_volume(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
1239    /// ```
1240    pub fn set_source_volume<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1241        self.source_volume = v.into();
1242        self
1243    }
1244
1245    /// Sets the value of [source_snapshot][crate::model::Backup::source_snapshot].
1246    ///
1247    /// # Example
1248    /// ```ignore,no_run
1249    /// # use google_cloud_netapp_v1::model::Backup;
1250    /// # let project_id = "project_id";
1251    /// # let location_id = "location_id";
1252    /// # let volume_id = "volume_id";
1253    /// # let snapshot_id = "snapshot_id";
1254    /// let x = Backup::new().set_source_snapshot(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}"));
1255    /// ```
1256    pub fn set_source_snapshot<T>(mut self, v: T) -> Self
1257    where
1258        T: std::convert::Into<std::string::String>,
1259    {
1260        self.source_snapshot = std::option::Option::Some(v.into());
1261        self
1262    }
1263
1264    /// Sets or clears the value of [source_snapshot][crate::model::Backup::source_snapshot].
1265    ///
1266    /// # Example
1267    /// ```ignore,no_run
1268    /// # use google_cloud_netapp_v1::model::Backup;
1269    /// # let project_id = "project_id";
1270    /// # let location_id = "location_id";
1271    /// # let volume_id = "volume_id";
1272    /// # let snapshot_id = "snapshot_id";
1273    /// let x = Backup::new().set_or_clear_source_snapshot(Some(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}")));
1274    /// let x = Backup::new().set_or_clear_source_snapshot(None::<String>);
1275    /// ```
1276    pub fn set_or_clear_source_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
1277    where
1278        T: std::convert::Into<std::string::String>,
1279    {
1280        self.source_snapshot = v.map(|x| x.into());
1281        self
1282    }
1283
1284    /// Sets the value of [create_time][crate::model::Backup::create_time].
1285    ///
1286    /// # Example
1287    /// ```ignore,no_run
1288    /// # use google_cloud_netapp_v1::model::Backup;
1289    /// use wkt::Timestamp;
1290    /// let x = Backup::new().set_create_time(Timestamp::default()/* use setters */);
1291    /// ```
1292    pub fn set_create_time<T>(mut self, v: T) -> Self
1293    where
1294        T: std::convert::Into<wkt::Timestamp>,
1295    {
1296        self.create_time = std::option::Option::Some(v.into());
1297        self
1298    }
1299
1300    /// Sets or clears the value of [create_time][crate::model::Backup::create_time].
1301    ///
1302    /// # Example
1303    /// ```ignore,no_run
1304    /// # use google_cloud_netapp_v1::model::Backup;
1305    /// use wkt::Timestamp;
1306    /// let x = Backup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1307    /// let x = Backup::new().set_or_clear_create_time(None::<Timestamp>);
1308    /// ```
1309    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1310    where
1311        T: std::convert::Into<wkt::Timestamp>,
1312    {
1313        self.create_time = v.map(|x| x.into());
1314        self
1315    }
1316
1317    /// Sets the value of [labels][crate::model::Backup::labels].
1318    ///
1319    /// # Example
1320    /// ```ignore,no_run
1321    /// # use google_cloud_netapp_v1::model::Backup;
1322    /// let x = Backup::new().set_labels([
1323    ///     ("key0", "abc"),
1324    ///     ("key1", "xyz"),
1325    /// ]);
1326    /// ```
1327    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1328    where
1329        T: std::iter::IntoIterator<Item = (K, V)>,
1330        K: std::convert::Into<std::string::String>,
1331        V: std::convert::Into<std::string::String>,
1332    {
1333        use std::iter::Iterator;
1334        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1335        self
1336    }
1337
1338    /// Sets the value of [chain_storage_bytes][crate::model::Backup::chain_storage_bytes].
1339    ///
1340    /// # Example
1341    /// ```ignore,no_run
1342    /// # use google_cloud_netapp_v1::model::Backup;
1343    /// let x = Backup::new().set_chain_storage_bytes(42);
1344    /// ```
1345    pub fn set_chain_storage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1346        self.chain_storage_bytes = v.into();
1347        self
1348    }
1349
1350    /// Sets the value of [satisfies_pzs][crate::model::Backup::satisfies_pzs].
1351    ///
1352    /// # Example
1353    /// ```ignore,no_run
1354    /// # use google_cloud_netapp_v1::model::Backup;
1355    /// let x = Backup::new().set_satisfies_pzs(true);
1356    /// ```
1357    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1358        self.satisfies_pzs = v.into();
1359        self
1360    }
1361
1362    /// Sets the value of [satisfies_pzi][crate::model::Backup::satisfies_pzi].
1363    ///
1364    /// # Example
1365    /// ```ignore,no_run
1366    /// # use google_cloud_netapp_v1::model::Backup;
1367    /// let x = Backup::new().set_satisfies_pzi(true);
1368    /// ```
1369    pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1370        self.satisfies_pzi = v.into();
1371        self
1372    }
1373
1374    /// Sets the value of [volume_region][crate::model::Backup::volume_region].
1375    ///
1376    /// # Example
1377    /// ```ignore,no_run
1378    /// # use google_cloud_netapp_v1::model::Backup;
1379    /// let x = Backup::new().set_volume_region("example");
1380    /// ```
1381    pub fn set_volume_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1382        self.volume_region = v.into();
1383        self
1384    }
1385
1386    /// Sets the value of [backup_region][crate::model::Backup::backup_region].
1387    ///
1388    /// # Example
1389    /// ```ignore,no_run
1390    /// # use google_cloud_netapp_v1::model::Backup;
1391    /// let x = Backup::new().set_backup_region("example");
1392    /// ```
1393    pub fn set_backup_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1394        self.backup_region = v.into();
1395        self
1396    }
1397
1398    /// Sets the value of [enforced_retention_end_time][crate::model::Backup::enforced_retention_end_time].
1399    ///
1400    /// # Example
1401    /// ```ignore,no_run
1402    /// # use google_cloud_netapp_v1::model::Backup;
1403    /// use wkt::Timestamp;
1404    /// let x = Backup::new().set_enforced_retention_end_time(Timestamp::default()/* use setters */);
1405    /// ```
1406    pub fn set_enforced_retention_end_time<T>(mut self, v: T) -> Self
1407    where
1408        T: std::convert::Into<wkt::Timestamp>,
1409    {
1410        self.enforced_retention_end_time = std::option::Option::Some(v.into());
1411        self
1412    }
1413
1414    /// Sets or clears the value of [enforced_retention_end_time][crate::model::Backup::enforced_retention_end_time].
1415    ///
1416    /// # Example
1417    /// ```ignore,no_run
1418    /// # use google_cloud_netapp_v1::model::Backup;
1419    /// use wkt::Timestamp;
1420    /// let x = Backup::new().set_or_clear_enforced_retention_end_time(Some(Timestamp::default()/* use setters */));
1421    /// let x = Backup::new().set_or_clear_enforced_retention_end_time(None::<Timestamp>);
1422    /// ```
1423    pub fn set_or_clear_enforced_retention_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1424    where
1425        T: std::convert::Into<wkt::Timestamp>,
1426    {
1427        self.enforced_retention_end_time = v.map(|x| x.into());
1428        self
1429    }
1430}
1431
1432impl wkt::message::Message for Backup {
1433    fn typename() -> &'static str {
1434        "type.googleapis.com/google.cloud.netapp.v1.Backup"
1435    }
1436}
1437
1438/// Defines additional types related to [Backup].
1439pub mod backup {
1440    #[allow(unused_imports)]
1441    use super::*;
1442
1443    /// The Backup States
1444    ///
1445    /// # Working with unknown values
1446    ///
1447    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1448    /// additional enum variants at any time. Adding new variants is not considered
1449    /// a breaking change. Applications should write their code in anticipation of:
1450    ///
1451    /// - New values appearing in future releases of the client library, **and**
1452    /// - New values received dynamically, without application changes.
1453    ///
1454    /// Please consult the [Working with enums] section in the user guide for some
1455    /// guidelines.
1456    ///
1457    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1458    #[derive(Clone, Debug, PartialEq)]
1459    #[non_exhaustive]
1460    pub enum State {
1461        /// State not set.
1462        Unspecified,
1463        /// Backup is being created. While in this state, the snapshot for the backup
1464        /// point-in-time may not have been created yet, and so the point-in-time may
1465        /// not have been fixed.
1466        Creating,
1467        /// Backup is being uploaded. While in this state, none of the writes to the
1468        /// volume will be included in the backup.
1469        Uploading,
1470        /// Backup is available for use.
1471        Ready,
1472        /// Backup is being deleted.
1473        Deleting,
1474        /// Backup is not valid and cannot be used for creating new volumes or
1475        /// restoring existing volumes.
1476        Error,
1477        /// Backup is being updated.
1478        Updating,
1479        /// If set, the enum was initialized with an unknown value.
1480        ///
1481        /// Applications can examine the value using [State::value] or
1482        /// [State::name].
1483        UnknownValue(state::UnknownValue),
1484    }
1485
1486    #[doc(hidden)]
1487    pub mod state {
1488        #[allow(unused_imports)]
1489        use super::*;
1490        #[derive(Clone, Debug, PartialEq)]
1491        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1492    }
1493
1494    impl State {
1495        /// Gets the enum value.
1496        ///
1497        /// Returns `None` if the enum contains an unknown value deserialized from
1498        /// the string representation of enums.
1499        pub fn value(&self) -> std::option::Option<i32> {
1500            match self {
1501                Self::Unspecified => std::option::Option::Some(0),
1502                Self::Creating => std::option::Option::Some(1),
1503                Self::Uploading => std::option::Option::Some(2),
1504                Self::Ready => std::option::Option::Some(3),
1505                Self::Deleting => std::option::Option::Some(4),
1506                Self::Error => std::option::Option::Some(5),
1507                Self::Updating => std::option::Option::Some(6),
1508                Self::UnknownValue(u) => u.0.value(),
1509            }
1510        }
1511
1512        /// Gets the enum value as a string.
1513        ///
1514        /// Returns `None` if the enum contains an unknown value deserialized from
1515        /// the integer representation of enums.
1516        pub fn name(&self) -> std::option::Option<&str> {
1517            match self {
1518                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1519                Self::Creating => std::option::Option::Some("CREATING"),
1520                Self::Uploading => std::option::Option::Some("UPLOADING"),
1521                Self::Ready => std::option::Option::Some("READY"),
1522                Self::Deleting => std::option::Option::Some("DELETING"),
1523                Self::Error => std::option::Option::Some("ERROR"),
1524                Self::Updating => std::option::Option::Some("UPDATING"),
1525                Self::UnknownValue(u) => u.0.name(),
1526            }
1527        }
1528    }
1529
1530    impl std::default::Default for State {
1531        fn default() -> Self {
1532            use std::convert::From;
1533            Self::from(0)
1534        }
1535    }
1536
1537    impl std::fmt::Display for State {
1538        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1539            wkt::internal::display_enum(f, self.name(), self.value())
1540        }
1541    }
1542
1543    impl std::convert::From<i32> for State {
1544        fn from(value: i32) -> Self {
1545            match value {
1546                0 => Self::Unspecified,
1547                1 => Self::Creating,
1548                2 => Self::Uploading,
1549                3 => Self::Ready,
1550                4 => Self::Deleting,
1551                5 => Self::Error,
1552                6 => Self::Updating,
1553                _ => Self::UnknownValue(state::UnknownValue(
1554                    wkt::internal::UnknownEnumValue::Integer(value),
1555                )),
1556            }
1557        }
1558    }
1559
1560    impl std::convert::From<&str> for State {
1561        fn from(value: &str) -> Self {
1562            use std::string::ToString;
1563            match value {
1564                "STATE_UNSPECIFIED" => Self::Unspecified,
1565                "CREATING" => Self::Creating,
1566                "UPLOADING" => Self::Uploading,
1567                "READY" => Self::Ready,
1568                "DELETING" => Self::Deleting,
1569                "ERROR" => Self::Error,
1570                "UPDATING" => Self::Updating,
1571                _ => Self::UnknownValue(state::UnknownValue(
1572                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1573                )),
1574            }
1575        }
1576    }
1577
1578    impl serde::ser::Serialize for State {
1579        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1580        where
1581            S: serde::Serializer,
1582        {
1583            match self {
1584                Self::Unspecified => serializer.serialize_i32(0),
1585                Self::Creating => serializer.serialize_i32(1),
1586                Self::Uploading => serializer.serialize_i32(2),
1587                Self::Ready => serializer.serialize_i32(3),
1588                Self::Deleting => serializer.serialize_i32(4),
1589                Self::Error => serializer.serialize_i32(5),
1590                Self::Updating => serializer.serialize_i32(6),
1591                Self::UnknownValue(u) => u.0.serialize(serializer),
1592            }
1593        }
1594    }
1595
1596    impl<'de> serde::de::Deserialize<'de> for State {
1597        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1598        where
1599            D: serde::Deserializer<'de>,
1600        {
1601            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1602                ".google.cloud.netapp.v1.Backup.State",
1603            ))
1604        }
1605    }
1606
1607    /// Backup types.
1608    ///
1609    /// # Working with unknown values
1610    ///
1611    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1612    /// additional enum variants at any time. Adding new variants is not considered
1613    /// a breaking change. Applications should write their code in anticipation of:
1614    ///
1615    /// - New values appearing in future releases of the client library, **and**
1616    /// - New values received dynamically, without application changes.
1617    ///
1618    /// Please consult the [Working with enums] section in the user guide for some
1619    /// guidelines.
1620    ///
1621    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1622    #[derive(Clone, Debug, PartialEq)]
1623    #[non_exhaustive]
1624    pub enum Type {
1625        /// Unspecified backup type.
1626        Unspecified,
1627        /// Manual backup type.
1628        Manual,
1629        /// Scheduled backup type.
1630        Scheduled,
1631        /// If set, the enum was initialized with an unknown value.
1632        ///
1633        /// Applications can examine the value using [Type::value] or
1634        /// [Type::name].
1635        UnknownValue(r#type::UnknownValue),
1636    }
1637
1638    #[doc(hidden)]
1639    pub mod r#type {
1640        #[allow(unused_imports)]
1641        use super::*;
1642        #[derive(Clone, Debug, PartialEq)]
1643        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1644    }
1645
1646    impl Type {
1647        /// Gets the enum value.
1648        ///
1649        /// Returns `None` if the enum contains an unknown value deserialized from
1650        /// the string representation of enums.
1651        pub fn value(&self) -> std::option::Option<i32> {
1652            match self {
1653                Self::Unspecified => std::option::Option::Some(0),
1654                Self::Manual => std::option::Option::Some(1),
1655                Self::Scheduled => std::option::Option::Some(2),
1656                Self::UnknownValue(u) => u.0.value(),
1657            }
1658        }
1659
1660        /// Gets the enum value as a string.
1661        ///
1662        /// Returns `None` if the enum contains an unknown value deserialized from
1663        /// the integer representation of enums.
1664        pub fn name(&self) -> std::option::Option<&str> {
1665            match self {
1666                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
1667                Self::Manual => std::option::Option::Some("MANUAL"),
1668                Self::Scheduled => std::option::Option::Some("SCHEDULED"),
1669                Self::UnknownValue(u) => u.0.name(),
1670            }
1671        }
1672    }
1673
1674    impl std::default::Default for Type {
1675        fn default() -> Self {
1676            use std::convert::From;
1677            Self::from(0)
1678        }
1679    }
1680
1681    impl std::fmt::Display for Type {
1682        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1683            wkt::internal::display_enum(f, self.name(), self.value())
1684        }
1685    }
1686
1687    impl std::convert::From<i32> for Type {
1688        fn from(value: i32) -> Self {
1689            match value {
1690                0 => Self::Unspecified,
1691                1 => Self::Manual,
1692                2 => Self::Scheduled,
1693                _ => Self::UnknownValue(r#type::UnknownValue(
1694                    wkt::internal::UnknownEnumValue::Integer(value),
1695                )),
1696            }
1697        }
1698    }
1699
1700    impl std::convert::From<&str> for Type {
1701        fn from(value: &str) -> Self {
1702            use std::string::ToString;
1703            match value {
1704                "TYPE_UNSPECIFIED" => Self::Unspecified,
1705                "MANUAL" => Self::Manual,
1706                "SCHEDULED" => Self::Scheduled,
1707                _ => Self::UnknownValue(r#type::UnknownValue(
1708                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1709                )),
1710            }
1711        }
1712    }
1713
1714    impl serde::ser::Serialize for Type {
1715        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1716        where
1717            S: serde::Serializer,
1718        {
1719            match self {
1720                Self::Unspecified => serializer.serialize_i32(0),
1721                Self::Manual => serializer.serialize_i32(1),
1722                Self::Scheduled => serializer.serialize_i32(2),
1723                Self::UnknownValue(u) => u.0.serialize(serializer),
1724            }
1725        }
1726    }
1727
1728    impl<'de> serde::de::Deserialize<'de> for Type {
1729        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1730        where
1731            D: serde::Deserializer<'de>,
1732        {
1733            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
1734                ".google.cloud.netapp.v1.Backup.Type",
1735            ))
1736        }
1737    }
1738}
1739
1740/// ListBackupsRequest lists backups.
1741#[derive(Clone, Default, PartialEq)]
1742#[non_exhaustive]
1743pub struct ListBackupsRequest {
1744    /// Required. The backupVault for which to retrieve backup information,
1745    /// in the format
1746    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`.
1747    /// To retrieve backup information for all locations, use "-" for the
1748    /// `{location}` value.
1749    /// To retrieve backup information for all backupVaults, use "-" for the
1750    /// `{backup_vault_id}` value.
1751    /// To retrieve backup information for a volume, use "-" for the
1752    /// `{backup_vault_id}` value and specify volume full name with the filter.
1753    pub parent: std::string::String,
1754
1755    /// The maximum number of items to return. The service may return fewer
1756    /// than this value. The maximum value
1757    /// is 1000; values above 1000 will be coerced to 1000.
1758    pub page_size: i32,
1759
1760    /// The next_page_token value to use if there are additional
1761    /// results to retrieve for this list request.
1762    pub page_token: std::string::String,
1763
1764    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
1765    pub order_by: std::string::String,
1766
1767    /// The standard list filter.
1768    /// If specified, backups will be returned based on the attribute name that
1769    /// matches the filter expression. If empty, then no backups are filtered out.
1770    /// See <https://google.aip.dev/160>
1771    pub filter: std::string::String,
1772
1773    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1774}
1775
1776impl ListBackupsRequest {
1777    /// Creates a new default instance.
1778    pub fn new() -> Self {
1779        std::default::Default::default()
1780    }
1781
1782    /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
1783    ///
1784    /// # Example
1785    /// ```ignore,no_run
1786    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1787    /// # let project_id = "project_id";
1788    /// # let location_id = "location_id";
1789    /// # let backup_vault_id = "backup_vault_id";
1790    /// let x = ListBackupsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}"));
1791    /// ```
1792    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1793        self.parent = v.into();
1794        self
1795    }
1796
1797    /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
1798    ///
1799    /// # Example
1800    /// ```ignore,no_run
1801    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1802    /// let x = ListBackupsRequest::new().set_page_size(42);
1803    /// ```
1804    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1805        self.page_size = v.into();
1806        self
1807    }
1808
1809    /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
1810    ///
1811    /// # Example
1812    /// ```ignore,no_run
1813    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1814    /// let x = ListBackupsRequest::new().set_page_token("example");
1815    /// ```
1816    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1817        self.page_token = v.into();
1818        self
1819    }
1820
1821    /// Sets the value of [order_by][crate::model::ListBackupsRequest::order_by].
1822    ///
1823    /// # Example
1824    /// ```ignore,no_run
1825    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1826    /// let x = ListBackupsRequest::new().set_order_by("example");
1827    /// ```
1828    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1829        self.order_by = v.into();
1830        self
1831    }
1832
1833    /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
1834    ///
1835    /// # Example
1836    /// ```ignore,no_run
1837    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1838    /// let x = ListBackupsRequest::new().set_filter("example");
1839    /// ```
1840    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1841        self.filter = v.into();
1842        self
1843    }
1844}
1845
1846impl wkt::message::Message for ListBackupsRequest {
1847    fn typename() -> &'static str {
1848        "type.googleapis.com/google.cloud.netapp.v1.ListBackupsRequest"
1849    }
1850}
1851
1852/// ListBackupsResponse is the result of ListBackupsRequest.
1853#[derive(Clone, Default, PartialEq)]
1854#[non_exhaustive]
1855pub struct ListBackupsResponse {
1856    /// A list of backups in the project.
1857    pub backups: std::vec::Vec<crate::model::Backup>,
1858
1859    /// The token you can use to retrieve the next page of results. Not returned
1860    /// if there are no more results in the list.
1861    pub next_page_token: std::string::String,
1862
1863    /// Locations that could not be reached.
1864    pub unreachable: std::vec::Vec<std::string::String>,
1865
1866    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1867}
1868
1869impl ListBackupsResponse {
1870    /// Creates a new default instance.
1871    pub fn new() -> Self {
1872        std::default::Default::default()
1873    }
1874
1875    /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
1876    ///
1877    /// # Example
1878    /// ```ignore,no_run
1879    /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1880    /// use google_cloud_netapp_v1::model::Backup;
1881    /// let x = ListBackupsResponse::new()
1882    ///     .set_backups([
1883    ///         Backup::default()/* use setters */,
1884    ///         Backup::default()/* use (different) setters */,
1885    ///     ]);
1886    /// ```
1887    pub fn set_backups<T, V>(mut self, v: T) -> Self
1888    where
1889        T: std::iter::IntoIterator<Item = V>,
1890        V: std::convert::Into<crate::model::Backup>,
1891    {
1892        use std::iter::Iterator;
1893        self.backups = v.into_iter().map(|i| i.into()).collect();
1894        self
1895    }
1896
1897    /// Sets the value of [next_page_token][crate::model::ListBackupsResponse::next_page_token].
1898    ///
1899    /// # Example
1900    /// ```ignore,no_run
1901    /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1902    /// let x = ListBackupsResponse::new().set_next_page_token("example");
1903    /// ```
1904    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1905        self.next_page_token = v.into();
1906        self
1907    }
1908
1909    /// Sets the value of [unreachable][crate::model::ListBackupsResponse::unreachable].
1910    ///
1911    /// # Example
1912    /// ```ignore,no_run
1913    /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1914    /// let x = ListBackupsResponse::new().set_unreachable(["a", "b", "c"]);
1915    /// ```
1916    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1917    where
1918        T: std::iter::IntoIterator<Item = V>,
1919        V: std::convert::Into<std::string::String>,
1920    {
1921        use std::iter::Iterator;
1922        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1923        self
1924    }
1925}
1926
1927impl wkt::message::Message for ListBackupsResponse {
1928    fn typename() -> &'static str {
1929        "type.googleapis.com/google.cloud.netapp.v1.ListBackupsResponse"
1930    }
1931}
1932
1933#[doc(hidden)]
1934impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupsResponse {
1935    type PageItem = crate::model::Backup;
1936
1937    fn items(self) -> std::vec::Vec<Self::PageItem> {
1938        self.backups
1939    }
1940
1941    fn next_page_token(&self) -> std::string::String {
1942        use std::clone::Clone;
1943        self.next_page_token.clone()
1944    }
1945}
1946
1947/// GetBackupRequest gets the state of a backup.
1948#[derive(Clone, Default, PartialEq)]
1949#[non_exhaustive]
1950pub struct GetBackupRequest {
1951    /// Required. The backup resource name, in the format
1952    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
1953    pub name: std::string::String,
1954
1955    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1956}
1957
1958impl GetBackupRequest {
1959    /// Creates a new default instance.
1960    pub fn new() -> Self {
1961        std::default::Default::default()
1962    }
1963
1964    /// Sets the value of [name][crate::model::GetBackupRequest::name].
1965    ///
1966    /// # Example
1967    /// ```ignore,no_run
1968    /// # use google_cloud_netapp_v1::model::GetBackupRequest;
1969    /// # let project_id = "project_id";
1970    /// # let location_id = "location_id";
1971    /// # let backup_vault_id = "backup_vault_id";
1972    /// # let backup_id = "backup_id";
1973    /// let x = GetBackupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}/backups/{backup_id}"));
1974    /// ```
1975    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1976        self.name = v.into();
1977        self
1978    }
1979}
1980
1981impl wkt::message::Message for GetBackupRequest {
1982    fn typename() -> &'static str {
1983        "type.googleapis.com/google.cloud.netapp.v1.GetBackupRequest"
1984    }
1985}
1986
1987/// CreateBackupRequest creates a backup.
1988#[derive(Clone, Default, PartialEq)]
1989#[non_exhaustive]
1990pub struct CreateBackupRequest {
1991    /// Required. The NetApp backupVault to create the backups of, in the format
1992    /// `projects/*/locations/*/backupVaults/{backup_vault_id}`
1993    pub parent: std::string::String,
1994
1995    /// Required. The ID to use for the backup.
1996    /// The ID must be unique within the specified backupVault.
1997    /// Must contain only letters, numbers and hyphen, with the first
1998    /// character a letter, the last a letter or a
1999    /// number, and a 63 character maximum.
2000    pub backup_id: std::string::String,
2001
2002    /// Required. A backup resource
2003    pub backup: std::option::Option<crate::model::Backup>,
2004
2005    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2006}
2007
2008impl CreateBackupRequest {
2009    /// Creates a new default instance.
2010    pub fn new() -> Self {
2011        std::default::Default::default()
2012    }
2013
2014    /// Sets the value of [parent][crate::model::CreateBackupRequest::parent].
2015    ///
2016    /// # Example
2017    /// ```ignore,no_run
2018    /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
2019    /// # let project_id = "project_id";
2020    /// # let location_id = "location_id";
2021    /// # let backup_vault_id = "backup_vault_id";
2022    /// let x = CreateBackupRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}"));
2023    /// ```
2024    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2025        self.parent = v.into();
2026        self
2027    }
2028
2029    /// Sets the value of [backup_id][crate::model::CreateBackupRequest::backup_id].
2030    ///
2031    /// # Example
2032    /// ```ignore,no_run
2033    /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
2034    /// let x = CreateBackupRequest::new().set_backup_id("example");
2035    /// ```
2036    pub fn set_backup_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2037        self.backup_id = v.into();
2038        self
2039    }
2040
2041    /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
2042    ///
2043    /// # Example
2044    /// ```ignore,no_run
2045    /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
2046    /// use google_cloud_netapp_v1::model::Backup;
2047    /// let x = CreateBackupRequest::new().set_backup(Backup::default()/* use setters */);
2048    /// ```
2049    pub fn set_backup<T>(mut self, v: T) -> Self
2050    where
2051        T: std::convert::Into<crate::model::Backup>,
2052    {
2053        self.backup = std::option::Option::Some(v.into());
2054        self
2055    }
2056
2057    /// Sets or clears the value of [backup][crate::model::CreateBackupRequest::backup].
2058    ///
2059    /// # Example
2060    /// ```ignore,no_run
2061    /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
2062    /// use google_cloud_netapp_v1::model::Backup;
2063    /// let x = CreateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
2064    /// let x = CreateBackupRequest::new().set_or_clear_backup(None::<Backup>);
2065    /// ```
2066    pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
2067    where
2068        T: std::convert::Into<crate::model::Backup>,
2069    {
2070        self.backup = v.map(|x| x.into());
2071        self
2072    }
2073}
2074
2075impl wkt::message::Message for CreateBackupRequest {
2076    fn typename() -> &'static str {
2077        "type.googleapis.com/google.cloud.netapp.v1.CreateBackupRequest"
2078    }
2079}
2080
2081/// DeleteBackupRequest deletes a backup.
2082#[derive(Clone, Default, PartialEq)]
2083#[non_exhaustive]
2084pub struct DeleteBackupRequest {
2085    /// Required. The backup resource name, in the format
2086    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
2087    pub name: std::string::String,
2088
2089    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2090}
2091
2092impl DeleteBackupRequest {
2093    /// Creates a new default instance.
2094    pub fn new() -> Self {
2095        std::default::Default::default()
2096    }
2097
2098    /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
2099    ///
2100    /// # Example
2101    /// ```ignore,no_run
2102    /// # use google_cloud_netapp_v1::model::DeleteBackupRequest;
2103    /// # let project_id = "project_id";
2104    /// # let location_id = "location_id";
2105    /// # let backup_vault_id = "backup_vault_id";
2106    /// # let backup_id = "backup_id";
2107    /// let x = DeleteBackupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}/backups/{backup_id}"));
2108    /// ```
2109    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2110        self.name = v.into();
2111        self
2112    }
2113}
2114
2115impl wkt::message::Message for DeleteBackupRequest {
2116    fn typename() -> &'static str {
2117        "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupRequest"
2118    }
2119}
2120
2121/// UpdateBackupRequest updates description and/or labels for a backup.
2122#[derive(Clone, Default, PartialEq)]
2123#[non_exhaustive]
2124pub struct UpdateBackupRequest {
2125    /// Required. Field mask is used to specify the fields to be overwritten in the
2126    /// Backup resource to be updated.
2127    /// The fields specified in the update_mask are relative to the resource, not
2128    /// the full request. A field will be overwritten if it is in the mask. If the
2129    /// user does not provide a mask then all fields will be overwritten.
2130    pub update_mask: std::option::Option<wkt::FieldMask>,
2131
2132    /// Required. The backup being updated
2133    pub backup: std::option::Option<crate::model::Backup>,
2134
2135    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2136}
2137
2138impl UpdateBackupRequest {
2139    /// Creates a new default instance.
2140    pub fn new() -> Self {
2141        std::default::Default::default()
2142    }
2143
2144    /// Sets the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
2145    ///
2146    /// # Example
2147    /// ```ignore,no_run
2148    /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2149    /// use wkt::FieldMask;
2150    /// let x = UpdateBackupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2151    /// ```
2152    pub fn set_update_mask<T>(mut self, v: T) -> Self
2153    where
2154        T: std::convert::Into<wkt::FieldMask>,
2155    {
2156        self.update_mask = std::option::Option::Some(v.into());
2157        self
2158    }
2159
2160    /// Sets or clears the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
2161    ///
2162    /// # Example
2163    /// ```ignore,no_run
2164    /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2165    /// use wkt::FieldMask;
2166    /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2167    /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2168    /// ```
2169    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2170    where
2171        T: std::convert::Into<wkt::FieldMask>,
2172    {
2173        self.update_mask = v.map(|x| x.into());
2174        self
2175    }
2176
2177    /// Sets the value of [backup][crate::model::UpdateBackupRequest::backup].
2178    ///
2179    /// # Example
2180    /// ```ignore,no_run
2181    /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2182    /// use google_cloud_netapp_v1::model::Backup;
2183    /// let x = UpdateBackupRequest::new().set_backup(Backup::default()/* use setters */);
2184    /// ```
2185    pub fn set_backup<T>(mut self, v: T) -> Self
2186    where
2187        T: std::convert::Into<crate::model::Backup>,
2188    {
2189        self.backup = std::option::Option::Some(v.into());
2190        self
2191    }
2192
2193    /// Sets or clears the value of [backup][crate::model::UpdateBackupRequest::backup].
2194    ///
2195    /// # Example
2196    /// ```ignore,no_run
2197    /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2198    /// use google_cloud_netapp_v1::model::Backup;
2199    /// let x = UpdateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
2200    /// let x = UpdateBackupRequest::new().set_or_clear_backup(None::<Backup>);
2201    /// ```
2202    pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
2203    where
2204        T: std::convert::Into<crate::model::Backup>,
2205    {
2206        self.backup = v.map(|x| x.into());
2207        self
2208    }
2209}
2210
2211impl wkt::message::Message for UpdateBackupRequest {
2212    fn typename() -> &'static str {
2213        "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupRequest"
2214    }
2215}
2216
2217/// Backup Policy.
2218#[derive(Clone, Default, PartialEq)]
2219#[non_exhaustive]
2220pub struct BackupPolicy {
2221    /// Identifier. The resource name of the backup policy.
2222    /// Format:
2223    /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`.
2224    pub name: std::string::String,
2225
2226    /// Number of daily backups to keep. Note that the minimum daily backup limit
2227    /// is 2.
2228    pub daily_backup_limit: std::option::Option<i32>,
2229
2230    /// Number of weekly backups to keep. Note that the sum of daily, weekly and
2231    /// monthly backups should be greater than 1.
2232    pub weekly_backup_limit: std::option::Option<i32>,
2233
2234    /// Number of monthly backups to keep. Note that the sum of daily, weekly and
2235    /// monthly backups should be greater than 1.
2236    pub monthly_backup_limit: std::option::Option<i32>,
2237
2238    /// Description of the backup policy.
2239    pub description: std::option::Option<std::string::String>,
2240
2241    /// If enabled, make backups automatically according to the schedules.
2242    /// This will be applied to all volumes that have this policy attached and
2243    /// enforced on volume level. If not specified, default is true.
2244    pub enabled: std::option::Option<bool>,
2245
2246    /// Output only. The total number of volumes assigned by this backup policy.
2247    pub assigned_volume_count: std::option::Option<i32>,
2248
2249    /// Output only. The time when the backup policy was created.
2250    pub create_time: std::option::Option<wkt::Timestamp>,
2251
2252    /// Resource labels to represent user provided metadata.
2253    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2254
2255    /// Output only. The backup policy state.
2256    pub state: crate::model::backup_policy::State,
2257
2258    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2259}
2260
2261impl BackupPolicy {
2262    /// Creates a new default instance.
2263    pub fn new() -> Self {
2264        std::default::Default::default()
2265    }
2266
2267    /// Sets the value of [name][crate::model::BackupPolicy::name].
2268    ///
2269    /// # Example
2270    /// ```ignore,no_run
2271    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2272    /// # let project_id = "project_id";
2273    /// # let location_id = "location_id";
2274    /// # let backup_policy_id = "backup_policy_id";
2275    /// let x = BackupPolicy::new().set_name(format!("projects/{project_id}/locations/{location_id}/backupPolicies/{backup_policy_id}"));
2276    /// ```
2277    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2278        self.name = v.into();
2279        self
2280    }
2281
2282    /// Sets the value of [daily_backup_limit][crate::model::BackupPolicy::daily_backup_limit].
2283    ///
2284    /// # Example
2285    /// ```ignore,no_run
2286    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2287    /// let x = BackupPolicy::new().set_daily_backup_limit(42);
2288    /// ```
2289    pub fn set_daily_backup_limit<T>(mut self, v: T) -> Self
2290    where
2291        T: std::convert::Into<i32>,
2292    {
2293        self.daily_backup_limit = std::option::Option::Some(v.into());
2294        self
2295    }
2296
2297    /// Sets or clears the value of [daily_backup_limit][crate::model::BackupPolicy::daily_backup_limit].
2298    ///
2299    /// # Example
2300    /// ```ignore,no_run
2301    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2302    /// let x = BackupPolicy::new().set_or_clear_daily_backup_limit(Some(42));
2303    /// let x = BackupPolicy::new().set_or_clear_daily_backup_limit(None::<i32>);
2304    /// ```
2305    pub fn set_or_clear_daily_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2306    where
2307        T: std::convert::Into<i32>,
2308    {
2309        self.daily_backup_limit = v.map(|x| x.into());
2310        self
2311    }
2312
2313    /// Sets the value of [weekly_backup_limit][crate::model::BackupPolicy::weekly_backup_limit].
2314    ///
2315    /// # Example
2316    /// ```ignore,no_run
2317    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2318    /// let x = BackupPolicy::new().set_weekly_backup_limit(42);
2319    /// ```
2320    pub fn set_weekly_backup_limit<T>(mut self, v: T) -> Self
2321    where
2322        T: std::convert::Into<i32>,
2323    {
2324        self.weekly_backup_limit = std::option::Option::Some(v.into());
2325        self
2326    }
2327
2328    /// Sets or clears the value of [weekly_backup_limit][crate::model::BackupPolicy::weekly_backup_limit].
2329    ///
2330    /// # Example
2331    /// ```ignore,no_run
2332    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2333    /// let x = BackupPolicy::new().set_or_clear_weekly_backup_limit(Some(42));
2334    /// let x = BackupPolicy::new().set_or_clear_weekly_backup_limit(None::<i32>);
2335    /// ```
2336    pub fn set_or_clear_weekly_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2337    where
2338        T: std::convert::Into<i32>,
2339    {
2340        self.weekly_backup_limit = v.map(|x| x.into());
2341        self
2342    }
2343
2344    /// Sets the value of [monthly_backup_limit][crate::model::BackupPolicy::monthly_backup_limit].
2345    ///
2346    /// # Example
2347    /// ```ignore,no_run
2348    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2349    /// let x = BackupPolicy::new().set_monthly_backup_limit(42);
2350    /// ```
2351    pub fn set_monthly_backup_limit<T>(mut self, v: T) -> Self
2352    where
2353        T: std::convert::Into<i32>,
2354    {
2355        self.monthly_backup_limit = std::option::Option::Some(v.into());
2356        self
2357    }
2358
2359    /// Sets or clears the value of [monthly_backup_limit][crate::model::BackupPolicy::monthly_backup_limit].
2360    ///
2361    /// # Example
2362    /// ```ignore,no_run
2363    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2364    /// let x = BackupPolicy::new().set_or_clear_monthly_backup_limit(Some(42));
2365    /// let x = BackupPolicy::new().set_or_clear_monthly_backup_limit(None::<i32>);
2366    /// ```
2367    pub fn set_or_clear_monthly_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2368    where
2369        T: std::convert::Into<i32>,
2370    {
2371        self.monthly_backup_limit = v.map(|x| x.into());
2372        self
2373    }
2374
2375    /// Sets the value of [description][crate::model::BackupPolicy::description].
2376    ///
2377    /// # Example
2378    /// ```ignore,no_run
2379    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2380    /// let x = BackupPolicy::new().set_description("example");
2381    /// ```
2382    pub fn set_description<T>(mut self, v: T) -> Self
2383    where
2384        T: std::convert::Into<std::string::String>,
2385    {
2386        self.description = std::option::Option::Some(v.into());
2387        self
2388    }
2389
2390    /// Sets or clears the value of [description][crate::model::BackupPolicy::description].
2391    ///
2392    /// # Example
2393    /// ```ignore,no_run
2394    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2395    /// let x = BackupPolicy::new().set_or_clear_description(Some("example"));
2396    /// let x = BackupPolicy::new().set_or_clear_description(None::<String>);
2397    /// ```
2398    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
2399    where
2400        T: std::convert::Into<std::string::String>,
2401    {
2402        self.description = v.map(|x| x.into());
2403        self
2404    }
2405
2406    /// Sets the value of [enabled][crate::model::BackupPolicy::enabled].
2407    ///
2408    /// # Example
2409    /// ```ignore,no_run
2410    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2411    /// let x = BackupPolicy::new().set_enabled(true);
2412    /// ```
2413    pub fn set_enabled<T>(mut self, v: T) -> Self
2414    where
2415        T: std::convert::Into<bool>,
2416    {
2417        self.enabled = std::option::Option::Some(v.into());
2418        self
2419    }
2420
2421    /// Sets or clears the value of [enabled][crate::model::BackupPolicy::enabled].
2422    ///
2423    /// # Example
2424    /// ```ignore,no_run
2425    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2426    /// let x = BackupPolicy::new().set_or_clear_enabled(Some(false));
2427    /// let x = BackupPolicy::new().set_or_clear_enabled(None::<bool>);
2428    /// ```
2429    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
2430    where
2431        T: std::convert::Into<bool>,
2432    {
2433        self.enabled = v.map(|x| x.into());
2434        self
2435    }
2436
2437    /// Sets the value of [assigned_volume_count][crate::model::BackupPolicy::assigned_volume_count].
2438    ///
2439    /// # Example
2440    /// ```ignore,no_run
2441    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2442    /// let x = BackupPolicy::new().set_assigned_volume_count(42);
2443    /// ```
2444    pub fn set_assigned_volume_count<T>(mut self, v: T) -> Self
2445    where
2446        T: std::convert::Into<i32>,
2447    {
2448        self.assigned_volume_count = std::option::Option::Some(v.into());
2449        self
2450    }
2451
2452    /// Sets or clears the value of [assigned_volume_count][crate::model::BackupPolicy::assigned_volume_count].
2453    ///
2454    /// # Example
2455    /// ```ignore,no_run
2456    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2457    /// let x = BackupPolicy::new().set_or_clear_assigned_volume_count(Some(42));
2458    /// let x = BackupPolicy::new().set_or_clear_assigned_volume_count(None::<i32>);
2459    /// ```
2460    pub fn set_or_clear_assigned_volume_count<T>(mut self, v: std::option::Option<T>) -> Self
2461    where
2462        T: std::convert::Into<i32>,
2463    {
2464        self.assigned_volume_count = v.map(|x| x.into());
2465        self
2466    }
2467
2468    /// Sets the value of [create_time][crate::model::BackupPolicy::create_time].
2469    ///
2470    /// # Example
2471    /// ```ignore,no_run
2472    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2473    /// use wkt::Timestamp;
2474    /// let x = BackupPolicy::new().set_create_time(Timestamp::default()/* use setters */);
2475    /// ```
2476    pub fn set_create_time<T>(mut self, v: T) -> Self
2477    where
2478        T: std::convert::Into<wkt::Timestamp>,
2479    {
2480        self.create_time = std::option::Option::Some(v.into());
2481        self
2482    }
2483
2484    /// Sets or clears the value of [create_time][crate::model::BackupPolicy::create_time].
2485    ///
2486    /// # Example
2487    /// ```ignore,no_run
2488    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2489    /// use wkt::Timestamp;
2490    /// let x = BackupPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2491    /// let x = BackupPolicy::new().set_or_clear_create_time(None::<Timestamp>);
2492    /// ```
2493    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2494    where
2495        T: std::convert::Into<wkt::Timestamp>,
2496    {
2497        self.create_time = v.map(|x| x.into());
2498        self
2499    }
2500
2501    /// Sets the value of [labels][crate::model::BackupPolicy::labels].
2502    ///
2503    /// # Example
2504    /// ```ignore,no_run
2505    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2506    /// let x = BackupPolicy::new().set_labels([
2507    ///     ("key0", "abc"),
2508    ///     ("key1", "xyz"),
2509    /// ]);
2510    /// ```
2511    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2512    where
2513        T: std::iter::IntoIterator<Item = (K, V)>,
2514        K: std::convert::Into<std::string::String>,
2515        V: std::convert::Into<std::string::String>,
2516    {
2517        use std::iter::Iterator;
2518        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2519        self
2520    }
2521
2522    /// Sets the value of [state][crate::model::BackupPolicy::state].
2523    ///
2524    /// # Example
2525    /// ```ignore,no_run
2526    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2527    /// use google_cloud_netapp_v1::model::backup_policy::State;
2528    /// let x0 = BackupPolicy::new().set_state(State::Creating);
2529    /// let x1 = BackupPolicy::new().set_state(State::Ready);
2530    /// let x2 = BackupPolicy::new().set_state(State::Deleting);
2531    /// ```
2532    pub fn set_state<T: std::convert::Into<crate::model::backup_policy::State>>(
2533        mut self,
2534        v: T,
2535    ) -> Self {
2536        self.state = v.into();
2537        self
2538    }
2539}
2540
2541impl wkt::message::Message for BackupPolicy {
2542    fn typename() -> &'static str {
2543        "type.googleapis.com/google.cloud.netapp.v1.BackupPolicy"
2544    }
2545}
2546
2547/// Defines additional types related to [BackupPolicy].
2548pub mod backup_policy {
2549    #[allow(unused_imports)]
2550    use super::*;
2551
2552    /// Enum for [State].
2553    ///
2554    /// # Working with unknown values
2555    ///
2556    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2557    /// additional enum variants at any time. Adding new variants is not considered
2558    /// a breaking change. Applications should write their code in anticipation of:
2559    ///
2560    /// - New values appearing in future releases of the client library, **and**
2561    /// - New values received dynamically, without application changes.
2562    ///
2563    /// Please consult the [Working with enums] section in the user guide for some
2564    /// guidelines.
2565    ///
2566    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2567    #[derive(Clone, Debug, PartialEq)]
2568    #[non_exhaustive]
2569    pub enum State {
2570        /// State not set.
2571        Unspecified,
2572        /// BackupPolicy is being created.
2573        Creating,
2574        /// BackupPolicy is available for use.
2575        Ready,
2576        /// BackupPolicy is being deleted.
2577        Deleting,
2578        /// BackupPolicy is not valid and cannot be used.
2579        Error,
2580        /// BackupPolicy is being updated.
2581        Updating,
2582        /// If set, the enum was initialized with an unknown value.
2583        ///
2584        /// Applications can examine the value using [State::value] or
2585        /// [State::name].
2586        UnknownValue(state::UnknownValue),
2587    }
2588
2589    #[doc(hidden)]
2590    pub mod state {
2591        #[allow(unused_imports)]
2592        use super::*;
2593        #[derive(Clone, Debug, PartialEq)]
2594        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2595    }
2596
2597    impl State {
2598        /// Gets the enum value.
2599        ///
2600        /// Returns `None` if the enum contains an unknown value deserialized from
2601        /// the string representation of enums.
2602        pub fn value(&self) -> std::option::Option<i32> {
2603            match self {
2604                Self::Unspecified => std::option::Option::Some(0),
2605                Self::Creating => std::option::Option::Some(1),
2606                Self::Ready => std::option::Option::Some(2),
2607                Self::Deleting => std::option::Option::Some(3),
2608                Self::Error => std::option::Option::Some(4),
2609                Self::Updating => std::option::Option::Some(5),
2610                Self::UnknownValue(u) => u.0.value(),
2611            }
2612        }
2613
2614        /// Gets the enum value as a string.
2615        ///
2616        /// Returns `None` if the enum contains an unknown value deserialized from
2617        /// the integer representation of enums.
2618        pub fn name(&self) -> std::option::Option<&str> {
2619            match self {
2620                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2621                Self::Creating => std::option::Option::Some("CREATING"),
2622                Self::Ready => std::option::Option::Some("READY"),
2623                Self::Deleting => std::option::Option::Some("DELETING"),
2624                Self::Error => std::option::Option::Some("ERROR"),
2625                Self::Updating => std::option::Option::Some("UPDATING"),
2626                Self::UnknownValue(u) => u.0.name(),
2627            }
2628        }
2629    }
2630
2631    impl std::default::Default for State {
2632        fn default() -> Self {
2633            use std::convert::From;
2634            Self::from(0)
2635        }
2636    }
2637
2638    impl std::fmt::Display for State {
2639        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2640            wkt::internal::display_enum(f, self.name(), self.value())
2641        }
2642    }
2643
2644    impl std::convert::From<i32> for State {
2645        fn from(value: i32) -> Self {
2646            match value {
2647                0 => Self::Unspecified,
2648                1 => Self::Creating,
2649                2 => Self::Ready,
2650                3 => Self::Deleting,
2651                4 => Self::Error,
2652                5 => Self::Updating,
2653                _ => Self::UnknownValue(state::UnknownValue(
2654                    wkt::internal::UnknownEnumValue::Integer(value),
2655                )),
2656            }
2657        }
2658    }
2659
2660    impl std::convert::From<&str> for State {
2661        fn from(value: &str) -> Self {
2662            use std::string::ToString;
2663            match value {
2664                "STATE_UNSPECIFIED" => Self::Unspecified,
2665                "CREATING" => Self::Creating,
2666                "READY" => Self::Ready,
2667                "DELETING" => Self::Deleting,
2668                "ERROR" => Self::Error,
2669                "UPDATING" => Self::Updating,
2670                _ => Self::UnknownValue(state::UnknownValue(
2671                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2672                )),
2673            }
2674        }
2675    }
2676
2677    impl serde::ser::Serialize for State {
2678        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2679        where
2680            S: serde::Serializer,
2681        {
2682            match self {
2683                Self::Unspecified => serializer.serialize_i32(0),
2684                Self::Creating => serializer.serialize_i32(1),
2685                Self::Ready => serializer.serialize_i32(2),
2686                Self::Deleting => serializer.serialize_i32(3),
2687                Self::Error => serializer.serialize_i32(4),
2688                Self::Updating => serializer.serialize_i32(5),
2689                Self::UnknownValue(u) => u.0.serialize(serializer),
2690            }
2691        }
2692    }
2693
2694    impl<'de> serde::de::Deserialize<'de> for State {
2695        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2696        where
2697            D: serde::Deserializer<'de>,
2698        {
2699            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2700                ".google.cloud.netapp.v1.BackupPolicy.State",
2701            ))
2702        }
2703    }
2704}
2705
2706/// CreateBackupPolicyRequest creates a backupPolicy.
2707#[derive(Clone, Default, PartialEq)]
2708#[non_exhaustive]
2709pub struct CreateBackupPolicyRequest {
2710    /// Required. The location to create the backup policies of, in the format
2711    /// `projects/{project_id}/locations/{location}`
2712    pub parent: std::string::String,
2713
2714    /// Required. A backupPolicy resource
2715    pub backup_policy: std::option::Option<crate::model::BackupPolicy>,
2716
2717    /// Required. The ID to use for the backup policy.
2718    /// The ID must be unique within the specified location.
2719    /// Must contain only letters, numbers and hyphen, with the first
2720    /// character a letter, the last a letter or a
2721    /// number, and a 63 character maximum.
2722    pub backup_policy_id: std::string::String,
2723
2724    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2725}
2726
2727impl CreateBackupPolicyRequest {
2728    /// Creates a new default instance.
2729    pub fn new() -> Self {
2730        std::default::Default::default()
2731    }
2732
2733    /// Sets the value of [parent][crate::model::CreateBackupPolicyRequest::parent].
2734    ///
2735    /// # Example
2736    /// ```ignore,no_run
2737    /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2738    /// # let project_id = "project_id";
2739    /// # let location_id = "location_id";
2740    /// let x = CreateBackupPolicyRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
2741    /// ```
2742    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2743        self.parent = v.into();
2744        self
2745    }
2746
2747    /// Sets the value of [backup_policy][crate::model::CreateBackupPolicyRequest::backup_policy].
2748    ///
2749    /// # Example
2750    /// ```ignore,no_run
2751    /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2752    /// use google_cloud_netapp_v1::model::BackupPolicy;
2753    /// let x = CreateBackupPolicyRequest::new().set_backup_policy(BackupPolicy::default()/* use setters */);
2754    /// ```
2755    pub fn set_backup_policy<T>(mut self, v: T) -> Self
2756    where
2757        T: std::convert::Into<crate::model::BackupPolicy>,
2758    {
2759        self.backup_policy = std::option::Option::Some(v.into());
2760        self
2761    }
2762
2763    /// Sets or clears the value of [backup_policy][crate::model::CreateBackupPolicyRequest::backup_policy].
2764    ///
2765    /// # Example
2766    /// ```ignore,no_run
2767    /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2768    /// use google_cloud_netapp_v1::model::BackupPolicy;
2769    /// let x = CreateBackupPolicyRequest::new().set_or_clear_backup_policy(Some(BackupPolicy::default()/* use setters */));
2770    /// let x = CreateBackupPolicyRequest::new().set_or_clear_backup_policy(None::<BackupPolicy>);
2771    /// ```
2772    pub fn set_or_clear_backup_policy<T>(mut self, v: std::option::Option<T>) -> Self
2773    where
2774        T: std::convert::Into<crate::model::BackupPolicy>,
2775    {
2776        self.backup_policy = v.map(|x| x.into());
2777        self
2778    }
2779
2780    /// Sets the value of [backup_policy_id][crate::model::CreateBackupPolicyRequest::backup_policy_id].
2781    ///
2782    /// # Example
2783    /// ```ignore,no_run
2784    /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2785    /// let x = CreateBackupPolicyRequest::new().set_backup_policy_id("example");
2786    /// ```
2787    pub fn set_backup_policy_id<T: std::convert::Into<std::string::String>>(
2788        mut self,
2789        v: T,
2790    ) -> Self {
2791        self.backup_policy_id = v.into();
2792        self
2793    }
2794}
2795
2796impl wkt::message::Message for CreateBackupPolicyRequest {
2797    fn typename() -> &'static str {
2798        "type.googleapis.com/google.cloud.netapp.v1.CreateBackupPolicyRequest"
2799    }
2800}
2801
2802/// GetBackupPolicyRequest gets the state of a backupPolicy.
2803#[derive(Clone, Default, PartialEq)]
2804#[non_exhaustive]
2805pub struct GetBackupPolicyRequest {
2806    /// Required. The backupPolicy resource name, in the format
2807    /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`
2808    pub name: std::string::String,
2809
2810    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2811}
2812
2813impl GetBackupPolicyRequest {
2814    /// Creates a new default instance.
2815    pub fn new() -> Self {
2816        std::default::Default::default()
2817    }
2818
2819    /// Sets the value of [name][crate::model::GetBackupPolicyRequest::name].
2820    ///
2821    /// # Example
2822    /// ```ignore,no_run
2823    /// # use google_cloud_netapp_v1::model::GetBackupPolicyRequest;
2824    /// # let project_id = "project_id";
2825    /// # let location_id = "location_id";
2826    /// # let backup_policy_id = "backup_policy_id";
2827    /// let x = GetBackupPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/backupPolicies/{backup_policy_id}"));
2828    /// ```
2829    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2830        self.name = v.into();
2831        self
2832    }
2833}
2834
2835impl wkt::message::Message for GetBackupPolicyRequest {
2836    fn typename() -> &'static str {
2837        "type.googleapis.com/google.cloud.netapp.v1.GetBackupPolicyRequest"
2838    }
2839}
2840
2841/// ListBackupPoliciesRequest for requesting multiple backup policies.
2842#[derive(Clone, Default, PartialEq)]
2843#[non_exhaustive]
2844pub struct ListBackupPoliciesRequest {
2845    /// Required. Parent value for ListBackupPoliciesRequest
2846    pub parent: std::string::String,
2847
2848    /// Requested page size. Server may return fewer items than requested.
2849    /// If unspecified, the server will pick an appropriate default.
2850    pub page_size: i32,
2851
2852    /// A token identifying a page of results the server should return.
2853    pub page_token: std::string::String,
2854
2855    /// Filtering results
2856    pub filter: std::string::String,
2857
2858    /// Hint for how to order the results
2859    pub order_by: std::string::String,
2860
2861    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2862}
2863
2864impl ListBackupPoliciesRequest {
2865    /// Creates a new default instance.
2866    pub fn new() -> Self {
2867        std::default::Default::default()
2868    }
2869
2870    /// Sets the value of [parent][crate::model::ListBackupPoliciesRequest::parent].
2871    ///
2872    /// # Example
2873    /// ```ignore,no_run
2874    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2875    /// # let project_id = "project_id";
2876    /// # let location_id = "location_id";
2877    /// let x = ListBackupPoliciesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
2878    /// ```
2879    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2880        self.parent = v.into();
2881        self
2882    }
2883
2884    /// Sets the value of [page_size][crate::model::ListBackupPoliciesRequest::page_size].
2885    ///
2886    /// # Example
2887    /// ```ignore,no_run
2888    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2889    /// let x = ListBackupPoliciesRequest::new().set_page_size(42);
2890    /// ```
2891    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2892        self.page_size = v.into();
2893        self
2894    }
2895
2896    /// Sets the value of [page_token][crate::model::ListBackupPoliciesRequest::page_token].
2897    ///
2898    /// # Example
2899    /// ```ignore,no_run
2900    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2901    /// let x = ListBackupPoliciesRequest::new().set_page_token("example");
2902    /// ```
2903    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2904        self.page_token = v.into();
2905        self
2906    }
2907
2908    /// Sets the value of [filter][crate::model::ListBackupPoliciesRequest::filter].
2909    ///
2910    /// # Example
2911    /// ```ignore,no_run
2912    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2913    /// let x = ListBackupPoliciesRequest::new().set_filter("example");
2914    /// ```
2915    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2916        self.filter = v.into();
2917        self
2918    }
2919
2920    /// Sets the value of [order_by][crate::model::ListBackupPoliciesRequest::order_by].
2921    ///
2922    /// # Example
2923    /// ```ignore,no_run
2924    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2925    /// let x = ListBackupPoliciesRequest::new().set_order_by("example");
2926    /// ```
2927    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2928        self.order_by = v.into();
2929        self
2930    }
2931}
2932
2933impl wkt::message::Message for ListBackupPoliciesRequest {
2934    fn typename() -> &'static str {
2935        "type.googleapis.com/google.cloud.netapp.v1.ListBackupPoliciesRequest"
2936    }
2937}
2938
2939/// ListBackupPoliciesResponse contains all the backup policies requested.
2940#[derive(Clone, Default, PartialEq)]
2941#[non_exhaustive]
2942pub struct ListBackupPoliciesResponse {
2943    /// The list of backup policies.
2944    pub backup_policies: std::vec::Vec<crate::model::BackupPolicy>,
2945
2946    /// A token identifying a page of results the server should return.
2947    pub next_page_token: std::string::String,
2948
2949    /// Locations that could not be reached.
2950    pub unreachable: std::vec::Vec<std::string::String>,
2951
2952    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2953}
2954
2955impl ListBackupPoliciesResponse {
2956    /// Creates a new default instance.
2957    pub fn new() -> Self {
2958        std::default::Default::default()
2959    }
2960
2961    /// Sets the value of [backup_policies][crate::model::ListBackupPoliciesResponse::backup_policies].
2962    ///
2963    /// # Example
2964    /// ```ignore,no_run
2965    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
2966    /// use google_cloud_netapp_v1::model::BackupPolicy;
2967    /// let x = ListBackupPoliciesResponse::new()
2968    ///     .set_backup_policies([
2969    ///         BackupPolicy::default()/* use setters */,
2970    ///         BackupPolicy::default()/* use (different) setters */,
2971    ///     ]);
2972    /// ```
2973    pub fn set_backup_policies<T, V>(mut self, v: T) -> Self
2974    where
2975        T: std::iter::IntoIterator<Item = V>,
2976        V: std::convert::Into<crate::model::BackupPolicy>,
2977    {
2978        use std::iter::Iterator;
2979        self.backup_policies = v.into_iter().map(|i| i.into()).collect();
2980        self
2981    }
2982
2983    /// Sets the value of [next_page_token][crate::model::ListBackupPoliciesResponse::next_page_token].
2984    ///
2985    /// # Example
2986    /// ```ignore,no_run
2987    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
2988    /// let x = ListBackupPoliciesResponse::new().set_next_page_token("example");
2989    /// ```
2990    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2991        self.next_page_token = v.into();
2992        self
2993    }
2994
2995    /// Sets the value of [unreachable][crate::model::ListBackupPoliciesResponse::unreachable].
2996    ///
2997    /// # Example
2998    /// ```ignore,no_run
2999    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
3000    /// let x = ListBackupPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
3001    /// ```
3002    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3003    where
3004        T: std::iter::IntoIterator<Item = V>,
3005        V: std::convert::Into<std::string::String>,
3006    {
3007        use std::iter::Iterator;
3008        self.unreachable = v.into_iter().map(|i| i.into()).collect();
3009        self
3010    }
3011}
3012
3013impl wkt::message::Message for ListBackupPoliciesResponse {
3014    fn typename() -> &'static str {
3015        "type.googleapis.com/google.cloud.netapp.v1.ListBackupPoliciesResponse"
3016    }
3017}
3018
3019#[doc(hidden)]
3020impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupPoliciesResponse {
3021    type PageItem = crate::model::BackupPolicy;
3022
3023    fn items(self) -> std::vec::Vec<Self::PageItem> {
3024        self.backup_policies
3025    }
3026
3027    fn next_page_token(&self) -> std::string::String {
3028        use std::clone::Clone;
3029        self.next_page_token.clone()
3030    }
3031}
3032
3033/// UpdateBackupPolicyRequest for updating a backup policy.
3034#[derive(Clone, Default, PartialEq)]
3035#[non_exhaustive]
3036pub struct UpdateBackupPolicyRequest {
3037    /// Required. Field mask is used to specify the fields to be overwritten in the
3038    /// Backup Policy resource by the update.
3039    /// The fields specified in the update_mask are relative to the resource, not
3040    /// the full request. A field will be overwritten if it is in the mask. If the
3041    /// user does not provide a mask then all fields will be overwritten.
3042    pub update_mask: std::option::Option<wkt::FieldMask>,
3043
3044    /// Required. The backup policy being updated
3045    pub backup_policy: std::option::Option<crate::model::BackupPolicy>,
3046
3047    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3048}
3049
3050impl UpdateBackupPolicyRequest {
3051    /// Creates a new default instance.
3052    pub fn new() -> Self {
3053        std::default::Default::default()
3054    }
3055
3056    /// Sets the value of [update_mask][crate::model::UpdateBackupPolicyRequest::update_mask].
3057    ///
3058    /// # Example
3059    /// ```ignore,no_run
3060    /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3061    /// use wkt::FieldMask;
3062    /// let x = UpdateBackupPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3063    /// ```
3064    pub fn set_update_mask<T>(mut self, v: T) -> Self
3065    where
3066        T: std::convert::Into<wkt::FieldMask>,
3067    {
3068        self.update_mask = std::option::Option::Some(v.into());
3069        self
3070    }
3071
3072    /// Sets or clears the value of [update_mask][crate::model::UpdateBackupPolicyRequest::update_mask].
3073    ///
3074    /// # Example
3075    /// ```ignore,no_run
3076    /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3077    /// use wkt::FieldMask;
3078    /// let x = UpdateBackupPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3079    /// let x = UpdateBackupPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3080    /// ```
3081    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3082    where
3083        T: std::convert::Into<wkt::FieldMask>,
3084    {
3085        self.update_mask = v.map(|x| x.into());
3086        self
3087    }
3088
3089    /// Sets the value of [backup_policy][crate::model::UpdateBackupPolicyRequest::backup_policy].
3090    ///
3091    /// # Example
3092    /// ```ignore,no_run
3093    /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3094    /// use google_cloud_netapp_v1::model::BackupPolicy;
3095    /// let x = UpdateBackupPolicyRequest::new().set_backup_policy(BackupPolicy::default()/* use setters */);
3096    /// ```
3097    pub fn set_backup_policy<T>(mut self, v: T) -> Self
3098    where
3099        T: std::convert::Into<crate::model::BackupPolicy>,
3100    {
3101        self.backup_policy = std::option::Option::Some(v.into());
3102        self
3103    }
3104
3105    /// Sets or clears the value of [backup_policy][crate::model::UpdateBackupPolicyRequest::backup_policy].
3106    ///
3107    /// # Example
3108    /// ```ignore,no_run
3109    /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3110    /// use google_cloud_netapp_v1::model::BackupPolicy;
3111    /// let x = UpdateBackupPolicyRequest::new().set_or_clear_backup_policy(Some(BackupPolicy::default()/* use setters */));
3112    /// let x = UpdateBackupPolicyRequest::new().set_or_clear_backup_policy(None::<BackupPolicy>);
3113    /// ```
3114    pub fn set_or_clear_backup_policy<T>(mut self, v: std::option::Option<T>) -> Self
3115    where
3116        T: std::convert::Into<crate::model::BackupPolicy>,
3117    {
3118        self.backup_policy = v.map(|x| x.into());
3119        self
3120    }
3121}
3122
3123impl wkt::message::Message for UpdateBackupPolicyRequest {
3124    fn typename() -> &'static str {
3125        "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupPolicyRequest"
3126    }
3127}
3128
3129/// DeleteBackupPolicyRequest deletes a backup policy.
3130#[derive(Clone, Default, PartialEq)]
3131#[non_exhaustive]
3132pub struct DeleteBackupPolicyRequest {
3133    /// Required. The backup policy resource name, in the format
3134    /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`
3135    pub name: std::string::String,
3136
3137    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3138}
3139
3140impl DeleteBackupPolicyRequest {
3141    /// Creates a new default instance.
3142    pub fn new() -> Self {
3143        std::default::Default::default()
3144    }
3145
3146    /// Sets the value of [name][crate::model::DeleteBackupPolicyRequest::name].
3147    ///
3148    /// # Example
3149    /// ```ignore,no_run
3150    /// # use google_cloud_netapp_v1::model::DeleteBackupPolicyRequest;
3151    /// # let project_id = "project_id";
3152    /// # let location_id = "location_id";
3153    /// # let backup_policy_id = "backup_policy_id";
3154    /// let x = DeleteBackupPolicyRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/backupPolicies/{backup_policy_id}"));
3155    /// ```
3156    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3157        self.name = v.into();
3158        self
3159    }
3160}
3161
3162impl wkt::message::Message for DeleteBackupPolicyRequest {
3163    fn typename() -> &'static str {
3164        "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupPolicyRequest"
3165    }
3166}
3167
3168/// A NetApp BackupVault.
3169#[derive(Clone, Default, PartialEq)]
3170#[non_exhaustive]
3171pub struct BackupVault {
3172    /// Identifier. The resource name of the backup vault.
3173    /// Format:
3174    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`.
3175    pub name: std::string::String,
3176
3177    /// Output only. The backup vault state.
3178    pub state: crate::model::backup_vault::State,
3179
3180    /// Output only. Create time of the backup vault.
3181    pub create_time: std::option::Option<wkt::Timestamp>,
3182
3183    /// Description of the backup vault.
3184    pub description: std::string::String,
3185
3186    /// Resource labels to represent user provided metadata.
3187    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3188
3189    /// Optional. Type of backup vault to be created.
3190    /// Default is IN_REGION.
3191    pub backup_vault_type: crate::model::backup_vault::BackupVaultType,
3192
3193    /// Output only. Region in which the backup vault is created.
3194    /// Format: `projects/{project_id}/locations/{location}`
3195    pub source_region: std::string::String,
3196
3197    /// Optional. Region where the backups are stored.
3198    /// Format: `projects/{project_id}/locations/{location}`
3199    pub backup_region: std::string::String,
3200
3201    /// Output only. Name of the Backup vault created in source region.
3202    /// Format:
3203    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
3204    pub source_backup_vault: std::string::String,
3205
3206    /// Output only. Name of the Backup vault created in backup region.
3207    /// Format:
3208    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
3209    pub destination_backup_vault: std::string::String,
3210
3211    /// Optional. Backup retention policy defining the retention of backups.
3212    pub backup_retention_policy:
3213        std::option::Option<crate::model::backup_vault::BackupRetentionPolicy>,
3214
3215    /// Optional. Specifies the Key Management System (KMS) configuration to be
3216    /// used for backup encryption. Format:
3217    /// `projects/{project}/locations/{location}/kmsConfigs/{kms_config}`
3218    pub kms_config: std::string::String,
3219
3220    /// Output only. Field indicating encryption state of CMEK backups.
3221    pub encryption_state: crate::model::backup_vault::EncryptionState,
3222
3223    /// Output only. The crypto key version used to encrypt the backup vault.
3224    /// Format:
3225    /// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`
3226    pub backups_crypto_key_version: std::string::String,
3227
3228    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3229}
3230
3231impl BackupVault {
3232    /// Creates a new default instance.
3233    pub fn new() -> Self {
3234        std::default::Default::default()
3235    }
3236
3237    /// Sets the value of [name][crate::model::BackupVault::name].
3238    ///
3239    /// # Example
3240    /// ```ignore,no_run
3241    /// # use google_cloud_netapp_v1::model::BackupVault;
3242    /// # let project_id = "project_id";
3243    /// # let location_id = "location_id";
3244    /// # let backup_vault_id = "backup_vault_id";
3245    /// let x = BackupVault::new().set_name(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}"));
3246    /// ```
3247    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3248        self.name = v.into();
3249        self
3250    }
3251
3252    /// Sets the value of [state][crate::model::BackupVault::state].
3253    ///
3254    /// # Example
3255    /// ```ignore,no_run
3256    /// # use google_cloud_netapp_v1::model::BackupVault;
3257    /// use google_cloud_netapp_v1::model::backup_vault::State;
3258    /// let x0 = BackupVault::new().set_state(State::Creating);
3259    /// let x1 = BackupVault::new().set_state(State::Ready);
3260    /// let x2 = BackupVault::new().set_state(State::Deleting);
3261    /// ```
3262    pub fn set_state<T: std::convert::Into<crate::model::backup_vault::State>>(
3263        mut self,
3264        v: T,
3265    ) -> Self {
3266        self.state = v.into();
3267        self
3268    }
3269
3270    /// Sets the value of [create_time][crate::model::BackupVault::create_time].
3271    ///
3272    /// # Example
3273    /// ```ignore,no_run
3274    /// # use google_cloud_netapp_v1::model::BackupVault;
3275    /// use wkt::Timestamp;
3276    /// let x = BackupVault::new().set_create_time(Timestamp::default()/* use setters */);
3277    /// ```
3278    pub fn set_create_time<T>(mut self, v: T) -> Self
3279    where
3280        T: std::convert::Into<wkt::Timestamp>,
3281    {
3282        self.create_time = std::option::Option::Some(v.into());
3283        self
3284    }
3285
3286    /// Sets or clears the value of [create_time][crate::model::BackupVault::create_time].
3287    ///
3288    /// # Example
3289    /// ```ignore,no_run
3290    /// # use google_cloud_netapp_v1::model::BackupVault;
3291    /// use wkt::Timestamp;
3292    /// let x = BackupVault::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3293    /// let x = BackupVault::new().set_or_clear_create_time(None::<Timestamp>);
3294    /// ```
3295    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3296    where
3297        T: std::convert::Into<wkt::Timestamp>,
3298    {
3299        self.create_time = v.map(|x| x.into());
3300        self
3301    }
3302
3303    /// Sets the value of [description][crate::model::BackupVault::description].
3304    ///
3305    /// # Example
3306    /// ```ignore,no_run
3307    /// # use google_cloud_netapp_v1::model::BackupVault;
3308    /// let x = BackupVault::new().set_description("example");
3309    /// ```
3310    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3311        self.description = v.into();
3312        self
3313    }
3314
3315    /// Sets the value of [labels][crate::model::BackupVault::labels].
3316    ///
3317    /// # Example
3318    /// ```ignore,no_run
3319    /// # use google_cloud_netapp_v1::model::BackupVault;
3320    /// let x = BackupVault::new().set_labels([
3321    ///     ("key0", "abc"),
3322    ///     ("key1", "xyz"),
3323    /// ]);
3324    /// ```
3325    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3326    where
3327        T: std::iter::IntoIterator<Item = (K, V)>,
3328        K: std::convert::Into<std::string::String>,
3329        V: std::convert::Into<std::string::String>,
3330    {
3331        use std::iter::Iterator;
3332        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3333        self
3334    }
3335
3336    /// Sets the value of [backup_vault_type][crate::model::BackupVault::backup_vault_type].
3337    ///
3338    /// # Example
3339    /// ```ignore,no_run
3340    /// # use google_cloud_netapp_v1::model::BackupVault;
3341    /// use google_cloud_netapp_v1::model::backup_vault::BackupVaultType;
3342    /// let x0 = BackupVault::new().set_backup_vault_type(BackupVaultType::InRegion);
3343    /// let x1 = BackupVault::new().set_backup_vault_type(BackupVaultType::CrossRegion);
3344    /// ```
3345    pub fn set_backup_vault_type<
3346        T: std::convert::Into<crate::model::backup_vault::BackupVaultType>,
3347    >(
3348        mut self,
3349        v: T,
3350    ) -> Self {
3351        self.backup_vault_type = v.into();
3352        self
3353    }
3354
3355    /// Sets the value of [source_region][crate::model::BackupVault::source_region].
3356    ///
3357    /// # Example
3358    /// ```ignore,no_run
3359    /// # use google_cloud_netapp_v1::model::BackupVault;
3360    /// let x = BackupVault::new().set_source_region("example");
3361    /// ```
3362    pub fn set_source_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3363        self.source_region = v.into();
3364        self
3365    }
3366
3367    /// Sets the value of [backup_region][crate::model::BackupVault::backup_region].
3368    ///
3369    /// # Example
3370    /// ```ignore,no_run
3371    /// # use google_cloud_netapp_v1::model::BackupVault;
3372    /// let x = BackupVault::new().set_backup_region("example");
3373    /// ```
3374    pub fn set_backup_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3375        self.backup_region = v.into();
3376        self
3377    }
3378
3379    /// Sets the value of [source_backup_vault][crate::model::BackupVault::source_backup_vault].
3380    ///
3381    /// # Example
3382    /// ```ignore,no_run
3383    /// # use google_cloud_netapp_v1::model::BackupVault;
3384    /// # let project_id = "project_id";
3385    /// # let location_id = "location_id";
3386    /// # let backup_vault_id = "backup_vault_id";
3387    /// let x = BackupVault::new().set_source_backup_vault(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}"));
3388    /// ```
3389    pub fn set_source_backup_vault<T: std::convert::Into<std::string::String>>(
3390        mut self,
3391        v: T,
3392    ) -> Self {
3393        self.source_backup_vault = v.into();
3394        self
3395    }
3396
3397    /// Sets the value of [destination_backup_vault][crate::model::BackupVault::destination_backup_vault].
3398    ///
3399    /// # Example
3400    /// ```ignore,no_run
3401    /// # use google_cloud_netapp_v1::model::BackupVault;
3402    /// # let project_id = "project_id";
3403    /// # let location_id = "location_id";
3404    /// # let backup_vault_id = "backup_vault_id";
3405    /// let x = BackupVault::new().set_destination_backup_vault(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}"));
3406    /// ```
3407    pub fn set_destination_backup_vault<T: std::convert::Into<std::string::String>>(
3408        mut self,
3409        v: T,
3410    ) -> Self {
3411        self.destination_backup_vault = v.into();
3412        self
3413    }
3414
3415    /// Sets the value of [backup_retention_policy][crate::model::BackupVault::backup_retention_policy].
3416    ///
3417    /// # Example
3418    /// ```ignore,no_run
3419    /// # use google_cloud_netapp_v1::model::BackupVault;
3420    /// use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3421    /// let x = BackupVault::new().set_backup_retention_policy(BackupRetentionPolicy::default()/* use setters */);
3422    /// ```
3423    pub fn set_backup_retention_policy<T>(mut self, v: T) -> Self
3424    where
3425        T: std::convert::Into<crate::model::backup_vault::BackupRetentionPolicy>,
3426    {
3427        self.backup_retention_policy = std::option::Option::Some(v.into());
3428        self
3429    }
3430
3431    /// Sets or clears the value of [backup_retention_policy][crate::model::BackupVault::backup_retention_policy].
3432    ///
3433    /// # Example
3434    /// ```ignore,no_run
3435    /// # use google_cloud_netapp_v1::model::BackupVault;
3436    /// use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3437    /// let x = BackupVault::new().set_or_clear_backup_retention_policy(Some(BackupRetentionPolicy::default()/* use setters */));
3438    /// let x = BackupVault::new().set_or_clear_backup_retention_policy(None::<BackupRetentionPolicy>);
3439    /// ```
3440    pub fn set_or_clear_backup_retention_policy<T>(mut self, v: std::option::Option<T>) -> Self
3441    where
3442        T: std::convert::Into<crate::model::backup_vault::BackupRetentionPolicy>,
3443    {
3444        self.backup_retention_policy = v.map(|x| x.into());
3445        self
3446    }
3447
3448    /// Sets the value of [kms_config][crate::model::BackupVault::kms_config].
3449    ///
3450    /// # Example
3451    /// ```ignore,no_run
3452    /// # use google_cloud_netapp_v1::model::BackupVault;
3453    /// # let project_id = "project_id";
3454    /// # let location_id = "location_id";
3455    /// # let kms_config_id = "kms_config_id";
3456    /// let x = BackupVault::new().set_kms_config(format!("projects/{project_id}/locations/{location_id}/kmsConfigs/{kms_config_id}"));
3457    /// ```
3458    pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3459        self.kms_config = v.into();
3460        self
3461    }
3462
3463    /// Sets the value of [encryption_state][crate::model::BackupVault::encryption_state].
3464    ///
3465    /// # Example
3466    /// ```ignore,no_run
3467    /// # use google_cloud_netapp_v1::model::BackupVault;
3468    /// use google_cloud_netapp_v1::model::backup_vault::EncryptionState;
3469    /// let x0 = BackupVault::new().set_encryption_state(EncryptionState::Pending);
3470    /// let x1 = BackupVault::new().set_encryption_state(EncryptionState::Completed);
3471    /// let x2 = BackupVault::new().set_encryption_state(EncryptionState::InProgress);
3472    /// ```
3473    pub fn set_encryption_state<
3474        T: std::convert::Into<crate::model::backup_vault::EncryptionState>,
3475    >(
3476        mut self,
3477        v: T,
3478    ) -> Self {
3479        self.encryption_state = v.into();
3480        self
3481    }
3482
3483    /// Sets the value of [backups_crypto_key_version][crate::model::BackupVault::backups_crypto_key_version].
3484    ///
3485    /// # Example
3486    /// ```ignore,no_run
3487    /// # use google_cloud_netapp_v1::model::BackupVault;
3488    /// let x = BackupVault::new().set_backups_crypto_key_version("example");
3489    /// ```
3490    pub fn set_backups_crypto_key_version<T: std::convert::Into<std::string::String>>(
3491        mut self,
3492        v: T,
3493    ) -> Self {
3494        self.backups_crypto_key_version = v.into();
3495        self
3496    }
3497}
3498
3499impl wkt::message::Message for BackupVault {
3500    fn typename() -> &'static str {
3501        "type.googleapis.com/google.cloud.netapp.v1.BackupVault"
3502    }
3503}
3504
3505/// Defines additional types related to [BackupVault].
3506pub mod backup_vault {
3507    #[allow(unused_imports)]
3508    use super::*;
3509
3510    /// Retention policy for backups in the backup vault
3511    #[derive(Clone, Default, PartialEq)]
3512    #[non_exhaustive]
3513    pub struct BackupRetentionPolicy {
3514        /// Required. Minimum retention duration in days for backups in the backup
3515        /// vault.
3516        pub backup_minimum_enforced_retention_days: i32,
3517
3518        /// Optional. Indicates if the daily backups are immutable.
3519        /// At least one of daily_backup_immutable, weekly_backup_immutable,
3520        /// monthly_backup_immutable and manual_backup_immutable must be true.
3521        pub daily_backup_immutable: bool,
3522
3523        /// Optional. Indicates if the weekly backups are immutable.
3524        /// At least one of daily_backup_immutable, weekly_backup_immutable,
3525        /// monthly_backup_immutable and manual_backup_immutable must be true.
3526        pub weekly_backup_immutable: bool,
3527
3528        /// Optional. Indicates if the monthly backups are immutable.
3529        /// At least one of daily_backup_immutable, weekly_backup_immutable,
3530        /// monthly_backup_immutable and manual_backup_immutable must be true.
3531        pub monthly_backup_immutable: bool,
3532
3533        /// Optional. Indicates if the manual backups are immutable.
3534        /// At least one of daily_backup_immutable, weekly_backup_immutable,
3535        /// monthly_backup_immutable and manual_backup_immutable must be true.
3536        pub manual_backup_immutable: bool,
3537
3538        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3539    }
3540
3541    impl BackupRetentionPolicy {
3542        /// Creates a new default instance.
3543        pub fn new() -> Self {
3544            std::default::Default::default()
3545        }
3546
3547        /// Sets the value of [backup_minimum_enforced_retention_days][crate::model::backup_vault::BackupRetentionPolicy::backup_minimum_enforced_retention_days].
3548        ///
3549        /// # Example
3550        /// ```ignore,no_run
3551        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3552        /// let x = BackupRetentionPolicy::new().set_backup_minimum_enforced_retention_days(42);
3553        /// ```
3554        pub fn set_backup_minimum_enforced_retention_days<T: std::convert::Into<i32>>(
3555            mut self,
3556            v: T,
3557        ) -> Self {
3558            self.backup_minimum_enforced_retention_days = v.into();
3559            self
3560        }
3561
3562        /// Sets the value of [daily_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::daily_backup_immutable].
3563        ///
3564        /// # Example
3565        /// ```ignore,no_run
3566        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3567        /// let x = BackupRetentionPolicy::new().set_daily_backup_immutable(true);
3568        /// ```
3569        pub fn set_daily_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3570            self.daily_backup_immutable = v.into();
3571            self
3572        }
3573
3574        /// Sets the value of [weekly_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::weekly_backup_immutable].
3575        ///
3576        /// # Example
3577        /// ```ignore,no_run
3578        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3579        /// let x = BackupRetentionPolicy::new().set_weekly_backup_immutable(true);
3580        /// ```
3581        pub fn set_weekly_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3582            self.weekly_backup_immutable = v.into();
3583            self
3584        }
3585
3586        /// Sets the value of [monthly_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::monthly_backup_immutable].
3587        ///
3588        /// # Example
3589        /// ```ignore,no_run
3590        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3591        /// let x = BackupRetentionPolicy::new().set_monthly_backup_immutable(true);
3592        /// ```
3593        pub fn set_monthly_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3594            self.monthly_backup_immutable = v.into();
3595            self
3596        }
3597
3598        /// Sets the value of [manual_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::manual_backup_immutable].
3599        ///
3600        /// # Example
3601        /// ```ignore,no_run
3602        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3603        /// let x = BackupRetentionPolicy::new().set_manual_backup_immutable(true);
3604        /// ```
3605        pub fn set_manual_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3606            self.manual_backup_immutable = v.into();
3607            self
3608        }
3609    }
3610
3611    impl wkt::message::Message for BackupRetentionPolicy {
3612        fn typename() -> &'static str {
3613            "type.googleapis.com/google.cloud.netapp.v1.BackupVault.BackupRetentionPolicy"
3614        }
3615    }
3616
3617    /// The Backup Vault States
3618    ///
3619    /// # Working with unknown values
3620    ///
3621    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3622    /// additional enum variants at any time. Adding new variants is not considered
3623    /// a breaking change. Applications should write their code in anticipation of:
3624    ///
3625    /// - New values appearing in future releases of the client library, **and**
3626    /// - New values received dynamically, without application changes.
3627    ///
3628    /// Please consult the [Working with enums] section in the user guide for some
3629    /// guidelines.
3630    ///
3631    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3632    #[derive(Clone, Debug, PartialEq)]
3633    #[non_exhaustive]
3634    pub enum State {
3635        /// State not set.
3636        Unspecified,
3637        /// BackupVault is being created.
3638        Creating,
3639        /// BackupVault is available for use.
3640        Ready,
3641        /// BackupVault is being deleted.
3642        Deleting,
3643        /// BackupVault is not valid and cannot be used.
3644        Error,
3645        /// BackupVault is being updated.
3646        Updating,
3647        /// If set, the enum was initialized with an unknown value.
3648        ///
3649        /// Applications can examine the value using [State::value] or
3650        /// [State::name].
3651        UnknownValue(state::UnknownValue),
3652    }
3653
3654    #[doc(hidden)]
3655    pub mod state {
3656        #[allow(unused_imports)]
3657        use super::*;
3658        #[derive(Clone, Debug, PartialEq)]
3659        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3660    }
3661
3662    impl State {
3663        /// Gets the enum value.
3664        ///
3665        /// Returns `None` if the enum contains an unknown value deserialized from
3666        /// the string representation of enums.
3667        pub fn value(&self) -> std::option::Option<i32> {
3668            match self {
3669                Self::Unspecified => std::option::Option::Some(0),
3670                Self::Creating => std::option::Option::Some(1),
3671                Self::Ready => std::option::Option::Some(2),
3672                Self::Deleting => std::option::Option::Some(3),
3673                Self::Error => std::option::Option::Some(4),
3674                Self::Updating => std::option::Option::Some(5),
3675                Self::UnknownValue(u) => u.0.value(),
3676            }
3677        }
3678
3679        /// Gets the enum value as a string.
3680        ///
3681        /// Returns `None` if the enum contains an unknown value deserialized from
3682        /// the integer representation of enums.
3683        pub fn name(&self) -> std::option::Option<&str> {
3684            match self {
3685                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3686                Self::Creating => std::option::Option::Some("CREATING"),
3687                Self::Ready => std::option::Option::Some("READY"),
3688                Self::Deleting => std::option::Option::Some("DELETING"),
3689                Self::Error => std::option::Option::Some("ERROR"),
3690                Self::Updating => std::option::Option::Some("UPDATING"),
3691                Self::UnknownValue(u) => u.0.name(),
3692            }
3693        }
3694    }
3695
3696    impl std::default::Default for State {
3697        fn default() -> Self {
3698            use std::convert::From;
3699            Self::from(0)
3700        }
3701    }
3702
3703    impl std::fmt::Display for State {
3704        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3705            wkt::internal::display_enum(f, self.name(), self.value())
3706        }
3707    }
3708
3709    impl std::convert::From<i32> for State {
3710        fn from(value: i32) -> Self {
3711            match value {
3712                0 => Self::Unspecified,
3713                1 => Self::Creating,
3714                2 => Self::Ready,
3715                3 => Self::Deleting,
3716                4 => Self::Error,
3717                5 => Self::Updating,
3718                _ => Self::UnknownValue(state::UnknownValue(
3719                    wkt::internal::UnknownEnumValue::Integer(value),
3720                )),
3721            }
3722        }
3723    }
3724
3725    impl std::convert::From<&str> for State {
3726        fn from(value: &str) -> Self {
3727            use std::string::ToString;
3728            match value {
3729                "STATE_UNSPECIFIED" => Self::Unspecified,
3730                "CREATING" => Self::Creating,
3731                "READY" => Self::Ready,
3732                "DELETING" => Self::Deleting,
3733                "ERROR" => Self::Error,
3734                "UPDATING" => Self::Updating,
3735                _ => Self::UnknownValue(state::UnknownValue(
3736                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3737                )),
3738            }
3739        }
3740    }
3741
3742    impl serde::ser::Serialize for State {
3743        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3744        where
3745            S: serde::Serializer,
3746        {
3747            match self {
3748                Self::Unspecified => serializer.serialize_i32(0),
3749                Self::Creating => serializer.serialize_i32(1),
3750                Self::Ready => serializer.serialize_i32(2),
3751                Self::Deleting => serializer.serialize_i32(3),
3752                Self::Error => serializer.serialize_i32(4),
3753                Self::Updating => serializer.serialize_i32(5),
3754                Self::UnknownValue(u) => u.0.serialize(serializer),
3755            }
3756        }
3757    }
3758
3759    impl<'de> serde::de::Deserialize<'de> for State {
3760        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3761        where
3762            D: serde::Deserializer<'de>,
3763        {
3764            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3765                ".google.cloud.netapp.v1.BackupVault.State",
3766            ))
3767        }
3768    }
3769
3770    /// Backup Vault Type.
3771    ///
3772    /// # Working with unknown values
3773    ///
3774    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3775    /// additional enum variants at any time. Adding new variants is not considered
3776    /// a breaking change. Applications should write their code in anticipation of:
3777    ///
3778    /// - New values appearing in future releases of the client library, **and**
3779    /// - New values received dynamically, without application changes.
3780    ///
3781    /// Please consult the [Working with enums] section in the user guide for some
3782    /// guidelines.
3783    ///
3784    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3785    #[derive(Clone, Debug, PartialEq)]
3786    #[non_exhaustive]
3787    pub enum BackupVaultType {
3788        /// BackupVault type not set.
3789        Unspecified,
3790        /// BackupVault type is IN_REGION.
3791        InRegion,
3792        /// BackupVault type is CROSS_REGION.
3793        CrossRegion,
3794        /// If set, the enum was initialized with an unknown value.
3795        ///
3796        /// Applications can examine the value using [BackupVaultType::value] or
3797        /// [BackupVaultType::name].
3798        UnknownValue(backup_vault_type::UnknownValue),
3799    }
3800
3801    #[doc(hidden)]
3802    pub mod backup_vault_type {
3803        #[allow(unused_imports)]
3804        use super::*;
3805        #[derive(Clone, Debug, PartialEq)]
3806        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3807    }
3808
3809    impl BackupVaultType {
3810        /// Gets the enum value.
3811        ///
3812        /// Returns `None` if the enum contains an unknown value deserialized from
3813        /// the string representation of enums.
3814        pub fn value(&self) -> std::option::Option<i32> {
3815            match self {
3816                Self::Unspecified => std::option::Option::Some(0),
3817                Self::InRegion => std::option::Option::Some(1),
3818                Self::CrossRegion => std::option::Option::Some(2),
3819                Self::UnknownValue(u) => u.0.value(),
3820            }
3821        }
3822
3823        /// Gets the enum value as a string.
3824        ///
3825        /// Returns `None` if the enum contains an unknown value deserialized from
3826        /// the integer representation of enums.
3827        pub fn name(&self) -> std::option::Option<&str> {
3828            match self {
3829                Self::Unspecified => std::option::Option::Some("BACKUP_VAULT_TYPE_UNSPECIFIED"),
3830                Self::InRegion => std::option::Option::Some("IN_REGION"),
3831                Self::CrossRegion => std::option::Option::Some("CROSS_REGION"),
3832                Self::UnknownValue(u) => u.0.name(),
3833            }
3834        }
3835    }
3836
3837    impl std::default::Default for BackupVaultType {
3838        fn default() -> Self {
3839            use std::convert::From;
3840            Self::from(0)
3841        }
3842    }
3843
3844    impl std::fmt::Display for BackupVaultType {
3845        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3846            wkt::internal::display_enum(f, self.name(), self.value())
3847        }
3848    }
3849
3850    impl std::convert::From<i32> for BackupVaultType {
3851        fn from(value: i32) -> Self {
3852            match value {
3853                0 => Self::Unspecified,
3854                1 => Self::InRegion,
3855                2 => Self::CrossRegion,
3856                _ => Self::UnknownValue(backup_vault_type::UnknownValue(
3857                    wkt::internal::UnknownEnumValue::Integer(value),
3858                )),
3859            }
3860        }
3861    }
3862
3863    impl std::convert::From<&str> for BackupVaultType {
3864        fn from(value: &str) -> Self {
3865            use std::string::ToString;
3866            match value {
3867                "BACKUP_VAULT_TYPE_UNSPECIFIED" => Self::Unspecified,
3868                "IN_REGION" => Self::InRegion,
3869                "CROSS_REGION" => Self::CrossRegion,
3870                _ => Self::UnknownValue(backup_vault_type::UnknownValue(
3871                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3872                )),
3873            }
3874        }
3875    }
3876
3877    impl serde::ser::Serialize for BackupVaultType {
3878        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3879        where
3880            S: serde::Serializer,
3881        {
3882            match self {
3883                Self::Unspecified => serializer.serialize_i32(0),
3884                Self::InRegion => serializer.serialize_i32(1),
3885                Self::CrossRegion => serializer.serialize_i32(2),
3886                Self::UnknownValue(u) => u.0.serialize(serializer),
3887            }
3888        }
3889    }
3890
3891    impl<'de> serde::de::Deserialize<'de> for BackupVaultType {
3892        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3893        where
3894            D: serde::Deserializer<'de>,
3895        {
3896            deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupVaultType>::new(
3897                ".google.cloud.netapp.v1.BackupVault.BackupVaultType",
3898            ))
3899        }
3900    }
3901
3902    /// Encryption state of customer-managed encryption keys (CMEK) backups.
3903    ///
3904    /// # Working with unknown values
3905    ///
3906    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3907    /// additional enum variants at any time. Adding new variants is not considered
3908    /// a breaking change. Applications should write their code in anticipation of:
3909    ///
3910    /// - New values appearing in future releases of the client library, **and**
3911    /// - New values received dynamically, without application changes.
3912    ///
3913    /// Please consult the [Working with enums] section in the user guide for some
3914    /// guidelines.
3915    ///
3916    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
3917    #[derive(Clone, Debug, PartialEq)]
3918    #[non_exhaustive]
3919    pub enum EncryptionState {
3920        /// Encryption state not set.
3921        Unspecified,
3922        /// Encryption state is pending.
3923        Pending,
3924        /// Encryption is complete.
3925        Completed,
3926        /// Encryption is in progress.
3927        InProgress,
3928        /// Encryption has failed.
3929        Failed,
3930        /// If set, the enum was initialized with an unknown value.
3931        ///
3932        /// Applications can examine the value using [EncryptionState::value] or
3933        /// [EncryptionState::name].
3934        UnknownValue(encryption_state::UnknownValue),
3935    }
3936
3937    #[doc(hidden)]
3938    pub mod encryption_state {
3939        #[allow(unused_imports)]
3940        use super::*;
3941        #[derive(Clone, Debug, PartialEq)]
3942        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3943    }
3944
3945    impl EncryptionState {
3946        /// Gets the enum value.
3947        ///
3948        /// Returns `None` if the enum contains an unknown value deserialized from
3949        /// the string representation of enums.
3950        pub fn value(&self) -> std::option::Option<i32> {
3951            match self {
3952                Self::Unspecified => std::option::Option::Some(0),
3953                Self::Pending => std::option::Option::Some(1),
3954                Self::Completed => std::option::Option::Some(2),
3955                Self::InProgress => std::option::Option::Some(3),
3956                Self::Failed => std::option::Option::Some(4),
3957                Self::UnknownValue(u) => u.0.value(),
3958            }
3959        }
3960
3961        /// Gets the enum value as a string.
3962        ///
3963        /// Returns `None` if the enum contains an unknown value deserialized from
3964        /// the integer representation of enums.
3965        pub fn name(&self) -> std::option::Option<&str> {
3966            match self {
3967                Self::Unspecified => std::option::Option::Some("ENCRYPTION_STATE_UNSPECIFIED"),
3968                Self::Pending => std::option::Option::Some("ENCRYPTION_STATE_PENDING"),
3969                Self::Completed => std::option::Option::Some("ENCRYPTION_STATE_COMPLETED"),
3970                Self::InProgress => std::option::Option::Some("ENCRYPTION_STATE_IN_PROGRESS"),
3971                Self::Failed => std::option::Option::Some("ENCRYPTION_STATE_FAILED"),
3972                Self::UnknownValue(u) => u.0.name(),
3973            }
3974        }
3975    }
3976
3977    impl std::default::Default for EncryptionState {
3978        fn default() -> Self {
3979            use std::convert::From;
3980            Self::from(0)
3981        }
3982    }
3983
3984    impl std::fmt::Display for EncryptionState {
3985        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3986            wkt::internal::display_enum(f, self.name(), self.value())
3987        }
3988    }
3989
3990    impl std::convert::From<i32> for EncryptionState {
3991        fn from(value: i32) -> Self {
3992            match value {
3993                0 => Self::Unspecified,
3994                1 => Self::Pending,
3995                2 => Self::Completed,
3996                3 => Self::InProgress,
3997                4 => Self::Failed,
3998                _ => Self::UnknownValue(encryption_state::UnknownValue(
3999                    wkt::internal::UnknownEnumValue::Integer(value),
4000                )),
4001            }
4002        }
4003    }
4004
4005    impl std::convert::From<&str> for EncryptionState {
4006        fn from(value: &str) -> Self {
4007            use std::string::ToString;
4008            match value {
4009                "ENCRYPTION_STATE_UNSPECIFIED" => Self::Unspecified,
4010                "ENCRYPTION_STATE_PENDING" => Self::Pending,
4011                "ENCRYPTION_STATE_COMPLETED" => Self::Completed,
4012                "ENCRYPTION_STATE_IN_PROGRESS" => Self::InProgress,
4013                "ENCRYPTION_STATE_FAILED" => Self::Failed,
4014                _ => Self::UnknownValue(encryption_state::UnknownValue(
4015                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4016                )),
4017            }
4018        }
4019    }
4020
4021    impl serde::ser::Serialize for EncryptionState {
4022        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4023        where
4024            S: serde::Serializer,
4025        {
4026            match self {
4027                Self::Unspecified => serializer.serialize_i32(0),
4028                Self::Pending => serializer.serialize_i32(1),
4029                Self::Completed => serializer.serialize_i32(2),
4030                Self::InProgress => serializer.serialize_i32(3),
4031                Self::Failed => serializer.serialize_i32(4),
4032                Self::UnknownValue(u) => u.0.serialize(serializer),
4033            }
4034        }
4035    }
4036
4037    impl<'de> serde::de::Deserialize<'de> for EncryptionState {
4038        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4039        where
4040            D: serde::Deserializer<'de>,
4041        {
4042            deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionState>::new(
4043                ".google.cloud.netapp.v1.BackupVault.EncryptionState",
4044            ))
4045        }
4046    }
4047}
4048
4049/// GetBackupVaultRequest gets the state of a backupVault.
4050#[derive(Clone, Default, PartialEq)]
4051#[non_exhaustive]
4052pub struct GetBackupVaultRequest {
4053    /// Required. The backupVault resource name, in the format
4054    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
4055    pub name: std::string::String,
4056
4057    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4058}
4059
4060impl GetBackupVaultRequest {
4061    /// Creates a new default instance.
4062    pub fn new() -> Self {
4063        std::default::Default::default()
4064    }
4065
4066    /// Sets the value of [name][crate::model::GetBackupVaultRequest::name].
4067    ///
4068    /// # Example
4069    /// ```ignore,no_run
4070    /// # use google_cloud_netapp_v1::model::GetBackupVaultRequest;
4071    /// # let project_id = "project_id";
4072    /// # let location_id = "location_id";
4073    /// # let backup_vault_id = "backup_vault_id";
4074    /// let x = GetBackupVaultRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}"));
4075    /// ```
4076    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4077        self.name = v.into();
4078        self
4079    }
4080}
4081
4082impl wkt::message::Message for GetBackupVaultRequest {
4083    fn typename() -> &'static str {
4084        "type.googleapis.com/google.cloud.netapp.v1.GetBackupVaultRequest"
4085    }
4086}
4087
4088/// ListBackupVaultsRequest lists backupVaults.
4089#[derive(Clone, Default, PartialEq)]
4090#[non_exhaustive]
4091pub struct ListBackupVaultsRequest {
4092    /// Required. The location for which to retrieve backupVault information,
4093    /// in the format
4094    /// `projects/{project_id}/locations/{location}`.
4095    pub parent: std::string::String,
4096
4097    /// The maximum number of items to return.
4098    pub page_size: i32,
4099
4100    /// The next_page_token value to use if there are additional
4101    /// results to retrieve for this list request.
4102    pub page_token: std::string::String,
4103
4104    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
4105    pub order_by: std::string::String,
4106
4107    /// List filter.
4108    pub filter: std::string::String,
4109
4110    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4111}
4112
4113impl ListBackupVaultsRequest {
4114    /// Creates a new default instance.
4115    pub fn new() -> Self {
4116        std::default::Default::default()
4117    }
4118
4119    /// Sets the value of [parent][crate::model::ListBackupVaultsRequest::parent].
4120    ///
4121    /// # Example
4122    /// ```ignore,no_run
4123    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4124    /// # let project_id = "project_id";
4125    /// # let location_id = "location_id";
4126    /// let x = ListBackupVaultsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
4127    /// ```
4128    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4129        self.parent = v.into();
4130        self
4131    }
4132
4133    /// Sets the value of [page_size][crate::model::ListBackupVaultsRequest::page_size].
4134    ///
4135    /// # Example
4136    /// ```ignore,no_run
4137    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4138    /// let x = ListBackupVaultsRequest::new().set_page_size(42);
4139    /// ```
4140    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4141        self.page_size = v.into();
4142        self
4143    }
4144
4145    /// Sets the value of [page_token][crate::model::ListBackupVaultsRequest::page_token].
4146    ///
4147    /// # Example
4148    /// ```ignore,no_run
4149    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4150    /// let x = ListBackupVaultsRequest::new().set_page_token("example");
4151    /// ```
4152    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4153        self.page_token = v.into();
4154        self
4155    }
4156
4157    /// Sets the value of [order_by][crate::model::ListBackupVaultsRequest::order_by].
4158    ///
4159    /// # Example
4160    /// ```ignore,no_run
4161    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4162    /// let x = ListBackupVaultsRequest::new().set_order_by("example");
4163    /// ```
4164    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4165        self.order_by = v.into();
4166        self
4167    }
4168
4169    /// Sets the value of [filter][crate::model::ListBackupVaultsRequest::filter].
4170    ///
4171    /// # Example
4172    /// ```ignore,no_run
4173    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4174    /// let x = ListBackupVaultsRequest::new().set_filter("example");
4175    /// ```
4176    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4177        self.filter = v.into();
4178        self
4179    }
4180}
4181
4182impl wkt::message::Message for ListBackupVaultsRequest {
4183    fn typename() -> &'static str {
4184        "type.googleapis.com/google.cloud.netapp.v1.ListBackupVaultsRequest"
4185    }
4186}
4187
4188/// ListBackupVaultsResponse is the result of ListBackupVaultsRequest.
4189#[derive(Clone, Default, PartialEq)]
4190#[non_exhaustive]
4191pub struct ListBackupVaultsResponse {
4192    /// A list of backupVaults in the project for the specified location.
4193    pub backup_vaults: std::vec::Vec<crate::model::BackupVault>,
4194
4195    /// The token you can use to retrieve the next page of results. Not returned
4196    /// if there are no more results in the list.
4197    pub next_page_token: std::string::String,
4198
4199    /// Locations that could not be reached.
4200    pub unreachable: std::vec::Vec<std::string::String>,
4201
4202    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4203}
4204
4205impl ListBackupVaultsResponse {
4206    /// Creates a new default instance.
4207    pub fn new() -> Self {
4208        std::default::Default::default()
4209    }
4210
4211    /// Sets the value of [backup_vaults][crate::model::ListBackupVaultsResponse::backup_vaults].
4212    ///
4213    /// # Example
4214    /// ```ignore,no_run
4215    /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
4216    /// use google_cloud_netapp_v1::model::BackupVault;
4217    /// let x = ListBackupVaultsResponse::new()
4218    ///     .set_backup_vaults([
4219    ///         BackupVault::default()/* use setters */,
4220    ///         BackupVault::default()/* use (different) setters */,
4221    ///     ]);
4222    /// ```
4223    pub fn set_backup_vaults<T, V>(mut self, v: T) -> Self
4224    where
4225        T: std::iter::IntoIterator<Item = V>,
4226        V: std::convert::Into<crate::model::BackupVault>,
4227    {
4228        use std::iter::Iterator;
4229        self.backup_vaults = v.into_iter().map(|i| i.into()).collect();
4230        self
4231    }
4232
4233    /// Sets the value of [next_page_token][crate::model::ListBackupVaultsResponse::next_page_token].
4234    ///
4235    /// # Example
4236    /// ```ignore,no_run
4237    /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
4238    /// let x = ListBackupVaultsResponse::new().set_next_page_token("example");
4239    /// ```
4240    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4241        self.next_page_token = v.into();
4242        self
4243    }
4244
4245    /// Sets the value of [unreachable][crate::model::ListBackupVaultsResponse::unreachable].
4246    ///
4247    /// # Example
4248    /// ```ignore,no_run
4249    /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
4250    /// let x = ListBackupVaultsResponse::new().set_unreachable(["a", "b", "c"]);
4251    /// ```
4252    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4253    where
4254        T: std::iter::IntoIterator<Item = V>,
4255        V: std::convert::Into<std::string::String>,
4256    {
4257        use std::iter::Iterator;
4258        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4259        self
4260    }
4261}
4262
4263impl wkt::message::Message for ListBackupVaultsResponse {
4264    fn typename() -> &'static str {
4265        "type.googleapis.com/google.cloud.netapp.v1.ListBackupVaultsResponse"
4266    }
4267}
4268
4269#[doc(hidden)]
4270impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupVaultsResponse {
4271    type PageItem = crate::model::BackupVault;
4272
4273    fn items(self) -> std::vec::Vec<Self::PageItem> {
4274        self.backup_vaults
4275    }
4276
4277    fn next_page_token(&self) -> std::string::String {
4278        use std::clone::Clone;
4279        self.next_page_token.clone()
4280    }
4281}
4282
4283/// CreateBackupVaultRequest creates a backup vault.
4284#[derive(Clone, Default, PartialEq)]
4285#[non_exhaustive]
4286pub struct CreateBackupVaultRequest {
4287    /// Required. The location to create the backup vaults, in the format
4288    /// `projects/{project_id}/locations/{location}`
4289    pub parent: std::string::String,
4290
4291    /// Required. The ID to use for the backupVault.
4292    /// The ID must be unique within the specified location.
4293    /// Must contain only letters, numbers and hyphen, with the first
4294    /// character a letter, the last a letter or a
4295    /// number, and a 63 character maximum.
4296    pub backup_vault_id: std::string::String,
4297
4298    /// Required. A backupVault resource
4299    pub backup_vault: std::option::Option<crate::model::BackupVault>,
4300
4301    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4302}
4303
4304impl CreateBackupVaultRequest {
4305    /// Creates a new default instance.
4306    pub fn new() -> Self {
4307        std::default::Default::default()
4308    }
4309
4310    /// Sets the value of [parent][crate::model::CreateBackupVaultRequest::parent].
4311    ///
4312    /// # Example
4313    /// ```ignore,no_run
4314    /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4315    /// # let project_id = "project_id";
4316    /// # let location_id = "location_id";
4317    /// let x = CreateBackupVaultRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
4318    /// ```
4319    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4320        self.parent = v.into();
4321        self
4322    }
4323
4324    /// Sets the value of [backup_vault_id][crate::model::CreateBackupVaultRequest::backup_vault_id].
4325    ///
4326    /// # Example
4327    /// ```ignore,no_run
4328    /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4329    /// let x = CreateBackupVaultRequest::new().set_backup_vault_id("example");
4330    /// ```
4331    pub fn set_backup_vault_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4332        self.backup_vault_id = v.into();
4333        self
4334    }
4335
4336    /// Sets the value of [backup_vault][crate::model::CreateBackupVaultRequest::backup_vault].
4337    ///
4338    /// # Example
4339    /// ```ignore,no_run
4340    /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4341    /// use google_cloud_netapp_v1::model::BackupVault;
4342    /// let x = CreateBackupVaultRequest::new().set_backup_vault(BackupVault::default()/* use setters */);
4343    /// ```
4344    pub fn set_backup_vault<T>(mut self, v: T) -> Self
4345    where
4346        T: std::convert::Into<crate::model::BackupVault>,
4347    {
4348        self.backup_vault = std::option::Option::Some(v.into());
4349        self
4350    }
4351
4352    /// Sets or clears the value of [backup_vault][crate::model::CreateBackupVaultRequest::backup_vault].
4353    ///
4354    /// # Example
4355    /// ```ignore,no_run
4356    /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4357    /// use google_cloud_netapp_v1::model::BackupVault;
4358    /// let x = CreateBackupVaultRequest::new().set_or_clear_backup_vault(Some(BackupVault::default()/* use setters */));
4359    /// let x = CreateBackupVaultRequest::new().set_or_clear_backup_vault(None::<BackupVault>);
4360    /// ```
4361    pub fn set_or_clear_backup_vault<T>(mut self, v: std::option::Option<T>) -> Self
4362    where
4363        T: std::convert::Into<crate::model::BackupVault>,
4364    {
4365        self.backup_vault = v.map(|x| x.into());
4366        self
4367    }
4368}
4369
4370impl wkt::message::Message for CreateBackupVaultRequest {
4371    fn typename() -> &'static str {
4372        "type.googleapis.com/google.cloud.netapp.v1.CreateBackupVaultRequest"
4373    }
4374}
4375
4376/// DeleteBackupVaultRequest deletes a backupVault.
4377#[derive(Clone, Default, PartialEq)]
4378#[non_exhaustive]
4379pub struct DeleteBackupVaultRequest {
4380    /// Required. The backupVault resource name, in the format
4381    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
4382    pub name: std::string::String,
4383
4384    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4385}
4386
4387impl DeleteBackupVaultRequest {
4388    /// Creates a new default instance.
4389    pub fn new() -> Self {
4390        std::default::Default::default()
4391    }
4392
4393    /// Sets the value of [name][crate::model::DeleteBackupVaultRequest::name].
4394    ///
4395    /// # Example
4396    /// ```ignore,no_run
4397    /// # use google_cloud_netapp_v1::model::DeleteBackupVaultRequest;
4398    /// # let project_id = "project_id";
4399    /// # let location_id = "location_id";
4400    /// # let backup_vault_id = "backup_vault_id";
4401    /// let x = DeleteBackupVaultRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}"));
4402    /// ```
4403    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4404        self.name = v.into();
4405        self
4406    }
4407}
4408
4409impl wkt::message::Message for DeleteBackupVaultRequest {
4410    fn typename() -> &'static str {
4411        "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupVaultRequest"
4412    }
4413}
4414
4415/// UpdateBackupVaultRequest updates description and/or labels for a backupVault.
4416#[derive(Clone, Default, PartialEq)]
4417#[non_exhaustive]
4418pub struct UpdateBackupVaultRequest {
4419    /// Required. Field mask is used to specify the fields to be overwritten in the
4420    /// Backup resource to be updated.
4421    /// The fields specified in the update_mask are relative to the resource, not
4422    /// the full request. A field will be overwritten if it is in the mask. If the
4423    /// user does not provide a mask then all fields will be overwritten.
4424    pub update_mask: std::option::Option<wkt::FieldMask>,
4425
4426    /// Required. The backupVault being updated
4427    pub backup_vault: std::option::Option<crate::model::BackupVault>,
4428
4429    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4430}
4431
4432impl UpdateBackupVaultRequest {
4433    /// Creates a new default instance.
4434    pub fn new() -> Self {
4435        std::default::Default::default()
4436    }
4437
4438    /// Sets the value of [update_mask][crate::model::UpdateBackupVaultRequest::update_mask].
4439    ///
4440    /// # Example
4441    /// ```ignore,no_run
4442    /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4443    /// use wkt::FieldMask;
4444    /// let x = UpdateBackupVaultRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4445    /// ```
4446    pub fn set_update_mask<T>(mut self, v: T) -> Self
4447    where
4448        T: std::convert::Into<wkt::FieldMask>,
4449    {
4450        self.update_mask = std::option::Option::Some(v.into());
4451        self
4452    }
4453
4454    /// Sets or clears the value of [update_mask][crate::model::UpdateBackupVaultRequest::update_mask].
4455    ///
4456    /// # Example
4457    /// ```ignore,no_run
4458    /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4459    /// use wkt::FieldMask;
4460    /// let x = UpdateBackupVaultRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4461    /// let x = UpdateBackupVaultRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4462    /// ```
4463    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4464    where
4465        T: std::convert::Into<wkt::FieldMask>,
4466    {
4467        self.update_mask = v.map(|x| x.into());
4468        self
4469    }
4470
4471    /// Sets the value of [backup_vault][crate::model::UpdateBackupVaultRequest::backup_vault].
4472    ///
4473    /// # Example
4474    /// ```ignore,no_run
4475    /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4476    /// use google_cloud_netapp_v1::model::BackupVault;
4477    /// let x = UpdateBackupVaultRequest::new().set_backup_vault(BackupVault::default()/* use setters */);
4478    /// ```
4479    pub fn set_backup_vault<T>(mut self, v: T) -> Self
4480    where
4481        T: std::convert::Into<crate::model::BackupVault>,
4482    {
4483        self.backup_vault = std::option::Option::Some(v.into());
4484        self
4485    }
4486
4487    /// Sets or clears the value of [backup_vault][crate::model::UpdateBackupVaultRequest::backup_vault].
4488    ///
4489    /// # Example
4490    /// ```ignore,no_run
4491    /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4492    /// use google_cloud_netapp_v1::model::BackupVault;
4493    /// let x = UpdateBackupVaultRequest::new().set_or_clear_backup_vault(Some(BackupVault::default()/* use setters */));
4494    /// let x = UpdateBackupVaultRequest::new().set_or_clear_backup_vault(None::<BackupVault>);
4495    /// ```
4496    pub fn set_or_clear_backup_vault<T>(mut self, v: std::option::Option<T>) -> Self
4497    where
4498        T: std::convert::Into<crate::model::BackupVault>,
4499    {
4500        self.backup_vault = v.map(|x| x.into());
4501        self
4502    }
4503}
4504
4505impl wkt::message::Message for UpdateBackupVaultRequest {
4506    fn typename() -> &'static str {
4507        "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupVaultRequest"
4508    }
4509}
4510
4511/// Represents the metadata of the long-running operation.
4512#[derive(Clone, Default, PartialEq)]
4513#[non_exhaustive]
4514pub struct OperationMetadata {
4515    /// Output only. The time the operation was created.
4516    pub create_time: std::option::Option<wkt::Timestamp>,
4517
4518    /// Output only. The time the operation finished running.
4519    pub end_time: std::option::Option<wkt::Timestamp>,
4520
4521    /// Output only. Server-defined resource path for the target of the operation.
4522    pub target: std::string::String,
4523
4524    /// Output only. Name of the verb executed by the operation.
4525    pub verb: std::string::String,
4526
4527    /// Output only. Human-readable status of the operation, if any.
4528    pub status_message: std::string::String,
4529
4530    /// Output only. Identifies whether the user has requested cancellation
4531    /// of the operation. Operations that have been canceled successfully
4532    /// have [Operation.error][] value with a
4533    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
4534    /// `Code.CANCELLED`.
4535    pub requested_cancellation: bool,
4536
4537    /// Output only. API version used to start the operation.
4538    pub api_version: std::string::String,
4539
4540    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4541}
4542
4543impl OperationMetadata {
4544    /// Creates a new default instance.
4545    pub fn new() -> Self {
4546        std::default::Default::default()
4547    }
4548
4549    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
4550    ///
4551    /// # Example
4552    /// ```ignore,no_run
4553    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4554    /// use wkt::Timestamp;
4555    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
4556    /// ```
4557    pub fn set_create_time<T>(mut self, v: T) -> Self
4558    where
4559        T: std::convert::Into<wkt::Timestamp>,
4560    {
4561        self.create_time = std::option::Option::Some(v.into());
4562        self
4563    }
4564
4565    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
4566    ///
4567    /// # Example
4568    /// ```ignore,no_run
4569    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4570    /// use wkt::Timestamp;
4571    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4572    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
4573    /// ```
4574    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4575    where
4576        T: std::convert::Into<wkt::Timestamp>,
4577    {
4578        self.create_time = v.map(|x| x.into());
4579        self
4580    }
4581
4582    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
4583    ///
4584    /// # Example
4585    /// ```ignore,no_run
4586    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4587    /// use wkt::Timestamp;
4588    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
4589    /// ```
4590    pub fn set_end_time<T>(mut self, v: T) -> Self
4591    where
4592        T: std::convert::Into<wkt::Timestamp>,
4593    {
4594        self.end_time = std::option::Option::Some(v.into());
4595        self
4596    }
4597
4598    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
4599    ///
4600    /// # Example
4601    /// ```ignore,no_run
4602    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4603    /// use wkt::Timestamp;
4604    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
4605    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
4606    /// ```
4607    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4608    where
4609        T: std::convert::Into<wkt::Timestamp>,
4610    {
4611        self.end_time = v.map(|x| x.into());
4612        self
4613    }
4614
4615    /// Sets the value of [target][crate::model::OperationMetadata::target].
4616    ///
4617    /// # Example
4618    /// ```ignore,no_run
4619    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4620    /// let x = OperationMetadata::new().set_target("example");
4621    /// ```
4622    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4623        self.target = v.into();
4624        self
4625    }
4626
4627    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
4628    ///
4629    /// # Example
4630    /// ```ignore,no_run
4631    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4632    /// let x = OperationMetadata::new().set_verb("example");
4633    /// ```
4634    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4635        self.verb = v.into();
4636        self
4637    }
4638
4639    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
4640    ///
4641    /// # Example
4642    /// ```ignore,no_run
4643    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4644    /// let x = OperationMetadata::new().set_status_message("example");
4645    /// ```
4646    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4647        self.status_message = v.into();
4648        self
4649    }
4650
4651    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
4652    ///
4653    /// # Example
4654    /// ```ignore,no_run
4655    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4656    /// let x = OperationMetadata::new().set_requested_cancellation(true);
4657    /// ```
4658    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4659        self.requested_cancellation = v.into();
4660        self
4661    }
4662
4663    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
4664    ///
4665    /// # Example
4666    /// ```ignore,no_run
4667    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4668    /// let x = OperationMetadata::new().set_api_version("example");
4669    /// ```
4670    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4671        self.api_version = v.into();
4672        self
4673    }
4674}
4675
4676impl wkt::message::Message for OperationMetadata {
4677    fn typename() -> &'static str {
4678        "type.googleapis.com/google.cloud.netapp.v1.OperationMetadata"
4679    }
4680}
4681
4682/// Metadata for a given
4683/// [google.cloud.location.Location][google.cloud.location.Location].
4684///
4685/// [google.cloud.location.Location]: google_cloud_location::model::Location
4686#[derive(Clone, Default, PartialEq)]
4687#[non_exhaustive]
4688pub struct LocationMetadata {
4689    /// Output only. Supported service levels in a location.
4690    pub supported_service_levels: std::vec::Vec<crate::model::ServiceLevel>,
4691
4692    /// Output only. Supported flex performance in a location.
4693    pub supported_flex_performance: std::vec::Vec<crate::model::FlexPerformance>,
4694
4695    /// Output only. Indicates if the location has VCP support.
4696    pub has_vcp: bool,
4697
4698    /// Output only. Indicates if the location has ONTAP Proxy support.
4699    pub has_ontap_proxy: bool,
4700
4701    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4702}
4703
4704impl LocationMetadata {
4705    /// Creates a new default instance.
4706    pub fn new() -> Self {
4707        std::default::Default::default()
4708    }
4709
4710    /// Sets the value of [supported_service_levels][crate::model::LocationMetadata::supported_service_levels].
4711    ///
4712    /// # Example
4713    /// ```ignore,no_run
4714    /// # use google_cloud_netapp_v1::model::LocationMetadata;
4715    /// use google_cloud_netapp_v1::model::ServiceLevel;
4716    /// let x = LocationMetadata::new().set_supported_service_levels([
4717    ///     ServiceLevel::Premium,
4718    ///     ServiceLevel::Extreme,
4719    ///     ServiceLevel::Standard,
4720    /// ]);
4721    /// ```
4722    pub fn set_supported_service_levels<T, V>(mut self, v: T) -> Self
4723    where
4724        T: std::iter::IntoIterator<Item = V>,
4725        V: std::convert::Into<crate::model::ServiceLevel>,
4726    {
4727        use std::iter::Iterator;
4728        self.supported_service_levels = v.into_iter().map(|i| i.into()).collect();
4729        self
4730    }
4731
4732    /// Sets the value of [supported_flex_performance][crate::model::LocationMetadata::supported_flex_performance].
4733    ///
4734    /// # Example
4735    /// ```ignore,no_run
4736    /// # use google_cloud_netapp_v1::model::LocationMetadata;
4737    /// use google_cloud_netapp_v1::model::FlexPerformance;
4738    /// let x = LocationMetadata::new().set_supported_flex_performance([
4739    ///     FlexPerformance::Default,
4740    ///     FlexPerformance::Custom,
4741    /// ]);
4742    /// ```
4743    pub fn set_supported_flex_performance<T, V>(mut self, v: T) -> Self
4744    where
4745        T: std::iter::IntoIterator<Item = V>,
4746        V: std::convert::Into<crate::model::FlexPerformance>,
4747    {
4748        use std::iter::Iterator;
4749        self.supported_flex_performance = v.into_iter().map(|i| i.into()).collect();
4750        self
4751    }
4752
4753    /// Sets the value of [has_vcp][crate::model::LocationMetadata::has_vcp].
4754    ///
4755    /// # Example
4756    /// ```ignore,no_run
4757    /// # use google_cloud_netapp_v1::model::LocationMetadata;
4758    /// let x = LocationMetadata::new().set_has_vcp(true);
4759    /// ```
4760    pub fn set_has_vcp<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4761        self.has_vcp = v.into();
4762        self
4763    }
4764
4765    /// Sets the value of [has_ontap_proxy][crate::model::LocationMetadata::has_ontap_proxy].
4766    ///
4767    /// # Example
4768    /// ```ignore,no_run
4769    /// # use google_cloud_netapp_v1::model::LocationMetadata;
4770    /// let x = LocationMetadata::new().set_has_ontap_proxy(true);
4771    /// ```
4772    pub fn set_has_ontap_proxy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4773        self.has_ontap_proxy = v.into();
4774        self
4775    }
4776}
4777
4778impl wkt::message::Message for LocationMetadata {
4779    fn typename() -> &'static str {
4780        "type.googleapis.com/google.cloud.netapp.v1.LocationMetadata"
4781    }
4782}
4783
4784/// UserCommands contains the commands to be executed by the customer.
4785#[derive(Clone, Default, PartialEq)]
4786#[non_exhaustive]
4787pub struct UserCommands {
4788    /// Output only. List of commands to be executed by the customer.
4789    pub commands: std::vec::Vec<std::string::String>,
4790
4791    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4792}
4793
4794impl UserCommands {
4795    /// Creates a new default instance.
4796    pub fn new() -> Self {
4797        std::default::Default::default()
4798    }
4799
4800    /// Sets the value of [commands][crate::model::UserCommands::commands].
4801    ///
4802    /// # Example
4803    /// ```ignore,no_run
4804    /// # use google_cloud_netapp_v1::model::UserCommands;
4805    /// let x = UserCommands::new().set_commands(["a", "b", "c"]);
4806    /// ```
4807    pub fn set_commands<T, V>(mut self, v: T) -> Self
4808    where
4809        T: std::iter::IntoIterator<Item = V>,
4810        V: std::convert::Into<std::string::String>,
4811    {
4812        use std::iter::Iterator;
4813        self.commands = v.into_iter().map(|i| i.into()).collect();
4814        self
4815    }
4816}
4817
4818impl wkt::message::Message for UserCommands {
4819    fn typename() -> &'static str {
4820        "type.googleapis.com/google.cloud.netapp.v1.UserCommands"
4821    }
4822}
4823
4824/// ListHostGroupsRequest for listing host groups.
4825#[derive(Clone, Default, PartialEq)]
4826#[non_exhaustive]
4827pub struct ListHostGroupsRequest {
4828    /// Required. Parent value for ListHostGroupsRequest
4829    pub parent: std::string::String,
4830
4831    /// Optional. Requested page size. Server may return fewer items than
4832    /// requested. If unspecified, the server will pick an appropriate default.
4833    pub page_size: i32,
4834
4835    /// Optional. A token identifying a page of results the server should return.
4836    pub page_token: std::string::String,
4837
4838    /// Optional. Filter to apply to the request.
4839    pub filter: std::string::String,
4840
4841    /// Optional. Hint for how to order the results
4842    pub order_by: std::string::String,
4843
4844    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4845}
4846
4847impl ListHostGroupsRequest {
4848    /// Creates a new default instance.
4849    pub fn new() -> Self {
4850        std::default::Default::default()
4851    }
4852
4853    /// Sets the value of [parent][crate::model::ListHostGroupsRequest::parent].
4854    ///
4855    /// # Example
4856    /// ```ignore,no_run
4857    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4858    /// # let project_id = "project_id";
4859    /// # let location_id = "location_id";
4860    /// let x = ListHostGroupsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
4861    /// ```
4862    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4863        self.parent = v.into();
4864        self
4865    }
4866
4867    /// Sets the value of [page_size][crate::model::ListHostGroupsRequest::page_size].
4868    ///
4869    /// # Example
4870    /// ```ignore,no_run
4871    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4872    /// let x = ListHostGroupsRequest::new().set_page_size(42);
4873    /// ```
4874    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4875        self.page_size = v.into();
4876        self
4877    }
4878
4879    /// Sets the value of [page_token][crate::model::ListHostGroupsRequest::page_token].
4880    ///
4881    /// # Example
4882    /// ```ignore,no_run
4883    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4884    /// let x = ListHostGroupsRequest::new().set_page_token("example");
4885    /// ```
4886    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4887        self.page_token = v.into();
4888        self
4889    }
4890
4891    /// Sets the value of [filter][crate::model::ListHostGroupsRequest::filter].
4892    ///
4893    /// # Example
4894    /// ```ignore,no_run
4895    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4896    /// let x = ListHostGroupsRequest::new().set_filter("example");
4897    /// ```
4898    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4899        self.filter = v.into();
4900        self
4901    }
4902
4903    /// Sets the value of [order_by][crate::model::ListHostGroupsRequest::order_by].
4904    ///
4905    /// # Example
4906    /// ```ignore,no_run
4907    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4908    /// let x = ListHostGroupsRequest::new().set_order_by("example");
4909    /// ```
4910    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4911        self.order_by = v.into();
4912        self
4913    }
4914}
4915
4916impl wkt::message::Message for ListHostGroupsRequest {
4917    fn typename() -> &'static str {
4918        "type.googleapis.com/google.cloud.netapp.v1.ListHostGroupsRequest"
4919    }
4920}
4921
4922/// ListHostGroupsResponse is the response to a ListHostGroupsRequest.
4923#[derive(Clone, Default, PartialEq)]
4924#[non_exhaustive]
4925pub struct ListHostGroupsResponse {
4926    /// The list of host groups.
4927    pub host_groups: std::vec::Vec<crate::model::HostGroup>,
4928
4929    /// A token identifying a page of results the server should return.
4930    pub next_page_token: std::string::String,
4931
4932    /// Locations that could not be reached.
4933    pub unreachable: std::vec::Vec<std::string::String>,
4934
4935    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4936}
4937
4938impl ListHostGroupsResponse {
4939    /// Creates a new default instance.
4940    pub fn new() -> Self {
4941        std::default::Default::default()
4942    }
4943
4944    /// Sets the value of [host_groups][crate::model::ListHostGroupsResponse::host_groups].
4945    ///
4946    /// # Example
4947    /// ```ignore,no_run
4948    /// # use google_cloud_netapp_v1::model::ListHostGroupsResponse;
4949    /// use google_cloud_netapp_v1::model::HostGroup;
4950    /// let x = ListHostGroupsResponse::new()
4951    ///     .set_host_groups([
4952    ///         HostGroup::default()/* use setters */,
4953    ///         HostGroup::default()/* use (different) setters */,
4954    ///     ]);
4955    /// ```
4956    pub fn set_host_groups<T, V>(mut self, v: T) -> Self
4957    where
4958        T: std::iter::IntoIterator<Item = V>,
4959        V: std::convert::Into<crate::model::HostGroup>,
4960    {
4961        use std::iter::Iterator;
4962        self.host_groups = v.into_iter().map(|i| i.into()).collect();
4963        self
4964    }
4965
4966    /// Sets the value of [next_page_token][crate::model::ListHostGroupsResponse::next_page_token].
4967    ///
4968    /// # Example
4969    /// ```ignore,no_run
4970    /// # use google_cloud_netapp_v1::model::ListHostGroupsResponse;
4971    /// let x = ListHostGroupsResponse::new().set_next_page_token("example");
4972    /// ```
4973    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4974        self.next_page_token = v.into();
4975        self
4976    }
4977
4978    /// Sets the value of [unreachable][crate::model::ListHostGroupsResponse::unreachable].
4979    ///
4980    /// # Example
4981    /// ```ignore,no_run
4982    /// # use google_cloud_netapp_v1::model::ListHostGroupsResponse;
4983    /// let x = ListHostGroupsResponse::new().set_unreachable(["a", "b", "c"]);
4984    /// ```
4985    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4986    where
4987        T: std::iter::IntoIterator<Item = V>,
4988        V: std::convert::Into<std::string::String>,
4989    {
4990        use std::iter::Iterator;
4991        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4992        self
4993    }
4994}
4995
4996impl wkt::message::Message for ListHostGroupsResponse {
4997    fn typename() -> &'static str {
4998        "type.googleapis.com/google.cloud.netapp.v1.ListHostGroupsResponse"
4999    }
5000}
5001
5002#[doc(hidden)]
5003impl google_cloud_gax::paginator::internal::PageableResponse for ListHostGroupsResponse {
5004    type PageItem = crate::model::HostGroup;
5005
5006    fn items(self) -> std::vec::Vec<Self::PageItem> {
5007        self.host_groups
5008    }
5009
5010    fn next_page_token(&self) -> std::string::String {
5011        use std::clone::Clone;
5012        self.next_page_token.clone()
5013    }
5014}
5015
5016/// GetHostGroupRequest for getting a host group.
5017#[derive(Clone, Default, PartialEq)]
5018#[non_exhaustive]
5019pub struct GetHostGroupRequest {
5020    /// Required. The resource name of the host group.
5021    /// Format:
5022    /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5023    pub name: std::string::String,
5024
5025    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5026}
5027
5028impl GetHostGroupRequest {
5029    /// Creates a new default instance.
5030    pub fn new() -> Self {
5031        std::default::Default::default()
5032    }
5033
5034    /// Sets the value of [name][crate::model::GetHostGroupRequest::name].
5035    ///
5036    /// # Example
5037    /// ```ignore,no_run
5038    /// # use google_cloud_netapp_v1::model::GetHostGroupRequest;
5039    /// # let project_id = "project_id";
5040    /// # let location_id = "location_id";
5041    /// # let host_group_id = "host_group_id";
5042    /// let x = GetHostGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/hostGroups/{host_group_id}"));
5043    /// ```
5044    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5045        self.name = v.into();
5046        self
5047    }
5048}
5049
5050impl wkt::message::Message for GetHostGroupRequest {
5051    fn typename() -> &'static str {
5052        "type.googleapis.com/google.cloud.netapp.v1.GetHostGroupRequest"
5053    }
5054}
5055
5056/// CreateHostGroupRequest for creating a host group.
5057#[derive(Clone, Default, PartialEq)]
5058#[non_exhaustive]
5059pub struct CreateHostGroupRequest {
5060    /// Required. Parent value for CreateHostGroupRequest
5061    pub parent: std::string::String,
5062
5063    /// Required. Fields of the host group to create.
5064    pub host_group: std::option::Option<crate::model::HostGroup>,
5065
5066    /// Required. ID of the host group to create. Must be unique within the parent
5067    /// resource. Must contain only letters, numbers, and hyphen, with
5068    /// the first character a letter or underscore, the last a letter or underscore
5069    /// or a number, and a 63 character maximum.
5070    pub host_group_id: std::string::String,
5071
5072    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5073}
5074
5075impl CreateHostGroupRequest {
5076    /// Creates a new default instance.
5077    pub fn new() -> Self {
5078        std::default::Default::default()
5079    }
5080
5081    /// Sets the value of [parent][crate::model::CreateHostGroupRequest::parent].
5082    ///
5083    /// # Example
5084    /// ```ignore,no_run
5085    /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
5086    /// # let project_id = "project_id";
5087    /// # let location_id = "location_id";
5088    /// let x = CreateHostGroupRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
5089    /// ```
5090    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5091        self.parent = v.into();
5092        self
5093    }
5094
5095    /// Sets the value of [host_group][crate::model::CreateHostGroupRequest::host_group].
5096    ///
5097    /// # Example
5098    /// ```ignore,no_run
5099    /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
5100    /// use google_cloud_netapp_v1::model::HostGroup;
5101    /// let x = CreateHostGroupRequest::new().set_host_group(HostGroup::default()/* use setters */);
5102    /// ```
5103    pub fn set_host_group<T>(mut self, v: T) -> Self
5104    where
5105        T: std::convert::Into<crate::model::HostGroup>,
5106    {
5107        self.host_group = std::option::Option::Some(v.into());
5108        self
5109    }
5110
5111    /// Sets or clears the value of [host_group][crate::model::CreateHostGroupRequest::host_group].
5112    ///
5113    /// # Example
5114    /// ```ignore,no_run
5115    /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
5116    /// use google_cloud_netapp_v1::model::HostGroup;
5117    /// let x = CreateHostGroupRequest::new().set_or_clear_host_group(Some(HostGroup::default()/* use setters */));
5118    /// let x = CreateHostGroupRequest::new().set_or_clear_host_group(None::<HostGroup>);
5119    /// ```
5120    pub fn set_or_clear_host_group<T>(mut self, v: std::option::Option<T>) -> Self
5121    where
5122        T: std::convert::Into<crate::model::HostGroup>,
5123    {
5124        self.host_group = v.map(|x| x.into());
5125        self
5126    }
5127
5128    /// Sets the value of [host_group_id][crate::model::CreateHostGroupRequest::host_group_id].
5129    ///
5130    /// # Example
5131    /// ```ignore,no_run
5132    /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
5133    /// let x = CreateHostGroupRequest::new().set_host_group_id("example");
5134    /// ```
5135    pub fn set_host_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5136        self.host_group_id = v.into();
5137        self
5138    }
5139}
5140
5141impl wkt::message::Message for CreateHostGroupRequest {
5142    fn typename() -> &'static str {
5143        "type.googleapis.com/google.cloud.netapp.v1.CreateHostGroupRequest"
5144    }
5145}
5146
5147/// UpdateHostGroupRequest for updating a host group.
5148#[derive(Clone, Default, PartialEq)]
5149#[non_exhaustive]
5150pub struct UpdateHostGroupRequest {
5151    /// Required. The host group to update.
5152    /// The host group's `name` field is used to identify the host group.
5153    /// Format:
5154    /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5155    pub host_group: std::option::Option<crate::model::HostGroup>,
5156
5157    /// Optional. The list of fields to update.
5158    pub update_mask: std::option::Option<wkt::FieldMask>,
5159
5160    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5161}
5162
5163impl UpdateHostGroupRequest {
5164    /// Creates a new default instance.
5165    pub fn new() -> Self {
5166        std::default::Default::default()
5167    }
5168
5169    /// Sets the value of [host_group][crate::model::UpdateHostGroupRequest::host_group].
5170    ///
5171    /// # Example
5172    /// ```ignore,no_run
5173    /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5174    /// use google_cloud_netapp_v1::model::HostGroup;
5175    /// let x = UpdateHostGroupRequest::new().set_host_group(HostGroup::default()/* use setters */);
5176    /// ```
5177    pub fn set_host_group<T>(mut self, v: T) -> Self
5178    where
5179        T: std::convert::Into<crate::model::HostGroup>,
5180    {
5181        self.host_group = std::option::Option::Some(v.into());
5182        self
5183    }
5184
5185    /// Sets or clears the value of [host_group][crate::model::UpdateHostGroupRequest::host_group].
5186    ///
5187    /// # Example
5188    /// ```ignore,no_run
5189    /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5190    /// use google_cloud_netapp_v1::model::HostGroup;
5191    /// let x = UpdateHostGroupRequest::new().set_or_clear_host_group(Some(HostGroup::default()/* use setters */));
5192    /// let x = UpdateHostGroupRequest::new().set_or_clear_host_group(None::<HostGroup>);
5193    /// ```
5194    pub fn set_or_clear_host_group<T>(mut self, v: std::option::Option<T>) -> Self
5195    where
5196        T: std::convert::Into<crate::model::HostGroup>,
5197    {
5198        self.host_group = v.map(|x| x.into());
5199        self
5200    }
5201
5202    /// Sets the value of [update_mask][crate::model::UpdateHostGroupRequest::update_mask].
5203    ///
5204    /// # Example
5205    /// ```ignore,no_run
5206    /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5207    /// use wkt::FieldMask;
5208    /// let x = UpdateHostGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5209    /// ```
5210    pub fn set_update_mask<T>(mut self, v: T) -> Self
5211    where
5212        T: std::convert::Into<wkt::FieldMask>,
5213    {
5214        self.update_mask = std::option::Option::Some(v.into());
5215        self
5216    }
5217
5218    /// Sets or clears the value of [update_mask][crate::model::UpdateHostGroupRequest::update_mask].
5219    ///
5220    /// # Example
5221    /// ```ignore,no_run
5222    /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5223    /// use wkt::FieldMask;
5224    /// let x = UpdateHostGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5225    /// let x = UpdateHostGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5226    /// ```
5227    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5228    where
5229        T: std::convert::Into<wkt::FieldMask>,
5230    {
5231        self.update_mask = v.map(|x| x.into());
5232        self
5233    }
5234}
5235
5236impl wkt::message::Message for UpdateHostGroupRequest {
5237    fn typename() -> &'static str {
5238        "type.googleapis.com/google.cloud.netapp.v1.UpdateHostGroupRequest"
5239    }
5240}
5241
5242/// DeleteHostGroupRequest for deleting a single host group.
5243#[derive(Clone, Default, PartialEq)]
5244#[non_exhaustive]
5245pub struct DeleteHostGroupRequest {
5246    /// Required. The resource name of the host group.
5247    /// Format:
5248    /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5249    pub name: std::string::String,
5250
5251    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5252}
5253
5254impl DeleteHostGroupRequest {
5255    /// Creates a new default instance.
5256    pub fn new() -> Self {
5257        std::default::Default::default()
5258    }
5259
5260    /// Sets the value of [name][crate::model::DeleteHostGroupRequest::name].
5261    ///
5262    /// # Example
5263    /// ```ignore,no_run
5264    /// # use google_cloud_netapp_v1::model::DeleteHostGroupRequest;
5265    /// # let project_id = "project_id";
5266    /// # let location_id = "location_id";
5267    /// # let host_group_id = "host_group_id";
5268    /// let x = DeleteHostGroupRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/hostGroups/{host_group_id}"));
5269    /// ```
5270    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5271        self.name = v.into();
5272        self
5273    }
5274}
5275
5276impl wkt::message::Message for DeleteHostGroupRequest {
5277    fn typename() -> &'static str {
5278        "type.googleapis.com/google.cloud.netapp.v1.DeleteHostGroupRequest"
5279    }
5280}
5281
5282/// Host group is a collection of hosts that can be used for accessing a Block
5283/// Volume.
5284#[derive(Clone, Default, PartialEq)]
5285#[non_exhaustive]
5286pub struct HostGroup {
5287    /// Identifier. The resource name of the host group.
5288    /// Format:
5289    /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5290    pub name: std::string::String,
5291
5292    /// Required. Type of the host group.
5293    pub r#type: crate::model::host_group::Type,
5294
5295    /// Output only. State of the host group.
5296    pub state: crate::model::host_group::State,
5297
5298    /// Output only. Create time of the host group.
5299    pub create_time: std::option::Option<wkt::Timestamp>,
5300
5301    /// Required. The list of hosts associated with the host group.
5302    pub hosts: std::vec::Vec<std::string::String>,
5303
5304    /// Required. The OS type of the host group. It indicates the type of operating
5305    /// system used by all of the hosts in the HostGroup. All hosts in a HostGroup
5306    /// must be of the same OS type. This can be set only when creating a
5307    /// HostGroup.
5308    pub os_type: crate::model::OsType,
5309
5310    /// Optional. Description of the host group.
5311    pub description: std::string::String,
5312
5313    /// Optional. Labels of the host group.
5314    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5315
5316    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5317}
5318
5319impl HostGroup {
5320    /// Creates a new default instance.
5321    pub fn new() -> Self {
5322        std::default::Default::default()
5323    }
5324
5325    /// Sets the value of [name][crate::model::HostGroup::name].
5326    ///
5327    /// # Example
5328    /// ```ignore,no_run
5329    /// # use google_cloud_netapp_v1::model::HostGroup;
5330    /// # let project_id = "project_id";
5331    /// # let location_id = "location_id";
5332    /// # let host_group_id = "host_group_id";
5333    /// let x = HostGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/hostGroups/{host_group_id}"));
5334    /// ```
5335    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5336        self.name = v.into();
5337        self
5338    }
5339
5340    /// Sets the value of [r#type][crate::model::HostGroup::type].
5341    ///
5342    /// # Example
5343    /// ```ignore,no_run
5344    /// # use google_cloud_netapp_v1::model::HostGroup;
5345    /// use google_cloud_netapp_v1::model::host_group::Type;
5346    /// let x0 = HostGroup::new().set_type(Type::IscsiInitiator);
5347    /// ```
5348    pub fn set_type<T: std::convert::Into<crate::model::host_group::Type>>(mut self, v: T) -> Self {
5349        self.r#type = v.into();
5350        self
5351    }
5352
5353    /// Sets the value of [state][crate::model::HostGroup::state].
5354    ///
5355    /// # Example
5356    /// ```ignore,no_run
5357    /// # use google_cloud_netapp_v1::model::HostGroup;
5358    /// use google_cloud_netapp_v1::model::host_group::State;
5359    /// let x0 = HostGroup::new().set_state(State::Creating);
5360    /// let x1 = HostGroup::new().set_state(State::Ready);
5361    /// let x2 = HostGroup::new().set_state(State::Updating);
5362    /// ```
5363    pub fn set_state<T: std::convert::Into<crate::model::host_group::State>>(
5364        mut self,
5365        v: T,
5366    ) -> Self {
5367        self.state = v.into();
5368        self
5369    }
5370
5371    /// Sets the value of [create_time][crate::model::HostGroup::create_time].
5372    ///
5373    /// # Example
5374    /// ```ignore,no_run
5375    /// # use google_cloud_netapp_v1::model::HostGroup;
5376    /// use wkt::Timestamp;
5377    /// let x = HostGroup::new().set_create_time(Timestamp::default()/* use setters */);
5378    /// ```
5379    pub fn set_create_time<T>(mut self, v: T) -> Self
5380    where
5381        T: std::convert::Into<wkt::Timestamp>,
5382    {
5383        self.create_time = std::option::Option::Some(v.into());
5384        self
5385    }
5386
5387    /// Sets or clears the value of [create_time][crate::model::HostGroup::create_time].
5388    ///
5389    /// # Example
5390    /// ```ignore,no_run
5391    /// # use google_cloud_netapp_v1::model::HostGroup;
5392    /// use wkt::Timestamp;
5393    /// let x = HostGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5394    /// let x = HostGroup::new().set_or_clear_create_time(None::<Timestamp>);
5395    /// ```
5396    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5397    where
5398        T: std::convert::Into<wkt::Timestamp>,
5399    {
5400        self.create_time = v.map(|x| x.into());
5401        self
5402    }
5403
5404    /// Sets the value of [hosts][crate::model::HostGroup::hosts].
5405    ///
5406    /// # Example
5407    /// ```ignore,no_run
5408    /// # use google_cloud_netapp_v1::model::HostGroup;
5409    /// let x = HostGroup::new().set_hosts(["a", "b", "c"]);
5410    /// ```
5411    pub fn set_hosts<T, V>(mut self, v: T) -> Self
5412    where
5413        T: std::iter::IntoIterator<Item = V>,
5414        V: std::convert::Into<std::string::String>,
5415    {
5416        use std::iter::Iterator;
5417        self.hosts = v.into_iter().map(|i| i.into()).collect();
5418        self
5419    }
5420
5421    /// Sets the value of [os_type][crate::model::HostGroup::os_type].
5422    ///
5423    /// # Example
5424    /// ```ignore,no_run
5425    /// # use google_cloud_netapp_v1::model::HostGroup;
5426    /// use google_cloud_netapp_v1::model::OsType;
5427    /// let x0 = HostGroup::new().set_os_type(OsType::Linux);
5428    /// let x1 = HostGroup::new().set_os_type(OsType::Windows);
5429    /// let x2 = HostGroup::new().set_os_type(OsType::Esxi);
5430    /// ```
5431    pub fn set_os_type<T: std::convert::Into<crate::model::OsType>>(mut self, v: T) -> Self {
5432        self.os_type = v.into();
5433        self
5434    }
5435
5436    /// Sets the value of [description][crate::model::HostGroup::description].
5437    ///
5438    /// # Example
5439    /// ```ignore,no_run
5440    /// # use google_cloud_netapp_v1::model::HostGroup;
5441    /// let x = HostGroup::new().set_description("example");
5442    /// ```
5443    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5444        self.description = v.into();
5445        self
5446    }
5447
5448    /// Sets the value of [labels][crate::model::HostGroup::labels].
5449    ///
5450    /// # Example
5451    /// ```ignore,no_run
5452    /// # use google_cloud_netapp_v1::model::HostGroup;
5453    /// let x = HostGroup::new().set_labels([
5454    ///     ("key0", "abc"),
5455    ///     ("key1", "xyz"),
5456    /// ]);
5457    /// ```
5458    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5459    where
5460        T: std::iter::IntoIterator<Item = (K, V)>,
5461        K: std::convert::Into<std::string::String>,
5462        V: std::convert::Into<std::string::String>,
5463    {
5464        use std::iter::Iterator;
5465        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5466        self
5467    }
5468}
5469
5470impl wkt::message::Message for HostGroup {
5471    fn typename() -> &'static str {
5472        "type.googleapis.com/google.cloud.netapp.v1.HostGroup"
5473    }
5474}
5475
5476/// Defines additional types related to [HostGroup].
5477pub mod host_group {
5478    #[allow(unused_imports)]
5479    use super::*;
5480
5481    /// Types of host group.
5482    ///
5483    /// # Working with unknown values
5484    ///
5485    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5486    /// additional enum variants at any time. Adding new variants is not considered
5487    /// a breaking change. Applications should write their code in anticipation of:
5488    ///
5489    /// - New values appearing in future releases of the client library, **and**
5490    /// - New values received dynamically, without application changes.
5491    ///
5492    /// Please consult the [Working with enums] section in the user guide for some
5493    /// guidelines.
5494    ///
5495    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5496    #[derive(Clone, Debug, PartialEq)]
5497    #[non_exhaustive]
5498    pub enum Type {
5499        /// Unspecified type for host group.
5500        Unspecified,
5501        /// iSCSI initiator host group.
5502        IscsiInitiator,
5503        /// If set, the enum was initialized with an unknown value.
5504        ///
5505        /// Applications can examine the value using [Type::value] or
5506        /// [Type::name].
5507        UnknownValue(r#type::UnknownValue),
5508    }
5509
5510    #[doc(hidden)]
5511    pub mod r#type {
5512        #[allow(unused_imports)]
5513        use super::*;
5514        #[derive(Clone, Debug, PartialEq)]
5515        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5516    }
5517
5518    impl Type {
5519        /// Gets the enum value.
5520        ///
5521        /// Returns `None` if the enum contains an unknown value deserialized from
5522        /// the string representation of enums.
5523        pub fn value(&self) -> std::option::Option<i32> {
5524            match self {
5525                Self::Unspecified => std::option::Option::Some(0),
5526                Self::IscsiInitiator => std::option::Option::Some(1),
5527                Self::UnknownValue(u) => u.0.value(),
5528            }
5529        }
5530
5531        /// Gets the enum value as a string.
5532        ///
5533        /// Returns `None` if the enum contains an unknown value deserialized from
5534        /// the integer representation of enums.
5535        pub fn name(&self) -> std::option::Option<&str> {
5536            match self {
5537                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
5538                Self::IscsiInitiator => std::option::Option::Some("ISCSI_INITIATOR"),
5539                Self::UnknownValue(u) => u.0.name(),
5540            }
5541        }
5542    }
5543
5544    impl std::default::Default for Type {
5545        fn default() -> Self {
5546            use std::convert::From;
5547            Self::from(0)
5548        }
5549    }
5550
5551    impl std::fmt::Display for Type {
5552        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5553            wkt::internal::display_enum(f, self.name(), self.value())
5554        }
5555    }
5556
5557    impl std::convert::From<i32> for Type {
5558        fn from(value: i32) -> Self {
5559            match value {
5560                0 => Self::Unspecified,
5561                1 => Self::IscsiInitiator,
5562                _ => Self::UnknownValue(r#type::UnknownValue(
5563                    wkt::internal::UnknownEnumValue::Integer(value),
5564                )),
5565            }
5566        }
5567    }
5568
5569    impl std::convert::From<&str> for Type {
5570        fn from(value: &str) -> Self {
5571            use std::string::ToString;
5572            match value {
5573                "TYPE_UNSPECIFIED" => Self::Unspecified,
5574                "ISCSI_INITIATOR" => Self::IscsiInitiator,
5575                _ => Self::UnknownValue(r#type::UnknownValue(
5576                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5577                )),
5578            }
5579        }
5580    }
5581
5582    impl serde::ser::Serialize for Type {
5583        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5584        where
5585            S: serde::Serializer,
5586        {
5587            match self {
5588                Self::Unspecified => serializer.serialize_i32(0),
5589                Self::IscsiInitiator => serializer.serialize_i32(1),
5590                Self::UnknownValue(u) => u.0.serialize(serializer),
5591            }
5592        }
5593    }
5594
5595    impl<'de> serde::de::Deserialize<'de> for Type {
5596        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5597        where
5598            D: serde::Deserializer<'de>,
5599        {
5600            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
5601                ".google.cloud.netapp.v1.HostGroup.Type",
5602            ))
5603        }
5604    }
5605
5606    /// Host group states.
5607    ///
5608    /// # Working with unknown values
5609    ///
5610    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5611    /// additional enum variants at any time. Adding new variants is not considered
5612    /// a breaking change. Applications should write their code in anticipation of:
5613    ///
5614    /// - New values appearing in future releases of the client library, **and**
5615    /// - New values received dynamically, without application changes.
5616    ///
5617    /// Please consult the [Working with enums] section in the user guide for some
5618    /// guidelines.
5619    ///
5620    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5621    #[derive(Clone, Debug, PartialEq)]
5622    #[non_exhaustive]
5623    pub enum State {
5624        /// Unspecified state for host group.
5625        Unspecified,
5626        /// Host group is creating.
5627        Creating,
5628        /// Host group is ready.
5629        Ready,
5630        /// Host group is updating.
5631        Updating,
5632        /// Host group is deleting.
5633        Deleting,
5634        /// Host group is disabled.
5635        Disabled,
5636        /// If set, the enum was initialized with an unknown value.
5637        ///
5638        /// Applications can examine the value using [State::value] or
5639        /// [State::name].
5640        UnknownValue(state::UnknownValue),
5641    }
5642
5643    #[doc(hidden)]
5644    pub mod state {
5645        #[allow(unused_imports)]
5646        use super::*;
5647        #[derive(Clone, Debug, PartialEq)]
5648        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5649    }
5650
5651    impl State {
5652        /// Gets the enum value.
5653        ///
5654        /// Returns `None` if the enum contains an unknown value deserialized from
5655        /// the string representation of enums.
5656        pub fn value(&self) -> std::option::Option<i32> {
5657            match self {
5658                Self::Unspecified => std::option::Option::Some(0),
5659                Self::Creating => std::option::Option::Some(1),
5660                Self::Ready => std::option::Option::Some(2),
5661                Self::Updating => std::option::Option::Some(3),
5662                Self::Deleting => std::option::Option::Some(4),
5663                Self::Disabled => std::option::Option::Some(5),
5664                Self::UnknownValue(u) => u.0.value(),
5665            }
5666        }
5667
5668        /// Gets the enum value as a string.
5669        ///
5670        /// Returns `None` if the enum contains an unknown value deserialized from
5671        /// the integer representation of enums.
5672        pub fn name(&self) -> std::option::Option<&str> {
5673            match self {
5674                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5675                Self::Creating => std::option::Option::Some("CREATING"),
5676                Self::Ready => std::option::Option::Some("READY"),
5677                Self::Updating => std::option::Option::Some("UPDATING"),
5678                Self::Deleting => std::option::Option::Some("DELETING"),
5679                Self::Disabled => std::option::Option::Some("DISABLED"),
5680                Self::UnknownValue(u) => u.0.name(),
5681            }
5682        }
5683    }
5684
5685    impl std::default::Default for State {
5686        fn default() -> Self {
5687            use std::convert::From;
5688            Self::from(0)
5689        }
5690    }
5691
5692    impl std::fmt::Display for State {
5693        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5694            wkt::internal::display_enum(f, self.name(), self.value())
5695        }
5696    }
5697
5698    impl std::convert::From<i32> for State {
5699        fn from(value: i32) -> Self {
5700            match value {
5701                0 => Self::Unspecified,
5702                1 => Self::Creating,
5703                2 => Self::Ready,
5704                3 => Self::Updating,
5705                4 => Self::Deleting,
5706                5 => Self::Disabled,
5707                _ => Self::UnknownValue(state::UnknownValue(
5708                    wkt::internal::UnknownEnumValue::Integer(value),
5709                )),
5710            }
5711        }
5712    }
5713
5714    impl std::convert::From<&str> for State {
5715        fn from(value: &str) -> Self {
5716            use std::string::ToString;
5717            match value {
5718                "STATE_UNSPECIFIED" => Self::Unspecified,
5719                "CREATING" => Self::Creating,
5720                "READY" => Self::Ready,
5721                "UPDATING" => Self::Updating,
5722                "DELETING" => Self::Deleting,
5723                "DISABLED" => Self::Disabled,
5724                _ => Self::UnknownValue(state::UnknownValue(
5725                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5726                )),
5727            }
5728        }
5729    }
5730
5731    impl serde::ser::Serialize for State {
5732        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5733        where
5734            S: serde::Serializer,
5735        {
5736            match self {
5737                Self::Unspecified => serializer.serialize_i32(0),
5738                Self::Creating => serializer.serialize_i32(1),
5739                Self::Ready => serializer.serialize_i32(2),
5740                Self::Updating => serializer.serialize_i32(3),
5741                Self::Deleting => serializer.serialize_i32(4),
5742                Self::Disabled => serializer.serialize_i32(5),
5743                Self::UnknownValue(u) => u.0.serialize(serializer),
5744            }
5745        }
5746    }
5747
5748    impl<'de> serde::de::Deserialize<'de> for State {
5749        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5750        where
5751            D: serde::Deserializer<'de>,
5752        {
5753            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5754                ".google.cloud.netapp.v1.HostGroup.State",
5755            ))
5756        }
5757    }
5758}
5759
5760/// GetKmsConfigRequest gets a KMS Config.
5761#[derive(Clone, Default, PartialEq)]
5762#[non_exhaustive]
5763pub struct GetKmsConfigRequest {
5764    /// Required. Name of the KmsConfig
5765    pub name: std::string::String,
5766
5767    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5768}
5769
5770impl GetKmsConfigRequest {
5771    /// Creates a new default instance.
5772    pub fn new() -> Self {
5773        std::default::Default::default()
5774    }
5775
5776    /// Sets the value of [name][crate::model::GetKmsConfigRequest::name].
5777    ///
5778    /// # Example
5779    /// ```ignore,no_run
5780    /// # use google_cloud_netapp_v1::model::GetKmsConfigRequest;
5781    /// # let project_id = "project_id";
5782    /// # let location_id = "location_id";
5783    /// # let kms_config_id = "kms_config_id";
5784    /// let x = GetKmsConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/kmsConfigs/{kms_config_id}"));
5785    /// ```
5786    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5787        self.name = v.into();
5788        self
5789    }
5790}
5791
5792impl wkt::message::Message for GetKmsConfigRequest {
5793    fn typename() -> &'static str {
5794        "type.googleapis.com/google.cloud.netapp.v1.GetKmsConfigRequest"
5795    }
5796}
5797
5798/// ListKmsConfigsRequest lists KMS Configs.
5799#[derive(Clone, Default, PartialEq)]
5800#[non_exhaustive]
5801pub struct ListKmsConfigsRequest {
5802    /// Required. Parent value
5803    pub parent: std::string::String,
5804
5805    /// The maximum number of items to return.
5806    pub page_size: i32,
5807
5808    /// The next_page_token value to use if there are additional
5809    /// results to retrieve for this list request.
5810    pub page_token: std::string::String,
5811
5812    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
5813    pub order_by: std::string::String,
5814
5815    /// List filter.
5816    pub filter: std::string::String,
5817
5818    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5819}
5820
5821impl ListKmsConfigsRequest {
5822    /// Creates a new default instance.
5823    pub fn new() -> Self {
5824        std::default::Default::default()
5825    }
5826
5827    /// Sets the value of [parent][crate::model::ListKmsConfigsRequest::parent].
5828    ///
5829    /// # Example
5830    /// ```ignore,no_run
5831    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5832    /// # let project_id = "project_id";
5833    /// # let location_id = "location_id";
5834    /// let x = ListKmsConfigsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
5835    /// ```
5836    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5837        self.parent = v.into();
5838        self
5839    }
5840
5841    /// Sets the value of [page_size][crate::model::ListKmsConfigsRequest::page_size].
5842    ///
5843    /// # Example
5844    /// ```ignore,no_run
5845    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5846    /// let x = ListKmsConfigsRequest::new().set_page_size(42);
5847    /// ```
5848    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5849        self.page_size = v.into();
5850        self
5851    }
5852
5853    /// Sets the value of [page_token][crate::model::ListKmsConfigsRequest::page_token].
5854    ///
5855    /// # Example
5856    /// ```ignore,no_run
5857    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5858    /// let x = ListKmsConfigsRequest::new().set_page_token("example");
5859    /// ```
5860    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5861        self.page_token = v.into();
5862        self
5863    }
5864
5865    /// Sets the value of [order_by][crate::model::ListKmsConfigsRequest::order_by].
5866    ///
5867    /// # Example
5868    /// ```ignore,no_run
5869    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5870    /// let x = ListKmsConfigsRequest::new().set_order_by("example");
5871    /// ```
5872    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5873        self.order_by = v.into();
5874        self
5875    }
5876
5877    /// Sets the value of [filter][crate::model::ListKmsConfigsRequest::filter].
5878    ///
5879    /// # Example
5880    /// ```ignore,no_run
5881    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5882    /// let x = ListKmsConfigsRequest::new().set_filter("example");
5883    /// ```
5884    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5885        self.filter = v.into();
5886        self
5887    }
5888}
5889
5890impl wkt::message::Message for ListKmsConfigsRequest {
5891    fn typename() -> &'static str {
5892        "type.googleapis.com/google.cloud.netapp.v1.ListKmsConfigsRequest"
5893    }
5894}
5895
5896/// ListKmsConfigsResponse is the response to a ListKmsConfigsRequest.
5897#[derive(Clone, Default, PartialEq)]
5898#[non_exhaustive]
5899pub struct ListKmsConfigsResponse {
5900    /// The list of KmsConfigs
5901    pub kms_configs: std::vec::Vec<crate::model::KmsConfig>,
5902
5903    /// A token identifying a page of results the server should return.
5904    pub next_page_token: std::string::String,
5905
5906    /// Locations that could not be reached.
5907    pub unreachable: std::vec::Vec<std::string::String>,
5908
5909    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5910}
5911
5912impl ListKmsConfigsResponse {
5913    /// Creates a new default instance.
5914    pub fn new() -> Self {
5915        std::default::Default::default()
5916    }
5917
5918    /// Sets the value of [kms_configs][crate::model::ListKmsConfigsResponse::kms_configs].
5919    ///
5920    /// # Example
5921    /// ```ignore,no_run
5922    /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
5923    /// use google_cloud_netapp_v1::model::KmsConfig;
5924    /// let x = ListKmsConfigsResponse::new()
5925    ///     .set_kms_configs([
5926    ///         KmsConfig::default()/* use setters */,
5927    ///         KmsConfig::default()/* use (different) setters */,
5928    ///     ]);
5929    /// ```
5930    pub fn set_kms_configs<T, V>(mut self, v: T) -> Self
5931    where
5932        T: std::iter::IntoIterator<Item = V>,
5933        V: std::convert::Into<crate::model::KmsConfig>,
5934    {
5935        use std::iter::Iterator;
5936        self.kms_configs = v.into_iter().map(|i| i.into()).collect();
5937        self
5938    }
5939
5940    /// Sets the value of [next_page_token][crate::model::ListKmsConfigsResponse::next_page_token].
5941    ///
5942    /// # Example
5943    /// ```ignore,no_run
5944    /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
5945    /// let x = ListKmsConfigsResponse::new().set_next_page_token("example");
5946    /// ```
5947    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5948        self.next_page_token = v.into();
5949        self
5950    }
5951
5952    /// Sets the value of [unreachable][crate::model::ListKmsConfigsResponse::unreachable].
5953    ///
5954    /// # Example
5955    /// ```ignore,no_run
5956    /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
5957    /// let x = ListKmsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
5958    /// ```
5959    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5960    where
5961        T: std::iter::IntoIterator<Item = V>,
5962        V: std::convert::Into<std::string::String>,
5963    {
5964        use std::iter::Iterator;
5965        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5966        self
5967    }
5968}
5969
5970impl wkt::message::Message for ListKmsConfigsResponse {
5971    fn typename() -> &'static str {
5972        "type.googleapis.com/google.cloud.netapp.v1.ListKmsConfigsResponse"
5973    }
5974}
5975
5976#[doc(hidden)]
5977impl google_cloud_gax::paginator::internal::PageableResponse for ListKmsConfigsResponse {
5978    type PageItem = crate::model::KmsConfig;
5979
5980    fn items(self) -> std::vec::Vec<Self::PageItem> {
5981        self.kms_configs
5982    }
5983
5984    fn next_page_token(&self) -> std::string::String {
5985        use std::clone::Clone;
5986        self.next_page_token.clone()
5987    }
5988}
5989
5990/// CreateKmsConfigRequest creates a KMS Config.
5991#[derive(Clone, Default, PartialEq)]
5992#[non_exhaustive]
5993pub struct CreateKmsConfigRequest {
5994    /// Required. Value for parent.
5995    pub parent: std::string::String,
5996
5997    /// Required. Id of the requesting KmsConfig. Must be unique within the parent
5998    /// resource. Must contain only letters, numbers and hyphen, with the first
5999    /// character a letter, the last a letter or a
6000    /// number, and a 63 character maximum.
6001    pub kms_config_id: std::string::String,
6002
6003    /// Required. The required parameters to create a new KmsConfig.
6004    pub kms_config: std::option::Option<crate::model::KmsConfig>,
6005
6006    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6007}
6008
6009impl CreateKmsConfigRequest {
6010    /// Creates a new default instance.
6011    pub fn new() -> Self {
6012        std::default::Default::default()
6013    }
6014
6015    /// Sets the value of [parent][crate::model::CreateKmsConfigRequest::parent].
6016    ///
6017    /// # Example
6018    /// ```ignore,no_run
6019    /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
6020    /// # let project_id = "project_id";
6021    /// # let location_id = "location_id";
6022    /// let x = CreateKmsConfigRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
6023    /// ```
6024    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6025        self.parent = v.into();
6026        self
6027    }
6028
6029    /// Sets the value of [kms_config_id][crate::model::CreateKmsConfigRequest::kms_config_id].
6030    ///
6031    /// # Example
6032    /// ```ignore,no_run
6033    /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
6034    /// let x = CreateKmsConfigRequest::new().set_kms_config_id("example");
6035    /// ```
6036    pub fn set_kms_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6037        self.kms_config_id = v.into();
6038        self
6039    }
6040
6041    /// Sets the value of [kms_config][crate::model::CreateKmsConfigRequest::kms_config].
6042    ///
6043    /// # Example
6044    /// ```ignore,no_run
6045    /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
6046    /// use google_cloud_netapp_v1::model::KmsConfig;
6047    /// let x = CreateKmsConfigRequest::new().set_kms_config(KmsConfig::default()/* use setters */);
6048    /// ```
6049    pub fn set_kms_config<T>(mut self, v: T) -> Self
6050    where
6051        T: std::convert::Into<crate::model::KmsConfig>,
6052    {
6053        self.kms_config = std::option::Option::Some(v.into());
6054        self
6055    }
6056
6057    /// Sets or clears the value of [kms_config][crate::model::CreateKmsConfigRequest::kms_config].
6058    ///
6059    /// # Example
6060    /// ```ignore,no_run
6061    /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
6062    /// use google_cloud_netapp_v1::model::KmsConfig;
6063    /// let x = CreateKmsConfigRequest::new().set_or_clear_kms_config(Some(KmsConfig::default()/* use setters */));
6064    /// let x = CreateKmsConfigRequest::new().set_or_clear_kms_config(None::<KmsConfig>);
6065    /// ```
6066    pub fn set_or_clear_kms_config<T>(mut self, v: std::option::Option<T>) -> Self
6067    where
6068        T: std::convert::Into<crate::model::KmsConfig>,
6069    {
6070        self.kms_config = v.map(|x| x.into());
6071        self
6072    }
6073}
6074
6075impl wkt::message::Message for CreateKmsConfigRequest {
6076    fn typename() -> &'static str {
6077        "type.googleapis.com/google.cloud.netapp.v1.CreateKmsConfigRequest"
6078    }
6079}
6080
6081/// UpdateKmsConfigRequest updates a KMS Config.
6082#[derive(Clone, Default, PartialEq)]
6083#[non_exhaustive]
6084pub struct UpdateKmsConfigRequest {
6085    /// Required. Field mask is used to specify the fields to be overwritten in the
6086    /// KmsConfig resource by the update.
6087    /// The fields specified in the update_mask are relative to the resource, not
6088    /// the full request. A field will be overwritten if it is in the mask. If the
6089    /// user does not provide a mask then all fields will be overwritten.
6090    pub update_mask: std::option::Option<wkt::FieldMask>,
6091
6092    /// Required. The KmsConfig being updated
6093    pub kms_config: std::option::Option<crate::model::KmsConfig>,
6094
6095    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6096}
6097
6098impl UpdateKmsConfigRequest {
6099    /// Creates a new default instance.
6100    pub fn new() -> Self {
6101        std::default::Default::default()
6102    }
6103
6104    /// Sets the value of [update_mask][crate::model::UpdateKmsConfigRequest::update_mask].
6105    ///
6106    /// # Example
6107    /// ```ignore,no_run
6108    /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
6109    /// use wkt::FieldMask;
6110    /// let x = UpdateKmsConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6111    /// ```
6112    pub fn set_update_mask<T>(mut self, v: T) -> Self
6113    where
6114        T: std::convert::Into<wkt::FieldMask>,
6115    {
6116        self.update_mask = std::option::Option::Some(v.into());
6117        self
6118    }
6119
6120    /// Sets or clears the value of [update_mask][crate::model::UpdateKmsConfigRequest::update_mask].
6121    ///
6122    /// # Example
6123    /// ```ignore,no_run
6124    /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
6125    /// use wkt::FieldMask;
6126    /// let x = UpdateKmsConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6127    /// let x = UpdateKmsConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6128    /// ```
6129    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6130    where
6131        T: std::convert::Into<wkt::FieldMask>,
6132    {
6133        self.update_mask = v.map(|x| x.into());
6134        self
6135    }
6136
6137    /// Sets the value of [kms_config][crate::model::UpdateKmsConfigRequest::kms_config].
6138    ///
6139    /// # Example
6140    /// ```ignore,no_run
6141    /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
6142    /// use google_cloud_netapp_v1::model::KmsConfig;
6143    /// let x = UpdateKmsConfigRequest::new().set_kms_config(KmsConfig::default()/* use setters */);
6144    /// ```
6145    pub fn set_kms_config<T>(mut self, v: T) -> Self
6146    where
6147        T: std::convert::Into<crate::model::KmsConfig>,
6148    {
6149        self.kms_config = std::option::Option::Some(v.into());
6150        self
6151    }
6152
6153    /// Sets or clears the value of [kms_config][crate::model::UpdateKmsConfigRequest::kms_config].
6154    ///
6155    /// # Example
6156    /// ```ignore,no_run
6157    /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
6158    /// use google_cloud_netapp_v1::model::KmsConfig;
6159    /// let x = UpdateKmsConfigRequest::new().set_or_clear_kms_config(Some(KmsConfig::default()/* use setters */));
6160    /// let x = UpdateKmsConfigRequest::new().set_or_clear_kms_config(None::<KmsConfig>);
6161    /// ```
6162    pub fn set_or_clear_kms_config<T>(mut self, v: std::option::Option<T>) -> Self
6163    where
6164        T: std::convert::Into<crate::model::KmsConfig>,
6165    {
6166        self.kms_config = v.map(|x| x.into());
6167        self
6168    }
6169}
6170
6171impl wkt::message::Message for UpdateKmsConfigRequest {
6172    fn typename() -> &'static str {
6173        "type.googleapis.com/google.cloud.netapp.v1.UpdateKmsConfigRequest"
6174    }
6175}
6176
6177/// DeleteKmsConfigRequest deletes a KMS Config.
6178#[derive(Clone, Default, PartialEq)]
6179#[non_exhaustive]
6180pub struct DeleteKmsConfigRequest {
6181    /// Required. Name of the KmsConfig.
6182    pub name: std::string::String,
6183
6184    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6185}
6186
6187impl DeleteKmsConfigRequest {
6188    /// Creates a new default instance.
6189    pub fn new() -> Self {
6190        std::default::Default::default()
6191    }
6192
6193    /// Sets the value of [name][crate::model::DeleteKmsConfigRequest::name].
6194    ///
6195    /// # Example
6196    /// ```ignore,no_run
6197    /// # use google_cloud_netapp_v1::model::DeleteKmsConfigRequest;
6198    /// # let project_id = "project_id";
6199    /// # let location_id = "location_id";
6200    /// # let kms_config_id = "kms_config_id";
6201    /// let x = DeleteKmsConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/kmsConfigs/{kms_config_id}"));
6202    /// ```
6203    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6204        self.name = v.into();
6205        self
6206    }
6207}
6208
6209impl wkt::message::Message for DeleteKmsConfigRequest {
6210    fn typename() -> &'static str {
6211        "type.googleapis.com/google.cloud.netapp.v1.DeleteKmsConfigRequest"
6212    }
6213}
6214
6215/// EncryptVolumesRequest specifies the KMS config to encrypt existing volumes.
6216#[derive(Clone, Default, PartialEq)]
6217#[non_exhaustive]
6218pub struct EncryptVolumesRequest {
6219    /// Required. Name of the KmsConfig.
6220    pub name: std::string::String,
6221
6222    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6223}
6224
6225impl EncryptVolumesRequest {
6226    /// Creates a new default instance.
6227    pub fn new() -> Self {
6228        std::default::Default::default()
6229    }
6230
6231    /// Sets the value of [name][crate::model::EncryptVolumesRequest::name].
6232    ///
6233    /// # Example
6234    /// ```ignore,no_run
6235    /// # use google_cloud_netapp_v1::model::EncryptVolumesRequest;
6236    /// # let project_id = "project_id";
6237    /// # let location_id = "location_id";
6238    /// # let kms_config_id = "kms_config_id";
6239    /// let x = EncryptVolumesRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/kmsConfigs/{kms_config_id}"));
6240    /// ```
6241    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6242        self.name = v.into();
6243        self
6244    }
6245}
6246
6247impl wkt::message::Message for EncryptVolumesRequest {
6248    fn typename() -> &'static str {
6249        "type.googleapis.com/google.cloud.netapp.v1.EncryptVolumesRequest"
6250    }
6251}
6252
6253/// VerifyKmsConfigRequest specifies the KMS config to be validated.
6254#[derive(Clone, Default, PartialEq)]
6255#[non_exhaustive]
6256pub struct VerifyKmsConfigRequest {
6257    /// Required. Name of the KMS Config to be verified.
6258    pub name: std::string::String,
6259
6260    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6261}
6262
6263impl VerifyKmsConfigRequest {
6264    /// Creates a new default instance.
6265    pub fn new() -> Self {
6266        std::default::Default::default()
6267    }
6268
6269    /// Sets the value of [name][crate::model::VerifyKmsConfigRequest::name].
6270    ///
6271    /// # Example
6272    /// ```ignore,no_run
6273    /// # use google_cloud_netapp_v1::model::VerifyKmsConfigRequest;
6274    /// # let project_id = "project_id";
6275    /// # let location_id = "location_id";
6276    /// # let kms_config_id = "kms_config_id";
6277    /// let x = VerifyKmsConfigRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/kmsConfigs/{kms_config_id}"));
6278    /// ```
6279    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6280        self.name = v.into();
6281        self
6282    }
6283}
6284
6285impl wkt::message::Message for VerifyKmsConfigRequest {
6286    fn typename() -> &'static str {
6287        "type.googleapis.com/google.cloud.netapp.v1.VerifyKmsConfigRequest"
6288    }
6289}
6290
6291/// VerifyKmsConfigResponse contains the information if the config is correctly
6292/// and error message.
6293#[derive(Clone, Default, PartialEq)]
6294#[non_exhaustive]
6295pub struct VerifyKmsConfigResponse {
6296    /// Output only. If the customer key configured correctly to the encrypt
6297    /// volume.
6298    pub healthy: bool,
6299
6300    /// Output only. Error message if config is not healthy.
6301    pub health_error: std::string::String,
6302
6303    /// Output only. Instructions for the customers to provide the access to the
6304    /// encryption key.
6305    pub instructions: std::string::String,
6306
6307    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6308}
6309
6310impl VerifyKmsConfigResponse {
6311    /// Creates a new default instance.
6312    pub fn new() -> Self {
6313        std::default::Default::default()
6314    }
6315
6316    /// Sets the value of [healthy][crate::model::VerifyKmsConfigResponse::healthy].
6317    ///
6318    /// # Example
6319    /// ```ignore,no_run
6320    /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
6321    /// let x = VerifyKmsConfigResponse::new().set_healthy(true);
6322    /// ```
6323    pub fn set_healthy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6324        self.healthy = v.into();
6325        self
6326    }
6327
6328    /// Sets the value of [health_error][crate::model::VerifyKmsConfigResponse::health_error].
6329    ///
6330    /// # Example
6331    /// ```ignore,no_run
6332    /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
6333    /// let x = VerifyKmsConfigResponse::new().set_health_error("example");
6334    /// ```
6335    pub fn set_health_error<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6336        self.health_error = v.into();
6337        self
6338    }
6339
6340    /// Sets the value of [instructions][crate::model::VerifyKmsConfigResponse::instructions].
6341    ///
6342    /// # Example
6343    /// ```ignore,no_run
6344    /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
6345    /// let x = VerifyKmsConfigResponse::new().set_instructions("example");
6346    /// ```
6347    pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6348        self.instructions = v.into();
6349        self
6350    }
6351}
6352
6353impl wkt::message::Message for VerifyKmsConfigResponse {
6354    fn typename() -> &'static str {
6355        "type.googleapis.com/google.cloud.netapp.v1.VerifyKmsConfigResponse"
6356    }
6357}
6358
6359/// KmsConfig is the customer-managed encryption key(CMEK) configuration.
6360#[derive(Clone, Default, PartialEq)]
6361#[non_exhaustive]
6362pub struct KmsConfig {
6363    /// Identifier. Name of the KmsConfig.
6364    /// Format: `projects/{project}/locations/{location}/kmsConfigs/{kms_config}`
6365    pub name: std::string::String,
6366
6367    /// Required. Customer-managed crypto key resource full name. Format:
6368    /// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`
6369    pub crypto_key_name: std::string::String,
6370
6371    /// Output only. State of the KmsConfig.
6372    pub state: crate::model::kms_config::State,
6373
6374    /// Output only. State details of the KmsConfig.
6375    pub state_details: std::string::String,
6376
6377    /// Output only. Create time of the KmsConfig.
6378    pub create_time: std::option::Option<wkt::Timestamp>,
6379
6380    /// Description of the KmsConfig.
6381    pub description: std::string::String,
6382
6383    /// Labels as key value pairs
6384    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6385
6386    /// Output only. Instructions to provide the access to the customer provided
6387    /// encryption key.
6388    pub instructions: std::string::String,
6389
6390    /// Output only. The Service account which will have access to the customer
6391    /// provided encryption key.
6392    pub service_account: std::string::String,
6393
6394    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6395}
6396
6397impl KmsConfig {
6398    /// Creates a new default instance.
6399    pub fn new() -> Self {
6400        std::default::Default::default()
6401    }
6402
6403    /// Sets the value of [name][crate::model::KmsConfig::name].
6404    ///
6405    /// # Example
6406    /// ```ignore,no_run
6407    /// # use google_cloud_netapp_v1::model::KmsConfig;
6408    /// # let project_id = "project_id";
6409    /// # let location_id = "location_id";
6410    /// # let kms_config_id = "kms_config_id";
6411    /// let x = KmsConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/kmsConfigs/{kms_config_id}"));
6412    /// ```
6413    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6414        self.name = v.into();
6415        self
6416    }
6417
6418    /// Sets the value of [crypto_key_name][crate::model::KmsConfig::crypto_key_name].
6419    ///
6420    /// # Example
6421    /// ```ignore,no_run
6422    /// # use google_cloud_netapp_v1::model::KmsConfig;
6423    /// let x = KmsConfig::new().set_crypto_key_name("example");
6424    /// ```
6425    pub fn set_crypto_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6426        self.crypto_key_name = v.into();
6427        self
6428    }
6429
6430    /// Sets the value of [state][crate::model::KmsConfig::state].
6431    ///
6432    /// # Example
6433    /// ```ignore,no_run
6434    /// # use google_cloud_netapp_v1::model::KmsConfig;
6435    /// use google_cloud_netapp_v1::model::kms_config::State;
6436    /// let x0 = KmsConfig::new().set_state(State::Ready);
6437    /// let x1 = KmsConfig::new().set_state(State::Creating);
6438    /// let x2 = KmsConfig::new().set_state(State::Deleting);
6439    /// ```
6440    pub fn set_state<T: std::convert::Into<crate::model::kms_config::State>>(
6441        mut self,
6442        v: T,
6443    ) -> Self {
6444        self.state = v.into();
6445        self
6446    }
6447
6448    /// Sets the value of [state_details][crate::model::KmsConfig::state_details].
6449    ///
6450    /// # Example
6451    /// ```ignore,no_run
6452    /// # use google_cloud_netapp_v1::model::KmsConfig;
6453    /// let x = KmsConfig::new().set_state_details("example");
6454    /// ```
6455    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6456        self.state_details = v.into();
6457        self
6458    }
6459
6460    /// Sets the value of [create_time][crate::model::KmsConfig::create_time].
6461    ///
6462    /// # Example
6463    /// ```ignore,no_run
6464    /// # use google_cloud_netapp_v1::model::KmsConfig;
6465    /// use wkt::Timestamp;
6466    /// let x = KmsConfig::new().set_create_time(Timestamp::default()/* use setters */);
6467    /// ```
6468    pub fn set_create_time<T>(mut self, v: T) -> Self
6469    where
6470        T: std::convert::Into<wkt::Timestamp>,
6471    {
6472        self.create_time = std::option::Option::Some(v.into());
6473        self
6474    }
6475
6476    /// Sets or clears the value of [create_time][crate::model::KmsConfig::create_time].
6477    ///
6478    /// # Example
6479    /// ```ignore,no_run
6480    /// # use google_cloud_netapp_v1::model::KmsConfig;
6481    /// use wkt::Timestamp;
6482    /// let x = KmsConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6483    /// let x = KmsConfig::new().set_or_clear_create_time(None::<Timestamp>);
6484    /// ```
6485    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6486    where
6487        T: std::convert::Into<wkt::Timestamp>,
6488    {
6489        self.create_time = v.map(|x| x.into());
6490        self
6491    }
6492
6493    /// Sets the value of [description][crate::model::KmsConfig::description].
6494    ///
6495    /// # Example
6496    /// ```ignore,no_run
6497    /// # use google_cloud_netapp_v1::model::KmsConfig;
6498    /// let x = KmsConfig::new().set_description("example");
6499    /// ```
6500    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6501        self.description = v.into();
6502        self
6503    }
6504
6505    /// Sets the value of [labels][crate::model::KmsConfig::labels].
6506    ///
6507    /// # Example
6508    /// ```ignore,no_run
6509    /// # use google_cloud_netapp_v1::model::KmsConfig;
6510    /// let x = KmsConfig::new().set_labels([
6511    ///     ("key0", "abc"),
6512    ///     ("key1", "xyz"),
6513    /// ]);
6514    /// ```
6515    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6516    where
6517        T: std::iter::IntoIterator<Item = (K, V)>,
6518        K: std::convert::Into<std::string::String>,
6519        V: std::convert::Into<std::string::String>,
6520    {
6521        use std::iter::Iterator;
6522        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6523        self
6524    }
6525
6526    /// Sets the value of [instructions][crate::model::KmsConfig::instructions].
6527    ///
6528    /// # Example
6529    /// ```ignore,no_run
6530    /// # use google_cloud_netapp_v1::model::KmsConfig;
6531    /// let x = KmsConfig::new().set_instructions("example");
6532    /// ```
6533    pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6534        self.instructions = v.into();
6535        self
6536    }
6537
6538    /// Sets the value of [service_account][crate::model::KmsConfig::service_account].
6539    ///
6540    /// # Example
6541    /// ```ignore,no_run
6542    /// # use google_cloud_netapp_v1::model::KmsConfig;
6543    /// let x = KmsConfig::new().set_service_account("example");
6544    /// ```
6545    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6546        self.service_account = v.into();
6547        self
6548    }
6549}
6550
6551impl wkt::message::Message for KmsConfig {
6552    fn typename() -> &'static str {
6553        "type.googleapis.com/google.cloud.netapp.v1.KmsConfig"
6554    }
6555}
6556
6557/// Defines additional types related to [KmsConfig].
6558pub mod kms_config {
6559    #[allow(unused_imports)]
6560    use super::*;
6561
6562    /// The KmsConfig States
6563    ///
6564    /// # Working with unknown values
6565    ///
6566    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6567    /// additional enum variants at any time. Adding new variants is not considered
6568    /// a breaking change. Applications should write their code in anticipation of:
6569    ///
6570    /// - New values appearing in future releases of the client library, **and**
6571    /// - New values received dynamically, without application changes.
6572    ///
6573    /// Please consult the [Working with enums] section in the user guide for some
6574    /// guidelines.
6575    ///
6576    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
6577    #[derive(Clone, Debug, PartialEq)]
6578    #[non_exhaustive]
6579    pub enum State {
6580        /// Unspecified KmsConfig State
6581        Unspecified,
6582        /// KmsConfig State is Ready
6583        Ready,
6584        /// KmsConfig State is Creating
6585        Creating,
6586        /// KmsConfig State is Deleting
6587        Deleting,
6588        /// KmsConfig State is Updating
6589        Updating,
6590        /// KmsConfig State is In Use.
6591        InUse,
6592        /// KmsConfig State is Error
6593        Error,
6594        /// KmsConfig State is Pending to verify crypto key access.
6595        KeyCheckPending,
6596        /// KmsConfig State is Not accessbile by the SDE service account to the
6597        /// crypto key.
6598        KeyNotReachable,
6599        /// KmsConfig State is Disabling.
6600        Disabling,
6601        /// KmsConfig State is Disabled.
6602        Disabled,
6603        /// KmsConfig State is Migrating.
6604        /// The existing volumes are migrating from SMEK to CMEK.
6605        Migrating,
6606        /// If set, the enum was initialized with an unknown value.
6607        ///
6608        /// Applications can examine the value using [State::value] or
6609        /// [State::name].
6610        UnknownValue(state::UnknownValue),
6611    }
6612
6613    #[doc(hidden)]
6614    pub mod state {
6615        #[allow(unused_imports)]
6616        use super::*;
6617        #[derive(Clone, Debug, PartialEq)]
6618        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6619    }
6620
6621    impl State {
6622        /// Gets the enum value.
6623        ///
6624        /// Returns `None` if the enum contains an unknown value deserialized from
6625        /// the string representation of enums.
6626        pub fn value(&self) -> std::option::Option<i32> {
6627            match self {
6628                Self::Unspecified => std::option::Option::Some(0),
6629                Self::Ready => std::option::Option::Some(1),
6630                Self::Creating => std::option::Option::Some(2),
6631                Self::Deleting => std::option::Option::Some(3),
6632                Self::Updating => std::option::Option::Some(4),
6633                Self::InUse => std::option::Option::Some(5),
6634                Self::Error => std::option::Option::Some(6),
6635                Self::KeyCheckPending => std::option::Option::Some(7),
6636                Self::KeyNotReachable => std::option::Option::Some(8),
6637                Self::Disabling => std::option::Option::Some(9),
6638                Self::Disabled => std::option::Option::Some(10),
6639                Self::Migrating => std::option::Option::Some(11),
6640                Self::UnknownValue(u) => u.0.value(),
6641            }
6642        }
6643
6644        /// Gets the enum value as a string.
6645        ///
6646        /// Returns `None` if the enum contains an unknown value deserialized from
6647        /// the integer representation of enums.
6648        pub fn name(&self) -> std::option::Option<&str> {
6649            match self {
6650                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6651                Self::Ready => std::option::Option::Some("READY"),
6652                Self::Creating => std::option::Option::Some("CREATING"),
6653                Self::Deleting => std::option::Option::Some("DELETING"),
6654                Self::Updating => std::option::Option::Some("UPDATING"),
6655                Self::InUse => std::option::Option::Some("IN_USE"),
6656                Self::Error => std::option::Option::Some("ERROR"),
6657                Self::KeyCheckPending => std::option::Option::Some("KEY_CHECK_PENDING"),
6658                Self::KeyNotReachable => std::option::Option::Some("KEY_NOT_REACHABLE"),
6659                Self::Disabling => std::option::Option::Some("DISABLING"),
6660                Self::Disabled => std::option::Option::Some("DISABLED"),
6661                Self::Migrating => std::option::Option::Some("MIGRATING"),
6662                Self::UnknownValue(u) => u.0.name(),
6663            }
6664        }
6665    }
6666
6667    impl std::default::Default for State {
6668        fn default() -> Self {
6669            use std::convert::From;
6670            Self::from(0)
6671        }
6672    }
6673
6674    impl std::fmt::Display for State {
6675        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6676            wkt::internal::display_enum(f, self.name(), self.value())
6677        }
6678    }
6679
6680    impl std::convert::From<i32> for State {
6681        fn from(value: i32) -> Self {
6682            match value {
6683                0 => Self::Unspecified,
6684                1 => Self::Ready,
6685                2 => Self::Creating,
6686                3 => Self::Deleting,
6687                4 => Self::Updating,
6688                5 => Self::InUse,
6689                6 => Self::Error,
6690                7 => Self::KeyCheckPending,
6691                8 => Self::KeyNotReachable,
6692                9 => Self::Disabling,
6693                10 => Self::Disabled,
6694                11 => Self::Migrating,
6695                _ => Self::UnknownValue(state::UnknownValue(
6696                    wkt::internal::UnknownEnumValue::Integer(value),
6697                )),
6698            }
6699        }
6700    }
6701
6702    impl std::convert::From<&str> for State {
6703        fn from(value: &str) -> Self {
6704            use std::string::ToString;
6705            match value {
6706                "STATE_UNSPECIFIED" => Self::Unspecified,
6707                "READY" => Self::Ready,
6708                "CREATING" => Self::Creating,
6709                "DELETING" => Self::Deleting,
6710                "UPDATING" => Self::Updating,
6711                "IN_USE" => Self::InUse,
6712                "ERROR" => Self::Error,
6713                "KEY_CHECK_PENDING" => Self::KeyCheckPending,
6714                "KEY_NOT_REACHABLE" => Self::KeyNotReachable,
6715                "DISABLING" => Self::Disabling,
6716                "DISABLED" => Self::Disabled,
6717                "MIGRATING" => Self::Migrating,
6718                _ => Self::UnknownValue(state::UnknownValue(
6719                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6720                )),
6721            }
6722        }
6723    }
6724
6725    impl serde::ser::Serialize for State {
6726        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6727        where
6728            S: serde::Serializer,
6729        {
6730            match self {
6731                Self::Unspecified => serializer.serialize_i32(0),
6732                Self::Ready => serializer.serialize_i32(1),
6733                Self::Creating => serializer.serialize_i32(2),
6734                Self::Deleting => serializer.serialize_i32(3),
6735                Self::Updating => serializer.serialize_i32(4),
6736                Self::InUse => serializer.serialize_i32(5),
6737                Self::Error => serializer.serialize_i32(6),
6738                Self::KeyCheckPending => serializer.serialize_i32(7),
6739                Self::KeyNotReachable => serializer.serialize_i32(8),
6740                Self::Disabling => serializer.serialize_i32(9),
6741                Self::Disabled => serializer.serialize_i32(10),
6742                Self::Migrating => serializer.serialize_i32(11),
6743                Self::UnknownValue(u) => u.0.serialize(serializer),
6744            }
6745        }
6746    }
6747
6748    impl<'de> serde::de::Deserialize<'de> for State {
6749        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6750        where
6751            D: serde::Deserializer<'de>,
6752        {
6753            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6754                ".google.cloud.netapp.v1.KmsConfig.State",
6755            ))
6756        }
6757    }
6758}
6759
6760/// Request message for `ExecuteOntapPost` API.
6761#[derive(Clone, Default, PartialEq)]
6762#[non_exhaustive]
6763pub struct ExecuteOntapPostRequest {
6764    /// Required. The raw `JSON` body of the request.
6765    /// The body should be in the format of the ONTAP resource.
6766    /// For example:
6767    ///
6768    /// ```norust
6769    /// {
6770    ///   "body": {
6771    ///     "field1": "value1",
6772    ///     "field2": "value2",
6773    ///   }
6774    /// }
6775    /// ```
6776    pub body: std::option::Option<wkt::Struct>,
6777
6778    /// Required. The resource path of the ONTAP resource.
6779    /// Format:
6780    /// `projects/{project_number}/locations/{location_id}/storagePools/{storage_pool_id}/ontap/{ontap_resource_path}`.
6781    /// For example:
6782    /// `projects/123456789/locations/us-central1/storagePools/my-storage-pool/ontap/api/storage/volumes`.
6783    pub ontap_path: std::string::String,
6784
6785    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6786}
6787
6788impl ExecuteOntapPostRequest {
6789    /// Creates a new default instance.
6790    pub fn new() -> Self {
6791        std::default::Default::default()
6792    }
6793
6794    /// Sets the value of [body][crate::model::ExecuteOntapPostRequest::body].
6795    ///
6796    /// # Example
6797    /// ```ignore,no_run
6798    /// # use google_cloud_netapp_v1::model::ExecuteOntapPostRequest;
6799    /// use wkt::Struct;
6800    /// let x = ExecuteOntapPostRequest::new().set_body(Struct::default()/* use setters */);
6801    /// ```
6802    pub fn set_body<T>(mut self, v: T) -> Self
6803    where
6804        T: std::convert::Into<wkt::Struct>,
6805    {
6806        self.body = std::option::Option::Some(v.into());
6807        self
6808    }
6809
6810    /// Sets or clears the value of [body][crate::model::ExecuteOntapPostRequest::body].
6811    ///
6812    /// # Example
6813    /// ```ignore,no_run
6814    /// # use google_cloud_netapp_v1::model::ExecuteOntapPostRequest;
6815    /// use wkt::Struct;
6816    /// let x = ExecuteOntapPostRequest::new().set_or_clear_body(Some(Struct::default()/* use setters */));
6817    /// let x = ExecuteOntapPostRequest::new().set_or_clear_body(None::<Struct>);
6818    /// ```
6819    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6820    where
6821        T: std::convert::Into<wkt::Struct>,
6822    {
6823        self.body = v.map(|x| x.into());
6824        self
6825    }
6826
6827    /// Sets the value of [ontap_path][crate::model::ExecuteOntapPostRequest::ontap_path].
6828    ///
6829    /// # Example
6830    /// ```ignore,no_run
6831    /// # use google_cloud_netapp_v1::model::ExecuteOntapPostRequest;
6832    /// let x = ExecuteOntapPostRequest::new().set_ontap_path("example");
6833    /// ```
6834    pub fn set_ontap_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6835        self.ontap_path = v.into();
6836        self
6837    }
6838}
6839
6840impl wkt::message::Message for ExecuteOntapPostRequest {
6841    fn typename() -> &'static str {
6842        "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapPostRequest"
6843    }
6844}
6845
6846/// Response message for `ExecuteOntapPost` API.
6847#[derive(Clone, Default, PartialEq)]
6848#[non_exhaustive]
6849pub struct ExecuteOntapPostResponse {
6850    /// The raw `JSON` body of the response.
6851    pub body: std::option::Option<wkt::Struct>,
6852
6853    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6854}
6855
6856impl ExecuteOntapPostResponse {
6857    /// Creates a new default instance.
6858    pub fn new() -> Self {
6859        std::default::Default::default()
6860    }
6861
6862    /// Sets the value of [body][crate::model::ExecuteOntapPostResponse::body].
6863    ///
6864    /// # Example
6865    /// ```ignore,no_run
6866    /// # use google_cloud_netapp_v1::model::ExecuteOntapPostResponse;
6867    /// use wkt::Struct;
6868    /// let x = ExecuteOntapPostResponse::new().set_body(Struct::default()/* use setters */);
6869    /// ```
6870    pub fn set_body<T>(mut self, v: T) -> Self
6871    where
6872        T: std::convert::Into<wkt::Struct>,
6873    {
6874        self.body = std::option::Option::Some(v.into());
6875        self
6876    }
6877
6878    /// Sets or clears the value of [body][crate::model::ExecuteOntapPostResponse::body].
6879    ///
6880    /// # Example
6881    /// ```ignore,no_run
6882    /// # use google_cloud_netapp_v1::model::ExecuteOntapPostResponse;
6883    /// use wkt::Struct;
6884    /// let x = ExecuteOntapPostResponse::new().set_or_clear_body(Some(Struct::default()/* use setters */));
6885    /// let x = ExecuteOntapPostResponse::new().set_or_clear_body(None::<Struct>);
6886    /// ```
6887    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6888    where
6889        T: std::convert::Into<wkt::Struct>,
6890    {
6891        self.body = v.map(|x| x.into());
6892        self
6893    }
6894}
6895
6896impl wkt::message::Message for ExecuteOntapPostResponse {
6897    fn typename() -> &'static str {
6898        "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapPostResponse"
6899    }
6900}
6901
6902/// Request message for `ExecuteOntapGet` API.
6903#[derive(Clone, Default, PartialEq)]
6904#[non_exhaustive]
6905pub struct ExecuteOntapGetRequest {
6906    /// Required. The resource path of the ONTAP resource.
6907    /// Format:
6908    /// `projects/{project_number}/locations/{location_id}/storagePools/{storage_pool_id}/ontap/{ontap_resource_path}`.
6909    /// For example:
6910    /// `projects/123456789/locations/us-central1/storagePools/my-storage-pool/ontap/api/storage/volumes`.
6911    pub ontap_path: std::string::String,
6912
6913    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6914}
6915
6916impl ExecuteOntapGetRequest {
6917    /// Creates a new default instance.
6918    pub fn new() -> Self {
6919        std::default::Default::default()
6920    }
6921
6922    /// Sets the value of [ontap_path][crate::model::ExecuteOntapGetRequest::ontap_path].
6923    ///
6924    /// # Example
6925    /// ```ignore,no_run
6926    /// # use google_cloud_netapp_v1::model::ExecuteOntapGetRequest;
6927    /// let x = ExecuteOntapGetRequest::new().set_ontap_path("example");
6928    /// ```
6929    pub fn set_ontap_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6930        self.ontap_path = v.into();
6931        self
6932    }
6933}
6934
6935impl wkt::message::Message for ExecuteOntapGetRequest {
6936    fn typename() -> &'static str {
6937        "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapGetRequest"
6938    }
6939}
6940
6941/// Response message for `ExecuteOntapGet` API.
6942#[derive(Clone, Default, PartialEq)]
6943#[non_exhaustive]
6944pub struct ExecuteOntapGetResponse {
6945    /// The raw `JSON` body of the response.
6946    pub body: std::option::Option<wkt::Struct>,
6947
6948    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6949}
6950
6951impl ExecuteOntapGetResponse {
6952    /// Creates a new default instance.
6953    pub fn new() -> Self {
6954        std::default::Default::default()
6955    }
6956
6957    /// Sets the value of [body][crate::model::ExecuteOntapGetResponse::body].
6958    ///
6959    /// # Example
6960    /// ```ignore,no_run
6961    /// # use google_cloud_netapp_v1::model::ExecuteOntapGetResponse;
6962    /// use wkt::Struct;
6963    /// let x = ExecuteOntapGetResponse::new().set_body(Struct::default()/* use setters */);
6964    /// ```
6965    pub fn set_body<T>(mut self, v: T) -> Self
6966    where
6967        T: std::convert::Into<wkt::Struct>,
6968    {
6969        self.body = std::option::Option::Some(v.into());
6970        self
6971    }
6972
6973    /// Sets or clears the value of [body][crate::model::ExecuteOntapGetResponse::body].
6974    ///
6975    /// # Example
6976    /// ```ignore,no_run
6977    /// # use google_cloud_netapp_v1::model::ExecuteOntapGetResponse;
6978    /// use wkt::Struct;
6979    /// let x = ExecuteOntapGetResponse::new().set_or_clear_body(Some(Struct::default()/* use setters */));
6980    /// let x = ExecuteOntapGetResponse::new().set_or_clear_body(None::<Struct>);
6981    /// ```
6982    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
6983    where
6984        T: std::convert::Into<wkt::Struct>,
6985    {
6986        self.body = v.map(|x| x.into());
6987        self
6988    }
6989}
6990
6991impl wkt::message::Message for ExecuteOntapGetResponse {
6992    fn typename() -> &'static str {
6993        "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapGetResponse"
6994    }
6995}
6996
6997/// Request message for `ExecuteOntapDelete` API.
6998#[derive(Clone, Default, PartialEq)]
6999#[non_exhaustive]
7000pub struct ExecuteOntapDeleteRequest {
7001    /// Required. The resource path of the ONTAP resource.
7002    /// Format:
7003    /// `projects/{project_number}/locations/{location_id}/storagePools/{storage_pool_id}/ontap/{ontap_resource_path}`.
7004    /// For example:
7005    /// `projects/123456789/locations/us-central1/storagePools/my-storage-pool/ontap/api/storage/volumes`.
7006    pub ontap_path: std::string::String,
7007
7008    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7009}
7010
7011impl ExecuteOntapDeleteRequest {
7012    /// Creates a new default instance.
7013    pub fn new() -> Self {
7014        std::default::Default::default()
7015    }
7016
7017    /// Sets the value of [ontap_path][crate::model::ExecuteOntapDeleteRequest::ontap_path].
7018    ///
7019    /// # Example
7020    /// ```ignore,no_run
7021    /// # use google_cloud_netapp_v1::model::ExecuteOntapDeleteRequest;
7022    /// let x = ExecuteOntapDeleteRequest::new().set_ontap_path("example");
7023    /// ```
7024    pub fn set_ontap_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7025        self.ontap_path = v.into();
7026        self
7027    }
7028}
7029
7030impl wkt::message::Message for ExecuteOntapDeleteRequest {
7031    fn typename() -> &'static str {
7032        "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapDeleteRequest"
7033    }
7034}
7035
7036/// Response message for `ExecuteOntapDelete` API.
7037#[derive(Clone, Default, PartialEq)]
7038#[non_exhaustive]
7039pub struct ExecuteOntapDeleteResponse {
7040    /// The raw `JSON` body of the response.
7041    pub body: std::option::Option<wkt::Struct>,
7042
7043    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7044}
7045
7046impl ExecuteOntapDeleteResponse {
7047    /// Creates a new default instance.
7048    pub fn new() -> Self {
7049        std::default::Default::default()
7050    }
7051
7052    /// Sets the value of [body][crate::model::ExecuteOntapDeleteResponse::body].
7053    ///
7054    /// # Example
7055    /// ```ignore,no_run
7056    /// # use google_cloud_netapp_v1::model::ExecuteOntapDeleteResponse;
7057    /// use wkt::Struct;
7058    /// let x = ExecuteOntapDeleteResponse::new().set_body(Struct::default()/* use setters */);
7059    /// ```
7060    pub fn set_body<T>(mut self, v: T) -> Self
7061    where
7062        T: std::convert::Into<wkt::Struct>,
7063    {
7064        self.body = std::option::Option::Some(v.into());
7065        self
7066    }
7067
7068    /// Sets or clears the value of [body][crate::model::ExecuteOntapDeleteResponse::body].
7069    ///
7070    /// # Example
7071    /// ```ignore,no_run
7072    /// # use google_cloud_netapp_v1::model::ExecuteOntapDeleteResponse;
7073    /// use wkt::Struct;
7074    /// let x = ExecuteOntapDeleteResponse::new().set_or_clear_body(Some(Struct::default()/* use setters */));
7075    /// let x = ExecuteOntapDeleteResponse::new().set_or_clear_body(None::<Struct>);
7076    /// ```
7077    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7078    where
7079        T: std::convert::Into<wkt::Struct>,
7080    {
7081        self.body = v.map(|x| x.into());
7082        self
7083    }
7084}
7085
7086impl wkt::message::Message for ExecuteOntapDeleteResponse {
7087    fn typename() -> &'static str {
7088        "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapDeleteResponse"
7089    }
7090}
7091
7092/// Request message for `ExecuteOntapPatch` API.
7093#[derive(Clone, Default, PartialEq)]
7094#[non_exhaustive]
7095pub struct ExecuteOntapPatchRequest {
7096    /// Required. The raw `JSON` body of the request.
7097    /// The body should be in the format of the ONTAP resource.
7098    /// For example:
7099    ///
7100    /// ```norust
7101    /// {
7102    ///   "body": {
7103    ///     "field1": "value1",
7104    ///     "field2": "value2",
7105    ///   }
7106    /// }
7107    /// ```
7108    pub body: std::option::Option<wkt::Struct>,
7109
7110    /// Required. The resource path of the ONTAP resource.
7111    /// Format:
7112    /// `projects/{project_number}/locations/{location_id}/storagePools/{storage_pool_id}/ontap/{ontap_resource_path}`.
7113    /// For example:
7114    /// `projects/123456789/locations/us-central1/storagePools/my-storage-pool/ontap/api/storage/volumes`.
7115    pub ontap_path: std::string::String,
7116
7117    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7118}
7119
7120impl ExecuteOntapPatchRequest {
7121    /// Creates a new default instance.
7122    pub fn new() -> Self {
7123        std::default::Default::default()
7124    }
7125
7126    /// Sets the value of [body][crate::model::ExecuteOntapPatchRequest::body].
7127    ///
7128    /// # Example
7129    /// ```ignore,no_run
7130    /// # use google_cloud_netapp_v1::model::ExecuteOntapPatchRequest;
7131    /// use wkt::Struct;
7132    /// let x = ExecuteOntapPatchRequest::new().set_body(Struct::default()/* use setters */);
7133    /// ```
7134    pub fn set_body<T>(mut self, v: T) -> Self
7135    where
7136        T: std::convert::Into<wkt::Struct>,
7137    {
7138        self.body = std::option::Option::Some(v.into());
7139        self
7140    }
7141
7142    /// Sets or clears the value of [body][crate::model::ExecuteOntapPatchRequest::body].
7143    ///
7144    /// # Example
7145    /// ```ignore,no_run
7146    /// # use google_cloud_netapp_v1::model::ExecuteOntapPatchRequest;
7147    /// use wkt::Struct;
7148    /// let x = ExecuteOntapPatchRequest::new().set_or_clear_body(Some(Struct::default()/* use setters */));
7149    /// let x = ExecuteOntapPatchRequest::new().set_or_clear_body(None::<Struct>);
7150    /// ```
7151    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7152    where
7153        T: std::convert::Into<wkt::Struct>,
7154    {
7155        self.body = v.map(|x| x.into());
7156        self
7157    }
7158
7159    /// Sets the value of [ontap_path][crate::model::ExecuteOntapPatchRequest::ontap_path].
7160    ///
7161    /// # Example
7162    /// ```ignore,no_run
7163    /// # use google_cloud_netapp_v1::model::ExecuteOntapPatchRequest;
7164    /// let x = ExecuteOntapPatchRequest::new().set_ontap_path("example");
7165    /// ```
7166    pub fn set_ontap_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7167        self.ontap_path = v.into();
7168        self
7169    }
7170}
7171
7172impl wkt::message::Message for ExecuteOntapPatchRequest {
7173    fn typename() -> &'static str {
7174        "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapPatchRequest"
7175    }
7176}
7177
7178/// Response message for `ExecuteOntapPatch` API.
7179#[derive(Clone, Default, PartialEq)]
7180#[non_exhaustive]
7181pub struct ExecuteOntapPatchResponse {
7182    /// The raw `JSON` body of the response.
7183    pub body: std::option::Option<wkt::Struct>,
7184
7185    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7186}
7187
7188impl ExecuteOntapPatchResponse {
7189    /// Creates a new default instance.
7190    pub fn new() -> Self {
7191        std::default::Default::default()
7192    }
7193
7194    /// Sets the value of [body][crate::model::ExecuteOntapPatchResponse::body].
7195    ///
7196    /// # Example
7197    /// ```ignore,no_run
7198    /// # use google_cloud_netapp_v1::model::ExecuteOntapPatchResponse;
7199    /// use wkt::Struct;
7200    /// let x = ExecuteOntapPatchResponse::new().set_body(Struct::default()/* use setters */);
7201    /// ```
7202    pub fn set_body<T>(mut self, v: T) -> Self
7203    where
7204        T: std::convert::Into<wkt::Struct>,
7205    {
7206        self.body = std::option::Option::Some(v.into());
7207        self
7208    }
7209
7210    /// Sets or clears the value of [body][crate::model::ExecuteOntapPatchResponse::body].
7211    ///
7212    /// # Example
7213    /// ```ignore,no_run
7214    /// # use google_cloud_netapp_v1::model::ExecuteOntapPatchResponse;
7215    /// use wkt::Struct;
7216    /// let x = ExecuteOntapPatchResponse::new().set_or_clear_body(Some(Struct::default()/* use setters */));
7217    /// let x = ExecuteOntapPatchResponse::new().set_or_clear_body(None::<Struct>);
7218    /// ```
7219    pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
7220    where
7221        T: std::convert::Into<wkt::Struct>,
7222    {
7223        self.body = v.map(|x| x.into());
7224        self
7225    }
7226}
7227
7228impl wkt::message::Message for ExecuteOntapPatchResponse {
7229    fn typename() -> &'static str {
7230        "type.googleapis.com/google.cloud.netapp.v1.ExecuteOntapPatchResponse"
7231    }
7232}
7233
7234/// ListQuotaRulesRequest for listing quota rules.
7235#[derive(Clone, Default, PartialEq)]
7236#[non_exhaustive]
7237pub struct ListQuotaRulesRequest {
7238    /// Required. Parent value for ListQuotaRulesRequest
7239    pub parent: std::string::String,
7240
7241    /// Optional. Requested page size. Server may return fewer items than
7242    /// requested. If unspecified, the server will pick an appropriate default.
7243    pub page_size: i32,
7244
7245    /// Optional. A token identifying a page of results the server should return.
7246    pub page_token: std::string::String,
7247
7248    /// Optional. Filtering results
7249    pub filter: std::string::String,
7250
7251    /// Optional. Hint for how to order the results
7252    pub order_by: std::string::String,
7253
7254    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7255}
7256
7257impl ListQuotaRulesRequest {
7258    /// Creates a new default instance.
7259    pub fn new() -> Self {
7260        std::default::Default::default()
7261    }
7262
7263    /// Sets the value of [parent][crate::model::ListQuotaRulesRequest::parent].
7264    ///
7265    /// # Example
7266    /// ```ignore,no_run
7267    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
7268    /// # let project_id = "project_id";
7269    /// # let location_id = "location_id";
7270    /// # let volume_id = "volume_id";
7271    /// let x = ListQuotaRulesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
7272    /// ```
7273    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7274        self.parent = v.into();
7275        self
7276    }
7277
7278    /// Sets the value of [page_size][crate::model::ListQuotaRulesRequest::page_size].
7279    ///
7280    /// # Example
7281    /// ```ignore,no_run
7282    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
7283    /// let x = ListQuotaRulesRequest::new().set_page_size(42);
7284    /// ```
7285    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7286        self.page_size = v.into();
7287        self
7288    }
7289
7290    /// Sets the value of [page_token][crate::model::ListQuotaRulesRequest::page_token].
7291    ///
7292    /// # Example
7293    /// ```ignore,no_run
7294    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
7295    /// let x = ListQuotaRulesRequest::new().set_page_token("example");
7296    /// ```
7297    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7298        self.page_token = v.into();
7299        self
7300    }
7301
7302    /// Sets the value of [filter][crate::model::ListQuotaRulesRequest::filter].
7303    ///
7304    /// # Example
7305    /// ```ignore,no_run
7306    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
7307    /// let x = ListQuotaRulesRequest::new().set_filter("example");
7308    /// ```
7309    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7310        self.filter = v.into();
7311        self
7312    }
7313
7314    /// Sets the value of [order_by][crate::model::ListQuotaRulesRequest::order_by].
7315    ///
7316    /// # Example
7317    /// ```ignore,no_run
7318    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
7319    /// let x = ListQuotaRulesRequest::new().set_order_by("example");
7320    /// ```
7321    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7322        self.order_by = v.into();
7323        self
7324    }
7325}
7326
7327impl wkt::message::Message for ListQuotaRulesRequest {
7328    fn typename() -> &'static str {
7329        "type.googleapis.com/google.cloud.netapp.v1.ListQuotaRulesRequest"
7330    }
7331}
7332
7333/// ListQuotaRulesResponse is the response to a ListQuotaRulesRequest.
7334#[derive(Clone, Default, PartialEq)]
7335#[non_exhaustive]
7336pub struct ListQuotaRulesResponse {
7337    /// List of quota rules
7338    pub quota_rules: std::vec::Vec<crate::model::QuotaRule>,
7339
7340    /// A token identifying a page of results the server should return.
7341    pub next_page_token: std::string::String,
7342
7343    /// Locations that could not be reached.
7344    pub unreachable: std::vec::Vec<std::string::String>,
7345
7346    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7347}
7348
7349impl ListQuotaRulesResponse {
7350    /// Creates a new default instance.
7351    pub fn new() -> Self {
7352        std::default::Default::default()
7353    }
7354
7355    /// Sets the value of [quota_rules][crate::model::ListQuotaRulesResponse::quota_rules].
7356    ///
7357    /// # Example
7358    /// ```ignore,no_run
7359    /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
7360    /// use google_cloud_netapp_v1::model::QuotaRule;
7361    /// let x = ListQuotaRulesResponse::new()
7362    ///     .set_quota_rules([
7363    ///         QuotaRule::default()/* use setters */,
7364    ///         QuotaRule::default()/* use (different) setters */,
7365    ///     ]);
7366    /// ```
7367    pub fn set_quota_rules<T, V>(mut self, v: T) -> Self
7368    where
7369        T: std::iter::IntoIterator<Item = V>,
7370        V: std::convert::Into<crate::model::QuotaRule>,
7371    {
7372        use std::iter::Iterator;
7373        self.quota_rules = v.into_iter().map(|i| i.into()).collect();
7374        self
7375    }
7376
7377    /// Sets the value of [next_page_token][crate::model::ListQuotaRulesResponse::next_page_token].
7378    ///
7379    /// # Example
7380    /// ```ignore,no_run
7381    /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
7382    /// let x = ListQuotaRulesResponse::new().set_next_page_token("example");
7383    /// ```
7384    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7385        self.next_page_token = v.into();
7386        self
7387    }
7388
7389    /// Sets the value of [unreachable][crate::model::ListQuotaRulesResponse::unreachable].
7390    ///
7391    /// # Example
7392    /// ```ignore,no_run
7393    /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
7394    /// let x = ListQuotaRulesResponse::new().set_unreachable(["a", "b", "c"]);
7395    /// ```
7396    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
7397    where
7398        T: std::iter::IntoIterator<Item = V>,
7399        V: std::convert::Into<std::string::String>,
7400    {
7401        use std::iter::Iterator;
7402        self.unreachable = v.into_iter().map(|i| i.into()).collect();
7403        self
7404    }
7405}
7406
7407impl wkt::message::Message for ListQuotaRulesResponse {
7408    fn typename() -> &'static str {
7409        "type.googleapis.com/google.cloud.netapp.v1.ListQuotaRulesResponse"
7410    }
7411}
7412
7413#[doc(hidden)]
7414impl google_cloud_gax::paginator::internal::PageableResponse for ListQuotaRulesResponse {
7415    type PageItem = crate::model::QuotaRule;
7416
7417    fn items(self) -> std::vec::Vec<Self::PageItem> {
7418        self.quota_rules
7419    }
7420
7421    fn next_page_token(&self) -> std::string::String {
7422        use std::clone::Clone;
7423        self.next_page_token.clone()
7424    }
7425}
7426
7427/// GetQuotaRuleRequest for getting a quota rule.
7428#[derive(Clone, Default, PartialEq)]
7429#[non_exhaustive]
7430pub struct GetQuotaRuleRequest {
7431    /// Required. Name of the quota rule
7432    pub name: std::string::String,
7433
7434    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7435}
7436
7437impl GetQuotaRuleRequest {
7438    /// Creates a new default instance.
7439    pub fn new() -> Self {
7440        std::default::Default::default()
7441    }
7442
7443    /// Sets the value of [name][crate::model::GetQuotaRuleRequest::name].
7444    ///
7445    /// # Example
7446    /// ```ignore,no_run
7447    /// # use google_cloud_netapp_v1::model::GetQuotaRuleRequest;
7448    /// # let project_id = "project_id";
7449    /// # let location_id = "location_id";
7450    /// # let volume_id = "volume_id";
7451    /// # let quota_rule_id = "quota_rule_id";
7452    /// let x = GetQuotaRuleRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/quotaRules/{quota_rule_id}"));
7453    /// ```
7454    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7455        self.name = v.into();
7456        self
7457    }
7458}
7459
7460impl wkt::message::Message for GetQuotaRuleRequest {
7461    fn typename() -> &'static str {
7462        "type.googleapis.com/google.cloud.netapp.v1.GetQuotaRuleRequest"
7463    }
7464}
7465
7466/// CreateQuotaRuleRequest for creating a quota rule.
7467#[derive(Clone, Default, PartialEq)]
7468#[non_exhaustive]
7469pub struct CreateQuotaRuleRequest {
7470    /// Required. Parent value for CreateQuotaRuleRequest
7471    pub parent: std::string::String,
7472
7473    /// Required. Fields of the to be created quota rule.
7474    pub quota_rule: std::option::Option<crate::model::QuotaRule>,
7475
7476    /// Required. ID of the quota rule to create. Must be unique within the parent
7477    /// resource. Must contain only letters, numbers, underscore and hyphen, with
7478    /// the first character a letter or underscore, the last a letter or underscore
7479    /// or a number, and a 63 character maximum.
7480    pub quota_rule_id: std::string::String,
7481
7482    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7483}
7484
7485impl CreateQuotaRuleRequest {
7486    /// Creates a new default instance.
7487    pub fn new() -> Self {
7488        std::default::Default::default()
7489    }
7490
7491    /// Sets the value of [parent][crate::model::CreateQuotaRuleRequest::parent].
7492    ///
7493    /// # Example
7494    /// ```ignore,no_run
7495    /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
7496    /// # let project_id = "project_id";
7497    /// # let location_id = "location_id";
7498    /// # let volume_id = "volume_id";
7499    /// let x = CreateQuotaRuleRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
7500    /// ```
7501    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7502        self.parent = v.into();
7503        self
7504    }
7505
7506    /// Sets the value of [quota_rule][crate::model::CreateQuotaRuleRequest::quota_rule].
7507    ///
7508    /// # Example
7509    /// ```ignore,no_run
7510    /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
7511    /// use google_cloud_netapp_v1::model::QuotaRule;
7512    /// let x = CreateQuotaRuleRequest::new().set_quota_rule(QuotaRule::default()/* use setters */);
7513    /// ```
7514    pub fn set_quota_rule<T>(mut self, v: T) -> Self
7515    where
7516        T: std::convert::Into<crate::model::QuotaRule>,
7517    {
7518        self.quota_rule = std::option::Option::Some(v.into());
7519        self
7520    }
7521
7522    /// Sets or clears the value of [quota_rule][crate::model::CreateQuotaRuleRequest::quota_rule].
7523    ///
7524    /// # Example
7525    /// ```ignore,no_run
7526    /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
7527    /// use google_cloud_netapp_v1::model::QuotaRule;
7528    /// let x = CreateQuotaRuleRequest::new().set_or_clear_quota_rule(Some(QuotaRule::default()/* use setters */));
7529    /// let x = CreateQuotaRuleRequest::new().set_or_clear_quota_rule(None::<QuotaRule>);
7530    /// ```
7531    pub fn set_or_clear_quota_rule<T>(mut self, v: std::option::Option<T>) -> Self
7532    where
7533        T: std::convert::Into<crate::model::QuotaRule>,
7534    {
7535        self.quota_rule = v.map(|x| x.into());
7536        self
7537    }
7538
7539    /// Sets the value of [quota_rule_id][crate::model::CreateQuotaRuleRequest::quota_rule_id].
7540    ///
7541    /// # Example
7542    /// ```ignore,no_run
7543    /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
7544    /// let x = CreateQuotaRuleRequest::new().set_quota_rule_id("example");
7545    /// ```
7546    pub fn set_quota_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7547        self.quota_rule_id = v.into();
7548        self
7549    }
7550}
7551
7552impl wkt::message::Message for CreateQuotaRuleRequest {
7553    fn typename() -> &'static str {
7554        "type.googleapis.com/google.cloud.netapp.v1.CreateQuotaRuleRequest"
7555    }
7556}
7557
7558/// UpdateQuotaRuleRequest for updating a quota rule.
7559#[derive(Clone, Default, PartialEq)]
7560#[non_exhaustive]
7561pub struct UpdateQuotaRuleRequest {
7562    /// Optional. Field mask is used to specify the fields to be overwritten in the
7563    /// Quota Rule resource by the update.
7564    /// The fields specified in the update_mask are relative to the resource, not
7565    /// the full request. A field will be overwritten if it is in the mask. If the
7566    /// user does not provide a mask then all fields will be overwritten.
7567    pub update_mask: std::option::Option<wkt::FieldMask>,
7568
7569    /// Required. The quota rule being updated
7570    pub quota_rule: std::option::Option<crate::model::QuotaRule>,
7571
7572    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7573}
7574
7575impl UpdateQuotaRuleRequest {
7576    /// Creates a new default instance.
7577    pub fn new() -> Self {
7578        std::default::Default::default()
7579    }
7580
7581    /// Sets the value of [update_mask][crate::model::UpdateQuotaRuleRequest::update_mask].
7582    ///
7583    /// # Example
7584    /// ```ignore,no_run
7585    /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
7586    /// use wkt::FieldMask;
7587    /// let x = UpdateQuotaRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
7588    /// ```
7589    pub fn set_update_mask<T>(mut self, v: T) -> Self
7590    where
7591        T: std::convert::Into<wkt::FieldMask>,
7592    {
7593        self.update_mask = std::option::Option::Some(v.into());
7594        self
7595    }
7596
7597    /// Sets or clears the value of [update_mask][crate::model::UpdateQuotaRuleRequest::update_mask].
7598    ///
7599    /// # Example
7600    /// ```ignore,no_run
7601    /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
7602    /// use wkt::FieldMask;
7603    /// let x = UpdateQuotaRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
7604    /// let x = UpdateQuotaRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
7605    /// ```
7606    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7607    where
7608        T: std::convert::Into<wkt::FieldMask>,
7609    {
7610        self.update_mask = v.map(|x| x.into());
7611        self
7612    }
7613
7614    /// Sets the value of [quota_rule][crate::model::UpdateQuotaRuleRequest::quota_rule].
7615    ///
7616    /// # Example
7617    /// ```ignore,no_run
7618    /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
7619    /// use google_cloud_netapp_v1::model::QuotaRule;
7620    /// let x = UpdateQuotaRuleRequest::new().set_quota_rule(QuotaRule::default()/* use setters */);
7621    /// ```
7622    pub fn set_quota_rule<T>(mut self, v: T) -> Self
7623    where
7624        T: std::convert::Into<crate::model::QuotaRule>,
7625    {
7626        self.quota_rule = std::option::Option::Some(v.into());
7627        self
7628    }
7629
7630    /// Sets or clears the value of [quota_rule][crate::model::UpdateQuotaRuleRequest::quota_rule].
7631    ///
7632    /// # Example
7633    /// ```ignore,no_run
7634    /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
7635    /// use google_cloud_netapp_v1::model::QuotaRule;
7636    /// let x = UpdateQuotaRuleRequest::new().set_or_clear_quota_rule(Some(QuotaRule::default()/* use setters */));
7637    /// let x = UpdateQuotaRuleRequest::new().set_or_clear_quota_rule(None::<QuotaRule>);
7638    /// ```
7639    pub fn set_or_clear_quota_rule<T>(mut self, v: std::option::Option<T>) -> Self
7640    where
7641        T: std::convert::Into<crate::model::QuotaRule>,
7642    {
7643        self.quota_rule = v.map(|x| x.into());
7644        self
7645    }
7646}
7647
7648impl wkt::message::Message for UpdateQuotaRuleRequest {
7649    fn typename() -> &'static str {
7650        "type.googleapis.com/google.cloud.netapp.v1.UpdateQuotaRuleRequest"
7651    }
7652}
7653
7654/// DeleteQuotaRuleRequest for deleting a single quota rule.
7655#[derive(Clone, Default, PartialEq)]
7656#[non_exhaustive]
7657pub struct DeleteQuotaRuleRequest {
7658    /// Required. Name of the quota rule.
7659    pub name: std::string::String,
7660
7661    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7662}
7663
7664impl DeleteQuotaRuleRequest {
7665    /// Creates a new default instance.
7666    pub fn new() -> Self {
7667        std::default::Default::default()
7668    }
7669
7670    /// Sets the value of [name][crate::model::DeleteQuotaRuleRequest::name].
7671    ///
7672    /// # Example
7673    /// ```ignore,no_run
7674    /// # use google_cloud_netapp_v1::model::DeleteQuotaRuleRequest;
7675    /// # let project_id = "project_id";
7676    /// # let location_id = "location_id";
7677    /// # let volume_id = "volume_id";
7678    /// # let quota_rule_id = "quota_rule_id";
7679    /// let x = DeleteQuotaRuleRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/quotaRules/{quota_rule_id}"));
7680    /// ```
7681    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7682        self.name = v.into();
7683        self
7684    }
7685}
7686
7687impl wkt::message::Message for DeleteQuotaRuleRequest {
7688    fn typename() -> &'static str {
7689        "type.googleapis.com/google.cloud.netapp.v1.DeleteQuotaRuleRequest"
7690    }
7691}
7692
7693/// QuotaRule specifies the maximum disk space a user or group can use within a
7694/// volume. They can be used for creating default and individual quota rules.
7695#[derive(Clone, Default, PartialEq)]
7696#[non_exhaustive]
7697pub struct QuotaRule {
7698    /// Identifier. The resource name of the quota rule.
7699    /// Format:
7700    /// `projects/{project_number}/locations/{location_id}/volumes/volumes/{volume_id}/quotaRules/{quota_rule_id}`.
7701    pub name: std::string::String,
7702
7703    /// Optional. The quota rule applies to the specified user or group, identified
7704    /// by a Unix UID/GID, Windows SID, or null for default.
7705    pub target: std::string::String,
7706
7707    /// Required. The type of quota rule.
7708    pub r#type: crate::model::quota_rule::Type,
7709
7710    /// Required. The maximum allowed disk space in MiB.
7711    pub disk_limit_mib: i32,
7712
7713    /// Output only. State of the quota rule
7714    pub state: crate::model::quota_rule::State,
7715
7716    /// Output only. State details of the quota rule
7717    pub state_details: std::string::String,
7718
7719    /// Output only. Create time of the quota rule
7720    pub create_time: std::option::Option<wkt::Timestamp>,
7721
7722    /// Optional. Description of the quota rule
7723    pub description: std::string::String,
7724
7725    /// Optional. Labels of the quota rule
7726    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7727
7728    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7729}
7730
7731impl QuotaRule {
7732    /// Creates a new default instance.
7733    pub fn new() -> Self {
7734        std::default::Default::default()
7735    }
7736
7737    /// Sets the value of [name][crate::model::QuotaRule::name].
7738    ///
7739    /// # Example
7740    /// ```ignore,no_run
7741    /// # use google_cloud_netapp_v1::model::QuotaRule;
7742    /// # let project_id = "project_id";
7743    /// # let location_id = "location_id";
7744    /// # let volume_id = "volume_id";
7745    /// # let quota_rule_id = "quota_rule_id";
7746    /// let x = QuotaRule::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/quotaRules/{quota_rule_id}"));
7747    /// ```
7748    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7749        self.name = v.into();
7750        self
7751    }
7752
7753    /// Sets the value of [target][crate::model::QuotaRule::target].
7754    ///
7755    /// # Example
7756    /// ```ignore,no_run
7757    /// # use google_cloud_netapp_v1::model::QuotaRule;
7758    /// let x = QuotaRule::new().set_target("example");
7759    /// ```
7760    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7761        self.target = v.into();
7762        self
7763    }
7764
7765    /// Sets the value of [r#type][crate::model::QuotaRule::type].
7766    ///
7767    /// # Example
7768    /// ```ignore,no_run
7769    /// # use google_cloud_netapp_v1::model::QuotaRule;
7770    /// use google_cloud_netapp_v1::model::quota_rule::Type;
7771    /// let x0 = QuotaRule::new().set_type(Type::IndividualUserQuota);
7772    /// let x1 = QuotaRule::new().set_type(Type::IndividualGroupQuota);
7773    /// let x2 = QuotaRule::new().set_type(Type::DefaultUserQuota);
7774    /// ```
7775    pub fn set_type<T: std::convert::Into<crate::model::quota_rule::Type>>(mut self, v: T) -> Self {
7776        self.r#type = v.into();
7777        self
7778    }
7779
7780    /// Sets the value of [disk_limit_mib][crate::model::QuotaRule::disk_limit_mib].
7781    ///
7782    /// # Example
7783    /// ```ignore,no_run
7784    /// # use google_cloud_netapp_v1::model::QuotaRule;
7785    /// let x = QuotaRule::new().set_disk_limit_mib(42);
7786    /// ```
7787    pub fn set_disk_limit_mib<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7788        self.disk_limit_mib = v.into();
7789        self
7790    }
7791
7792    /// Sets the value of [state][crate::model::QuotaRule::state].
7793    ///
7794    /// # Example
7795    /// ```ignore,no_run
7796    /// # use google_cloud_netapp_v1::model::QuotaRule;
7797    /// use google_cloud_netapp_v1::model::quota_rule::State;
7798    /// let x0 = QuotaRule::new().set_state(State::Creating);
7799    /// let x1 = QuotaRule::new().set_state(State::Updating);
7800    /// let x2 = QuotaRule::new().set_state(State::Deleting);
7801    /// ```
7802    pub fn set_state<T: std::convert::Into<crate::model::quota_rule::State>>(
7803        mut self,
7804        v: T,
7805    ) -> Self {
7806        self.state = v.into();
7807        self
7808    }
7809
7810    /// Sets the value of [state_details][crate::model::QuotaRule::state_details].
7811    ///
7812    /// # Example
7813    /// ```ignore,no_run
7814    /// # use google_cloud_netapp_v1::model::QuotaRule;
7815    /// let x = QuotaRule::new().set_state_details("example");
7816    /// ```
7817    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7818        self.state_details = v.into();
7819        self
7820    }
7821
7822    /// Sets the value of [create_time][crate::model::QuotaRule::create_time].
7823    ///
7824    /// # Example
7825    /// ```ignore,no_run
7826    /// # use google_cloud_netapp_v1::model::QuotaRule;
7827    /// use wkt::Timestamp;
7828    /// let x = QuotaRule::new().set_create_time(Timestamp::default()/* use setters */);
7829    /// ```
7830    pub fn set_create_time<T>(mut self, v: T) -> Self
7831    where
7832        T: std::convert::Into<wkt::Timestamp>,
7833    {
7834        self.create_time = std::option::Option::Some(v.into());
7835        self
7836    }
7837
7838    /// Sets or clears the value of [create_time][crate::model::QuotaRule::create_time].
7839    ///
7840    /// # Example
7841    /// ```ignore,no_run
7842    /// # use google_cloud_netapp_v1::model::QuotaRule;
7843    /// use wkt::Timestamp;
7844    /// let x = QuotaRule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7845    /// let x = QuotaRule::new().set_or_clear_create_time(None::<Timestamp>);
7846    /// ```
7847    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7848    where
7849        T: std::convert::Into<wkt::Timestamp>,
7850    {
7851        self.create_time = v.map(|x| x.into());
7852        self
7853    }
7854
7855    /// Sets the value of [description][crate::model::QuotaRule::description].
7856    ///
7857    /// # Example
7858    /// ```ignore,no_run
7859    /// # use google_cloud_netapp_v1::model::QuotaRule;
7860    /// let x = QuotaRule::new().set_description("example");
7861    /// ```
7862    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7863        self.description = v.into();
7864        self
7865    }
7866
7867    /// Sets the value of [labels][crate::model::QuotaRule::labels].
7868    ///
7869    /// # Example
7870    /// ```ignore,no_run
7871    /// # use google_cloud_netapp_v1::model::QuotaRule;
7872    /// let x = QuotaRule::new().set_labels([
7873    ///     ("key0", "abc"),
7874    ///     ("key1", "xyz"),
7875    /// ]);
7876    /// ```
7877    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7878    where
7879        T: std::iter::IntoIterator<Item = (K, V)>,
7880        K: std::convert::Into<std::string::String>,
7881        V: std::convert::Into<std::string::String>,
7882    {
7883        use std::iter::Iterator;
7884        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7885        self
7886    }
7887}
7888
7889impl wkt::message::Message for QuotaRule {
7890    fn typename() -> &'static str {
7891        "type.googleapis.com/google.cloud.netapp.v1.QuotaRule"
7892    }
7893}
7894
7895/// Defines additional types related to [QuotaRule].
7896pub mod quota_rule {
7897    #[allow(unused_imports)]
7898    use super::*;
7899
7900    /// Types of Quota Rule
7901    ///
7902    /// # Working with unknown values
7903    ///
7904    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7905    /// additional enum variants at any time. Adding new variants is not considered
7906    /// a breaking change. Applications should write their code in anticipation of:
7907    ///
7908    /// - New values appearing in future releases of the client library, **and**
7909    /// - New values received dynamically, without application changes.
7910    ///
7911    /// Please consult the [Working with enums] section in the user guide for some
7912    /// guidelines.
7913    ///
7914    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
7915    #[derive(Clone, Debug, PartialEq)]
7916    #[non_exhaustive]
7917    pub enum Type {
7918        /// Unspecified type for quota rule
7919        Unspecified,
7920        /// Individual user quota rule
7921        IndividualUserQuota,
7922        /// Individual group quota rule
7923        IndividualGroupQuota,
7924        /// Default user quota rule
7925        DefaultUserQuota,
7926        /// Default group quota rule
7927        DefaultGroupQuota,
7928        /// If set, the enum was initialized with an unknown value.
7929        ///
7930        /// Applications can examine the value using [Type::value] or
7931        /// [Type::name].
7932        UnknownValue(r#type::UnknownValue),
7933    }
7934
7935    #[doc(hidden)]
7936    pub mod r#type {
7937        #[allow(unused_imports)]
7938        use super::*;
7939        #[derive(Clone, Debug, PartialEq)]
7940        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7941    }
7942
7943    impl Type {
7944        /// Gets the enum value.
7945        ///
7946        /// Returns `None` if the enum contains an unknown value deserialized from
7947        /// the string representation of enums.
7948        pub fn value(&self) -> std::option::Option<i32> {
7949            match self {
7950                Self::Unspecified => std::option::Option::Some(0),
7951                Self::IndividualUserQuota => std::option::Option::Some(1),
7952                Self::IndividualGroupQuota => std::option::Option::Some(2),
7953                Self::DefaultUserQuota => std::option::Option::Some(3),
7954                Self::DefaultGroupQuota => std::option::Option::Some(4),
7955                Self::UnknownValue(u) => u.0.value(),
7956            }
7957        }
7958
7959        /// Gets the enum value as a string.
7960        ///
7961        /// Returns `None` if the enum contains an unknown value deserialized from
7962        /// the integer representation of enums.
7963        pub fn name(&self) -> std::option::Option<&str> {
7964            match self {
7965                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
7966                Self::IndividualUserQuota => std::option::Option::Some("INDIVIDUAL_USER_QUOTA"),
7967                Self::IndividualGroupQuota => std::option::Option::Some("INDIVIDUAL_GROUP_QUOTA"),
7968                Self::DefaultUserQuota => std::option::Option::Some("DEFAULT_USER_QUOTA"),
7969                Self::DefaultGroupQuota => std::option::Option::Some("DEFAULT_GROUP_QUOTA"),
7970                Self::UnknownValue(u) => u.0.name(),
7971            }
7972        }
7973    }
7974
7975    impl std::default::Default for Type {
7976        fn default() -> Self {
7977            use std::convert::From;
7978            Self::from(0)
7979        }
7980    }
7981
7982    impl std::fmt::Display for Type {
7983        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7984            wkt::internal::display_enum(f, self.name(), self.value())
7985        }
7986    }
7987
7988    impl std::convert::From<i32> for Type {
7989        fn from(value: i32) -> Self {
7990            match value {
7991                0 => Self::Unspecified,
7992                1 => Self::IndividualUserQuota,
7993                2 => Self::IndividualGroupQuota,
7994                3 => Self::DefaultUserQuota,
7995                4 => Self::DefaultGroupQuota,
7996                _ => Self::UnknownValue(r#type::UnknownValue(
7997                    wkt::internal::UnknownEnumValue::Integer(value),
7998                )),
7999            }
8000        }
8001    }
8002
8003    impl std::convert::From<&str> for Type {
8004        fn from(value: &str) -> Self {
8005            use std::string::ToString;
8006            match value {
8007                "TYPE_UNSPECIFIED" => Self::Unspecified,
8008                "INDIVIDUAL_USER_QUOTA" => Self::IndividualUserQuota,
8009                "INDIVIDUAL_GROUP_QUOTA" => Self::IndividualGroupQuota,
8010                "DEFAULT_USER_QUOTA" => Self::DefaultUserQuota,
8011                "DEFAULT_GROUP_QUOTA" => Self::DefaultGroupQuota,
8012                _ => Self::UnknownValue(r#type::UnknownValue(
8013                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8014                )),
8015            }
8016        }
8017    }
8018
8019    impl serde::ser::Serialize for Type {
8020        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8021        where
8022            S: serde::Serializer,
8023        {
8024            match self {
8025                Self::Unspecified => serializer.serialize_i32(0),
8026                Self::IndividualUserQuota => serializer.serialize_i32(1),
8027                Self::IndividualGroupQuota => serializer.serialize_i32(2),
8028                Self::DefaultUserQuota => serializer.serialize_i32(3),
8029                Self::DefaultGroupQuota => serializer.serialize_i32(4),
8030                Self::UnknownValue(u) => u.0.serialize(serializer),
8031            }
8032        }
8033    }
8034
8035    impl<'de> serde::de::Deserialize<'de> for Type {
8036        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8037        where
8038            D: serde::Deserializer<'de>,
8039        {
8040            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
8041                ".google.cloud.netapp.v1.QuotaRule.Type",
8042            ))
8043        }
8044    }
8045
8046    /// Quota Rule states
8047    ///
8048    /// # Working with unknown values
8049    ///
8050    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8051    /// additional enum variants at any time. Adding new variants is not considered
8052    /// a breaking change. Applications should write their code in anticipation of:
8053    ///
8054    /// - New values appearing in future releases of the client library, **and**
8055    /// - New values received dynamically, without application changes.
8056    ///
8057    /// Please consult the [Working with enums] section in the user guide for some
8058    /// guidelines.
8059    ///
8060    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
8061    #[derive(Clone, Debug, PartialEq)]
8062    #[non_exhaustive]
8063    pub enum State {
8064        /// Unspecified state for quota rule
8065        Unspecified,
8066        /// Quota rule is creating
8067        Creating,
8068        /// Quota rule is updating
8069        Updating,
8070        /// Quota rule is deleting
8071        Deleting,
8072        /// Quota rule is ready
8073        Ready,
8074        /// Quota rule is in error state.
8075        Error,
8076        /// If set, the enum was initialized with an unknown value.
8077        ///
8078        /// Applications can examine the value using [State::value] or
8079        /// [State::name].
8080        UnknownValue(state::UnknownValue),
8081    }
8082
8083    #[doc(hidden)]
8084    pub mod state {
8085        #[allow(unused_imports)]
8086        use super::*;
8087        #[derive(Clone, Debug, PartialEq)]
8088        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8089    }
8090
8091    impl State {
8092        /// Gets the enum value.
8093        ///
8094        /// Returns `None` if the enum contains an unknown value deserialized from
8095        /// the string representation of enums.
8096        pub fn value(&self) -> std::option::Option<i32> {
8097            match self {
8098                Self::Unspecified => std::option::Option::Some(0),
8099                Self::Creating => std::option::Option::Some(1),
8100                Self::Updating => std::option::Option::Some(2),
8101                Self::Deleting => std::option::Option::Some(3),
8102                Self::Ready => std::option::Option::Some(4),
8103                Self::Error => std::option::Option::Some(5),
8104                Self::UnknownValue(u) => u.0.value(),
8105            }
8106        }
8107
8108        /// Gets the enum value as a string.
8109        ///
8110        /// Returns `None` if the enum contains an unknown value deserialized from
8111        /// the integer representation of enums.
8112        pub fn name(&self) -> std::option::Option<&str> {
8113            match self {
8114                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8115                Self::Creating => std::option::Option::Some("CREATING"),
8116                Self::Updating => std::option::Option::Some("UPDATING"),
8117                Self::Deleting => std::option::Option::Some("DELETING"),
8118                Self::Ready => std::option::Option::Some("READY"),
8119                Self::Error => std::option::Option::Some("ERROR"),
8120                Self::UnknownValue(u) => u.0.name(),
8121            }
8122        }
8123    }
8124
8125    impl std::default::Default for State {
8126        fn default() -> Self {
8127            use std::convert::From;
8128            Self::from(0)
8129        }
8130    }
8131
8132    impl std::fmt::Display for State {
8133        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8134            wkt::internal::display_enum(f, self.name(), self.value())
8135        }
8136    }
8137
8138    impl std::convert::From<i32> for State {
8139        fn from(value: i32) -> Self {
8140            match value {
8141                0 => Self::Unspecified,
8142                1 => Self::Creating,
8143                2 => Self::Updating,
8144                3 => Self::Deleting,
8145                4 => Self::Ready,
8146                5 => Self::Error,
8147                _ => Self::UnknownValue(state::UnknownValue(
8148                    wkt::internal::UnknownEnumValue::Integer(value),
8149                )),
8150            }
8151        }
8152    }
8153
8154    impl std::convert::From<&str> for State {
8155        fn from(value: &str) -> Self {
8156            use std::string::ToString;
8157            match value {
8158                "STATE_UNSPECIFIED" => Self::Unspecified,
8159                "CREATING" => Self::Creating,
8160                "UPDATING" => Self::Updating,
8161                "DELETING" => Self::Deleting,
8162                "READY" => Self::Ready,
8163                "ERROR" => Self::Error,
8164                _ => Self::UnknownValue(state::UnknownValue(
8165                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8166                )),
8167            }
8168        }
8169    }
8170
8171    impl serde::ser::Serialize for State {
8172        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8173        where
8174            S: serde::Serializer,
8175        {
8176            match self {
8177                Self::Unspecified => serializer.serialize_i32(0),
8178                Self::Creating => serializer.serialize_i32(1),
8179                Self::Updating => serializer.serialize_i32(2),
8180                Self::Deleting => serializer.serialize_i32(3),
8181                Self::Ready => serializer.serialize_i32(4),
8182                Self::Error => serializer.serialize_i32(5),
8183                Self::UnknownValue(u) => u.0.serialize(serializer),
8184            }
8185        }
8186    }
8187
8188    impl<'de> serde::de::Deserialize<'de> for State {
8189        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8190        where
8191            D: serde::Deserializer<'de>,
8192        {
8193            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8194                ".google.cloud.netapp.v1.QuotaRule.State",
8195            ))
8196        }
8197    }
8198}
8199
8200/// TransferStats reports all statistics related to replication transfer.
8201#[derive(Clone, Default, PartialEq)]
8202#[non_exhaustive]
8203pub struct TransferStats {
8204    /// Cumulative bytes transferred so far for the replication relationship.
8205    pub transfer_bytes: std::option::Option<i64>,
8206
8207    /// Cumulative time taken across all transfers for the replication
8208    /// relationship.
8209    pub total_transfer_duration: std::option::Option<wkt::Duration>,
8210
8211    /// Last transfer size in bytes.
8212    pub last_transfer_bytes: std::option::Option<i64>,
8213
8214    /// Time taken during last transfer.
8215    pub last_transfer_duration: std::option::Option<wkt::Duration>,
8216
8217    /// Lag duration indicates the duration by which Destination region volume
8218    /// content lags behind the primary region volume content.
8219    pub lag_duration: std::option::Option<wkt::Duration>,
8220
8221    /// Time when progress was updated last.
8222    pub update_time: std::option::Option<wkt::Timestamp>,
8223
8224    /// Time when last transfer completed.
8225    pub last_transfer_end_time: std::option::Option<wkt::Timestamp>,
8226
8227    /// A message describing the cause of the last transfer failure.
8228    pub last_transfer_error: std::option::Option<std::string::String>,
8229
8230    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8231}
8232
8233impl TransferStats {
8234    /// Creates a new default instance.
8235    pub fn new() -> Self {
8236        std::default::Default::default()
8237    }
8238
8239    /// Sets the value of [transfer_bytes][crate::model::TransferStats::transfer_bytes].
8240    ///
8241    /// # Example
8242    /// ```ignore,no_run
8243    /// # use google_cloud_netapp_v1::model::TransferStats;
8244    /// let x = TransferStats::new().set_transfer_bytes(42);
8245    /// ```
8246    pub fn set_transfer_bytes<T>(mut self, v: T) -> Self
8247    where
8248        T: std::convert::Into<i64>,
8249    {
8250        self.transfer_bytes = std::option::Option::Some(v.into());
8251        self
8252    }
8253
8254    /// Sets or clears the value of [transfer_bytes][crate::model::TransferStats::transfer_bytes].
8255    ///
8256    /// # Example
8257    /// ```ignore,no_run
8258    /// # use google_cloud_netapp_v1::model::TransferStats;
8259    /// let x = TransferStats::new().set_or_clear_transfer_bytes(Some(42));
8260    /// let x = TransferStats::new().set_or_clear_transfer_bytes(None::<i32>);
8261    /// ```
8262    pub fn set_or_clear_transfer_bytes<T>(mut self, v: std::option::Option<T>) -> Self
8263    where
8264        T: std::convert::Into<i64>,
8265    {
8266        self.transfer_bytes = v.map(|x| x.into());
8267        self
8268    }
8269
8270    /// Sets the value of [total_transfer_duration][crate::model::TransferStats::total_transfer_duration].
8271    ///
8272    /// # Example
8273    /// ```ignore,no_run
8274    /// # use google_cloud_netapp_v1::model::TransferStats;
8275    /// use wkt::Duration;
8276    /// let x = TransferStats::new().set_total_transfer_duration(Duration::default()/* use setters */);
8277    /// ```
8278    pub fn set_total_transfer_duration<T>(mut self, v: T) -> Self
8279    where
8280        T: std::convert::Into<wkt::Duration>,
8281    {
8282        self.total_transfer_duration = std::option::Option::Some(v.into());
8283        self
8284    }
8285
8286    /// Sets or clears the value of [total_transfer_duration][crate::model::TransferStats::total_transfer_duration].
8287    ///
8288    /// # Example
8289    /// ```ignore,no_run
8290    /// # use google_cloud_netapp_v1::model::TransferStats;
8291    /// use wkt::Duration;
8292    /// let x = TransferStats::new().set_or_clear_total_transfer_duration(Some(Duration::default()/* use setters */));
8293    /// let x = TransferStats::new().set_or_clear_total_transfer_duration(None::<Duration>);
8294    /// ```
8295    pub fn set_or_clear_total_transfer_duration<T>(mut self, v: std::option::Option<T>) -> Self
8296    where
8297        T: std::convert::Into<wkt::Duration>,
8298    {
8299        self.total_transfer_duration = v.map(|x| x.into());
8300        self
8301    }
8302
8303    /// Sets the value of [last_transfer_bytes][crate::model::TransferStats::last_transfer_bytes].
8304    ///
8305    /// # Example
8306    /// ```ignore,no_run
8307    /// # use google_cloud_netapp_v1::model::TransferStats;
8308    /// let x = TransferStats::new().set_last_transfer_bytes(42);
8309    /// ```
8310    pub fn set_last_transfer_bytes<T>(mut self, v: T) -> Self
8311    where
8312        T: std::convert::Into<i64>,
8313    {
8314        self.last_transfer_bytes = std::option::Option::Some(v.into());
8315        self
8316    }
8317
8318    /// Sets or clears the value of [last_transfer_bytes][crate::model::TransferStats::last_transfer_bytes].
8319    ///
8320    /// # Example
8321    /// ```ignore,no_run
8322    /// # use google_cloud_netapp_v1::model::TransferStats;
8323    /// let x = TransferStats::new().set_or_clear_last_transfer_bytes(Some(42));
8324    /// let x = TransferStats::new().set_or_clear_last_transfer_bytes(None::<i32>);
8325    /// ```
8326    pub fn set_or_clear_last_transfer_bytes<T>(mut self, v: std::option::Option<T>) -> Self
8327    where
8328        T: std::convert::Into<i64>,
8329    {
8330        self.last_transfer_bytes = v.map(|x| x.into());
8331        self
8332    }
8333
8334    /// Sets the value of [last_transfer_duration][crate::model::TransferStats::last_transfer_duration].
8335    ///
8336    /// # Example
8337    /// ```ignore,no_run
8338    /// # use google_cloud_netapp_v1::model::TransferStats;
8339    /// use wkt::Duration;
8340    /// let x = TransferStats::new().set_last_transfer_duration(Duration::default()/* use setters */);
8341    /// ```
8342    pub fn set_last_transfer_duration<T>(mut self, v: T) -> Self
8343    where
8344        T: std::convert::Into<wkt::Duration>,
8345    {
8346        self.last_transfer_duration = std::option::Option::Some(v.into());
8347        self
8348    }
8349
8350    /// Sets or clears the value of [last_transfer_duration][crate::model::TransferStats::last_transfer_duration].
8351    ///
8352    /// # Example
8353    /// ```ignore,no_run
8354    /// # use google_cloud_netapp_v1::model::TransferStats;
8355    /// use wkt::Duration;
8356    /// let x = TransferStats::new().set_or_clear_last_transfer_duration(Some(Duration::default()/* use setters */));
8357    /// let x = TransferStats::new().set_or_clear_last_transfer_duration(None::<Duration>);
8358    /// ```
8359    pub fn set_or_clear_last_transfer_duration<T>(mut self, v: std::option::Option<T>) -> Self
8360    where
8361        T: std::convert::Into<wkt::Duration>,
8362    {
8363        self.last_transfer_duration = v.map(|x| x.into());
8364        self
8365    }
8366
8367    /// Sets the value of [lag_duration][crate::model::TransferStats::lag_duration].
8368    ///
8369    /// # Example
8370    /// ```ignore,no_run
8371    /// # use google_cloud_netapp_v1::model::TransferStats;
8372    /// use wkt::Duration;
8373    /// let x = TransferStats::new().set_lag_duration(Duration::default()/* use setters */);
8374    /// ```
8375    pub fn set_lag_duration<T>(mut self, v: T) -> Self
8376    where
8377        T: std::convert::Into<wkt::Duration>,
8378    {
8379        self.lag_duration = std::option::Option::Some(v.into());
8380        self
8381    }
8382
8383    /// Sets or clears the value of [lag_duration][crate::model::TransferStats::lag_duration].
8384    ///
8385    /// # Example
8386    /// ```ignore,no_run
8387    /// # use google_cloud_netapp_v1::model::TransferStats;
8388    /// use wkt::Duration;
8389    /// let x = TransferStats::new().set_or_clear_lag_duration(Some(Duration::default()/* use setters */));
8390    /// let x = TransferStats::new().set_or_clear_lag_duration(None::<Duration>);
8391    /// ```
8392    pub fn set_or_clear_lag_duration<T>(mut self, v: std::option::Option<T>) -> Self
8393    where
8394        T: std::convert::Into<wkt::Duration>,
8395    {
8396        self.lag_duration = v.map(|x| x.into());
8397        self
8398    }
8399
8400    /// Sets the value of [update_time][crate::model::TransferStats::update_time].
8401    ///
8402    /// # Example
8403    /// ```ignore,no_run
8404    /// # use google_cloud_netapp_v1::model::TransferStats;
8405    /// use wkt::Timestamp;
8406    /// let x = TransferStats::new().set_update_time(Timestamp::default()/* use setters */);
8407    /// ```
8408    pub fn set_update_time<T>(mut self, v: T) -> Self
8409    where
8410        T: std::convert::Into<wkt::Timestamp>,
8411    {
8412        self.update_time = std::option::Option::Some(v.into());
8413        self
8414    }
8415
8416    /// Sets or clears the value of [update_time][crate::model::TransferStats::update_time].
8417    ///
8418    /// # Example
8419    /// ```ignore,no_run
8420    /// # use google_cloud_netapp_v1::model::TransferStats;
8421    /// use wkt::Timestamp;
8422    /// let x = TransferStats::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
8423    /// let x = TransferStats::new().set_or_clear_update_time(None::<Timestamp>);
8424    /// ```
8425    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
8426    where
8427        T: std::convert::Into<wkt::Timestamp>,
8428    {
8429        self.update_time = v.map(|x| x.into());
8430        self
8431    }
8432
8433    /// Sets the value of [last_transfer_end_time][crate::model::TransferStats::last_transfer_end_time].
8434    ///
8435    /// # Example
8436    /// ```ignore,no_run
8437    /// # use google_cloud_netapp_v1::model::TransferStats;
8438    /// use wkt::Timestamp;
8439    /// let x = TransferStats::new().set_last_transfer_end_time(Timestamp::default()/* use setters */);
8440    /// ```
8441    pub fn set_last_transfer_end_time<T>(mut self, v: T) -> Self
8442    where
8443        T: std::convert::Into<wkt::Timestamp>,
8444    {
8445        self.last_transfer_end_time = std::option::Option::Some(v.into());
8446        self
8447    }
8448
8449    /// Sets or clears the value of [last_transfer_end_time][crate::model::TransferStats::last_transfer_end_time].
8450    ///
8451    /// # Example
8452    /// ```ignore,no_run
8453    /// # use google_cloud_netapp_v1::model::TransferStats;
8454    /// use wkt::Timestamp;
8455    /// let x = TransferStats::new().set_or_clear_last_transfer_end_time(Some(Timestamp::default()/* use setters */));
8456    /// let x = TransferStats::new().set_or_clear_last_transfer_end_time(None::<Timestamp>);
8457    /// ```
8458    pub fn set_or_clear_last_transfer_end_time<T>(mut self, v: std::option::Option<T>) -> Self
8459    where
8460        T: std::convert::Into<wkt::Timestamp>,
8461    {
8462        self.last_transfer_end_time = v.map(|x| x.into());
8463        self
8464    }
8465
8466    /// Sets the value of [last_transfer_error][crate::model::TransferStats::last_transfer_error].
8467    ///
8468    /// # Example
8469    /// ```ignore,no_run
8470    /// # use google_cloud_netapp_v1::model::TransferStats;
8471    /// let x = TransferStats::new().set_last_transfer_error("example");
8472    /// ```
8473    pub fn set_last_transfer_error<T>(mut self, v: T) -> Self
8474    where
8475        T: std::convert::Into<std::string::String>,
8476    {
8477        self.last_transfer_error = std::option::Option::Some(v.into());
8478        self
8479    }
8480
8481    /// Sets or clears the value of [last_transfer_error][crate::model::TransferStats::last_transfer_error].
8482    ///
8483    /// # Example
8484    /// ```ignore,no_run
8485    /// # use google_cloud_netapp_v1::model::TransferStats;
8486    /// let x = TransferStats::new().set_or_clear_last_transfer_error(Some("example"));
8487    /// let x = TransferStats::new().set_or_clear_last_transfer_error(None::<String>);
8488    /// ```
8489    pub fn set_or_clear_last_transfer_error<T>(mut self, v: std::option::Option<T>) -> Self
8490    where
8491        T: std::convert::Into<std::string::String>,
8492    {
8493        self.last_transfer_error = v.map(|x| x.into());
8494        self
8495    }
8496}
8497
8498impl wkt::message::Message for TransferStats {
8499    fn typename() -> &'static str {
8500        "type.googleapis.com/google.cloud.netapp.v1.TransferStats"
8501    }
8502}
8503
8504/// Replication is a nested resource under Volume, that describes a
8505/// cross-region replication relationship between 2 volumes in different
8506/// regions.
8507#[derive(Clone, Default, PartialEq)]
8508#[non_exhaustive]
8509pub struct Replication {
8510    /// Identifier. The resource name of the Replication.
8511    /// Format:
8512    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}`.
8513    pub name: std::string::String,
8514
8515    /// Output only. State of the replication.
8516    pub state: crate::model::replication::State,
8517
8518    /// Output only. State details of the replication.
8519    pub state_details: std::string::String,
8520
8521    /// Output only. Indicates whether this points to source or destination.
8522    pub role: crate::model::replication::ReplicationRole,
8523
8524    /// Required. Indicates the schedule for replication.
8525    pub replication_schedule: crate::model::replication::ReplicationSchedule,
8526
8527    /// Output only. Indicates the state of mirroring.
8528    pub mirror_state: crate::model::replication::MirrorState,
8529
8530    /// Output only. Condition of the relationship. Can be one of the following:
8531    ///
8532    /// - true: The replication relationship is healthy. It has not missed the most
8533    ///   recent scheduled transfer.
8534    /// - false: The replication relationship is not healthy. It has missed the
8535    ///   most recent scheduled transfer.
8536    pub healthy: std::option::Option<bool>,
8537
8538    /// Output only. Replication create time.
8539    pub create_time: std::option::Option<wkt::Timestamp>,
8540
8541    /// Output only. Full name of destination volume resource.
8542    /// Example : "projects/{project}/locations/{location}/volumes/{volume_id}"
8543    pub destination_volume: std::string::String,
8544
8545    /// Output only. Replication transfer statistics.
8546    pub transfer_stats: std::option::Option<crate::model::TransferStats>,
8547
8548    /// Resource labels to represent user provided metadata.
8549    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
8550
8551    /// A description about this replication relationship.
8552    pub description: std::option::Option<std::string::String>,
8553
8554    /// Required. Input only. Destination volume parameters
8555    pub destination_volume_parameters:
8556        std::option::Option<crate::model::DestinationVolumeParameters>,
8557
8558    /// Output only. Full name of source volume resource.
8559    /// Example : "projects/{project}/locations/{location}/volumes/{volume_id}"
8560    pub source_volume: std::string::String,
8561
8562    /// Output only. Hybrid peering details.
8563    pub hybrid_peering_details: std::option::Option<crate::model::HybridPeeringDetails>,
8564
8565    /// Optional. Location of the user cluster.
8566    pub cluster_location: std::string::String,
8567
8568    /// Output only. Type of the hybrid replication.
8569    pub hybrid_replication_type: crate::model::replication::HybridReplicationType,
8570
8571    /// Output only. Copy pastable snapmirror commands to be executed on onprem
8572    /// cluster by the customer.
8573    pub hybrid_replication_user_commands: std::option::Option<crate::model::UserCommands>,
8574
8575    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8576}
8577
8578impl Replication {
8579    /// Creates a new default instance.
8580    pub fn new() -> Self {
8581        std::default::Default::default()
8582    }
8583
8584    /// Sets the value of [name][crate::model::Replication::name].
8585    ///
8586    /// # Example
8587    /// ```ignore,no_run
8588    /// # use google_cloud_netapp_v1::model::Replication;
8589    /// # let project_id = "project_id";
8590    /// # let location_id = "location_id";
8591    /// # let volume_id = "volume_id";
8592    /// # let replication_id = "replication_id";
8593    /// let x = Replication::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/replications/{replication_id}"));
8594    /// ```
8595    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8596        self.name = v.into();
8597        self
8598    }
8599
8600    /// Sets the value of [state][crate::model::Replication::state].
8601    ///
8602    /// # Example
8603    /// ```ignore,no_run
8604    /// # use google_cloud_netapp_v1::model::Replication;
8605    /// use google_cloud_netapp_v1::model::replication::State;
8606    /// let x0 = Replication::new().set_state(State::Creating);
8607    /// let x1 = Replication::new().set_state(State::Ready);
8608    /// let x2 = Replication::new().set_state(State::Updating);
8609    /// ```
8610    pub fn set_state<T: std::convert::Into<crate::model::replication::State>>(
8611        mut self,
8612        v: T,
8613    ) -> Self {
8614        self.state = v.into();
8615        self
8616    }
8617
8618    /// Sets the value of [state_details][crate::model::Replication::state_details].
8619    ///
8620    /// # Example
8621    /// ```ignore,no_run
8622    /// # use google_cloud_netapp_v1::model::Replication;
8623    /// let x = Replication::new().set_state_details("example");
8624    /// ```
8625    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8626        self.state_details = v.into();
8627        self
8628    }
8629
8630    /// Sets the value of [role][crate::model::Replication::role].
8631    ///
8632    /// # Example
8633    /// ```ignore,no_run
8634    /// # use google_cloud_netapp_v1::model::Replication;
8635    /// use google_cloud_netapp_v1::model::replication::ReplicationRole;
8636    /// let x0 = Replication::new().set_role(ReplicationRole::Source);
8637    /// let x1 = Replication::new().set_role(ReplicationRole::Destination);
8638    /// ```
8639    pub fn set_role<T: std::convert::Into<crate::model::replication::ReplicationRole>>(
8640        mut self,
8641        v: T,
8642    ) -> Self {
8643        self.role = v.into();
8644        self
8645    }
8646
8647    /// Sets the value of [replication_schedule][crate::model::Replication::replication_schedule].
8648    ///
8649    /// # Example
8650    /// ```ignore,no_run
8651    /// # use google_cloud_netapp_v1::model::Replication;
8652    /// use google_cloud_netapp_v1::model::replication::ReplicationSchedule;
8653    /// let x0 = Replication::new().set_replication_schedule(ReplicationSchedule::Every10Minutes);
8654    /// let x1 = Replication::new().set_replication_schedule(ReplicationSchedule::Hourly);
8655    /// let x2 = Replication::new().set_replication_schedule(ReplicationSchedule::Daily);
8656    /// ```
8657    pub fn set_replication_schedule<
8658        T: std::convert::Into<crate::model::replication::ReplicationSchedule>,
8659    >(
8660        mut self,
8661        v: T,
8662    ) -> Self {
8663        self.replication_schedule = v.into();
8664        self
8665    }
8666
8667    /// Sets the value of [mirror_state][crate::model::Replication::mirror_state].
8668    ///
8669    /// # Example
8670    /// ```ignore,no_run
8671    /// # use google_cloud_netapp_v1::model::Replication;
8672    /// use google_cloud_netapp_v1::model::replication::MirrorState;
8673    /// let x0 = Replication::new().set_mirror_state(MirrorState::Preparing);
8674    /// let x1 = Replication::new().set_mirror_state(MirrorState::Mirrored);
8675    /// let x2 = Replication::new().set_mirror_state(MirrorState::Stopped);
8676    /// ```
8677    pub fn set_mirror_state<T: std::convert::Into<crate::model::replication::MirrorState>>(
8678        mut self,
8679        v: T,
8680    ) -> Self {
8681        self.mirror_state = v.into();
8682        self
8683    }
8684
8685    /// Sets the value of [healthy][crate::model::Replication::healthy].
8686    ///
8687    /// # Example
8688    /// ```ignore,no_run
8689    /// # use google_cloud_netapp_v1::model::Replication;
8690    /// let x = Replication::new().set_healthy(true);
8691    /// ```
8692    pub fn set_healthy<T>(mut self, v: T) -> Self
8693    where
8694        T: std::convert::Into<bool>,
8695    {
8696        self.healthy = std::option::Option::Some(v.into());
8697        self
8698    }
8699
8700    /// Sets or clears the value of [healthy][crate::model::Replication::healthy].
8701    ///
8702    /// # Example
8703    /// ```ignore,no_run
8704    /// # use google_cloud_netapp_v1::model::Replication;
8705    /// let x = Replication::new().set_or_clear_healthy(Some(false));
8706    /// let x = Replication::new().set_or_clear_healthy(None::<bool>);
8707    /// ```
8708    pub fn set_or_clear_healthy<T>(mut self, v: std::option::Option<T>) -> Self
8709    where
8710        T: std::convert::Into<bool>,
8711    {
8712        self.healthy = v.map(|x| x.into());
8713        self
8714    }
8715
8716    /// Sets the value of [create_time][crate::model::Replication::create_time].
8717    ///
8718    /// # Example
8719    /// ```ignore,no_run
8720    /// # use google_cloud_netapp_v1::model::Replication;
8721    /// use wkt::Timestamp;
8722    /// let x = Replication::new().set_create_time(Timestamp::default()/* use setters */);
8723    /// ```
8724    pub fn set_create_time<T>(mut self, v: T) -> Self
8725    where
8726        T: std::convert::Into<wkt::Timestamp>,
8727    {
8728        self.create_time = std::option::Option::Some(v.into());
8729        self
8730    }
8731
8732    /// Sets or clears the value of [create_time][crate::model::Replication::create_time].
8733    ///
8734    /// # Example
8735    /// ```ignore,no_run
8736    /// # use google_cloud_netapp_v1::model::Replication;
8737    /// use wkt::Timestamp;
8738    /// let x = Replication::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8739    /// let x = Replication::new().set_or_clear_create_time(None::<Timestamp>);
8740    /// ```
8741    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8742    where
8743        T: std::convert::Into<wkt::Timestamp>,
8744    {
8745        self.create_time = v.map(|x| x.into());
8746        self
8747    }
8748
8749    /// Sets the value of [destination_volume][crate::model::Replication::destination_volume].
8750    ///
8751    /// # Example
8752    /// ```ignore,no_run
8753    /// # use google_cloud_netapp_v1::model::Replication;
8754    /// # let project_id = "project_id";
8755    /// # let location_id = "location_id";
8756    /// # let volume_id = "volume_id";
8757    /// let x = Replication::new().set_destination_volume(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
8758    /// ```
8759    pub fn set_destination_volume<T: std::convert::Into<std::string::String>>(
8760        mut self,
8761        v: T,
8762    ) -> Self {
8763        self.destination_volume = v.into();
8764        self
8765    }
8766
8767    /// Sets the value of [transfer_stats][crate::model::Replication::transfer_stats].
8768    ///
8769    /// # Example
8770    /// ```ignore,no_run
8771    /// # use google_cloud_netapp_v1::model::Replication;
8772    /// use google_cloud_netapp_v1::model::TransferStats;
8773    /// let x = Replication::new().set_transfer_stats(TransferStats::default()/* use setters */);
8774    /// ```
8775    pub fn set_transfer_stats<T>(mut self, v: T) -> Self
8776    where
8777        T: std::convert::Into<crate::model::TransferStats>,
8778    {
8779        self.transfer_stats = std::option::Option::Some(v.into());
8780        self
8781    }
8782
8783    /// Sets or clears the value of [transfer_stats][crate::model::Replication::transfer_stats].
8784    ///
8785    /// # Example
8786    /// ```ignore,no_run
8787    /// # use google_cloud_netapp_v1::model::Replication;
8788    /// use google_cloud_netapp_v1::model::TransferStats;
8789    /// let x = Replication::new().set_or_clear_transfer_stats(Some(TransferStats::default()/* use setters */));
8790    /// let x = Replication::new().set_or_clear_transfer_stats(None::<TransferStats>);
8791    /// ```
8792    pub fn set_or_clear_transfer_stats<T>(mut self, v: std::option::Option<T>) -> Self
8793    where
8794        T: std::convert::Into<crate::model::TransferStats>,
8795    {
8796        self.transfer_stats = v.map(|x| x.into());
8797        self
8798    }
8799
8800    /// Sets the value of [labels][crate::model::Replication::labels].
8801    ///
8802    /// # Example
8803    /// ```ignore,no_run
8804    /// # use google_cloud_netapp_v1::model::Replication;
8805    /// let x = Replication::new().set_labels([
8806    ///     ("key0", "abc"),
8807    ///     ("key1", "xyz"),
8808    /// ]);
8809    /// ```
8810    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8811    where
8812        T: std::iter::IntoIterator<Item = (K, V)>,
8813        K: std::convert::Into<std::string::String>,
8814        V: std::convert::Into<std::string::String>,
8815    {
8816        use std::iter::Iterator;
8817        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8818        self
8819    }
8820
8821    /// Sets the value of [description][crate::model::Replication::description].
8822    ///
8823    /// # Example
8824    /// ```ignore,no_run
8825    /// # use google_cloud_netapp_v1::model::Replication;
8826    /// let x = Replication::new().set_description("example");
8827    /// ```
8828    pub fn set_description<T>(mut self, v: T) -> Self
8829    where
8830        T: std::convert::Into<std::string::String>,
8831    {
8832        self.description = std::option::Option::Some(v.into());
8833        self
8834    }
8835
8836    /// Sets or clears the value of [description][crate::model::Replication::description].
8837    ///
8838    /// # Example
8839    /// ```ignore,no_run
8840    /// # use google_cloud_netapp_v1::model::Replication;
8841    /// let x = Replication::new().set_or_clear_description(Some("example"));
8842    /// let x = Replication::new().set_or_clear_description(None::<String>);
8843    /// ```
8844    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
8845    where
8846        T: std::convert::Into<std::string::String>,
8847    {
8848        self.description = v.map(|x| x.into());
8849        self
8850    }
8851
8852    /// Sets the value of [destination_volume_parameters][crate::model::Replication::destination_volume_parameters].
8853    ///
8854    /// # Example
8855    /// ```ignore,no_run
8856    /// # use google_cloud_netapp_v1::model::Replication;
8857    /// use google_cloud_netapp_v1::model::DestinationVolumeParameters;
8858    /// let x = Replication::new().set_destination_volume_parameters(DestinationVolumeParameters::default()/* use setters */);
8859    /// ```
8860    pub fn set_destination_volume_parameters<T>(mut self, v: T) -> Self
8861    where
8862        T: std::convert::Into<crate::model::DestinationVolumeParameters>,
8863    {
8864        self.destination_volume_parameters = std::option::Option::Some(v.into());
8865        self
8866    }
8867
8868    /// Sets or clears the value of [destination_volume_parameters][crate::model::Replication::destination_volume_parameters].
8869    ///
8870    /// # Example
8871    /// ```ignore,no_run
8872    /// # use google_cloud_netapp_v1::model::Replication;
8873    /// use google_cloud_netapp_v1::model::DestinationVolumeParameters;
8874    /// let x = Replication::new().set_or_clear_destination_volume_parameters(Some(DestinationVolumeParameters::default()/* use setters */));
8875    /// let x = Replication::new().set_or_clear_destination_volume_parameters(None::<DestinationVolumeParameters>);
8876    /// ```
8877    pub fn set_or_clear_destination_volume_parameters<T>(
8878        mut self,
8879        v: std::option::Option<T>,
8880    ) -> Self
8881    where
8882        T: std::convert::Into<crate::model::DestinationVolumeParameters>,
8883    {
8884        self.destination_volume_parameters = v.map(|x| x.into());
8885        self
8886    }
8887
8888    /// Sets the value of [source_volume][crate::model::Replication::source_volume].
8889    ///
8890    /// # Example
8891    /// ```ignore,no_run
8892    /// # use google_cloud_netapp_v1::model::Replication;
8893    /// # let project_id = "project_id";
8894    /// # let location_id = "location_id";
8895    /// # let volume_id = "volume_id";
8896    /// let x = Replication::new().set_source_volume(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
8897    /// ```
8898    pub fn set_source_volume<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8899        self.source_volume = v.into();
8900        self
8901    }
8902
8903    /// Sets the value of [hybrid_peering_details][crate::model::Replication::hybrid_peering_details].
8904    ///
8905    /// # Example
8906    /// ```ignore,no_run
8907    /// # use google_cloud_netapp_v1::model::Replication;
8908    /// use google_cloud_netapp_v1::model::HybridPeeringDetails;
8909    /// let x = Replication::new().set_hybrid_peering_details(HybridPeeringDetails::default()/* use setters */);
8910    /// ```
8911    pub fn set_hybrid_peering_details<T>(mut self, v: T) -> Self
8912    where
8913        T: std::convert::Into<crate::model::HybridPeeringDetails>,
8914    {
8915        self.hybrid_peering_details = std::option::Option::Some(v.into());
8916        self
8917    }
8918
8919    /// Sets or clears the value of [hybrid_peering_details][crate::model::Replication::hybrid_peering_details].
8920    ///
8921    /// # Example
8922    /// ```ignore,no_run
8923    /// # use google_cloud_netapp_v1::model::Replication;
8924    /// use google_cloud_netapp_v1::model::HybridPeeringDetails;
8925    /// let x = Replication::new().set_or_clear_hybrid_peering_details(Some(HybridPeeringDetails::default()/* use setters */));
8926    /// let x = Replication::new().set_or_clear_hybrid_peering_details(None::<HybridPeeringDetails>);
8927    /// ```
8928    pub fn set_or_clear_hybrid_peering_details<T>(mut self, v: std::option::Option<T>) -> Self
8929    where
8930        T: std::convert::Into<crate::model::HybridPeeringDetails>,
8931    {
8932        self.hybrid_peering_details = v.map(|x| x.into());
8933        self
8934    }
8935
8936    /// Sets the value of [cluster_location][crate::model::Replication::cluster_location].
8937    ///
8938    /// # Example
8939    /// ```ignore,no_run
8940    /// # use google_cloud_netapp_v1::model::Replication;
8941    /// let x = Replication::new().set_cluster_location("example");
8942    /// ```
8943    pub fn set_cluster_location<T: std::convert::Into<std::string::String>>(
8944        mut self,
8945        v: T,
8946    ) -> Self {
8947        self.cluster_location = v.into();
8948        self
8949    }
8950
8951    /// Sets the value of [hybrid_replication_type][crate::model::Replication::hybrid_replication_type].
8952    ///
8953    /// # Example
8954    /// ```ignore,no_run
8955    /// # use google_cloud_netapp_v1::model::Replication;
8956    /// use google_cloud_netapp_v1::model::replication::HybridReplicationType;
8957    /// let x0 = Replication::new().set_hybrid_replication_type(HybridReplicationType::Migration);
8958    /// let x1 = Replication::new().set_hybrid_replication_type(HybridReplicationType::ContinuousReplication);
8959    /// let x2 = Replication::new().set_hybrid_replication_type(HybridReplicationType::OnpremReplication);
8960    /// ```
8961    pub fn set_hybrid_replication_type<
8962        T: std::convert::Into<crate::model::replication::HybridReplicationType>,
8963    >(
8964        mut self,
8965        v: T,
8966    ) -> Self {
8967        self.hybrid_replication_type = v.into();
8968        self
8969    }
8970
8971    /// Sets the value of [hybrid_replication_user_commands][crate::model::Replication::hybrid_replication_user_commands].
8972    ///
8973    /// # Example
8974    /// ```ignore,no_run
8975    /// # use google_cloud_netapp_v1::model::Replication;
8976    /// use google_cloud_netapp_v1::model::UserCommands;
8977    /// let x = Replication::new().set_hybrid_replication_user_commands(UserCommands::default()/* use setters */);
8978    /// ```
8979    pub fn set_hybrid_replication_user_commands<T>(mut self, v: T) -> Self
8980    where
8981        T: std::convert::Into<crate::model::UserCommands>,
8982    {
8983        self.hybrid_replication_user_commands = std::option::Option::Some(v.into());
8984        self
8985    }
8986
8987    /// Sets or clears the value of [hybrid_replication_user_commands][crate::model::Replication::hybrid_replication_user_commands].
8988    ///
8989    /// # Example
8990    /// ```ignore,no_run
8991    /// # use google_cloud_netapp_v1::model::Replication;
8992    /// use google_cloud_netapp_v1::model::UserCommands;
8993    /// let x = Replication::new().set_or_clear_hybrid_replication_user_commands(Some(UserCommands::default()/* use setters */));
8994    /// let x = Replication::new().set_or_clear_hybrid_replication_user_commands(None::<UserCommands>);
8995    /// ```
8996    pub fn set_or_clear_hybrid_replication_user_commands<T>(
8997        mut self,
8998        v: std::option::Option<T>,
8999    ) -> Self
9000    where
9001        T: std::convert::Into<crate::model::UserCommands>,
9002    {
9003        self.hybrid_replication_user_commands = v.map(|x| x.into());
9004        self
9005    }
9006}
9007
9008impl wkt::message::Message for Replication {
9009    fn typename() -> &'static str {
9010        "type.googleapis.com/google.cloud.netapp.v1.Replication"
9011    }
9012}
9013
9014/// Defines additional types related to [Replication].
9015pub mod replication {
9016    #[allow(unused_imports)]
9017    use super::*;
9018
9019    /// The replication states
9020    /// New enum values may be added in future to indicate possible new states.
9021    ///
9022    /// # Working with unknown values
9023    ///
9024    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9025    /// additional enum variants at any time. Adding new variants is not considered
9026    /// a breaking change. Applications should write their code in anticipation of:
9027    ///
9028    /// - New values appearing in future releases of the client library, **and**
9029    /// - New values received dynamically, without application changes.
9030    ///
9031    /// Please consult the [Working with enums] section in the user guide for some
9032    /// guidelines.
9033    ///
9034    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9035    #[derive(Clone, Debug, PartialEq)]
9036    #[non_exhaustive]
9037    pub enum State {
9038        /// Unspecified replication State
9039        Unspecified,
9040        /// Replication is creating.
9041        Creating,
9042        /// Replication is ready.
9043        Ready,
9044        /// Replication is updating.
9045        Updating,
9046        /// Replication is deleting.
9047        Deleting,
9048        /// Replication is in error state.
9049        Error,
9050        /// Replication is waiting for cluster peering to be established.
9051        PendingClusterPeering,
9052        /// Replication is waiting for SVM peering to be established.
9053        PendingSvmPeering,
9054        /// Replication is waiting for Commands to be executed on Onprem ONTAP.
9055        PendingRemoteResync,
9056        /// Onprem ONTAP is destination and Replication can only be managed from
9057        /// Onprem.
9058        ExternallyManagedReplication,
9059        /// If set, the enum was initialized with an unknown value.
9060        ///
9061        /// Applications can examine the value using [State::value] or
9062        /// [State::name].
9063        UnknownValue(state::UnknownValue),
9064    }
9065
9066    #[doc(hidden)]
9067    pub mod state {
9068        #[allow(unused_imports)]
9069        use super::*;
9070        #[derive(Clone, Debug, PartialEq)]
9071        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9072    }
9073
9074    impl State {
9075        /// Gets the enum value.
9076        ///
9077        /// Returns `None` if the enum contains an unknown value deserialized from
9078        /// the string representation of enums.
9079        pub fn value(&self) -> std::option::Option<i32> {
9080            match self {
9081                Self::Unspecified => std::option::Option::Some(0),
9082                Self::Creating => std::option::Option::Some(1),
9083                Self::Ready => std::option::Option::Some(2),
9084                Self::Updating => std::option::Option::Some(3),
9085                Self::Deleting => std::option::Option::Some(5),
9086                Self::Error => std::option::Option::Some(6),
9087                Self::PendingClusterPeering => std::option::Option::Some(8),
9088                Self::PendingSvmPeering => std::option::Option::Some(9),
9089                Self::PendingRemoteResync => std::option::Option::Some(10),
9090                Self::ExternallyManagedReplication => std::option::Option::Some(11),
9091                Self::UnknownValue(u) => u.0.value(),
9092            }
9093        }
9094
9095        /// Gets the enum value as a string.
9096        ///
9097        /// Returns `None` if the enum contains an unknown value deserialized from
9098        /// the integer representation of enums.
9099        pub fn name(&self) -> std::option::Option<&str> {
9100            match self {
9101                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9102                Self::Creating => std::option::Option::Some("CREATING"),
9103                Self::Ready => std::option::Option::Some("READY"),
9104                Self::Updating => std::option::Option::Some("UPDATING"),
9105                Self::Deleting => std::option::Option::Some("DELETING"),
9106                Self::Error => std::option::Option::Some("ERROR"),
9107                Self::PendingClusterPeering => std::option::Option::Some("PENDING_CLUSTER_PEERING"),
9108                Self::PendingSvmPeering => std::option::Option::Some("PENDING_SVM_PEERING"),
9109                Self::PendingRemoteResync => std::option::Option::Some("PENDING_REMOTE_RESYNC"),
9110                Self::ExternallyManagedReplication => {
9111                    std::option::Option::Some("EXTERNALLY_MANAGED_REPLICATION")
9112                }
9113                Self::UnknownValue(u) => u.0.name(),
9114            }
9115        }
9116    }
9117
9118    impl std::default::Default for State {
9119        fn default() -> Self {
9120            use std::convert::From;
9121            Self::from(0)
9122        }
9123    }
9124
9125    impl std::fmt::Display for State {
9126        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9127            wkt::internal::display_enum(f, self.name(), self.value())
9128        }
9129    }
9130
9131    impl std::convert::From<i32> for State {
9132        fn from(value: i32) -> Self {
9133            match value {
9134                0 => Self::Unspecified,
9135                1 => Self::Creating,
9136                2 => Self::Ready,
9137                3 => Self::Updating,
9138                5 => Self::Deleting,
9139                6 => Self::Error,
9140                8 => Self::PendingClusterPeering,
9141                9 => Self::PendingSvmPeering,
9142                10 => Self::PendingRemoteResync,
9143                11 => Self::ExternallyManagedReplication,
9144                _ => Self::UnknownValue(state::UnknownValue(
9145                    wkt::internal::UnknownEnumValue::Integer(value),
9146                )),
9147            }
9148        }
9149    }
9150
9151    impl std::convert::From<&str> for State {
9152        fn from(value: &str) -> Self {
9153            use std::string::ToString;
9154            match value {
9155                "STATE_UNSPECIFIED" => Self::Unspecified,
9156                "CREATING" => Self::Creating,
9157                "READY" => Self::Ready,
9158                "UPDATING" => Self::Updating,
9159                "DELETING" => Self::Deleting,
9160                "ERROR" => Self::Error,
9161                "PENDING_CLUSTER_PEERING" => Self::PendingClusterPeering,
9162                "PENDING_SVM_PEERING" => Self::PendingSvmPeering,
9163                "PENDING_REMOTE_RESYNC" => Self::PendingRemoteResync,
9164                "EXTERNALLY_MANAGED_REPLICATION" => Self::ExternallyManagedReplication,
9165                _ => Self::UnknownValue(state::UnknownValue(
9166                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9167                )),
9168            }
9169        }
9170    }
9171
9172    impl serde::ser::Serialize for State {
9173        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9174        where
9175            S: serde::Serializer,
9176        {
9177            match self {
9178                Self::Unspecified => serializer.serialize_i32(0),
9179                Self::Creating => serializer.serialize_i32(1),
9180                Self::Ready => serializer.serialize_i32(2),
9181                Self::Updating => serializer.serialize_i32(3),
9182                Self::Deleting => serializer.serialize_i32(5),
9183                Self::Error => serializer.serialize_i32(6),
9184                Self::PendingClusterPeering => serializer.serialize_i32(8),
9185                Self::PendingSvmPeering => serializer.serialize_i32(9),
9186                Self::PendingRemoteResync => serializer.serialize_i32(10),
9187                Self::ExternallyManagedReplication => serializer.serialize_i32(11),
9188                Self::UnknownValue(u) => u.0.serialize(serializer),
9189            }
9190        }
9191    }
9192
9193    impl<'de> serde::de::Deserialize<'de> for State {
9194        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9195        where
9196            D: serde::Deserializer<'de>,
9197        {
9198            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9199                ".google.cloud.netapp.v1.Replication.State",
9200            ))
9201        }
9202    }
9203
9204    /// New enum values may be added in future to support different replication
9205    /// topology.
9206    ///
9207    /// # Working with unknown values
9208    ///
9209    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9210    /// additional enum variants at any time. Adding new variants is not considered
9211    /// a breaking change. Applications should write their code in anticipation of:
9212    ///
9213    /// - New values appearing in future releases of the client library, **and**
9214    /// - New values received dynamically, without application changes.
9215    ///
9216    /// Please consult the [Working with enums] section in the user guide for some
9217    /// guidelines.
9218    ///
9219    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9220    #[derive(Clone, Debug, PartialEq)]
9221    #[non_exhaustive]
9222    pub enum ReplicationRole {
9223        /// Unspecified replication role
9224        Unspecified,
9225        /// Indicates Source volume.
9226        Source,
9227        /// Indicates Destination volume.
9228        Destination,
9229        /// If set, the enum was initialized with an unknown value.
9230        ///
9231        /// Applications can examine the value using [ReplicationRole::value] or
9232        /// [ReplicationRole::name].
9233        UnknownValue(replication_role::UnknownValue),
9234    }
9235
9236    #[doc(hidden)]
9237    pub mod replication_role {
9238        #[allow(unused_imports)]
9239        use super::*;
9240        #[derive(Clone, Debug, PartialEq)]
9241        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9242    }
9243
9244    impl ReplicationRole {
9245        /// Gets the enum value.
9246        ///
9247        /// Returns `None` if the enum contains an unknown value deserialized from
9248        /// the string representation of enums.
9249        pub fn value(&self) -> std::option::Option<i32> {
9250            match self {
9251                Self::Unspecified => std::option::Option::Some(0),
9252                Self::Source => std::option::Option::Some(1),
9253                Self::Destination => std::option::Option::Some(2),
9254                Self::UnknownValue(u) => u.0.value(),
9255            }
9256        }
9257
9258        /// Gets the enum value as a string.
9259        ///
9260        /// Returns `None` if the enum contains an unknown value deserialized from
9261        /// the integer representation of enums.
9262        pub fn name(&self) -> std::option::Option<&str> {
9263            match self {
9264                Self::Unspecified => std::option::Option::Some("REPLICATION_ROLE_UNSPECIFIED"),
9265                Self::Source => std::option::Option::Some("SOURCE"),
9266                Self::Destination => std::option::Option::Some("DESTINATION"),
9267                Self::UnknownValue(u) => u.0.name(),
9268            }
9269        }
9270    }
9271
9272    impl std::default::Default for ReplicationRole {
9273        fn default() -> Self {
9274            use std::convert::From;
9275            Self::from(0)
9276        }
9277    }
9278
9279    impl std::fmt::Display for ReplicationRole {
9280        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9281            wkt::internal::display_enum(f, self.name(), self.value())
9282        }
9283    }
9284
9285    impl std::convert::From<i32> for ReplicationRole {
9286        fn from(value: i32) -> Self {
9287            match value {
9288                0 => Self::Unspecified,
9289                1 => Self::Source,
9290                2 => Self::Destination,
9291                _ => Self::UnknownValue(replication_role::UnknownValue(
9292                    wkt::internal::UnknownEnumValue::Integer(value),
9293                )),
9294            }
9295        }
9296    }
9297
9298    impl std::convert::From<&str> for ReplicationRole {
9299        fn from(value: &str) -> Self {
9300            use std::string::ToString;
9301            match value {
9302                "REPLICATION_ROLE_UNSPECIFIED" => Self::Unspecified,
9303                "SOURCE" => Self::Source,
9304                "DESTINATION" => Self::Destination,
9305                _ => Self::UnknownValue(replication_role::UnknownValue(
9306                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9307                )),
9308            }
9309        }
9310    }
9311
9312    impl serde::ser::Serialize for ReplicationRole {
9313        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9314        where
9315            S: serde::Serializer,
9316        {
9317            match self {
9318                Self::Unspecified => serializer.serialize_i32(0),
9319                Self::Source => serializer.serialize_i32(1),
9320                Self::Destination => serializer.serialize_i32(2),
9321                Self::UnknownValue(u) => u.0.serialize(serializer),
9322            }
9323        }
9324    }
9325
9326    impl<'de> serde::de::Deserialize<'de> for ReplicationRole {
9327        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9328        where
9329            D: serde::Deserializer<'de>,
9330        {
9331            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicationRole>::new(
9332                ".google.cloud.netapp.v1.Replication.ReplicationRole",
9333            ))
9334        }
9335    }
9336
9337    /// Schedule for Replication.
9338    /// New enum values may be added in future to support different frequency of
9339    /// replication.
9340    ///
9341    /// # Working with unknown values
9342    ///
9343    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9344    /// additional enum variants at any time. Adding new variants is not considered
9345    /// a breaking change. Applications should write their code in anticipation of:
9346    ///
9347    /// - New values appearing in future releases of the client library, **and**
9348    /// - New values received dynamically, without application changes.
9349    ///
9350    /// Please consult the [Working with enums] section in the user guide for some
9351    /// guidelines.
9352    ///
9353    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9354    #[derive(Clone, Debug, PartialEq)]
9355    #[non_exhaustive]
9356    pub enum ReplicationSchedule {
9357        /// Unspecified ReplicationSchedule
9358        Unspecified,
9359        /// Replication happens once every 10 minutes.
9360        Every10Minutes,
9361        /// Replication happens once every hour.
9362        Hourly,
9363        /// Replication happens once every day.
9364        Daily,
9365        /// If set, the enum was initialized with an unknown value.
9366        ///
9367        /// Applications can examine the value using [ReplicationSchedule::value] or
9368        /// [ReplicationSchedule::name].
9369        UnknownValue(replication_schedule::UnknownValue),
9370    }
9371
9372    #[doc(hidden)]
9373    pub mod replication_schedule {
9374        #[allow(unused_imports)]
9375        use super::*;
9376        #[derive(Clone, Debug, PartialEq)]
9377        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9378    }
9379
9380    impl ReplicationSchedule {
9381        /// Gets the enum value.
9382        ///
9383        /// Returns `None` if the enum contains an unknown value deserialized from
9384        /// the string representation of enums.
9385        pub fn value(&self) -> std::option::Option<i32> {
9386            match self {
9387                Self::Unspecified => std::option::Option::Some(0),
9388                Self::Every10Minutes => std::option::Option::Some(1),
9389                Self::Hourly => std::option::Option::Some(2),
9390                Self::Daily => std::option::Option::Some(3),
9391                Self::UnknownValue(u) => u.0.value(),
9392            }
9393        }
9394
9395        /// Gets the enum value as a string.
9396        ///
9397        /// Returns `None` if the enum contains an unknown value deserialized from
9398        /// the integer representation of enums.
9399        pub fn name(&self) -> std::option::Option<&str> {
9400            match self {
9401                Self::Unspecified => std::option::Option::Some("REPLICATION_SCHEDULE_UNSPECIFIED"),
9402                Self::Every10Minutes => std::option::Option::Some("EVERY_10_MINUTES"),
9403                Self::Hourly => std::option::Option::Some("HOURLY"),
9404                Self::Daily => std::option::Option::Some("DAILY"),
9405                Self::UnknownValue(u) => u.0.name(),
9406            }
9407        }
9408    }
9409
9410    impl std::default::Default for ReplicationSchedule {
9411        fn default() -> Self {
9412            use std::convert::From;
9413            Self::from(0)
9414        }
9415    }
9416
9417    impl std::fmt::Display for ReplicationSchedule {
9418        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9419            wkt::internal::display_enum(f, self.name(), self.value())
9420        }
9421    }
9422
9423    impl std::convert::From<i32> for ReplicationSchedule {
9424        fn from(value: i32) -> Self {
9425            match value {
9426                0 => Self::Unspecified,
9427                1 => Self::Every10Minutes,
9428                2 => Self::Hourly,
9429                3 => Self::Daily,
9430                _ => Self::UnknownValue(replication_schedule::UnknownValue(
9431                    wkt::internal::UnknownEnumValue::Integer(value),
9432                )),
9433            }
9434        }
9435    }
9436
9437    impl std::convert::From<&str> for ReplicationSchedule {
9438        fn from(value: &str) -> Self {
9439            use std::string::ToString;
9440            match value {
9441                "REPLICATION_SCHEDULE_UNSPECIFIED" => Self::Unspecified,
9442                "EVERY_10_MINUTES" => Self::Every10Minutes,
9443                "HOURLY" => Self::Hourly,
9444                "DAILY" => Self::Daily,
9445                _ => Self::UnknownValue(replication_schedule::UnknownValue(
9446                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9447                )),
9448            }
9449        }
9450    }
9451
9452    impl serde::ser::Serialize for ReplicationSchedule {
9453        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9454        where
9455            S: serde::Serializer,
9456        {
9457            match self {
9458                Self::Unspecified => serializer.serialize_i32(0),
9459                Self::Every10Minutes => serializer.serialize_i32(1),
9460                Self::Hourly => serializer.serialize_i32(2),
9461                Self::Daily => serializer.serialize_i32(3),
9462                Self::UnknownValue(u) => u.0.serialize(serializer),
9463            }
9464        }
9465    }
9466
9467    impl<'de> serde::de::Deserialize<'de> for ReplicationSchedule {
9468        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9469        where
9470            D: serde::Deserializer<'de>,
9471        {
9472            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicationSchedule>::new(
9473                ".google.cloud.netapp.v1.Replication.ReplicationSchedule",
9474            ))
9475        }
9476    }
9477
9478    /// Mirroring states.
9479    /// No new value is expected to be added in future.
9480    ///
9481    /// # Working with unknown values
9482    ///
9483    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9484    /// additional enum variants at any time. Adding new variants is not considered
9485    /// a breaking change. Applications should write their code in anticipation of:
9486    ///
9487    /// - New values appearing in future releases of the client library, **and**
9488    /// - New values received dynamically, without application changes.
9489    ///
9490    /// Please consult the [Working with enums] section in the user guide for some
9491    /// guidelines.
9492    ///
9493    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9494    #[derive(Clone, Debug, PartialEq)]
9495    #[non_exhaustive]
9496    pub enum MirrorState {
9497        /// Unspecified MirrorState
9498        Unspecified,
9499        /// Destination volume is being prepared.
9500        Preparing,
9501        /// Destination volume has been initialized and is ready to receive
9502        /// replication transfers.
9503        Mirrored,
9504        /// Destination volume is not receiving replication transfers.
9505        Stopped,
9506        /// Incremental replication is in progress.
9507        Transferring,
9508        /// Baseline replication is in progress.
9509        BaselineTransferring,
9510        /// Replication is aborted.
9511        Aborted,
9512        /// Replication is being managed from Onprem ONTAP.
9513        ExternallyManaged,
9514        /// Peering is yet to be established.
9515        PendingPeering,
9516        /// If set, the enum was initialized with an unknown value.
9517        ///
9518        /// Applications can examine the value using [MirrorState::value] or
9519        /// [MirrorState::name].
9520        UnknownValue(mirror_state::UnknownValue),
9521    }
9522
9523    #[doc(hidden)]
9524    pub mod mirror_state {
9525        #[allow(unused_imports)]
9526        use super::*;
9527        #[derive(Clone, Debug, PartialEq)]
9528        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9529    }
9530
9531    impl MirrorState {
9532        /// Gets the enum value.
9533        ///
9534        /// Returns `None` if the enum contains an unknown value deserialized from
9535        /// the string representation of enums.
9536        pub fn value(&self) -> std::option::Option<i32> {
9537            match self {
9538                Self::Unspecified => std::option::Option::Some(0),
9539                Self::Preparing => std::option::Option::Some(1),
9540                Self::Mirrored => std::option::Option::Some(2),
9541                Self::Stopped => std::option::Option::Some(3),
9542                Self::Transferring => std::option::Option::Some(4),
9543                Self::BaselineTransferring => std::option::Option::Some(5),
9544                Self::Aborted => std::option::Option::Some(6),
9545                Self::ExternallyManaged => std::option::Option::Some(7),
9546                Self::PendingPeering => std::option::Option::Some(8),
9547                Self::UnknownValue(u) => u.0.value(),
9548            }
9549        }
9550
9551        /// Gets the enum value as a string.
9552        ///
9553        /// Returns `None` if the enum contains an unknown value deserialized from
9554        /// the integer representation of enums.
9555        pub fn name(&self) -> std::option::Option<&str> {
9556            match self {
9557                Self::Unspecified => std::option::Option::Some("MIRROR_STATE_UNSPECIFIED"),
9558                Self::Preparing => std::option::Option::Some("PREPARING"),
9559                Self::Mirrored => std::option::Option::Some("MIRRORED"),
9560                Self::Stopped => std::option::Option::Some("STOPPED"),
9561                Self::Transferring => std::option::Option::Some("TRANSFERRING"),
9562                Self::BaselineTransferring => std::option::Option::Some("BASELINE_TRANSFERRING"),
9563                Self::Aborted => std::option::Option::Some("ABORTED"),
9564                Self::ExternallyManaged => std::option::Option::Some("EXTERNALLY_MANAGED"),
9565                Self::PendingPeering => std::option::Option::Some("PENDING_PEERING"),
9566                Self::UnknownValue(u) => u.0.name(),
9567            }
9568        }
9569    }
9570
9571    impl std::default::Default for MirrorState {
9572        fn default() -> Self {
9573            use std::convert::From;
9574            Self::from(0)
9575        }
9576    }
9577
9578    impl std::fmt::Display for MirrorState {
9579        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9580            wkt::internal::display_enum(f, self.name(), self.value())
9581        }
9582    }
9583
9584    impl std::convert::From<i32> for MirrorState {
9585        fn from(value: i32) -> Self {
9586            match value {
9587                0 => Self::Unspecified,
9588                1 => Self::Preparing,
9589                2 => Self::Mirrored,
9590                3 => Self::Stopped,
9591                4 => Self::Transferring,
9592                5 => Self::BaselineTransferring,
9593                6 => Self::Aborted,
9594                7 => Self::ExternallyManaged,
9595                8 => Self::PendingPeering,
9596                _ => Self::UnknownValue(mirror_state::UnknownValue(
9597                    wkt::internal::UnknownEnumValue::Integer(value),
9598                )),
9599            }
9600        }
9601    }
9602
9603    impl std::convert::From<&str> for MirrorState {
9604        fn from(value: &str) -> Self {
9605            use std::string::ToString;
9606            match value {
9607                "MIRROR_STATE_UNSPECIFIED" => Self::Unspecified,
9608                "PREPARING" => Self::Preparing,
9609                "MIRRORED" => Self::Mirrored,
9610                "STOPPED" => Self::Stopped,
9611                "TRANSFERRING" => Self::Transferring,
9612                "BASELINE_TRANSFERRING" => Self::BaselineTransferring,
9613                "ABORTED" => Self::Aborted,
9614                "EXTERNALLY_MANAGED" => Self::ExternallyManaged,
9615                "PENDING_PEERING" => Self::PendingPeering,
9616                _ => Self::UnknownValue(mirror_state::UnknownValue(
9617                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9618                )),
9619            }
9620        }
9621    }
9622
9623    impl serde::ser::Serialize for MirrorState {
9624        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9625        where
9626            S: serde::Serializer,
9627        {
9628            match self {
9629                Self::Unspecified => serializer.serialize_i32(0),
9630                Self::Preparing => serializer.serialize_i32(1),
9631                Self::Mirrored => serializer.serialize_i32(2),
9632                Self::Stopped => serializer.serialize_i32(3),
9633                Self::Transferring => serializer.serialize_i32(4),
9634                Self::BaselineTransferring => serializer.serialize_i32(5),
9635                Self::Aborted => serializer.serialize_i32(6),
9636                Self::ExternallyManaged => serializer.serialize_i32(7),
9637                Self::PendingPeering => serializer.serialize_i32(8),
9638                Self::UnknownValue(u) => u.0.serialize(serializer),
9639            }
9640        }
9641    }
9642
9643    impl<'de> serde::de::Deserialize<'de> for MirrorState {
9644        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9645        where
9646            D: serde::Deserializer<'de>,
9647        {
9648            deserializer.deserialize_any(wkt::internal::EnumVisitor::<MirrorState>::new(
9649                ".google.cloud.netapp.v1.Replication.MirrorState",
9650            ))
9651        }
9652    }
9653
9654    /// Hybrid replication type.
9655    ///
9656    /// # Working with unknown values
9657    ///
9658    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9659    /// additional enum variants at any time. Adding new variants is not considered
9660    /// a breaking change. Applications should write their code in anticipation of:
9661    ///
9662    /// - New values appearing in future releases of the client library, **and**
9663    /// - New values received dynamically, without application changes.
9664    ///
9665    /// Please consult the [Working with enums] section in the user guide for some
9666    /// guidelines.
9667    ///
9668    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
9669    #[derive(Clone, Debug, PartialEq)]
9670    #[non_exhaustive]
9671    pub enum HybridReplicationType {
9672        /// Unspecified hybrid replication type.
9673        Unspecified,
9674        /// Hybrid replication type for migration.
9675        Migration,
9676        /// Hybrid replication type for continuous replication.
9677        ContinuousReplication,
9678        /// New field for reversible OnPrem replication, to be used for data
9679        /// protection.
9680        OnpremReplication,
9681        /// Hybrid replication type for incremental Transfer in the reverse direction
9682        /// (GCNV is source and Onprem is destination)
9683        ReverseOnpremReplication,
9684        /// If set, the enum was initialized with an unknown value.
9685        ///
9686        /// Applications can examine the value using [HybridReplicationType::value] or
9687        /// [HybridReplicationType::name].
9688        UnknownValue(hybrid_replication_type::UnknownValue),
9689    }
9690
9691    #[doc(hidden)]
9692    pub mod hybrid_replication_type {
9693        #[allow(unused_imports)]
9694        use super::*;
9695        #[derive(Clone, Debug, PartialEq)]
9696        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9697    }
9698
9699    impl HybridReplicationType {
9700        /// Gets the enum value.
9701        ///
9702        /// Returns `None` if the enum contains an unknown value deserialized from
9703        /// the string representation of enums.
9704        pub fn value(&self) -> std::option::Option<i32> {
9705            match self {
9706                Self::Unspecified => std::option::Option::Some(0),
9707                Self::Migration => std::option::Option::Some(1),
9708                Self::ContinuousReplication => std::option::Option::Some(2),
9709                Self::OnpremReplication => std::option::Option::Some(3),
9710                Self::ReverseOnpremReplication => std::option::Option::Some(4),
9711                Self::UnknownValue(u) => u.0.value(),
9712            }
9713        }
9714
9715        /// Gets the enum value as a string.
9716        ///
9717        /// Returns `None` if the enum contains an unknown value deserialized from
9718        /// the integer representation of enums.
9719        pub fn name(&self) -> std::option::Option<&str> {
9720            match self {
9721                Self::Unspecified => {
9722                    std::option::Option::Some("HYBRID_REPLICATION_TYPE_UNSPECIFIED")
9723                }
9724                Self::Migration => std::option::Option::Some("MIGRATION"),
9725                Self::ContinuousReplication => std::option::Option::Some("CONTINUOUS_REPLICATION"),
9726                Self::OnpremReplication => std::option::Option::Some("ONPREM_REPLICATION"),
9727                Self::ReverseOnpremReplication => {
9728                    std::option::Option::Some("REVERSE_ONPREM_REPLICATION")
9729                }
9730                Self::UnknownValue(u) => u.0.name(),
9731            }
9732        }
9733    }
9734
9735    impl std::default::Default for HybridReplicationType {
9736        fn default() -> Self {
9737            use std::convert::From;
9738            Self::from(0)
9739        }
9740    }
9741
9742    impl std::fmt::Display for HybridReplicationType {
9743        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9744            wkt::internal::display_enum(f, self.name(), self.value())
9745        }
9746    }
9747
9748    impl std::convert::From<i32> for HybridReplicationType {
9749        fn from(value: i32) -> Self {
9750            match value {
9751                0 => Self::Unspecified,
9752                1 => Self::Migration,
9753                2 => Self::ContinuousReplication,
9754                3 => Self::OnpremReplication,
9755                4 => Self::ReverseOnpremReplication,
9756                _ => Self::UnknownValue(hybrid_replication_type::UnknownValue(
9757                    wkt::internal::UnknownEnumValue::Integer(value),
9758                )),
9759            }
9760        }
9761    }
9762
9763    impl std::convert::From<&str> for HybridReplicationType {
9764        fn from(value: &str) -> Self {
9765            use std::string::ToString;
9766            match value {
9767                "HYBRID_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
9768                "MIGRATION" => Self::Migration,
9769                "CONTINUOUS_REPLICATION" => Self::ContinuousReplication,
9770                "ONPREM_REPLICATION" => Self::OnpremReplication,
9771                "REVERSE_ONPREM_REPLICATION" => Self::ReverseOnpremReplication,
9772                _ => Self::UnknownValue(hybrid_replication_type::UnknownValue(
9773                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9774                )),
9775            }
9776        }
9777    }
9778
9779    impl serde::ser::Serialize for HybridReplicationType {
9780        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9781        where
9782            S: serde::Serializer,
9783        {
9784            match self {
9785                Self::Unspecified => serializer.serialize_i32(0),
9786                Self::Migration => serializer.serialize_i32(1),
9787                Self::ContinuousReplication => serializer.serialize_i32(2),
9788                Self::OnpremReplication => serializer.serialize_i32(3),
9789                Self::ReverseOnpremReplication => serializer.serialize_i32(4),
9790                Self::UnknownValue(u) => u.0.serialize(serializer),
9791            }
9792        }
9793    }
9794
9795    impl<'de> serde::de::Deserialize<'de> for HybridReplicationType {
9796        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9797        where
9798            D: serde::Deserializer<'de>,
9799        {
9800            deserializer.deserialize_any(wkt::internal::EnumVisitor::<HybridReplicationType>::new(
9801                ".google.cloud.netapp.v1.Replication.HybridReplicationType",
9802            ))
9803        }
9804    }
9805}
9806
9807/// HybridPeeringDetails contains details about the hybrid peering.
9808#[derive(Clone, Default, PartialEq)]
9809#[non_exhaustive]
9810pub struct HybridPeeringDetails {
9811    /// Output only. IP address of the subnet.
9812    pub subnet_ip: std::string::String,
9813
9814    /// Output only. Copy-paste-able commands to be used on user's ONTAP to accept
9815    /// peering requests.
9816    pub command: std::string::String,
9817
9818    /// Output only. Expiration time for the peering command to be executed on
9819    /// user's ONTAP.
9820    pub command_expiry_time: std::option::Option<wkt::Timestamp>,
9821
9822    /// Output only. Temporary passphrase generated to accept cluster peering
9823    /// command.
9824    pub passphrase: std::string::String,
9825
9826    /// Output only. Name of the user's local source volume to be peered with the
9827    /// destination volume.
9828    pub peer_volume_name: std::string::String,
9829
9830    /// Output only. Name of the user's local source cluster to be peered with the
9831    /// destination cluster.
9832    pub peer_cluster_name: std::string::String,
9833
9834    /// Output only. Name of the user's local source vserver svm to be peered with
9835    /// the destination vserver svm.
9836    pub peer_svm_name: std::string::String,
9837
9838    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9839}
9840
9841impl HybridPeeringDetails {
9842    /// Creates a new default instance.
9843    pub fn new() -> Self {
9844        std::default::Default::default()
9845    }
9846
9847    /// Sets the value of [subnet_ip][crate::model::HybridPeeringDetails::subnet_ip].
9848    ///
9849    /// # Example
9850    /// ```ignore,no_run
9851    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9852    /// let x = HybridPeeringDetails::new().set_subnet_ip("example");
9853    /// ```
9854    pub fn set_subnet_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9855        self.subnet_ip = v.into();
9856        self
9857    }
9858
9859    /// Sets the value of [command][crate::model::HybridPeeringDetails::command].
9860    ///
9861    /// # Example
9862    /// ```ignore,no_run
9863    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9864    /// let x = HybridPeeringDetails::new().set_command("example");
9865    /// ```
9866    pub fn set_command<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9867        self.command = v.into();
9868        self
9869    }
9870
9871    /// Sets the value of [command_expiry_time][crate::model::HybridPeeringDetails::command_expiry_time].
9872    ///
9873    /// # Example
9874    /// ```ignore,no_run
9875    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9876    /// use wkt::Timestamp;
9877    /// let x = HybridPeeringDetails::new().set_command_expiry_time(Timestamp::default()/* use setters */);
9878    /// ```
9879    pub fn set_command_expiry_time<T>(mut self, v: T) -> Self
9880    where
9881        T: std::convert::Into<wkt::Timestamp>,
9882    {
9883        self.command_expiry_time = std::option::Option::Some(v.into());
9884        self
9885    }
9886
9887    /// Sets or clears the value of [command_expiry_time][crate::model::HybridPeeringDetails::command_expiry_time].
9888    ///
9889    /// # Example
9890    /// ```ignore,no_run
9891    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9892    /// use wkt::Timestamp;
9893    /// let x = HybridPeeringDetails::new().set_or_clear_command_expiry_time(Some(Timestamp::default()/* use setters */));
9894    /// let x = HybridPeeringDetails::new().set_or_clear_command_expiry_time(None::<Timestamp>);
9895    /// ```
9896    pub fn set_or_clear_command_expiry_time<T>(mut self, v: std::option::Option<T>) -> Self
9897    where
9898        T: std::convert::Into<wkt::Timestamp>,
9899    {
9900        self.command_expiry_time = v.map(|x| x.into());
9901        self
9902    }
9903
9904    /// Sets the value of [passphrase][crate::model::HybridPeeringDetails::passphrase].
9905    ///
9906    /// # Example
9907    /// ```ignore,no_run
9908    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9909    /// let x = HybridPeeringDetails::new().set_passphrase("example");
9910    /// ```
9911    pub fn set_passphrase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9912        self.passphrase = v.into();
9913        self
9914    }
9915
9916    /// Sets the value of [peer_volume_name][crate::model::HybridPeeringDetails::peer_volume_name].
9917    ///
9918    /// # Example
9919    /// ```ignore,no_run
9920    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9921    /// let x = HybridPeeringDetails::new().set_peer_volume_name("example");
9922    /// ```
9923    pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
9924        mut self,
9925        v: T,
9926    ) -> Self {
9927        self.peer_volume_name = v.into();
9928        self
9929    }
9930
9931    /// Sets the value of [peer_cluster_name][crate::model::HybridPeeringDetails::peer_cluster_name].
9932    ///
9933    /// # Example
9934    /// ```ignore,no_run
9935    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9936    /// let x = HybridPeeringDetails::new().set_peer_cluster_name("example");
9937    /// ```
9938    pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
9939        mut self,
9940        v: T,
9941    ) -> Self {
9942        self.peer_cluster_name = v.into();
9943        self
9944    }
9945
9946    /// Sets the value of [peer_svm_name][crate::model::HybridPeeringDetails::peer_svm_name].
9947    ///
9948    /// # Example
9949    /// ```ignore,no_run
9950    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9951    /// let x = HybridPeeringDetails::new().set_peer_svm_name("example");
9952    /// ```
9953    pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9954        self.peer_svm_name = v.into();
9955        self
9956    }
9957}
9958
9959impl wkt::message::Message for HybridPeeringDetails {
9960    fn typename() -> &'static str {
9961        "type.googleapis.com/google.cloud.netapp.v1.HybridPeeringDetails"
9962    }
9963}
9964
9965/// ListReplications lists replications.
9966#[derive(Clone, Default, PartialEq)]
9967#[non_exhaustive]
9968pub struct ListReplicationsRequest {
9969    /// Required. The volume for which to retrieve replication information,
9970    /// in the format
9971    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`.
9972    pub parent: std::string::String,
9973
9974    /// The maximum number of items to return.
9975    pub page_size: i32,
9976
9977    /// The next_page_token value to use if there are additional
9978    /// results to retrieve for this list request.
9979    pub page_token: std::string::String,
9980
9981    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
9982    pub order_by: std::string::String,
9983
9984    /// List filter.
9985    pub filter: std::string::String,
9986
9987    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9988}
9989
9990impl ListReplicationsRequest {
9991    /// Creates a new default instance.
9992    pub fn new() -> Self {
9993        std::default::Default::default()
9994    }
9995
9996    /// Sets the value of [parent][crate::model::ListReplicationsRequest::parent].
9997    ///
9998    /// # Example
9999    /// ```ignore,no_run
10000    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
10001    /// # let project_id = "project_id";
10002    /// # let location_id = "location_id";
10003    /// # let volume_id = "volume_id";
10004    /// let x = ListReplicationsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
10005    /// ```
10006    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10007        self.parent = v.into();
10008        self
10009    }
10010
10011    /// Sets the value of [page_size][crate::model::ListReplicationsRequest::page_size].
10012    ///
10013    /// # Example
10014    /// ```ignore,no_run
10015    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
10016    /// let x = ListReplicationsRequest::new().set_page_size(42);
10017    /// ```
10018    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10019        self.page_size = v.into();
10020        self
10021    }
10022
10023    /// Sets the value of [page_token][crate::model::ListReplicationsRequest::page_token].
10024    ///
10025    /// # Example
10026    /// ```ignore,no_run
10027    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
10028    /// let x = ListReplicationsRequest::new().set_page_token("example");
10029    /// ```
10030    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10031        self.page_token = v.into();
10032        self
10033    }
10034
10035    /// Sets the value of [order_by][crate::model::ListReplicationsRequest::order_by].
10036    ///
10037    /// # Example
10038    /// ```ignore,no_run
10039    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
10040    /// let x = ListReplicationsRequest::new().set_order_by("example");
10041    /// ```
10042    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10043        self.order_by = v.into();
10044        self
10045    }
10046
10047    /// Sets the value of [filter][crate::model::ListReplicationsRequest::filter].
10048    ///
10049    /// # Example
10050    /// ```ignore,no_run
10051    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
10052    /// let x = ListReplicationsRequest::new().set_filter("example");
10053    /// ```
10054    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10055        self.filter = v.into();
10056        self
10057    }
10058}
10059
10060impl wkt::message::Message for ListReplicationsRequest {
10061    fn typename() -> &'static str {
10062        "type.googleapis.com/google.cloud.netapp.v1.ListReplicationsRequest"
10063    }
10064}
10065
10066/// ListReplicationsResponse is the result of ListReplicationsRequest.
10067#[derive(Clone, Default, PartialEq)]
10068#[non_exhaustive]
10069pub struct ListReplicationsResponse {
10070    /// A list of replications in the project for the specified volume.
10071    pub replications: std::vec::Vec<crate::model::Replication>,
10072
10073    /// The token you can use to retrieve the next page of results. Not returned
10074    /// if there are no more results in the list.
10075    pub next_page_token: std::string::String,
10076
10077    /// Locations that could not be reached.
10078    pub unreachable: std::vec::Vec<std::string::String>,
10079
10080    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10081}
10082
10083impl ListReplicationsResponse {
10084    /// Creates a new default instance.
10085    pub fn new() -> Self {
10086        std::default::Default::default()
10087    }
10088
10089    /// Sets the value of [replications][crate::model::ListReplicationsResponse::replications].
10090    ///
10091    /// # Example
10092    /// ```ignore,no_run
10093    /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
10094    /// use google_cloud_netapp_v1::model::Replication;
10095    /// let x = ListReplicationsResponse::new()
10096    ///     .set_replications([
10097    ///         Replication::default()/* use setters */,
10098    ///         Replication::default()/* use (different) setters */,
10099    ///     ]);
10100    /// ```
10101    pub fn set_replications<T, V>(mut self, v: T) -> Self
10102    where
10103        T: std::iter::IntoIterator<Item = V>,
10104        V: std::convert::Into<crate::model::Replication>,
10105    {
10106        use std::iter::Iterator;
10107        self.replications = v.into_iter().map(|i| i.into()).collect();
10108        self
10109    }
10110
10111    /// Sets the value of [next_page_token][crate::model::ListReplicationsResponse::next_page_token].
10112    ///
10113    /// # Example
10114    /// ```ignore,no_run
10115    /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
10116    /// let x = ListReplicationsResponse::new().set_next_page_token("example");
10117    /// ```
10118    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10119        self.next_page_token = v.into();
10120        self
10121    }
10122
10123    /// Sets the value of [unreachable][crate::model::ListReplicationsResponse::unreachable].
10124    ///
10125    /// # Example
10126    /// ```ignore,no_run
10127    /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
10128    /// let x = ListReplicationsResponse::new().set_unreachable(["a", "b", "c"]);
10129    /// ```
10130    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10131    where
10132        T: std::iter::IntoIterator<Item = V>,
10133        V: std::convert::Into<std::string::String>,
10134    {
10135        use std::iter::Iterator;
10136        self.unreachable = v.into_iter().map(|i| i.into()).collect();
10137        self
10138    }
10139}
10140
10141impl wkt::message::Message for ListReplicationsResponse {
10142    fn typename() -> &'static str {
10143        "type.googleapis.com/google.cloud.netapp.v1.ListReplicationsResponse"
10144    }
10145}
10146
10147#[doc(hidden)]
10148impl google_cloud_gax::paginator::internal::PageableResponse for ListReplicationsResponse {
10149    type PageItem = crate::model::Replication;
10150
10151    fn items(self) -> std::vec::Vec<Self::PageItem> {
10152        self.replications
10153    }
10154
10155    fn next_page_token(&self) -> std::string::String {
10156        use std::clone::Clone;
10157        self.next_page_token.clone()
10158    }
10159}
10160
10161/// GetReplicationRequest gets the state of a replication.
10162#[derive(Clone, Default, PartialEq)]
10163#[non_exhaustive]
10164pub struct GetReplicationRequest {
10165    /// Required. The replication resource name, in the format
10166    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}`
10167    pub name: std::string::String,
10168
10169    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10170}
10171
10172impl GetReplicationRequest {
10173    /// Creates a new default instance.
10174    pub fn new() -> Self {
10175        std::default::Default::default()
10176    }
10177
10178    /// Sets the value of [name][crate::model::GetReplicationRequest::name].
10179    ///
10180    /// # Example
10181    /// ```ignore,no_run
10182    /// # use google_cloud_netapp_v1::model::GetReplicationRequest;
10183    /// # let project_id = "project_id";
10184    /// # let location_id = "location_id";
10185    /// # let volume_id = "volume_id";
10186    /// # let replication_id = "replication_id";
10187    /// let x = GetReplicationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/replications/{replication_id}"));
10188    /// ```
10189    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10190        self.name = v.into();
10191        self
10192    }
10193}
10194
10195impl wkt::message::Message for GetReplicationRequest {
10196    fn typename() -> &'static str {
10197        "type.googleapis.com/google.cloud.netapp.v1.GetReplicationRequest"
10198    }
10199}
10200
10201/// DestinationVolumeParameters specify input parameters used for creating
10202/// destination volume.
10203#[derive(Clone, Default, PartialEq)]
10204#[non_exhaustive]
10205pub struct DestinationVolumeParameters {
10206    /// Required. Existing destination StoragePool name.
10207    pub storage_pool: std::string::String,
10208
10209    /// Desired destination volume resource id. If not specified, source volume's
10210    /// resource id will be used.
10211    /// This value must start with a lowercase letter followed by up to 62
10212    /// lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
10213    pub volume_id: std::string::String,
10214
10215    /// Destination volume's share name. If not specified, source volume's share
10216    /// name will be used.
10217    pub share_name: std::string::String,
10218
10219    /// Description for the destination volume.
10220    pub description: std::option::Option<std::string::String>,
10221
10222    /// Optional. Tiering policy for the volume.
10223    pub tiering_policy: std::option::Option<crate::model::TieringPolicy>,
10224
10225    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10226}
10227
10228impl DestinationVolumeParameters {
10229    /// Creates a new default instance.
10230    pub fn new() -> Self {
10231        std::default::Default::default()
10232    }
10233
10234    /// Sets the value of [storage_pool][crate::model::DestinationVolumeParameters::storage_pool].
10235    ///
10236    /// # Example
10237    /// ```ignore,no_run
10238    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10239    /// # let project_id = "project_id";
10240    /// # let location_id = "location_id";
10241    /// # let storage_pool_id = "storage_pool_id";
10242    /// let x = DestinationVolumeParameters::new().set_storage_pool(format!("projects/{project_id}/locations/{location_id}/storagePools/{storage_pool_id}"));
10243    /// ```
10244    pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10245        self.storage_pool = v.into();
10246        self
10247    }
10248
10249    /// Sets the value of [volume_id][crate::model::DestinationVolumeParameters::volume_id].
10250    ///
10251    /// # Example
10252    /// ```ignore,no_run
10253    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10254    /// let x = DestinationVolumeParameters::new().set_volume_id("example");
10255    /// ```
10256    pub fn set_volume_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10257        self.volume_id = v.into();
10258        self
10259    }
10260
10261    /// Sets the value of [share_name][crate::model::DestinationVolumeParameters::share_name].
10262    ///
10263    /// # Example
10264    /// ```ignore,no_run
10265    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10266    /// let x = DestinationVolumeParameters::new().set_share_name("example");
10267    /// ```
10268    pub fn set_share_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10269        self.share_name = v.into();
10270        self
10271    }
10272
10273    /// Sets the value of [description][crate::model::DestinationVolumeParameters::description].
10274    ///
10275    /// # Example
10276    /// ```ignore,no_run
10277    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10278    /// let x = DestinationVolumeParameters::new().set_description("example");
10279    /// ```
10280    pub fn set_description<T>(mut self, v: T) -> Self
10281    where
10282        T: std::convert::Into<std::string::String>,
10283    {
10284        self.description = std::option::Option::Some(v.into());
10285        self
10286    }
10287
10288    /// Sets or clears the value of [description][crate::model::DestinationVolumeParameters::description].
10289    ///
10290    /// # Example
10291    /// ```ignore,no_run
10292    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10293    /// let x = DestinationVolumeParameters::new().set_or_clear_description(Some("example"));
10294    /// let x = DestinationVolumeParameters::new().set_or_clear_description(None::<String>);
10295    /// ```
10296    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
10297    where
10298        T: std::convert::Into<std::string::String>,
10299    {
10300        self.description = v.map(|x| x.into());
10301        self
10302    }
10303
10304    /// Sets the value of [tiering_policy][crate::model::DestinationVolumeParameters::tiering_policy].
10305    ///
10306    /// # Example
10307    /// ```ignore,no_run
10308    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10309    /// use google_cloud_netapp_v1::model::TieringPolicy;
10310    /// let x = DestinationVolumeParameters::new().set_tiering_policy(TieringPolicy::default()/* use setters */);
10311    /// ```
10312    pub fn set_tiering_policy<T>(mut self, v: T) -> Self
10313    where
10314        T: std::convert::Into<crate::model::TieringPolicy>,
10315    {
10316        self.tiering_policy = std::option::Option::Some(v.into());
10317        self
10318    }
10319
10320    /// Sets or clears the value of [tiering_policy][crate::model::DestinationVolumeParameters::tiering_policy].
10321    ///
10322    /// # Example
10323    /// ```ignore,no_run
10324    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
10325    /// use google_cloud_netapp_v1::model::TieringPolicy;
10326    /// let x = DestinationVolumeParameters::new().set_or_clear_tiering_policy(Some(TieringPolicy::default()/* use setters */));
10327    /// let x = DestinationVolumeParameters::new().set_or_clear_tiering_policy(None::<TieringPolicy>);
10328    /// ```
10329    pub fn set_or_clear_tiering_policy<T>(mut self, v: std::option::Option<T>) -> Self
10330    where
10331        T: std::convert::Into<crate::model::TieringPolicy>,
10332    {
10333        self.tiering_policy = v.map(|x| x.into());
10334        self
10335    }
10336}
10337
10338impl wkt::message::Message for DestinationVolumeParameters {
10339    fn typename() -> &'static str {
10340        "type.googleapis.com/google.cloud.netapp.v1.DestinationVolumeParameters"
10341    }
10342}
10343
10344/// CreateReplicationRequest creates a replication.
10345#[derive(Clone, Default, PartialEq)]
10346#[non_exhaustive]
10347pub struct CreateReplicationRequest {
10348    /// Required. The NetApp volume to create the replications of, in the format
10349    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
10350    pub parent: std::string::String,
10351
10352    /// Required. A replication resource
10353    pub replication: std::option::Option<crate::model::Replication>,
10354
10355    /// Required. ID of the replication to create. Must be unique within the parent
10356    /// resource. Must contain only letters, numbers and hyphen, with the first
10357    /// character a letter, the last a letter or a
10358    /// number, and a 63 character maximum.
10359    pub replication_id: std::string::String,
10360
10361    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10362}
10363
10364impl CreateReplicationRequest {
10365    /// Creates a new default instance.
10366    pub fn new() -> Self {
10367        std::default::Default::default()
10368    }
10369
10370    /// Sets the value of [parent][crate::model::CreateReplicationRequest::parent].
10371    ///
10372    /// # Example
10373    /// ```ignore,no_run
10374    /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
10375    /// # let project_id = "project_id";
10376    /// # let location_id = "location_id";
10377    /// # let volume_id = "volume_id";
10378    /// let x = CreateReplicationRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
10379    /// ```
10380    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10381        self.parent = v.into();
10382        self
10383    }
10384
10385    /// Sets the value of [replication][crate::model::CreateReplicationRequest::replication].
10386    ///
10387    /// # Example
10388    /// ```ignore,no_run
10389    /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
10390    /// use google_cloud_netapp_v1::model::Replication;
10391    /// let x = CreateReplicationRequest::new().set_replication(Replication::default()/* use setters */);
10392    /// ```
10393    pub fn set_replication<T>(mut self, v: T) -> Self
10394    where
10395        T: std::convert::Into<crate::model::Replication>,
10396    {
10397        self.replication = std::option::Option::Some(v.into());
10398        self
10399    }
10400
10401    /// Sets or clears the value of [replication][crate::model::CreateReplicationRequest::replication].
10402    ///
10403    /// # Example
10404    /// ```ignore,no_run
10405    /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
10406    /// use google_cloud_netapp_v1::model::Replication;
10407    /// let x = CreateReplicationRequest::new().set_or_clear_replication(Some(Replication::default()/* use setters */));
10408    /// let x = CreateReplicationRequest::new().set_or_clear_replication(None::<Replication>);
10409    /// ```
10410    pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
10411    where
10412        T: std::convert::Into<crate::model::Replication>,
10413    {
10414        self.replication = v.map(|x| x.into());
10415        self
10416    }
10417
10418    /// Sets the value of [replication_id][crate::model::CreateReplicationRequest::replication_id].
10419    ///
10420    /// # Example
10421    /// ```ignore,no_run
10422    /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
10423    /// let x = CreateReplicationRequest::new().set_replication_id("example");
10424    /// ```
10425    pub fn set_replication_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10426        self.replication_id = v.into();
10427        self
10428    }
10429}
10430
10431impl wkt::message::Message for CreateReplicationRequest {
10432    fn typename() -> &'static str {
10433        "type.googleapis.com/google.cloud.netapp.v1.CreateReplicationRequest"
10434    }
10435}
10436
10437/// DeleteReplicationRequest deletes a replication.
10438#[derive(Clone, Default, PartialEq)]
10439#[non_exhaustive]
10440pub struct DeleteReplicationRequest {
10441    /// Required. The replication resource name, in the format
10442    /// `projects/*/locations/*/volumes/*/replications/{replication_id}`
10443    pub name: std::string::String,
10444
10445    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10446}
10447
10448impl DeleteReplicationRequest {
10449    /// Creates a new default instance.
10450    pub fn new() -> Self {
10451        std::default::Default::default()
10452    }
10453
10454    /// Sets the value of [name][crate::model::DeleteReplicationRequest::name].
10455    ///
10456    /// # Example
10457    /// ```ignore,no_run
10458    /// # use google_cloud_netapp_v1::model::DeleteReplicationRequest;
10459    /// # let project_id = "project_id";
10460    /// # let location_id = "location_id";
10461    /// # let volume_id = "volume_id";
10462    /// # let replication_id = "replication_id";
10463    /// let x = DeleteReplicationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/replications/{replication_id}"));
10464    /// ```
10465    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10466        self.name = v.into();
10467        self
10468    }
10469}
10470
10471impl wkt::message::Message for DeleteReplicationRequest {
10472    fn typename() -> &'static str {
10473        "type.googleapis.com/google.cloud.netapp.v1.DeleteReplicationRequest"
10474    }
10475}
10476
10477/// UpdateReplicationRequest updates description and/or labels for a replication.
10478#[derive(Clone, Default, PartialEq)]
10479#[non_exhaustive]
10480pub struct UpdateReplicationRequest {
10481    /// Required. Mask of fields to update.  At least one path must be supplied in
10482    /// this field.
10483    pub update_mask: std::option::Option<wkt::FieldMask>,
10484
10485    /// Required. A replication resource
10486    pub replication: std::option::Option<crate::model::Replication>,
10487
10488    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10489}
10490
10491impl UpdateReplicationRequest {
10492    /// Creates a new default instance.
10493    pub fn new() -> Self {
10494        std::default::Default::default()
10495    }
10496
10497    /// Sets the value of [update_mask][crate::model::UpdateReplicationRequest::update_mask].
10498    ///
10499    /// # Example
10500    /// ```ignore,no_run
10501    /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
10502    /// use wkt::FieldMask;
10503    /// let x = UpdateReplicationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10504    /// ```
10505    pub fn set_update_mask<T>(mut self, v: T) -> Self
10506    where
10507        T: std::convert::Into<wkt::FieldMask>,
10508    {
10509        self.update_mask = std::option::Option::Some(v.into());
10510        self
10511    }
10512
10513    /// Sets or clears the value of [update_mask][crate::model::UpdateReplicationRequest::update_mask].
10514    ///
10515    /// # Example
10516    /// ```ignore,no_run
10517    /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
10518    /// use wkt::FieldMask;
10519    /// let x = UpdateReplicationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10520    /// let x = UpdateReplicationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10521    /// ```
10522    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10523    where
10524        T: std::convert::Into<wkt::FieldMask>,
10525    {
10526        self.update_mask = v.map(|x| x.into());
10527        self
10528    }
10529
10530    /// Sets the value of [replication][crate::model::UpdateReplicationRequest::replication].
10531    ///
10532    /// # Example
10533    /// ```ignore,no_run
10534    /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
10535    /// use google_cloud_netapp_v1::model::Replication;
10536    /// let x = UpdateReplicationRequest::new().set_replication(Replication::default()/* use setters */);
10537    /// ```
10538    pub fn set_replication<T>(mut self, v: T) -> Self
10539    where
10540        T: std::convert::Into<crate::model::Replication>,
10541    {
10542        self.replication = std::option::Option::Some(v.into());
10543        self
10544    }
10545
10546    /// Sets or clears the value of [replication][crate::model::UpdateReplicationRequest::replication].
10547    ///
10548    /// # Example
10549    /// ```ignore,no_run
10550    /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
10551    /// use google_cloud_netapp_v1::model::Replication;
10552    /// let x = UpdateReplicationRequest::new().set_or_clear_replication(Some(Replication::default()/* use setters */));
10553    /// let x = UpdateReplicationRequest::new().set_or_clear_replication(None::<Replication>);
10554    /// ```
10555    pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
10556    where
10557        T: std::convert::Into<crate::model::Replication>,
10558    {
10559        self.replication = v.map(|x| x.into());
10560        self
10561    }
10562}
10563
10564impl wkt::message::Message for UpdateReplicationRequest {
10565    fn typename() -> &'static str {
10566        "type.googleapis.com/google.cloud.netapp.v1.UpdateReplicationRequest"
10567    }
10568}
10569
10570/// StopReplicationRequest stops a replication until resumed.
10571#[derive(Clone, Default, PartialEq)]
10572#[non_exhaustive]
10573pub struct StopReplicationRequest {
10574    /// Required. The resource name of the replication, in the format of
10575    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10576    pub name: std::string::String,
10577
10578    /// Indicates whether to stop replication forcefully while data transfer is in
10579    /// progress.
10580    /// Warning! if force is true, this will abort any current transfers
10581    /// and can lead to data loss due to partial transfer.
10582    /// If force is false, stop replication will fail while data transfer is in
10583    /// progress and you will need to retry later.
10584    pub force: bool,
10585
10586    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10587}
10588
10589impl StopReplicationRequest {
10590    /// Creates a new default instance.
10591    pub fn new() -> Self {
10592        std::default::Default::default()
10593    }
10594
10595    /// Sets the value of [name][crate::model::StopReplicationRequest::name].
10596    ///
10597    /// # Example
10598    /// ```ignore,no_run
10599    /// # use google_cloud_netapp_v1::model::StopReplicationRequest;
10600    /// # let project_id = "project_id";
10601    /// # let location_id = "location_id";
10602    /// # let volume_id = "volume_id";
10603    /// # let replication_id = "replication_id";
10604    /// let x = StopReplicationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/replications/{replication_id}"));
10605    /// ```
10606    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10607        self.name = v.into();
10608        self
10609    }
10610
10611    /// Sets the value of [force][crate::model::StopReplicationRequest::force].
10612    ///
10613    /// # Example
10614    /// ```ignore,no_run
10615    /// # use google_cloud_netapp_v1::model::StopReplicationRequest;
10616    /// let x = StopReplicationRequest::new().set_force(true);
10617    /// ```
10618    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10619        self.force = v.into();
10620        self
10621    }
10622}
10623
10624impl wkt::message::Message for StopReplicationRequest {
10625    fn typename() -> &'static str {
10626        "type.googleapis.com/google.cloud.netapp.v1.StopReplicationRequest"
10627    }
10628}
10629
10630/// ResumeReplicationRequest resumes a stopped replication.
10631#[derive(Clone, Default, PartialEq)]
10632#[non_exhaustive]
10633pub struct ResumeReplicationRequest {
10634    /// Required. The resource name of the replication, in the format of
10635    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10636    pub name: std::string::String,
10637
10638    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10639}
10640
10641impl ResumeReplicationRequest {
10642    /// Creates a new default instance.
10643    pub fn new() -> Self {
10644        std::default::Default::default()
10645    }
10646
10647    /// Sets the value of [name][crate::model::ResumeReplicationRequest::name].
10648    ///
10649    /// # Example
10650    /// ```ignore,no_run
10651    /// # use google_cloud_netapp_v1::model::ResumeReplicationRequest;
10652    /// # let project_id = "project_id";
10653    /// # let location_id = "location_id";
10654    /// # let volume_id = "volume_id";
10655    /// # let replication_id = "replication_id";
10656    /// let x = ResumeReplicationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/replications/{replication_id}"));
10657    /// ```
10658    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10659        self.name = v.into();
10660        self
10661    }
10662}
10663
10664impl wkt::message::Message for ResumeReplicationRequest {
10665    fn typename() -> &'static str {
10666        "type.googleapis.com/google.cloud.netapp.v1.ResumeReplicationRequest"
10667    }
10668}
10669
10670/// ReverseReplicationDirectionRequest reverses direction of replication. Source
10671/// becomes destination and destination becomes source.
10672#[derive(Clone, Default, PartialEq)]
10673#[non_exhaustive]
10674pub struct ReverseReplicationDirectionRequest {
10675    /// Required. The resource name of the replication, in the format of
10676    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10677    pub name: std::string::String,
10678
10679    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10680}
10681
10682impl ReverseReplicationDirectionRequest {
10683    /// Creates a new default instance.
10684    pub fn new() -> Self {
10685        std::default::Default::default()
10686    }
10687
10688    /// Sets the value of [name][crate::model::ReverseReplicationDirectionRequest::name].
10689    ///
10690    /// # Example
10691    /// ```ignore,no_run
10692    /// # use google_cloud_netapp_v1::model::ReverseReplicationDirectionRequest;
10693    /// # let project_id = "project_id";
10694    /// # let location_id = "location_id";
10695    /// # let volume_id = "volume_id";
10696    /// # let replication_id = "replication_id";
10697    /// let x = ReverseReplicationDirectionRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/replications/{replication_id}"));
10698    /// ```
10699    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10700        self.name = v.into();
10701        self
10702    }
10703}
10704
10705impl wkt::message::Message for ReverseReplicationDirectionRequest {
10706    fn typename() -> &'static str {
10707        "type.googleapis.com/google.cloud.netapp.v1.ReverseReplicationDirectionRequest"
10708    }
10709}
10710
10711/// EstablishPeeringRequest establishes cluster and svm peerings between the
10712/// source and the destination replications.
10713#[derive(Clone, Default, PartialEq)]
10714#[non_exhaustive]
10715pub struct EstablishPeeringRequest {
10716    /// Required. The resource name of the replication, in the format of
10717    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10718    pub name: std::string::String,
10719
10720    /// Required. Name of the user's local source cluster to be peered with the
10721    /// destination cluster.
10722    pub peer_cluster_name: std::string::String,
10723
10724    /// Required. Name of the user's local source vserver svm to be peered with the
10725    /// destination vserver svm.
10726    pub peer_svm_name: std::string::String,
10727
10728    /// Optional. List of IPv4 ip addresses to be used for peering.
10729    pub peer_ip_addresses: std::vec::Vec<std::string::String>,
10730
10731    /// Required. Name of the user's local source volume to be peered with the
10732    /// destination volume.
10733    pub peer_volume_name: std::string::String,
10734
10735    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10736}
10737
10738impl EstablishPeeringRequest {
10739    /// Creates a new default instance.
10740    pub fn new() -> Self {
10741        std::default::Default::default()
10742    }
10743
10744    /// Sets the value of [name][crate::model::EstablishPeeringRequest::name].
10745    ///
10746    /// # Example
10747    /// ```ignore,no_run
10748    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10749    /// # let project_id = "project_id";
10750    /// # let location_id = "location_id";
10751    /// # let volume_id = "volume_id";
10752    /// # let replication_id = "replication_id";
10753    /// let x = EstablishPeeringRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/replications/{replication_id}"));
10754    /// ```
10755    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10756        self.name = v.into();
10757        self
10758    }
10759
10760    /// Sets the value of [peer_cluster_name][crate::model::EstablishPeeringRequest::peer_cluster_name].
10761    ///
10762    /// # Example
10763    /// ```ignore,no_run
10764    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10765    /// let x = EstablishPeeringRequest::new().set_peer_cluster_name("example");
10766    /// ```
10767    pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
10768        mut self,
10769        v: T,
10770    ) -> Self {
10771        self.peer_cluster_name = v.into();
10772        self
10773    }
10774
10775    /// Sets the value of [peer_svm_name][crate::model::EstablishPeeringRequest::peer_svm_name].
10776    ///
10777    /// # Example
10778    /// ```ignore,no_run
10779    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10780    /// let x = EstablishPeeringRequest::new().set_peer_svm_name("example");
10781    /// ```
10782    pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10783        self.peer_svm_name = v.into();
10784        self
10785    }
10786
10787    /// Sets the value of [peer_ip_addresses][crate::model::EstablishPeeringRequest::peer_ip_addresses].
10788    ///
10789    /// # Example
10790    /// ```ignore,no_run
10791    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10792    /// let x = EstablishPeeringRequest::new().set_peer_ip_addresses(["a", "b", "c"]);
10793    /// ```
10794    pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
10795    where
10796        T: std::iter::IntoIterator<Item = V>,
10797        V: std::convert::Into<std::string::String>,
10798    {
10799        use std::iter::Iterator;
10800        self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
10801        self
10802    }
10803
10804    /// Sets the value of [peer_volume_name][crate::model::EstablishPeeringRequest::peer_volume_name].
10805    ///
10806    /// # Example
10807    /// ```ignore,no_run
10808    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10809    /// let x = EstablishPeeringRequest::new().set_peer_volume_name("example");
10810    /// ```
10811    pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
10812        mut self,
10813        v: T,
10814    ) -> Self {
10815        self.peer_volume_name = v.into();
10816        self
10817    }
10818}
10819
10820impl wkt::message::Message for EstablishPeeringRequest {
10821    fn typename() -> &'static str {
10822        "type.googleapis.com/google.cloud.netapp.v1.EstablishPeeringRequest"
10823    }
10824}
10825
10826/// SyncReplicationRequest syncs the replication from source to destination.
10827#[derive(Clone, Default, PartialEq)]
10828#[non_exhaustive]
10829pub struct SyncReplicationRequest {
10830    /// Required. The resource name of the replication, in the format of
10831    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10832    pub name: std::string::String,
10833
10834    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10835}
10836
10837impl SyncReplicationRequest {
10838    /// Creates a new default instance.
10839    pub fn new() -> Self {
10840        std::default::Default::default()
10841    }
10842
10843    /// Sets the value of [name][crate::model::SyncReplicationRequest::name].
10844    ///
10845    /// # Example
10846    /// ```ignore,no_run
10847    /// # use google_cloud_netapp_v1::model::SyncReplicationRequest;
10848    /// # let project_id = "project_id";
10849    /// # let location_id = "location_id";
10850    /// # let volume_id = "volume_id";
10851    /// # let replication_id = "replication_id";
10852    /// let x = SyncReplicationRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/replications/{replication_id}"));
10853    /// ```
10854    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10855        self.name = v.into();
10856        self
10857    }
10858}
10859
10860impl wkt::message::Message for SyncReplicationRequest {
10861    fn typename() -> &'static str {
10862        "type.googleapis.com/google.cloud.netapp.v1.SyncReplicationRequest"
10863    }
10864}
10865
10866/// ListSnapshotsRequest lists snapshots.
10867#[derive(Clone, Default, PartialEq)]
10868#[non_exhaustive]
10869pub struct ListSnapshotsRequest {
10870    /// Required. The volume for which to retrieve snapshot information,
10871    /// in the format
10872    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`.
10873    pub parent: std::string::String,
10874
10875    /// The maximum number of items to return.
10876    pub page_size: i32,
10877
10878    /// The next_page_token value to use if there are additional
10879    /// results to retrieve for this list request.
10880    pub page_token: std::string::String,
10881
10882    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
10883    pub order_by: std::string::String,
10884
10885    /// List filter.
10886    pub filter: std::string::String,
10887
10888    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10889}
10890
10891impl ListSnapshotsRequest {
10892    /// Creates a new default instance.
10893    pub fn new() -> Self {
10894        std::default::Default::default()
10895    }
10896
10897    /// Sets the value of [parent][crate::model::ListSnapshotsRequest::parent].
10898    ///
10899    /// # Example
10900    /// ```ignore,no_run
10901    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10902    /// # let project_id = "project_id";
10903    /// # let location_id = "location_id";
10904    /// # let volume_id = "volume_id";
10905    /// let x = ListSnapshotsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
10906    /// ```
10907    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10908        self.parent = v.into();
10909        self
10910    }
10911
10912    /// Sets the value of [page_size][crate::model::ListSnapshotsRequest::page_size].
10913    ///
10914    /// # Example
10915    /// ```ignore,no_run
10916    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10917    /// let x = ListSnapshotsRequest::new().set_page_size(42);
10918    /// ```
10919    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10920        self.page_size = v.into();
10921        self
10922    }
10923
10924    /// Sets the value of [page_token][crate::model::ListSnapshotsRequest::page_token].
10925    ///
10926    /// # Example
10927    /// ```ignore,no_run
10928    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10929    /// let x = ListSnapshotsRequest::new().set_page_token("example");
10930    /// ```
10931    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10932        self.page_token = v.into();
10933        self
10934    }
10935
10936    /// Sets the value of [order_by][crate::model::ListSnapshotsRequest::order_by].
10937    ///
10938    /// # Example
10939    /// ```ignore,no_run
10940    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10941    /// let x = ListSnapshotsRequest::new().set_order_by("example");
10942    /// ```
10943    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10944        self.order_by = v.into();
10945        self
10946    }
10947
10948    /// Sets the value of [filter][crate::model::ListSnapshotsRequest::filter].
10949    ///
10950    /// # Example
10951    /// ```ignore,no_run
10952    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10953    /// let x = ListSnapshotsRequest::new().set_filter("example");
10954    /// ```
10955    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10956        self.filter = v.into();
10957        self
10958    }
10959}
10960
10961impl wkt::message::Message for ListSnapshotsRequest {
10962    fn typename() -> &'static str {
10963        "type.googleapis.com/google.cloud.netapp.v1.ListSnapshotsRequest"
10964    }
10965}
10966
10967/// ListSnapshotsResponse is the result of ListSnapshotsRequest.
10968#[derive(Clone, Default, PartialEq)]
10969#[non_exhaustive]
10970pub struct ListSnapshotsResponse {
10971    /// A list of snapshots in the project for the specified volume.
10972    pub snapshots: std::vec::Vec<crate::model::Snapshot>,
10973
10974    /// The token you can use to retrieve the next page of results. Not returned
10975    /// if there are no more results in the list.
10976    pub next_page_token: std::string::String,
10977
10978    /// Locations that could not be reached.
10979    pub unreachable: std::vec::Vec<std::string::String>,
10980
10981    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10982}
10983
10984impl ListSnapshotsResponse {
10985    /// Creates a new default instance.
10986    pub fn new() -> Self {
10987        std::default::Default::default()
10988    }
10989
10990    /// Sets the value of [snapshots][crate::model::ListSnapshotsResponse::snapshots].
10991    ///
10992    /// # Example
10993    /// ```ignore,no_run
10994    /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
10995    /// use google_cloud_netapp_v1::model::Snapshot;
10996    /// let x = ListSnapshotsResponse::new()
10997    ///     .set_snapshots([
10998    ///         Snapshot::default()/* use setters */,
10999    ///         Snapshot::default()/* use (different) setters */,
11000    ///     ]);
11001    /// ```
11002    pub fn set_snapshots<T, V>(mut self, v: T) -> Self
11003    where
11004        T: std::iter::IntoIterator<Item = V>,
11005        V: std::convert::Into<crate::model::Snapshot>,
11006    {
11007        use std::iter::Iterator;
11008        self.snapshots = v.into_iter().map(|i| i.into()).collect();
11009        self
11010    }
11011
11012    /// Sets the value of [next_page_token][crate::model::ListSnapshotsResponse::next_page_token].
11013    ///
11014    /// # Example
11015    /// ```ignore,no_run
11016    /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
11017    /// let x = ListSnapshotsResponse::new().set_next_page_token("example");
11018    /// ```
11019    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11020        self.next_page_token = v.into();
11021        self
11022    }
11023
11024    /// Sets the value of [unreachable][crate::model::ListSnapshotsResponse::unreachable].
11025    ///
11026    /// # Example
11027    /// ```ignore,no_run
11028    /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
11029    /// let x = ListSnapshotsResponse::new().set_unreachable(["a", "b", "c"]);
11030    /// ```
11031    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11032    where
11033        T: std::iter::IntoIterator<Item = V>,
11034        V: std::convert::Into<std::string::String>,
11035    {
11036        use std::iter::Iterator;
11037        self.unreachable = v.into_iter().map(|i| i.into()).collect();
11038        self
11039    }
11040}
11041
11042impl wkt::message::Message for ListSnapshotsResponse {
11043    fn typename() -> &'static str {
11044        "type.googleapis.com/google.cloud.netapp.v1.ListSnapshotsResponse"
11045    }
11046}
11047
11048#[doc(hidden)]
11049impl google_cloud_gax::paginator::internal::PageableResponse for ListSnapshotsResponse {
11050    type PageItem = crate::model::Snapshot;
11051
11052    fn items(self) -> std::vec::Vec<Self::PageItem> {
11053        self.snapshots
11054    }
11055
11056    fn next_page_token(&self) -> std::string::String {
11057        use std::clone::Clone;
11058        self.next_page_token.clone()
11059    }
11060}
11061
11062/// GetSnapshotRequest gets the state of a snapshot.
11063#[derive(Clone, Default, PartialEq)]
11064#[non_exhaustive]
11065pub struct GetSnapshotRequest {
11066    /// Required. The snapshot resource name, in the format
11067    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`
11068    pub name: std::string::String,
11069
11070    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11071}
11072
11073impl GetSnapshotRequest {
11074    /// Creates a new default instance.
11075    pub fn new() -> Self {
11076        std::default::Default::default()
11077    }
11078
11079    /// Sets the value of [name][crate::model::GetSnapshotRequest::name].
11080    ///
11081    /// # Example
11082    /// ```ignore,no_run
11083    /// # use google_cloud_netapp_v1::model::GetSnapshotRequest;
11084    /// # let project_id = "project_id";
11085    /// # let location_id = "location_id";
11086    /// # let volume_id = "volume_id";
11087    /// # let snapshot_id = "snapshot_id";
11088    /// let x = GetSnapshotRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}"));
11089    /// ```
11090    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11091        self.name = v.into();
11092        self
11093    }
11094}
11095
11096impl wkt::message::Message for GetSnapshotRequest {
11097    fn typename() -> &'static str {
11098        "type.googleapis.com/google.cloud.netapp.v1.GetSnapshotRequest"
11099    }
11100}
11101
11102/// CreateSnapshotRequest creates a snapshot.
11103#[derive(Clone, Default, PartialEq)]
11104#[non_exhaustive]
11105pub struct CreateSnapshotRequest {
11106    /// Required. The NetApp volume to create the snapshots of, in the format
11107    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
11108    pub parent: std::string::String,
11109
11110    /// Required. A snapshot resource
11111    pub snapshot: std::option::Option<crate::model::Snapshot>,
11112
11113    /// Required. ID of the snapshot to create. Must be unique within the parent
11114    /// resource. Must contain only letters, numbers and hyphen, with the first
11115    /// character a letter, the last a letter or a
11116    /// number, and a 63 character maximum.
11117    pub snapshot_id: std::string::String,
11118
11119    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11120}
11121
11122impl CreateSnapshotRequest {
11123    /// Creates a new default instance.
11124    pub fn new() -> Self {
11125        std::default::Default::default()
11126    }
11127
11128    /// Sets the value of [parent][crate::model::CreateSnapshotRequest::parent].
11129    ///
11130    /// # Example
11131    /// ```ignore,no_run
11132    /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
11133    /// # let project_id = "project_id";
11134    /// # let location_id = "location_id";
11135    /// # let volume_id = "volume_id";
11136    /// let x = CreateSnapshotRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
11137    /// ```
11138    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11139        self.parent = v.into();
11140        self
11141    }
11142
11143    /// Sets the value of [snapshot][crate::model::CreateSnapshotRequest::snapshot].
11144    ///
11145    /// # Example
11146    /// ```ignore,no_run
11147    /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
11148    /// use google_cloud_netapp_v1::model::Snapshot;
11149    /// let x = CreateSnapshotRequest::new().set_snapshot(Snapshot::default()/* use setters */);
11150    /// ```
11151    pub fn set_snapshot<T>(mut self, v: T) -> Self
11152    where
11153        T: std::convert::Into<crate::model::Snapshot>,
11154    {
11155        self.snapshot = std::option::Option::Some(v.into());
11156        self
11157    }
11158
11159    /// Sets or clears the value of [snapshot][crate::model::CreateSnapshotRequest::snapshot].
11160    ///
11161    /// # Example
11162    /// ```ignore,no_run
11163    /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
11164    /// use google_cloud_netapp_v1::model::Snapshot;
11165    /// let x = CreateSnapshotRequest::new().set_or_clear_snapshot(Some(Snapshot::default()/* use setters */));
11166    /// let x = CreateSnapshotRequest::new().set_or_clear_snapshot(None::<Snapshot>);
11167    /// ```
11168    pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
11169    where
11170        T: std::convert::Into<crate::model::Snapshot>,
11171    {
11172        self.snapshot = v.map(|x| x.into());
11173        self
11174    }
11175
11176    /// Sets the value of [snapshot_id][crate::model::CreateSnapshotRequest::snapshot_id].
11177    ///
11178    /// # Example
11179    /// ```ignore,no_run
11180    /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
11181    /// let x = CreateSnapshotRequest::new().set_snapshot_id("example");
11182    /// ```
11183    pub fn set_snapshot_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11184        self.snapshot_id = v.into();
11185        self
11186    }
11187}
11188
11189impl wkt::message::Message for CreateSnapshotRequest {
11190    fn typename() -> &'static str {
11191        "type.googleapis.com/google.cloud.netapp.v1.CreateSnapshotRequest"
11192    }
11193}
11194
11195/// DeleteSnapshotRequest deletes a snapshot.
11196#[derive(Clone, Default, PartialEq)]
11197#[non_exhaustive]
11198pub struct DeleteSnapshotRequest {
11199    /// Required. The snapshot resource name, in the format
11200    /// `projects/*/locations/*/volumes/*/snapshots/{snapshot_id}`
11201    pub name: std::string::String,
11202
11203    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11204}
11205
11206impl DeleteSnapshotRequest {
11207    /// Creates a new default instance.
11208    pub fn new() -> Self {
11209        std::default::Default::default()
11210    }
11211
11212    /// Sets the value of [name][crate::model::DeleteSnapshotRequest::name].
11213    ///
11214    /// # Example
11215    /// ```ignore,no_run
11216    /// # use google_cloud_netapp_v1::model::DeleteSnapshotRequest;
11217    /// # let project_id = "project_id";
11218    /// # let location_id = "location_id";
11219    /// # let volume_id = "volume_id";
11220    /// # let snapshot_id = "snapshot_id";
11221    /// let x = DeleteSnapshotRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}"));
11222    /// ```
11223    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11224        self.name = v.into();
11225        self
11226    }
11227}
11228
11229impl wkt::message::Message for DeleteSnapshotRequest {
11230    fn typename() -> &'static str {
11231        "type.googleapis.com/google.cloud.netapp.v1.DeleteSnapshotRequest"
11232    }
11233}
11234
11235/// UpdateSnapshotRequest updates description and/or labels for a snapshot.
11236#[derive(Clone, Default, PartialEq)]
11237#[non_exhaustive]
11238pub struct UpdateSnapshotRequest {
11239    /// Required. Mask of fields to update.  At least one path must be supplied in
11240    /// this field.
11241    pub update_mask: std::option::Option<wkt::FieldMask>,
11242
11243    /// Required. A snapshot resource
11244    pub snapshot: std::option::Option<crate::model::Snapshot>,
11245
11246    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11247}
11248
11249impl UpdateSnapshotRequest {
11250    /// Creates a new default instance.
11251    pub fn new() -> Self {
11252        std::default::Default::default()
11253    }
11254
11255    /// Sets the value of [update_mask][crate::model::UpdateSnapshotRequest::update_mask].
11256    ///
11257    /// # Example
11258    /// ```ignore,no_run
11259    /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
11260    /// use wkt::FieldMask;
11261    /// let x = UpdateSnapshotRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11262    /// ```
11263    pub fn set_update_mask<T>(mut self, v: T) -> Self
11264    where
11265        T: std::convert::Into<wkt::FieldMask>,
11266    {
11267        self.update_mask = std::option::Option::Some(v.into());
11268        self
11269    }
11270
11271    /// Sets or clears the value of [update_mask][crate::model::UpdateSnapshotRequest::update_mask].
11272    ///
11273    /// # Example
11274    /// ```ignore,no_run
11275    /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
11276    /// use wkt::FieldMask;
11277    /// let x = UpdateSnapshotRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11278    /// let x = UpdateSnapshotRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11279    /// ```
11280    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11281    where
11282        T: std::convert::Into<wkt::FieldMask>,
11283    {
11284        self.update_mask = v.map(|x| x.into());
11285        self
11286    }
11287
11288    /// Sets the value of [snapshot][crate::model::UpdateSnapshotRequest::snapshot].
11289    ///
11290    /// # Example
11291    /// ```ignore,no_run
11292    /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
11293    /// use google_cloud_netapp_v1::model::Snapshot;
11294    /// let x = UpdateSnapshotRequest::new().set_snapshot(Snapshot::default()/* use setters */);
11295    /// ```
11296    pub fn set_snapshot<T>(mut self, v: T) -> Self
11297    where
11298        T: std::convert::Into<crate::model::Snapshot>,
11299    {
11300        self.snapshot = std::option::Option::Some(v.into());
11301        self
11302    }
11303
11304    /// Sets or clears the value of [snapshot][crate::model::UpdateSnapshotRequest::snapshot].
11305    ///
11306    /// # Example
11307    /// ```ignore,no_run
11308    /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
11309    /// use google_cloud_netapp_v1::model::Snapshot;
11310    /// let x = UpdateSnapshotRequest::new().set_or_clear_snapshot(Some(Snapshot::default()/* use setters */));
11311    /// let x = UpdateSnapshotRequest::new().set_or_clear_snapshot(None::<Snapshot>);
11312    /// ```
11313    pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
11314    where
11315        T: std::convert::Into<crate::model::Snapshot>,
11316    {
11317        self.snapshot = v.map(|x| x.into());
11318        self
11319    }
11320}
11321
11322impl wkt::message::Message for UpdateSnapshotRequest {
11323    fn typename() -> &'static str {
11324        "type.googleapis.com/google.cloud.netapp.v1.UpdateSnapshotRequest"
11325    }
11326}
11327
11328/// Snapshot is a point-in-time version of a Volume's content.
11329#[derive(Clone, Default, PartialEq)]
11330#[non_exhaustive]
11331pub struct Snapshot {
11332    /// Identifier. The resource name of the snapshot.
11333    /// Format:
11334    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`.
11335    pub name: std::string::String,
11336
11337    /// Output only. The snapshot state.
11338    pub state: crate::model::snapshot::State,
11339
11340    /// Output only. State details of the storage pool
11341    pub state_details: std::string::String,
11342
11343    /// A description of the snapshot with 2048 characters or less.
11344    /// Requests with longer descriptions will be rejected.
11345    pub description: std::string::String,
11346
11347    /// Output only. Current storage usage for the snapshot in bytes.
11348    pub used_bytes: f64,
11349
11350    /// Output only. The time when the snapshot was created.
11351    pub create_time: std::option::Option<wkt::Timestamp>,
11352
11353    /// Resource labels to represent user provided metadata.
11354    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11355
11356    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11357}
11358
11359impl Snapshot {
11360    /// Creates a new default instance.
11361    pub fn new() -> Self {
11362        std::default::Default::default()
11363    }
11364
11365    /// Sets the value of [name][crate::model::Snapshot::name].
11366    ///
11367    /// # Example
11368    /// ```ignore,no_run
11369    /// # use google_cloud_netapp_v1::model::Snapshot;
11370    /// # let project_id = "project_id";
11371    /// # let location_id = "location_id";
11372    /// # let volume_id = "volume_id";
11373    /// # let snapshot_id = "snapshot_id";
11374    /// let x = Snapshot::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}"));
11375    /// ```
11376    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11377        self.name = v.into();
11378        self
11379    }
11380
11381    /// Sets the value of [state][crate::model::Snapshot::state].
11382    ///
11383    /// # Example
11384    /// ```ignore,no_run
11385    /// # use google_cloud_netapp_v1::model::Snapshot;
11386    /// use google_cloud_netapp_v1::model::snapshot::State;
11387    /// let x0 = Snapshot::new().set_state(State::Ready);
11388    /// let x1 = Snapshot::new().set_state(State::Creating);
11389    /// let x2 = Snapshot::new().set_state(State::Deleting);
11390    /// ```
11391    pub fn set_state<T: std::convert::Into<crate::model::snapshot::State>>(mut self, v: T) -> Self {
11392        self.state = v.into();
11393        self
11394    }
11395
11396    /// Sets the value of [state_details][crate::model::Snapshot::state_details].
11397    ///
11398    /// # Example
11399    /// ```ignore,no_run
11400    /// # use google_cloud_netapp_v1::model::Snapshot;
11401    /// let x = Snapshot::new().set_state_details("example");
11402    /// ```
11403    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11404        self.state_details = v.into();
11405        self
11406    }
11407
11408    /// Sets the value of [description][crate::model::Snapshot::description].
11409    ///
11410    /// # Example
11411    /// ```ignore,no_run
11412    /// # use google_cloud_netapp_v1::model::Snapshot;
11413    /// let x = Snapshot::new().set_description("example");
11414    /// ```
11415    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11416        self.description = v.into();
11417        self
11418    }
11419
11420    /// Sets the value of [used_bytes][crate::model::Snapshot::used_bytes].
11421    ///
11422    /// # Example
11423    /// ```ignore,no_run
11424    /// # use google_cloud_netapp_v1::model::Snapshot;
11425    /// let x = Snapshot::new().set_used_bytes(42.0);
11426    /// ```
11427    pub fn set_used_bytes<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11428        self.used_bytes = v.into();
11429        self
11430    }
11431
11432    /// Sets the value of [create_time][crate::model::Snapshot::create_time].
11433    ///
11434    /// # Example
11435    /// ```ignore,no_run
11436    /// # use google_cloud_netapp_v1::model::Snapshot;
11437    /// use wkt::Timestamp;
11438    /// let x = Snapshot::new().set_create_time(Timestamp::default()/* use setters */);
11439    /// ```
11440    pub fn set_create_time<T>(mut self, v: T) -> Self
11441    where
11442        T: std::convert::Into<wkt::Timestamp>,
11443    {
11444        self.create_time = std::option::Option::Some(v.into());
11445        self
11446    }
11447
11448    /// Sets or clears the value of [create_time][crate::model::Snapshot::create_time].
11449    ///
11450    /// # Example
11451    /// ```ignore,no_run
11452    /// # use google_cloud_netapp_v1::model::Snapshot;
11453    /// use wkt::Timestamp;
11454    /// let x = Snapshot::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11455    /// let x = Snapshot::new().set_or_clear_create_time(None::<Timestamp>);
11456    /// ```
11457    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11458    where
11459        T: std::convert::Into<wkt::Timestamp>,
11460    {
11461        self.create_time = v.map(|x| x.into());
11462        self
11463    }
11464
11465    /// Sets the value of [labels][crate::model::Snapshot::labels].
11466    ///
11467    /// # Example
11468    /// ```ignore,no_run
11469    /// # use google_cloud_netapp_v1::model::Snapshot;
11470    /// let x = Snapshot::new().set_labels([
11471    ///     ("key0", "abc"),
11472    ///     ("key1", "xyz"),
11473    /// ]);
11474    /// ```
11475    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11476    where
11477        T: std::iter::IntoIterator<Item = (K, V)>,
11478        K: std::convert::Into<std::string::String>,
11479        V: std::convert::Into<std::string::String>,
11480    {
11481        use std::iter::Iterator;
11482        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11483        self
11484    }
11485}
11486
11487impl wkt::message::Message for Snapshot {
11488    fn typename() -> &'static str {
11489        "type.googleapis.com/google.cloud.netapp.v1.Snapshot"
11490    }
11491}
11492
11493/// Defines additional types related to [Snapshot].
11494pub mod snapshot {
11495    #[allow(unused_imports)]
11496    use super::*;
11497
11498    /// The Snapshot States
11499    ///
11500    /// # Working with unknown values
11501    ///
11502    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
11503    /// additional enum variants at any time. Adding new variants is not considered
11504    /// a breaking change. Applications should write their code in anticipation of:
11505    ///
11506    /// - New values appearing in future releases of the client library, **and**
11507    /// - New values received dynamically, without application changes.
11508    ///
11509    /// Please consult the [Working with enums] section in the user guide for some
11510    /// guidelines.
11511    ///
11512    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
11513    #[derive(Clone, Debug, PartialEq)]
11514    #[non_exhaustive]
11515    pub enum State {
11516        /// Unspecified Snapshot State
11517        Unspecified,
11518        /// Snapshot State is Ready
11519        Ready,
11520        /// Snapshot State is Creating
11521        Creating,
11522        /// Snapshot State is Deleting
11523        Deleting,
11524        /// Snapshot State is Updating
11525        Updating,
11526        /// Snapshot State is Disabled
11527        Disabled,
11528        /// Snapshot State is Error
11529        Error,
11530        /// If set, the enum was initialized with an unknown value.
11531        ///
11532        /// Applications can examine the value using [State::value] or
11533        /// [State::name].
11534        UnknownValue(state::UnknownValue),
11535    }
11536
11537    #[doc(hidden)]
11538    pub mod state {
11539        #[allow(unused_imports)]
11540        use super::*;
11541        #[derive(Clone, Debug, PartialEq)]
11542        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
11543    }
11544
11545    impl State {
11546        /// Gets the enum value.
11547        ///
11548        /// Returns `None` if the enum contains an unknown value deserialized from
11549        /// the string representation of enums.
11550        pub fn value(&self) -> std::option::Option<i32> {
11551            match self {
11552                Self::Unspecified => std::option::Option::Some(0),
11553                Self::Ready => std::option::Option::Some(1),
11554                Self::Creating => std::option::Option::Some(2),
11555                Self::Deleting => std::option::Option::Some(3),
11556                Self::Updating => std::option::Option::Some(4),
11557                Self::Disabled => std::option::Option::Some(5),
11558                Self::Error => std::option::Option::Some(6),
11559                Self::UnknownValue(u) => u.0.value(),
11560            }
11561        }
11562
11563        /// Gets the enum value as a string.
11564        ///
11565        /// Returns `None` if the enum contains an unknown value deserialized from
11566        /// the integer representation of enums.
11567        pub fn name(&self) -> std::option::Option<&str> {
11568            match self {
11569                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
11570                Self::Ready => std::option::Option::Some("READY"),
11571                Self::Creating => std::option::Option::Some("CREATING"),
11572                Self::Deleting => std::option::Option::Some("DELETING"),
11573                Self::Updating => std::option::Option::Some("UPDATING"),
11574                Self::Disabled => std::option::Option::Some("DISABLED"),
11575                Self::Error => std::option::Option::Some("ERROR"),
11576                Self::UnknownValue(u) => u.0.name(),
11577            }
11578        }
11579    }
11580
11581    impl std::default::Default for State {
11582        fn default() -> Self {
11583            use std::convert::From;
11584            Self::from(0)
11585        }
11586    }
11587
11588    impl std::fmt::Display for State {
11589        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
11590            wkt::internal::display_enum(f, self.name(), self.value())
11591        }
11592    }
11593
11594    impl std::convert::From<i32> for State {
11595        fn from(value: i32) -> Self {
11596            match value {
11597                0 => Self::Unspecified,
11598                1 => Self::Ready,
11599                2 => Self::Creating,
11600                3 => Self::Deleting,
11601                4 => Self::Updating,
11602                5 => Self::Disabled,
11603                6 => Self::Error,
11604                _ => Self::UnknownValue(state::UnknownValue(
11605                    wkt::internal::UnknownEnumValue::Integer(value),
11606                )),
11607            }
11608        }
11609    }
11610
11611    impl std::convert::From<&str> for State {
11612        fn from(value: &str) -> Self {
11613            use std::string::ToString;
11614            match value {
11615                "STATE_UNSPECIFIED" => Self::Unspecified,
11616                "READY" => Self::Ready,
11617                "CREATING" => Self::Creating,
11618                "DELETING" => Self::Deleting,
11619                "UPDATING" => Self::Updating,
11620                "DISABLED" => Self::Disabled,
11621                "ERROR" => Self::Error,
11622                _ => Self::UnknownValue(state::UnknownValue(
11623                    wkt::internal::UnknownEnumValue::String(value.to_string()),
11624                )),
11625            }
11626        }
11627    }
11628
11629    impl serde::ser::Serialize for State {
11630        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
11631        where
11632            S: serde::Serializer,
11633        {
11634            match self {
11635                Self::Unspecified => serializer.serialize_i32(0),
11636                Self::Ready => serializer.serialize_i32(1),
11637                Self::Creating => serializer.serialize_i32(2),
11638                Self::Deleting => serializer.serialize_i32(3),
11639                Self::Updating => serializer.serialize_i32(4),
11640                Self::Disabled => serializer.serialize_i32(5),
11641                Self::Error => serializer.serialize_i32(6),
11642                Self::UnknownValue(u) => u.0.serialize(serializer),
11643            }
11644        }
11645    }
11646
11647    impl<'de> serde::de::Deserialize<'de> for State {
11648        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11649        where
11650            D: serde::Deserializer<'de>,
11651        {
11652            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11653                ".google.cloud.netapp.v1.Snapshot.State",
11654            ))
11655        }
11656    }
11657}
11658
11659/// GetStoragePoolRequest gets a Storage Pool.
11660#[derive(Clone, Default, PartialEq)]
11661#[non_exhaustive]
11662pub struct GetStoragePoolRequest {
11663    /// Required. Name of the storage pool
11664    pub name: std::string::String,
11665
11666    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11667}
11668
11669impl GetStoragePoolRequest {
11670    /// Creates a new default instance.
11671    pub fn new() -> Self {
11672        std::default::Default::default()
11673    }
11674
11675    /// Sets the value of [name][crate::model::GetStoragePoolRequest::name].
11676    ///
11677    /// # Example
11678    /// ```ignore,no_run
11679    /// # use google_cloud_netapp_v1::model::GetStoragePoolRequest;
11680    /// # let project_id = "project_id";
11681    /// # let location_id = "location_id";
11682    /// # let storage_pool_id = "storage_pool_id";
11683    /// let x = GetStoragePoolRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/storagePools/{storage_pool_id}"));
11684    /// ```
11685    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11686        self.name = v.into();
11687        self
11688    }
11689}
11690
11691impl wkt::message::Message for GetStoragePoolRequest {
11692    fn typename() -> &'static str {
11693        "type.googleapis.com/google.cloud.netapp.v1.GetStoragePoolRequest"
11694    }
11695}
11696
11697/// ListStoragePoolsRequest lists Storage Pools.
11698#[derive(Clone, Default, PartialEq)]
11699#[non_exhaustive]
11700pub struct ListStoragePoolsRequest {
11701    /// Required. Parent value
11702    pub parent: std::string::String,
11703
11704    /// Optional. The maximum number of items to return.
11705    pub page_size: i32,
11706
11707    /// Optional. The next_page_token value to use if there are additional
11708    /// results to retrieve for this list request.
11709    pub page_token: std::string::String,
11710
11711    /// Optional. Sort results. Supported values are "name", "name desc" or ""
11712    /// (unsorted).
11713    pub order_by: std::string::String,
11714
11715    /// Optional. List filter.
11716    pub filter: std::string::String,
11717
11718    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11719}
11720
11721impl ListStoragePoolsRequest {
11722    /// Creates a new default instance.
11723    pub fn new() -> Self {
11724        std::default::Default::default()
11725    }
11726
11727    /// Sets the value of [parent][crate::model::ListStoragePoolsRequest::parent].
11728    ///
11729    /// # Example
11730    /// ```ignore,no_run
11731    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11732    /// # let project_id = "project_id";
11733    /// # let location_id = "location_id";
11734    /// let x = ListStoragePoolsRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
11735    /// ```
11736    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11737        self.parent = v.into();
11738        self
11739    }
11740
11741    /// Sets the value of [page_size][crate::model::ListStoragePoolsRequest::page_size].
11742    ///
11743    /// # Example
11744    /// ```ignore,no_run
11745    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11746    /// let x = ListStoragePoolsRequest::new().set_page_size(42);
11747    /// ```
11748    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11749        self.page_size = v.into();
11750        self
11751    }
11752
11753    /// Sets the value of [page_token][crate::model::ListStoragePoolsRequest::page_token].
11754    ///
11755    /// # Example
11756    /// ```ignore,no_run
11757    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11758    /// let x = ListStoragePoolsRequest::new().set_page_token("example");
11759    /// ```
11760    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11761        self.page_token = v.into();
11762        self
11763    }
11764
11765    /// Sets the value of [order_by][crate::model::ListStoragePoolsRequest::order_by].
11766    ///
11767    /// # Example
11768    /// ```ignore,no_run
11769    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11770    /// let x = ListStoragePoolsRequest::new().set_order_by("example");
11771    /// ```
11772    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11773        self.order_by = v.into();
11774        self
11775    }
11776
11777    /// Sets the value of [filter][crate::model::ListStoragePoolsRequest::filter].
11778    ///
11779    /// # Example
11780    /// ```ignore,no_run
11781    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11782    /// let x = ListStoragePoolsRequest::new().set_filter("example");
11783    /// ```
11784    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11785        self.filter = v.into();
11786        self
11787    }
11788}
11789
11790impl wkt::message::Message for ListStoragePoolsRequest {
11791    fn typename() -> &'static str {
11792        "type.googleapis.com/google.cloud.netapp.v1.ListStoragePoolsRequest"
11793    }
11794}
11795
11796/// ListStoragePoolsResponse is the response to a ListStoragePoolsRequest.
11797#[derive(Clone, Default, PartialEq)]
11798#[non_exhaustive]
11799pub struct ListStoragePoolsResponse {
11800    /// The list of StoragePools
11801    pub storage_pools: std::vec::Vec<crate::model::StoragePool>,
11802
11803    /// A token identifying a page of results the server should return.
11804    pub next_page_token: std::string::String,
11805
11806    /// Locations that could not be reached.
11807    pub unreachable: std::vec::Vec<std::string::String>,
11808
11809    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11810}
11811
11812impl ListStoragePoolsResponse {
11813    /// Creates a new default instance.
11814    pub fn new() -> Self {
11815        std::default::Default::default()
11816    }
11817
11818    /// Sets the value of [storage_pools][crate::model::ListStoragePoolsResponse::storage_pools].
11819    ///
11820    /// # Example
11821    /// ```ignore,no_run
11822    /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
11823    /// use google_cloud_netapp_v1::model::StoragePool;
11824    /// let x = ListStoragePoolsResponse::new()
11825    ///     .set_storage_pools([
11826    ///         StoragePool::default()/* use setters */,
11827    ///         StoragePool::default()/* use (different) setters */,
11828    ///     ]);
11829    /// ```
11830    pub fn set_storage_pools<T, V>(mut self, v: T) -> Self
11831    where
11832        T: std::iter::IntoIterator<Item = V>,
11833        V: std::convert::Into<crate::model::StoragePool>,
11834    {
11835        use std::iter::Iterator;
11836        self.storage_pools = v.into_iter().map(|i| i.into()).collect();
11837        self
11838    }
11839
11840    /// Sets the value of [next_page_token][crate::model::ListStoragePoolsResponse::next_page_token].
11841    ///
11842    /// # Example
11843    /// ```ignore,no_run
11844    /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
11845    /// let x = ListStoragePoolsResponse::new().set_next_page_token("example");
11846    /// ```
11847    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11848        self.next_page_token = v.into();
11849        self
11850    }
11851
11852    /// Sets the value of [unreachable][crate::model::ListStoragePoolsResponse::unreachable].
11853    ///
11854    /// # Example
11855    /// ```ignore,no_run
11856    /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
11857    /// let x = ListStoragePoolsResponse::new().set_unreachable(["a", "b", "c"]);
11858    /// ```
11859    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11860    where
11861        T: std::iter::IntoIterator<Item = V>,
11862        V: std::convert::Into<std::string::String>,
11863    {
11864        use std::iter::Iterator;
11865        self.unreachable = v.into_iter().map(|i| i.into()).collect();
11866        self
11867    }
11868}
11869
11870impl wkt::message::Message for ListStoragePoolsResponse {
11871    fn typename() -> &'static str {
11872        "type.googleapis.com/google.cloud.netapp.v1.ListStoragePoolsResponse"
11873    }
11874}
11875
11876#[doc(hidden)]
11877impl google_cloud_gax::paginator::internal::PageableResponse for ListStoragePoolsResponse {
11878    type PageItem = crate::model::StoragePool;
11879
11880    fn items(self) -> std::vec::Vec<Self::PageItem> {
11881        self.storage_pools
11882    }
11883
11884    fn next_page_token(&self) -> std::string::String {
11885        use std::clone::Clone;
11886        self.next_page_token.clone()
11887    }
11888}
11889
11890/// CreateStoragePoolRequest creates a Storage Pool.
11891#[derive(Clone, Default, PartialEq)]
11892#[non_exhaustive]
11893pub struct CreateStoragePoolRequest {
11894    /// Required. Value for parent.
11895    pub parent: std::string::String,
11896
11897    /// Required. Id of the requesting storage pool. Must be unique within the
11898    /// parent resource. Must contain only letters, numbers and hyphen, with the
11899    /// first character a letter, the last a letter or a number, and a 63 character
11900    /// maximum.
11901    pub storage_pool_id: std::string::String,
11902
11903    /// Required. The required parameters to create a new storage pool.
11904    pub storage_pool: std::option::Option<crate::model::StoragePool>,
11905
11906    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11907}
11908
11909impl CreateStoragePoolRequest {
11910    /// Creates a new default instance.
11911    pub fn new() -> Self {
11912        std::default::Default::default()
11913    }
11914
11915    /// Sets the value of [parent][crate::model::CreateStoragePoolRequest::parent].
11916    ///
11917    /// # Example
11918    /// ```ignore,no_run
11919    /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11920    /// # let project_id = "project_id";
11921    /// # let location_id = "location_id";
11922    /// let x = CreateStoragePoolRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
11923    /// ```
11924    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11925        self.parent = v.into();
11926        self
11927    }
11928
11929    /// Sets the value of [storage_pool_id][crate::model::CreateStoragePoolRequest::storage_pool_id].
11930    ///
11931    /// # Example
11932    /// ```ignore,no_run
11933    /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11934    /// let x = CreateStoragePoolRequest::new().set_storage_pool_id("example");
11935    /// ```
11936    pub fn set_storage_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11937        self.storage_pool_id = v.into();
11938        self
11939    }
11940
11941    /// Sets the value of [storage_pool][crate::model::CreateStoragePoolRequest::storage_pool].
11942    ///
11943    /// # Example
11944    /// ```ignore,no_run
11945    /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11946    /// use google_cloud_netapp_v1::model::StoragePool;
11947    /// let x = CreateStoragePoolRequest::new().set_storage_pool(StoragePool::default()/* use setters */);
11948    /// ```
11949    pub fn set_storage_pool<T>(mut self, v: T) -> Self
11950    where
11951        T: std::convert::Into<crate::model::StoragePool>,
11952    {
11953        self.storage_pool = std::option::Option::Some(v.into());
11954        self
11955    }
11956
11957    /// Sets or clears the value of [storage_pool][crate::model::CreateStoragePoolRequest::storage_pool].
11958    ///
11959    /// # Example
11960    /// ```ignore,no_run
11961    /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11962    /// use google_cloud_netapp_v1::model::StoragePool;
11963    /// let x = CreateStoragePoolRequest::new().set_or_clear_storage_pool(Some(StoragePool::default()/* use setters */));
11964    /// let x = CreateStoragePoolRequest::new().set_or_clear_storage_pool(None::<StoragePool>);
11965    /// ```
11966    pub fn set_or_clear_storage_pool<T>(mut self, v: std::option::Option<T>) -> Self
11967    where
11968        T: std::convert::Into<crate::model::StoragePool>,
11969    {
11970        self.storage_pool = v.map(|x| x.into());
11971        self
11972    }
11973}
11974
11975impl wkt::message::Message for CreateStoragePoolRequest {
11976    fn typename() -> &'static str {
11977        "type.googleapis.com/google.cloud.netapp.v1.CreateStoragePoolRequest"
11978    }
11979}
11980
11981/// UpdateStoragePoolRequest updates a Storage Pool.
11982#[derive(Clone, Default, PartialEq)]
11983#[non_exhaustive]
11984pub struct UpdateStoragePoolRequest {
11985    /// Required. Field mask is used to specify the fields to be overwritten in the
11986    /// StoragePool resource by the update.
11987    /// The fields specified in the update_mask are relative to the resource, not
11988    /// the full request. A field will be overwritten if it is in the mask. If the
11989    /// user does not provide a mask then all fields will be overwritten.
11990    pub update_mask: std::option::Option<wkt::FieldMask>,
11991
11992    /// Required. The pool being updated
11993    pub storage_pool: std::option::Option<crate::model::StoragePool>,
11994
11995    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11996}
11997
11998impl UpdateStoragePoolRequest {
11999    /// Creates a new default instance.
12000    pub fn new() -> Self {
12001        std::default::Default::default()
12002    }
12003
12004    /// Sets the value of [update_mask][crate::model::UpdateStoragePoolRequest::update_mask].
12005    ///
12006    /// # Example
12007    /// ```ignore,no_run
12008    /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
12009    /// use wkt::FieldMask;
12010    /// let x = UpdateStoragePoolRequest::new().set_update_mask(FieldMask::default()/* use setters */);
12011    /// ```
12012    pub fn set_update_mask<T>(mut self, v: T) -> Self
12013    where
12014        T: std::convert::Into<wkt::FieldMask>,
12015    {
12016        self.update_mask = std::option::Option::Some(v.into());
12017        self
12018    }
12019
12020    /// Sets or clears the value of [update_mask][crate::model::UpdateStoragePoolRequest::update_mask].
12021    ///
12022    /// # Example
12023    /// ```ignore,no_run
12024    /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
12025    /// use wkt::FieldMask;
12026    /// let x = UpdateStoragePoolRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
12027    /// let x = UpdateStoragePoolRequest::new().set_or_clear_update_mask(None::<FieldMask>);
12028    /// ```
12029    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12030    where
12031        T: std::convert::Into<wkt::FieldMask>,
12032    {
12033        self.update_mask = v.map(|x| x.into());
12034        self
12035    }
12036
12037    /// Sets the value of [storage_pool][crate::model::UpdateStoragePoolRequest::storage_pool].
12038    ///
12039    /// # Example
12040    /// ```ignore,no_run
12041    /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
12042    /// use google_cloud_netapp_v1::model::StoragePool;
12043    /// let x = UpdateStoragePoolRequest::new().set_storage_pool(StoragePool::default()/* use setters */);
12044    /// ```
12045    pub fn set_storage_pool<T>(mut self, v: T) -> Self
12046    where
12047        T: std::convert::Into<crate::model::StoragePool>,
12048    {
12049        self.storage_pool = std::option::Option::Some(v.into());
12050        self
12051    }
12052
12053    /// Sets or clears the value of [storage_pool][crate::model::UpdateStoragePoolRequest::storage_pool].
12054    ///
12055    /// # Example
12056    /// ```ignore,no_run
12057    /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
12058    /// use google_cloud_netapp_v1::model::StoragePool;
12059    /// let x = UpdateStoragePoolRequest::new().set_or_clear_storage_pool(Some(StoragePool::default()/* use setters */));
12060    /// let x = UpdateStoragePoolRequest::new().set_or_clear_storage_pool(None::<StoragePool>);
12061    /// ```
12062    pub fn set_or_clear_storage_pool<T>(mut self, v: std::option::Option<T>) -> Self
12063    where
12064        T: std::convert::Into<crate::model::StoragePool>,
12065    {
12066        self.storage_pool = v.map(|x| x.into());
12067        self
12068    }
12069}
12070
12071impl wkt::message::Message for UpdateStoragePoolRequest {
12072    fn typename() -> &'static str {
12073        "type.googleapis.com/google.cloud.netapp.v1.UpdateStoragePoolRequest"
12074    }
12075}
12076
12077/// DeleteStoragePoolRequest deletes a Storage Pool.
12078#[derive(Clone, Default, PartialEq)]
12079#[non_exhaustive]
12080pub struct DeleteStoragePoolRequest {
12081    /// Required. Name of the storage pool
12082    pub name: std::string::String,
12083
12084    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12085}
12086
12087impl DeleteStoragePoolRequest {
12088    /// Creates a new default instance.
12089    pub fn new() -> Self {
12090        std::default::Default::default()
12091    }
12092
12093    /// Sets the value of [name][crate::model::DeleteStoragePoolRequest::name].
12094    ///
12095    /// # Example
12096    /// ```ignore,no_run
12097    /// # use google_cloud_netapp_v1::model::DeleteStoragePoolRequest;
12098    /// # let project_id = "project_id";
12099    /// # let location_id = "location_id";
12100    /// # let storage_pool_id = "storage_pool_id";
12101    /// let x = DeleteStoragePoolRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/storagePools/{storage_pool_id}"));
12102    /// ```
12103    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12104        self.name = v.into();
12105        self
12106    }
12107}
12108
12109impl wkt::message::Message for DeleteStoragePoolRequest {
12110    fn typename() -> &'static str {
12111        "type.googleapis.com/google.cloud.netapp.v1.DeleteStoragePoolRequest"
12112    }
12113}
12114
12115/// SwitchActiveReplicaZoneRequest switch the active/replica zone for a regional
12116/// storagePool.
12117#[derive(Clone, Default, PartialEq)]
12118#[non_exhaustive]
12119pub struct SwitchActiveReplicaZoneRequest {
12120    /// Required. Name of the storage pool
12121    pub name: std::string::String,
12122
12123    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12124}
12125
12126impl SwitchActiveReplicaZoneRequest {
12127    /// Creates a new default instance.
12128    pub fn new() -> Self {
12129        std::default::Default::default()
12130    }
12131
12132    /// Sets the value of [name][crate::model::SwitchActiveReplicaZoneRequest::name].
12133    ///
12134    /// # Example
12135    /// ```ignore,no_run
12136    /// # use google_cloud_netapp_v1::model::SwitchActiveReplicaZoneRequest;
12137    /// # let project_id = "project_id";
12138    /// # let location_id = "location_id";
12139    /// # let storage_pool_id = "storage_pool_id";
12140    /// let x = SwitchActiveReplicaZoneRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/storagePools/{storage_pool_id}"));
12141    /// ```
12142    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12143        self.name = v.into();
12144        self
12145    }
12146}
12147
12148impl wkt::message::Message for SwitchActiveReplicaZoneRequest {
12149    fn typename() -> &'static str {
12150        "type.googleapis.com/google.cloud.netapp.v1.SwitchActiveReplicaZoneRequest"
12151    }
12152}
12153
12154/// StoragePool is a container for volumes with a service level and capacity.
12155/// Volumes can be created in a pool of sufficient available capacity.
12156/// StoragePool capacity is what you are billed for.
12157#[derive(Clone, Default, PartialEq)]
12158#[non_exhaustive]
12159pub struct StoragePool {
12160    /// Identifier. Name of the storage pool
12161    pub name: std::string::String,
12162
12163    /// Required. Service level of the storage pool
12164    pub service_level: crate::model::ServiceLevel,
12165
12166    /// Required. Capacity in GIB of the pool
12167    pub capacity_gib: i64,
12168
12169    /// Output only. Allocated size of all volumes in GIB in the storage pool
12170    pub volume_capacity_gib: i64,
12171
12172    /// Output only. Volume count of the storage pool
12173    pub volume_count: i32,
12174
12175    /// Output only. State of the storage pool
12176    pub state: crate::model::storage_pool::State,
12177
12178    /// Output only. State details of the storage pool
12179    pub state_details: std::string::String,
12180
12181    /// Output only. Create time of the storage pool
12182    pub create_time: std::option::Option<wkt::Timestamp>,
12183
12184    /// Optional. Description of the storage pool
12185    pub description: std::string::String,
12186
12187    /// Optional. Labels as key value pairs
12188    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12189
12190    /// Required. VPC Network name.
12191    /// Format: projects/{project}/global/networks/{network}
12192    pub network: std::string::String,
12193
12194    /// Optional. Specifies the Active Directory to be used for creating a SMB
12195    /// volume.
12196    pub active_directory: std::string::String,
12197
12198    /// Optional. Specifies the KMS config to be used for volume encryption.
12199    pub kms_config: std::string::String,
12200
12201    /// Optional. Flag indicating if the pool is NFS LDAP enabled or not.
12202    pub ldap_enabled: bool,
12203
12204    /// Optional. This field is not implemented. The values provided in this field
12205    /// are ignored.
12206    pub psa_range: std::string::String,
12207
12208    /// Output only. Specifies the current pool encryption key source.
12209    pub encryption_type: crate::model::EncryptionType,
12210
12211    /// Deprecated. Used to allow SO pool to access AD or DNS server from other
12212    /// regions.
12213    #[deprecated]
12214    pub global_access_allowed: std::option::Option<bool>,
12215
12216    /// Optional. True if the storage pool supports Auto Tiering enabled volumes.
12217    /// Default is false. Auto-tiering can be enabled after storage pool creation
12218    /// but it can't be disabled once enabled.
12219    pub allow_auto_tiering: bool,
12220
12221    /// Optional. Specifies the replica zone for regional storagePool.
12222    pub replica_zone: std::string::String,
12223
12224    /// Optional. Specifies the active zone for regional storagePool.
12225    pub zone: std::string::String,
12226
12227    /// Output only. Reserved for future use
12228    pub satisfies_pzs: bool,
12229
12230    /// Output only. Reserved for future use
12231    pub satisfies_pzi: bool,
12232
12233    /// Optional. True if using Independent Scaling of capacity and performance
12234    /// (Hyperdisk) By default set to false
12235    pub custom_performance_enabled: bool,
12236
12237    /// Optional. Custom Performance Total Throughput of the pool (in MiBps)
12238    pub total_throughput_mibps: i64,
12239
12240    /// Optional. Custom Performance Total IOPS of the pool
12241    /// if not provided, it will be calculated based on the total_throughput_mibps
12242    pub total_iops: i64,
12243
12244    /// Optional. Total hot tier capacity for the Storage Pool. It is applicable
12245    /// only to Flex service level. It should be less than the minimum storage pool
12246    /// size and cannot be more than the current storage pool size. It cannot be
12247    /// decreased once set.
12248    pub hot_tier_size_gib: i64,
12249
12250    /// Optional. Flag indicating that the hot-tier threshold will be
12251    /// auto-increased by 10% of the hot-tier when it hits 100%. Default is true.
12252    /// The increment will kick in only if the new size after increment is
12253    /// still less than or equal to storage pool size.
12254    pub enable_hot_tier_auto_resize: std::option::Option<bool>,
12255
12256    /// Optional. QoS (Quality of Service) Type of the storage pool
12257    pub qos_type: crate::model::QosType,
12258
12259    /// Output only. Available throughput of the storage pool (in MiB/s).
12260    pub available_throughput_mibps: f64,
12261
12262    /// Output only. Total cold tier data rounded down to the nearest GiB used by
12263    /// the storage pool.
12264    pub cold_tier_size_used_gib: i64,
12265
12266    /// Output only. Total hot tier data rounded down to the nearest GiB used by
12267    /// the storage pool.
12268    pub hot_tier_size_used_gib: i64,
12269
12270    /// Optional. Type of the storage pool. This field is used to control whether
12271    /// the pool supports `FILE` based volumes only or `UNIFIED` (both `FILE` and
12272    /// `BLOCK`) volumes. If not specified during creation, it defaults to `FILE`.
12273    pub r#type: std::option::Option<crate::model::StoragePoolType>,
12274
12275    /// Optional. Mode of the storage pool. This field is used to control whether
12276    /// the user can perform the ONTAP operations on the storage pool using the
12277    /// GCNV ONTAP Mode APIs. If not specified during creation, it defaults to
12278    /// `DEFAULT`.
12279    pub mode: std::option::Option<crate::model::Mode>,
12280
12281    /// Optional. The scale type of the storage pool. Defaults to
12282    /// `SCALE_TYPE_DEFAULT` if not specified.
12283    pub scale_type: crate::model::ScaleType,
12284
12285    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12286}
12287
12288impl StoragePool {
12289    /// Creates a new default instance.
12290    pub fn new() -> Self {
12291        std::default::Default::default()
12292    }
12293
12294    /// Sets the value of [name][crate::model::StoragePool::name].
12295    ///
12296    /// # Example
12297    /// ```ignore,no_run
12298    /// # use google_cloud_netapp_v1::model::StoragePool;
12299    /// # let project_id = "project_id";
12300    /// # let location_id = "location_id";
12301    /// # let storage_pool_id = "storage_pool_id";
12302    /// let x = StoragePool::new().set_name(format!("projects/{project_id}/locations/{location_id}/storagePools/{storage_pool_id}"));
12303    /// ```
12304    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12305        self.name = v.into();
12306        self
12307    }
12308
12309    /// Sets the value of [service_level][crate::model::StoragePool::service_level].
12310    ///
12311    /// # Example
12312    /// ```ignore,no_run
12313    /// # use google_cloud_netapp_v1::model::StoragePool;
12314    /// use google_cloud_netapp_v1::model::ServiceLevel;
12315    /// let x0 = StoragePool::new().set_service_level(ServiceLevel::Premium);
12316    /// let x1 = StoragePool::new().set_service_level(ServiceLevel::Extreme);
12317    /// let x2 = StoragePool::new().set_service_level(ServiceLevel::Standard);
12318    /// ```
12319    pub fn set_service_level<T: std::convert::Into<crate::model::ServiceLevel>>(
12320        mut self,
12321        v: T,
12322    ) -> Self {
12323        self.service_level = v.into();
12324        self
12325    }
12326
12327    /// Sets the value of [capacity_gib][crate::model::StoragePool::capacity_gib].
12328    ///
12329    /// # Example
12330    /// ```ignore,no_run
12331    /// # use google_cloud_netapp_v1::model::StoragePool;
12332    /// let x = StoragePool::new().set_capacity_gib(42);
12333    /// ```
12334    pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12335        self.capacity_gib = v.into();
12336        self
12337    }
12338
12339    /// Sets the value of [volume_capacity_gib][crate::model::StoragePool::volume_capacity_gib].
12340    ///
12341    /// # Example
12342    /// ```ignore,no_run
12343    /// # use google_cloud_netapp_v1::model::StoragePool;
12344    /// let x = StoragePool::new().set_volume_capacity_gib(42);
12345    /// ```
12346    pub fn set_volume_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12347        self.volume_capacity_gib = v.into();
12348        self
12349    }
12350
12351    /// Sets the value of [volume_count][crate::model::StoragePool::volume_count].
12352    ///
12353    /// # Example
12354    /// ```ignore,no_run
12355    /// # use google_cloud_netapp_v1::model::StoragePool;
12356    /// let x = StoragePool::new().set_volume_count(42);
12357    /// ```
12358    pub fn set_volume_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12359        self.volume_count = v.into();
12360        self
12361    }
12362
12363    /// Sets the value of [state][crate::model::StoragePool::state].
12364    ///
12365    /// # Example
12366    /// ```ignore,no_run
12367    /// # use google_cloud_netapp_v1::model::StoragePool;
12368    /// use google_cloud_netapp_v1::model::storage_pool::State;
12369    /// let x0 = StoragePool::new().set_state(State::Ready);
12370    /// let x1 = StoragePool::new().set_state(State::Creating);
12371    /// let x2 = StoragePool::new().set_state(State::Deleting);
12372    /// ```
12373    pub fn set_state<T: std::convert::Into<crate::model::storage_pool::State>>(
12374        mut self,
12375        v: T,
12376    ) -> Self {
12377        self.state = v.into();
12378        self
12379    }
12380
12381    /// Sets the value of [state_details][crate::model::StoragePool::state_details].
12382    ///
12383    /// # Example
12384    /// ```ignore,no_run
12385    /// # use google_cloud_netapp_v1::model::StoragePool;
12386    /// let x = StoragePool::new().set_state_details("example");
12387    /// ```
12388    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12389        self.state_details = v.into();
12390        self
12391    }
12392
12393    /// Sets the value of [create_time][crate::model::StoragePool::create_time].
12394    ///
12395    /// # Example
12396    /// ```ignore,no_run
12397    /// # use google_cloud_netapp_v1::model::StoragePool;
12398    /// use wkt::Timestamp;
12399    /// let x = StoragePool::new().set_create_time(Timestamp::default()/* use setters */);
12400    /// ```
12401    pub fn set_create_time<T>(mut self, v: T) -> Self
12402    where
12403        T: std::convert::Into<wkt::Timestamp>,
12404    {
12405        self.create_time = std::option::Option::Some(v.into());
12406        self
12407    }
12408
12409    /// Sets or clears the value of [create_time][crate::model::StoragePool::create_time].
12410    ///
12411    /// # Example
12412    /// ```ignore,no_run
12413    /// # use google_cloud_netapp_v1::model::StoragePool;
12414    /// use wkt::Timestamp;
12415    /// let x = StoragePool::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
12416    /// let x = StoragePool::new().set_or_clear_create_time(None::<Timestamp>);
12417    /// ```
12418    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12419    where
12420        T: std::convert::Into<wkt::Timestamp>,
12421    {
12422        self.create_time = v.map(|x| x.into());
12423        self
12424    }
12425
12426    /// Sets the value of [description][crate::model::StoragePool::description].
12427    ///
12428    /// # Example
12429    /// ```ignore,no_run
12430    /// # use google_cloud_netapp_v1::model::StoragePool;
12431    /// let x = StoragePool::new().set_description("example");
12432    /// ```
12433    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12434        self.description = v.into();
12435        self
12436    }
12437
12438    /// Sets the value of [labels][crate::model::StoragePool::labels].
12439    ///
12440    /// # Example
12441    /// ```ignore,no_run
12442    /// # use google_cloud_netapp_v1::model::StoragePool;
12443    /// let x = StoragePool::new().set_labels([
12444    ///     ("key0", "abc"),
12445    ///     ("key1", "xyz"),
12446    /// ]);
12447    /// ```
12448    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12449    where
12450        T: std::iter::IntoIterator<Item = (K, V)>,
12451        K: std::convert::Into<std::string::String>,
12452        V: std::convert::Into<std::string::String>,
12453    {
12454        use std::iter::Iterator;
12455        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12456        self
12457    }
12458
12459    /// Sets the value of [network][crate::model::StoragePool::network].
12460    ///
12461    /// # Example
12462    /// ```ignore,no_run
12463    /// # use google_cloud_netapp_v1::model::StoragePool;
12464    /// let x = StoragePool::new().set_network("example");
12465    /// ```
12466    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12467        self.network = v.into();
12468        self
12469    }
12470
12471    /// Sets the value of [active_directory][crate::model::StoragePool::active_directory].
12472    ///
12473    /// # Example
12474    /// ```ignore,no_run
12475    /// # use google_cloud_netapp_v1::model::StoragePool;
12476    /// # let project_id = "project_id";
12477    /// # let location_id = "location_id";
12478    /// # let active_directory_id = "active_directory_id";
12479    /// let x = StoragePool::new().set_active_directory(format!("projects/{project_id}/locations/{location_id}/activeDirectories/{active_directory_id}"));
12480    /// ```
12481    pub fn set_active_directory<T: std::convert::Into<std::string::String>>(
12482        mut self,
12483        v: T,
12484    ) -> Self {
12485        self.active_directory = v.into();
12486        self
12487    }
12488
12489    /// Sets the value of [kms_config][crate::model::StoragePool::kms_config].
12490    ///
12491    /// # Example
12492    /// ```ignore,no_run
12493    /// # use google_cloud_netapp_v1::model::StoragePool;
12494    /// # let project_id = "project_id";
12495    /// # let location_id = "location_id";
12496    /// # let kms_config_id = "kms_config_id";
12497    /// let x = StoragePool::new().set_kms_config(format!("projects/{project_id}/locations/{location_id}/kmsConfigs/{kms_config_id}"));
12498    /// ```
12499    pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12500        self.kms_config = v.into();
12501        self
12502    }
12503
12504    /// Sets the value of [ldap_enabled][crate::model::StoragePool::ldap_enabled].
12505    ///
12506    /// # Example
12507    /// ```ignore,no_run
12508    /// # use google_cloud_netapp_v1::model::StoragePool;
12509    /// let x = StoragePool::new().set_ldap_enabled(true);
12510    /// ```
12511    pub fn set_ldap_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12512        self.ldap_enabled = v.into();
12513        self
12514    }
12515
12516    /// Sets the value of [psa_range][crate::model::StoragePool::psa_range].
12517    ///
12518    /// # Example
12519    /// ```ignore,no_run
12520    /// # use google_cloud_netapp_v1::model::StoragePool;
12521    /// let x = StoragePool::new().set_psa_range("example");
12522    /// ```
12523    pub fn set_psa_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12524        self.psa_range = v.into();
12525        self
12526    }
12527
12528    /// Sets the value of [encryption_type][crate::model::StoragePool::encryption_type].
12529    ///
12530    /// # Example
12531    /// ```ignore,no_run
12532    /// # use google_cloud_netapp_v1::model::StoragePool;
12533    /// use google_cloud_netapp_v1::model::EncryptionType;
12534    /// let x0 = StoragePool::new().set_encryption_type(EncryptionType::ServiceManaged);
12535    /// let x1 = StoragePool::new().set_encryption_type(EncryptionType::CloudKms);
12536    /// ```
12537    pub fn set_encryption_type<T: std::convert::Into<crate::model::EncryptionType>>(
12538        mut self,
12539        v: T,
12540    ) -> Self {
12541        self.encryption_type = v.into();
12542        self
12543    }
12544
12545    /// Sets the value of [global_access_allowed][crate::model::StoragePool::global_access_allowed].
12546    ///
12547    /// # Example
12548    /// ```ignore,no_run
12549    /// # use google_cloud_netapp_v1::model::StoragePool;
12550    /// let x = StoragePool::new().set_global_access_allowed(true);
12551    /// ```
12552    #[deprecated]
12553    pub fn set_global_access_allowed<T>(mut self, v: T) -> Self
12554    where
12555        T: std::convert::Into<bool>,
12556    {
12557        self.global_access_allowed = std::option::Option::Some(v.into());
12558        self
12559    }
12560
12561    /// Sets or clears the value of [global_access_allowed][crate::model::StoragePool::global_access_allowed].
12562    ///
12563    /// # Example
12564    /// ```ignore,no_run
12565    /// # use google_cloud_netapp_v1::model::StoragePool;
12566    /// let x = StoragePool::new().set_or_clear_global_access_allowed(Some(false));
12567    /// let x = StoragePool::new().set_or_clear_global_access_allowed(None::<bool>);
12568    /// ```
12569    #[deprecated]
12570    pub fn set_or_clear_global_access_allowed<T>(mut self, v: std::option::Option<T>) -> Self
12571    where
12572        T: std::convert::Into<bool>,
12573    {
12574        self.global_access_allowed = v.map(|x| x.into());
12575        self
12576    }
12577
12578    /// Sets the value of [allow_auto_tiering][crate::model::StoragePool::allow_auto_tiering].
12579    ///
12580    /// # Example
12581    /// ```ignore,no_run
12582    /// # use google_cloud_netapp_v1::model::StoragePool;
12583    /// let x = StoragePool::new().set_allow_auto_tiering(true);
12584    /// ```
12585    pub fn set_allow_auto_tiering<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12586        self.allow_auto_tiering = v.into();
12587        self
12588    }
12589
12590    /// Sets the value of [replica_zone][crate::model::StoragePool::replica_zone].
12591    ///
12592    /// # Example
12593    /// ```ignore,no_run
12594    /// # use google_cloud_netapp_v1::model::StoragePool;
12595    /// let x = StoragePool::new().set_replica_zone("example");
12596    /// ```
12597    pub fn set_replica_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12598        self.replica_zone = v.into();
12599        self
12600    }
12601
12602    /// Sets the value of [zone][crate::model::StoragePool::zone].
12603    ///
12604    /// # Example
12605    /// ```ignore,no_run
12606    /// # use google_cloud_netapp_v1::model::StoragePool;
12607    /// let x = StoragePool::new().set_zone("example");
12608    /// ```
12609    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12610        self.zone = v.into();
12611        self
12612    }
12613
12614    /// Sets the value of [satisfies_pzs][crate::model::StoragePool::satisfies_pzs].
12615    ///
12616    /// # Example
12617    /// ```ignore,no_run
12618    /// # use google_cloud_netapp_v1::model::StoragePool;
12619    /// let x = StoragePool::new().set_satisfies_pzs(true);
12620    /// ```
12621    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12622        self.satisfies_pzs = v.into();
12623        self
12624    }
12625
12626    /// Sets the value of [satisfies_pzi][crate::model::StoragePool::satisfies_pzi].
12627    ///
12628    /// # Example
12629    /// ```ignore,no_run
12630    /// # use google_cloud_netapp_v1::model::StoragePool;
12631    /// let x = StoragePool::new().set_satisfies_pzi(true);
12632    /// ```
12633    pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12634        self.satisfies_pzi = v.into();
12635        self
12636    }
12637
12638    /// Sets the value of [custom_performance_enabled][crate::model::StoragePool::custom_performance_enabled].
12639    ///
12640    /// # Example
12641    /// ```ignore,no_run
12642    /// # use google_cloud_netapp_v1::model::StoragePool;
12643    /// let x = StoragePool::new().set_custom_performance_enabled(true);
12644    /// ```
12645    pub fn set_custom_performance_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12646        self.custom_performance_enabled = v.into();
12647        self
12648    }
12649
12650    /// Sets the value of [total_throughput_mibps][crate::model::StoragePool::total_throughput_mibps].
12651    ///
12652    /// # Example
12653    /// ```ignore,no_run
12654    /// # use google_cloud_netapp_v1::model::StoragePool;
12655    /// let x = StoragePool::new().set_total_throughput_mibps(42);
12656    /// ```
12657    pub fn set_total_throughput_mibps<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12658        self.total_throughput_mibps = v.into();
12659        self
12660    }
12661
12662    /// Sets the value of [total_iops][crate::model::StoragePool::total_iops].
12663    ///
12664    /// # Example
12665    /// ```ignore,no_run
12666    /// # use google_cloud_netapp_v1::model::StoragePool;
12667    /// let x = StoragePool::new().set_total_iops(42);
12668    /// ```
12669    pub fn set_total_iops<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12670        self.total_iops = v.into();
12671        self
12672    }
12673
12674    /// Sets the value of [hot_tier_size_gib][crate::model::StoragePool::hot_tier_size_gib].
12675    ///
12676    /// # Example
12677    /// ```ignore,no_run
12678    /// # use google_cloud_netapp_v1::model::StoragePool;
12679    /// let x = StoragePool::new().set_hot_tier_size_gib(42);
12680    /// ```
12681    pub fn set_hot_tier_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12682        self.hot_tier_size_gib = v.into();
12683        self
12684    }
12685
12686    /// Sets the value of [enable_hot_tier_auto_resize][crate::model::StoragePool::enable_hot_tier_auto_resize].
12687    ///
12688    /// # Example
12689    /// ```ignore,no_run
12690    /// # use google_cloud_netapp_v1::model::StoragePool;
12691    /// let x = StoragePool::new().set_enable_hot_tier_auto_resize(true);
12692    /// ```
12693    pub fn set_enable_hot_tier_auto_resize<T>(mut self, v: T) -> Self
12694    where
12695        T: std::convert::Into<bool>,
12696    {
12697        self.enable_hot_tier_auto_resize = std::option::Option::Some(v.into());
12698        self
12699    }
12700
12701    /// Sets or clears the value of [enable_hot_tier_auto_resize][crate::model::StoragePool::enable_hot_tier_auto_resize].
12702    ///
12703    /// # Example
12704    /// ```ignore,no_run
12705    /// # use google_cloud_netapp_v1::model::StoragePool;
12706    /// let x = StoragePool::new().set_or_clear_enable_hot_tier_auto_resize(Some(false));
12707    /// let x = StoragePool::new().set_or_clear_enable_hot_tier_auto_resize(None::<bool>);
12708    /// ```
12709    pub fn set_or_clear_enable_hot_tier_auto_resize<T>(mut self, v: std::option::Option<T>) -> Self
12710    where
12711        T: std::convert::Into<bool>,
12712    {
12713        self.enable_hot_tier_auto_resize = v.map(|x| x.into());
12714        self
12715    }
12716
12717    /// Sets the value of [qos_type][crate::model::StoragePool::qos_type].
12718    ///
12719    /// # Example
12720    /// ```ignore,no_run
12721    /// # use google_cloud_netapp_v1::model::StoragePool;
12722    /// use google_cloud_netapp_v1::model::QosType;
12723    /// let x0 = StoragePool::new().set_qos_type(QosType::Auto);
12724    /// let x1 = StoragePool::new().set_qos_type(QosType::Manual);
12725    /// ```
12726    pub fn set_qos_type<T: std::convert::Into<crate::model::QosType>>(mut self, v: T) -> Self {
12727        self.qos_type = v.into();
12728        self
12729    }
12730
12731    /// Sets the value of [available_throughput_mibps][crate::model::StoragePool::available_throughput_mibps].
12732    ///
12733    /// # Example
12734    /// ```ignore,no_run
12735    /// # use google_cloud_netapp_v1::model::StoragePool;
12736    /// let x = StoragePool::new().set_available_throughput_mibps(42.0);
12737    /// ```
12738    pub fn set_available_throughput_mibps<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
12739        self.available_throughput_mibps = v.into();
12740        self
12741    }
12742
12743    /// Sets the value of [cold_tier_size_used_gib][crate::model::StoragePool::cold_tier_size_used_gib].
12744    ///
12745    /// # Example
12746    /// ```ignore,no_run
12747    /// # use google_cloud_netapp_v1::model::StoragePool;
12748    /// let x = StoragePool::new().set_cold_tier_size_used_gib(42);
12749    /// ```
12750    pub fn set_cold_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12751        self.cold_tier_size_used_gib = v.into();
12752        self
12753    }
12754
12755    /// Sets the value of [hot_tier_size_used_gib][crate::model::StoragePool::hot_tier_size_used_gib].
12756    ///
12757    /// # Example
12758    /// ```ignore,no_run
12759    /// # use google_cloud_netapp_v1::model::StoragePool;
12760    /// let x = StoragePool::new().set_hot_tier_size_used_gib(42);
12761    /// ```
12762    pub fn set_hot_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12763        self.hot_tier_size_used_gib = v.into();
12764        self
12765    }
12766
12767    /// Sets the value of [r#type][crate::model::StoragePool::type].
12768    ///
12769    /// # Example
12770    /// ```ignore,no_run
12771    /// # use google_cloud_netapp_v1::model::StoragePool;
12772    /// use google_cloud_netapp_v1::model::StoragePoolType;
12773    /// let x0 = StoragePool::new().set_type(StoragePoolType::File);
12774    /// let x1 = StoragePool::new().set_type(StoragePoolType::Unified);
12775    /// ```
12776    pub fn set_type<T>(mut self, v: T) -> Self
12777    where
12778        T: std::convert::Into<crate::model::StoragePoolType>,
12779    {
12780        self.r#type = std::option::Option::Some(v.into());
12781        self
12782    }
12783
12784    /// Sets or clears the value of [r#type][crate::model::StoragePool::type].
12785    ///
12786    /// # Example
12787    /// ```ignore,no_run
12788    /// # use google_cloud_netapp_v1::model::StoragePool;
12789    /// use google_cloud_netapp_v1::model::StoragePoolType;
12790    /// let x0 = StoragePool::new().set_or_clear_type(Some(StoragePoolType::File));
12791    /// let x1 = StoragePool::new().set_or_clear_type(Some(StoragePoolType::Unified));
12792    /// let x_none = StoragePool::new().set_or_clear_type(None::<StoragePoolType>);
12793    /// ```
12794    pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
12795    where
12796        T: std::convert::Into<crate::model::StoragePoolType>,
12797    {
12798        self.r#type = v.map(|x| x.into());
12799        self
12800    }
12801
12802    /// Sets the value of [mode][crate::model::StoragePool::mode].
12803    ///
12804    /// # Example
12805    /// ```ignore,no_run
12806    /// # use google_cloud_netapp_v1::model::StoragePool;
12807    /// use google_cloud_netapp_v1::model::Mode;
12808    /// let x0 = StoragePool::new().set_mode(Mode::Default);
12809    /// let x1 = StoragePool::new().set_mode(Mode::Ontap);
12810    /// ```
12811    pub fn set_mode<T>(mut self, v: T) -> Self
12812    where
12813        T: std::convert::Into<crate::model::Mode>,
12814    {
12815        self.mode = std::option::Option::Some(v.into());
12816        self
12817    }
12818
12819    /// Sets or clears the value of [mode][crate::model::StoragePool::mode].
12820    ///
12821    /// # Example
12822    /// ```ignore,no_run
12823    /// # use google_cloud_netapp_v1::model::StoragePool;
12824    /// use google_cloud_netapp_v1::model::Mode;
12825    /// let x0 = StoragePool::new().set_or_clear_mode(Some(Mode::Default));
12826    /// let x1 = StoragePool::new().set_or_clear_mode(Some(Mode::Ontap));
12827    /// let x_none = StoragePool::new().set_or_clear_mode(None::<Mode>);
12828    /// ```
12829    pub fn set_or_clear_mode<T>(mut self, v: std::option::Option<T>) -> Self
12830    where
12831        T: std::convert::Into<crate::model::Mode>,
12832    {
12833        self.mode = v.map(|x| x.into());
12834        self
12835    }
12836
12837    /// Sets the value of [scale_type][crate::model::StoragePool::scale_type].
12838    ///
12839    /// # Example
12840    /// ```ignore,no_run
12841    /// # use google_cloud_netapp_v1::model::StoragePool;
12842    /// use google_cloud_netapp_v1::model::ScaleType;
12843    /// let x0 = StoragePool::new().set_scale_type(ScaleType::Default);
12844    /// let x1 = StoragePool::new().set_scale_type(ScaleType::Scaleout);
12845    /// ```
12846    pub fn set_scale_type<T: std::convert::Into<crate::model::ScaleType>>(mut self, v: T) -> Self {
12847        self.scale_type = v.into();
12848        self
12849    }
12850}
12851
12852impl wkt::message::Message for StoragePool {
12853    fn typename() -> &'static str {
12854        "type.googleapis.com/google.cloud.netapp.v1.StoragePool"
12855    }
12856}
12857
12858/// Defines additional types related to [StoragePool].
12859pub mod storage_pool {
12860    #[allow(unused_imports)]
12861    use super::*;
12862
12863    /// The Storage Pool States
12864    ///
12865    /// # Working with unknown values
12866    ///
12867    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12868    /// additional enum variants at any time. Adding new variants is not considered
12869    /// a breaking change. Applications should write their code in anticipation of:
12870    ///
12871    /// - New values appearing in future releases of the client library, **and**
12872    /// - New values received dynamically, without application changes.
12873    ///
12874    /// Please consult the [Working with enums] section in the user guide for some
12875    /// guidelines.
12876    ///
12877    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
12878    #[derive(Clone, Debug, PartialEq)]
12879    #[non_exhaustive]
12880    pub enum State {
12881        /// Unspecified Storage Pool State
12882        Unspecified,
12883        /// Storage Pool State is Ready
12884        Ready,
12885        /// Storage Pool State is Creating
12886        Creating,
12887        /// Storage Pool State is Deleting
12888        Deleting,
12889        /// Storage Pool State is Updating
12890        Updating,
12891        /// Storage Pool State is Restoring
12892        Restoring,
12893        /// Storage Pool State is Disabled
12894        Disabled,
12895        /// Storage Pool State is Error
12896        Error,
12897        /// If set, the enum was initialized with an unknown value.
12898        ///
12899        /// Applications can examine the value using [State::value] or
12900        /// [State::name].
12901        UnknownValue(state::UnknownValue),
12902    }
12903
12904    #[doc(hidden)]
12905    pub mod state {
12906        #[allow(unused_imports)]
12907        use super::*;
12908        #[derive(Clone, Debug, PartialEq)]
12909        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12910    }
12911
12912    impl State {
12913        /// Gets the enum value.
12914        ///
12915        /// Returns `None` if the enum contains an unknown value deserialized from
12916        /// the string representation of enums.
12917        pub fn value(&self) -> std::option::Option<i32> {
12918            match self {
12919                Self::Unspecified => std::option::Option::Some(0),
12920                Self::Ready => std::option::Option::Some(1),
12921                Self::Creating => std::option::Option::Some(2),
12922                Self::Deleting => std::option::Option::Some(3),
12923                Self::Updating => std::option::Option::Some(4),
12924                Self::Restoring => std::option::Option::Some(5),
12925                Self::Disabled => std::option::Option::Some(6),
12926                Self::Error => std::option::Option::Some(7),
12927                Self::UnknownValue(u) => u.0.value(),
12928            }
12929        }
12930
12931        /// Gets the enum value as a string.
12932        ///
12933        /// Returns `None` if the enum contains an unknown value deserialized from
12934        /// the integer representation of enums.
12935        pub fn name(&self) -> std::option::Option<&str> {
12936            match self {
12937                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12938                Self::Ready => std::option::Option::Some("READY"),
12939                Self::Creating => std::option::Option::Some("CREATING"),
12940                Self::Deleting => std::option::Option::Some("DELETING"),
12941                Self::Updating => std::option::Option::Some("UPDATING"),
12942                Self::Restoring => std::option::Option::Some("RESTORING"),
12943                Self::Disabled => std::option::Option::Some("DISABLED"),
12944                Self::Error => std::option::Option::Some("ERROR"),
12945                Self::UnknownValue(u) => u.0.name(),
12946            }
12947        }
12948    }
12949
12950    impl std::default::Default for State {
12951        fn default() -> Self {
12952            use std::convert::From;
12953            Self::from(0)
12954        }
12955    }
12956
12957    impl std::fmt::Display for State {
12958        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12959            wkt::internal::display_enum(f, self.name(), self.value())
12960        }
12961    }
12962
12963    impl std::convert::From<i32> for State {
12964        fn from(value: i32) -> Self {
12965            match value {
12966                0 => Self::Unspecified,
12967                1 => Self::Ready,
12968                2 => Self::Creating,
12969                3 => Self::Deleting,
12970                4 => Self::Updating,
12971                5 => Self::Restoring,
12972                6 => Self::Disabled,
12973                7 => Self::Error,
12974                _ => Self::UnknownValue(state::UnknownValue(
12975                    wkt::internal::UnknownEnumValue::Integer(value),
12976                )),
12977            }
12978        }
12979    }
12980
12981    impl std::convert::From<&str> for State {
12982        fn from(value: &str) -> Self {
12983            use std::string::ToString;
12984            match value {
12985                "STATE_UNSPECIFIED" => Self::Unspecified,
12986                "READY" => Self::Ready,
12987                "CREATING" => Self::Creating,
12988                "DELETING" => Self::Deleting,
12989                "UPDATING" => Self::Updating,
12990                "RESTORING" => Self::Restoring,
12991                "DISABLED" => Self::Disabled,
12992                "ERROR" => Self::Error,
12993                _ => Self::UnknownValue(state::UnknownValue(
12994                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12995                )),
12996            }
12997        }
12998    }
12999
13000    impl serde::ser::Serialize for State {
13001        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13002        where
13003            S: serde::Serializer,
13004        {
13005            match self {
13006                Self::Unspecified => serializer.serialize_i32(0),
13007                Self::Ready => serializer.serialize_i32(1),
13008                Self::Creating => serializer.serialize_i32(2),
13009                Self::Deleting => serializer.serialize_i32(3),
13010                Self::Updating => serializer.serialize_i32(4),
13011                Self::Restoring => serializer.serialize_i32(5),
13012                Self::Disabled => serializer.serialize_i32(6),
13013                Self::Error => serializer.serialize_i32(7),
13014                Self::UnknownValue(u) => u.0.serialize(serializer),
13015            }
13016        }
13017    }
13018
13019    impl<'de> serde::de::Deserialize<'de> for State {
13020        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13021        where
13022            D: serde::Deserializer<'de>,
13023        {
13024            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13025                ".google.cloud.netapp.v1.StoragePool.State",
13026            ))
13027        }
13028    }
13029}
13030
13031/// ValidateDirectoryServiceRequest validates the directory service policy
13032/// attached to the storage pool.
13033#[derive(Clone, Default, PartialEq)]
13034#[non_exhaustive]
13035pub struct ValidateDirectoryServiceRequest {
13036    /// Required. Name of the storage pool
13037    pub name: std::string::String,
13038
13039    /// Type of directory service policy attached to the storage pool.
13040    pub directory_service_type: crate::model::DirectoryServiceType,
13041
13042    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13043}
13044
13045impl ValidateDirectoryServiceRequest {
13046    /// Creates a new default instance.
13047    pub fn new() -> Self {
13048        std::default::Default::default()
13049    }
13050
13051    /// Sets the value of [name][crate::model::ValidateDirectoryServiceRequest::name].
13052    ///
13053    /// # Example
13054    /// ```ignore,no_run
13055    /// # use google_cloud_netapp_v1::model::ValidateDirectoryServiceRequest;
13056    /// # let project_id = "project_id";
13057    /// # let location_id = "location_id";
13058    /// # let storage_pool_id = "storage_pool_id";
13059    /// let x = ValidateDirectoryServiceRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/storagePools/{storage_pool_id}"));
13060    /// ```
13061    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13062        self.name = v.into();
13063        self
13064    }
13065
13066    /// Sets the value of [directory_service_type][crate::model::ValidateDirectoryServiceRequest::directory_service_type].
13067    ///
13068    /// # Example
13069    /// ```ignore,no_run
13070    /// # use google_cloud_netapp_v1::model::ValidateDirectoryServiceRequest;
13071    /// use google_cloud_netapp_v1::model::DirectoryServiceType;
13072    /// let x0 = ValidateDirectoryServiceRequest::new().set_directory_service_type(DirectoryServiceType::ActiveDirectory);
13073    /// ```
13074    pub fn set_directory_service_type<T: std::convert::Into<crate::model::DirectoryServiceType>>(
13075        mut self,
13076        v: T,
13077    ) -> Self {
13078        self.directory_service_type = v.into();
13079        self
13080    }
13081}
13082
13083impl wkt::message::Message for ValidateDirectoryServiceRequest {
13084    fn typename() -> &'static str {
13085        "type.googleapis.com/google.cloud.netapp.v1.ValidateDirectoryServiceRequest"
13086    }
13087}
13088
13089/// Message for requesting list of Volumes
13090#[derive(Clone, Default, PartialEq)]
13091#[non_exhaustive]
13092pub struct ListVolumesRequest {
13093    /// Required. Parent value for ListVolumesRequest
13094    pub parent: std::string::String,
13095
13096    /// Requested page size. Server may return fewer items than requested.
13097    /// If unspecified, the server will pick an appropriate default.
13098    pub page_size: i32,
13099
13100    /// A token identifying a page of results the server should return.
13101    pub page_token: std::string::String,
13102
13103    /// Filtering results
13104    pub filter: std::string::String,
13105
13106    /// Hint for how to order the results
13107    pub order_by: std::string::String,
13108
13109    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13110}
13111
13112impl ListVolumesRequest {
13113    /// Creates a new default instance.
13114    pub fn new() -> Self {
13115        std::default::Default::default()
13116    }
13117
13118    /// Sets the value of [parent][crate::model::ListVolumesRequest::parent].
13119    ///
13120    /// # Example
13121    /// ```ignore,no_run
13122    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
13123    /// # let project_id = "project_id";
13124    /// # let location_id = "location_id";
13125    /// let x = ListVolumesRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
13126    /// ```
13127    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13128        self.parent = v.into();
13129        self
13130    }
13131
13132    /// Sets the value of [page_size][crate::model::ListVolumesRequest::page_size].
13133    ///
13134    /// # Example
13135    /// ```ignore,no_run
13136    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
13137    /// let x = ListVolumesRequest::new().set_page_size(42);
13138    /// ```
13139    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
13140        self.page_size = v.into();
13141        self
13142    }
13143
13144    /// Sets the value of [page_token][crate::model::ListVolumesRequest::page_token].
13145    ///
13146    /// # Example
13147    /// ```ignore,no_run
13148    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
13149    /// let x = ListVolumesRequest::new().set_page_token("example");
13150    /// ```
13151    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13152        self.page_token = v.into();
13153        self
13154    }
13155
13156    /// Sets the value of [filter][crate::model::ListVolumesRequest::filter].
13157    ///
13158    /// # Example
13159    /// ```ignore,no_run
13160    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
13161    /// let x = ListVolumesRequest::new().set_filter("example");
13162    /// ```
13163    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13164        self.filter = v.into();
13165        self
13166    }
13167
13168    /// Sets the value of [order_by][crate::model::ListVolumesRequest::order_by].
13169    ///
13170    /// # Example
13171    /// ```ignore,no_run
13172    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
13173    /// let x = ListVolumesRequest::new().set_order_by("example");
13174    /// ```
13175    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13176        self.order_by = v.into();
13177        self
13178    }
13179}
13180
13181impl wkt::message::Message for ListVolumesRequest {
13182    fn typename() -> &'static str {
13183        "type.googleapis.com/google.cloud.netapp.v1.ListVolumesRequest"
13184    }
13185}
13186
13187/// Message for response to listing Volumes
13188#[derive(Clone, Default, PartialEq)]
13189#[non_exhaustive]
13190pub struct ListVolumesResponse {
13191    /// The list of Volume
13192    pub volumes: std::vec::Vec<crate::model::Volume>,
13193
13194    /// A token identifying a page of results the server should return.
13195    pub next_page_token: std::string::String,
13196
13197    /// Locations that could not be reached.
13198    pub unreachable: std::vec::Vec<std::string::String>,
13199
13200    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13201}
13202
13203impl ListVolumesResponse {
13204    /// Creates a new default instance.
13205    pub fn new() -> Self {
13206        std::default::Default::default()
13207    }
13208
13209    /// Sets the value of [volumes][crate::model::ListVolumesResponse::volumes].
13210    ///
13211    /// # Example
13212    /// ```ignore,no_run
13213    /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
13214    /// use google_cloud_netapp_v1::model::Volume;
13215    /// let x = ListVolumesResponse::new()
13216    ///     .set_volumes([
13217    ///         Volume::default()/* use setters */,
13218    ///         Volume::default()/* use (different) setters */,
13219    ///     ]);
13220    /// ```
13221    pub fn set_volumes<T, V>(mut self, v: T) -> Self
13222    where
13223        T: std::iter::IntoIterator<Item = V>,
13224        V: std::convert::Into<crate::model::Volume>,
13225    {
13226        use std::iter::Iterator;
13227        self.volumes = v.into_iter().map(|i| i.into()).collect();
13228        self
13229    }
13230
13231    /// Sets the value of [next_page_token][crate::model::ListVolumesResponse::next_page_token].
13232    ///
13233    /// # Example
13234    /// ```ignore,no_run
13235    /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
13236    /// let x = ListVolumesResponse::new().set_next_page_token("example");
13237    /// ```
13238    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13239        self.next_page_token = v.into();
13240        self
13241    }
13242
13243    /// Sets the value of [unreachable][crate::model::ListVolumesResponse::unreachable].
13244    ///
13245    /// # Example
13246    /// ```ignore,no_run
13247    /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
13248    /// let x = ListVolumesResponse::new().set_unreachable(["a", "b", "c"]);
13249    /// ```
13250    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
13251    where
13252        T: std::iter::IntoIterator<Item = V>,
13253        V: std::convert::Into<std::string::String>,
13254    {
13255        use std::iter::Iterator;
13256        self.unreachable = v.into_iter().map(|i| i.into()).collect();
13257        self
13258    }
13259}
13260
13261impl wkt::message::Message for ListVolumesResponse {
13262    fn typename() -> &'static str {
13263        "type.googleapis.com/google.cloud.netapp.v1.ListVolumesResponse"
13264    }
13265}
13266
13267#[doc(hidden)]
13268impl google_cloud_gax::paginator::internal::PageableResponse for ListVolumesResponse {
13269    type PageItem = crate::model::Volume;
13270
13271    fn items(self) -> std::vec::Vec<Self::PageItem> {
13272        self.volumes
13273    }
13274
13275    fn next_page_token(&self) -> std::string::String {
13276        use std::clone::Clone;
13277        self.next_page_token.clone()
13278    }
13279}
13280
13281/// Message for getting a Volume
13282#[derive(Clone, Default, PartialEq)]
13283#[non_exhaustive]
13284pub struct GetVolumeRequest {
13285    /// Required. Name of the volume
13286    pub name: std::string::String,
13287
13288    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13289}
13290
13291impl GetVolumeRequest {
13292    /// Creates a new default instance.
13293    pub fn new() -> Self {
13294        std::default::Default::default()
13295    }
13296
13297    /// Sets the value of [name][crate::model::GetVolumeRequest::name].
13298    ///
13299    /// # Example
13300    /// ```ignore,no_run
13301    /// # use google_cloud_netapp_v1::model::GetVolumeRequest;
13302    /// # let project_id = "project_id";
13303    /// # let location_id = "location_id";
13304    /// # let volume_id = "volume_id";
13305    /// let x = GetVolumeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
13306    /// ```
13307    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13308        self.name = v.into();
13309        self
13310    }
13311}
13312
13313impl wkt::message::Message for GetVolumeRequest {
13314    fn typename() -> &'static str {
13315        "type.googleapis.com/google.cloud.netapp.v1.GetVolumeRequest"
13316    }
13317}
13318
13319/// Message for creating a Volume
13320#[derive(Clone, Default, PartialEq)]
13321#[non_exhaustive]
13322pub struct CreateVolumeRequest {
13323    /// Required. Value for parent.
13324    pub parent: std::string::String,
13325
13326    /// Required. Id of the requesting volume. Must be unique within the parent
13327    /// resource. Must contain only letters, numbers and hyphen, with the first
13328    /// character a letter, the last a letter or a number,
13329    /// and a 63 character maximum.
13330    pub volume_id: std::string::String,
13331
13332    /// Required. The volume being created.
13333    pub volume: std::option::Option<crate::model::Volume>,
13334
13335    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13336}
13337
13338impl CreateVolumeRequest {
13339    /// Creates a new default instance.
13340    pub fn new() -> Self {
13341        std::default::Default::default()
13342    }
13343
13344    /// Sets the value of [parent][crate::model::CreateVolumeRequest::parent].
13345    ///
13346    /// # Example
13347    /// ```ignore,no_run
13348    /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
13349    /// # let project_id = "project_id";
13350    /// # let location_id = "location_id";
13351    /// let x = CreateVolumeRequest::new().set_parent(format!("projects/{project_id}/locations/{location_id}"));
13352    /// ```
13353    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13354        self.parent = v.into();
13355        self
13356    }
13357
13358    /// Sets the value of [volume_id][crate::model::CreateVolumeRequest::volume_id].
13359    ///
13360    /// # Example
13361    /// ```ignore,no_run
13362    /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
13363    /// let x = CreateVolumeRequest::new().set_volume_id("example");
13364    /// ```
13365    pub fn set_volume_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13366        self.volume_id = v.into();
13367        self
13368    }
13369
13370    /// Sets the value of [volume][crate::model::CreateVolumeRequest::volume].
13371    ///
13372    /// # Example
13373    /// ```ignore,no_run
13374    /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
13375    /// use google_cloud_netapp_v1::model::Volume;
13376    /// let x = CreateVolumeRequest::new().set_volume(Volume::default()/* use setters */);
13377    /// ```
13378    pub fn set_volume<T>(mut self, v: T) -> Self
13379    where
13380        T: std::convert::Into<crate::model::Volume>,
13381    {
13382        self.volume = std::option::Option::Some(v.into());
13383        self
13384    }
13385
13386    /// Sets or clears the value of [volume][crate::model::CreateVolumeRequest::volume].
13387    ///
13388    /// # Example
13389    /// ```ignore,no_run
13390    /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
13391    /// use google_cloud_netapp_v1::model::Volume;
13392    /// let x = CreateVolumeRequest::new().set_or_clear_volume(Some(Volume::default()/* use setters */));
13393    /// let x = CreateVolumeRequest::new().set_or_clear_volume(None::<Volume>);
13394    /// ```
13395    pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
13396    where
13397        T: std::convert::Into<crate::model::Volume>,
13398    {
13399        self.volume = v.map(|x| x.into());
13400        self
13401    }
13402}
13403
13404impl wkt::message::Message for CreateVolumeRequest {
13405    fn typename() -> &'static str {
13406        "type.googleapis.com/google.cloud.netapp.v1.CreateVolumeRequest"
13407    }
13408}
13409
13410/// Message for updating a Volume
13411#[derive(Clone, Default, PartialEq)]
13412#[non_exhaustive]
13413pub struct UpdateVolumeRequest {
13414    /// Required. Field mask is used to specify the fields to be overwritten in the
13415    /// Volume resource by the update.
13416    /// The fields specified in the update_mask are relative to the resource, not
13417    /// the full request. A field will be overwritten if it is in the mask. If the
13418    /// user does not provide a mask then all fields will be overwritten.
13419    pub update_mask: std::option::Option<wkt::FieldMask>,
13420
13421    /// Required. The volume being updated
13422    pub volume: std::option::Option<crate::model::Volume>,
13423
13424    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13425}
13426
13427impl UpdateVolumeRequest {
13428    /// Creates a new default instance.
13429    pub fn new() -> Self {
13430        std::default::Default::default()
13431    }
13432
13433    /// Sets the value of [update_mask][crate::model::UpdateVolumeRequest::update_mask].
13434    ///
13435    /// # Example
13436    /// ```ignore,no_run
13437    /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
13438    /// use wkt::FieldMask;
13439    /// let x = UpdateVolumeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
13440    /// ```
13441    pub fn set_update_mask<T>(mut self, v: T) -> Self
13442    where
13443        T: std::convert::Into<wkt::FieldMask>,
13444    {
13445        self.update_mask = std::option::Option::Some(v.into());
13446        self
13447    }
13448
13449    /// Sets or clears the value of [update_mask][crate::model::UpdateVolumeRequest::update_mask].
13450    ///
13451    /// # Example
13452    /// ```ignore,no_run
13453    /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
13454    /// use wkt::FieldMask;
13455    /// let x = UpdateVolumeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
13456    /// let x = UpdateVolumeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
13457    /// ```
13458    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13459    where
13460        T: std::convert::Into<wkt::FieldMask>,
13461    {
13462        self.update_mask = v.map(|x| x.into());
13463        self
13464    }
13465
13466    /// Sets the value of [volume][crate::model::UpdateVolumeRequest::volume].
13467    ///
13468    /// # Example
13469    /// ```ignore,no_run
13470    /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
13471    /// use google_cloud_netapp_v1::model::Volume;
13472    /// let x = UpdateVolumeRequest::new().set_volume(Volume::default()/* use setters */);
13473    /// ```
13474    pub fn set_volume<T>(mut self, v: T) -> Self
13475    where
13476        T: std::convert::Into<crate::model::Volume>,
13477    {
13478        self.volume = std::option::Option::Some(v.into());
13479        self
13480    }
13481
13482    /// Sets or clears the value of [volume][crate::model::UpdateVolumeRequest::volume].
13483    ///
13484    /// # Example
13485    /// ```ignore,no_run
13486    /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
13487    /// use google_cloud_netapp_v1::model::Volume;
13488    /// let x = UpdateVolumeRequest::new().set_or_clear_volume(Some(Volume::default()/* use setters */));
13489    /// let x = UpdateVolumeRequest::new().set_or_clear_volume(None::<Volume>);
13490    /// ```
13491    pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
13492    where
13493        T: std::convert::Into<crate::model::Volume>,
13494    {
13495        self.volume = v.map(|x| x.into());
13496        self
13497    }
13498}
13499
13500impl wkt::message::Message for UpdateVolumeRequest {
13501    fn typename() -> &'static str {
13502        "type.googleapis.com/google.cloud.netapp.v1.UpdateVolumeRequest"
13503    }
13504}
13505
13506/// Message for deleting a Volume
13507#[derive(Clone, Default, PartialEq)]
13508#[non_exhaustive]
13509pub struct DeleteVolumeRequest {
13510    /// Required. Name of the volume
13511    pub name: std::string::String,
13512
13513    /// If this field is set as true, CCFE will not block the volume resource
13514    /// deletion even if it has any snapshots resource. (Otherwise, the request
13515    /// will only work if the volume has no snapshots.)
13516    pub force: bool,
13517
13518    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13519}
13520
13521impl DeleteVolumeRequest {
13522    /// Creates a new default instance.
13523    pub fn new() -> Self {
13524        std::default::Default::default()
13525    }
13526
13527    /// Sets the value of [name][crate::model::DeleteVolumeRequest::name].
13528    ///
13529    /// # Example
13530    /// ```ignore,no_run
13531    /// # use google_cloud_netapp_v1::model::DeleteVolumeRequest;
13532    /// # let project_id = "project_id";
13533    /// # let location_id = "location_id";
13534    /// # let volume_id = "volume_id";
13535    /// let x = DeleteVolumeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
13536    /// ```
13537    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13538        self.name = v.into();
13539        self
13540    }
13541
13542    /// Sets the value of [force][crate::model::DeleteVolumeRequest::force].
13543    ///
13544    /// # Example
13545    /// ```ignore,no_run
13546    /// # use google_cloud_netapp_v1::model::DeleteVolumeRequest;
13547    /// let x = DeleteVolumeRequest::new().set_force(true);
13548    /// ```
13549    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13550        self.force = v.into();
13551        self
13552    }
13553}
13554
13555impl wkt::message::Message for DeleteVolumeRequest {
13556    fn typename() -> &'static str {
13557        "type.googleapis.com/google.cloud.netapp.v1.DeleteVolumeRequest"
13558    }
13559}
13560
13561/// RevertVolumeRequest reverts the given volume to the specified snapshot.
13562#[derive(Clone, Default, PartialEq)]
13563#[non_exhaustive]
13564pub struct RevertVolumeRequest {
13565    /// Required. The resource name of the volume, in the format of
13566    /// projects/{project_id}/locations/{location}/volumes/{volume_id}.
13567    pub name: std::string::String,
13568
13569    /// Required. The snapshot resource ID, in the format 'my-snapshot', where the
13570    /// specified ID is the {snapshot_id} of the fully qualified name like
13571    /// projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}
13572    pub snapshot_id: std::string::String,
13573
13574    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13575}
13576
13577impl RevertVolumeRequest {
13578    /// Creates a new default instance.
13579    pub fn new() -> Self {
13580        std::default::Default::default()
13581    }
13582
13583    /// Sets the value of [name][crate::model::RevertVolumeRequest::name].
13584    ///
13585    /// # Example
13586    /// ```ignore,no_run
13587    /// # use google_cloud_netapp_v1::model::RevertVolumeRequest;
13588    /// # let project_id = "project_id";
13589    /// # let location_id = "location_id";
13590    /// # let volume_id = "volume_id";
13591    /// let x = RevertVolumeRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
13592    /// ```
13593    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13594        self.name = v.into();
13595        self
13596    }
13597
13598    /// Sets the value of [snapshot_id][crate::model::RevertVolumeRequest::snapshot_id].
13599    ///
13600    /// # Example
13601    /// ```ignore,no_run
13602    /// # use google_cloud_netapp_v1::model::RevertVolumeRequest;
13603    /// let x = RevertVolumeRequest::new().set_snapshot_id("example");
13604    /// ```
13605    pub fn set_snapshot_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13606        self.snapshot_id = v.into();
13607        self
13608    }
13609}
13610
13611impl wkt::message::Message for RevertVolumeRequest {
13612    fn typename() -> &'static str {
13613        "type.googleapis.com/google.cloud.netapp.v1.RevertVolumeRequest"
13614    }
13615}
13616
13617/// Volume provides a filesystem that you can mount.
13618#[derive(Clone, Default, PartialEq)]
13619#[non_exhaustive]
13620pub struct Volume {
13621    /// Identifier. Name of the volume
13622    pub name: std::string::String,
13623
13624    /// Output only. State of the volume
13625    pub state: crate::model::volume::State,
13626
13627    /// Output only. State details of the volume
13628    pub state_details: std::string::String,
13629
13630    /// Output only. Create time of the volume
13631    pub create_time: std::option::Option<wkt::Timestamp>,
13632
13633    /// Required. Share name of the volume
13634    pub share_name: std::string::String,
13635
13636    /// Output only. This field is not implemented. The values provided in this
13637    /// field are ignored.
13638    pub psa_range: std::string::String,
13639
13640    /// Required. StoragePool name of the volume
13641    pub storage_pool: std::string::String,
13642
13643    /// Output only. VPC Network name.
13644    /// Format: projects/{project}/global/networks/{network}
13645    pub network: std::string::String,
13646
13647    /// Output only. Service level of the volume
13648    pub service_level: crate::model::ServiceLevel,
13649
13650    /// Required. Capacity in GIB of the volume
13651    pub capacity_gib: i64,
13652
13653    /// Optional. Export policy of the volume
13654    pub export_policy: std::option::Option<crate::model::ExportPolicy>,
13655
13656    /// Required. Protocols required for the volume
13657    pub protocols: std::vec::Vec<crate::model::Protocols>,
13658
13659    /// Optional. SMB share settings for the volume.
13660    pub smb_settings: std::vec::Vec<crate::model::SMBSettings>,
13661
13662    /// Output only. Mount options of this volume
13663    pub mount_options: std::vec::Vec<crate::model::MountOption>,
13664
13665    /// Optional. Default unix style permission (e.g. 777) the mount point will be
13666    /// created with. Applicable for NFS protocol types only.
13667    pub unix_permissions: std::string::String,
13668
13669    /// Optional. Labels as key value pairs
13670    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
13671
13672    /// Optional. Description of the volume
13673    pub description: std::string::String,
13674
13675    /// Optional. SnapshotPolicy for a volume.
13676    pub snapshot_policy: std::option::Option<crate::model::SnapshotPolicy>,
13677
13678    /// Optional. Snap_reserve specifies percentage of volume storage reserved for
13679    /// snapshot storage. Default is 0 percent.
13680    pub snap_reserve: f64,
13681
13682    /// Optional. Snapshot_directory if enabled (true) the volume will contain a
13683    /// read-only .snapshot directory which provides access to each of the volume's
13684    /// snapshots.
13685    pub snapshot_directory: bool,
13686
13687    /// Output only. Used capacity in GIB of the volume. This is computed
13688    /// periodically and it does not represent the realtime usage.
13689    pub used_gib: i64,
13690
13691    /// Optional. Security Style of the Volume
13692    pub security_style: crate::model::SecurityStyle,
13693
13694    /// Optional. Flag indicating if the volume is a kerberos volume or not, export
13695    /// policy rules control kerberos security modes (krb5, krb5i, krb5p).
13696    pub kerberos_enabled: bool,
13697
13698    /// Output only. Flag indicating if the volume is NFS LDAP enabled or not.
13699    pub ldap_enabled: bool,
13700
13701    /// Output only. Specifies the ActiveDirectory name of a SMB volume.
13702    pub active_directory: std::string::String,
13703
13704    /// Optional. Specifies the source of the volume to be created from.
13705    pub restore_parameters: std::option::Option<crate::model::RestoreParameters>,
13706
13707    /// Output only. Specifies the KMS config to be used for volume encryption.
13708    pub kms_config: std::string::String,
13709
13710    /// Output only. Specified the current volume encryption key source.
13711    pub encryption_type: crate::model::EncryptionType,
13712
13713    /// Output only. Indicates whether the volume is part of a replication
13714    /// relationship.
13715    pub has_replication: bool,
13716
13717    /// BackupConfig of the volume.
13718    pub backup_config: std::option::Option<crate::model::BackupConfig>,
13719
13720    /// Optional. List of actions that are restricted on this volume.
13721    pub restricted_actions: std::vec::Vec<crate::model::RestrictedAction>,
13722
13723    /// Optional. Flag indicating if the volume will be a large capacity volume or
13724    /// a regular volume. This field is used for legacy FILE pools. For Unified
13725    /// pools, use the `large_capacity_config` field instead. This field and
13726    /// `large_capacity_config` are mutually exclusive.
13727    pub large_capacity: bool,
13728
13729    /// Optional. Flag indicating if the volume will have an IP address per node
13730    /// for volumes supporting multiple IP endpoints. Only the volume with
13731    /// large_capacity will be allowed to have multiple endpoints.
13732    pub multiple_endpoints: bool,
13733
13734    /// Tiering policy for the volume.
13735    pub tiering_policy: std::option::Option<crate::model::TieringPolicy>,
13736
13737    /// Output only. Specifies the replica zone for regional volume.
13738    pub replica_zone: std::string::String,
13739
13740    /// Output only. Specifies the active zone for regional volume.
13741    pub zone: std::string::String,
13742
13743    /// Output only. Size of the volume cold tier data rounded down to the nearest
13744    /// GiB.
13745    pub cold_tier_size_gib: i64,
13746
13747    /// Optional. The Hybrid Replication parameters for the volume.
13748    pub hybrid_replication_parameters:
13749        std::option::Option<crate::model::HybridReplicationParameters>,
13750
13751    /// Optional. Throughput of the volume (in MiB/s)
13752    pub throughput_mibps: f64,
13753
13754    /// Optional. Cache parameters for the volume.
13755    pub cache_parameters: std::option::Option<crate::model::CacheParameters>,
13756
13757    /// Output only. Total hot tier data rounded down to the nearest GiB used by
13758    /// the Volume. This field is only used for flex Service Level
13759    pub hot_tier_size_used_gib: i64,
13760
13761    /// Optional. Block devices for the volume.
13762    /// Currently, only one block device is permitted per Volume.
13763    pub block_devices: std::vec::Vec<crate::model::BlockDevice>,
13764
13765    /// Optional. Large capacity config for the volume.
13766    /// Enables and configures large capacity for volumes in Unified pools with
13767    /// File protocols. Not applicable for Block protocols in Unified pools.
13768    /// This field and the legacy `large_capacity` boolean field
13769    /// are mutually exclusive.
13770    pub large_capacity_config: std::option::Option<crate::model::LargeCapacityConfig>,
13771
13772    /// Output only. If this volume is a clone, this field contains details about
13773    /// the clone.
13774    pub clone_details: std::option::Option<crate::model::volume::CloneDetails>,
13775
13776    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13777}
13778
13779impl Volume {
13780    /// Creates a new default instance.
13781    pub fn new() -> Self {
13782        std::default::Default::default()
13783    }
13784
13785    /// Sets the value of [name][crate::model::Volume::name].
13786    ///
13787    /// # Example
13788    /// ```ignore,no_run
13789    /// # use google_cloud_netapp_v1::model::Volume;
13790    /// # let project_id = "project_id";
13791    /// # let location_id = "location_id";
13792    /// # let volume_id = "volume_id";
13793    /// let x = Volume::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
13794    /// ```
13795    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13796        self.name = v.into();
13797        self
13798    }
13799
13800    /// Sets the value of [state][crate::model::Volume::state].
13801    ///
13802    /// # Example
13803    /// ```ignore,no_run
13804    /// # use google_cloud_netapp_v1::model::Volume;
13805    /// use google_cloud_netapp_v1::model::volume::State;
13806    /// let x0 = Volume::new().set_state(State::Ready);
13807    /// let x1 = Volume::new().set_state(State::Creating);
13808    /// let x2 = Volume::new().set_state(State::Deleting);
13809    /// ```
13810    pub fn set_state<T: std::convert::Into<crate::model::volume::State>>(mut self, v: T) -> Self {
13811        self.state = v.into();
13812        self
13813    }
13814
13815    /// Sets the value of [state_details][crate::model::Volume::state_details].
13816    ///
13817    /// # Example
13818    /// ```ignore,no_run
13819    /// # use google_cloud_netapp_v1::model::Volume;
13820    /// let x = Volume::new().set_state_details("example");
13821    /// ```
13822    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13823        self.state_details = v.into();
13824        self
13825    }
13826
13827    /// Sets the value of [create_time][crate::model::Volume::create_time].
13828    ///
13829    /// # Example
13830    /// ```ignore,no_run
13831    /// # use google_cloud_netapp_v1::model::Volume;
13832    /// use wkt::Timestamp;
13833    /// let x = Volume::new().set_create_time(Timestamp::default()/* use setters */);
13834    /// ```
13835    pub fn set_create_time<T>(mut self, v: T) -> Self
13836    where
13837        T: std::convert::Into<wkt::Timestamp>,
13838    {
13839        self.create_time = std::option::Option::Some(v.into());
13840        self
13841    }
13842
13843    /// Sets or clears the value of [create_time][crate::model::Volume::create_time].
13844    ///
13845    /// # Example
13846    /// ```ignore,no_run
13847    /// # use google_cloud_netapp_v1::model::Volume;
13848    /// use wkt::Timestamp;
13849    /// let x = Volume::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
13850    /// let x = Volume::new().set_or_clear_create_time(None::<Timestamp>);
13851    /// ```
13852    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
13853    where
13854        T: std::convert::Into<wkt::Timestamp>,
13855    {
13856        self.create_time = v.map(|x| x.into());
13857        self
13858    }
13859
13860    /// Sets the value of [share_name][crate::model::Volume::share_name].
13861    ///
13862    /// # Example
13863    /// ```ignore,no_run
13864    /// # use google_cloud_netapp_v1::model::Volume;
13865    /// let x = Volume::new().set_share_name("example");
13866    /// ```
13867    pub fn set_share_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13868        self.share_name = v.into();
13869        self
13870    }
13871
13872    /// Sets the value of [psa_range][crate::model::Volume::psa_range].
13873    ///
13874    /// # Example
13875    /// ```ignore,no_run
13876    /// # use google_cloud_netapp_v1::model::Volume;
13877    /// let x = Volume::new().set_psa_range("example");
13878    /// ```
13879    pub fn set_psa_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13880        self.psa_range = v.into();
13881        self
13882    }
13883
13884    /// Sets the value of [storage_pool][crate::model::Volume::storage_pool].
13885    ///
13886    /// # Example
13887    /// ```ignore,no_run
13888    /// # use google_cloud_netapp_v1::model::Volume;
13889    /// # let project_id = "project_id";
13890    /// # let location_id = "location_id";
13891    /// # let storage_pool_id = "storage_pool_id";
13892    /// let x = Volume::new().set_storage_pool(format!("projects/{project_id}/locations/{location_id}/storagePools/{storage_pool_id}"));
13893    /// ```
13894    pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13895        self.storage_pool = v.into();
13896        self
13897    }
13898
13899    /// Sets the value of [network][crate::model::Volume::network].
13900    ///
13901    /// # Example
13902    /// ```ignore,no_run
13903    /// # use google_cloud_netapp_v1::model::Volume;
13904    /// let x = Volume::new().set_network("example");
13905    /// ```
13906    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13907        self.network = v.into();
13908        self
13909    }
13910
13911    /// Sets the value of [service_level][crate::model::Volume::service_level].
13912    ///
13913    /// # Example
13914    /// ```ignore,no_run
13915    /// # use google_cloud_netapp_v1::model::Volume;
13916    /// use google_cloud_netapp_v1::model::ServiceLevel;
13917    /// let x0 = Volume::new().set_service_level(ServiceLevel::Premium);
13918    /// let x1 = Volume::new().set_service_level(ServiceLevel::Extreme);
13919    /// let x2 = Volume::new().set_service_level(ServiceLevel::Standard);
13920    /// ```
13921    pub fn set_service_level<T: std::convert::Into<crate::model::ServiceLevel>>(
13922        mut self,
13923        v: T,
13924    ) -> Self {
13925        self.service_level = v.into();
13926        self
13927    }
13928
13929    /// Sets the value of [capacity_gib][crate::model::Volume::capacity_gib].
13930    ///
13931    /// # Example
13932    /// ```ignore,no_run
13933    /// # use google_cloud_netapp_v1::model::Volume;
13934    /// let x = Volume::new().set_capacity_gib(42);
13935    /// ```
13936    pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13937        self.capacity_gib = v.into();
13938        self
13939    }
13940
13941    /// Sets the value of [export_policy][crate::model::Volume::export_policy].
13942    ///
13943    /// # Example
13944    /// ```ignore,no_run
13945    /// # use google_cloud_netapp_v1::model::Volume;
13946    /// use google_cloud_netapp_v1::model::ExportPolicy;
13947    /// let x = Volume::new().set_export_policy(ExportPolicy::default()/* use setters */);
13948    /// ```
13949    pub fn set_export_policy<T>(mut self, v: T) -> Self
13950    where
13951        T: std::convert::Into<crate::model::ExportPolicy>,
13952    {
13953        self.export_policy = std::option::Option::Some(v.into());
13954        self
13955    }
13956
13957    /// Sets or clears the value of [export_policy][crate::model::Volume::export_policy].
13958    ///
13959    /// # Example
13960    /// ```ignore,no_run
13961    /// # use google_cloud_netapp_v1::model::Volume;
13962    /// use google_cloud_netapp_v1::model::ExportPolicy;
13963    /// let x = Volume::new().set_or_clear_export_policy(Some(ExportPolicy::default()/* use setters */));
13964    /// let x = Volume::new().set_or_clear_export_policy(None::<ExportPolicy>);
13965    /// ```
13966    pub fn set_or_clear_export_policy<T>(mut self, v: std::option::Option<T>) -> Self
13967    where
13968        T: std::convert::Into<crate::model::ExportPolicy>,
13969    {
13970        self.export_policy = v.map(|x| x.into());
13971        self
13972    }
13973
13974    /// Sets the value of [protocols][crate::model::Volume::protocols].
13975    ///
13976    /// # Example
13977    /// ```ignore,no_run
13978    /// # use google_cloud_netapp_v1::model::Volume;
13979    /// use google_cloud_netapp_v1::model::Protocols;
13980    /// let x = Volume::new().set_protocols([
13981    ///     Protocols::Nfsv3,
13982    ///     Protocols::Nfsv4,
13983    ///     Protocols::Smb,
13984    /// ]);
13985    /// ```
13986    pub fn set_protocols<T, V>(mut self, v: T) -> Self
13987    where
13988        T: std::iter::IntoIterator<Item = V>,
13989        V: std::convert::Into<crate::model::Protocols>,
13990    {
13991        use std::iter::Iterator;
13992        self.protocols = v.into_iter().map(|i| i.into()).collect();
13993        self
13994    }
13995
13996    /// Sets the value of [smb_settings][crate::model::Volume::smb_settings].
13997    ///
13998    /// # Example
13999    /// ```ignore,no_run
14000    /// # use google_cloud_netapp_v1::model::Volume;
14001    /// use google_cloud_netapp_v1::model::SMBSettings;
14002    /// let x = Volume::new().set_smb_settings([
14003    ///     SMBSettings::EncryptData,
14004    ///     SMBSettings::Browsable,
14005    ///     SMBSettings::ChangeNotify,
14006    /// ]);
14007    /// ```
14008    pub fn set_smb_settings<T, V>(mut self, v: T) -> Self
14009    where
14010        T: std::iter::IntoIterator<Item = V>,
14011        V: std::convert::Into<crate::model::SMBSettings>,
14012    {
14013        use std::iter::Iterator;
14014        self.smb_settings = v.into_iter().map(|i| i.into()).collect();
14015        self
14016    }
14017
14018    /// Sets the value of [mount_options][crate::model::Volume::mount_options].
14019    ///
14020    /// # Example
14021    /// ```ignore,no_run
14022    /// # use google_cloud_netapp_v1::model::Volume;
14023    /// use google_cloud_netapp_v1::model::MountOption;
14024    /// let x = Volume::new()
14025    ///     .set_mount_options([
14026    ///         MountOption::default()/* use setters */,
14027    ///         MountOption::default()/* use (different) setters */,
14028    ///     ]);
14029    /// ```
14030    pub fn set_mount_options<T, V>(mut self, v: T) -> Self
14031    where
14032        T: std::iter::IntoIterator<Item = V>,
14033        V: std::convert::Into<crate::model::MountOption>,
14034    {
14035        use std::iter::Iterator;
14036        self.mount_options = v.into_iter().map(|i| i.into()).collect();
14037        self
14038    }
14039
14040    /// Sets the value of [unix_permissions][crate::model::Volume::unix_permissions].
14041    ///
14042    /// # Example
14043    /// ```ignore,no_run
14044    /// # use google_cloud_netapp_v1::model::Volume;
14045    /// let x = Volume::new().set_unix_permissions("example");
14046    /// ```
14047    pub fn set_unix_permissions<T: std::convert::Into<std::string::String>>(
14048        mut self,
14049        v: T,
14050    ) -> Self {
14051        self.unix_permissions = v.into();
14052        self
14053    }
14054
14055    /// Sets the value of [labels][crate::model::Volume::labels].
14056    ///
14057    /// # Example
14058    /// ```ignore,no_run
14059    /// # use google_cloud_netapp_v1::model::Volume;
14060    /// let x = Volume::new().set_labels([
14061    ///     ("key0", "abc"),
14062    ///     ("key1", "xyz"),
14063    /// ]);
14064    /// ```
14065    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
14066    where
14067        T: std::iter::IntoIterator<Item = (K, V)>,
14068        K: std::convert::Into<std::string::String>,
14069        V: std::convert::Into<std::string::String>,
14070    {
14071        use std::iter::Iterator;
14072        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14073        self
14074    }
14075
14076    /// Sets the value of [description][crate::model::Volume::description].
14077    ///
14078    /// # Example
14079    /// ```ignore,no_run
14080    /// # use google_cloud_netapp_v1::model::Volume;
14081    /// let x = Volume::new().set_description("example");
14082    /// ```
14083    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14084        self.description = v.into();
14085        self
14086    }
14087
14088    /// Sets the value of [snapshot_policy][crate::model::Volume::snapshot_policy].
14089    ///
14090    /// # Example
14091    /// ```ignore,no_run
14092    /// # use google_cloud_netapp_v1::model::Volume;
14093    /// use google_cloud_netapp_v1::model::SnapshotPolicy;
14094    /// let x = Volume::new().set_snapshot_policy(SnapshotPolicy::default()/* use setters */);
14095    /// ```
14096    pub fn set_snapshot_policy<T>(mut self, v: T) -> Self
14097    where
14098        T: std::convert::Into<crate::model::SnapshotPolicy>,
14099    {
14100        self.snapshot_policy = std::option::Option::Some(v.into());
14101        self
14102    }
14103
14104    /// Sets or clears the value of [snapshot_policy][crate::model::Volume::snapshot_policy].
14105    ///
14106    /// # Example
14107    /// ```ignore,no_run
14108    /// # use google_cloud_netapp_v1::model::Volume;
14109    /// use google_cloud_netapp_v1::model::SnapshotPolicy;
14110    /// let x = Volume::new().set_or_clear_snapshot_policy(Some(SnapshotPolicy::default()/* use setters */));
14111    /// let x = Volume::new().set_or_clear_snapshot_policy(None::<SnapshotPolicy>);
14112    /// ```
14113    pub fn set_or_clear_snapshot_policy<T>(mut self, v: std::option::Option<T>) -> Self
14114    where
14115        T: std::convert::Into<crate::model::SnapshotPolicy>,
14116    {
14117        self.snapshot_policy = v.map(|x| x.into());
14118        self
14119    }
14120
14121    /// Sets the value of [snap_reserve][crate::model::Volume::snap_reserve].
14122    ///
14123    /// # Example
14124    /// ```ignore,no_run
14125    /// # use google_cloud_netapp_v1::model::Volume;
14126    /// let x = Volume::new().set_snap_reserve(42.0);
14127    /// ```
14128    pub fn set_snap_reserve<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
14129        self.snap_reserve = v.into();
14130        self
14131    }
14132
14133    /// Sets the value of [snapshot_directory][crate::model::Volume::snapshot_directory].
14134    ///
14135    /// # Example
14136    /// ```ignore,no_run
14137    /// # use google_cloud_netapp_v1::model::Volume;
14138    /// let x = Volume::new().set_snapshot_directory(true);
14139    /// ```
14140    pub fn set_snapshot_directory<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14141        self.snapshot_directory = v.into();
14142        self
14143    }
14144
14145    /// Sets the value of [used_gib][crate::model::Volume::used_gib].
14146    ///
14147    /// # Example
14148    /// ```ignore,no_run
14149    /// # use google_cloud_netapp_v1::model::Volume;
14150    /// let x = Volume::new().set_used_gib(42);
14151    /// ```
14152    pub fn set_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14153        self.used_gib = v.into();
14154        self
14155    }
14156
14157    /// Sets the value of [security_style][crate::model::Volume::security_style].
14158    ///
14159    /// # Example
14160    /// ```ignore,no_run
14161    /// # use google_cloud_netapp_v1::model::Volume;
14162    /// use google_cloud_netapp_v1::model::SecurityStyle;
14163    /// let x0 = Volume::new().set_security_style(SecurityStyle::Ntfs);
14164    /// let x1 = Volume::new().set_security_style(SecurityStyle::Unix);
14165    /// ```
14166    pub fn set_security_style<T: std::convert::Into<crate::model::SecurityStyle>>(
14167        mut self,
14168        v: T,
14169    ) -> Self {
14170        self.security_style = v.into();
14171        self
14172    }
14173
14174    /// Sets the value of [kerberos_enabled][crate::model::Volume::kerberos_enabled].
14175    ///
14176    /// # Example
14177    /// ```ignore,no_run
14178    /// # use google_cloud_netapp_v1::model::Volume;
14179    /// let x = Volume::new().set_kerberos_enabled(true);
14180    /// ```
14181    pub fn set_kerberos_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14182        self.kerberos_enabled = v.into();
14183        self
14184    }
14185
14186    /// Sets the value of [ldap_enabled][crate::model::Volume::ldap_enabled].
14187    ///
14188    /// # Example
14189    /// ```ignore,no_run
14190    /// # use google_cloud_netapp_v1::model::Volume;
14191    /// let x = Volume::new().set_ldap_enabled(true);
14192    /// ```
14193    pub fn set_ldap_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14194        self.ldap_enabled = v.into();
14195        self
14196    }
14197
14198    /// Sets the value of [active_directory][crate::model::Volume::active_directory].
14199    ///
14200    /// # Example
14201    /// ```ignore,no_run
14202    /// # use google_cloud_netapp_v1::model::Volume;
14203    /// # let project_id = "project_id";
14204    /// # let location_id = "location_id";
14205    /// # let active_directory_id = "active_directory_id";
14206    /// let x = Volume::new().set_active_directory(format!("projects/{project_id}/locations/{location_id}/activeDirectories/{active_directory_id}"));
14207    /// ```
14208    pub fn set_active_directory<T: std::convert::Into<std::string::String>>(
14209        mut self,
14210        v: T,
14211    ) -> Self {
14212        self.active_directory = v.into();
14213        self
14214    }
14215
14216    /// Sets the value of [restore_parameters][crate::model::Volume::restore_parameters].
14217    ///
14218    /// # Example
14219    /// ```ignore,no_run
14220    /// # use google_cloud_netapp_v1::model::Volume;
14221    /// use google_cloud_netapp_v1::model::RestoreParameters;
14222    /// let x = Volume::new().set_restore_parameters(RestoreParameters::default()/* use setters */);
14223    /// ```
14224    pub fn set_restore_parameters<T>(mut self, v: T) -> Self
14225    where
14226        T: std::convert::Into<crate::model::RestoreParameters>,
14227    {
14228        self.restore_parameters = std::option::Option::Some(v.into());
14229        self
14230    }
14231
14232    /// Sets or clears the value of [restore_parameters][crate::model::Volume::restore_parameters].
14233    ///
14234    /// # Example
14235    /// ```ignore,no_run
14236    /// # use google_cloud_netapp_v1::model::Volume;
14237    /// use google_cloud_netapp_v1::model::RestoreParameters;
14238    /// let x = Volume::new().set_or_clear_restore_parameters(Some(RestoreParameters::default()/* use setters */));
14239    /// let x = Volume::new().set_or_clear_restore_parameters(None::<RestoreParameters>);
14240    /// ```
14241    pub fn set_or_clear_restore_parameters<T>(mut self, v: std::option::Option<T>) -> Self
14242    where
14243        T: std::convert::Into<crate::model::RestoreParameters>,
14244    {
14245        self.restore_parameters = v.map(|x| x.into());
14246        self
14247    }
14248
14249    /// Sets the value of [kms_config][crate::model::Volume::kms_config].
14250    ///
14251    /// # Example
14252    /// ```ignore,no_run
14253    /// # use google_cloud_netapp_v1::model::Volume;
14254    /// # let project_id = "project_id";
14255    /// # let location_id = "location_id";
14256    /// # let kms_config_id = "kms_config_id";
14257    /// let x = Volume::new().set_kms_config(format!("projects/{project_id}/locations/{location_id}/kmsConfigs/{kms_config_id}"));
14258    /// ```
14259    pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14260        self.kms_config = v.into();
14261        self
14262    }
14263
14264    /// Sets the value of [encryption_type][crate::model::Volume::encryption_type].
14265    ///
14266    /// # Example
14267    /// ```ignore,no_run
14268    /// # use google_cloud_netapp_v1::model::Volume;
14269    /// use google_cloud_netapp_v1::model::EncryptionType;
14270    /// let x0 = Volume::new().set_encryption_type(EncryptionType::ServiceManaged);
14271    /// let x1 = Volume::new().set_encryption_type(EncryptionType::CloudKms);
14272    /// ```
14273    pub fn set_encryption_type<T: std::convert::Into<crate::model::EncryptionType>>(
14274        mut self,
14275        v: T,
14276    ) -> Self {
14277        self.encryption_type = v.into();
14278        self
14279    }
14280
14281    /// Sets the value of [has_replication][crate::model::Volume::has_replication].
14282    ///
14283    /// # Example
14284    /// ```ignore,no_run
14285    /// # use google_cloud_netapp_v1::model::Volume;
14286    /// let x = Volume::new().set_has_replication(true);
14287    /// ```
14288    pub fn set_has_replication<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14289        self.has_replication = v.into();
14290        self
14291    }
14292
14293    /// Sets the value of [backup_config][crate::model::Volume::backup_config].
14294    ///
14295    /// # Example
14296    /// ```ignore,no_run
14297    /// # use google_cloud_netapp_v1::model::Volume;
14298    /// use google_cloud_netapp_v1::model::BackupConfig;
14299    /// let x = Volume::new().set_backup_config(BackupConfig::default()/* use setters */);
14300    /// ```
14301    pub fn set_backup_config<T>(mut self, v: T) -> Self
14302    where
14303        T: std::convert::Into<crate::model::BackupConfig>,
14304    {
14305        self.backup_config = std::option::Option::Some(v.into());
14306        self
14307    }
14308
14309    /// Sets or clears the value of [backup_config][crate::model::Volume::backup_config].
14310    ///
14311    /// # Example
14312    /// ```ignore,no_run
14313    /// # use google_cloud_netapp_v1::model::Volume;
14314    /// use google_cloud_netapp_v1::model::BackupConfig;
14315    /// let x = Volume::new().set_or_clear_backup_config(Some(BackupConfig::default()/* use setters */));
14316    /// let x = Volume::new().set_or_clear_backup_config(None::<BackupConfig>);
14317    /// ```
14318    pub fn set_or_clear_backup_config<T>(mut self, v: std::option::Option<T>) -> Self
14319    where
14320        T: std::convert::Into<crate::model::BackupConfig>,
14321    {
14322        self.backup_config = v.map(|x| x.into());
14323        self
14324    }
14325
14326    /// Sets the value of [restricted_actions][crate::model::Volume::restricted_actions].
14327    ///
14328    /// # Example
14329    /// ```ignore,no_run
14330    /// # use google_cloud_netapp_v1::model::Volume;
14331    /// use google_cloud_netapp_v1::model::RestrictedAction;
14332    /// let x = Volume::new().set_restricted_actions([
14333    ///     RestrictedAction::Delete,
14334    /// ]);
14335    /// ```
14336    pub fn set_restricted_actions<T, V>(mut self, v: T) -> Self
14337    where
14338        T: std::iter::IntoIterator<Item = V>,
14339        V: std::convert::Into<crate::model::RestrictedAction>,
14340    {
14341        use std::iter::Iterator;
14342        self.restricted_actions = v.into_iter().map(|i| i.into()).collect();
14343        self
14344    }
14345
14346    /// Sets the value of [large_capacity][crate::model::Volume::large_capacity].
14347    ///
14348    /// # Example
14349    /// ```ignore,no_run
14350    /// # use google_cloud_netapp_v1::model::Volume;
14351    /// let x = Volume::new().set_large_capacity(true);
14352    /// ```
14353    pub fn set_large_capacity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14354        self.large_capacity = v.into();
14355        self
14356    }
14357
14358    /// Sets the value of [multiple_endpoints][crate::model::Volume::multiple_endpoints].
14359    ///
14360    /// # Example
14361    /// ```ignore,no_run
14362    /// # use google_cloud_netapp_v1::model::Volume;
14363    /// let x = Volume::new().set_multiple_endpoints(true);
14364    /// ```
14365    pub fn set_multiple_endpoints<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
14366        self.multiple_endpoints = v.into();
14367        self
14368    }
14369
14370    /// Sets the value of [tiering_policy][crate::model::Volume::tiering_policy].
14371    ///
14372    /// # Example
14373    /// ```ignore,no_run
14374    /// # use google_cloud_netapp_v1::model::Volume;
14375    /// use google_cloud_netapp_v1::model::TieringPolicy;
14376    /// let x = Volume::new().set_tiering_policy(TieringPolicy::default()/* use setters */);
14377    /// ```
14378    pub fn set_tiering_policy<T>(mut self, v: T) -> Self
14379    where
14380        T: std::convert::Into<crate::model::TieringPolicy>,
14381    {
14382        self.tiering_policy = std::option::Option::Some(v.into());
14383        self
14384    }
14385
14386    /// Sets or clears the value of [tiering_policy][crate::model::Volume::tiering_policy].
14387    ///
14388    /// # Example
14389    /// ```ignore,no_run
14390    /// # use google_cloud_netapp_v1::model::Volume;
14391    /// use google_cloud_netapp_v1::model::TieringPolicy;
14392    /// let x = Volume::new().set_or_clear_tiering_policy(Some(TieringPolicy::default()/* use setters */));
14393    /// let x = Volume::new().set_or_clear_tiering_policy(None::<TieringPolicy>);
14394    /// ```
14395    pub fn set_or_clear_tiering_policy<T>(mut self, v: std::option::Option<T>) -> Self
14396    where
14397        T: std::convert::Into<crate::model::TieringPolicy>,
14398    {
14399        self.tiering_policy = v.map(|x| x.into());
14400        self
14401    }
14402
14403    /// Sets the value of [replica_zone][crate::model::Volume::replica_zone].
14404    ///
14405    /// # Example
14406    /// ```ignore,no_run
14407    /// # use google_cloud_netapp_v1::model::Volume;
14408    /// let x = Volume::new().set_replica_zone("example");
14409    /// ```
14410    pub fn set_replica_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14411        self.replica_zone = v.into();
14412        self
14413    }
14414
14415    /// Sets the value of [zone][crate::model::Volume::zone].
14416    ///
14417    /// # Example
14418    /// ```ignore,no_run
14419    /// # use google_cloud_netapp_v1::model::Volume;
14420    /// let x = Volume::new().set_zone("example");
14421    /// ```
14422    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14423        self.zone = v.into();
14424        self
14425    }
14426
14427    /// Sets the value of [cold_tier_size_gib][crate::model::Volume::cold_tier_size_gib].
14428    ///
14429    /// # Example
14430    /// ```ignore,no_run
14431    /// # use google_cloud_netapp_v1::model::Volume;
14432    /// let x = Volume::new().set_cold_tier_size_gib(42);
14433    /// ```
14434    pub fn set_cold_tier_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14435        self.cold_tier_size_gib = v.into();
14436        self
14437    }
14438
14439    /// Sets the value of [hybrid_replication_parameters][crate::model::Volume::hybrid_replication_parameters].
14440    ///
14441    /// # Example
14442    /// ```ignore,no_run
14443    /// # use google_cloud_netapp_v1::model::Volume;
14444    /// use google_cloud_netapp_v1::model::HybridReplicationParameters;
14445    /// let x = Volume::new().set_hybrid_replication_parameters(HybridReplicationParameters::default()/* use setters */);
14446    /// ```
14447    pub fn set_hybrid_replication_parameters<T>(mut self, v: T) -> Self
14448    where
14449        T: std::convert::Into<crate::model::HybridReplicationParameters>,
14450    {
14451        self.hybrid_replication_parameters = std::option::Option::Some(v.into());
14452        self
14453    }
14454
14455    /// Sets or clears the value of [hybrid_replication_parameters][crate::model::Volume::hybrid_replication_parameters].
14456    ///
14457    /// # Example
14458    /// ```ignore,no_run
14459    /// # use google_cloud_netapp_v1::model::Volume;
14460    /// use google_cloud_netapp_v1::model::HybridReplicationParameters;
14461    /// let x = Volume::new().set_or_clear_hybrid_replication_parameters(Some(HybridReplicationParameters::default()/* use setters */));
14462    /// let x = Volume::new().set_or_clear_hybrid_replication_parameters(None::<HybridReplicationParameters>);
14463    /// ```
14464    pub fn set_or_clear_hybrid_replication_parameters<T>(
14465        mut self,
14466        v: std::option::Option<T>,
14467    ) -> Self
14468    where
14469        T: std::convert::Into<crate::model::HybridReplicationParameters>,
14470    {
14471        self.hybrid_replication_parameters = v.map(|x| x.into());
14472        self
14473    }
14474
14475    /// Sets the value of [throughput_mibps][crate::model::Volume::throughput_mibps].
14476    ///
14477    /// # Example
14478    /// ```ignore,no_run
14479    /// # use google_cloud_netapp_v1::model::Volume;
14480    /// let x = Volume::new().set_throughput_mibps(42.0);
14481    /// ```
14482    pub fn set_throughput_mibps<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
14483        self.throughput_mibps = v.into();
14484        self
14485    }
14486
14487    /// Sets the value of [cache_parameters][crate::model::Volume::cache_parameters].
14488    ///
14489    /// # Example
14490    /// ```ignore,no_run
14491    /// # use google_cloud_netapp_v1::model::Volume;
14492    /// use google_cloud_netapp_v1::model::CacheParameters;
14493    /// let x = Volume::new().set_cache_parameters(CacheParameters::default()/* use setters */);
14494    /// ```
14495    pub fn set_cache_parameters<T>(mut self, v: T) -> Self
14496    where
14497        T: std::convert::Into<crate::model::CacheParameters>,
14498    {
14499        self.cache_parameters = std::option::Option::Some(v.into());
14500        self
14501    }
14502
14503    /// Sets or clears the value of [cache_parameters][crate::model::Volume::cache_parameters].
14504    ///
14505    /// # Example
14506    /// ```ignore,no_run
14507    /// # use google_cloud_netapp_v1::model::Volume;
14508    /// use google_cloud_netapp_v1::model::CacheParameters;
14509    /// let x = Volume::new().set_or_clear_cache_parameters(Some(CacheParameters::default()/* use setters */));
14510    /// let x = Volume::new().set_or_clear_cache_parameters(None::<CacheParameters>);
14511    /// ```
14512    pub fn set_or_clear_cache_parameters<T>(mut self, v: std::option::Option<T>) -> Self
14513    where
14514        T: std::convert::Into<crate::model::CacheParameters>,
14515    {
14516        self.cache_parameters = v.map(|x| x.into());
14517        self
14518    }
14519
14520    /// Sets the value of [hot_tier_size_used_gib][crate::model::Volume::hot_tier_size_used_gib].
14521    ///
14522    /// # Example
14523    /// ```ignore,no_run
14524    /// # use google_cloud_netapp_v1::model::Volume;
14525    /// let x = Volume::new().set_hot_tier_size_used_gib(42);
14526    /// ```
14527    pub fn set_hot_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14528        self.hot_tier_size_used_gib = v.into();
14529        self
14530    }
14531
14532    /// Sets the value of [block_devices][crate::model::Volume::block_devices].
14533    ///
14534    /// # Example
14535    /// ```ignore,no_run
14536    /// # use google_cloud_netapp_v1::model::Volume;
14537    /// use google_cloud_netapp_v1::model::BlockDevice;
14538    /// let x = Volume::new()
14539    ///     .set_block_devices([
14540    ///         BlockDevice::default()/* use setters */,
14541    ///         BlockDevice::default()/* use (different) setters */,
14542    ///     ]);
14543    /// ```
14544    pub fn set_block_devices<T, V>(mut self, v: T) -> Self
14545    where
14546        T: std::iter::IntoIterator<Item = V>,
14547        V: std::convert::Into<crate::model::BlockDevice>,
14548    {
14549        use std::iter::Iterator;
14550        self.block_devices = v.into_iter().map(|i| i.into()).collect();
14551        self
14552    }
14553
14554    /// Sets the value of [large_capacity_config][crate::model::Volume::large_capacity_config].
14555    ///
14556    /// # Example
14557    /// ```ignore,no_run
14558    /// # use google_cloud_netapp_v1::model::Volume;
14559    /// use google_cloud_netapp_v1::model::LargeCapacityConfig;
14560    /// let x = Volume::new().set_large_capacity_config(LargeCapacityConfig::default()/* use setters */);
14561    /// ```
14562    pub fn set_large_capacity_config<T>(mut self, v: T) -> Self
14563    where
14564        T: std::convert::Into<crate::model::LargeCapacityConfig>,
14565    {
14566        self.large_capacity_config = std::option::Option::Some(v.into());
14567        self
14568    }
14569
14570    /// Sets or clears the value of [large_capacity_config][crate::model::Volume::large_capacity_config].
14571    ///
14572    /// # Example
14573    /// ```ignore,no_run
14574    /// # use google_cloud_netapp_v1::model::Volume;
14575    /// use google_cloud_netapp_v1::model::LargeCapacityConfig;
14576    /// let x = Volume::new().set_or_clear_large_capacity_config(Some(LargeCapacityConfig::default()/* use setters */));
14577    /// let x = Volume::new().set_or_clear_large_capacity_config(None::<LargeCapacityConfig>);
14578    /// ```
14579    pub fn set_or_clear_large_capacity_config<T>(mut self, v: std::option::Option<T>) -> Self
14580    where
14581        T: std::convert::Into<crate::model::LargeCapacityConfig>,
14582    {
14583        self.large_capacity_config = v.map(|x| x.into());
14584        self
14585    }
14586
14587    /// Sets the value of [clone_details][crate::model::Volume::clone_details].
14588    ///
14589    /// # Example
14590    /// ```ignore,no_run
14591    /// # use google_cloud_netapp_v1::model::Volume;
14592    /// use google_cloud_netapp_v1::model::volume::CloneDetails;
14593    /// let x = Volume::new().set_clone_details(CloneDetails::default()/* use setters */);
14594    /// ```
14595    pub fn set_clone_details<T>(mut self, v: T) -> Self
14596    where
14597        T: std::convert::Into<crate::model::volume::CloneDetails>,
14598    {
14599        self.clone_details = std::option::Option::Some(v.into());
14600        self
14601    }
14602
14603    /// Sets or clears the value of [clone_details][crate::model::Volume::clone_details].
14604    ///
14605    /// # Example
14606    /// ```ignore,no_run
14607    /// # use google_cloud_netapp_v1::model::Volume;
14608    /// use google_cloud_netapp_v1::model::volume::CloneDetails;
14609    /// let x = Volume::new().set_or_clear_clone_details(Some(CloneDetails::default()/* use setters */));
14610    /// let x = Volume::new().set_or_clear_clone_details(None::<CloneDetails>);
14611    /// ```
14612    pub fn set_or_clear_clone_details<T>(mut self, v: std::option::Option<T>) -> Self
14613    where
14614        T: std::convert::Into<crate::model::volume::CloneDetails>,
14615    {
14616        self.clone_details = v.map(|x| x.into());
14617        self
14618    }
14619}
14620
14621impl wkt::message::Message for Volume {
14622    fn typename() -> &'static str {
14623        "type.googleapis.com/google.cloud.netapp.v1.Volume"
14624    }
14625}
14626
14627/// Defines additional types related to [Volume].
14628pub mod volume {
14629    #[allow(unused_imports)]
14630    use super::*;
14631
14632    /// Details about a clone volume.
14633    #[derive(Clone, Default, PartialEq)]
14634    #[non_exhaustive]
14635    pub struct CloneDetails {
14636        /// Output only. Specifies the full resource name of the source snapshot from
14637        /// which this volume was cloned. Format:
14638        /// projects/{project}/locations/{location}/volumes/{volume}/snapshots/{snapshot}
14639        pub source_snapshot: std::string::String,
14640
14641        /// Output only. Full name of the source volume resource.
14642        /// Format:
14643        /// projects/{project}/locations/{location}/volumes/{volume}
14644        pub source_volume: std::string::String,
14645
14646        /// Output only. Shared space in GiB. Determined at volume creation time
14647        /// based on size of source snapshot.
14648        pub shared_space_gib: i64,
14649
14650        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14651    }
14652
14653    impl CloneDetails {
14654        /// Creates a new default instance.
14655        pub fn new() -> Self {
14656            std::default::Default::default()
14657        }
14658
14659        /// Sets the value of [source_snapshot][crate::model::volume::CloneDetails::source_snapshot].
14660        ///
14661        /// # Example
14662        /// ```ignore,no_run
14663        /// # use google_cloud_netapp_v1::model::volume::CloneDetails;
14664        /// # let project_id = "project_id";
14665        /// # let location_id = "location_id";
14666        /// # let volume_id = "volume_id";
14667        /// # let snapshot_id = "snapshot_id";
14668        /// let x = CloneDetails::new().set_source_snapshot(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}"));
14669        /// ```
14670        pub fn set_source_snapshot<T: std::convert::Into<std::string::String>>(
14671            mut self,
14672            v: T,
14673        ) -> Self {
14674            self.source_snapshot = v.into();
14675            self
14676        }
14677
14678        /// Sets the value of [source_volume][crate::model::volume::CloneDetails::source_volume].
14679        ///
14680        /// # Example
14681        /// ```ignore,no_run
14682        /// # use google_cloud_netapp_v1::model::volume::CloneDetails;
14683        /// # let project_id = "project_id";
14684        /// # let location_id = "location_id";
14685        /// # let volume_id = "volume_id";
14686        /// let x = CloneDetails::new().set_source_volume(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
14687        /// ```
14688        pub fn set_source_volume<T: std::convert::Into<std::string::String>>(
14689            mut self,
14690            v: T,
14691        ) -> Self {
14692            self.source_volume = v.into();
14693            self
14694        }
14695
14696        /// Sets the value of [shared_space_gib][crate::model::volume::CloneDetails::shared_space_gib].
14697        ///
14698        /// # Example
14699        /// ```ignore,no_run
14700        /// # use google_cloud_netapp_v1::model::volume::CloneDetails;
14701        /// let x = CloneDetails::new().set_shared_space_gib(42);
14702        /// ```
14703        pub fn set_shared_space_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
14704            self.shared_space_gib = v.into();
14705            self
14706        }
14707    }
14708
14709    impl wkt::message::Message for CloneDetails {
14710        fn typename() -> &'static str {
14711            "type.googleapis.com/google.cloud.netapp.v1.Volume.CloneDetails"
14712        }
14713    }
14714
14715    /// The volume states
14716    ///
14717    /// # Working with unknown values
14718    ///
14719    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14720    /// additional enum variants at any time. Adding new variants is not considered
14721    /// a breaking change. Applications should write their code in anticipation of:
14722    ///
14723    /// - New values appearing in future releases of the client library, **and**
14724    /// - New values received dynamically, without application changes.
14725    ///
14726    /// Please consult the [Working with enums] section in the user guide for some
14727    /// guidelines.
14728    ///
14729    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
14730    #[derive(Clone, Debug, PartialEq)]
14731    #[non_exhaustive]
14732    pub enum State {
14733        /// Unspecified Volume State
14734        Unspecified,
14735        /// Volume State is Ready
14736        Ready,
14737        /// Volume State is Creating
14738        Creating,
14739        /// Volume State is Deleting
14740        Deleting,
14741        /// Volume State is Updating
14742        Updating,
14743        /// Volume State is Restoring
14744        Restoring,
14745        /// Volume State is Disabled
14746        Disabled,
14747        /// Volume State is Error
14748        Error,
14749        /// Volume State is Preparing. Note that this is different from CREATING
14750        /// where CREATING means the volume is being created, while PREPARING means
14751        /// the volume is created and now being prepared for the replication.
14752        Preparing,
14753        /// Volume State is Read Only
14754        ReadOnly,
14755        /// If set, the enum was initialized with an unknown value.
14756        ///
14757        /// Applications can examine the value using [State::value] or
14758        /// [State::name].
14759        UnknownValue(state::UnknownValue),
14760    }
14761
14762    #[doc(hidden)]
14763    pub mod state {
14764        #[allow(unused_imports)]
14765        use super::*;
14766        #[derive(Clone, Debug, PartialEq)]
14767        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14768    }
14769
14770    impl State {
14771        /// Gets the enum value.
14772        ///
14773        /// Returns `None` if the enum contains an unknown value deserialized from
14774        /// the string representation of enums.
14775        pub fn value(&self) -> std::option::Option<i32> {
14776            match self {
14777                Self::Unspecified => std::option::Option::Some(0),
14778                Self::Ready => std::option::Option::Some(1),
14779                Self::Creating => std::option::Option::Some(2),
14780                Self::Deleting => std::option::Option::Some(3),
14781                Self::Updating => std::option::Option::Some(4),
14782                Self::Restoring => std::option::Option::Some(5),
14783                Self::Disabled => std::option::Option::Some(6),
14784                Self::Error => std::option::Option::Some(7),
14785                Self::Preparing => std::option::Option::Some(8),
14786                Self::ReadOnly => std::option::Option::Some(9),
14787                Self::UnknownValue(u) => u.0.value(),
14788            }
14789        }
14790
14791        /// Gets the enum value as a string.
14792        ///
14793        /// Returns `None` if the enum contains an unknown value deserialized from
14794        /// the integer representation of enums.
14795        pub fn name(&self) -> std::option::Option<&str> {
14796            match self {
14797                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
14798                Self::Ready => std::option::Option::Some("READY"),
14799                Self::Creating => std::option::Option::Some("CREATING"),
14800                Self::Deleting => std::option::Option::Some("DELETING"),
14801                Self::Updating => std::option::Option::Some("UPDATING"),
14802                Self::Restoring => std::option::Option::Some("RESTORING"),
14803                Self::Disabled => std::option::Option::Some("DISABLED"),
14804                Self::Error => std::option::Option::Some("ERROR"),
14805                Self::Preparing => std::option::Option::Some("PREPARING"),
14806                Self::ReadOnly => std::option::Option::Some("READ_ONLY"),
14807                Self::UnknownValue(u) => u.0.name(),
14808            }
14809        }
14810    }
14811
14812    impl std::default::Default for State {
14813        fn default() -> Self {
14814            use std::convert::From;
14815            Self::from(0)
14816        }
14817    }
14818
14819    impl std::fmt::Display for State {
14820        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14821            wkt::internal::display_enum(f, self.name(), self.value())
14822        }
14823    }
14824
14825    impl std::convert::From<i32> for State {
14826        fn from(value: i32) -> Self {
14827            match value {
14828                0 => Self::Unspecified,
14829                1 => Self::Ready,
14830                2 => Self::Creating,
14831                3 => Self::Deleting,
14832                4 => Self::Updating,
14833                5 => Self::Restoring,
14834                6 => Self::Disabled,
14835                7 => Self::Error,
14836                8 => Self::Preparing,
14837                9 => Self::ReadOnly,
14838                _ => Self::UnknownValue(state::UnknownValue(
14839                    wkt::internal::UnknownEnumValue::Integer(value),
14840                )),
14841            }
14842        }
14843    }
14844
14845    impl std::convert::From<&str> for State {
14846        fn from(value: &str) -> Self {
14847            use std::string::ToString;
14848            match value {
14849                "STATE_UNSPECIFIED" => Self::Unspecified,
14850                "READY" => Self::Ready,
14851                "CREATING" => Self::Creating,
14852                "DELETING" => Self::Deleting,
14853                "UPDATING" => Self::Updating,
14854                "RESTORING" => Self::Restoring,
14855                "DISABLED" => Self::Disabled,
14856                "ERROR" => Self::Error,
14857                "PREPARING" => Self::Preparing,
14858                "READ_ONLY" => Self::ReadOnly,
14859                _ => Self::UnknownValue(state::UnknownValue(
14860                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14861                )),
14862            }
14863        }
14864    }
14865
14866    impl serde::ser::Serialize for State {
14867        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14868        where
14869            S: serde::Serializer,
14870        {
14871            match self {
14872                Self::Unspecified => serializer.serialize_i32(0),
14873                Self::Ready => serializer.serialize_i32(1),
14874                Self::Creating => serializer.serialize_i32(2),
14875                Self::Deleting => serializer.serialize_i32(3),
14876                Self::Updating => serializer.serialize_i32(4),
14877                Self::Restoring => serializer.serialize_i32(5),
14878                Self::Disabled => serializer.serialize_i32(6),
14879                Self::Error => serializer.serialize_i32(7),
14880                Self::Preparing => serializer.serialize_i32(8),
14881                Self::ReadOnly => serializer.serialize_i32(9),
14882                Self::UnknownValue(u) => u.0.serialize(serializer),
14883            }
14884        }
14885    }
14886
14887    impl<'de> serde::de::Deserialize<'de> for State {
14888        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14889        where
14890            D: serde::Deserializer<'de>,
14891        {
14892            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
14893                ".google.cloud.netapp.v1.Volume.State",
14894            ))
14895        }
14896    }
14897}
14898
14899/// Configuration for a Large Capacity Volume. A Large Capacity Volume
14900/// supports sizes ranging from 4.8 TiB to 20 PiB, it is composed of multiple
14901/// internal constituents, and must be created in a large capacity pool.
14902#[derive(Clone, Default, PartialEq)]
14903#[non_exhaustive]
14904pub struct LargeCapacityConfig {
14905    /// Optional. The number of internal constituents (e.g., FlexVols) for this
14906    /// large volume. The minimum number of constituents is 2.
14907    pub constituent_count: i32,
14908
14909    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14910}
14911
14912impl LargeCapacityConfig {
14913    /// Creates a new default instance.
14914    pub fn new() -> Self {
14915        std::default::Default::default()
14916    }
14917
14918    /// Sets the value of [constituent_count][crate::model::LargeCapacityConfig::constituent_count].
14919    ///
14920    /// # Example
14921    /// ```ignore,no_run
14922    /// # use google_cloud_netapp_v1::model::LargeCapacityConfig;
14923    /// let x = LargeCapacityConfig::new().set_constituent_count(42);
14924    /// ```
14925    pub fn set_constituent_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14926        self.constituent_count = v.into();
14927        self
14928    }
14929}
14930
14931impl wkt::message::Message for LargeCapacityConfig {
14932    fn typename() -> &'static str {
14933        "type.googleapis.com/google.cloud.netapp.v1.LargeCapacityConfig"
14934    }
14935}
14936
14937/// Defines the export policy for the volume.
14938#[derive(Clone, Default, PartialEq)]
14939#[non_exhaustive]
14940pub struct ExportPolicy {
14941    /// Required. List of export policy rules
14942    pub rules: std::vec::Vec<crate::model::SimpleExportPolicyRule>,
14943
14944    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14945}
14946
14947impl ExportPolicy {
14948    /// Creates a new default instance.
14949    pub fn new() -> Self {
14950        std::default::Default::default()
14951    }
14952
14953    /// Sets the value of [rules][crate::model::ExportPolicy::rules].
14954    ///
14955    /// # Example
14956    /// ```ignore,no_run
14957    /// # use google_cloud_netapp_v1::model::ExportPolicy;
14958    /// use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14959    /// let x = ExportPolicy::new()
14960    ///     .set_rules([
14961    ///         SimpleExportPolicyRule::default()/* use setters */,
14962    ///         SimpleExportPolicyRule::default()/* use (different) setters */,
14963    ///     ]);
14964    /// ```
14965    pub fn set_rules<T, V>(mut self, v: T) -> Self
14966    where
14967        T: std::iter::IntoIterator<Item = V>,
14968        V: std::convert::Into<crate::model::SimpleExportPolicyRule>,
14969    {
14970        use std::iter::Iterator;
14971        self.rules = v.into_iter().map(|i| i.into()).collect();
14972        self
14973    }
14974}
14975
14976impl wkt::message::Message for ExportPolicy {
14977    fn typename() -> &'static str {
14978        "type.googleapis.com/google.cloud.netapp.v1.ExportPolicy"
14979    }
14980}
14981
14982/// An export policy rule describing various export options.
14983#[derive(Clone, Default, PartialEq)]
14984#[non_exhaustive]
14985pub struct SimpleExportPolicyRule {
14986    /// Comma separated list of allowed clients IP addresses
14987    pub allowed_clients: std::option::Option<std::string::String>,
14988
14989    /// Whether Unix root access will be granted.
14990    pub has_root_access: std::option::Option<std::string::String>,
14991
14992    /// Access type (ReadWrite, ReadOnly, None)
14993    pub access_type: std::option::Option<crate::model::AccessType>,
14994
14995    /// NFS V3 protocol.
14996    pub nfsv3: std::option::Option<bool>,
14997
14998    /// NFS V4 protocol.
14999    pub nfsv4: std::option::Option<bool>,
15000
15001    /// If enabled (true) the rule defines a read only access for clients matching
15002    /// the 'allowedClients' specification. It enables nfs clients to mount using
15003    /// 'authentication' kerberos security mode.
15004    pub kerberos_5_read_only: std::option::Option<bool>,
15005
15006    /// If enabled (true) the rule defines read and write access for clients
15007    /// matching the 'allowedClients' specification. It enables nfs clients to
15008    /// mount using 'authentication' kerberos security mode. The
15009    /// 'kerberos5ReadOnly' value be ignored if this is enabled.
15010    pub kerberos_5_read_write: std::option::Option<bool>,
15011
15012    /// If enabled (true) the rule defines a read only access for clients matching
15013    /// the 'allowedClients' specification. It enables nfs clients to mount using
15014    /// 'integrity' kerberos security mode.
15015    pub kerberos_5i_read_only: std::option::Option<bool>,
15016
15017    /// If enabled (true) the rule defines read and write access for clients
15018    /// matching the 'allowedClients' specification. It enables nfs clients to
15019    /// mount using 'integrity' kerberos security mode. The 'kerberos5iReadOnly'
15020    /// value be ignored if this is enabled.
15021    pub kerberos_5i_read_write: std::option::Option<bool>,
15022
15023    /// If enabled (true) the rule defines a read only access for clients matching
15024    /// the 'allowedClients' specification. It enables nfs clients to mount using
15025    /// 'privacy' kerberos security mode.
15026    pub kerberos_5p_read_only: std::option::Option<bool>,
15027
15028    /// If enabled (true) the rule defines read and write access for clients
15029    /// matching the 'allowedClients' specification. It enables nfs clients to
15030    /// mount using 'privacy' kerberos security mode. The 'kerberos5pReadOnly'
15031    /// value be ignored if this is enabled.
15032    pub kerberos_5p_read_write: std::option::Option<bool>,
15033
15034    /// Optional. Defines how user identity squashing is applied for this export
15035    /// rule. This field is the preferred way to configure squashing behavior and
15036    /// takes precedence over `has_root_access` if both are provided.
15037    pub squash_mode: std::option::Option<crate::model::simple_export_policy_rule::SquashMode>,
15038
15039    /// Optional. An integer representing the anonymous user ID. Range is 0 to
15040    /// `4294967295`. Required when `squash_mode` is `ROOT_SQUASH` or `ALL_SQUASH`.
15041    pub anon_uid: std::option::Option<i64>,
15042
15043    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15044}
15045
15046impl SimpleExportPolicyRule {
15047    /// Creates a new default instance.
15048    pub fn new() -> Self {
15049        std::default::Default::default()
15050    }
15051
15052    /// Sets the value of [allowed_clients][crate::model::SimpleExportPolicyRule::allowed_clients].
15053    ///
15054    /// # Example
15055    /// ```ignore,no_run
15056    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15057    /// let x = SimpleExportPolicyRule::new().set_allowed_clients("example");
15058    /// ```
15059    pub fn set_allowed_clients<T>(mut self, v: T) -> Self
15060    where
15061        T: std::convert::Into<std::string::String>,
15062    {
15063        self.allowed_clients = std::option::Option::Some(v.into());
15064        self
15065    }
15066
15067    /// Sets or clears the value of [allowed_clients][crate::model::SimpleExportPolicyRule::allowed_clients].
15068    ///
15069    /// # Example
15070    /// ```ignore,no_run
15071    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15072    /// let x = SimpleExportPolicyRule::new().set_or_clear_allowed_clients(Some("example"));
15073    /// let x = SimpleExportPolicyRule::new().set_or_clear_allowed_clients(None::<String>);
15074    /// ```
15075    pub fn set_or_clear_allowed_clients<T>(mut self, v: std::option::Option<T>) -> Self
15076    where
15077        T: std::convert::Into<std::string::String>,
15078    {
15079        self.allowed_clients = v.map(|x| x.into());
15080        self
15081    }
15082
15083    /// Sets the value of [has_root_access][crate::model::SimpleExportPolicyRule::has_root_access].
15084    ///
15085    /// # Example
15086    /// ```ignore,no_run
15087    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15088    /// let x = SimpleExportPolicyRule::new().set_has_root_access("example");
15089    /// ```
15090    pub fn set_has_root_access<T>(mut self, v: T) -> Self
15091    where
15092        T: std::convert::Into<std::string::String>,
15093    {
15094        self.has_root_access = std::option::Option::Some(v.into());
15095        self
15096    }
15097
15098    /// Sets or clears the value of [has_root_access][crate::model::SimpleExportPolicyRule::has_root_access].
15099    ///
15100    /// # Example
15101    /// ```ignore,no_run
15102    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15103    /// let x = SimpleExportPolicyRule::new().set_or_clear_has_root_access(Some("example"));
15104    /// let x = SimpleExportPolicyRule::new().set_or_clear_has_root_access(None::<String>);
15105    /// ```
15106    pub fn set_or_clear_has_root_access<T>(mut self, v: std::option::Option<T>) -> Self
15107    where
15108        T: std::convert::Into<std::string::String>,
15109    {
15110        self.has_root_access = v.map(|x| x.into());
15111        self
15112    }
15113
15114    /// Sets the value of [access_type][crate::model::SimpleExportPolicyRule::access_type].
15115    ///
15116    /// # Example
15117    /// ```ignore,no_run
15118    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15119    /// use google_cloud_netapp_v1::model::AccessType;
15120    /// let x0 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadOnly);
15121    /// let x1 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadWrite);
15122    /// let x2 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadNone);
15123    /// ```
15124    pub fn set_access_type<T>(mut self, v: T) -> Self
15125    where
15126        T: std::convert::Into<crate::model::AccessType>,
15127    {
15128        self.access_type = std::option::Option::Some(v.into());
15129        self
15130    }
15131
15132    /// Sets or clears the value of [access_type][crate::model::SimpleExportPolicyRule::access_type].
15133    ///
15134    /// # Example
15135    /// ```ignore,no_run
15136    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15137    /// use google_cloud_netapp_v1::model::AccessType;
15138    /// let x0 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadOnly));
15139    /// let x1 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadWrite));
15140    /// let x2 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadNone));
15141    /// let x_none = SimpleExportPolicyRule::new().set_or_clear_access_type(None::<AccessType>);
15142    /// ```
15143    pub fn set_or_clear_access_type<T>(mut self, v: std::option::Option<T>) -> Self
15144    where
15145        T: std::convert::Into<crate::model::AccessType>,
15146    {
15147        self.access_type = v.map(|x| x.into());
15148        self
15149    }
15150
15151    /// Sets the value of [nfsv3][crate::model::SimpleExportPolicyRule::nfsv3].
15152    ///
15153    /// # Example
15154    /// ```ignore,no_run
15155    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15156    /// let x = SimpleExportPolicyRule::new().set_nfsv3(true);
15157    /// ```
15158    pub fn set_nfsv3<T>(mut self, v: T) -> Self
15159    where
15160        T: std::convert::Into<bool>,
15161    {
15162        self.nfsv3 = std::option::Option::Some(v.into());
15163        self
15164    }
15165
15166    /// Sets or clears the value of [nfsv3][crate::model::SimpleExportPolicyRule::nfsv3].
15167    ///
15168    /// # Example
15169    /// ```ignore,no_run
15170    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15171    /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv3(Some(false));
15172    /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv3(None::<bool>);
15173    /// ```
15174    pub fn set_or_clear_nfsv3<T>(mut self, v: std::option::Option<T>) -> Self
15175    where
15176        T: std::convert::Into<bool>,
15177    {
15178        self.nfsv3 = v.map(|x| x.into());
15179        self
15180    }
15181
15182    /// Sets the value of [nfsv4][crate::model::SimpleExportPolicyRule::nfsv4].
15183    ///
15184    /// # Example
15185    /// ```ignore,no_run
15186    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15187    /// let x = SimpleExportPolicyRule::new().set_nfsv4(true);
15188    /// ```
15189    pub fn set_nfsv4<T>(mut self, v: T) -> Self
15190    where
15191        T: std::convert::Into<bool>,
15192    {
15193        self.nfsv4 = std::option::Option::Some(v.into());
15194        self
15195    }
15196
15197    /// Sets or clears the value of [nfsv4][crate::model::SimpleExportPolicyRule::nfsv4].
15198    ///
15199    /// # Example
15200    /// ```ignore,no_run
15201    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15202    /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv4(Some(false));
15203    /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv4(None::<bool>);
15204    /// ```
15205    pub fn set_or_clear_nfsv4<T>(mut self, v: std::option::Option<T>) -> Self
15206    where
15207        T: std::convert::Into<bool>,
15208    {
15209        self.nfsv4 = v.map(|x| x.into());
15210        self
15211    }
15212
15213    /// Sets the value of [kerberos_5_read_only][crate::model::SimpleExportPolicyRule::kerberos_5_read_only].
15214    ///
15215    /// # Example
15216    /// ```ignore,no_run
15217    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15218    /// let x = SimpleExportPolicyRule::new().set_kerberos_5_read_only(true);
15219    /// ```
15220    pub fn set_kerberos_5_read_only<T>(mut self, v: T) -> Self
15221    where
15222        T: std::convert::Into<bool>,
15223    {
15224        self.kerberos_5_read_only = std::option::Option::Some(v.into());
15225        self
15226    }
15227
15228    /// Sets or clears the value of [kerberos_5_read_only][crate::model::SimpleExportPolicyRule::kerberos_5_read_only].
15229    ///
15230    /// # Example
15231    /// ```ignore,no_run
15232    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15233    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_only(Some(false));
15234    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_only(None::<bool>);
15235    /// ```
15236    pub fn set_or_clear_kerberos_5_read_only<T>(mut self, v: std::option::Option<T>) -> Self
15237    where
15238        T: std::convert::Into<bool>,
15239    {
15240        self.kerberos_5_read_only = v.map(|x| x.into());
15241        self
15242    }
15243
15244    /// Sets the value of [kerberos_5_read_write][crate::model::SimpleExportPolicyRule::kerberos_5_read_write].
15245    ///
15246    /// # Example
15247    /// ```ignore,no_run
15248    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15249    /// let x = SimpleExportPolicyRule::new().set_kerberos_5_read_write(true);
15250    /// ```
15251    pub fn set_kerberos_5_read_write<T>(mut self, v: T) -> Self
15252    where
15253        T: std::convert::Into<bool>,
15254    {
15255        self.kerberos_5_read_write = std::option::Option::Some(v.into());
15256        self
15257    }
15258
15259    /// Sets or clears the value of [kerberos_5_read_write][crate::model::SimpleExportPolicyRule::kerberos_5_read_write].
15260    ///
15261    /// # Example
15262    /// ```ignore,no_run
15263    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15264    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_write(Some(false));
15265    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_write(None::<bool>);
15266    /// ```
15267    pub fn set_or_clear_kerberos_5_read_write<T>(mut self, v: std::option::Option<T>) -> Self
15268    where
15269        T: std::convert::Into<bool>,
15270    {
15271        self.kerberos_5_read_write = v.map(|x| x.into());
15272        self
15273    }
15274
15275    /// Sets the value of [kerberos_5i_read_only][crate::model::SimpleExportPolicyRule::kerberos_5i_read_only].
15276    ///
15277    /// # Example
15278    /// ```ignore,no_run
15279    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15280    /// let x = SimpleExportPolicyRule::new().set_kerberos_5i_read_only(true);
15281    /// ```
15282    pub fn set_kerberos_5i_read_only<T>(mut self, v: T) -> Self
15283    where
15284        T: std::convert::Into<bool>,
15285    {
15286        self.kerberos_5i_read_only = std::option::Option::Some(v.into());
15287        self
15288    }
15289
15290    /// Sets or clears the value of [kerberos_5i_read_only][crate::model::SimpleExportPolicyRule::kerberos_5i_read_only].
15291    ///
15292    /// # Example
15293    /// ```ignore,no_run
15294    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15295    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_only(Some(false));
15296    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_only(None::<bool>);
15297    /// ```
15298    pub fn set_or_clear_kerberos_5i_read_only<T>(mut self, v: std::option::Option<T>) -> Self
15299    where
15300        T: std::convert::Into<bool>,
15301    {
15302        self.kerberos_5i_read_only = v.map(|x| x.into());
15303        self
15304    }
15305
15306    /// Sets the value of [kerberos_5i_read_write][crate::model::SimpleExportPolicyRule::kerberos_5i_read_write].
15307    ///
15308    /// # Example
15309    /// ```ignore,no_run
15310    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15311    /// let x = SimpleExportPolicyRule::new().set_kerberos_5i_read_write(true);
15312    /// ```
15313    pub fn set_kerberos_5i_read_write<T>(mut self, v: T) -> Self
15314    where
15315        T: std::convert::Into<bool>,
15316    {
15317        self.kerberos_5i_read_write = std::option::Option::Some(v.into());
15318        self
15319    }
15320
15321    /// Sets or clears the value of [kerberos_5i_read_write][crate::model::SimpleExportPolicyRule::kerberos_5i_read_write].
15322    ///
15323    /// # Example
15324    /// ```ignore,no_run
15325    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15326    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_write(Some(false));
15327    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_write(None::<bool>);
15328    /// ```
15329    pub fn set_or_clear_kerberos_5i_read_write<T>(mut self, v: std::option::Option<T>) -> Self
15330    where
15331        T: std::convert::Into<bool>,
15332    {
15333        self.kerberos_5i_read_write = v.map(|x| x.into());
15334        self
15335    }
15336
15337    /// Sets the value of [kerberos_5p_read_only][crate::model::SimpleExportPolicyRule::kerberos_5p_read_only].
15338    ///
15339    /// # Example
15340    /// ```ignore,no_run
15341    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15342    /// let x = SimpleExportPolicyRule::new().set_kerberos_5p_read_only(true);
15343    /// ```
15344    pub fn set_kerberos_5p_read_only<T>(mut self, v: T) -> Self
15345    where
15346        T: std::convert::Into<bool>,
15347    {
15348        self.kerberos_5p_read_only = std::option::Option::Some(v.into());
15349        self
15350    }
15351
15352    /// Sets or clears the value of [kerberos_5p_read_only][crate::model::SimpleExportPolicyRule::kerberos_5p_read_only].
15353    ///
15354    /// # Example
15355    /// ```ignore,no_run
15356    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15357    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_only(Some(false));
15358    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_only(None::<bool>);
15359    /// ```
15360    pub fn set_or_clear_kerberos_5p_read_only<T>(mut self, v: std::option::Option<T>) -> Self
15361    where
15362        T: std::convert::Into<bool>,
15363    {
15364        self.kerberos_5p_read_only = v.map(|x| x.into());
15365        self
15366    }
15367
15368    /// Sets the value of [kerberos_5p_read_write][crate::model::SimpleExportPolicyRule::kerberos_5p_read_write].
15369    ///
15370    /// # Example
15371    /// ```ignore,no_run
15372    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15373    /// let x = SimpleExportPolicyRule::new().set_kerberos_5p_read_write(true);
15374    /// ```
15375    pub fn set_kerberos_5p_read_write<T>(mut self, v: T) -> Self
15376    where
15377        T: std::convert::Into<bool>,
15378    {
15379        self.kerberos_5p_read_write = std::option::Option::Some(v.into());
15380        self
15381    }
15382
15383    /// Sets or clears the value of [kerberos_5p_read_write][crate::model::SimpleExportPolicyRule::kerberos_5p_read_write].
15384    ///
15385    /// # Example
15386    /// ```ignore,no_run
15387    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15388    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_write(Some(false));
15389    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_write(None::<bool>);
15390    /// ```
15391    pub fn set_or_clear_kerberos_5p_read_write<T>(mut self, v: std::option::Option<T>) -> Self
15392    where
15393        T: std::convert::Into<bool>,
15394    {
15395        self.kerberos_5p_read_write = v.map(|x| x.into());
15396        self
15397    }
15398
15399    /// Sets the value of [squash_mode][crate::model::SimpleExportPolicyRule::squash_mode].
15400    ///
15401    /// # Example
15402    /// ```ignore,no_run
15403    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15404    /// use google_cloud_netapp_v1::model::simple_export_policy_rule::SquashMode;
15405    /// let x0 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::NoRootSquash);
15406    /// let x1 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::RootSquash);
15407    /// let x2 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::AllSquash);
15408    /// ```
15409    pub fn set_squash_mode<T>(mut self, v: T) -> Self
15410    where
15411        T: std::convert::Into<crate::model::simple_export_policy_rule::SquashMode>,
15412    {
15413        self.squash_mode = std::option::Option::Some(v.into());
15414        self
15415    }
15416
15417    /// Sets or clears the value of [squash_mode][crate::model::SimpleExportPolicyRule::squash_mode].
15418    ///
15419    /// # Example
15420    /// ```ignore,no_run
15421    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15422    /// use google_cloud_netapp_v1::model::simple_export_policy_rule::SquashMode;
15423    /// let x0 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::NoRootSquash));
15424    /// let x1 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::RootSquash));
15425    /// let x2 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::AllSquash));
15426    /// let x_none = SimpleExportPolicyRule::new().set_or_clear_squash_mode(None::<SquashMode>);
15427    /// ```
15428    pub fn set_or_clear_squash_mode<T>(mut self, v: std::option::Option<T>) -> Self
15429    where
15430        T: std::convert::Into<crate::model::simple_export_policy_rule::SquashMode>,
15431    {
15432        self.squash_mode = v.map(|x| x.into());
15433        self
15434    }
15435
15436    /// Sets the value of [anon_uid][crate::model::SimpleExportPolicyRule::anon_uid].
15437    ///
15438    /// # Example
15439    /// ```ignore,no_run
15440    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15441    /// let x = SimpleExportPolicyRule::new().set_anon_uid(42);
15442    /// ```
15443    pub fn set_anon_uid<T>(mut self, v: T) -> Self
15444    where
15445        T: std::convert::Into<i64>,
15446    {
15447        self.anon_uid = std::option::Option::Some(v.into());
15448        self
15449    }
15450
15451    /// Sets or clears the value of [anon_uid][crate::model::SimpleExportPolicyRule::anon_uid].
15452    ///
15453    /// # Example
15454    /// ```ignore,no_run
15455    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
15456    /// let x = SimpleExportPolicyRule::new().set_or_clear_anon_uid(Some(42));
15457    /// let x = SimpleExportPolicyRule::new().set_or_clear_anon_uid(None::<i32>);
15458    /// ```
15459    pub fn set_or_clear_anon_uid<T>(mut self, v: std::option::Option<T>) -> Self
15460    where
15461        T: std::convert::Into<i64>,
15462    {
15463        self.anon_uid = v.map(|x| x.into());
15464        self
15465    }
15466}
15467
15468impl wkt::message::Message for SimpleExportPolicyRule {
15469    fn typename() -> &'static str {
15470        "type.googleapis.com/google.cloud.netapp.v1.SimpleExportPolicyRule"
15471    }
15472}
15473
15474/// Defines additional types related to [SimpleExportPolicyRule].
15475pub mod simple_export_policy_rule {
15476    #[allow(unused_imports)]
15477    use super::*;
15478
15479    /// `SquashMode` defines how remote user privileges are restricted when
15480    /// accessing an NFS export. It controls how user identities (like root) are
15481    /// mapped to anonymous users to limit access and enforce security.
15482    ///
15483    /// # Working with unknown values
15484    ///
15485    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15486    /// additional enum variants at any time. Adding new variants is not considered
15487    /// a breaking change. Applications should write their code in anticipation of:
15488    ///
15489    /// - New values appearing in future releases of the client library, **and**
15490    /// - New values received dynamically, without application changes.
15491    ///
15492    /// Please consult the [Working with enums] section in the user guide for some
15493    /// guidelines.
15494    ///
15495    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
15496    #[derive(Clone, Debug, PartialEq)]
15497    #[non_exhaustive]
15498    pub enum SquashMode {
15499        /// Defaults to `NO_ROOT_SQUASH`.
15500        Unspecified,
15501        /// The root user (UID 0) retains full access. Other users are
15502        /// unaffected.
15503        NoRootSquash,
15504        /// The root user (UID 0) is squashed to anonymous user ID. Other users are
15505        /// unaffected.
15506        RootSquash,
15507        /// All users are squashed to anonymous user ID.
15508        AllSquash,
15509        /// If set, the enum was initialized with an unknown value.
15510        ///
15511        /// Applications can examine the value using [SquashMode::value] or
15512        /// [SquashMode::name].
15513        UnknownValue(squash_mode::UnknownValue),
15514    }
15515
15516    #[doc(hidden)]
15517    pub mod squash_mode {
15518        #[allow(unused_imports)]
15519        use super::*;
15520        #[derive(Clone, Debug, PartialEq)]
15521        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15522    }
15523
15524    impl SquashMode {
15525        /// Gets the enum value.
15526        ///
15527        /// Returns `None` if the enum contains an unknown value deserialized from
15528        /// the string representation of enums.
15529        pub fn value(&self) -> std::option::Option<i32> {
15530            match self {
15531                Self::Unspecified => std::option::Option::Some(0),
15532                Self::NoRootSquash => std::option::Option::Some(1),
15533                Self::RootSquash => std::option::Option::Some(2),
15534                Self::AllSquash => std::option::Option::Some(3),
15535                Self::UnknownValue(u) => u.0.value(),
15536            }
15537        }
15538
15539        /// Gets the enum value as a string.
15540        ///
15541        /// Returns `None` if the enum contains an unknown value deserialized from
15542        /// the integer representation of enums.
15543        pub fn name(&self) -> std::option::Option<&str> {
15544            match self {
15545                Self::Unspecified => std::option::Option::Some("SQUASH_MODE_UNSPECIFIED"),
15546                Self::NoRootSquash => std::option::Option::Some("NO_ROOT_SQUASH"),
15547                Self::RootSquash => std::option::Option::Some("ROOT_SQUASH"),
15548                Self::AllSquash => std::option::Option::Some("ALL_SQUASH"),
15549                Self::UnknownValue(u) => u.0.name(),
15550            }
15551        }
15552    }
15553
15554    impl std::default::Default for SquashMode {
15555        fn default() -> Self {
15556            use std::convert::From;
15557            Self::from(0)
15558        }
15559    }
15560
15561    impl std::fmt::Display for SquashMode {
15562        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15563            wkt::internal::display_enum(f, self.name(), self.value())
15564        }
15565    }
15566
15567    impl std::convert::From<i32> for SquashMode {
15568        fn from(value: i32) -> Self {
15569            match value {
15570                0 => Self::Unspecified,
15571                1 => Self::NoRootSquash,
15572                2 => Self::RootSquash,
15573                3 => Self::AllSquash,
15574                _ => Self::UnknownValue(squash_mode::UnknownValue(
15575                    wkt::internal::UnknownEnumValue::Integer(value),
15576                )),
15577            }
15578        }
15579    }
15580
15581    impl std::convert::From<&str> for SquashMode {
15582        fn from(value: &str) -> Self {
15583            use std::string::ToString;
15584            match value {
15585                "SQUASH_MODE_UNSPECIFIED" => Self::Unspecified,
15586                "NO_ROOT_SQUASH" => Self::NoRootSquash,
15587                "ROOT_SQUASH" => Self::RootSquash,
15588                "ALL_SQUASH" => Self::AllSquash,
15589                _ => Self::UnknownValue(squash_mode::UnknownValue(
15590                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15591                )),
15592            }
15593        }
15594    }
15595
15596    impl serde::ser::Serialize for SquashMode {
15597        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15598        where
15599            S: serde::Serializer,
15600        {
15601            match self {
15602                Self::Unspecified => serializer.serialize_i32(0),
15603                Self::NoRootSquash => serializer.serialize_i32(1),
15604                Self::RootSquash => serializer.serialize_i32(2),
15605                Self::AllSquash => serializer.serialize_i32(3),
15606                Self::UnknownValue(u) => u.0.serialize(serializer),
15607            }
15608        }
15609    }
15610
15611    impl<'de> serde::de::Deserialize<'de> for SquashMode {
15612        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15613        where
15614            D: serde::Deserializer<'de>,
15615        {
15616            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SquashMode>::new(
15617                ".google.cloud.netapp.v1.SimpleExportPolicyRule.SquashMode",
15618            ))
15619        }
15620    }
15621}
15622
15623/// Snapshot Policy for a volume.
15624#[derive(Clone, Default, PartialEq)]
15625#[non_exhaustive]
15626pub struct SnapshotPolicy {
15627    /// If enabled, make snapshots automatically according to the schedules.
15628    /// Default is false.
15629    pub enabled: std::option::Option<bool>,
15630
15631    /// Hourly schedule policy.
15632    pub hourly_schedule: std::option::Option<crate::model::HourlySchedule>,
15633
15634    /// Daily schedule policy.
15635    pub daily_schedule: std::option::Option<crate::model::DailySchedule>,
15636
15637    /// Weekly schedule policy.
15638    pub weekly_schedule: std::option::Option<crate::model::WeeklySchedule>,
15639
15640    /// Monthly schedule policy.
15641    pub monthly_schedule: std::option::Option<crate::model::MonthlySchedule>,
15642
15643    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15644}
15645
15646impl SnapshotPolicy {
15647    /// Creates a new default instance.
15648    pub fn new() -> Self {
15649        std::default::Default::default()
15650    }
15651
15652    /// Sets the value of [enabled][crate::model::SnapshotPolicy::enabled].
15653    ///
15654    /// # Example
15655    /// ```ignore,no_run
15656    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15657    /// let x = SnapshotPolicy::new().set_enabled(true);
15658    /// ```
15659    pub fn set_enabled<T>(mut self, v: T) -> Self
15660    where
15661        T: std::convert::Into<bool>,
15662    {
15663        self.enabled = std::option::Option::Some(v.into());
15664        self
15665    }
15666
15667    /// Sets or clears the value of [enabled][crate::model::SnapshotPolicy::enabled].
15668    ///
15669    /// # Example
15670    /// ```ignore,no_run
15671    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15672    /// let x = SnapshotPolicy::new().set_or_clear_enabled(Some(false));
15673    /// let x = SnapshotPolicy::new().set_or_clear_enabled(None::<bool>);
15674    /// ```
15675    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
15676    where
15677        T: std::convert::Into<bool>,
15678    {
15679        self.enabled = v.map(|x| x.into());
15680        self
15681    }
15682
15683    /// Sets the value of [hourly_schedule][crate::model::SnapshotPolicy::hourly_schedule].
15684    ///
15685    /// # Example
15686    /// ```ignore,no_run
15687    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15688    /// use google_cloud_netapp_v1::model::HourlySchedule;
15689    /// let x = SnapshotPolicy::new().set_hourly_schedule(HourlySchedule::default()/* use setters */);
15690    /// ```
15691    pub fn set_hourly_schedule<T>(mut self, v: T) -> Self
15692    where
15693        T: std::convert::Into<crate::model::HourlySchedule>,
15694    {
15695        self.hourly_schedule = std::option::Option::Some(v.into());
15696        self
15697    }
15698
15699    /// Sets or clears the value of [hourly_schedule][crate::model::SnapshotPolicy::hourly_schedule].
15700    ///
15701    /// # Example
15702    /// ```ignore,no_run
15703    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15704    /// use google_cloud_netapp_v1::model::HourlySchedule;
15705    /// let x = SnapshotPolicy::new().set_or_clear_hourly_schedule(Some(HourlySchedule::default()/* use setters */));
15706    /// let x = SnapshotPolicy::new().set_or_clear_hourly_schedule(None::<HourlySchedule>);
15707    /// ```
15708    pub fn set_or_clear_hourly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
15709    where
15710        T: std::convert::Into<crate::model::HourlySchedule>,
15711    {
15712        self.hourly_schedule = v.map(|x| x.into());
15713        self
15714    }
15715
15716    /// Sets the value of [daily_schedule][crate::model::SnapshotPolicy::daily_schedule].
15717    ///
15718    /// # Example
15719    /// ```ignore,no_run
15720    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15721    /// use google_cloud_netapp_v1::model::DailySchedule;
15722    /// let x = SnapshotPolicy::new().set_daily_schedule(DailySchedule::default()/* use setters */);
15723    /// ```
15724    pub fn set_daily_schedule<T>(mut self, v: T) -> Self
15725    where
15726        T: std::convert::Into<crate::model::DailySchedule>,
15727    {
15728        self.daily_schedule = std::option::Option::Some(v.into());
15729        self
15730    }
15731
15732    /// Sets or clears the value of [daily_schedule][crate::model::SnapshotPolicy::daily_schedule].
15733    ///
15734    /// # Example
15735    /// ```ignore,no_run
15736    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15737    /// use google_cloud_netapp_v1::model::DailySchedule;
15738    /// let x = SnapshotPolicy::new().set_or_clear_daily_schedule(Some(DailySchedule::default()/* use setters */));
15739    /// let x = SnapshotPolicy::new().set_or_clear_daily_schedule(None::<DailySchedule>);
15740    /// ```
15741    pub fn set_or_clear_daily_schedule<T>(mut self, v: std::option::Option<T>) -> Self
15742    where
15743        T: std::convert::Into<crate::model::DailySchedule>,
15744    {
15745        self.daily_schedule = v.map(|x| x.into());
15746        self
15747    }
15748
15749    /// Sets the value of [weekly_schedule][crate::model::SnapshotPolicy::weekly_schedule].
15750    ///
15751    /// # Example
15752    /// ```ignore,no_run
15753    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15754    /// use google_cloud_netapp_v1::model::WeeklySchedule;
15755    /// let x = SnapshotPolicy::new().set_weekly_schedule(WeeklySchedule::default()/* use setters */);
15756    /// ```
15757    pub fn set_weekly_schedule<T>(mut self, v: T) -> Self
15758    where
15759        T: std::convert::Into<crate::model::WeeklySchedule>,
15760    {
15761        self.weekly_schedule = std::option::Option::Some(v.into());
15762        self
15763    }
15764
15765    /// Sets or clears the value of [weekly_schedule][crate::model::SnapshotPolicy::weekly_schedule].
15766    ///
15767    /// # Example
15768    /// ```ignore,no_run
15769    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15770    /// use google_cloud_netapp_v1::model::WeeklySchedule;
15771    /// let x = SnapshotPolicy::new().set_or_clear_weekly_schedule(Some(WeeklySchedule::default()/* use setters */));
15772    /// let x = SnapshotPolicy::new().set_or_clear_weekly_schedule(None::<WeeklySchedule>);
15773    /// ```
15774    pub fn set_or_clear_weekly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
15775    where
15776        T: std::convert::Into<crate::model::WeeklySchedule>,
15777    {
15778        self.weekly_schedule = v.map(|x| x.into());
15779        self
15780    }
15781
15782    /// Sets the value of [monthly_schedule][crate::model::SnapshotPolicy::monthly_schedule].
15783    ///
15784    /// # Example
15785    /// ```ignore,no_run
15786    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15787    /// use google_cloud_netapp_v1::model::MonthlySchedule;
15788    /// let x = SnapshotPolicy::new().set_monthly_schedule(MonthlySchedule::default()/* use setters */);
15789    /// ```
15790    pub fn set_monthly_schedule<T>(mut self, v: T) -> Self
15791    where
15792        T: std::convert::Into<crate::model::MonthlySchedule>,
15793    {
15794        self.monthly_schedule = std::option::Option::Some(v.into());
15795        self
15796    }
15797
15798    /// Sets or clears the value of [monthly_schedule][crate::model::SnapshotPolicy::monthly_schedule].
15799    ///
15800    /// # Example
15801    /// ```ignore,no_run
15802    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
15803    /// use google_cloud_netapp_v1::model::MonthlySchedule;
15804    /// let x = SnapshotPolicy::new().set_or_clear_monthly_schedule(Some(MonthlySchedule::default()/* use setters */));
15805    /// let x = SnapshotPolicy::new().set_or_clear_monthly_schedule(None::<MonthlySchedule>);
15806    /// ```
15807    pub fn set_or_clear_monthly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
15808    where
15809        T: std::convert::Into<crate::model::MonthlySchedule>,
15810    {
15811        self.monthly_schedule = v.map(|x| x.into());
15812        self
15813    }
15814}
15815
15816impl wkt::message::Message for SnapshotPolicy {
15817    fn typename() -> &'static str {
15818        "type.googleapis.com/google.cloud.netapp.v1.SnapshotPolicy"
15819    }
15820}
15821
15822/// Make a snapshot every hour e.g. at 04:00, 05:00, 06:00.
15823#[derive(Clone, Default, PartialEq)]
15824#[non_exhaustive]
15825pub struct HourlySchedule {
15826    /// The maximum number of Snapshots to keep for the hourly schedule
15827    pub snapshots_to_keep: std::option::Option<f64>,
15828
15829    /// Set the minute of the hour to start the snapshot (0-59), defaults to the
15830    /// top of the hour (0).
15831    pub minute: std::option::Option<f64>,
15832
15833    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15834}
15835
15836impl HourlySchedule {
15837    /// Creates a new default instance.
15838    pub fn new() -> Self {
15839        std::default::Default::default()
15840    }
15841
15842    /// Sets the value of [snapshots_to_keep][crate::model::HourlySchedule::snapshots_to_keep].
15843    ///
15844    /// # Example
15845    /// ```ignore,no_run
15846    /// # use google_cloud_netapp_v1::model::HourlySchedule;
15847    /// let x = HourlySchedule::new().set_snapshots_to_keep(42.0);
15848    /// ```
15849    pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
15850    where
15851        T: std::convert::Into<f64>,
15852    {
15853        self.snapshots_to_keep = std::option::Option::Some(v.into());
15854        self
15855    }
15856
15857    /// Sets or clears the value of [snapshots_to_keep][crate::model::HourlySchedule::snapshots_to_keep].
15858    ///
15859    /// # Example
15860    /// ```ignore,no_run
15861    /// # use google_cloud_netapp_v1::model::HourlySchedule;
15862    /// let x = HourlySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
15863    /// let x = HourlySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
15864    /// ```
15865    pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
15866    where
15867        T: std::convert::Into<f64>,
15868    {
15869        self.snapshots_to_keep = v.map(|x| x.into());
15870        self
15871    }
15872
15873    /// Sets the value of [minute][crate::model::HourlySchedule::minute].
15874    ///
15875    /// # Example
15876    /// ```ignore,no_run
15877    /// # use google_cloud_netapp_v1::model::HourlySchedule;
15878    /// let x = HourlySchedule::new().set_minute(42.0);
15879    /// ```
15880    pub fn set_minute<T>(mut self, v: T) -> Self
15881    where
15882        T: std::convert::Into<f64>,
15883    {
15884        self.minute = std::option::Option::Some(v.into());
15885        self
15886    }
15887
15888    /// Sets or clears the value of [minute][crate::model::HourlySchedule::minute].
15889    ///
15890    /// # Example
15891    /// ```ignore,no_run
15892    /// # use google_cloud_netapp_v1::model::HourlySchedule;
15893    /// let x = HourlySchedule::new().set_or_clear_minute(Some(42.0));
15894    /// let x = HourlySchedule::new().set_or_clear_minute(None::<f32>);
15895    /// ```
15896    pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
15897    where
15898        T: std::convert::Into<f64>,
15899    {
15900        self.minute = v.map(|x| x.into());
15901        self
15902    }
15903}
15904
15905impl wkt::message::Message for HourlySchedule {
15906    fn typename() -> &'static str {
15907        "type.googleapis.com/google.cloud.netapp.v1.HourlySchedule"
15908    }
15909}
15910
15911/// Make a snapshot every day e.g. at 04:00, 05:20, 23:50
15912#[derive(Clone, Default, PartialEq)]
15913#[non_exhaustive]
15914pub struct DailySchedule {
15915    /// The maximum number of Snapshots to keep for the hourly schedule
15916    pub snapshots_to_keep: std::option::Option<f64>,
15917
15918    /// Set the minute of the hour to start the snapshot (0-59), defaults to the
15919    /// top of the hour (0).
15920    pub minute: std::option::Option<f64>,
15921
15922    /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
15923    pub hour: std::option::Option<f64>,
15924
15925    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15926}
15927
15928impl DailySchedule {
15929    /// Creates a new default instance.
15930    pub fn new() -> Self {
15931        std::default::Default::default()
15932    }
15933
15934    /// Sets the value of [snapshots_to_keep][crate::model::DailySchedule::snapshots_to_keep].
15935    ///
15936    /// # Example
15937    /// ```ignore,no_run
15938    /// # use google_cloud_netapp_v1::model::DailySchedule;
15939    /// let x = DailySchedule::new().set_snapshots_to_keep(42.0);
15940    /// ```
15941    pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
15942    where
15943        T: std::convert::Into<f64>,
15944    {
15945        self.snapshots_to_keep = std::option::Option::Some(v.into());
15946        self
15947    }
15948
15949    /// Sets or clears the value of [snapshots_to_keep][crate::model::DailySchedule::snapshots_to_keep].
15950    ///
15951    /// # Example
15952    /// ```ignore,no_run
15953    /// # use google_cloud_netapp_v1::model::DailySchedule;
15954    /// let x = DailySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
15955    /// let x = DailySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
15956    /// ```
15957    pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
15958    where
15959        T: std::convert::Into<f64>,
15960    {
15961        self.snapshots_to_keep = v.map(|x| x.into());
15962        self
15963    }
15964
15965    /// Sets the value of [minute][crate::model::DailySchedule::minute].
15966    ///
15967    /// # Example
15968    /// ```ignore,no_run
15969    /// # use google_cloud_netapp_v1::model::DailySchedule;
15970    /// let x = DailySchedule::new().set_minute(42.0);
15971    /// ```
15972    pub fn set_minute<T>(mut self, v: T) -> Self
15973    where
15974        T: std::convert::Into<f64>,
15975    {
15976        self.minute = std::option::Option::Some(v.into());
15977        self
15978    }
15979
15980    /// Sets or clears the value of [minute][crate::model::DailySchedule::minute].
15981    ///
15982    /// # Example
15983    /// ```ignore,no_run
15984    /// # use google_cloud_netapp_v1::model::DailySchedule;
15985    /// let x = DailySchedule::new().set_or_clear_minute(Some(42.0));
15986    /// let x = DailySchedule::new().set_or_clear_minute(None::<f32>);
15987    /// ```
15988    pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
15989    where
15990        T: std::convert::Into<f64>,
15991    {
15992        self.minute = v.map(|x| x.into());
15993        self
15994    }
15995
15996    /// Sets the value of [hour][crate::model::DailySchedule::hour].
15997    ///
15998    /// # Example
15999    /// ```ignore,no_run
16000    /// # use google_cloud_netapp_v1::model::DailySchedule;
16001    /// let x = DailySchedule::new().set_hour(42.0);
16002    /// ```
16003    pub fn set_hour<T>(mut self, v: T) -> Self
16004    where
16005        T: std::convert::Into<f64>,
16006    {
16007        self.hour = std::option::Option::Some(v.into());
16008        self
16009    }
16010
16011    /// Sets or clears the value of [hour][crate::model::DailySchedule::hour].
16012    ///
16013    /// # Example
16014    /// ```ignore,no_run
16015    /// # use google_cloud_netapp_v1::model::DailySchedule;
16016    /// let x = DailySchedule::new().set_or_clear_hour(Some(42.0));
16017    /// let x = DailySchedule::new().set_or_clear_hour(None::<f32>);
16018    /// ```
16019    pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
16020    where
16021        T: std::convert::Into<f64>,
16022    {
16023        self.hour = v.map(|x| x.into());
16024        self
16025    }
16026}
16027
16028impl wkt::message::Message for DailySchedule {
16029    fn typename() -> &'static str {
16030        "type.googleapis.com/google.cloud.netapp.v1.DailySchedule"
16031    }
16032}
16033
16034/// Make a snapshot every week e.g. at Monday 04:00, Wednesday 05:20, Sunday
16035/// 23:50
16036#[derive(Clone, Default, PartialEq)]
16037#[non_exhaustive]
16038pub struct WeeklySchedule {
16039    /// The maximum number of Snapshots to keep for the hourly schedule
16040    pub snapshots_to_keep: std::option::Option<f64>,
16041
16042    /// Set the minute of the hour to start the snapshot (0-59), defaults to the
16043    /// top of the hour (0).
16044    pub minute: std::option::Option<f64>,
16045
16046    /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
16047    pub hour: std::option::Option<f64>,
16048
16049    /// Set the day or days of the week to make a snapshot. Accepts a comma
16050    /// separated days of the week. Defaults to 'Sunday'.
16051    pub day: std::option::Option<std::string::String>,
16052
16053    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16054}
16055
16056impl WeeklySchedule {
16057    /// Creates a new default instance.
16058    pub fn new() -> Self {
16059        std::default::Default::default()
16060    }
16061
16062    /// Sets the value of [snapshots_to_keep][crate::model::WeeklySchedule::snapshots_to_keep].
16063    ///
16064    /// # Example
16065    /// ```ignore,no_run
16066    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
16067    /// let x = WeeklySchedule::new().set_snapshots_to_keep(42.0);
16068    /// ```
16069    pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
16070    where
16071        T: std::convert::Into<f64>,
16072    {
16073        self.snapshots_to_keep = std::option::Option::Some(v.into());
16074        self
16075    }
16076
16077    /// Sets or clears the value of [snapshots_to_keep][crate::model::WeeklySchedule::snapshots_to_keep].
16078    ///
16079    /// # Example
16080    /// ```ignore,no_run
16081    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
16082    /// let x = WeeklySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
16083    /// let x = WeeklySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
16084    /// ```
16085    pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
16086    where
16087        T: std::convert::Into<f64>,
16088    {
16089        self.snapshots_to_keep = v.map(|x| x.into());
16090        self
16091    }
16092
16093    /// Sets the value of [minute][crate::model::WeeklySchedule::minute].
16094    ///
16095    /// # Example
16096    /// ```ignore,no_run
16097    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
16098    /// let x = WeeklySchedule::new().set_minute(42.0);
16099    /// ```
16100    pub fn set_minute<T>(mut self, v: T) -> Self
16101    where
16102        T: std::convert::Into<f64>,
16103    {
16104        self.minute = std::option::Option::Some(v.into());
16105        self
16106    }
16107
16108    /// Sets or clears the value of [minute][crate::model::WeeklySchedule::minute].
16109    ///
16110    /// # Example
16111    /// ```ignore,no_run
16112    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
16113    /// let x = WeeklySchedule::new().set_or_clear_minute(Some(42.0));
16114    /// let x = WeeklySchedule::new().set_or_clear_minute(None::<f32>);
16115    /// ```
16116    pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
16117    where
16118        T: std::convert::Into<f64>,
16119    {
16120        self.minute = v.map(|x| x.into());
16121        self
16122    }
16123
16124    /// Sets the value of [hour][crate::model::WeeklySchedule::hour].
16125    ///
16126    /// # Example
16127    /// ```ignore,no_run
16128    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
16129    /// let x = WeeklySchedule::new().set_hour(42.0);
16130    /// ```
16131    pub fn set_hour<T>(mut self, v: T) -> Self
16132    where
16133        T: std::convert::Into<f64>,
16134    {
16135        self.hour = std::option::Option::Some(v.into());
16136        self
16137    }
16138
16139    /// Sets or clears the value of [hour][crate::model::WeeklySchedule::hour].
16140    ///
16141    /// # Example
16142    /// ```ignore,no_run
16143    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
16144    /// let x = WeeklySchedule::new().set_or_clear_hour(Some(42.0));
16145    /// let x = WeeklySchedule::new().set_or_clear_hour(None::<f32>);
16146    /// ```
16147    pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
16148    where
16149        T: std::convert::Into<f64>,
16150    {
16151        self.hour = v.map(|x| x.into());
16152        self
16153    }
16154
16155    /// Sets the value of [day][crate::model::WeeklySchedule::day].
16156    ///
16157    /// # Example
16158    /// ```ignore,no_run
16159    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
16160    /// let x = WeeklySchedule::new().set_day("example");
16161    /// ```
16162    pub fn set_day<T>(mut self, v: T) -> Self
16163    where
16164        T: std::convert::Into<std::string::String>,
16165    {
16166        self.day = std::option::Option::Some(v.into());
16167        self
16168    }
16169
16170    /// Sets or clears the value of [day][crate::model::WeeklySchedule::day].
16171    ///
16172    /// # Example
16173    /// ```ignore,no_run
16174    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
16175    /// let x = WeeklySchedule::new().set_or_clear_day(Some("example"));
16176    /// let x = WeeklySchedule::new().set_or_clear_day(None::<String>);
16177    /// ```
16178    pub fn set_or_clear_day<T>(mut self, v: std::option::Option<T>) -> Self
16179    where
16180        T: std::convert::Into<std::string::String>,
16181    {
16182        self.day = v.map(|x| x.into());
16183        self
16184    }
16185}
16186
16187impl wkt::message::Message for WeeklySchedule {
16188    fn typename() -> &'static str {
16189        "type.googleapis.com/google.cloud.netapp.v1.WeeklySchedule"
16190    }
16191}
16192
16193/// Make a snapshot once a month e.g. at 2nd 04:00, 7th 05:20, 24th 23:50
16194#[derive(Clone, Default, PartialEq)]
16195#[non_exhaustive]
16196pub struct MonthlySchedule {
16197    /// The maximum number of Snapshots to keep for the hourly schedule
16198    pub snapshots_to_keep: std::option::Option<f64>,
16199
16200    /// Set the minute of the hour to start the snapshot (0-59), defaults to the
16201    /// top of the hour (0).
16202    pub minute: std::option::Option<f64>,
16203
16204    /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
16205    pub hour: std::option::Option<f64>,
16206
16207    /// Set the day or days of the month to make a snapshot (1-31). Accepts a
16208    /// comma separated number of days. Defaults to '1'.
16209    pub days_of_month: std::option::Option<std::string::String>,
16210
16211    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16212}
16213
16214impl MonthlySchedule {
16215    /// Creates a new default instance.
16216    pub fn new() -> Self {
16217        std::default::Default::default()
16218    }
16219
16220    /// Sets the value of [snapshots_to_keep][crate::model::MonthlySchedule::snapshots_to_keep].
16221    ///
16222    /// # Example
16223    /// ```ignore,no_run
16224    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
16225    /// let x = MonthlySchedule::new().set_snapshots_to_keep(42.0);
16226    /// ```
16227    pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
16228    where
16229        T: std::convert::Into<f64>,
16230    {
16231        self.snapshots_to_keep = std::option::Option::Some(v.into());
16232        self
16233    }
16234
16235    /// Sets or clears the value of [snapshots_to_keep][crate::model::MonthlySchedule::snapshots_to_keep].
16236    ///
16237    /// # Example
16238    /// ```ignore,no_run
16239    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
16240    /// let x = MonthlySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
16241    /// let x = MonthlySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
16242    /// ```
16243    pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
16244    where
16245        T: std::convert::Into<f64>,
16246    {
16247        self.snapshots_to_keep = v.map(|x| x.into());
16248        self
16249    }
16250
16251    /// Sets the value of [minute][crate::model::MonthlySchedule::minute].
16252    ///
16253    /// # Example
16254    /// ```ignore,no_run
16255    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
16256    /// let x = MonthlySchedule::new().set_minute(42.0);
16257    /// ```
16258    pub fn set_minute<T>(mut self, v: T) -> Self
16259    where
16260        T: std::convert::Into<f64>,
16261    {
16262        self.minute = std::option::Option::Some(v.into());
16263        self
16264    }
16265
16266    /// Sets or clears the value of [minute][crate::model::MonthlySchedule::minute].
16267    ///
16268    /// # Example
16269    /// ```ignore,no_run
16270    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
16271    /// let x = MonthlySchedule::new().set_or_clear_minute(Some(42.0));
16272    /// let x = MonthlySchedule::new().set_or_clear_minute(None::<f32>);
16273    /// ```
16274    pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
16275    where
16276        T: std::convert::Into<f64>,
16277    {
16278        self.minute = v.map(|x| x.into());
16279        self
16280    }
16281
16282    /// Sets the value of [hour][crate::model::MonthlySchedule::hour].
16283    ///
16284    /// # Example
16285    /// ```ignore,no_run
16286    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
16287    /// let x = MonthlySchedule::new().set_hour(42.0);
16288    /// ```
16289    pub fn set_hour<T>(mut self, v: T) -> Self
16290    where
16291        T: std::convert::Into<f64>,
16292    {
16293        self.hour = std::option::Option::Some(v.into());
16294        self
16295    }
16296
16297    /// Sets or clears the value of [hour][crate::model::MonthlySchedule::hour].
16298    ///
16299    /// # Example
16300    /// ```ignore,no_run
16301    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
16302    /// let x = MonthlySchedule::new().set_or_clear_hour(Some(42.0));
16303    /// let x = MonthlySchedule::new().set_or_clear_hour(None::<f32>);
16304    /// ```
16305    pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
16306    where
16307        T: std::convert::Into<f64>,
16308    {
16309        self.hour = v.map(|x| x.into());
16310        self
16311    }
16312
16313    /// Sets the value of [days_of_month][crate::model::MonthlySchedule::days_of_month].
16314    ///
16315    /// # Example
16316    /// ```ignore,no_run
16317    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
16318    /// let x = MonthlySchedule::new().set_days_of_month("example");
16319    /// ```
16320    pub fn set_days_of_month<T>(mut self, v: T) -> Self
16321    where
16322        T: std::convert::Into<std::string::String>,
16323    {
16324        self.days_of_month = std::option::Option::Some(v.into());
16325        self
16326    }
16327
16328    /// Sets or clears the value of [days_of_month][crate::model::MonthlySchedule::days_of_month].
16329    ///
16330    /// # Example
16331    /// ```ignore,no_run
16332    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
16333    /// let x = MonthlySchedule::new().set_or_clear_days_of_month(Some("example"));
16334    /// let x = MonthlySchedule::new().set_or_clear_days_of_month(None::<String>);
16335    /// ```
16336    pub fn set_or_clear_days_of_month<T>(mut self, v: std::option::Option<T>) -> Self
16337    where
16338        T: std::convert::Into<std::string::String>,
16339    {
16340        self.days_of_month = v.map(|x| x.into());
16341        self
16342    }
16343}
16344
16345impl wkt::message::Message for MonthlySchedule {
16346    fn typename() -> &'static str {
16347        "type.googleapis.com/google.cloud.netapp.v1.MonthlySchedule"
16348    }
16349}
16350
16351/// View only mount options for a volume.
16352#[derive(Clone, Default, PartialEq)]
16353#[non_exhaustive]
16354pub struct MountOption {
16355    /// Export string
16356    pub export: std::string::String,
16357
16358    /// Full export string
16359    pub export_full: std::string::String,
16360
16361    /// Protocol to mount with.
16362    pub protocol: crate::model::Protocols,
16363
16364    /// Instructions for mounting
16365    pub instructions: std::string::String,
16366
16367    /// Output only. IP Address.
16368    pub ip_address: std::string::String,
16369
16370    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16371}
16372
16373impl MountOption {
16374    /// Creates a new default instance.
16375    pub fn new() -> Self {
16376        std::default::Default::default()
16377    }
16378
16379    /// Sets the value of [export][crate::model::MountOption::export].
16380    ///
16381    /// # Example
16382    /// ```ignore,no_run
16383    /// # use google_cloud_netapp_v1::model::MountOption;
16384    /// let x = MountOption::new().set_export("example");
16385    /// ```
16386    pub fn set_export<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16387        self.export = v.into();
16388        self
16389    }
16390
16391    /// Sets the value of [export_full][crate::model::MountOption::export_full].
16392    ///
16393    /// # Example
16394    /// ```ignore,no_run
16395    /// # use google_cloud_netapp_v1::model::MountOption;
16396    /// let x = MountOption::new().set_export_full("example");
16397    /// ```
16398    pub fn set_export_full<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16399        self.export_full = v.into();
16400        self
16401    }
16402
16403    /// Sets the value of [protocol][crate::model::MountOption::protocol].
16404    ///
16405    /// # Example
16406    /// ```ignore,no_run
16407    /// # use google_cloud_netapp_v1::model::MountOption;
16408    /// use google_cloud_netapp_v1::model::Protocols;
16409    /// let x0 = MountOption::new().set_protocol(Protocols::Nfsv3);
16410    /// let x1 = MountOption::new().set_protocol(Protocols::Nfsv4);
16411    /// let x2 = MountOption::new().set_protocol(Protocols::Smb);
16412    /// ```
16413    pub fn set_protocol<T: std::convert::Into<crate::model::Protocols>>(mut self, v: T) -> Self {
16414        self.protocol = v.into();
16415        self
16416    }
16417
16418    /// Sets the value of [instructions][crate::model::MountOption::instructions].
16419    ///
16420    /// # Example
16421    /// ```ignore,no_run
16422    /// # use google_cloud_netapp_v1::model::MountOption;
16423    /// let x = MountOption::new().set_instructions("example");
16424    /// ```
16425    pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16426        self.instructions = v.into();
16427        self
16428    }
16429
16430    /// Sets the value of [ip_address][crate::model::MountOption::ip_address].
16431    ///
16432    /// # Example
16433    /// ```ignore,no_run
16434    /// # use google_cloud_netapp_v1::model::MountOption;
16435    /// let x = MountOption::new().set_ip_address("example");
16436    /// ```
16437    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16438        self.ip_address = v.into();
16439        self
16440    }
16441}
16442
16443impl wkt::message::Message for MountOption {
16444    fn typename() -> &'static str {
16445        "type.googleapis.com/google.cloud.netapp.v1.MountOption"
16446    }
16447}
16448
16449/// The RestoreParameters if volume is created from a snapshot or backup.
16450#[derive(Clone, Default, PartialEq)]
16451#[non_exhaustive]
16452pub struct RestoreParameters {
16453    /// The source that the volume is created from.
16454    pub source: std::option::Option<crate::model::restore_parameters::Source>,
16455
16456    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16457}
16458
16459impl RestoreParameters {
16460    /// Creates a new default instance.
16461    pub fn new() -> Self {
16462        std::default::Default::default()
16463    }
16464
16465    /// Sets the value of [source][crate::model::RestoreParameters::source].
16466    ///
16467    /// Note that all the setters affecting `source` are mutually
16468    /// exclusive.
16469    ///
16470    /// # Example
16471    /// ```ignore,no_run
16472    /// # use google_cloud_netapp_v1::model::RestoreParameters;
16473    /// use google_cloud_netapp_v1::model::restore_parameters::Source;
16474    /// let x = RestoreParameters::new().set_source(Some(Source::SourceSnapshot("example".to_string())));
16475    /// ```
16476    pub fn set_source<
16477        T: std::convert::Into<std::option::Option<crate::model::restore_parameters::Source>>,
16478    >(
16479        mut self,
16480        v: T,
16481    ) -> Self {
16482        self.source = v.into();
16483        self
16484    }
16485
16486    /// The value of [source][crate::model::RestoreParameters::source]
16487    /// if it holds a `SourceSnapshot`, `None` if the field is not set or
16488    /// holds a different branch.
16489    pub fn source_snapshot(&self) -> std::option::Option<&std::string::String> {
16490        #[allow(unreachable_patterns)]
16491        self.source.as_ref().and_then(|v| match v {
16492            crate::model::restore_parameters::Source::SourceSnapshot(v) => {
16493                std::option::Option::Some(v)
16494            }
16495            _ => std::option::Option::None,
16496        })
16497    }
16498
16499    /// Sets the value of [source][crate::model::RestoreParameters::source]
16500    /// to hold a `SourceSnapshot`.
16501    ///
16502    /// Note that all the setters affecting `source` are
16503    /// mutually exclusive.
16504    ///
16505    /// # Example
16506    /// ```ignore,no_run
16507    /// # use google_cloud_netapp_v1::model::RestoreParameters;
16508    /// let x = RestoreParameters::new().set_source_snapshot("example");
16509    /// assert!(x.source_snapshot().is_some());
16510    /// assert!(x.source_backup().is_none());
16511    /// ```
16512    pub fn set_source_snapshot<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16513        self.source = std::option::Option::Some(
16514            crate::model::restore_parameters::Source::SourceSnapshot(v.into()),
16515        );
16516        self
16517    }
16518
16519    /// The value of [source][crate::model::RestoreParameters::source]
16520    /// if it holds a `SourceBackup`, `None` if the field is not set or
16521    /// holds a different branch.
16522    pub fn source_backup(&self) -> std::option::Option<&std::string::String> {
16523        #[allow(unreachable_patterns)]
16524        self.source.as_ref().and_then(|v| match v {
16525            crate::model::restore_parameters::Source::SourceBackup(v) => {
16526                std::option::Option::Some(v)
16527            }
16528            _ => std::option::Option::None,
16529        })
16530    }
16531
16532    /// Sets the value of [source][crate::model::RestoreParameters::source]
16533    /// to hold a `SourceBackup`.
16534    ///
16535    /// Note that all the setters affecting `source` are
16536    /// mutually exclusive.
16537    ///
16538    /// # Example
16539    /// ```ignore,no_run
16540    /// # use google_cloud_netapp_v1::model::RestoreParameters;
16541    /// # let project_id = "project_id";
16542    /// # let location_id = "location_id";
16543    /// # let backup_vault_id = "backup_vault_id";
16544    /// # let backup_id = "backup_id";
16545    /// let x = RestoreParameters::new().set_source_backup(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}/backups/{backup_id}"));
16546    /// assert!(x.source_backup().is_some());
16547    /// assert!(x.source_snapshot().is_none());
16548    /// ```
16549    pub fn set_source_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16550        self.source = std::option::Option::Some(
16551            crate::model::restore_parameters::Source::SourceBackup(v.into()),
16552        );
16553        self
16554    }
16555}
16556
16557impl wkt::message::Message for RestoreParameters {
16558    fn typename() -> &'static str {
16559        "type.googleapis.com/google.cloud.netapp.v1.RestoreParameters"
16560    }
16561}
16562
16563/// Defines additional types related to [RestoreParameters].
16564pub mod restore_parameters {
16565    #[allow(unused_imports)]
16566    use super::*;
16567
16568    /// The source that the volume is created from.
16569    #[derive(Clone, Debug, PartialEq)]
16570    #[non_exhaustive]
16571    pub enum Source {
16572        /// Full name of the snapshot resource.
16573        /// Format:
16574        /// projects/{project}/locations/{location}/volumes/{volume}/snapshots/{snapshot}
16575        SourceSnapshot(std::string::String),
16576        /// Full name of the backup resource.
16577        /// Format for standard backup:
16578        /// projects/{project}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}
16579        /// Format for BackupDR backup:
16580        /// projects/{project}/locations/{location}/backupVaults/{backup_vault}/dataSources/{data_source}/backups/{backup}
16581        SourceBackup(std::string::String),
16582    }
16583}
16584
16585/// BackupConfig contains backup related config on a volume.
16586#[derive(Clone, Default, PartialEq)]
16587#[non_exhaustive]
16588pub struct BackupConfig {
16589    /// Optional. When specified, schedule backups will be created based on the
16590    /// policy configuration.
16591    pub backup_policies: std::vec::Vec<std::string::String>,
16592
16593    /// Optional. Name of backup vault.
16594    /// Format:
16595    /// projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}
16596    pub backup_vault: std::string::String,
16597
16598    /// Optional. When set to true, scheduled backup is enabled on the volume.
16599    /// This field should be nil when there's no backup policy attached.
16600    pub scheduled_backup_enabled: std::option::Option<bool>,
16601
16602    /// Output only. Total size of all backups in a chain in bytes = baseline
16603    /// backup size + sum(incremental backup size).
16604    pub backup_chain_bytes: std::option::Option<i64>,
16605
16606    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16607}
16608
16609impl BackupConfig {
16610    /// Creates a new default instance.
16611    pub fn new() -> Self {
16612        std::default::Default::default()
16613    }
16614
16615    /// Sets the value of [backup_policies][crate::model::BackupConfig::backup_policies].
16616    ///
16617    /// # Example
16618    /// ```ignore,no_run
16619    /// # use google_cloud_netapp_v1::model::BackupConfig;
16620    /// let x = BackupConfig::new().set_backup_policies(["a", "b", "c"]);
16621    /// ```
16622    pub fn set_backup_policies<T, V>(mut self, v: T) -> Self
16623    where
16624        T: std::iter::IntoIterator<Item = V>,
16625        V: std::convert::Into<std::string::String>,
16626    {
16627        use std::iter::Iterator;
16628        self.backup_policies = v.into_iter().map(|i| i.into()).collect();
16629        self
16630    }
16631
16632    /// Sets the value of [backup_vault][crate::model::BackupConfig::backup_vault].
16633    ///
16634    /// # Example
16635    /// ```ignore,no_run
16636    /// # use google_cloud_netapp_v1::model::BackupConfig;
16637    /// # let project_id = "project_id";
16638    /// # let location_id = "location_id";
16639    /// # let backup_vault_id = "backup_vault_id";
16640    /// let x = BackupConfig::new().set_backup_vault(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}"));
16641    /// ```
16642    pub fn set_backup_vault<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16643        self.backup_vault = v.into();
16644        self
16645    }
16646
16647    /// Sets the value of [scheduled_backup_enabled][crate::model::BackupConfig::scheduled_backup_enabled].
16648    ///
16649    /// # Example
16650    /// ```ignore,no_run
16651    /// # use google_cloud_netapp_v1::model::BackupConfig;
16652    /// let x = BackupConfig::new().set_scheduled_backup_enabled(true);
16653    /// ```
16654    pub fn set_scheduled_backup_enabled<T>(mut self, v: T) -> Self
16655    where
16656        T: std::convert::Into<bool>,
16657    {
16658        self.scheduled_backup_enabled = std::option::Option::Some(v.into());
16659        self
16660    }
16661
16662    /// Sets or clears the value of [scheduled_backup_enabled][crate::model::BackupConfig::scheduled_backup_enabled].
16663    ///
16664    /// # Example
16665    /// ```ignore,no_run
16666    /// # use google_cloud_netapp_v1::model::BackupConfig;
16667    /// let x = BackupConfig::new().set_or_clear_scheduled_backup_enabled(Some(false));
16668    /// let x = BackupConfig::new().set_or_clear_scheduled_backup_enabled(None::<bool>);
16669    /// ```
16670    pub fn set_or_clear_scheduled_backup_enabled<T>(mut self, v: std::option::Option<T>) -> Self
16671    where
16672        T: std::convert::Into<bool>,
16673    {
16674        self.scheduled_backup_enabled = v.map(|x| x.into());
16675        self
16676    }
16677
16678    /// Sets the value of [backup_chain_bytes][crate::model::BackupConfig::backup_chain_bytes].
16679    ///
16680    /// # Example
16681    /// ```ignore,no_run
16682    /// # use google_cloud_netapp_v1::model::BackupConfig;
16683    /// let x = BackupConfig::new().set_backup_chain_bytes(42);
16684    /// ```
16685    pub fn set_backup_chain_bytes<T>(mut self, v: T) -> Self
16686    where
16687        T: std::convert::Into<i64>,
16688    {
16689        self.backup_chain_bytes = std::option::Option::Some(v.into());
16690        self
16691    }
16692
16693    /// Sets or clears the value of [backup_chain_bytes][crate::model::BackupConfig::backup_chain_bytes].
16694    ///
16695    /// # Example
16696    /// ```ignore,no_run
16697    /// # use google_cloud_netapp_v1::model::BackupConfig;
16698    /// let x = BackupConfig::new().set_or_clear_backup_chain_bytes(Some(42));
16699    /// let x = BackupConfig::new().set_or_clear_backup_chain_bytes(None::<i32>);
16700    /// ```
16701    pub fn set_or_clear_backup_chain_bytes<T>(mut self, v: std::option::Option<T>) -> Self
16702    where
16703        T: std::convert::Into<i64>,
16704    {
16705        self.backup_chain_bytes = v.map(|x| x.into());
16706        self
16707    }
16708}
16709
16710impl wkt::message::Message for BackupConfig {
16711    fn typename() -> &'static str {
16712        "type.googleapis.com/google.cloud.netapp.v1.BackupConfig"
16713    }
16714}
16715
16716/// Defines tiering policy for the volume.
16717#[derive(Clone, Default, PartialEq)]
16718#[non_exhaustive]
16719pub struct TieringPolicy {
16720    /// Optional. Flag indicating if the volume has tiering policy enable/pause.
16721    /// Default is PAUSED.
16722    pub tier_action: std::option::Option<crate::model::tiering_policy::TierAction>,
16723
16724    /// Optional. Time in days to mark the volume's data block as cold and make it
16725    /// eligible for tiering, can be range from 2-183. Default is 31.
16726    pub cooling_threshold_days: std::option::Option<i32>,
16727
16728    /// Optional. Flag indicating that the hot tier bypass mode is enabled. Default
16729    /// is false. This is only applicable to Flex service level.
16730    pub hot_tier_bypass_mode_enabled: std::option::Option<bool>,
16731
16732    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16733}
16734
16735impl TieringPolicy {
16736    /// Creates a new default instance.
16737    pub fn new() -> Self {
16738        std::default::Default::default()
16739    }
16740
16741    /// Sets the value of [tier_action][crate::model::TieringPolicy::tier_action].
16742    ///
16743    /// # Example
16744    /// ```ignore,no_run
16745    /// # use google_cloud_netapp_v1::model::TieringPolicy;
16746    /// use google_cloud_netapp_v1::model::tiering_policy::TierAction;
16747    /// let x0 = TieringPolicy::new().set_tier_action(TierAction::Enabled);
16748    /// let x1 = TieringPolicy::new().set_tier_action(TierAction::Paused);
16749    /// ```
16750    pub fn set_tier_action<T>(mut self, v: T) -> Self
16751    where
16752        T: std::convert::Into<crate::model::tiering_policy::TierAction>,
16753    {
16754        self.tier_action = std::option::Option::Some(v.into());
16755        self
16756    }
16757
16758    /// Sets or clears the value of [tier_action][crate::model::TieringPolicy::tier_action].
16759    ///
16760    /// # Example
16761    /// ```ignore,no_run
16762    /// # use google_cloud_netapp_v1::model::TieringPolicy;
16763    /// use google_cloud_netapp_v1::model::tiering_policy::TierAction;
16764    /// let x0 = TieringPolicy::new().set_or_clear_tier_action(Some(TierAction::Enabled));
16765    /// let x1 = TieringPolicy::new().set_or_clear_tier_action(Some(TierAction::Paused));
16766    /// let x_none = TieringPolicy::new().set_or_clear_tier_action(None::<TierAction>);
16767    /// ```
16768    pub fn set_or_clear_tier_action<T>(mut self, v: std::option::Option<T>) -> Self
16769    where
16770        T: std::convert::Into<crate::model::tiering_policy::TierAction>,
16771    {
16772        self.tier_action = v.map(|x| x.into());
16773        self
16774    }
16775
16776    /// Sets the value of [cooling_threshold_days][crate::model::TieringPolicy::cooling_threshold_days].
16777    ///
16778    /// # Example
16779    /// ```ignore,no_run
16780    /// # use google_cloud_netapp_v1::model::TieringPolicy;
16781    /// let x = TieringPolicy::new().set_cooling_threshold_days(42);
16782    /// ```
16783    pub fn set_cooling_threshold_days<T>(mut self, v: T) -> Self
16784    where
16785        T: std::convert::Into<i32>,
16786    {
16787        self.cooling_threshold_days = std::option::Option::Some(v.into());
16788        self
16789    }
16790
16791    /// Sets or clears the value of [cooling_threshold_days][crate::model::TieringPolicy::cooling_threshold_days].
16792    ///
16793    /// # Example
16794    /// ```ignore,no_run
16795    /// # use google_cloud_netapp_v1::model::TieringPolicy;
16796    /// let x = TieringPolicy::new().set_or_clear_cooling_threshold_days(Some(42));
16797    /// let x = TieringPolicy::new().set_or_clear_cooling_threshold_days(None::<i32>);
16798    /// ```
16799    pub fn set_or_clear_cooling_threshold_days<T>(mut self, v: std::option::Option<T>) -> Self
16800    where
16801        T: std::convert::Into<i32>,
16802    {
16803        self.cooling_threshold_days = v.map(|x| x.into());
16804        self
16805    }
16806
16807    /// Sets the value of [hot_tier_bypass_mode_enabled][crate::model::TieringPolicy::hot_tier_bypass_mode_enabled].
16808    ///
16809    /// # Example
16810    /// ```ignore,no_run
16811    /// # use google_cloud_netapp_v1::model::TieringPolicy;
16812    /// let x = TieringPolicy::new().set_hot_tier_bypass_mode_enabled(true);
16813    /// ```
16814    pub fn set_hot_tier_bypass_mode_enabled<T>(mut self, v: T) -> Self
16815    where
16816        T: std::convert::Into<bool>,
16817    {
16818        self.hot_tier_bypass_mode_enabled = std::option::Option::Some(v.into());
16819        self
16820    }
16821
16822    /// Sets or clears the value of [hot_tier_bypass_mode_enabled][crate::model::TieringPolicy::hot_tier_bypass_mode_enabled].
16823    ///
16824    /// # Example
16825    /// ```ignore,no_run
16826    /// # use google_cloud_netapp_v1::model::TieringPolicy;
16827    /// let x = TieringPolicy::new().set_or_clear_hot_tier_bypass_mode_enabled(Some(false));
16828    /// let x = TieringPolicy::new().set_or_clear_hot_tier_bypass_mode_enabled(None::<bool>);
16829    /// ```
16830    pub fn set_or_clear_hot_tier_bypass_mode_enabled<T>(mut self, v: std::option::Option<T>) -> Self
16831    where
16832        T: std::convert::Into<bool>,
16833    {
16834        self.hot_tier_bypass_mode_enabled = v.map(|x| x.into());
16835        self
16836    }
16837}
16838
16839impl wkt::message::Message for TieringPolicy {
16840    fn typename() -> &'static str {
16841        "type.googleapis.com/google.cloud.netapp.v1.TieringPolicy"
16842    }
16843}
16844
16845/// Defines additional types related to [TieringPolicy].
16846pub mod tiering_policy {
16847    #[allow(unused_imports)]
16848    use super::*;
16849
16850    /// Tier action for the volume.
16851    ///
16852    /// # Working with unknown values
16853    ///
16854    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16855    /// additional enum variants at any time. Adding new variants is not considered
16856    /// a breaking change. Applications should write their code in anticipation of:
16857    ///
16858    /// - New values appearing in future releases of the client library, **and**
16859    /// - New values received dynamically, without application changes.
16860    ///
16861    /// Please consult the [Working with enums] section in the user guide for some
16862    /// guidelines.
16863    ///
16864    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
16865    #[derive(Clone, Debug, PartialEq)]
16866    #[non_exhaustive]
16867    pub enum TierAction {
16868        /// Unspecified.
16869        Unspecified,
16870        /// When tiering is enabled, new cold data will be tiered.
16871        Enabled,
16872        /// When paused, tiering won't be performed on new data. Existing data stays
16873        /// tiered until accessed.
16874        Paused,
16875        /// If set, the enum was initialized with an unknown value.
16876        ///
16877        /// Applications can examine the value using [TierAction::value] or
16878        /// [TierAction::name].
16879        UnknownValue(tier_action::UnknownValue),
16880    }
16881
16882    #[doc(hidden)]
16883    pub mod tier_action {
16884        #[allow(unused_imports)]
16885        use super::*;
16886        #[derive(Clone, Debug, PartialEq)]
16887        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16888    }
16889
16890    impl TierAction {
16891        /// Gets the enum value.
16892        ///
16893        /// Returns `None` if the enum contains an unknown value deserialized from
16894        /// the string representation of enums.
16895        pub fn value(&self) -> std::option::Option<i32> {
16896            match self {
16897                Self::Unspecified => std::option::Option::Some(0),
16898                Self::Enabled => std::option::Option::Some(1),
16899                Self::Paused => std::option::Option::Some(2),
16900                Self::UnknownValue(u) => u.0.value(),
16901            }
16902        }
16903
16904        /// Gets the enum value as a string.
16905        ///
16906        /// Returns `None` if the enum contains an unknown value deserialized from
16907        /// the integer representation of enums.
16908        pub fn name(&self) -> std::option::Option<&str> {
16909            match self {
16910                Self::Unspecified => std::option::Option::Some("TIER_ACTION_UNSPECIFIED"),
16911                Self::Enabled => std::option::Option::Some("ENABLED"),
16912                Self::Paused => std::option::Option::Some("PAUSED"),
16913                Self::UnknownValue(u) => u.0.name(),
16914            }
16915        }
16916    }
16917
16918    impl std::default::Default for TierAction {
16919        fn default() -> Self {
16920            use std::convert::From;
16921            Self::from(0)
16922        }
16923    }
16924
16925    impl std::fmt::Display for TierAction {
16926        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16927            wkt::internal::display_enum(f, self.name(), self.value())
16928        }
16929    }
16930
16931    impl std::convert::From<i32> for TierAction {
16932        fn from(value: i32) -> Self {
16933            match value {
16934                0 => Self::Unspecified,
16935                1 => Self::Enabled,
16936                2 => Self::Paused,
16937                _ => Self::UnknownValue(tier_action::UnknownValue(
16938                    wkt::internal::UnknownEnumValue::Integer(value),
16939                )),
16940            }
16941        }
16942    }
16943
16944    impl std::convert::From<&str> for TierAction {
16945        fn from(value: &str) -> Self {
16946            use std::string::ToString;
16947            match value {
16948                "TIER_ACTION_UNSPECIFIED" => Self::Unspecified,
16949                "ENABLED" => Self::Enabled,
16950                "PAUSED" => Self::Paused,
16951                _ => Self::UnknownValue(tier_action::UnknownValue(
16952                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16953                )),
16954            }
16955        }
16956    }
16957
16958    impl serde::ser::Serialize for TierAction {
16959        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16960        where
16961            S: serde::Serializer,
16962        {
16963            match self {
16964                Self::Unspecified => serializer.serialize_i32(0),
16965                Self::Enabled => serializer.serialize_i32(1),
16966                Self::Paused => serializer.serialize_i32(2),
16967                Self::UnknownValue(u) => u.0.serialize(serializer),
16968            }
16969        }
16970    }
16971
16972    impl<'de> serde::de::Deserialize<'de> for TierAction {
16973        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16974        where
16975            D: serde::Deserializer<'de>,
16976        {
16977            deserializer.deserialize_any(wkt::internal::EnumVisitor::<TierAction>::new(
16978                ".google.cloud.netapp.v1.TieringPolicy.TierAction",
16979            ))
16980        }
16981    }
16982}
16983
16984/// The Hybrid Replication parameters for the volume.
16985#[derive(Clone, Default, PartialEq)]
16986#[non_exhaustive]
16987pub struct HybridReplicationParameters {
16988    /// Required. Desired name for the replication of this volume.
16989    pub replication: std::string::String,
16990
16991    /// Required. Name of the user's local source volume to be peered with the
16992    /// destination volume.
16993    pub peer_volume_name: std::string::String,
16994
16995    /// Required. Name of the user's local source cluster to be peered with the
16996    /// destination cluster.
16997    pub peer_cluster_name: std::string::String,
16998
16999    /// Required. Name of the user's local source vserver svm to be peered with the
17000    /// destination vserver svm.
17001    pub peer_svm_name: std::string::String,
17002
17003    /// Required. List of node ip addresses to be peered with.
17004    pub peer_ip_addresses: std::vec::Vec<std::string::String>,
17005
17006    /// Optional. Name of source cluster location associated with the Hybrid
17007    /// replication. This is a free-form field for the display purpose only.
17008    pub cluster_location: std::string::String,
17009
17010    /// Optional. Description of the replication.
17011    pub description: std::string::String,
17012
17013    /// Optional. Labels to be added to the replication as the key value pairs.
17014    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
17015
17016    /// Optional. Replication Schedule for the replication created.
17017    pub replication_schedule: crate::model::HybridReplicationSchedule,
17018
17019    /// Optional. Type of the hybrid replication.
17020    pub hybrid_replication_type:
17021        crate::model::hybrid_replication_parameters::VolumeHybridReplicationType,
17022
17023    /// Optional. Constituent volume count for large volume.
17024    pub large_volume_constituent_count: i32,
17025
17026    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17027}
17028
17029impl HybridReplicationParameters {
17030    /// Creates a new default instance.
17031    pub fn new() -> Self {
17032        std::default::Default::default()
17033    }
17034
17035    /// Sets the value of [replication][crate::model::HybridReplicationParameters::replication].
17036    ///
17037    /// # Example
17038    /// ```ignore,no_run
17039    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
17040    /// # let project_id = "project_id";
17041    /// # let location_id = "location_id";
17042    /// # let volume_id = "volume_id";
17043    /// # let replication_id = "replication_id";
17044    /// let x = HybridReplicationParameters::new().set_replication(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}/replications/{replication_id}"));
17045    /// ```
17046    pub fn set_replication<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17047        self.replication = v.into();
17048        self
17049    }
17050
17051    /// Sets the value of [peer_volume_name][crate::model::HybridReplicationParameters::peer_volume_name].
17052    ///
17053    /// # Example
17054    /// ```ignore,no_run
17055    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
17056    /// let x = HybridReplicationParameters::new().set_peer_volume_name("example");
17057    /// ```
17058    pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
17059        mut self,
17060        v: T,
17061    ) -> Self {
17062        self.peer_volume_name = v.into();
17063        self
17064    }
17065
17066    /// Sets the value of [peer_cluster_name][crate::model::HybridReplicationParameters::peer_cluster_name].
17067    ///
17068    /// # Example
17069    /// ```ignore,no_run
17070    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
17071    /// let x = HybridReplicationParameters::new().set_peer_cluster_name("example");
17072    /// ```
17073    pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
17074        mut self,
17075        v: T,
17076    ) -> Self {
17077        self.peer_cluster_name = v.into();
17078        self
17079    }
17080
17081    /// Sets the value of [peer_svm_name][crate::model::HybridReplicationParameters::peer_svm_name].
17082    ///
17083    /// # Example
17084    /// ```ignore,no_run
17085    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
17086    /// let x = HybridReplicationParameters::new().set_peer_svm_name("example");
17087    /// ```
17088    pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17089        self.peer_svm_name = v.into();
17090        self
17091    }
17092
17093    /// Sets the value of [peer_ip_addresses][crate::model::HybridReplicationParameters::peer_ip_addresses].
17094    ///
17095    /// # Example
17096    /// ```ignore,no_run
17097    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
17098    /// let x = HybridReplicationParameters::new().set_peer_ip_addresses(["a", "b", "c"]);
17099    /// ```
17100    pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
17101    where
17102        T: std::iter::IntoIterator<Item = V>,
17103        V: std::convert::Into<std::string::String>,
17104    {
17105        use std::iter::Iterator;
17106        self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
17107        self
17108    }
17109
17110    /// Sets the value of [cluster_location][crate::model::HybridReplicationParameters::cluster_location].
17111    ///
17112    /// # Example
17113    /// ```ignore,no_run
17114    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
17115    /// let x = HybridReplicationParameters::new().set_cluster_location("example");
17116    /// ```
17117    pub fn set_cluster_location<T: std::convert::Into<std::string::String>>(
17118        mut self,
17119        v: T,
17120    ) -> Self {
17121        self.cluster_location = v.into();
17122        self
17123    }
17124
17125    /// Sets the value of [description][crate::model::HybridReplicationParameters::description].
17126    ///
17127    /// # Example
17128    /// ```ignore,no_run
17129    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
17130    /// let x = HybridReplicationParameters::new().set_description("example");
17131    /// ```
17132    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17133        self.description = v.into();
17134        self
17135    }
17136
17137    /// Sets the value of [labels][crate::model::HybridReplicationParameters::labels].
17138    ///
17139    /// # Example
17140    /// ```ignore,no_run
17141    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
17142    /// let x = HybridReplicationParameters::new().set_labels([
17143    ///     ("key0", "abc"),
17144    ///     ("key1", "xyz"),
17145    /// ]);
17146    /// ```
17147    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
17148    where
17149        T: std::iter::IntoIterator<Item = (K, V)>,
17150        K: std::convert::Into<std::string::String>,
17151        V: std::convert::Into<std::string::String>,
17152    {
17153        use std::iter::Iterator;
17154        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
17155        self
17156    }
17157
17158    /// Sets the value of [replication_schedule][crate::model::HybridReplicationParameters::replication_schedule].
17159    ///
17160    /// # Example
17161    /// ```ignore,no_run
17162    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
17163    /// use google_cloud_netapp_v1::model::HybridReplicationSchedule;
17164    /// let x0 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Every10Minutes);
17165    /// let x1 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Hourly);
17166    /// let x2 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Daily);
17167    /// ```
17168    pub fn set_replication_schedule<
17169        T: std::convert::Into<crate::model::HybridReplicationSchedule>,
17170    >(
17171        mut self,
17172        v: T,
17173    ) -> Self {
17174        self.replication_schedule = v.into();
17175        self
17176    }
17177
17178    /// Sets the value of [hybrid_replication_type][crate::model::HybridReplicationParameters::hybrid_replication_type].
17179    ///
17180    /// # Example
17181    /// ```ignore,no_run
17182    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
17183    /// use google_cloud_netapp_v1::model::hybrid_replication_parameters::VolumeHybridReplicationType;
17184    /// let x0 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::Migration);
17185    /// let x1 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::ContinuousReplication);
17186    /// let x2 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::OnpremReplication);
17187    /// ```
17188    pub fn set_hybrid_replication_type<
17189        T: std::convert::Into<
17190                crate::model::hybrid_replication_parameters::VolumeHybridReplicationType,
17191            >,
17192    >(
17193        mut self,
17194        v: T,
17195    ) -> Self {
17196        self.hybrid_replication_type = v.into();
17197        self
17198    }
17199
17200    /// Sets the value of [large_volume_constituent_count][crate::model::HybridReplicationParameters::large_volume_constituent_count].
17201    ///
17202    /// # Example
17203    /// ```ignore,no_run
17204    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
17205    /// let x = HybridReplicationParameters::new().set_large_volume_constituent_count(42);
17206    /// ```
17207    pub fn set_large_volume_constituent_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
17208        self.large_volume_constituent_count = v.into();
17209        self
17210    }
17211}
17212
17213impl wkt::message::Message for HybridReplicationParameters {
17214    fn typename() -> &'static str {
17215        "type.googleapis.com/google.cloud.netapp.v1.HybridReplicationParameters"
17216    }
17217}
17218
17219/// Defines additional types related to [HybridReplicationParameters].
17220pub mod hybrid_replication_parameters {
17221    #[allow(unused_imports)]
17222    use super::*;
17223
17224    /// Type of the volume's hybrid replication.
17225    ///
17226    /// # Working with unknown values
17227    ///
17228    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17229    /// additional enum variants at any time. Adding new variants is not considered
17230    /// a breaking change. Applications should write their code in anticipation of:
17231    ///
17232    /// - New values appearing in future releases of the client library, **and**
17233    /// - New values received dynamically, without application changes.
17234    ///
17235    /// Please consult the [Working with enums] section in the user guide for some
17236    /// guidelines.
17237    ///
17238    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17239    #[derive(Clone, Debug, PartialEq)]
17240    #[non_exhaustive]
17241    pub enum VolumeHybridReplicationType {
17242        /// Unspecified hybrid replication type.
17243        Unspecified,
17244        /// Hybrid replication type for migration.
17245        Migration,
17246        /// Hybrid replication type for continuous replication.
17247        ContinuousReplication,
17248        /// New field for reversible OnPrem replication, to be used for data
17249        /// protection.
17250        OnpremReplication,
17251        /// New field for reversible OnPrem replication, to be used for data
17252        /// protection.
17253        ReverseOnpremReplication,
17254        /// If set, the enum was initialized with an unknown value.
17255        ///
17256        /// Applications can examine the value using [VolumeHybridReplicationType::value] or
17257        /// [VolumeHybridReplicationType::name].
17258        UnknownValue(volume_hybrid_replication_type::UnknownValue),
17259    }
17260
17261    #[doc(hidden)]
17262    pub mod volume_hybrid_replication_type {
17263        #[allow(unused_imports)]
17264        use super::*;
17265        #[derive(Clone, Debug, PartialEq)]
17266        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17267    }
17268
17269    impl VolumeHybridReplicationType {
17270        /// Gets the enum value.
17271        ///
17272        /// Returns `None` if the enum contains an unknown value deserialized from
17273        /// the string representation of enums.
17274        pub fn value(&self) -> std::option::Option<i32> {
17275            match self {
17276                Self::Unspecified => std::option::Option::Some(0),
17277                Self::Migration => std::option::Option::Some(1),
17278                Self::ContinuousReplication => std::option::Option::Some(2),
17279                Self::OnpremReplication => std::option::Option::Some(3),
17280                Self::ReverseOnpremReplication => std::option::Option::Some(4),
17281                Self::UnknownValue(u) => u.0.value(),
17282            }
17283        }
17284
17285        /// Gets the enum value as a string.
17286        ///
17287        /// Returns `None` if the enum contains an unknown value deserialized from
17288        /// the integer representation of enums.
17289        pub fn name(&self) -> std::option::Option<&str> {
17290            match self {
17291                Self::Unspecified => {
17292                    std::option::Option::Some("VOLUME_HYBRID_REPLICATION_TYPE_UNSPECIFIED")
17293                }
17294                Self::Migration => std::option::Option::Some("MIGRATION"),
17295                Self::ContinuousReplication => std::option::Option::Some("CONTINUOUS_REPLICATION"),
17296                Self::OnpremReplication => std::option::Option::Some("ONPREM_REPLICATION"),
17297                Self::ReverseOnpremReplication => {
17298                    std::option::Option::Some("REVERSE_ONPREM_REPLICATION")
17299                }
17300                Self::UnknownValue(u) => u.0.name(),
17301            }
17302        }
17303    }
17304
17305    impl std::default::Default for VolumeHybridReplicationType {
17306        fn default() -> Self {
17307            use std::convert::From;
17308            Self::from(0)
17309        }
17310    }
17311
17312    impl std::fmt::Display for VolumeHybridReplicationType {
17313        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17314            wkt::internal::display_enum(f, self.name(), self.value())
17315        }
17316    }
17317
17318    impl std::convert::From<i32> for VolumeHybridReplicationType {
17319        fn from(value: i32) -> Self {
17320            match value {
17321                0 => Self::Unspecified,
17322                1 => Self::Migration,
17323                2 => Self::ContinuousReplication,
17324                3 => Self::OnpremReplication,
17325                4 => Self::ReverseOnpremReplication,
17326                _ => Self::UnknownValue(volume_hybrid_replication_type::UnknownValue(
17327                    wkt::internal::UnknownEnumValue::Integer(value),
17328                )),
17329            }
17330        }
17331    }
17332
17333    impl std::convert::From<&str> for VolumeHybridReplicationType {
17334        fn from(value: &str) -> Self {
17335            use std::string::ToString;
17336            match value {
17337                "VOLUME_HYBRID_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
17338                "MIGRATION" => Self::Migration,
17339                "CONTINUOUS_REPLICATION" => Self::ContinuousReplication,
17340                "ONPREM_REPLICATION" => Self::OnpremReplication,
17341                "REVERSE_ONPREM_REPLICATION" => Self::ReverseOnpremReplication,
17342                _ => Self::UnknownValue(volume_hybrid_replication_type::UnknownValue(
17343                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17344                )),
17345            }
17346        }
17347    }
17348
17349    impl serde::ser::Serialize for VolumeHybridReplicationType {
17350        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17351        where
17352            S: serde::Serializer,
17353        {
17354            match self {
17355                Self::Unspecified => serializer.serialize_i32(0),
17356                Self::Migration => serializer.serialize_i32(1),
17357                Self::ContinuousReplication => serializer.serialize_i32(2),
17358                Self::OnpremReplication => serializer.serialize_i32(3),
17359                Self::ReverseOnpremReplication => serializer.serialize_i32(4),
17360                Self::UnknownValue(u) => u.0.serialize(serializer),
17361            }
17362        }
17363    }
17364
17365    impl<'de> serde::de::Deserialize<'de> for VolumeHybridReplicationType {
17366        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17367        where
17368            D: serde::Deserializer<'de>,
17369        {
17370            deserializer.deserialize_any(wkt::internal::EnumVisitor::<VolumeHybridReplicationType>::new(
17371                ".google.cloud.netapp.v1.HybridReplicationParameters.VolumeHybridReplicationType"))
17372        }
17373    }
17374}
17375
17376/// Cache Parameters for the volume.
17377#[derive(Clone, Default, PartialEq)]
17378#[non_exhaustive]
17379pub struct CacheParameters {
17380    /// Required. Name of the origin volume for the cache volume.
17381    pub peer_volume_name: std::string::String,
17382
17383    /// Required. Name of the origin volume's ONTAP cluster.
17384    pub peer_cluster_name: std::string::String,
17385
17386    /// Required. Name of the origin volume's SVM.
17387    pub peer_svm_name: std::string::String,
17388
17389    /// Required. List of IC LIF addresses of the origin volume's ONTAP cluster.
17390    pub peer_ip_addresses: std::vec::Vec<std::string::String>,
17391
17392    /// Optional. Indicates whether the cache volume has global file lock enabled.
17393    pub enable_global_file_lock: std::option::Option<bool>,
17394
17395    /// Optional. Configuration of the cache volume.
17396    pub cache_config: std::option::Option<crate::model::CacheConfig>,
17397
17398    /// Output only. State of the cache volume indicating the peering status.
17399    pub cache_state: crate::model::cache_parameters::CacheState,
17400
17401    /// Output only. Copy-paste-able commands to be used on user's ONTAP to accept
17402    /// peering requests.
17403    pub command: std::string::String,
17404
17405    /// Optional. Expiration time for the peering command to be executed on user's
17406    /// ONTAP.
17407    pub peering_command_expiry_time: std::option::Option<wkt::Timestamp>,
17408
17409    /// Output only. Temporary passphrase generated to accept cluster peering
17410    /// command.
17411    pub passphrase: std::string::String,
17412
17413    /// Output only. Detailed description of the current cache state.
17414    pub state_details: std::string::String,
17415
17416    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17417}
17418
17419impl CacheParameters {
17420    /// Creates a new default instance.
17421    pub fn new() -> Self {
17422        std::default::Default::default()
17423    }
17424
17425    /// Sets the value of [peer_volume_name][crate::model::CacheParameters::peer_volume_name].
17426    ///
17427    /// # Example
17428    /// ```ignore,no_run
17429    /// # use google_cloud_netapp_v1::model::CacheParameters;
17430    /// let x = CacheParameters::new().set_peer_volume_name("example");
17431    /// ```
17432    pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
17433        mut self,
17434        v: T,
17435    ) -> Self {
17436        self.peer_volume_name = v.into();
17437        self
17438    }
17439
17440    /// Sets the value of [peer_cluster_name][crate::model::CacheParameters::peer_cluster_name].
17441    ///
17442    /// # Example
17443    /// ```ignore,no_run
17444    /// # use google_cloud_netapp_v1::model::CacheParameters;
17445    /// let x = CacheParameters::new().set_peer_cluster_name("example");
17446    /// ```
17447    pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
17448        mut self,
17449        v: T,
17450    ) -> Self {
17451        self.peer_cluster_name = v.into();
17452        self
17453    }
17454
17455    /// Sets the value of [peer_svm_name][crate::model::CacheParameters::peer_svm_name].
17456    ///
17457    /// # Example
17458    /// ```ignore,no_run
17459    /// # use google_cloud_netapp_v1::model::CacheParameters;
17460    /// let x = CacheParameters::new().set_peer_svm_name("example");
17461    /// ```
17462    pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17463        self.peer_svm_name = v.into();
17464        self
17465    }
17466
17467    /// Sets the value of [peer_ip_addresses][crate::model::CacheParameters::peer_ip_addresses].
17468    ///
17469    /// # Example
17470    /// ```ignore,no_run
17471    /// # use google_cloud_netapp_v1::model::CacheParameters;
17472    /// let x = CacheParameters::new().set_peer_ip_addresses(["a", "b", "c"]);
17473    /// ```
17474    pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
17475    where
17476        T: std::iter::IntoIterator<Item = V>,
17477        V: std::convert::Into<std::string::String>,
17478    {
17479        use std::iter::Iterator;
17480        self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
17481        self
17482    }
17483
17484    /// Sets the value of [enable_global_file_lock][crate::model::CacheParameters::enable_global_file_lock].
17485    ///
17486    /// # Example
17487    /// ```ignore,no_run
17488    /// # use google_cloud_netapp_v1::model::CacheParameters;
17489    /// let x = CacheParameters::new().set_enable_global_file_lock(true);
17490    /// ```
17491    pub fn set_enable_global_file_lock<T>(mut self, v: T) -> Self
17492    where
17493        T: std::convert::Into<bool>,
17494    {
17495        self.enable_global_file_lock = std::option::Option::Some(v.into());
17496        self
17497    }
17498
17499    /// Sets or clears the value of [enable_global_file_lock][crate::model::CacheParameters::enable_global_file_lock].
17500    ///
17501    /// # Example
17502    /// ```ignore,no_run
17503    /// # use google_cloud_netapp_v1::model::CacheParameters;
17504    /// let x = CacheParameters::new().set_or_clear_enable_global_file_lock(Some(false));
17505    /// let x = CacheParameters::new().set_or_clear_enable_global_file_lock(None::<bool>);
17506    /// ```
17507    pub fn set_or_clear_enable_global_file_lock<T>(mut self, v: std::option::Option<T>) -> Self
17508    where
17509        T: std::convert::Into<bool>,
17510    {
17511        self.enable_global_file_lock = v.map(|x| x.into());
17512        self
17513    }
17514
17515    /// Sets the value of [cache_config][crate::model::CacheParameters::cache_config].
17516    ///
17517    /// # Example
17518    /// ```ignore,no_run
17519    /// # use google_cloud_netapp_v1::model::CacheParameters;
17520    /// use google_cloud_netapp_v1::model::CacheConfig;
17521    /// let x = CacheParameters::new().set_cache_config(CacheConfig::default()/* use setters */);
17522    /// ```
17523    pub fn set_cache_config<T>(mut self, v: T) -> Self
17524    where
17525        T: std::convert::Into<crate::model::CacheConfig>,
17526    {
17527        self.cache_config = std::option::Option::Some(v.into());
17528        self
17529    }
17530
17531    /// Sets or clears the value of [cache_config][crate::model::CacheParameters::cache_config].
17532    ///
17533    /// # Example
17534    /// ```ignore,no_run
17535    /// # use google_cloud_netapp_v1::model::CacheParameters;
17536    /// use google_cloud_netapp_v1::model::CacheConfig;
17537    /// let x = CacheParameters::new().set_or_clear_cache_config(Some(CacheConfig::default()/* use setters */));
17538    /// let x = CacheParameters::new().set_or_clear_cache_config(None::<CacheConfig>);
17539    /// ```
17540    pub fn set_or_clear_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
17541    where
17542        T: std::convert::Into<crate::model::CacheConfig>,
17543    {
17544        self.cache_config = v.map(|x| x.into());
17545        self
17546    }
17547
17548    /// Sets the value of [cache_state][crate::model::CacheParameters::cache_state].
17549    ///
17550    /// # Example
17551    /// ```ignore,no_run
17552    /// # use google_cloud_netapp_v1::model::CacheParameters;
17553    /// use google_cloud_netapp_v1::model::cache_parameters::CacheState;
17554    /// let x0 = CacheParameters::new().set_cache_state(CacheState::PendingClusterPeering);
17555    /// let x1 = CacheParameters::new().set_cache_state(CacheState::PendingSvmPeering);
17556    /// let x2 = CacheParameters::new().set_cache_state(CacheState::Peered);
17557    /// ```
17558    pub fn set_cache_state<T: std::convert::Into<crate::model::cache_parameters::CacheState>>(
17559        mut self,
17560        v: T,
17561    ) -> Self {
17562        self.cache_state = v.into();
17563        self
17564    }
17565
17566    /// Sets the value of [command][crate::model::CacheParameters::command].
17567    ///
17568    /// # Example
17569    /// ```ignore,no_run
17570    /// # use google_cloud_netapp_v1::model::CacheParameters;
17571    /// let x = CacheParameters::new().set_command("example");
17572    /// ```
17573    pub fn set_command<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17574        self.command = v.into();
17575        self
17576    }
17577
17578    /// Sets the value of [peering_command_expiry_time][crate::model::CacheParameters::peering_command_expiry_time].
17579    ///
17580    /// # Example
17581    /// ```ignore,no_run
17582    /// # use google_cloud_netapp_v1::model::CacheParameters;
17583    /// use wkt::Timestamp;
17584    /// let x = CacheParameters::new().set_peering_command_expiry_time(Timestamp::default()/* use setters */);
17585    /// ```
17586    pub fn set_peering_command_expiry_time<T>(mut self, v: T) -> Self
17587    where
17588        T: std::convert::Into<wkt::Timestamp>,
17589    {
17590        self.peering_command_expiry_time = std::option::Option::Some(v.into());
17591        self
17592    }
17593
17594    /// Sets or clears the value of [peering_command_expiry_time][crate::model::CacheParameters::peering_command_expiry_time].
17595    ///
17596    /// # Example
17597    /// ```ignore,no_run
17598    /// # use google_cloud_netapp_v1::model::CacheParameters;
17599    /// use wkt::Timestamp;
17600    /// let x = CacheParameters::new().set_or_clear_peering_command_expiry_time(Some(Timestamp::default()/* use setters */));
17601    /// let x = CacheParameters::new().set_or_clear_peering_command_expiry_time(None::<Timestamp>);
17602    /// ```
17603    pub fn set_or_clear_peering_command_expiry_time<T>(mut self, v: std::option::Option<T>) -> Self
17604    where
17605        T: std::convert::Into<wkt::Timestamp>,
17606    {
17607        self.peering_command_expiry_time = v.map(|x| x.into());
17608        self
17609    }
17610
17611    /// Sets the value of [passphrase][crate::model::CacheParameters::passphrase].
17612    ///
17613    /// # Example
17614    /// ```ignore,no_run
17615    /// # use google_cloud_netapp_v1::model::CacheParameters;
17616    /// let x = CacheParameters::new().set_passphrase("example");
17617    /// ```
17618    pub fn set_passphrase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17619        self.passphrase = v.into();
17620        self
17621    }
17622
17623    /// Sets the value of [state_details][crate::model::CacheParameters::state_details].
17624    ///
17625    /// # Example
17626    /// ```ignore,no_run
17627    /// # use google_cloud_netapp_v1::model::CacheParameters;
17628    /// let x = CacheParameters::new().set_state_details("example");
17629    /// ```
17630    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17631        self.state_details = v.into();
17632        self
17633    }
17634}
17635
17636impl wkt::message::Message for CacheParameters {
17637    fn typename() -> &'static str {
17638        "type.googleapis.com/google.cloud.netapp.v1.CacheParameters"
17639    }
17640}
17641
17642/// Defines additional types related to [CacheParameters].
17643pub mod cache_parameters {
17644    #[allow(unused_imports)]
17645    use super::*;
17646
17647    /// State of the cache volume indicating the peering status.
17648    ///
17649    /// # Working with unknown values
17650    ///
17651    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17652    /// additional enum variants at any time. Adding new variants is not considered
17653    /// a breaking change. Applications should write their code in anticipation of:
17654    ///
17655    /// - New values appearing in future releases of the client library, **and**
17656    /// - New values received dynamically, without application changes.
17657    ///
17658    /// Please consult the [Working with enums] section in the user guide for some
17659    /// guidelines.
17660    ///
17661    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17662    #[derive(Clone, Debug, PartialEq)]
17663    #[non_exhaustive]
17664    pub enum CacheState {
17665        /// Default unspecified state.
17666        Unspecified,
17667        /// State indicating waiting for cluster peering to be established.
17668        PendingClusterPeering,
17669        /// State indicating waiting for SVM peering to be established.
17670        PendingSvmPeering,
17671        /// State indicating successful establishment of peering with origin
17672        /// volumes's ONTAP cluster.
17673        Peered,
17674        /// Terminal state wherein peering with origin volume's ONTAP cluster
17675        /// has failed.
17676        Error,
17677        /// If set, the enum was initialized with an unknown value.
17678        ///
17679        /// Applications can examine the value using [CacheState::value] or
17680        /// [CacheState::name].
17681        UnknownValue(cache_state::UnknownValue),
17682    }
17683
17684    #[doc(hidden)]
17685    pub mod cache_state {
17686        #[allow(unused_imports)]
17687        use super::*;
17688        #[derive(Clone, Debug, PartialEq)]
17689        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17690    }
17691
17692    impl CacheState {
17693        /// Gets the enum value.
17694        ///
17695        /// Returns `None` if the enum contains an unknown value deserialized from
17696        /// the string representation of enums.
17697        pub fn value(&self) -> std::option::Option<i32> {
17698            match self {
17699                Self::Unspecified => std::option::Option::Some(0),
17700                Self::PendingClusterPeering => std::option::Option::Some(1),
17701                Self::PendingSvmPeering => std::option::Option::Some(2),
17702                Self::Peered => std::option::Option::Some(3),
17703                Self::Error => std::option::Option::Some(4),
17704                Self::UnknownValue(u) => u.0.value(),
17705            }
17706        }
17707
17708        /// Gets the enum value as a string.
17709        ///
17710        /// Returns `None` if the enum contains an unknown value deserialized from
17711        /// the integer representation of enums.
17712        pub fn name(&self) -> std::option::Option<&str> {
17713            match self {
17714                Self::Unspecified => std::option::Option::Some("CACHE_STATE_UNSPECIFIED"),
17715                Self::PendingClusterPeering => std::option::Option::Some("PENDING_CLUSTER_PEERING"),
17716                Self::PendingSvmPeering => std::option::Option::Some("PENDING_SVM_PEERING"),
17717                Self::Peered => std::option::Option::Some("PEERED"),
17718                Self::Error => std::option::Option::Some("ERROR"),
17719                Self::UnknownValue(u) => u.0.name(),
17720            }
17721        }
17722    }
17723
17724    impl std::default::Default for CacheState {
17725        fn default() -> Self {
17726            use std::convert::From;
17727            Self::from(0)
17728        }
17729    }
17730
17731    impl std::fmt::Display for CacheState {
17732        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17733            wkt::internal::display_enum(f, self.name(), self.value())
17734        }
17735    }
17736
17737    impl std::convert::From<i32> for CacheState {
17738        fn from(value: i32) -> Self {
17739            match value {
17740                0 => Self::Unspecified,
17741                1 => Self::PendingClusterPeering,
17742                2 => Self::PendingSvmPeering,
17743                3 => Self::Peered,
17744                4 => Self::Error,
17745                _ => Self::UnknownValue(cache_state::UnknownValue(
17746                    wkt::internal::UnknownEnumValue::Integer(value),
17747                )),
17748            }
17749        }
17750    }
17751
17752    impl std::convert::From<&str> for CacheState {
17753        fn from(value: &str) -> Self {
17754            use std::string::ToString;
17755            match value {
17756                "CACHE_STATE_UNSPECIFIED" => Self::Unspecified,
17757                "PENDING_CLUSTER_PEERING" => Self::PendingClusterPeering,
17758                "PENDING_SVM_PEERING" => Self::PendingSvmPeering,
17759                "PEERED" => Self::Peered,
17760                "ERROR" => Self::Error,
17761                _ => Self::UnknownValue(cache_state::UnknownValue(
17762                    wkt::internal::UnknownEnumValue::String(value.to_string()),
17763                )),
17764            }
17765        }
17766    }
17767
17768    impl serde::ser::Serialize for CacheState {
17769        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17770        where
17771            S: serde::Serializer,
17772        {
17773            match self {
17774                Self::Unspecified => serializer.serialize_i32(0),
17775                Self::PendingClusterPeering => serializer.serialize_i32(1),
17776                Self::PendingSvmPeering => serializer.serialize_i32(2),
17777                Self::Peered => serializer.serialize_i32(3),
17778                Self::Error => serializer.serialize_i32(4),
17779                Self::UnknownValue(u) => u.0.serialize(serializer),
17780            }
17781        }
17782    }
17783
17784    impl<'de> serde::de::Deserialize<'de> for CacheState {
17785        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17786        where
17787            D: serde::Deserializer<'de>,
17788        {
17789            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CacheState>::new(
17790                ".google.cloud.netapp.v1.CacheParameters.CacheState",
17791            ))
17792        }
17793    }
17794}
17795
17796/// Configuration of the cache volume.
17797#[derive(Clone, Default, PartialEq)]
17798#[non_exhaustive]
17799pub struct CacheConfig {
17800    /// Optional. Pre-populate cache volume with data from the origin volume.
17801    pub cache_pre_populate: std::option::Option<crate::model::CachePrePopulate>,
17802
17803    /// Optional. Flag indicating whether writeback is enabled for the FlexCache
17804    /// volume.
17805    pub writeback_enabled: std::option::Option<bool>,
17806
17807    /// Optional. Flag indicating whether a CIFS change notification is enabled for
17808    /// the FlexCache volume.
17809    pub cifs_change_notify_enabled: std::option::Option<bool>,
17810
17811    /// Output only. State of the prepopulation job indicating how the
17812    /// prepopulation is progressing.
17813    pub cache_pre_populate_state: crate::model::cache_config::CachePrePopulateState,
17814
17815    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17816}
17817
17818impl CacheConfig {
17819    /// Creates a new default instance.
17820    pub fn new() -> Self {
17821        std::default::Default::default()
17822    }
17823
17824    /// Sets the value of [cache_pre_populate][crate::model::CacheConfig::cache_pre_populate].
17825    ///
17826    /// # Example
17827    /// ```ignore,no_run
17828    /// # use google_cloud_netapp_v1::model::CacheConfig;
17829    /// use google_cloud_netapp_v1::model::CachePrePopulate;
17830    /// let x = CacheConfig::new().set_cache_pre_populate(CachePrePopulate::default()/* use setters */);
17831    /// ```
17832    pub fn set_cache_pre_populate<T>(mut self, v: T) -> Self
17833    where
17834        T: std::convert::Into<crate::model::CachePrePopulate>,
17835    {
17836        self.cache_pre_populate = std::option::Option::Some(v.into());
17837        self
17838    }
17839
17840    /// Sets or clears the value of [cache_pre_populate][crate::model::CacheConfig::cache_pre_populate].
17841    ///
17842    /// # Example
17843    /// ```ignore,no_run
17844    /// # use google_cloud_netapp_v1::model::CacheConfig;
17845    /// use google_cloud_netapp_v1::model::CachePrePopulate;
17846    /// let x = CacheConfig::new().set_or_clear_cache_pre_populate(Some(CachePrePopulate::default()/* use setters */));
17847    /// let x = CacheConfig::new().set_or_clear_cache_pre_populate(None::<CachePrePopulate>);
17848    /// ```
17849    pub fn set_or_clear_cache_pre_populate<T>(mut self, v: std::option::Option<T>) -> Self
17850    where
17851        T: std::convert::Into<crate::model::CachePrePopulate>,
17852    {
17853        self.cache_pre_populate = v.map(|x| x.into());
17854        self
17855    }
17856
17857    /// Sets the value of [writeback_enabled][crate::model::CacheConfig::writeback_enabled].
17858    ///
17859    /// # Example
17860    /// ```ignore,no_run
17861    /// # use google_cloud_netapp_v1::model::CacheConfig;
17862    /// let x = CacheConfig::new().set_writeback_enabled(true);
17863    /// ```
17864    pub fn set_writeback_enabled<T>(mut self, v: T) -> Self
17865    where
17866        T: std::convert::Into<bool>,
17867    {
17868        self.writeback_enabled = std::option::Option::Some(v.into());
17869        self
17870    }
17871
17872    /// Sets or clears the value of [writeback_enabled][crate::model::CacheConfig::writeback_enabled].
17873    ///
17874    /// # Example
17875    /// ```ignore,no_run
17876    /// # use google_cloud_netapp_v1::model::CacheConfig;
17877    /// let x = CacheConfig::new().set_or_clear_writeback_enabled(Some(false));
17878    /// let x = CacheConfig::new().set_or_clear_writeback_enabled(None::<bool>);
17879    /// ```
17880    pub fn set_or_clear_writeback_enabled<T>(mut self, v: std::option::Option<T>) -> Self
17881    where
17882        T: std::convert::Into<bool>,
17883    {
17884        self.writeback_enabled = v.map(|x| x.into());
17885        self
17886    }
17887
17888    /// Sets the value of [cifs_change_notify_enabled][crate::model::CacheConfig::cifs_change_notify_enabled].
17889    ///
17890    /// # Example
17891    /// ```ignore,no_run
17892    /// # use google_cloud_netapp_v1::model::CacheConfig;
17893    /// let x = CacheConfig::new().set_cifs_change_notify_enabled(true);
17894    /// ```
17895    pub fn set_cifs_change_notify_enabled<T>(mut self, v: T) -> Self
17896    where
17897        T: std::convert::Into<bool>,
17898    {
17899        self.cifs_change_notify_enabled = std::option::Option::Some(v.into());
17900        self
17901    }
17902
17903    /// Sets or clears the value of [cifs_change_notify_enabled][crate::model::CacheConfig::cifs_change_notify_enabled].
17904    ///
17905    /// # Example
17906    /// ```ignore,no_run
17907    /// # use google_cloud_netapp_v1::model::CacheConfig;
17908    /// let x = CacheConfig::new().set_or_clear_cifs_change_notify_enabled(Some(false));
17909    /// let x = CacheConfig::new().set_or_clear_cifs_change_notify_enabled(None::<bool>);
17910    /// ```
17911    pub fn set_or_clear_cifs_change_notify_enabled<T>(mut self, v: std::option::Option<T>) -> Self
17912    where
17913        T: std::convert::Into<bool>,
17914    {
17915        self.cifs_change_notify_enabled = v.map(|x| x.into());
17916        self
17917    }
17918
17919    /// Sets the value of [cache_pre_populate_state][crate::model::CacheConfig::cache_pre_populate_state].
17920    ///
17921    /// # Example
17922    /// ```ignore,no_run
17923    /// # use google_cloud_netapp_v1::model::CacheConfig;
17924    /// use google_cloud_netapp_v1::model::cache_config::CachePrePopulateState;
17925    /// let x0 = CacheConfig::new().set_cache_pre_populate_state(CachePrePopulateState::NotNeeded);
17926    /// let x1 = CacheConfig::new().set_cache_pre_populate_state(CachePrePopulateState::InProgress);
17927    /// let x2 = CacheConfig::new().set_cache_pre_populate_state(CachePrePopulateState::Complete);
17928    /// ```
17929    pub fn set_cache_pre_populate_state<
17930        T: std::convert::Into<crate::model::cache_config::CachePrePopulateState>,
17931    >(
17932        mut self,
17933        v: T,
17934    ) -> Self {
17935        self.cache_pre_populate_state = v.into();
17936        self
17937    }
17938}
17939
17940impl wkt::message::Message for CacheConfig {
17941    fn typename() -> &'static str {
17942        "type.googleapis.com/google.cloud.netapp.v1.CacheConfig"
17943    }
17944}
17945
17946/// Defines additional types related to [CacheConfig].
17947pub mod cache_config {
17948    #[allow(unused_imports)]
17949    use super::*;
17950
17951    /// State of the prepopulation job indicating how the prepopulation is
17952    /// progressing.
17953    ///
17954    /// # Working with unknown values
17955    ///
17956    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17957    /// additional enum variants at any time. Adding new variants is not considered
17958    /// a breaking change. Applications should write their code in anticipation of:
17959    ///
17960    /// - New values appearing in future releases of the client library, **and**
17961    /// - New values received dynamically, without application changes.
17962    ///
17963    /// Please consult the [Working with enums] section in the user guide for some
17964    /// guidelines.
17965    ///
17966    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
17967    #[derive(Clone, Debug, PartialEq)]
17968    #[non_exhaustive]
17969    pub enum CachePrePopulateState {
17970        /// Default unspecified state.
17971        Unspecified,
17972        /// State representing when the most recent create or update request did not
17973        /// require a prepopulation job.
17974        NotNeeded,
17975        /// State representing when the most recent update request requested a
17976        /// prepopulation job but it has not yet completed.
17977        InProgress,
17978        /// State representing when the most recent update request requested a
17979        /// prepopulation job and it has completed successfully.
17980        Complete,
17981        /// State representing when the most recent update request requested a
17982        /// prepopulation job but the prepopulate job failed.
17983        Error,
17984        /// If set, the enum was initialized with an unknown value.
17985        ///
17986        /// Applications can examine the value using [CachePrePopulateState::value] or
17987        /// [CachePrePopulateState::name].
17988        UnknownValue(cache_pre_populate_state::UnknownValue),
17989    }
17990
17991    #[doc(hidden)]
17992    pub mod cache_pre_populate_state {
17993        #[allow(unused_imports)]
17994        use super::*;
17995        #[derive(Clone, Debug, PartialEq)]
17996        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17997    }
17998
17999    impl CachePrePopulateState {
18000        /// Gets the enum value.
18001        ///
18002        /// Returns `None` if the enum contains an unknown value deserialized from
18003        /// the string representation of enums.
18004        pub fn value(&self) -> std::option::Option<i32> {
18005            match self {
18006                Self::Unspecified => std::option::Option::Some(0),
18007                Self::NotNeeded => std::option::Option::Some(1),
18008                Self::InProgress => std::option::Option::Some(2),
18009                Self::Complete => std::option::Option::Some(3),
18010                Self::Error => std::option::Option::Some(4),
18011                Self::UnknownValue(u) => u.0.value(),
18012            }
18013        }
18014
18015        /// Gets the enum value as a string.
18016        ///
18017        /// Returns `None` if the enum contains an unknown value deserialized from
18018        /// the integer representation of enums.
18019        pub fn name(&self) -> std::option::Option<&str> {
18020            match self {
18021                Self::Unspecified => {
18022                    std::option::Option::Some("CACHE_PRE_POPULATE_STATE_UNSPECIFIED")
18023                }
18024                Self::NotNeeded => std::option::Option::Some("NOT_NEEDED"),
18025                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
18026                Self::Complete => std::option::Option::Some("COMPLETE"),
18027                Self::Error => std::option::Option::Some("ERROR"),
18028                Self::UnknownValue(u) => u.0.name(),
18029            }
18030        }
18031    }
18032
18033    impl std::default::Default for CachePrePopulateState {
18034        fn default() -> Self {
18035            use std::convert::From;
18036            Self::from(0)
18037        }
18038    }
18039
18040    impl std::fmt::Display for CachePrePopulateState {
18041        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18042            wkt::internal::display_enum(f, self.name(), self.value())
18043        }
18044    }
18045
18046    impl std::convert::From<i32> for CachePrePopulateState {
18047        fn from(value: i32) -> Self {
18048            match value {
18049                0 => Self::Unspecified,
18050                1 => Self::NotNeeded,
18051                2 => Self::InProgress,
18052                3 => Self::Complete,
18053                4 => Self::Error,
18054                _ => Self::UnknownValue(cache_pre_populate_state::UnknownValue(
18055                    wkt::internal::UnknownEnumValue::Integer(value),
18056                )),
18057            }
18058        }
18059    }
18060
18061    impl std::convert::From<&str> for CachePrePopulateState {
18062        fn from(value: &str) -> Self {
18063            use std::string::ToString;
18064            match value {
18065                "CACHE_PRE_POPULATE_STATE_UNSPECIFIED" => Self::Unspecified,
18066                "NOT_NEEDED" => Self::NotNeeded,
18067                "IN_PROGRESS" => Self::InProgress,
18068                "COMPLETE" => Self::Complete,
18069                "ERROR" => Self::Error,
18070                _ => Self::UnknownValue(cache_pre_populate_state::UnknownValue(
18071                    wkt::internal::UnknownEnumValue::String(value.to_string()),
18072                )),
18073            }
18074        }
18075    }
18076
18077    impl serde::ser::Serialize for CachePrePopulateState {
18078        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18079        where
18080            S: serde::Serializer,
18081        {
18082            match self {
18083                Self::Unspecified => serializer.serialize_i32(0),
18084                Self::NotNeeded => serializer.serialize_i32(1),
18085                Self::InProgress => serializer.serialize_i32(2),
18086                Self::Complete => serializer.serialize_i32(3),
18087                Self::Error => serializer.serialize_i32(4),
18088                Self::UnknownValue(u) => u.0.serialize(serializer),
18089            }
18090        }
18091    }
18092
18093    impl<'de> serde::de::Deserialize<'de> for CachePrePopulateState {
18094        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18095        where
18096            D: serde::Deserializer<'de>,
18097        {
18098            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CachePrePopulateState>::new(
18099                ".google.cloud.netapp.v1.CacheConfig.CachePrePopulateState",
18100            ))
18101        }
18102    }
18103}
18104
18105/// Pre-populate cache volume with data from the origin volume.
18106#[derive(Clone, Default, PartialEq)]
18107#[non_exhaustive]
18108pub struct CachePrePopulate {
18109    /// Optional. List of directory-paths to be pre-populated for the FlexCache
18110    /// volume.
18111    pub path_list: std::vec::Vec<std::string::String>,
18112
18113    /// Optional. List of directory-paths to be excluded for pre-population for the
18114    /// FlexCache volume.
18115    pub exclude_path_list: std::vec::Vec<std::string::String>,
18116
18117    /// Optional. Flag indicating whether the directories listed with the
18118    /// `path_list` need to be recursively pre-populated.
18119    pub recursion: std::option::Option<bool>,
18120
18121    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18122}
18123
18124impl CachePrePopulate {
18125    /// Creates a new default instance.
18126    pub fn new() -> Self {
18127        std::default::Default::default()
18128    }
18129
18130    /// Sets the value of [path_list][crate::model::CachePrePopulate::path_list].
18131    ///
18132    /// # Example
18133    /// ```ignore,no_run
18134    /// # use google_cloud_netapp_v1::model::CachePrePopulate;
18135    /// let x = CachePrePopulate::new().set_path_list(["a", "b", "c"]);
18136    /// ```
18137    pub fn set_path_list<T, V>(mut self, v: T) -> Self
18138    where
18139        T: std::iter::IntoIterator<Item = V>,
18140        V: std::convert::Into<std::string::String>,
18141    {
18142        use std::iter::Iterator;
18143        self.path_list = v.into_iter().map(|i| i.into()).collect();
18144        self
18145    }
18146
18147    /// Sets the value of [exclude_path_list][crate::model::CachePrePopulate::exclude_path_list].
18148    ///
18149    /// # Example
18150    /// ```ignore,no_run
18151    /// # use google_cloud_netapp_v1::model::CachePrePopulate;
18152    /// let x = CachePrePopulate::new().set_exclude_path_list(["a", "b", "c"]);
18153    /// ```
18154    pub fn set_exclude_path_list<T, V>(mut self, v: T) -> Self
18155    where
18156        T: std::iter::IntoIterator<Item = V>,
18157        V: std::convert::Into<std::string::String>,
18158    {
18159        use std::iter::Iterator;
18160        self.exclude_path_list = v.into_iter().map(|i| i.into()).collect();
18161        self
18162    }
18163
18164    /// Sets the value of [recursion][crate::model::CachePrePopulate::recursion].
18165    ///
18166    /// # Example
18167    /// ```ignore,no_run
18168    /// # use google_cloud_netapp_v1::model::CachePrePopulate;
18169    /// let x = CachePrePopulate::new().set_recursion(true);
18170    /// ```
18171    pub fn set_recursion<T>(mut self, v: T) -> Self
18172    where
18173        T: std::convert::Into<bool>,
18174    {
18175        self.recursion = std::option::Option::Some(v.into());
18176        self
18177    }
18178
18179    /// Sets or clears the value of [recursion][crate::model::CachePrePopulate::recursion].
18180    ///
18181    /// # Example
18182    /// ```ignore,no_run
18183    /// # use google_cloud_netapp_v1::model::CachePrePopulate;
18184    /// let x = CachePrePopulate::new().set_or_clear_recursion(Some(false));
18185    /// let x = CachePrePopulate::new().set_or_clear_recursion(None::<bool>);
18186    /// ```
18187    pub fn set_or_clear_recursion<T>(mut self, v: std::option::Option<T>) -> Self
18188    where
18189        T: std::convert::Into<bool>,
18190    {
18191        self.recursion = v.map(|x| x.into());
18192        self
18193    }
18194}
18195
18196impl wkt::message::Message for CachePrePopulate {
18197    fn typename() -> &'static str {
18198        "type.googleapis.com/google.cloud.netapp.v1.CachePrePopulate"
18199    }
18200}
18201
18202/// Block device represents the device(s) which are stored in the block volume.
18203#[derive(Clone, Default, PartialEq)]
18204#[non_exhaustive]
18205pub struct BlockDevice {
18206    /// Optional. User-defined name for the block device, unique within the volume.
18207    /// In case no user input is provided, name will be auto-generated in the
18208    /// backend. The name must meet the following requirements:
18209    ///
18210    /// * Be between 1 and 255 characters long.
18211    /// * Contain only uppercase or lowercase letters (A-Z, a-z), numbers (0-9),
18212    ///   and the following special characters: "-", "_", "}", "{", ".".
18213    /// * Spaces are not allowed.
18214    pub name: std::option::Option<std::string::String>,
18215
18216    /// Optional. A list of host groups that identify hosts that can mount the
18217    /// block volume. Format:
18218    /// `projects/{project_id}/locations/{location}/hostGroups/{host_group_id}`
18219    /// This field can be updated after the block device is created.
18220    pub host_groups: std::vec::Vec<std::string::String>,
18221
18222    /// Output only. Device identifier of the block volume. This represents
18223    /// `lun_serial_number` for iSCSI volumes.
18224    pub identifier: std::string::String,
18225
18226    /// Optional. The size of the block device in GiB.
18227    /// Any value provided for the `size_gib` field during volume creation is
18228    /// ignored. The block device's size is system-managed and will be set to match
18229    /// the parent Volume's `capacity_gib`.
18230    pub size_gib: std::option::Option<i64>,
18231
18232    /// Required. Immutable. The OS type of the volume.
18233    /// This field can't be changed after the block device is created.
18234    pub os_type: crate::model::OsType,
18235
18236    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18237}
18238
18239impl BlockDevice {
18240    /// Creates a new default instance.
18241    pub fn new() -> Self {
18242        std::default::Default::default()
18243    }
18244
18245    /// Sets the value of [name][crate::model::BlockDevice::name].
18246    ///
18247    /// # Example
18248    /// ```ignore,no_run
18249    /// # use google_cloud_netapp_v1::model::BlockDevice;
18250    /// let x = BlockDevice::new().set_name("example");
18251    /// ```
18252    pub fn set_name<T>(mut self, v: T) -> Self
18253    where
18254        T: std::convert::Into<std::string::String>,
18255    {
18256        self.name = std::option::Option::Some(v.into());
18257        self
18258    }
18259
18260    /// Sets or clears the value of [name][crate::model::BlockDevice::name].
18261    ///
18262    /// # Example
18263    /// ```ignore,no_run
18264    /// # use google_cloud_netapp_v1::model::BlockDevice;
18265    /// let x = BlockDevice::new().set_or_clear_name(Some("example"));
18266    /// let x = BlockDevice::new().set_or_clear_name(None::<String>);
18267    /// ```
18268    pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
18269    where
18270        T: std::convert::Into<std::string::String>,
18271    {
18272        self.name = v.map(|x| x.into());
18273        self
18274    }
18275
18276    /// Sets the value of [host_groups][crate::model::BlockDevice::host_groups].
18277    ///
18278    /// # Example
18279    /// ```ignore,no_run
18280    /// # use google_cloud_netapp_v1::model::BlockDevice;
18281    /// let x = BlockDevice::new().set_host_groups(["a", "b", "c"]);
18282    /// ```
18283    pub fn set_host_groups<T, V>(mut self, v: T) -> Self
18284    where
18285        T: std::iter::IntoIterator<Item = V>,
18286        V: std::convert::Into<std::string::String>,
18287    {
18288        use std::iter::Iterator;
18289        self.host_groups = v.into_iter().map(|i| i.into()).collect();
18290        self
18291    }
18292
18293    /// Sets the value of [identifier][crate::model::BlockDevice::identifier].
18294    ///
18295    /// # Example
18296    /// ```ignore,no_run
18297    /// # use google_cloud_netapp_v1::model::BlockDevice;
18298    /// let x = BlockDevice::new().set_identifier("example");
18299    /// ```
18300    pub fn set_identifier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18301        self.identifier = v.into();
18302        self
18303    }
18304
18305    /// Sets the value of [size_gib][crate::model::BlockDevice::size_gib].
18306    ///
18307    /// # Example
18308    /// ```ignore,no_run
18309    /// # use google_cloud_netapp_v1::model::BlockDevice;
18310    /// let x = BlockDevice::new().set_size_gib(42);
18311    /// ```
18312    pub fn set_size_gib<T>(mut self, v: T) -> Self
18313    where
18314        T: std::convert::Into<i64>,
18315    {
18316        self.size_gib = std::option::Option::Some(v.into());
18317        self
18318    }
18319
18320    /// Sets or clears the value of [size_gib][crate::model::BlockDevice::size_gib].
18321    ///
18322    /// # Example
18323    /// ```ignore,no_run
18324    /// # use google_cloud_netapp_v1::model::BlockDevice;
18325    /// let x = BlockDevice::new().set_or_clear_size_gib(Some(42));
18326    /// let x = BlockDevice::new().set_or_clear_size_gib(None::<i32>);
18327    /// ```
18328    pub fn set_or_clear_size_gib<T>(mut self, v: std::option::Option<T>) -> Self
18329    where
18330        T: std::convert::Into<i64>,
18331    {
18332        self.size_gib = v.map(|x| x.into());
18333        self
18334    }
18335
18336    /// Sets the value of [os_type][crate::model::BlockDevice::os_type].
18337    ///
18338    /// # Example
18339    /// ```ignore,no_run
18340    /// # use google_cloud_netapp_v1::model::BlockDevice;
18341    /// use google_cloud_netapp_v1::model::OsType;
18342    /// let x0 = BlockDevice::new().set_os_type(OsType::Linux);
18343    /// let x1 = BlockDevice::new().set_os_type(OsType::Windows);
18344    /// let x2 = BlockDevice::new().set_os_type(OsType::Esxi);
18345    /// ```
18346    pub fn set_os_type<T: std::convert::Into<crate::model::OsType>>(mut self, v: T) -> Self {
18347        self.os_type = v.into();
18348        self
18349    }
18350}
18351
18352impl wkt::message::Message for BlockDevice {
18353    fn typename() -> &'static str {
18354        "type.googleapis.com/google.cloud.netapp.v1.BlockDevice"
18355    }
18356}
18357
18358/// RestoreBackupFilesRequest restores files from a backup to a volume.
18359#[derive(Clone, Default, PartialEq)]
18360#[non_exhaustive]
18361pub struct RestoreBackupFilesRequest {
18362    /// Required. The volume resource name, in the format
18363    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
18364    pub name: std::string::String,
18365
18366    /// Required. The backup resource name, in the format
18367    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
18368    pub backup: std::string::String,
18369
18370    /// Required. List of files to be restored, specified by their absolute path in
18371    /// the source volume.
18372    pub file_list: std::vec::Vec<std::string::String>,
18373
18374    /// Optional. Absolute directory path in the destination volume. This is
18375    /// required if the `file_list` is provided.
18376    pub restore_destination_path: std::string::String,
18377
18378    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18379}
18380
18381impl RestoreBackupFilesRequest {
18382    /// Creates a new default instance.
18383    pub fn new() -> Self {
18384        std::default::Default::default()
18385    }
18386
18387    /// Sets the value of [name][crate::model::RestoreBackupFilesRequest::name].
18388    ///
18389    /// # Example
18390    /// ```ignore,no_run
18391    /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
18392    /// # let project_id = "project_id";
18393    /// # let location_id = "location_id";
18394    /// # let volume_id = "volume_id";
18395    /// let x = RestoreBackupFilesRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
18396    /// ```
18397    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18398        self.name = v.into();
18399        self
18400    }
18401
18402    /// Sets the value of [backup][crate::model::RestoreBackupFilesRequest::backup].
18403    ///
18404    /// # Example
18405    /// ```ignore,no_run
18406    /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
18407    /// # let project_id = "project_id";
18408    /// # let location_id = "location_id";
18409    /// # let backup_vault_id = "backup_vault_id";
18410    /// # let backup_id = "backup_id";
18411    /// let x = RestoreBackupFilesRequest::new().set_backup(format!("projects/{project_id}/locations/{location_id}/backupVaults/{backup_vault_id}/backups/{backup_id}"));
18412    /// ```
18413    pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18414        self.backup = v.into();
18415        self
18416    }
18417
18418    /// Sets the value of [file_list][crate::model::RestoreBackupFilesRequest::file_list].
18419    ///
18420    /// # Example
18421    /// ```ignore,no_run
18422    /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
18423    /// let x = RestoreBackupFilesRequest::new().set_file_list(["a", "b", "c"]);
18424    /// ```
18425    pub fn set_file_list<T, V>(mut self, v: T) -> Self
18426    where
18427        T: std::iter::IntoIterator<Item = V>,
18428        V: std::convert::Into<std::string::String>,
18429    {
18430        use std::iter::Iterator;
18431        self.file_list = v.into_iter().map(|i| i.into()).collect();
18432        self
18433    }
18434
18435    /// Sets the value of [restore_destination_path][crate::model::RestoreBackupFilesRequest::restore_destination_path].
18436    ///
18437    /// # Example
18438    /// ```ignore,no_run
18439    /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
18440    /// let x = RestoreBackupFilesRequest::new().set_restore_destination_path("example");
18441    /// ```
18442    pub fn set_restore_destination_path<T: std::convert::Into<std::string::String>>(
18443        mut self,
18444        v: T,
18445    ) -> Self {
18446        self.restore_destination_path = v.into();
18447        self
18448    }
18449}
18450
18451impl wkt::message::Message for RestoreBackupFilesRequest {
18452    fn typename() -> &'static str {
18453        "type.googleapis.com/google.cloud.netapp.v1.RestoreBackupFilesRequest"
18454    }
18455}
18456
18457/// RestoreBackupFilesResponse is the result of RestoreBackupFilesRequest.
18458#[derive(Clone, Default, PartialEq)]
18459#[non_exhaustive]
18460pub struct RestoreBackupFilesResponse {
18461    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18462}
18463
18464impl RestoreBackupFilesResponse {
18465    /// Creates a new default instance.
18466    pub fn new() -> Self {
18467        std::default::Default::default()
18468    }
18469}
18470
18471impl wkt::message::Message for RestoreBackupFilesResponse {
18472    fn typename() -> &'static str {
18473        "type.googleapis.com/google.cloud.netapp.v1.RestoreBackupFilesResponse"
18474    }
18475}
18476
18477/// EstablishVolumePeeringRequest establishes cluster and svm peerings between
18478/// the source and destination clusters.
18479#[derive(Clone, Default, PartialEq)]
18480#[non_exhaustive]
18481pub struct EstablishVolumePeeringRequest {
18482    /// Required. The volume resource name, in the format
18483    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
18484    pub name: std::string::String,
18485
18486    /// Required. Name of the user's local source cluster to be peered with the
18487    /// destination cluster.
18488    pub peer_cluster_name: std::string::String,
18489
18490    /// Required. Name of the user's local source vserver svm to be peered with the
18491    /// destination vserver svm.
18492    pub peer_svm_name: std::string::String,
18493
18494    /// Optional. List of IPv4 ip addresses to be used for peering.
18495    pub peer_ip_addresses: std::vec::Vec<std::string::String>,
18496
18497    /// Required. Name of the user's local source volume to be peered with the
18498    /// destination volume.
18499    pub peer_volume_name: std::string::String,
18500
18501    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
18502}
18503
18504impl EstablishVolumePeeringRequest {
18505    /// Creates a new default instance.
18506    pub fn new() -> Self {
18507        std::default::Default::default()
18508    }
18509
18510    /// Sets the value of [name][crate::model::EstablishVolumePeeringRequest::name].
18511    ///
18512    /// # Example
18513    /// ```ignore,no_run
18514    /// # use google_cloud_netapp_v1::model::EstablishVolumePeeringRequest;
18515    /// # let project_id = "project_id";
18516    /// # let location_id = "location_id";
18517    /// # let volume_id = "volume_id";
18518    /// let x = EstablishVolumePeeringRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/volumes/{volume_id}"));
18519    /// ```
18520    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18521        self.name = v.into();
18522        self
18523    }
18524
18525    /// Sets the value of [peer_cluster_name][crate::model::EstablishVolumePeeringRequest::peer_cluster_name].
18526    ///
18527    /// # Example
18528    /// ```ignore,no_run
18529    /// # use google_cloud_netapp_v1::model::EstablishVolumePeeringRequest;
18530    /// let x = EstablishVolumePeeringRequest::new().set_peer_cluster_name("example");
18531    /// ```
18532    pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
18533        mut self,
18534        v: T,
18535    ) -> Self {
18536        self.peer_cluster_name = v.into();
18537        self
18538    }
18539
18540    /// Sets the value of [peer_svm_name][crate::model::EstablishVolumePeeringRequest::peer_svm_name].
18541    ///
18542    /// # Example
18543    /// ```ignore,no_run
18544    /// # use google_cloud_netapp_v1::model::EstablishVolumePeeringRequest;
18545    /// let x = EstablishVolumePeeringRequest::new().set_peer_svm_name("example");
18546    /// ```
18547    pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
18548        self.peer_svm_name = v.into();
18549        self
18550    }
18551
18552    /// Sets the value of [peer_ip_addresses][crate::model::EstablishVolumePeeringRequest::peer_ip_addresses].
18553    ///
18554    /// # Example
18555    /// ```ignore,no_run
18556    /// # use google_cloud_netapp_v1::model::EstablishVolumePeeringRequest;
18557    /// let x = EstablishVolumePeeringRequest::new().set_peer_ip_addresses(["a", "b", "c"]);
18558    /// ```
18559    pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
18560    where
18561        T: std::iter::IntoIterator<Item = V>,
18562        V: std::convert::Into<std::string::String>,
18563    {
18564        use std::iter::Iterator;
18565        self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
18566        self
18567    }
18568
18569    /// Sets the value of [peer_volume_name][crate::model::EstablishVolumePeeringRequest::peer_volume_name].
18570    ///
18571    /// # Example
18572    /// ```ignore,no_run
18573    /// # use google_cloud_netapp_v1::model::EstablishVolumePeeringRequest;
18574    /// let x = EstablishVolumePeeringRequest::new().set_peer_volume_name("example");
18575    /// ```
18576    pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
18577        mut self,
18578        v: T,
18579    ) -> Self {
18580        self.peer_volume_name = v.into();
18581        self
18582    }
18583}
18584
18585impl wkt::message::Message for EstablishVolumePeeringRequest {
18586    fn typename() -> &'static str {
18587        "type.googleapis.com/google.cloud.netapp.v1.EstablishVolumePeeringRequest"
18588    }
18589}
18590
18591/// The service level of a storage pool and its volumes.
18592///
18593/// # Working with unknown values
18594///
18595/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18596/// additional enum variants at any time. Adding new variants is not considered
18597/// a breaking change. Applications should write their code in anticipation of:
18598///
18599/// - New values appearing in future releases of the client library, **and**
18600/// - New values received dynamically, without application changes.
18601///
18602/// Please consult the [Working with enums] section in the user guide for some
18603/// guidelines.
18604///
18605/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18606#[derive(Clone, Debug, PartialEq)]
18607#[non_exhaustive]
18608pub enum ServiceLevel {
18609    /// Unspecified service level.
18610    Unspecified,
18611    /// Premium service level.
18612    Premium,
18613    /// Extreme service level.
18614    Extreme,
18615    /// Standard service level.
18616    Standard,
18617    /// Flex service level.
18618    Flex,
18619    /// If set, the enum was initialized with an unknown value.
18620    ///
18621    /// Applications can examine the value using [ServiceLevel::value] or
18622    /// [ServiceLevel::name].
18623    UnknownValue(service_level::UnknownValue),
18624}
18625
18626#[doc(hidden)]
18627pub mod service_level {
18628    #[allow(unused_imports)]
18629    use super::*;
18630    #[derive(Clone, Debug, PartialEq)]
18631    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18632}
18633
18634impl ServiceLevel {
18635    /// Gets the enum value.
18636    ///
18637    /// Returns `None` if the enum contains an unknown value deserialized from
18638    /// the string representation of enums.
18639    pub fn value(&self) -> std::option::Option<i32> {
18640        match self {
18641            Self::Unspecified => std::option::Option::Some(0),
18642            Self::Premium => std::option::Option::Some(1),
18643            Self::Extreme => std::option::Option::Some(2),
18644            Self::Standard => std::option::Option::Some(3),
18645            Self::Flex => std::option::Option::Some(4),
18646            Self::UnknownValue(u) => u.0.value(),
18647        }
18648    }
18649
18650    /// Gets the enum value as a string.
18651    ///
18652    /// Returns `None` if the enum contains an unknown value deserialized from
18653    /// the integer representation of enums.
18654    pub fn name(&self) -> std::option::Option<&str> {
18655        match self {
18656            Self::Unspecified => std::option::Option::Some("SERVICE_LEVEL_UNSPECIFIED"),
18657            Self::Premium => std::option::Option::Some("PREMIUM"),
18658            Self::Extreme => std::option::Option::Some("EXTREME"),
18659            Self::Standard => std::option::Option::Some("STANDARD"),
18660            Self::Flex => std::option::Option::Some("FLEX"),
18661            Self::UnknownValue(u) => u.0.name(),
18662        }
18663    }
18664}
18665
18666impl std::default::Default for ServiceLevel {
18667    fn default() -> Self {
18668        use std::convert::From;
18669        Self::from(0)
18670    }
18671}
18672
18673impl std::fmt::Display for ServiceLevel {
18674    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18675        wkt::internal::display_enum(f, self.name(), self.value())
18676    }
18677}
18678
18679impl std::convert::From<i32> for ServiceLevel {
18680    fn from(value: i32) -> Self {
18681        match value {
18682            0 => Self::Unspecified,
18683            1 => Self::Premium,
18684            2 => Self::Extreme,
18685            3 => Self::Standard,
18686            4 => Self::Flex,
18687            _ => Self::UnknownValue(service_level::UnknownValue(
18688                wkt::internal::UnknownEnumValue::Integer(value),
18689            )),
18690        }
18691    }
18692}
18693
18694impl std::convert::From<&str> for ServiceLevel {
18695    fn from(value: &str) -> Self {
18696        use std::string::ToString;
18697        match value {
18698            "SERVICE_LEVEL_UNSPECIFIED" => Self::Unspecified,
18699            "PREMIUM" => Self::Premium,
18700            "EXTREME" => Self::Extreme,
18701            "STANDARD" => Self::Standard,
18702            "FLEX" => Self::Flex,
18703            _ => Self::UnknownValue(service_level::UnknownValue(
18704                wkt::internal::UnknownEnumValue::String(value.to_string()),
18705            )),
18706        }
18707    }
18708}
18709
18710impl serde::ser::Serialize for ServiceLevel {
18711    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18712    where
18713        S: serde::Serializer,
18714    {
18715        match self {
18716            Self::Unspecified => serializer.serialize_i32(0),
18717            Self::Premium => serializer.serialize_i32(1),
18718            Self::Extreme => serializer.serialize_i32(2),
18719            Self::Standard => serializer.serialize_i32(3),
18720            Self::Flex => serializer.serialize_i32(4),
18721            Self::UnknownValue(u) => u.0.serialize(serializer),
18722        }
18723    }
18724}
18725
18726impl<'de> serde::de::Deserialize<'de> for ServiceLevel {
18727    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18728    where
18729        D: serde::Deserializer<'de>,
18730    {
18731        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ServiceLevel>::new(
18732            ".google.cloud.netapp.v1.ServiceLevel",
18733        ))
18734    }
18735}
18736
18737/// Flex Storage Pool performance.
18738///
18739/// # Working with unknown values
18740///
18741/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18742/// additional enum variants at any time. Adding new variants is not considered
18743/// a breaking change. Applications should write their code in anticipation of:
18744///
18745/// - New values appearing in future releases of the client library, **and**
18746/// - New values received dynamically, without application changes.
18747///
18748/// Please consult the [Working with enums] section in the user guide for some
18749/// guidelines.
18750///
18751/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18752#[derive(Clone, Debug, PartialEq)]
18753#[non_exhaustive]
18754pub enum FlexPerformance {
18755    /// Unspecified flex performance.
18756    Unspecified,
18757    /// Flex Storage Pool with default performance.
18758    Default,
18759    /// Flex Storage Pool with custom performance.
18760    Custom,
18761    /// If set, the enum was initialized with an unknown value.
18762    ///
18763    /// Applications can examine the value using [FlexPerformance::value] or
18764    /// [FlexPerformance::name].
18765    UnknownValue(flex_performance::UnknownValue),
18766}
18767
18768#[doc(hidden)]
18769pub mod flex_performance {
18770    #[allow(unused_imports)]
18771    use super::*;
18772    #[derive(Clone, Debug, PartialEq)]
18773    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18774}
18775
18776impl FlexPerformance {
18777    /// Gets the enum value.
18778    ///
18779    /// Returns `None` if the enum contains an unknown value deserialized from
18780    /// the string representation of enums.
18781    pub fn value(&self) -> std::option::Option<i32> {
18782        match self {
18783            Self::Unspecified => std::option::Option::Some(0),
18784            Self::Default => std::option::Option::Some(1),
18785            Self::Custom => std::option::Option::Some(2),
18786            Self::UnknownValue(u) => u.0.value(),
18787        }
18788    }
18789
18790    /// Gets the enum value as a string.
18791    ///
18792    /// Returns `None` if the enum contains an unknown value deserialized from
18793    /// the integer representation of enums.
18794    pub fn name(&self) -> std::option::Option<&str> {
18795        match self {
18796            Self::Unspecified => std::option::Option::Some("FLEX_PERFORMANCE_UNSPECIFIED"),
18797            Self::Default => std::option::Option::Some("FLEX_PERFORMANCE_DEFAULT"),
18798            Self::Custom => std::option::Option::Some("FLEX_PERFORMANCE_CUSTOM"),
18799            Self::UnknownValue(u) => u.0.name(),
18800        }
18801    }
18802}
18803
18804impl std::default::Default for FlexPerformance {
18805    fn default() -> Self {
18806        use std::convert::From;
18807        Self::from(0)
18808    }
18809}
18810
18811impl std::fmt::Display for FlexPerformance {
18812    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18813        wkt::internal::display_enum(f, self.name(), self.value())
18814    }
18815}
18816
18817impl std::convert::From<i32> for FlexPerformance {
18818    fn from(value: i32) -> Self {
18819        match value {
18820            0 => Self::Unspecified,
18821            1 => Self::Default,
18822            2 => Self::Custom,
18823            _ => Self::UnknownValue(flex_performance::UnknownValue(
18824                wkt::internal::UnknownEnumValue::Integer(value),
18825            )),
18826        }
18827    }
18828}
18829
18830impl std::convert::From<&str> for FlexPerformance {
18831    fn from(value: &str) -> Self {
18832        use std::string::ToString;
18833        match value {
18834            "FLEX_PERFORMANCE_UNSPECIFIED" => Self::Unspecified,
18835            "FLEX_PERFORMANCE_DEFAULT" => Self::Default,
18836            "FLEX_PERFORMANCE_CUSTOM" => Self::Custom,
18837            _ => Self::UnknownValue(flex_performance::UnknownValue(
18838                wkt::internal::UnknownEnumValue::String(value.to_string()),
18839            )),
18840        }
18841    }
18842}
18843
18844impl serde::ser::Serialize for FlexPerformance {
18845    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18846    where
18847        S: serde::Serializer,
18848    {
18849        match self {
18850            Self::Unspecified => serializer.serialize_i32(0),
18851            Self::Default => serializer.serialize_i32(1),
18852            Self::Custom => serializer.serialize_i32(2),
18853            Self::UnknownValue(u) => u.0.serialize(serializer),
18854        }
18855    }
18856}
18857
18858impl<'de> serde::de::Deserialize<'de> for FlexPerformance {
18859    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18860    where
18861        D: serde::Deserializer<'de>,
18862    {
18863        deserializer.deserialize_any(wkt::internal::EnumVisitor::<FlexPerformance>::new(
18864            ".google.cloud.netapp.v1.FlexPerformance",
18865        ))
18866    }
18867}
18868
18869/// The volume encryption key source.
18870///
18871/// # Working with unknown values
18872///
18873/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18874/// additional enum variants at any time. Adding new variants is not considered
18875/// a breaking change. Applications should write their code in anticipation of:
18876///
18877/// - New values appearing in future releases of the client library, **and**
18878/// - New values received dynamically, without application changes.
18879///
18880/// Please consult the [Working with enums] section in the user guide for some
18881/// guidelines.
18882///
18883/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
18884#[derive(Clone, Debug, PartialEq)]
18885#[non_exhaustive]
18886pub enum EncryptionType {
18887    /// The source of the encryption key is not specified.
18888    Unspecified,
18889    /// Google managed encryption key.
18890    ServiceManaged,
18891    /// Customer managed encryption key, which is stored in KMS.
18892    CloudKms,
18893    /// If set, the enum was initialized with an unknown value.
18894    ///
18895    /// Applications can examine the value using [EncryptionType::value] or
18896    /// [EncryptionType::name].
18897    UnknownValue(encryption_type::UnknownValue),
18898}
18899
18900#[doc(hidden)]
18901pub mod encryption_type {
18902    #[allow(unused_imports)]
18903    use super::*;
18904    #[derive(Clone, Debug, PartialEq)]
18905    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18906}
18907
18908impl EncryptionType {
18909    /// Gets the enum value.
18910    ///
18911    /// Returns `None` if the enum contains an unknown value deserialized from
18912    /// the string representation of enums.
18913    pub fn value(&self) -> std::option::Option<i32> {
18914        match self {
18915            Self::Unspecified => std::option::Option::Some(0),
18916            Self::ServiceManaged => std::option::Option::Some(1),
18917            Self::CloudKms => std::option::Option::Some(2),
18918            Self::UnknownValue(u) => u.0.value(),
18919        }
18920    }
18921
18922    /// Gets the enum value as a string.
18923    ///
18924    /// Returns `None` if the enum contains an unknown value deserialized from
18925    /// the integer representation of enums.
18926    pub fn name(&self) -> std::option::Option<&str> {
18927        match self {
18928            Self::Unspecified => std::option::Option::Some("ENCRYPTION_TYPE_UNSPECIFIED"),
18929            Self::ServiceManaged => std::option::Option::Some("SERVICE_MANAGED"),
18930            Self::CloudKms => std::option::Option::Some("CLOUD_KMS"),
18931            Self::UnknownValue(u) => u.0.name(),
18932        }
18933    }
18934}
18935
18936impl std::default::Default for EncryptionType {
18937    fn default() -> Self {
18938        use std::convert::From;
18939        Self::from(0)
18940    }
18941}
18942
18943impl std::fmt::Display for EncryptionType {
18944    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18945        wkt::internal::display_enum(f, self.name(), self.value())
18946    }
18947}
18948
18949impl std::convert::From<i32> for EncryptionType {
18950    fn from(value: i32) -> Self {
18951        match value {
18952            0 => Self::Unspecified,
18953            1 => Self::ServiceManaged,
18954            2 => Self::CloudKms,
18955            _ => Self::UnknownValue(encryption_type::UnknownValue(
18956                wkt::internal::UnknownEnumValue::Integer(value),
18957            )),
18958        }
18959    }
18960}
18961
18962impl std::convert::From<&str> for EncryptionType {
18963    fn from(value: &str) -> Self {
18964        use std::string::ToString;
18965        match value {
18966            "ENCRYPTION_TYPE_UNSPECIFIED" => Self::Unspecified,
18967            "SERVICE_MANAGED" => Self::ServiceManaged,
18968            "CLOUD_KMS" => Self::CloudKms,
18969            _ => Self::UnknownValue(encryption_type::UnknownValue(
18970                wkt::internal::UnknownEnumValue::String(value.to_string()),
18971            )),
18972        }
18973    }
18974}
18975
18976impl serde::ser::Serialize for EncryptionType {
18977    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18978    where
18979        S: serde::Serializer,
18980    {
18981        match self {
18982            Self::Unspecified => serializer.serialize_i32(0),
18983            Self::ServiceManaged => serializer.serialize_i32(1),
18984            Self::CloudKms => serializer.serialize_i32(2),
18985            Self::UnknownValue(u) => u.0.serialize(serializer),
18986        }
18987    }
18988}
18989
18990impl<'de> serde::de::Deserialize<'de> for EncryptionType {
18991    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18992    where
18993        D: serde::Deserializer<'de>,
18994    {
18995        deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionType>::new(
18996            ".google.cloud.netapp.v1.EncryptionType",
18997        ))
18998    }
18999}
19000
19001/// Type of directory service
19002///
19003/// # Working with unknown values
19004///
19005/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19006/// additional enum variants at any time. Adding new variants is not considered
19007/// a breaking change. Applications should write their code in anticipation of:
19008///
19009/// - New values appearing in future releases of the client library, **and**
19010/// - New values received dynamically, without application changes.
19011///
19012/// Please consult the [Working with enums] section in the user guide for some
19013/// guidelines.
19014///
19015/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19016#[derive(Clone, Debug, PartialEq)]
19017#[non_exhaustive]
19018pub enum DirectoryServiceType {
19019    /// Directory service type is not specified.
19020    Unspecified,
19021    /// Active directory policy attached to the storage pool.
19022    ActiveDirectory,
19023    /// If set, the enum was initialized with an unknown value.
19024    ///
19025    /// Applications can examine the value using [DirectoryServiceType::value] or
19026    /// [DirectoryServiceType::name].
19027    UnknownValue(directory_service_type::UnknownValue),
19028}
19029
19030#[doc(hidden)]
19031pub mod directory_service_type {
19032    #[allow(unused_imports)]
19033    use super::*;
19034    #[derive(Clone, Debug, PartialEq)]
19035    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19036}
19037
19038impl DirectoryServiceType {
19039    /// Gets the enum value.
19040    ///
19041    /// Returns `None` if the enum contains an unknown value deserialized from
19042    /// the string representation of enums.
19043    pub fn value(&self) -> std::option::Option<i32> {
19044        match self {
19045            Self::Unspecified => std::option::Option::Some(0),
19046            Self::ActiveDirectory => std::option::Option::Some(1),
19047            Self::UnknownValue(u) => u.0.value(),
19048        }
19049    }
19050
19051    /// Gets the enum value as a string.
19052    ///
19053    /// Returns `None` if the enum contains an unknown value deserialized from
19054    /// the integer representation of enums.
19055    pub fn name(&self) -> std::option::Option<&str> {
19056        match self {
19057            Self::Unspecified => std::option::Option::Some("DIRECTORY_SERVICE_TYPE_UNSPECIFIED"),
19058            Self::ActiveDirectory => std::option::Option::Some("ACTIVE_DIRECTORY"),
19059            Self::UnknownValue(u) => u.0.name(),
19060        }
19061    }
19062}
19063
19064impl std::default::Default for DirectoryServiceType {
19065    fn default() -> Self {
19066        use std::convert::From;
19067        Self::from(0)
19068    }
19069}
19070
19071impl std::fmt::Display for DirectoryServiceType {
19072    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19073        wkt::internal::display_enum(f, self.name(), self.value())
19074    }
19075}
19076
19077impl std::convert::From<i32> for DirectoryServiceType {
19078    fn from(value: i32) -> Self {
19079        match value {
19080            0 => Self::Unspecified,
19081            1 => Self::ActiveDirectory,
19082            _ => Self::UnknownValue(directory_service_type::UnknownValue(
19083                wkt::internal::UnknownEnumValue::Integer(value),
19084            )),
19085        }
19086    }
19087}
19088
19089impl std::convert::From<&str> for DirectoryServiceType {
19090    fn from(value: &str) -> Self {
19091        use std::string::ToString;
19092        match value {
19093            "DIRECTORY_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
19094            "ACTIVE_DIRECTORY" => Self::ActiveDirectory,
19095            _ => Self::UnknownValue(directory_service_type::UnknownValue(
19096                wkt::internal::UnknownEnumValue::String(value.to_string()),
19097            )),
19098        }
19099    }
19100}
19101
19102impl serde::ser::Serialize for DirectoryServiceType {
19103    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19104    where
19105        S: serde::Serializer,
19106    {
19107        match self {
19108            Self::Unspecified => serializer.serialize_i32(0),
19109            Self::ActiveDirectory => serializer.serialize_i32(1),
19110            Self::UnknownValue(u) => u.0.serialize(serializer),
19111        }
19112    }
19113}
19114
19115impl<'de> serde::de::Deserialize<'de> for DirectoryServiceType {
19116    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19117    where
19118        D: serde::Deserializer<'de>,
19119    {
19120        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DirectoryServiceType>::new(
19121            ".google.cloud.netapp.v1.DirectoryServiceType",
19122        ))
19123    }
19124}
19125
19126/// Type of storage pool
19127///
19128/// # Working with unknown values
19129///
19130/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19131/// additional enum variants at any time. Adding new variants is not considered
19132/// a breaking change. Applications should write their code in anticipation of:
19133///
19134/// - New values appearing in future releases of the client library, **and**
19135/// - New values received dynamically, without application changes.
19136///
19137/// Please consult the [Working with enums] section in the user guide for some
19138/// guidelines.
19139///
19140/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19141#[derive(Clone, Debug, PartialEq)]
19142#[non_exhaustive]
19143pub enum StoragePoolType {
19144    /// Storage pool type is not specified.
19145    Unspecified,
19146    /// Storage pool type is file.
19147    File,
19148    /// Storage pool type is unified.
19149    Unified,
19150    /// If set, the enum was initialized with an unknown value.
19151    ///
19152    /// Applications can examine the value using [StoragePoolType::value] or
19153    /// [StoragePoolType::name].
19154    UnknownValue(storage_pool_type::UnknownValue),
19155}
19156
19157#[doc(hidden)]
19158pub mod storage_pool_type {
19159    #[allow(unused_imports)]
19160    use super::*;
19161    #[derive(Clone, Debug, PartialEq)]
19162    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19163}
19164
19165impl StoragePoolType {
19166    /// Gets the enum value.
19167    ///
19168    /// Returns `None` if the enum contains an unknown value deserialized from
19169    /// the string representation of enums.
19170    pub fn value(&self) -> std::option::Option<i32> {
19171        match self {
19172            Self::Unspecified => std::option::Option::Some(0),
19173            Self::File => std::option::Option::Some(1),
19174            Self::Unified => std::option::Option::Some(2),
19175            Self::UnknownValue(u) => u.0.value(),
19176        }
19177    }
19178
19179    /// Gets the enum value as a string.
19180    ///
19181    /// Returns `None` if the enum contains an unknown value deserialized from
19182    /// the integer representation of enums.
19183    pub fn name(&self) -> std::option::Option<&str> {
19184        match self {
19185            Self::Unspecified => std::option::Option::Some("STORAGE_POOL_TYPE_UNSPECIFIED"),
19186            Self::File => std::option::Option::Some("FILE"),
19187            Self::Unified => std::option::Option::Some("UNIFIED"),
19188            Self::UnknownValue(u) => u.0.name(),
19189        }
19190    }
19191}
19192
19193impl std::default::Default for StoragePoolType {
19194    fn default() -> Self {
19195        use std::convert::From;
19196        Self::from(0)
19197    }
19198}
19199
19200impl std::fmt::Display for StoragePoolType {
19201    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19202        wkt::internal::display_enum(f, self.name(), self.value())
19203    }
19204}
19205
19206impl std::convert::From<i32> for StoragePoolType {
19207    fn from(value: i32) -> Self {
19208        match value {
19209            0 => Self::Unspecified,
19210            1 => Self::File,
19211            2 => Self::Unified,
19212            _ => Self::UnknownValue(storage_pool_type::UnknownValue(
19213                wkt::internal::UnknownEnumValue::Integer(value),
19214            )),
19215        }
19216    }
19217}
19218
19219impl std::convert::From<&str> for StoragePoolType {
19220    fn from(value: &str) -> Self {
19221        use std::string::ToString;
19222        match value {
19223            "STORAGE_POOL_TYPE_UNSPECIFIED" => Self::Unspecified,
19224            "FILE" => Self::File,
19225            "UNIFIED" => Self::Unified,
19226            _ => Self::UnknownValue(storage_pool_type::UnknownValue(
19227                wkt::internal::UnknownEnumValue::String(value.to_string()),
19228            )),
19229        }
19230    }
19231}
19232
19233impl serde::ser::Serialize for StoragePoolType {
19234    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19235    where
19236        S: serde::Serializer,
19237    {
19238        match self {
19239            Self::Unspecified => serializer.serialize_i32(0),
19240            Self::File => serializer.serialize_i32(1),
19241            Self::Unified => serializer.serialize_i32(2),
19242            Self::UnknownValue(u) => u.0.serialize(serializer),
19243        }
19244    }
19245}
19246
19247impl<'de> serde::de::Deserialize<'de> for StoragePoolType {
19248    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19249    where
19250        D: serde::Deserializer<'de>,
19251    {
19252        deserializer.deserialize_any(wkt::internal::EnumVisitor::<StoragePoolType>::new(
19253            ".google.cloud.netapp.v1.StoragePoolType",
19254        ))
19255    }
19256}
19257
19258/// Defines the scale-type of a UNIFIED Storage Pool.
19259///
19260/// # Working with unknown values
19261///
19262/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19263/// additional enum variants at any time. Adding new variants is not considered
19264/// a breaking change. Applications should write their code in anticipation of:
19265///
19266/// - New values appearing in future releases of the client library, **and**
19267/// - New values received dynamically, without application changes.
19268///
19269/// Please consult the [Working with enums] section in the user guide for some
19270/// guidelines.
19271///
19272/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19273#[derive(Clone, Debug, PartialEq)]
19274#[non_exhaustive]
19275pub enum ScaleType {
19276    /// Unspecified scale type.
19277    Unspecified,
19278    /// Represents standard capacity and performance scale-type.
19279    /// Suitable for general purpose workloads.
19280    Default,
19281    /// Represents higher capacity and performance scale-type.
19282    /// Suitable for more demanding workloads.
19283    Scaleout,
19284    /// If set, the enum was initialized with an unknown value.
19285    ///
19286    /// Applications can examine the value using [ScaleType::value] or
19287    /// [ScaleType::name].
19288    UnknownValue(scale_type::UnknownValue),
19289}
19290
19291#[doc(hidden)]
19292pub mod scale_type {
19293    #[allow(unused_imports)]
19294    use super::*;
19295    #[derive(Clone, Debug, PartialEq)]
19296    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19297}
19298
19299impl ScaleType {
19300    /// Gets the enum value.
19301    ///
19302    /// Returns `None` if the enum contains an unknown value deserialized from
19303    /// the string representation of enums.
19304    pub fn value(&self) -> std::option::Option<i32> {
19305        match self {
19306            Self::Unspecified => std::option::Option::Some(0),
19307            Self::Default => std::option::Option::Some(1),
19308            Self::Scaleout => std::option::Option::Some(2),
19309            Self::UnknownValue(u) => u.0.value(),
19310        }
19311    }
19312
19313    /// Gets the enum value as a string.
19314    ///
19315    /// Returns `None` if the enum contains an unknown value deserialized from
19316    /// the integer representation of enums.
19317    pub fn name(&self) -> std::option::Option<&str> {
19318        match self {
19319            Self::Unspecified => std::option::Option::Some("SCALE_TYPE_UNSPECIFIED"),
19320            Self::Default => std::option::Option::Some("SCALE_TYPE_DEFAULT"),
19321            Self::Scaleout => std::option::Option::Some("SCALE_TYPE_SCALEOUT"),
19322            Self::UnknownValue(u) => u.0.name(),
19323        }
19324    }
19325}
19326
19327impl std::default::Default for ScaleType {
19328    fn default() -> Self {
19329        use std::convert::From;
19330        Self::from(0)
19331    }
19332}
19333
19334impl std::fmt::Display for ScaleType {
19335    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19336        wkt::internal::display_enum(f, self.name(), self.value())
19337    }
19338}
19339
19340impl std::convert::From<i32> for ScaleType {
19341    fn from(value: i32) -> Self {
19342        match value {
19343            0 => Self::Unspecified,
19344            1 => Self::Default,
19345            2 => Self::Scaleout,
19346            _ => Self::UnknownValue(scale_type::UnknownValue(
19347                wkt::internal::UnknownEnumValue::Integer(value),
19348            )),
19349        }
19350    }
19351}
19352
19353impl std::convert::From<&str> for ScaleType {
19354    fn from(value: &str) -> Self {
19355        use std::string::ToString;
19356        match value {
19357            "SCALE_TYPE_UNSPECIFIED" => Self::Unspecified,
19358            "SCALE_TYPE_DEFAULT" => Self::Default,
19359            "SCALE_TYPE_SCALEOUT" => Self::Scaleout,
19360            _ => Self::UnknownValue(scale_type::UnknownValue(
19361                wkt::internal::UnknownEnumValue::String(value.to_string()),
19362            )),
19363        }
19364    }
19365}
19366
19367impl serde::ser::Serialize for ScaleType {
19368    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19369    where
19370        S: serde::Serializer,
19371    {
19372        match self {
19373            Self::Unspecified => serializer.serialize_i32(0),
19374            Self::Default => serializer.serialize_i32(1),
19375            Self::Scaleout => serializer.serialize_i32(2),
19376            Self::UnknownValue(u) => u.0.serialize(serializer),
19377        }
19378    }
19379}
19380
19381impl<'de> serde::de::Deserialize<'de> for ScaleType {
19382    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19383    where
19384        D: serde::Deserializer<'de>,
19385    {
19386        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ScaleType>::new(
19387            ".google.cloud.netapp.v1.ScaleType",
19388        ))
19389    }
19390}
19391
19392/// Schedule for Hybrid Replication.
19393/// New enum values may be added in future to support different frequency of
19394/// replication.
19395///
19396/// # Working with unknown values
19397///
19398/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19399/// additional enum variants at any time. Adding new variants is not considered
19400/// a breaking change. Applications should write their code in anticipation of:
19401///
19402/// - New values appearing in future releases of the client library, **and**
19403/// - New values received dynamically, without application changes.
19404///
19405/// Please consult the [Working with enums] section in the user guide for some
19406/// guidelines.
19407///
19408/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19409#[derive(Clone, Debug, PartialEq)]
19410#[non_exhaustive]
19411pub enum HybridReplicationSchedule {
19412    /// Unspecified HybridReplicationSchedule
19413    Unspecified,
19414    /// Replication happens once every 10 minutes.
19415    Every10Minutes,
19416    /// Replication happens once every hour.
19417    Hourly,
19418    /// Replication happens once every day.
19419    Daily,
19420    /// If set, the enum was initialized with an unknown value.
19421    ///
19422    /// Applications can examine the value using [HybridReplicationSchedule::value] or
19423    /// [HybridReplicationSchedule::name].
19424    UnknownValue(hybrid_replication_schedule::UnknownValue),
19425}
19426
19427#[doc(hidden)]
19428pub mod hybrid_replication_schedule {
19429    #[allow(unused_imports)]
19430    use super::*;
19431    #[derive(Clone, Debug, PartialEq)]
19432    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19433}
19434
19435impl HybridReplicationSchedule {
19436    /// Gets the enum value.
19437    ///
19438    /// Returns `None` if the enum contains an unknown value deserialized from
19439    /// the string representation of enums.
19440    pub fn value(&self) -> std::option::Option<i32> {
19441        match self {
19442            Self::Unspecified => std::option::Option::Some(0),
19443            Self::Every10Minutes => std::option::Option::Some(1),
19444            Self::Hourly => std::option::Option::Some(2),
19445            Self::Daily => std::option::Option::Some(3),
19446            Self::UnknownValue(u) => u.0.value(),
19447        }
19448    }
19449
19450    /// Gets the enum value as a string.
19451    ///
19452    /// Returns `None` if the enum contains an unknown value deserialized from
19453    /// the integer representation of enums.
19454    pub fn name(&self) -> std::option::Option<&str> {
19455        match self {
19456            Self::Unspecified => {
19457                std::option::Option::Some("HYBRID_REPLICATION_SCHEDULE_UNSPECIFIED")
19458            }
19459            Self::Every10Minutes => std::option::Option::Some("EVERY_10_MINUTES"),
19460            Self::Hourly => std::option::Option::Some("HOURLY"),
19461            Self::Daily => std::option::Option::Some("DAILY"),
19462            Self::UnknownValue(u) => u.0.name(),
19463        }
19464    }
19465}
19466
19467impl std::default::Default for HybridReplicationSchedule {
19468    fn default() -> Self {
19469        use std::convert::From;
19470        Self::from(0)
19471    }
19472}
19473
19474impl std::fmt::Display for HybridReplicationSchedule {
19475    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19476        wkt::internal::display_enum(f, self.name(), self.value())
19477    }
19478}
19479
19480impl std::convert::From<i32> for HybridReplicationSchedule {
19481    fn from(value: i32) -> Self {
19482        match value {
19483            0 => Self::Unspecified,
19484            1 => Self::Every10Minutes,
19485            2 => Self::Hourly,
19486            3 => Self::Daily,
19487            _ => Self::UnknownValue(hybrid_replication_schedule::UnknownValue(
19488                wkt::internal::UnknownEnumValue::Integer(value),
19489            )),
19490        }
19491    }
19492}
19493
19494impl std::convert::From<&str> for HybridReplicationSchedule {
19495    fn from(value: &str) -> Self {
19496        use std::string::ToString;
19497        match value {
19498            "HYBRID_REPLICATION_SCHEDULE_UNSPECIFIED" => Self::Unspecified,
19499            "EVERY_10_MINUTES" => Self::Every10Minutes,
19500            "HOURLY" => Self::Hourly,
19501            "DAILY" => Self::Daily,
19502            _ => Self::UnknownValue(hybrid_replication_schedule::UnknownValue(
19503                wkt::internal::UnknownEnumValue::String(value.to_string()),
19504            )),
19505        }
19506    }
19507}
19508
19509impl serde::ser::Serialize for HybridReplicationSchedule {
19510    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19511    where
19512        S: serde::Serializer,
19513    {
19514        match self {
19515            Self::Unspecified => serializer.serialize_i32(0),
19516            Self::Every10Minutes => serializer.serialize_i32(1),
19517            Self::Hourly => serializer.serialize_i32(2),
19518            Self::Daily => serializer.serialize_i32(3),
19519            Self::UnknownValue(u) => u.0.serialize(serializer),
19520        }
19521    }
19522}
19523
19524impl<'de> serde::de::Deserialize<'de> for HybridReplicationSchedule {
19525    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19526    where
19527        D: serde::Deserializer<'de>,
19528    {
19529        deserializer.deserialize_any(
19530            wkt::internal::EnumVisitor::<HybridReplicationSchedule>::new(
19531                ".google.cloud.netapp.v1.HybridReplicationSchedule",
19532            ),
19533        )
19534    }
19535}
19536
19537/// QoS (Quality of Service) Types of the storage pool
19538///
19539/// # Working with unknown values
19540///
19541/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19542/// additional enum variants at any time. Adding new variants is not considered
19543/// a breaking change. Applications should write their code in anticipation of:
19544///
19545/// - New values appearing in future releases of the client library, **and**
19546/// - New values received dynamically, without application changes.
19547///
19548/// Please consult the [Working with enums] section in the user guide for some
19549/// guidelines.
19550///
19551/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19552#[derive(Clone, Debug, PartialEq)]
19553#[non_exhaustive]
19554pub enum QosType {
19555    /// Unspecified QoS Type
19556    Unspecified,
19557    /// QoS Type is Auto
19558    Auto,
19559    /// QoS Type is Manual
19560    Manual,
19561    /// If set, the enum was initialized with an unknown value.
19562    ///
19563    /// Applications can examine the value using [QosType::value] or
19564    /// [QosType::name].
19565    UnknownValue(qos_type::UnknownValue),
19566}
19567
19568#[doc(hidden)]
19569pub mod qos_type {
19570    #[allow(unused_imports)]
19571    use super::*;
19572    #[derive(Clone, Debug, PartialEq)]
19573    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19574}
19575
19576impl QosType {
19577    /// Gets the enum value.
19578    ///
19579    /// Returns `None` if the enum contains an unknown value deserialized from
19580    /// the string representation of enums.
19581    pub fn value(&self) -> std::option::Option<i32> {
19582        match self {
19583            Self::Unspecified => std::option::Option::Some(0),
19584            Self::Auto => std::option::Option::Some(1),
19585            Self::Manual => std::option::Option::Some(2),
19586            Self::UnknownValue(u) => u.0.value(),
19587        }
19588    }
19589
19590    /// Gets the enum value as a string.
19591    ///
19592    /// Returns `None` if the enum contains an unknown value deserialized from
19593    /// the integer representation of enums.
19594    pub fn name(&self) -> std::option::Option<&str> {
19595        match self {
19596            Self::Unspecified => std::option::Option::Some("QOS_TYPE_UNSPECIFIED"),
19597            Self::Auto => std::option::Option::Some("AUTO"),
19598            Self::Manual => std::option::Option::Some("MANUAL"),
19599            Self::UnknownValue(u) => u.0.name(),
19600        }
19601    }
19602}
19603
19604impl std::default::Default for QosType {
19605    fn default() -> Self {
19606        use std::convert::From;
19607        Self::from(0)
19608    }
19609}
19610
19611impl std::fmt::Display for QosType {
19612    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19613        wkt::internal::display_enum(f, self.name(), self.value())
19614    }
19615}
19616
19617impl std::convert::From<i32> for QosType {
19618    fn from(value: i32) -> Self {
19619        match value {
19620            0 => Self::Unspecified,
19621            1 => Self::Auto,
19622            2 => Self::Manual,
19623            _ => Self::UnknownValue(qos_type::UnknownValue(
19624                wkt::internal::UnknownEnumValue::Integer(value),
19625            )),
19626        }
19627    }
19628}
19629
19630impl std::convert::From<&str> for QosType {
19631    fn from(value: &str) -> Self {
19632        use std::string::ToString;
19633        match value {
19634            "QOS_TYPE_UNSPECIFIED" => Self::Unspecified,
19635            "AUTO" => Self::Auto,
19636            "MANUAL" => Self::Manual,
19637            _ => Self::UnknownValue(qos_type::UnknownValue(
19638                wkt::internal::UnknownEnumValue::String(value.to_string()),
19639            )),
19640        }
19641    }
19642}
19643
19644impl serde::ser::Serialize for QosType {
19645    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19646    where
19647        S: serde::Serializer,
19648    {
19649        match self {
19650            Self::Unspecified => serializer.serialize_i32(0),
19651            Self::Auto => serializer.serialize_i32(1),
19652            Self::Manual => serializer.serialize_i32(2),
19653            Self::UnknownValue(u) => u.0.serialize(serializer),
19654        }
19655    }
19656}
19657
19658impl<'de> serde::de::Deserialize<'de> for QosType {
19659    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19660    where
19661        D: serde::Deserializer<'de>,
19662    {
19663        deserializer.deserialize_any(wkt::internal::EnumVisitor::<QosType>::new(
19664            ".google.cloud.netapp.v1.QosType",
19665        ))
19666    }
19667}
19668
19669/// OS types for the host group
19670///
19671/// # Working with unknown values
19672///
19673/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19674/// additional enum variants at any time. Adding new variants is not considered
19675/// a breaking change. Applications should write their code in anticipation of:
19676///
19677/// - New values appearing in future releases of the client library, **and**
19678/// - New values received dynamically, without application changes.
19679///
19680/// Please consult the [Working with enums] section in the user guide for some
19681/// guidelines.
19682///
19683/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19684#[derive(Clone, Debug, PartialEq)]
19685#[non_exhaustive]
19686pub enum OsType {
19687    /// Unspecified OS Type
19688    Unspecified,
19689    /// OS Type is Linux
19690    Linux,
19691    /// OS Type is Windows
19692    Windows,
19693    /// OS Type is VMware ESXi
19694    Esxi,
19695    /// If set, the enum was initialized with an unknown value.
19696    ///
19697    /// Applications can examine the value using [OsType::value] or
19698    /// [OsType::name].
19699    UnknownValue(os_type::UnknownValue),
19700}
19701
19702#[doc(hidden)]
19703pub mod os_type {
19704    #[allow(unused_imports)]
19705    use super::*;
19706    #[derive(Clone, Debug, PartialEq)]
19707    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19708}
19709
19710impl OsType {
19711    /// Gets the enum value.
19712    ///
19713    /// Returns `None` if the enum contains an unknown value deserialized from
19714    /// the string representation of enums.
19715    pub fn value(&self) -> std::option::Option<i32> {
19716        match self {
19717            Self::Unspecified => std::option::Option::Some(0),
19718            Self::Linux => std::option::Option::Some(1),
19719            Self::Windows => std::option::Option::Some(2),
19720            Self::Esxi => std::option::Option::Some(3),
19721            Self::UnknownValue(u) => u.0.value(),
19722        }
19723    }
19724
19725    /// Gets the enum value as a string.
19726    ///
19727    /// Returns `None` if the enum contains an unknown value deserialized from
19728    /// the integer representation of enums.
19729    pub fn name(&self) -> std::option::Option<&str> {
19730        match self {
19731            Self::Unspecified => std::option::Option::Some("OS_TYPE_UNSPECIFIED"),
19732            Self::Linux => std::option::Option::Some("LINUX"),
19733            Self::Windows => std::option::Option::Some("WINDOWS"),
19734            Self::Esxi => std::option::Option::Some("ESXI"),
19735            Self::UnknownValue(u) => u.0.name(),
19736        }
19737    }
19738}
19739
19740impl std::default::Default for OsType {
19741    fn default() -> Self {
19742        use std::convert::From;
19743        Self::from(0)
19744    }
19745}
19746
19747impl std::fmt::Display for OsType {
19748    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19749        wkt::internal::display_enum(f, self.name(), self.value())
19750    }
19751}
19752
19753impl std::convert::From<i32> for OsType {
19754    fn from(value: i32) -> Self {
19755        match value {
19756            0 => Self::Unspecified,
19757            1 => Self::Linux,
19758            2 => Self::Windows,
19759            3 => Self::Esxi,
19760            _ => Self::UnknownValue(os_type::UnknownValue(
19761                wkt::internal::UnknownEnumValue::Integer(value),
19762            )),
19763        }
19764    }
19765}
19766
19767impl std::convert::From<&str> for OsType {
19768    fn from(value: &str) -> Self {
19769        use std::string::ToString;
19770        match value {
19771            "OS_TYPE_UNSPECIFIED" => Self::Unspecified,
19772            "LINUX" => Self::Linux,
19773            "WINDOWS" => Self::Windows,
19774            "ESXI" => Self::Esxi,
19775            _ => Self::UnknownValue(os_type::UnknownValue(
19776                wkt::internal::UnknownEnumValue::String(value.to_string()),
19777            )),
19778        }
19779    }
19780}
19781
19782impl serde::ser::Serialize for OsType {
19783    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19784    where
19785        S: serde::Serializer,
19786    {
19787        match self {
19788            Self::Unspecified => serializer.serialize_i32(0),
19789            Self::Linux => serializer.serialize_i32(1),
19790            Self::Windows => serializer.serialize_i32(2),
19791            Self::Esxi => serializer.serialize_i32(3),
19792            Self::UnknownValue(u) => u.0.serialize(serializer),
19793        }
19794    }
19795}
19796
19797impl<'de> serde::de::Deserialize<'de> for OsType {
19798    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19799    where
19800        D: serde::Deserializer<'de>,
19801    {
19802        deserializer.deserialize_any(wkt::internal::EnumVisitor::<OsType>::new(
19803            ".google.cloud.netapp.v1.OsType",
19804        ))
19805    }
19806}
19807
19808/// `Mode` of the storage pool or volume. This field is used to control whether
19809/// the resource is managed by the GCNV APIs or the GCNV ONTAP Mode APIs.
19810///
19811/// # Working with unknown values
19812///
19813/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19814/// additional enum variants at any time. Adding new variants is not considered
19815/// a breaking change. Applications should write their code in anticipation of:
19816///
19817/// - New values appearing in future releases of the client library, **and**
19818/// - New values received dynamically, without application changes.
19819///
19820/// Please consult the [Working with enums] section in the user guide for some
19821/// guidelines.
19822///
19823/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19824#[derive(Clone, Debug, PartialEq)]
19825#[non_exhaustive]
19826pub enum Mode {
19827    /// The `Mode` is not specified.
19828    Unspecified,
19829    /// The resource is managed by the GCNV APIs.
19830    Default,
19831    /// The resource is managed by the GCNV ONTAP Mode APIs.
19832    Ontap,
19833    /// If set, the enum was initialized with an unknown value.
19834    ///
19835    /// Applications can examine the value using [Mode::value] or
19836    /// [Mode::name].
19837    UnknownValue(mode::UnknownValue),
19838}
19839
19840#[doc(hidden)]
19841pub mod mode {
19842    #[allow(unused_imports)]
19843    use super::*;
19844    #[derive(Clone, Debug, PartialEq)]
19845    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19846}
19847
19848impl Mode {
19849    /// Gets the enum value.
19850    ///
19851    /// Returns `None` if the enum contains an unknown value deserialized from
19852    /// the string representation of enums.
19853    pub fn value(&self) -> std::option::Option<i32> {
19854        match self {
19855            Self::Unspecified => std::option::Option::Some(0),
19856            Self::Default => std::option::Option::Some(1),
19857            Self::Ontap => std::option::Option::Some(2),
19858            Self::UnknownValue(u) => u.0.value(),
19859        }
19860    }
19861
19862    /// Gets the enum value as a string.
19863    ///
19864    /// Returns `None` if the enum contains an unknown value deserialized from
19865    /// the integer representation of enums.
19866    pub fn name(&self) -> std::option::Option<&str> {
19867        match self {
19868            Self::Unspecified => std::option::Option::Some("MODE_UNSPECIFIED"),
19869            Self::Default => std::option::Option::Some("DEFAULT"),
19870            Self::Ontap => std::option::Option::Some("ONTAP"),
19871            Self::UnknownValue(u) => u.0.name(),
19872        }
19873    }
19874}
19875
19876impl std::default::Default for Mode {
19877    fn default() -> Self {
19878        use std::convert::From;
19879        Self::from(0)
19880    }
19881}
19882
19883impl std::fmt::Display for Mode {
19884    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19885        wkt::internal::display_enum(f, self.name(), self.value())
19886    }
19887}
19888
19889impl std::convert::From<i32> for Mode {
19890    fn from(value: i32) -> Self {
19891        match value {
19892            0 => Self::Unspecified,
19893            1 => Self::Default,
19894            2 => Self::Ontap,
19895            _ => Self::UnknownValue(mode::UnknownValue(
19896                wkt::internal::UnknownEnumValue::Integer(value),
19897            )),
19898        }
19899    }
19900}
19901
19902impl std::convert::From<&str> for Mode {
19903    fn from(value: &str) -> Self {
19904        use std::string::ToString;
19905        match value {
19906            "MODE_UNSPECIFIED" => Self::Unspecified,
19907            "DEFAULT" => Self::Default,
19908            "ONTAP" => Self::Ontap,
19909            _ => Self::UnknownValue(mode::UnknownValue(wkt::internal::UnknownEnumValue::String(
19910                value.to_string(),
19911            ))),
19912        }
19913    }
19914}
19915
19916impl serde::ser::Serialize for Mode {
19917    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19918    where
19919        S: serde::Serializer,
19920    {
19921        match self {
19922            Self::Unspecified => serializer.serialize_i32(0),
19923            Self::Default => serializer.serialize_i32(1),
19924            Self::Ontap => serializer.serialize_i32(2),
19925            Self::UnknownValue(u) => u.0.serialize(serializer),
19926        }
19927    }
19928}
19929
19930impl<'de> serde::de::Deserialize<'de> for Mode {
19931    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19932    where
19933        D: serde::Deserializer<'de>,
19934    {
19935        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Mode>::new(
19936            ".google.cloud.netapp.v1.Mode",
19937        ))
19938    }
19939}
19940
19941/// Protocols is an enum of all the supported network protocols for a volume.
19942///
19943/// # Working with unknown values
19944///
19945/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19946/// additional enum variants at any time. Adding new variants is not considered
19947/// a breaking change. Applications should write their code in anticipation of:
19948///
19949/// - New values appearing in future releases of the client library, **and**
19950/// - New values received dynamically, without application changes.
19951///
19952/// Please consult the [Working with enums] section in the user guide for some
19953/// guidelines.
19954///
19955/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
19956#[derive(Clone, Debug, PartialEq)]
19957#[non_exhaustive]
19958pub enum Protocols {
19959    /// Unspecified protocol
19960    Unspecified,
19961    /// NFS V3 protocol
19962    Nfsv3,
19963    /// NFS V4 protocol
19964    Nfsv4,
19965    /// SMB protocol
19966    Smb,
19967    /// ISCSI protocol
19968    Iscsi,
19969    /// If set, the enum was initialized with an unknown value.
19970    ///
19971    /// Applications can examine the value using [Protocols::value] or
19972    /// [Protocols::name].
19973    UnknownValue(protocols::UnknownValue),
19974}
19975
19976#[doc(hidden)]
19977pub mod protocols {
19978    #[allow(unused_imports)]
19979    use super::*;
19980    #[derive(Clone, Debug, PartialEq)]
19981    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19982}
19983
19984impl Protocols {
19985    /// Gets the enum value.
19986    ///
19987    /// Returns `None` if the enum contains an unknown value deserialized from
19988    /// the string representation of enums.
19989    pub fn value(&self) -> std::option::Option<i32> {
19990        match self {
19991            Self::Unspecified => std::option::Option::Some(0),
19992            Self::Nfsv3 => std::option::Option::Some(1),
19993            Self::Nfsv4 => std::option::Option::Some(2),
19994            Self::Smb => std::option::Option::Some(3),
19995            Self::Iscsi => std::option::Option::Some(4),
19996            Self::UnknownValue(u) => u.0.value(),
19997        }
19998    }
19999
20000    /// Gets the enum value as a string.
20001    ///
20002    /// Returns `None` if the enum contains an unknown value deserialized from
20003    /// the integer representation of enums.
20004    pub fn name(&self) -> std::option::Option<&str> {
20005        match self {
20006            Self::Unspecified => std::option::Option::Some("PROTOCOLS_UNSPECIFIED"),
20007            Self::Nfsv3 => std::option::Option::Some("NFSV3"),
20008            Self::Nfsv4 => std::option::Option::Some("NFSV4"),
20009            Self::Smb => std::option::Option::Some("SMB"),
20010            Self::Iscsi => std::option::Option::Some("ISCSI"),
20011            Self::UnknownValue(u) => u.0.name(),
20012        }
20013    }
20014}
20015
20016impl std::default::Default for Protocols {
20017    fn default() -> Self {
20018        use std::convert::From;
20019        Self::from(0)
20020    }
20021}
20022
20023impl std::fmt::Display for Protocols {
20024    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20025        wkt::internal::display_enum(f, self.name(), self.value())
20026    }
20027}
20028
20029impl std::convert::From<i32> for Protocols {
20030    fn from(value: i32) -> Self {
20031        match value {
20032            0 => Self::Unspecified,
20033            1 => Self::Nfsv3,
20034            2 => Self::Nfsv4,
20035            3 => Self::Smb,
20036            4 => Self::Iscsi,
20037            _ => Self::UnknownValue(protocols::UnknownValue(
20038                wkt::internal::UnknownEnumValue::Integer(value),
20039            )),
20040        }
20041    }
20042}
20043
20044impl std::convert::From<&str> for Protocols {
20045    fn from(value: &str) -> Self {
20046        use std::string::ToString;
20047        match value {
20048            "PROTOCOLS_UNSPECIFIED" => Self::Unspecified,
20049            "NFSV3" => Self::Nfsv3,
20050            "NFSV4" => Self::Nfsv4,
20051            "SMB" => Self::Smb,
20052            "ISCSI" => Self::Iscsi,
20053            _ => Self::UnknownValue(protocols::UnknownValue(
20054                wkt::internal::UnknownEnumValue::String(value.to_string()),
20055            )),
20056        }
20057    }
20058}
20059
20060impl serde::ser::Serialize for Protocols {
20061    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20062    where
20063        S: serde::Serializer,
20064    {
20065        match self {
20066            Self::Unspecified => serializer.serialize_i32(0),
20067            Self::Nfsv3 => serializer.serialize_i32(1),
20068            Self::Nfsv4 => serializer.serialize_i32(2),
20069            Self::Smb => serializer.serialize_i32(3),
20070            Self::Iscsi => serializer.serialize_i32(4),
20071            Self::UnknownValue(u) => u.0.serialize(serializer),
20072        }
20073    }
20074}
20075
20076impl<'de> serde::de::Deserialize<'de> for Protocols {
20077    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20078    where
20079        D: serde::Deserializer<'de>,
20080    {
20081        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocols>::new(
20082            ".google.cloud.netapp.v1.Protocols",
20083        ))
20084    }
20085}
20086
20087/// AccessType is an enum of all the supported access types for a volume.
20088///
20089/// # Working with unknown values
20090///
20091/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20092/// additional enum variants at any time. Adding new variants is not considered
20093/// a breaking change. Applications should write their code in anticipation of:
20094///
20095/// - New values appearing in future releases of the client library, **and**
20096/// - New values received dynamically, without application changes.
20097///
20098/// Please consult the [Working with enums] section in the user guide for some
20099/// guidelines.
20100///
20101/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
20102#[derive(Clone, Debug, PartialEq)]
20103#[non_exhaustive]
20104pub enum AccessType {
20105    /// Unspecified Access Type
20106    Unspecified,
20107    /// Read Only
20108    ReadOnly,
20109    /// Read Write
20110    ReadWrite,
20111    /// None
20112    ReadNone,
20113    /// If set, the enum was initialized with an unknown value.
20114    ///
20115    /// Applications can examine the value using [AccessType::value] or
20116    /// [AccessType::name].
20117    UnknownValue(access_type::UnknownValue),
20118}
20119
20120#[doc(hidden)]
20121pub mod access_type {
20122    #[allow(unused_imports)]
20123    use super::*;
20124    #[derive(Clone, Debug, PartialEq)]
20125    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20126}
20127
20128impl AccessType {
20129    /// Gets the enum value.
20130    ///
20131    /// Returns `None` if the enum contains an unknown value deserialized from
20132    /// the string representation of enums.
20133    pub fn value(&self) -> std::option::Option<i32> {
20134        match self {
20135            Self::Unspecified => std::option::Option::Some(0),
20136            Self::ReadOnly => std::option::Option::Some(1),
20137            Self::ReadWrite => std::option::Option::Some(2),
20138            Self::ReadNone => std::option::Option::Some(3),
20139            Self::UnknownValue(u) => u.0.value(),
20140        }
20141    }
20142
20143    /// Gets the enum value as a string.
20144    ///
20145    /// Returns `None` if the enum contains an unknown value deserialized from
20146    /// the integer representation of enums.
20147    pub fn name(&self) -> std::option::Option<&str> {
20148        match self {
20149            Self::Unspecified => std::option::Option::Some("ACCESS_TYPE_UNSPECIFIED"),
20150            Self::ReadOnly => std::option::Option::Some("READ_ONLY"),
20151            Self::ReadWrite => std::option::Option::Some("READ_WRITE"),
20152            Self::ReadNone => std::option::Option::Some("READ_NONE"),
20153            Self::UnknownValue(u) => u.0.name(),
20154        }
20155    }
20156}
20157
20158impl std::default::Default for AccessType {
20159    fn default() -> Self {
20160        use std::convert::From;
20161        Self::from(0)
20162    }
20163}
20164
20165impl std::fmt::Display for AccessType {
20166    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20167        wkt::internal::display_enum(f, self.name(), self.value())
20168    }
20169}
20170
20171impl std::convert::From<i32> for AccessType {
20172    fn from(value: i32) -> Self {
20173        match value {
20174            0 => Self::Unspecified,
20175            1 => Self::ReadOnly,
20176            2 => Self::ReadWrite,
20177            3 => Self::ReadNone,
20178            _ => Self::UnknownValue(access_type::UnknownValue(
20179                wkt::internal::UnknownEnumValue::Integer(value),
20180            )),
20181        }
20182    }
20183}
20184
20185impl std::convert::From<&str> for AccessType {
20186    fn from(value: &str) -> Self {
20187        use std::string::ToString;
20188        match value {
20189            "ACCESS_TYPE_UNSPECIFIED" => Self::Unspecified,
20190            "READ_ONLY" => Self::ReadOnly,
20191            "READ_WRITE" => Self::ReadWrite,
20192            "READ_NONE" => Self::ReadNone,
20193            _ => Self::UnknownValue(access_type::UnknownValue(
20194                wkt::internal::UnknownEnumValue::String(value.to_string()),
20195            )),
20196        }
20197    }
20198}
20199
20200impl serde::ser::Serialize for AccessType {
20201    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20202    where
20203        S: serde::Serializer,
20204    {
20205        match self {
20206            Self::Unspecified => serializer.serialize_i32(0),
20207            Self::ReadOnly => serializer.serialize_i32(1),
20208            Self::ReadWrite => serializer.serialize_i32(2),
20209            Self::ReadNone => serializer.serialize_i32(3),
20210            Self::UnknownValue(u) => u.0.serialize(serializer),
20211        }
20212    }
20213}
20214
20215impl<'de> serde::de::Deserialize<'de> for AccessType {
20216    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20217    where
20218        D: serde::Deserializer<'de>,
20219    {
20220        deserializer.deserialize_any(wkt::internal::EnumVisitor::<AccessType>::new(
20221            ".google.cloud.netapp.v1.AccessType",
20222        ))
20223    }
20224}
20225
20226/// SMBSettings
20227/// Modifies the behaviour of a SMB volume.
20228///
20229/// # Working with unknown values
20230///
20231/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20232/// additional enum variants at any time. Adding new variants is not considered
20233/// a breaking change. Applications should write their code in anticipation of:
20234///
20235/// - New values appearing in future releases of the client library, **and**
20236/// - New values received dynamically, without application changes.
20237///
20238/// Please consult the [Working with enums] section in the user guide for some
20239/// guidelines.
20240///
20241/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
20242#[derive(Clone, Debug, PartialEq)]
20243#[non_exhaustive]
20244pub enum SMBSettings {
20245    /// Unspecified default option
20246    Unspecified,
20247    /// SMB setting encrypt data
20248    EncryptData,
20249    /// SMB setting browsable
20250    Browsable,
20251    /// SMB setting notify change
20252    ChangeNotify,
20253    /// SMB setting not to notify change
20254    NonBrowsable,
20255    /// SMB setting oplocks
20256    Oplocks,
20257    /// SMB setting to show snapshots
20258    ShowSnapshot,
20259    /// SMB setting to show previous versions
20260    ShowPreviousVersions,
20261    /// SMB setting to access volume based on enumerartion
20262    AccessBasedEnumeration,
20263    /// Continuously available enumeration
20264    ContinuouslyAvailable,
20265    /// If set, the enum was initialized with an unknown value.
20266    ///
20267    /// Applications can examine the value using [SMBSettings::value] or
20268    /// [SMBSettings::name].
20269    UnknownValue(smb_settings::UnknownValue),
20270}
20271
20272#[doc(hidden)]
20273pub mod smb_settings {
20274    #[allow(unused_imports)]
20275    use super::*;
20276    #[derive(Clone, Debug, PartialEq)]
20277    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20278}
20279
20280impl SMBSettings {
20281    /// Gets the enum value.
20282    ///
20283    /// Returns `None` if the enum contains an unknown value deserialized from
20284    /// the string representation of enums.
20285    pub fn value(&self) -> std::option::Option<i32> {
20286        match self {
20287            Self::Unspecified => std::option::Option::Some(0),
20288            Self::EncryptData => std::option::Option::Some(1),
20289            Self::Browsable => std::option::Option::Some(2),
20290            Self::ChangeNotify => std::option::Option::Some(3),
20291            Self::NonBrowsable => std::option::Option::Some(4),
20292            Self::Oplocks => std::option::Option::Some(5),
20293            Self::ShowSnapshot => std::option::Option::Some(6),
20294            Self::ShowPreviousVersions => std::option::Option::Some(7),
20295            Self::AccessBasedEnumeration => std::option::Option::Some(8),
20296            Self::ContinuouslyAvailable => std::option::Option::Some(9),
20297            Self::UnknownValue(u) => u.0.value(),
20298        }
20299    }
20300
20301    /// Gets the enum value as a string.
20302    ///
20303    /// Returns `None` if the enum contains an unknown value deserialized from
20304    /// the integer representation of enums.
20305    pub fn name(&self) -> std::option::Option<&str> {
20306        match self {
20307            Self::Unspecified => std::option::Option::Some("SMB_SETTINGS_UNSPECIFIED"),
20308            Self::EncryptData => std::option::Option::Some("ENCRYPT_DATA"),
20309            Self::Browsable => std::option::Option::Some("BROWSABLE"),
20310            Self::ChangeNotify => std::option::Option::Some("CHANGE_NOTIFY"),
20311            Self::NonBrowsable => std::option::Option::Some("NON_BROWSABLE"),
20312            Self::Oplocks => std::option::Option::Some("OPLOCKS"),
20313            Self::ShowSnapshot => std::option::Option::Some("SHOW_SNAPSHOT"),
20314            Self::ShowPreviousVersions => std::option::Option::Some("SHOW_PREVIOUS_VERSIONS"),
20315            Self::AccessBasedEnumeration => std::option::Option::Some("ACCESS_BASED_ENUMERATION"),
20316            Self::ContinuouslyAvailable => std::option::Option::Some("CONTINUOUSLY_AVAILABLE"),
20317            Self::UnknownValue(u) => u.0.name(),
20318        }
20319    }
20320}
20321
20322impl std::default::Default for SMBSettings {
20323    fn default() -> Self {
20324        use std::convert::From;
20325        Self::from(0)
20326    }
20327}
20328
20329impl std::fmt::Display for SMBSettings {
20330    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20331        wkt::internal::display_enum(f, self.name(), self.value())
20332    }
20333}
20334
20335impl std::convert::From<i32> for SMBSettings {
20336    fn from(value: i32) -> Self {
20337        match value {
20338            0 => Self::Unspecified,
20339            1 => Self::EncryptData,
20340            2 => Self::Browsable,
20341            3 => Self::ChangeNotify,
20342            4 => Self::NonBrowsable,
20343            5 => Self::Oplocks,
20344            6 => Self::ShowSnapshot,
20345            7 => Self::ShowPreviousVersions,
20346            8 => Self::AccessBasedEnumeration,
20347            9 => Self::ContinuouslyAvailable,
20348            _ => Self::UnknownValue(smb_settings::UnknownValue(
20349                wkt::internal::UnknownEnumValue::Integer(value),
20350            )),
20351        }
20352    }
20353}
20354
20355impl std::convert::From<&str> for SMBSettings {
20356    fn from(value: &str) -> Self {
20357        use std::string::ToString;
20358        match value {
20359            "SMB_SETTINGS_UNSPECIFIED" => Self::Unspecified,
20360            "ENCRYPT_DATA" => Self::EncryptData,
20361            "BROWSABLE" => Self::Browsable,
20362            "CHANGE_NOTIFY" => Self::ChangeNotify,
20363            "NON_BROWSABLE" => Self::NonBrowsable,
20364            "OPLOCKS" => Self::Oplocks,
20365            "SHOW_SNAPSHOT" => Self::ShowSnapshot,
20366            "SHOW_PREVIOUS_VERSIONS" => Self::ShowPreviousVersions,
20367            "ACCESS_BASED_ENUMERATION" => Self::AccessBasedEnumeration,
20368            "CONTINUOUSLY_AVAILABLE" => Self::ContinuouslyAvailable,
20369            _ => Self::UnknownValue(smb_settings::UnknownValue(
20370                wkt::internal::UnknownEnumValue::String(value.to_string()),
20371            )),
20372        }
20373    }
20374}
20375
20376impl serde::ser::Serialize for SMBSettings {
20377    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20378    where
20379        S: serde::Serializer,
20380    {
20381        match self {
20382            Self::Unspecified => serializer.serialize_i32(0),
20383            Self::EncryptData => serializer.serialize_i32(1),
20384            Self::Browsable => serializer.serialize_i32(2),
20385            Self::ChangeNotify => serializer.serialize_i32(3),
20386            Self::NonBrowsable => serializer.serialize_i32(4),
20387            Self::Oplocks => serializer.serialize_i32(5),
20388            Self::ShowSnapshot => serializer.serialize_i32(6),
20389            Self::ShowPreviousVersions => serializer.serialize_i32(7),
20390            Self::AccessBasedEnumeration => serializer.serialize_i32(8),
20391            Self::ContinuouslyAvailable => serializer.serialize_i32(9),
20392            Self::UnknownValue(u) => u.0.serialize(serializer),
20393        }
20394    }
20395}
20396
20397impl<'de> serde::de::Deserialize<'de> for SMBSettings {
20398    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20399    where
20400        D: serde::Deserializer<'de>,
20401    {
20402        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SMBSettings>::new(
20403            ".google.cloud.netapp.v1.SMBSettings",
20404        ))
20405    }
20406}
20407
20408/// The security style of the volume, can be either UNIX or NTFS.
20409///
20410/// # Working with unknown values
20411///
20412/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20413/// additional enum variants at any time. Adding new variants is not considered
20414/// a breaking change. Applications should write their code in anticipation of:
20415///
20416/// - New values appearing in future releases of the client library, **and**
20417/// - New values received dynamically, without application changes.
20418///
20419/// Please consult the [Working with enums] section in the user guide for some
20420/// guidelines.
20421///
20422/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
20423#[derive(Clone, Debug, PartialEq)]
20424#[non_exhaustive]
20425pub enum SecurityStyle {
20426    /// SecurityStyle is unspecified
20427    Unspecified,
20428    /// SecurityStyle uses NTFS
20429    Ntfs,
20430    /// SecurityStyle uses UNIX
20431    Unix,
20432    /// If set, the enum was initialized with an unknown value.
20433    ///
20434    /// Applications can examine the value using [SecurityStyle::value] or
20435    /// [SecurityStyle::name].
20436    UnknownValue(security_style::UnknownValue),
20437}
20438
20439#[doc(hidden)]
20440pub mod security_style {
20441    #[allow(unused_imports)]
20442    use super::*;
20443    #[derive(Clone, Debug, PartialEq)]
20444    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20445}
20446
20447impl SecurityStyle {
20448    /// Gets the enum value.
20449    ///
20450    /// Returns `None` if the enum contains an unknown value deserialized from
20451    /// the string representation of enums.
20452    pub fn value(&self) -> std::option::Option<i32> {
20453        match self {
20454            Self::Unspecified => std::option::Option::Some(0),
20455            Self::Ntfs => std::option::Option::Some(1),
20456            Self::Unix => std::option::Option::Some(2),
20457            Self::UnknownValue(u) => u.0.value(),
20458        }
20459    }
20460
20461    /// Gets the enum value as a string.
20462    ///
20463    /// Returns `None` if the enum contains an unknown value deserialized from
20464    /// the integer representation of enums.
20465    pub fn name(&self) -> std::option::Option<&str> {
20466        match self {
20467            Self::Unspecified => std::option::Option::Some("SECURITY_STYLE_UNSPECIFIED"),
20468            Self::Ntfs => std::option::Option::Some("NTFS"),
20469            Self::Unix => std::option::Option::Some("UNIX"),
20470            Self::UnknownValue(u) => u.0.name(),
20471        }
20472    }
20473}
20474
20475impl std::default::Default for SecurityStyle {
20476    fn default() -> Self {
20477        use std::convert::From;
20478        Self::from(0)
20479    }
20480}
20481
20482impl std::fmt::Display for SecurityStyle {
20483    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20484        wkt::internal::display_enum(f, self.name(), self.value())
20485    }
20486}
20487
20488impl std::convert::From<i32> for SecurityStyle {
20489    fn from(value: i32) -> Self {
20490        match value {
20491            0 => Self::Unspecified,
20492            1 => Self::Ntfs,
20493            2 => Self::Unix,
20494            _ => Self::UnknownValue(security_style::UnknownValue(
20495                wkt::internal::UnknownEnumValue::Integer(value),
20496            )),
20497        }
20498    }
20499}
20500
20501impl std::convert::From<&str> for SecurityStyle {
20502    fn from(value: &str) -> Self {
20503        use std::string::ToString;
20504        match value {
20505            "SECURITY_STYLE_UNSPECIFIED" => Self::Unspecified,
20506            "NTFS" => Self::Ntfs,
20507            "UNIX" => Self::Unix,
20508            _ => Self::UnknownValue(security_style::UnknownValue(
20509                wkt::internal::UnknownEnumValue::String(value.to_string()),
20510            )),
20511        }
20512    }
20513}
20514
20515impl serde::ser::Serialize for SecurityStyle {
20516    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20517    where
20518        S: serde::Serializer,
20519    {
20520        match self {
20521            Self::Unspecified => serializer.serialize_i32(0),
20522            Self::Ntfs => serializer.serialize_i32(1),
20523            Self::Unix => serializer.serialize_i32(2),
20524            Self::UnknownValue(u) => u.0.serialize(serializer),
20525        }
20526    }
20527}
20528
20529impl<'de> serde::de::Deserialize<'de> for SecurityStyle {
20530    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20531    where
20532        D: serde::Deserializer<'de>,
20533    {
20534        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SecurityStyle>::new(
20535            ".google.cloud.netapp.v1.SecurityStyle",
20536        ))
20537    }
20538}
20539
20540/// Actions to be restricted for a volume.
20541///
20542/// # Working with unknown values
20543///
20544/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
20545/// additional enum variants at any time. Adding new variants is not considered
20546/// a breaking change. Applications should write their code in anticipation of:
20547///
20548/// - New values appearing in future releases of the client library, **and**
20549/// - New values received dynamically, without application changes.
20550///
20551/// Please consult the [Working with enums] section in the user guide for some
20552/// guidelines.
20553///
20554/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
20555#[derive(Clone, Debug, PartialEq)]
20556#[non_exhaustive]
20557pub enum RestrictedAction {
20558    /// Unspecified restricted action
20559    Unspecified,
20560    /// Prevent volume from being deleted when mounted.
20561    Delete,
20562    /// If set, the enum was initialized with an unknown value.
20563    ///
20564    /// Applications can examine the value using [RestrictedAction::value] or
20565    /// [RestrictedAction::name].
20566    UnknownValue(restricted_action::UnknownValue),
20567}
20568
20569#[doc(hidden)]
20570pub mod restricted_action {
20571    #[allow(unused_imports)]
20572    use super::*;
20573    #[derive(Clone, Debug, PartialEq)]
20574    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
20575}
20576
20577impl RestrictedAction {
20578    /// Gets the enum value.
20579    ///
20580    /// Returns `None` if the enum contains an unknown value deserialized from
20581    /// the string representation of enums.
20582    pub fn value(&self) -> std::option::Option<i32> {
20583        match self {
20584            Self::Unspecified => std::option::Option::Some(0),
20585            Self::Delete => std::option::Option::Some(1),
20586            Self::UnknownValue(u) => u.0.value(),
20587        }
20588    }
20589
20590    /// Gets the enum value as a string.
20591    ///
20592    /// Returns `None` if the enum contains an unknown value deserialized from
20593    /// the integer representation of enums.
20594    pub fn name(&self) -> std::option::Option<&str> {
20595        match self {
20596            Self::Unspecified => std::option::Option::Some("RESTRICTED_ACTION_UNSPECIFIED"),
20597            Self::Delete => std::option::Option::Some("DELETE"),
20598            Self::UnknownValue(u) => u.0.name(),
20599        }
20600    }
20601}
20602
20603impl std::default::Default for RestrictedAction {
20604    fn default() -> Self {
20605        use std::convert::From;
20606        Self::from(0)
20607    }
20608}
20609
20610impl std::fmt::Display for RestrictedAction {
20611    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
20612        wkt::internal::display_enum(f, self.name(), self.value())
20613    }
20614}
20615
20616impl std::convert::From<i32> for RestrictedAction {
20617    fn from(value: i32) -> Self {
20618        match value {
20619            0 => Self::Unspecified,
20620            1 => Self::Delete,
20621            _ => Self::UnknownValue(restricted_action::UnknownValue(
20622                wkt::internal::UnknownEnumValue::Integer(value),
20623            )),
20624        }
20625    }
20626}
20627
20628impl std::convert::From<&str> for RestrictedAction {
20629    fn from(value: &str) -> Self {
20630        use std::string::ToString;
20631        match value {
20632            "RESTRICTED_ACTION_UNSPECIFIED" => Self::Unspecified,
20633            "DELETE" => Self::Delete,
20634            _ => Self::UnknownValue(restricted_action::UnknownValue(
20635                wkt::internal::UnknownEnumValue::String(value.to_string()),
20636            )),
20637        }
20638    }
20639}
20640
20641impl serde::ser::Serialize for RestrictedAction {
20642    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
20643    where
20644        S: serde::Serializer,
20645    {
20646        match self {
20647            Self::Unspecified => serializer.serialize_i32(0),
20648            Self::Delete => serializer.serialize_i32(1),
20649            Self::UnknownValue(u) => u.0.serialize(serializer),
20650        }
20651    }
20652}
20653
20654impl<'de> serde::de::Deserialize<'de> for RestrictedAction {
20655    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
20656    where
20657        D: serde::Deserializer<'de>,
20658    {
20659        deserializer.deserialize_any(wkt::internal::EnumVisitor::<RestrictedAction>::new(
20660            ".google.cloud.netapp.v1.RestrictedAction",
20661        ))
20662    }
20663}