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 gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate location;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// ListActiveDirectoriesRequest for requesting multiple active directories.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct ListActiveDirectoriesRequest {
44    /// Required. Parent value for ListActiveDirectoriesRequest
45    pub parent: std::string::String,
46
47    /// Requested page size. Server may return fewer items than requested.
48    /// If unspecified, the server will pick an appropriate default.
49    pub page_size: i32,
50
51    /// A token identifying a page of results the server should return.
52    pub page_token: std::string::String,
53
54    /// Filtering results
55    pub filter: std::string::String,
56
57    /// Hint for how to order the results
58    pub order_by: std::string::String,
59
60    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
61}
62
63impl ListActiveDirectoriesRequest {
64    pub fn new() -> Self {
65        std::default::Default::default()
66    }
67
68    /// Sets the value of [parent][crate::model::ListActiveDirectoriesRequest::parent].
69    ///
70    /// # Example
71    /// ```ignore,no_run
72    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
73    /// let x = ListActiveDirectoriesRequest::new().set_parent("example");
74    /// ```
75    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
76        self.parent = v.into();
77        self
78    }
79
80    /// Sets the value of [page_size][crate::model::ListActiveDirectoriesRequest::page_size].
81    ///
82    /// # Example
83    /// ```ignore,no_run
84    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
85    /// let x = ListActiveDirectoriesRequest::new().set_page_size(42);
86    /// ```
87    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
88        self.page_size = v.into();
89        self
90    }
91
92    /// Sets the value of [page_token][crate::model::ListActiveDirectoriesRequest::page_token].
93    ///
94    /// # Example
95    /// ```ignore,no_run
96    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
97    /// let x = ListActiveDirectoriesRequest::new().set_page_token("example");
98    /// ```
99    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
100        self.page_token = v.into();
101        self
102    }
103
104    /// Sets the value of [filter][crate::model::ListActiveDirectoriesRequest::filter].
105    ///
106    /// # Example
107    /// ```ignore,no_run
108    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
109    /// let x = ListActiveDirectoriesRequest::new().set_filter("example");
110    /// ```
111    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
112        self.filter = v.into();
113        self
114    }
115
116    /// Sets the value of [order_by][crate::model::ListActiveDirectoriesRequest::order_by].
117    ///
118    /// # Example
119    /// ```ignore,no_run
120    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
121    /// let x = ListActiveDirectoriesRequest::new().set_order_by("example");
122    /// ```
123    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
124        self.order_by = v.into();
125        self
126    }
127}
128
129impl wkt::message::Message for ListActiveDirectoriesRequest {
130    fn typename() -> &'static str {
131        "type.googleapis.com/google.cloud.netapp.v1.ListActiveDirectoriesRequest"
132    }
133}
134
135/// ListActiveDirectoriesResponse contains all the active directories requested.
136#[derive(Clone, Default, PartialEq)]
137#[non_exhaustive]
138pub struct ListActiveDirectoriesResponse {
139    /// The list of active directories.
140    pub active_directories: std::vec::Vec<crate::model::ActiveDirectory>,
141
142    /// A token identifying a page of results the server should return.
143    pub next_page_token: std::string::String,
144
145    /// Locations that could not be reached.
146    pub unreachable: std::vec::Vec<std::string::String>,
147
148    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
149}
150
151impl ListActiveDirectoriesResponse {
152    pub fn new() -> Self {
153        std::default::Default::default()
154    }
155
156    /// Sets the value of [active_directories][crate::model::ListActiveDirectoriesResponse::active_directories].
157    ///
158    /// # Example
159    /// ```ignore,no_run
160    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesResponse;
161    /// use google_cloud_netapp_v1::model::ActiveDirectory;
162    /// let x = ListActiveDirectoriesResponse::new()
163    ///     .set_active_directories([
164    ///         ActiveDirectory::default()/* use setters */,
165    ///         ActiveDirectory::default()/* use (different) setters */,
166    ///     ]);
167    /// ```
168    pub fn set_active_directories<T, V>(mut self, v: T) -> Self
169    where
170        T: std::iter::IntoIterator<Item = V>,
171        V: std::convert::Into<crate::model::ActiveDirectory>,
172    {
173        use std::iter::Iterator;
174        self.active_directories = v.into_iter().map(|i| i.into()).collect();
175        self
176    }
177
178    /// Sets the value of [next_page_token][crate::model::ListActiveDirectoriesResponse::next_page_token].
179    ///
180    /// # Example
181    /// ```ignore,no_run
182    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesResponse;
183    /// let x = ListActiveDirectoriesResponse::new().set_next_page_token("example");
184    /// ```
185    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
186        self.next_page_token = v.into();
187        self
188    }
189
190    /// Sets the value of [unreachable][crate::model::ListActiveDirectoriesResponse::unreachable].
191    ///
192    /// # Example
193    /// ```ignore,no_run
194    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesResponse;
195    /// let x = ListActiveDirectoriesResponse::new().set_unreachable(["a", "b", "c"]);
196    /// ```
197    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
198    where
199        T: std::iter::IntoIterator<Item = V>,
200        V: std::convert::Into<std::string::String>,
201    {
202        use std::iter::Iterator;
203        self.unreachable = v.into_iter().map(|i| i.into()).collect();
204        self
205    }
206}
207
208impl wkt::message::Message for ListActiveDirectoriesResponse {
209    fn typename() -> &'static str {
210        "type.googleapis.com/google.cloud.netapp.v1.ListActiveDirectoriesResponse"
211    }
212}
213
214#[doc(hidden)]
215impl gax::paginator::internal::PageableResponse for ListActiveDirectoriesResponse {
216    type PageItem = crate::model::ActiveDirectory;
217
218    fn items(self) -> std::vec::Vec<Self::PageItem> {
219        self.active_directories
220    }
221
222    fn next_page_token(&self) -> std::string::String {
223        use std::clone::Clone;
224        self.next_page_token.clone()
225    }
226}
227
228/// GetActiveDirectory for getting a single active directory.
229#[derive(Clone, Default, PartialEq)]
230#[non_exhaustive]
231pub struct GetActiveDirectoryRequest {
232    /// Required. Name of the active directory.
233    pub name: std::string::String,
234
235    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
236}
237
238impl GetActiveDirectoryRequest {
239    pub fn new() -> Self {
240        std::default::Default::default()
241    }
242
243    /// Sets the value of [name][crate::model::GetActiveDirectoryRequest::name].
244    ///
245    /// # Example
246    /// ```ignore,no_run
247    /// # use google_cloud_netapp_v1::model::GetActiveDirectoryRequest;
248    /// let x = GetActiveDirectoryRequest::new().set_name("example");
249    /// ```
250    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
251        self.name = v.into();
252        self
253    }
254}
255
256impl wkt::message::Message for GetActiveDirectoryRequest {
257    fn typename() -> &'static str {
258        "type.googleapis.com/google.cloud.netapp.v1.GetActiveDirectoryRequest"
259    }
260}
261
262/// CreateActiveDirectoryRequest for creating an active directory.
263#[derive(Clone, Default, PartialEq)]
264#[non_exhaustive]
265pub struct CreateActiveDirectoryRequest {
266    /// Required. Value for parent.
267    pub parent: std::string::String,
268
269    /// Required. Fields of the to be created active directory.
270    pub active_directory: std::option::Option<crate::model::ActiveDirectory>,
271
272    /// Required. ID of the active directory to create. Must be unique within the
273    /// parent resource. Must contain only letters, numbers and hyphen, with the
274    /// first character a letter , the last a letter or a number, and a 63
275    /// character maximum.
276    pub active_directory_id: std::string::String,
277
278    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
279}
280
281impl CreateActiveDirectoryRequest {
282    pub fn new() -> Self {
283        std::default::Default::default()
284    }
285
286    /// Sets the value of [parent][crate::model::CreateActiveDirectoryRequest::parent].
287    ///
288    /// # Example
289    /// ```ignore,no_run
290    /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
291    /// let x = CreateActiveDirectoryRequest::new().set_parent("example");
292    /// ```
293    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
294        self.parent = v.into();
295        self
296    }
297
298    /// Sets the value of [active_directory][crate::model::CreateActiveDirectoryRequest::active_directory].
299    ///
300    /// # Example
301    /// ```ignore,no_run
302    /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
303    /// use google_cloud_netapp_v1::model::ActiveDirectory;
304    /// let x = CreateActiveDirectoryRequest::new().set_active_directory(ActiveDirectory::default()/* use setters */);
305    /// ```
306    pub fn set_active_directory<T>(mut self, v: T) -> Self
307    where
308        T: std::convert::Into<crate::model::ActiveDirectory>,
309    {
310        self.active_directory = std::option::Option::Some(v.into());
311        self
312    }
313
314    /// Sets or clears the value of [active_directory][crate::model::CreateActiveDirectoryRequest::active_directory].
315    ///
316    /// # Example
317    /// ```ignore,no_run
318    /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
319    /// use google_cloud_netapp_v1::model::ActiveDirectory;
320    /// let x = CreateActiveDirectoryRequest::new().set_or_clear_active_directory(Some(ActiveDirectory::default()/* use setters */));
321    /// let x = CreateActiveDirectoryRequest::new().set_or_clear_active_directory(None::<ActiveDirectory>);
322    /// ```
323    pub fn set_or_clear_active_directory<T>(mut self, v: std::option::Option<T>) -> Self
324    where
325        T: std::convert::Into<crate::model::ActiveDirectory>,
326    {
327        self.active_directory = v.map(|x| x.into());
328        self
329    }
330
331    /// Sets the value of [active_directory_id][crate::model::CreateActiveDirectoryRequest::active_directory_id].
332    ///
333    /// # Example
334    /// ```ignore,no_run
335    /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
336    /// let x = CreateActiveDirectoryRequest::new().set_active_directory_id("example");
337    /// ```
338    pub fn set_active_directory_id<T: std::convert::Into<std::string::String>>(
339        mut self,
340        v: T,
341    ) -> Self {
342        self.active_directory_id = v.into();
343        self
344    }
345}
346
347impl wkt::message::Message for CreateActiveDirectoryRequest {
348    fn typename() -> &'static str {
349        "type.googleapis.com/google.cloud.netapp.v1.CreateActiveDirectoryRequest"
350    }
351}
352
353/// UpdateActiveDirectoryRequest for updating an active directory.
354#[derive(Clone, Default, PartialEq)]
355#[non_exhaustive]
356pub struct UpdateActiveDirectoryRequest {
357    /// Required. Field mask is used to specify the fields to be overwritten in the
358    /// Active Directory resource by the update.
359    /// The fields specified in the update_mask are relative to the resource, not
360    /// the full request. A field will be overwritten if it is in the mask. If the
361    /// user does not provide a mask then all fields will be overwritten.
362    pub update_mask: std::option::Option<wkt::FieldMask>,
363
364    /// Required. The volume being updated
365    pub active_directory: std::option::Option<crate::model::ActiveDirectory>,
366
367    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
368}
369
370impl UpdateActiveDirectoryRequest {
371    pub fn new() -> Self {
372        std::default::Default::default()
373    }
374
375    /// Sets the value of [update_mask][crate::model::UpdateActiveDirectoryRequest::update_mask].
376    ///
377    /// # Example
378    /// ```ignore,no_run
379    /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
380    /// use wkt::FieldMask;
381    /// let x = UpdateActiveDirectoryRequest::new().set_update_mask(FieldMask::default()/* use setters */);
382    /// ```
383    pub fn set_update_mask<T>(mut self, v: T) -> Self
384    where
385        T: std::convert::Into<wkt::FieldMask>,
386    {
387        self.update_mask = std::option::Option::Some(v.into());
388        self
389    }
390
391    /// Sets or clears the value of [update_mask][crate::model::UpdateActiveDirectoryRequest::update_mask].
392    ///
393    /// # Example
394    /// ```ignore,no_run
395    /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
396    /// use wkt::FieldMask;
397    /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
398    /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_update_mask(None::<FieldMask>);
399    /// ```
400    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
401    where
402        T: std::convert::Into<wkt::FieldMask>,
403    {
404        self.update_mask = v.map(|x| x.into());
405        self
406    }
407
408    /// Sets the value of [active_directory][crate::model::UpdateActiveDirectoryRequest::active_directory].
409    ///
410    /// # Example
411    /// ```ignore,no_run
412    /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
413    /// use google_cloud_netapp_v1::model::ActiveDirectory;
414    /// let x = UpdateActiveDirectoryRequest::new().set_active_directory(ActiveDirectory::default()/* use setters */);
415    /// ```
416    pub fn set_active_directory<T>(mut self, v: T) -> Self
417    where
418        T: std::convert::Into<crate::model::ActiveDirectory>,
419    {
420        self.active_directory = std::option::Option::Some(v.into());
421        self
422    }
423
424    /// Sets or clears the value of [active_directory][crate::model::UpdateActiveDirectoryRequest::active_directory].
425    ///
426    /// # Example
427    /// ```ignore,no_run
428    /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
429    /// use google_cloud_netapp_v1::model::ActiveDirectory;
430    /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_active_directory(Some(ActiveDirectory::default()/* use setters */));
431    /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_active_directory(None::<ActiveDirectory>);
432    /// ```
433    pub fn set_or_clear_active_directory<T>(mut self, v: std::option::Option<T>) -> Self
434    where
435        T: std::convert::Into<crate::model::ActiveDirectory>,
436    {
437        self.active_directory = v.map(|x| x.into());
438        self
439    }
440}
441
442impl wkt::message::Message for UpdateActiveDirectoryRequest {
443    fn typename() -> &'static str {
444        "type.googleapis.com/google.cloud.netapp.v1.UpdateActiveDirectoryRequest"
445    }
446}
447
448/// DeleteActiveDirectoryRequest for deleting a single active directory.
449#[derive(Clone, Default, PartialEq)]
450#[non_exhaustive]
451pub struct DeleteActiveDirectoryRequest {
452    /// Required. Name of the active directory.
453    pub name: std::string::String,
454
455    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
456}
457
458impl DeleteActiveDirectoryRequest {
459    pub fn new() -> Self {
460        std::default::Default::default()
461    }
462
463    /// Sets the value of [name][crate::model::DeleteActiveDirectoryRequest::name].
464    ///
465    /// # Example
466    /// ```ignore,no_run
467    /// # use google_cloud_netapp_v1::model::DeleteActiveDirectoryRequest;
468    /// let x = DeleteActiveDirectoryRequest::new().set_name("example");
469    /// ```
470    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
471        self.name = v.into();
472        self
473    }
474}
475
476impl wkt::message::Message for DeleteActiveDirectoryRequest {
477    fn typename() -> &'static str {
478        "type.googleapis.com/google.cloud.netapp.v1.DeleteActiveDirectoryRequest"
479    }
480}
481
482/// ActiveDirectory is the public representation of the active directory config.
483#[derive(Clone, Default, PartialEq)]
484#[non_exhaustive]
485pub struct ActiveDirectory {
486    /// Identifier. The resource name of the active directory.
487    /// Format:
488    /// `projects/{project_number}/locations/{location_id}/activeDirectories/{active_directory_id}`.
489    pub name: std::string::String,
490
491    /// Output only. Create time of the active directory.
492    pub create_time: std::option::Option<wkt::Timestamp>,
493
494    /// Output only. The state of the AD.
495    pub state: crate::model::active_directory::State,
496
497    /// Required. Name of the Active Directory domain
498    pub domain: std::string::String,
499
500    /// The Active Directory site the service will limit Domain Controller
501    /// discovery too.
502    pub site: std::string::String,
503
504    /// Required. Comma separated list of DNS server IP addresses for the Active
505    /// Directory domain.
506    pub dns: std::string::String,
507
508    /// Required. NetBIOSPrefix is used as a prefix for SMB server name.
509    pub net_bios_prefix: std::string::String,
510
511    /// The Organizational Unit (OU) within the Windows Active Directory the user
512    /// belongs to.
513    pub organizational_unit: std::string::String,
514
515    /// If enabled, AES encryption will be enabled for SMB communication.
516    pub aes_encryption: bool,
517
518    /// Required. Username of the Active Directory domain administrator.
519    pub username: std::string::String,
520
521    /// Required. Password of the Active Directory domain administrator.
522    pub password: std::string::String,
523
524    /// Optional. Users to be added to the Built-in Backup Operator active
525    /// directory group.
526    pub backup_operators: std::vec::Vec<std::string::String>,
527
528    /// Optional. Users to be added to the Built-in Admininstrators group.
529    pub administrators: std::vec::Vec<std::string::String>,
530
531    /// Optional. Domain users to be given the SeSecurityPrivilege.
532    pub security_operators: std::vec::Vec<std::string::String>,
533
534    /// Name of the active directory machine. This optional parameter is used only
535    /// while creating kerberos volume
536    pub kdc_hostname: std::string::String,
537
538    /// KDC server IP address for the active directory machine.
539    pub kdc_ip: std::string::String,
540
541    /// If enabled, will allow access to local users and LDAP users. If access is
542    /// needed for only LDAP users, it has to be disabled.
543    pub nfs_users_with_ldap: bool,
544
545    /// Description of the active directory.
546    pub description: std::string::String,
547
548    /// Specifies whether or not the LDAP traffic needs to be signed.
549    pub ldap_signing: bool,
550
551    /// If enabled, traffic between the SMB server to Domain Controller (DC) will
552    /// be encrypted.
553    pub encrypt_dc_connections: bool,
554
555    /// Labels for the active directory.
556    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
557
558    /// Output only. The state details of the Active Directory.
559    pub state_details: std::string::String,
560
561    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
562}
563
564impl ActiveDirectory {
565    pub fn new() -> Self {
566        std::default::Default::default()
567    }
568
569    /// Sets the value of [name][crate::model::ActiveDirectory::name].
570    ///
571    /// # Example
572    /// ```ignore,no_run
573    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
574    /// let x = ActiveDirectory::new().set_name("example");
575    /// ```
576    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
577        self.name = v.into();
578        self
579    }
580
581    /// Sets the value of [create_time][crate::model::ActiveDirectory::create_time].
582    ///
583    /// # Example
584    /// ```ignore,no_run
585    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
586    /// use wkt::Timestamp;
587    /// let x = ActiveDirectory::new().set_create_time(Timestamp::default()/* use setters */);
588    /// ```
589    pub fn set_create_time<T>(mut self, v: T) -> Self
590    where
591        T: std::convert::Into<wkt::Timestamp>,
592    {
593        self.create_time = std::option::Option::Some(v.into());
594        self
595    }
596
597    /// Sets or clears the value of [create_time][crate::model::ActiveDirectory::create_time].
598    ///
599    /// # Example
600    /// ```ignore,no_run
601    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
602    /// use wkt::Timestamp;
603    /// let x = ActiveDirectory::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
604    /// let x = ActiveDirectory::new().set_or_clear_create_time(None::<Timestamp>);
605    /// ```
606    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
607    where
608        T: std::convert::Into<wkt::Timestamp>,
609    {
610        self.create_time = v.map(|x| x.into());
611        self
612    }
613
614    /// Sets the value of [state][crate::model::ActiveDirectory::state].
615    ///
616    /// # Example
617    /// ```ignore,no_run
618    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
619    /// use google_cloud_netapp_v1::model::active_directory::State;
620    /// let x0 = ActiveDirectory::new().set_state(State::Creating);
621    /// let x1 = ActiveDirectory::new().set_state(State::Ready);
622    /// let x2 = ActiveDirectory::new().set_state(State::Updating);
623    /// ```
624    pub fn set_state<T: std::convert::Into<crate::model::active_directory::State>>(
625        mut self,
626        v: T,
627    ) -> Self {
628        self.state = v.into();
629        self
630    }
631
632    /// Sets the value of [domain][crate::model::ActiveDirectory::domain].
633    ///
634    /// # Example
635    /// ```ignore,no_run
636    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
637    /// let x = ActiveDirectory::new().set_domain("example");
638    /// ```
639    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
640        self.domain = v.into();
641        self
642    }
643
644    /// Sets the value of [site][crate::model::ActiveDirectory::site].
645    ///
646    /// # Example
647    /// ```ignore,no_run
648    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
649    /// let x = ActiveDirectory::new().set_site("example");
650    /// ```
651    pub fn set_site<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
652        self.site = v.into();
653        self
654    }
655
656    /// Sets the value of [dns][crate::model::ActiveDirectory::dns].
657    ///
658    /// # Example
659    /// ```ignore,no_run
660    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
661    /// let x = ActiveDirectory::new().set_dns("example");
662    /// ```
663    pub fn set_dns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
664        self.dns = v.into();
665        self
666    }
667
668    /// Sets the value of [net_bios_prefix][crate::model::ActiveDirectory::net_bios_prefix].
669    ///
670    /// # Example
671    /// ```ignore,no_run
672    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
673    /// let x = ActiveDirectory::new().set_net_bios_prefix("example");
674    /// ```
675    pub fn set_net_bios_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
676        self.net_bios_prefix = v.into();
677        self
678    }
679
680    /// Sets the value of [organizational_unit][crate::model::ActiveDirectory::organizational_unit].
681    ///
682    /// # Example
683    /// ```ignore,no_run
684    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
685    /// let x = ActiveDirectory::new().set_organizational_unit("example");
686    /// ```
687    pub fn set_organizational_unit<T: std::convert::Into<std::string::String>>(
688        mut self,
689        v: T,
690    ) -> Self {
691        self.organizational_unit = v.into();
692        self
693    }
694
695    /// Sets the value of [aes_encryption][crate::model::ActiveDirectory::aes_encryption].
696    ///
697    /// # Example
698    /// ```ignore,no_run
699    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
700    /// let x = ActiveDirectory::new().set_aes_encryption(true);
701    /// ```
702    pub fn set_aes_encryption<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
703        self.aes_encryption = v.into();
704        self
705    }
706
707    /// Sets the value of [username][crate::model::ActiveDirectory::username].
708    ///
709    /// # Example
710    /// ```ignore,no_run
711    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
712    /// let x = ActiveDirectory::new().set_username("example");
713    /// ```
714    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
715        self.username = v.into();
716        self
717    }
718
719    /// Sets the value of [password][crate::model::ActiveDirectory::password].
720    ///
721    /// # Example
722    /// ```ignore,no_run
723    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
724    /// let x = ActiveDirectory::new().set_password("example");
725    /// ```
726    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
727        self.password = v.into();
728        self
729    }
730
731    /// Sets the value of [backup_operators][crate::model::ActiveDirectory::backup_operators].
732    ///
733    /// # Example
734    /// ```ignore,no_run
735    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
736    /// let x = ActiveDirectory::new().set_backup_operators(["a", "b", "c"]);
737    /// ```
738    pub fn set_backup_operators<T, V>(mut self, v: T) -> Self
739    where
740        T: std::iter::IntoIterator<Item = V>,
741        V: std::convert::Into<std::string::String>,
742    {
743        use std::iter::Iterator;
744        self.backup_operators = v.into_iter().map(|i| i.into()).collect();
745        self
746    }
747
748    /// Sets the value of [administrators][crate::model::ActiveDirectory::administrators].
749    ///
750    /// # Example
751    /// ```ignore,no_run
752    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
753    /// let x = ActiveDirectory::new().set_administrators(["a", "b", "c"]);
754    /// ```
755    pub fn set_administrators<T, V>(mut self, v: T) -> Self
756    where
757        T: std::iter::IntoIterator<Item = V>,
758        V: std::convert::Into<std::string::String>,
759    {
760        use std::iter::Iterator;
761        self.administrators = v.into_iter().map(|i| i.into()).collect();
762        self
763    }
764
765    /// Sets the value of [security_operators][crate::model::ActiveDirectory::security_operators].
766    ///
767    /// # Example
768    /// ```ignore,no_run
769    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
770    /// let x = ActiveDirectory::new().set_security_operators(["a", "b", "c"]);
771    /// ```
772    pub fn set_security_operators<T, V>(mut self, v: T) -> Self
773    where
774        T: std::iter::IntoIterator<Item = V>,
775        V: std::convert::Into<std::string::String>,
776    {
777        use std::iter::Iterator;
778        self.security_operators = v.into_iter().map(|i| i.into()).collect();
779        self
780    }
781
782    /// Sets the value of [kdc_hostname][crate::model::ActiveDirectory::kdc_hostname].
783    ///
784    /// # Example
785    /// ```ignore,no_run
786    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
787    /// let x = ActiveDirectory::new().set_kdc_hostname("example");
788    /// ```
789    pub fn set_kdc_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
790        self.kdc_hostname = v.into();
791        self
792    }
793
794    /// Sets the value of [kdc_ip][crate::model::ActiveDirectory::kdc_ip].
795    ///
796    /// # Example
797    /// ```ignore,no_run
798    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
799    /// let x = ActiveDirectory::new().set_kdc_ip("example");
800    /// ```
801    pub fn set_kdc_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
802        self.kdc_ip = v.into();
803        self
804    }
805
806    /// Sets the value of [nfs_users_with_ldap][crate::model::ActiveDirectory::nfs_users_with_ldap].
807    ///
808    /// # Example
809    /// ```ignore,no_run
810    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
811    /// let x = ActiveDirectory::new().set_nfs_users_with_ldap(true);
812    /// ```
813    pub fn set_nfs_users_with_ldap<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
814        self.nfs_users_with_ldap = v.into();
815        self
816    }
817
818    /// Sets the value of [description][crate::model::ActiveDirectory::description].
819    ///
820    /// # Example
821    /// ```ignore,no_run
822    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
823    /// let x = ActiveDirectory::new().set_description("example");
824    /// ```
825    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
826        self.description = v.into();
827        self
828    }
829
830    /// Sets the value of [ldap_signing][crate::model::ActiveDirectory::ldap_signing].
831    ///
832    /// # Example
833    /// ```ignore,no_run
834    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
835    /// let x = ActiveDirectory::new().set_ldap_signing(true);
836    /// ```
837    pub fn set_ldap_signing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
838        self.ldap_signing = v.into();
839        self
840    }
841
842    /// Sets the value of [encrypt_dc_connections][crate::model::ActiveDirectory::encrypt_dc_connections].
843    ///
844    /// # Example
845    /// ```ignore,no_run
846    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
847    /// let x = ActiveDirectory::new().set_encrypt_dc_connections(true);
848    /// ```
849    pub fn set_encrypt_dc_connections<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
850        self.encrypt_dc_connections = v.into();
851        self
852    }
853
854    /// Sets the value of [labels][crate::model::ActiveDirectory::labels].
855    ///
856    /// # Example
857    /// ```ignore,no_run
858    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
859    /// let x = ActiveDirectory::new().set_labels([
860    ///     ("key0", "abc"),
861    ///     ("key1", "xyz"),
862    /// ]);
863    /// ```
864    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
865    where
866        T: std::iter::IntoIterator<Item = (K, V)>,
867        K: std::convert::Into<std::string::String>,
868        V: std::convert::Into<std::string::String>,
869    {
870        use std::iter::Iterator;
871        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
872        self
873    }
874
875    /// Sets the value of [state_details][crate::model::ActiveDirectory::state_details].
876    ///
877    /// # Example
878    /// ```ignore,no_run
879    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
880    /// let x = ActiveDirectory::new().set_state_details("example");
881    /// ```
882    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
883        self.state_details = v.into();
884        self
885    }
886}
887
888impl wkt::message::Message for ActiveDirectory {
889    fn typename() -> &'static str {
890        "type.googleapis.com/google.cloud.netapp.v1.ActiveDirectory"
891    }
892}
893
894/// Defines additional types related to [ActiveDirectory].
895pub mod active_directory {
896    #[allow(unused_imports)]
897    use super::*;
898
899    /// The Active Directory States
900    ///
901    /// # Working with unknown values
902    ///
903    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
904    /// additional enum variants at any time. Adding new variants is not considered
905    /// a breaking change. Applications should write their code in anticipation of:
906    ///
907    /// - New values appearing in future releases of the client library, **and**
908    /// - New values received dynamically, without application changes.
909    ///
910    /// Please consult the [Working with enums] section in the user guide for some
911    /// guidelines.
912    ///
913    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
914    #[derive(Clone, Debug, PartialEq)]
915    #[non_exhaustive]
916    pub enum State {
917        /// Unspecified Active Directory State
918        Unspecified,
919        /// Active Directory State is Creating
920        Creating,
921        /// Active Directory State is Ready
922        Ready,
923        /// Active Directory State is Updating
924        Updating,
925        /// Active Directory State is In use
926        InUse,
927        /// Active Directory State is Deleting
928        Deleting,
929        /// Active Directory State is Error
930        Error,
931        /// Active Directory State is Diagnosing.
932        Diagnosing,
933        /// If set, the enum was initialized with an unknown value.
934        ///
935        /// Applications can examine the value using [State::value] or
936        /// [State::name].
937        UnknownValue(state::UnknownValue),
938    }
939
940    #[doc(hidden)]
941    pub mod state {
942        #[allow(unused_imports)]
943        use super::*;
944        #[derive(Clone, Debug, PartialEq)]
945        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
946    }
947
948    impl State {
949        /// Gets the enum value.
950        ///
951        /// Returns `None` if the enum contains an unknown value deserialized from
952        /// the string representation of enums.
953        pub fn value(&self) -> std::option::Option<i32> {
954            match self {
955                Self::Unspecified => std::option::Option::Some(0),
956                Self::Creating => std::option::Option::Some(1),
957                Self::Ready => std::option::Option::Some(2),
958                Self::Updating => std::option::Option::Some(3),
959                Self::InUse => std::option::Option::Some(4),
960                Self::Deleting => std::option::Option::Some(5),
961                Self::Error => std::option::Option::Some(6),
962                Self::Diagnosing => std::option::Option::Some(7),
963                Self::UnknownValue(u) => u.0.value(),
964            }
965        }
966
967        /// Gets the enum value as a string.
968        ///
969        /// Returns `None` if the enum contains an unknown value deserialized from
970        /// the integer representation of enums.
971        pub fn name(&self) -> std::option::Option<&str> {
972            match self {
973                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
974                Self::Creating => std::option::Option::Some("CREATING"),
975                Self::Ready => std::option::Option::Some("READY"),
976                Self::Updating => std::option::Option::Some("UPDATING"),
977                Self::InUse => std::option::Option::Some("IN_USE"),
978                Self::Deleting => std::option::Option::Some("DELETING"),
979                Self::Error => std::option::Option::Some("ERROR"),
980                Self::Diagnosing => std::option::Option::Some("DIAGNOSING"),
981                Self::UnknownValue(u) => u.0.name(),
982            }
983        }
984    }
985
986    impl std::default::Default for State {
987        fn default() -> Self {
988            use std::convert::From;
989            Self::from(0)
990        }
991    }
992
993    impl std::fmt::Display for State {
994        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
995            wkt::internal::display_enum(f, self.name(), self.value())
996        }
997    }
998
999    impl std::convert::From<i32> for State {
1000        fn from(value: i32) -> Self {
1001            match value {
1002                0 => Self::Unspecified,
1003                1 => Self::Creating,
1004                2 => Self::Ready,
1005                3 => Self::Updating,
1006                4 => Self::InUse,
1007                5 => Self::Deleting,
1008                6 => Self::Error,
1009                7 => Self::Diagnosing,
1010                _ => Self::UnknownValue(state::UnknownValue(
1011                    wkt::internal::UnknownEnumValue::Integer(value),
1012                )),
1013            }
1014        }
1015    }
1016
1017    impl std::convert::From<&str> for State {
1018        fn from(value: &str) -> Self {
1019            use std::string::ToString;
1020            match value {
1021                "STATE_UNSPECIFIED" => Self::Unspecified,
1022                "CREATING" => Self::Creating,
1023                "READY" => Self::Ready,
1024                "UPDATING" => Self::Updating,
1025                "IN_USE" => Self::InUse,
1026                "DELETING" => Self::Deleting,
1027                "ERROR" => Self::Error,
1028                "DIAGNOSING" => Self::Diagnosing,
1029                _ => Self::UnknownValue(state::UnknownValue(
1030                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1031                )),
1032            }
1033        }
1034    }
1035
1036    impl serde::ser::Serialize for State {
1037        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1038        where
1039            S: serde::Serializer,
1040        {
1041            match self {
1042                Self::Unspecified => serializer.serialize_i32(0),
1043                Self::Creating => serializer.serialize_i32(1),
1044                Self::Ready => serializer.serialize_i32(2),
1045                Self::Updating => serializer.serialize_i32(3),
1046                Self::InUse => serializer.serialize_i32(4),
1047                Self::Deleting => serializer.serialize_i32(5),
1048                Self::Error => serializer.serialize_i32(6),
1049                Self::Diagnosing => serializer.serialize_i32(7),
1050                Self::UnknownValue(u) => u.0.serialize(serializer),
1051            }
1052        }
1053    }
1054
1055    impl<'de> serde::de::Deserialize<'de> for State {
1056        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1057        where
1058            D: serde::Deserializer<'de>,
1059        {
1060            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1061                ".google.cloud.netapp.v1.ActiveDirectory.State",
1062            ))
1063        }
1064    }
1065}
1066
1067/// A NetApp Backup.
1068#[derive(Clone, Default, PartialEq)]
1069#[non_exhaustive]
1070pub struct Backup {
1071    /// Identifier. The resource name of the backup.
1072    /// Format:
1073    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`.
1074    pub name: std::string::String,
1075
1076    /// Output only. The backup state.
1077    pub state: crate::model::backup::State,
1078
1079    /// A description of the backup with 2048 characters or less.
1080    /// Requests with longer descriptions will be rejected.
1081    pub description: std::string::String,
1082
1083    /// Output only. Size of the file system when the backup was created. When
1084    /// creating a new volume from the backup, the volume capacity will have to be
1085    /// at least as big.
1086    pub volume_usage_bytes: i64,
1087
1088    /// Output only. Type of backup, manually created or created by a backup
1089    /// policy.
1090    pub backup_type: crate::model::backup::Type,
1091
1092    /// Volume full name of this backup belongs to.
1093    /// Format:
1094    /// `projects/{projects_id}/locations/{location}/volumes/{volume_id}`
1095    pub source_volume: std::string::String,
1096
1097    /// If specified, backup will be created from the given snapshot.
1098    /// If not specified, there will be a new snapshot taken to initiate the backup
1099    /// creation. Format:
1100    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`
1101    pub source_snapshot: std::option::Option<std::string::String>,
1102
1103    /// Output only. The time when the backup was created.
1104    pub create_time: std::option::Option<wkt::Timestamp>,
1105
1106    /// Resource labels to represent user provided metadata.
1107    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1108
1109    /// Output only. Total size of all backups in a chain in bytes = baseline
1110    /// backup size + sum(incremental backup size)
1111    pub chain_storage_bytes: i64,
1112
1113    /// Output only. Reserved for future use
1114    pub satisfies_pzs: bool,
1115
1116    /// Output only. Reserved for future use
1117    pub satisfies_pzi: bool,
1118
1119    /// Output only. Region of the volume from which the backup was created.
1120    /// Format: `projects/{project_id}/locations/{location}`
1121    pub volume_region: std::string::String,
1122
1123    /// Output only. Region in which backup is stored.
1124    /// Format: `projects/{project_id}/locations/{location}`
1125    pub backup_region: std::string::String,
1126
1127    /// Output only. The time until which the backup is not deletable.
1128    pub enforced_retention_end_time: std::option::Option<wkt::Timestamp>,
1129
1130    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1131}
1132
1133impl Backup {
1134    pub fn new() -> Self {
1135        std::default::Default::default()
1136    }
1137
1138    /// Sets the value of [name][crate::model::Backup::name].
1139    ///
1140    /// # Example
1141    /// ```ignore,no_run
1142    /// # use google_cloud_netapp_v1::model::Backup;
1143    /// let x = Backup::new().set_name("example");
1144    /// ```
1145    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1146        self.name = v.into();
1147        self
1148    }
1149
1150    /// Sets the value of [state][crate::model::Backup::state].
1151    ///
1152    /// # Example
1153    /// ```ignore,no_run
1154    /// # use google_cloud_netapp_v1::model::Backup;
1155    /// use google_cloud_netapp_v1::model::backup::State;
1156    /// let x0 = Backup::new().set_state(State::Creating);
1157    /// let x1 = Backup::new().set_state(State::Uploading);
1158    /// let x2 = Backup::new().set_state(State::Ready);
1159    /// ```
1160    pub fn set_state<T: std::convert::Into<crate::model::backup::State>>(mut self, v: T) -> Self {
1161        self.state = v.into();
1162        self
1163    }
1164
1165    /// Sets the value of [description][crate::model::Backup::description].
1166    ///
1167    /// # Example
1168    /// ```ignore,no_run
1169    /// # use google_cloud_netapp_v1::model::Backup;
1170    /// let x = Backup::new().set_description("example");
1171    /// ```
1172    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1173        self.description = v.into();
1174        self
1175    }
1176
1177    /// Sets the value of [volume_usage_bytes][crate::model::Backup::volume_usage_bytes].
1178    ///
1179    /// # Example
1180    /// ```ignore,no_run
1181    /// # use google_cloud_netapp_v1::model::Backup;
1182    /// let x = Backup::new().set_volume_usage_bytes(42);
1183    /// ```
1184    pub fn set_volume_usage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1185        self.volume_usage_bytes = v.into();
1186        self
1187    }
1188
1189    /// Sets the value of [backup_type][crate::model::Backup::backup_type].
1190    ///
1191    /// # Example
1192    /// ```ignore,no_run
1193    /// # use google_cloud_netapp_v1::model::Backup;
1194    /// use google_cloud_netapp_v1::model::backup::Type;
1195    /// let x0 = Backup::new().set_backup_type(Type::Manual);
1196    /// let x1 = Backup::new().set_backup_type(Type::Scheduled);
1197    /// ```
1198    pub fn set_backup_type<T: std::convert::Into<crate::model::backup::Type>>(
1199        mut self,
1200        v: T,
1201    ) -> Self {
1202        self.backup_type = v.into();
1203        self
1204    }
1205
1206    /// Sets the value of [source_volume][crate::model::Backup::source_volume].
1207    ///
1208    /// # Example
1209    /// ```ignore,no_run
1210    /// # use google_cloud_netapp_v1::model::Backup;
1211    /// let x = Backup::new().set_source_volume("example");
1212    /// ```
1213    pub fn set_source_volume<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1214        self.source_volume = v.into();
1215        self
1216    }
1217
1218    /// Sets the value of [source_snapshot][crate::model::Backup::source_snapshot].
1219    ///
1220    /// # Example
1221    /// ```ignore,no_run
1222    /// # use google_cloud_netapp_v1::model::Backup;
1223    /// let x = Backup::new().set_source_snapshot("example");
1224    /// ```
1225    pub fn set_source_snapshot<T>(mut self, v: T) -> Self
1226    where
1227        T: std::convert::Into<std::string::String>,
1228    {
1229        self.source_snapshot = std::option::Option::Some(v.into());
1230        self
1231    }
1232
1233    /// Sets or clears the value of [source_snapshot][crate::model::Backup::source_snapshot].
1234    ///
1235    /// # Example
1236    /// ```ignore,no_run
1237    /// # use google_cloud_netapp_v1::model::Backup;
1238    /// let x = Backup::new().set_or_clear_source_snapshot(Some("example"));
1239    /// let x = Backup::new().set_or_clear_source_snapshot(None::<String>);
1240    /// ```
1241    pub fn set_or_clear_source_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
1242    where
1243        T: std::convert::Into<std::string::String>,
1244    {
1245        self.source_snapshot = v.map(|x| x.into());
1246        self
1247    }
1248
1249    /// Sets the value of [create_time][crate::model::Backup::create_time].
1250    ///
1251    /// # Example
1252    /// ```ignore,no_run
1253    /// # use google_cloud_netapp_v1::model::Backup;
1254    /// use wkt::Timestamp;
1255    /// let x = Backup::new().set_create_time(Timestamp::default()/* use setters */);
1256    /// ```
1257    pub fn set_create_time<T>(mut self, v: T) -> Self
1258    where
1259        T: std::convert::Into<wkt::Timestamp>,
1260    {
1261        self.create_time = std::option::Option::Some(v.into());
1262        self
1263    }
1264
1265    /// Sets or clears the value of [create_time][crate::model::Backup::create_time].
1266    ///
1267    /// # Example
1268    /// ```ignore,no_run
1269    /// # use google_cloud_netapp_v1::model::Backup;
1270    /// use wkt::Timestamp;
1271    /// let x = Backup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1272    /// let x = Backup::new().set_or_clear_create_time(None::<Timestamp>);
1273    /// ```
1274    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1275    where
1276        T: std::convert::Into<wkt::Timestamp>,
1277    {
1278        self.create_time = v.map(|x| x.into());
1279        self
1280    }
1281
1282    /// Sets the value of [labels][crate::model::Backup::labels].
1283    ///
1284    /// # Example
1285    /// ```ignore,no_run
1286    /// # use google_cloud_netapp_v1::model::Backup;
1287    /// let x = Backup::new().set_labels([
1288    ///     ("key0", "abc"),
1289    ///     ("key1", "xyz"),
1290    /// ]);
1291    /// ```
1292    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1293    where
1294        T: std::iter::IntoIterator<Item = (K, V)>,
1295        K: std::convert::Into<std::string::String>,
1296        V: std::convert::Into<std::string::String>,
1297    {
1298        use std::iter::Iterator;
1299        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1300        self
1301    }
1302
1303    /// Sets the value of [chain_storage_bytes][crate::model::Backup::chain_storage_bytes].
1304    ///
1305    /// # Example
1306    /// ```ignore,no_run
1307    /// # use google_cloud_netapp_v1::model::Backup;
1308    /// let x = Backup::new().set_chain_storage_bytes(42);
1309    /// ```
1310    pub fn set_chain_storage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1311        self.chain_storage_bytes = v.into();
1312        self
1313    }
1314
1315    /// Sets the value of [satisfies_pzs][crate::model::Backup::satisfies_pzs].
1316    ///
1317    /// # Example
1318    /// ```ignore,no_run
1319    /// # use google_cloud_netapp_v1::model::Backup;
1320    /// let x = Backup::new().set_satisfies_pzs(true);
1321    /// ```
1322    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1323        self.satisfies_pzs = v.into();
1324        self
1325    }
1326
1327    /// Sets the value of [satisfies_pzi][crate::model::Backup::satisfies_pzi].
1328    ///
1329    /// # Example
1330    /// ```ignore,no_run
1331    /// # use google_cloud_netapp_v1::model::Backup;
1332    /// let x = Backup::new().set_satisfies_pzi(true);
1333    /// ```
1334    pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1335        self.satisfies_pzi = v.into();
1336        self
1337    }
1338
1339    /// Sets the value of [volume_region][crate::model::Backup::volume_region].
1340    ///
1341    /// # Example
1342    /// ```ignore,no_run
1343    /// # use google_cloud_netapp_v1::model::Backup;
1344    /// let x = Backup::new().set_volume_region("example");
1345    /// ```
1346    pub fn set_volume_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1347        self.volume_region = v.into();
1348        self
1349    }
1350
1351    /// Sets the value of [backup_region][crate::model::Backup::backup_region].
1352    ///
1353    /// # Example
1354    /// ```ignore,no_run
1355    /// # use google_cloud_netapp_v1::model::Backup;
1356    /// let x = Backup::new().set_backup_region("example");
1357    /// ```
1358    pub fn set_backup_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1359        self.backup_region = v.into();
1360        self
1361    }
1362
1363    /// Sets the value of [enforced_retention_end_time][crate::model::Backup::enforced_retention_end_time].
1364    ///
1365    /// # Example
1366    /// ```ignore,no_run
1367    /// # use google_cloud_netapp_v1::model::Backup;
1368    /// use wkt::Timestamp;
1369    /// let x = Backup::new().set_enforced_retention_end_time(Timestamp::default()/* use setters */);
1370    /// ```
1371    pub fn set_enforced_retention_end_time<T>(mut self, v: T) -> Self
1372    where
1373        T: std::convert::Into<wkt::Timestamp>,
1374    {
1375        self.enforced_retention_end_time = std::option::Option::Some(v.into());
1376        self
1377    }
1378
1379    /// Sets or clears the value of [enforced_retention_end_time][crate::model::Backup::enforced_retention_end_time].
1380    ///
1381    /// # Example
1382    /// ```ignore,no_run
1383    /// # use google_cloud_netapp_v1::model::Backup;
1384    /// use wkt::Timestamp;
1385    /// let x = Backup::new().set_or_clear_enforced_retention_end_time(Some(Timestamp::default()/* use setters */));
1386    /// let x = Backup::new().set_or_clear_enforced_retention_end_time(None::<Timestamp>);
1387    /// ```
1388    pub fn set_or_clear_enforced_retention_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1389    where
1390        T: std::convert::Into<wkt::Timestamp>,
1391    {
1392        self.enforced_retention_end_time = v.map(|x| x.into());
1393        self
1394    }
1395}
1396
1397impl wkt::message::Message for Backup {
1398    fn typename() -> &'static str {
1399        "type.googleapis.com/google.cloud.netapp.v1.Backup"
1400    }
1401}
1402
1403/// Defines additional types related to [Backup].
1404pub mod backup {
1405    #[allow(unused_imports)]
1406    use super::*;
1407
1408    /// The Backup States
1409    ///
1410    /// # Working with unknown values
1411    ///
1412    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1413    /// additional enum variants at any time. Adding new variants is not considered
1414    /// a breaking change. Applications should write their code in anticipation of:
1415    ///
1416    /// - New values appearing in future releases of the client library, **and**
1417    /// - New values received dynamically, without application changes.
1418    ///
1419    /// Please consult the [Working with enums] section in the user guide for some
1420    /// guidelines.
1421    ///
1422    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1423    #[derive(Clone, Debug, PartialEq)]
1424    #[non_exhaustive]
1425    pub enum State {
1426        /// State not set.
1427        Unspecified,
1428        /// Backup is being created. While in this state, the snapshot for the backup
1429        /// point-in-time may not have been created yet, and so the point-in-time may
1430        /// not have been fixed.
1431        Creating,
1432        /// Backup is being uploaded. While in this state, none of the writes to the
1433        /// volume will be included in the backup.
1434        Uploading,
1435        /// Backup is available for use.
1436        Ready,
1437        /// Backup is being deleted.
1438        Deleting,
1439        /// Backup is not valid and cannot be used for creating new volumes or
1440        /// restoring existing volumes.
1441        Error,
1442        /// Backup is being updated.
1443        Updating,
1444        /// If set, the enum was initialized with an unknown value.
1445        ///
1446        /// Applications can examine the value using [State::value] or
1447        /// [State::name].
1448        UnknownValue(state::UnknownValue),
1449    }
1450
1451    #[doc(hidden)]
1452    pub mod state {
1453        #[allow(unused_imports)]
1454        use super::*;
1455        #[derive(Clone, Debug, PartialEq)]
1456        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1457    }
1458
1459    impl State {
1460        /// Gets the enum value.
1461        ///
1462        /// Returns `None` if the enum contains an unknown value deserialized from
1463        /// the string representation of enums.
1464        pub fn value(&self) -> std::option::Option<i32> {
1465            match self {
1466                Self::Unspecified => std::option::Option::Some(0),
1467                Self::Creating => std::option::Option::Some(1),
1468                Self::Uploading => std::option::Option::Some(2),
1469                Self::Ready => std::option::Option::Some(3),
1470                Self::Deleting => std::option::Option::Some(4),
1471                Self::Error => std::option::Option::Some(5),
1472                Self::Updating => std::option::Option::Some(6),
1473                Self::UnknownValue(u) => u.0.value(),
1474            }
1475        }
1476
1477        /// Gets the enum value as a string.
1478        ///
1479        /// Returns `None` if the enum contains an unknown value deserialized from
1480        /// the integer representation of enums.
1481        pub fn name(&self) -> std::option::Option<&str> {
1482            match self {
1483                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1484                Self::Creating => std::option::Option::Some("CREATING"),
1485                Self::Uploading => std::option::Option::Some("UPLOADING"),
1486                Self::Ready => std::option::Option::Some("READY"),
1487                Self::Deleting => std::option::Option::Some("DELETING"),
1488                Self::Error => std::option::Option::Some("ERROR"),
1489                Self::Updating => std::option::Option::Some("UPDATING"),
1490                Self::UnknownValue(u) => u.0.name(),
1491            }
1492        }
1493    }
1494
1495    impl std::default::Default for State {
1496        fn default() -> Self {
1497            use std::convert::From;
1498            Self::from(0)
1499        }
1500    }
1501
1502    impl std::fmt::Display for State {
1503        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1504            wkt::internal::display_enum(f, self.name(), self.value())
1505        }
1506    }
1507
1508    impl std::convert::From<i32> for State {
1509        fn from(value: i32) -> Self {
1510            match value {
1511                0 => Self::Unspecified,
1512                1 => Self::Creating,
1513                2 => Self::Uploading,
1514                3 => Self::Ready,
1515                4 => Self::Deleting,
1516                5 => Self::Error,
1517                6 => Self::Updating,
1518                _ => Self::UnknownValue(state::UnknownValue(
1519                    wkt::internal::UnknownEnumValue::Integer(value),
1520                )),
1521            }
1522        }
1523    }
1524
1525    impl std::convert::From<&str> for State {
1526        fn from(value: &str) -> Self {
1527            use std::string::ToString;
1528            match value {
1529                "STATE_UNSPECIFIED" => Self::Unspecified,
1530                "CREATING" => Self::Creating,
1531                "UPLOADING" => Self::Uploading,
1532                "READY" => Self::Ready,
1533                "DELETING" => Self::Deleting,
1534                "ERROR" => Self::Error,
1535                "UPDATING" => Self::Updating,
1536                _ => Self::UnknownValue(state::UnknownValue(
1537                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1538                )),
1539            }
1540        }
1541    }
1542
1543    impl serde::ser::Serialize for State {
1544        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1545        where
1546            S: serde::Serializer,
1547        {
1548            match self {
1549                Self::Unspecified => serializer.serialize_i32(0),
1550                Self::Creating => serializer.serialize_i32(1),
1551                Self::Uploading => serializer.serialize_i32(2),
1552                Self::Ready => serializer.serialize_i32(3),
1553                Self::Deleting => serializer.serialize_i32(4),
1554                Self::Error => serializer.serialize_i32(5),
1555                Self::Updating => serializer.serialize_i32(6),
1556                Self::UnknownValue(u) => u.0.serialize(serializer),
1557            }
1558        }
1559    }
1560
1561    impl<'de> serde::de::Deserialize<'de> for State {
1562        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1563        where
1564            D: serde::Deserializer<'de>,
1565        {
1566            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1567                ".google.cloud.netapp.v1.Backup.State",
1568            ))
1569        }
1570    }
1571
1572    /// Backup types.
1573    ///
1574    /// # Working with unknown values
1575    ///
1576    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1577    /// additional enum variants at any time. Adding new variants is not considered
1578    /// a breaking change. Applications should write their code in anticipation of:
1579    ///
1580    /// - New values appearing in future releases of the client library, **and**
1581    /// - New values received dynamically, without application changes.
1582    ///
1583    /// Please consult the [Working with enums] section in the user guide for some
1584    /// guidelines.
1585    ///
1586    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1587    #[derive(Clone, Debug, PartialEq)]
1588    #[non_exhaustive]
1589    pub enum Type {
1590        /// Unspecified backup type.
1591        Unspecified,
1592        /// Manual backup type.
1593        Manual,
1594        /// Scheduled backup type.
1595        Scheduled,
1596        /// If set, the enum was initialized with an unknown value.
1597        ///
1598        /// Applications can examine the value using [Type::value] or
1599        /// [Type::name].
1600        UnknownValue(r#type::UnknownValue),
1601    }
1602
1603    #[doc(hidden)]
1604    pub mod r#type {
1605        #[allow(unused_imports)]
1606        use super::*;
1607        #[derive(Clone, Debug, PartialEq)]
1608        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1609    }
1610
1611    impl Type {
1612        /// Gets the enum value.
1613        ///
1614        /// Returns `None` if the enum contains an unknown value deserialized from
1615        /// the string representation of enums.
1616        pub fn value(&self) -> std::option::Option<i32> {
1617            match self {
1618                Self::Unspecified => std::option::Option::Some(0),
1619                Self::Manual => std::option::Option::Some(1),
1620                Self::Scheduled => std::option::Option::Some(2),
1621                Self::UnknownValue(u) => u.0.value(),
1622            }
1623        }
1624
1625        /// Gets the enum value as a string.
1626        ///
1627        /// Returns `None` if the enum contains an unknown value deserialized from
1628        /// the integer representation of enums.
1629        pub fn name(&self) -> std::option::Option<&str> {
1630            match self {
1631                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
1632                Self::Manual => std::option::Option::Some("MANUAL"),
1633                Self::Scheduled => std::option::Option::Some("SCHEDULED"),
1634                Self::UnknownValue(u) => u.0.name(),
1635            }
1636        }
1637    }
1638
1639    impl std::default::Default for Type {
1640        fn default() -> Self {
1641            use std::convert::From;
1642            Self::from(0)
1643        }
1644    }
1645
1646    impl std::fmt::Display for Type {
1647        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1648            wkt::internal::display_enum(f, self.name(), self.value())
1649        }
1650    }
1651
1652    impl std::convert::From<i32> for Type {
1653        fn from(value: i32) -> Self {
1654            match value {
1655                0 => Self::Unspecified,
1656                1 => Self::Manual,
1657                2 => Self::Scheduled,
1658                _ => Self::UnknownValue(r#type::UnknownValue(
1659                    wkt::internal::UnknownEnumValue::Integer(value),
1660                )),
1661            }
1662        }
1663    }
1664
1665    impl std::convert::From<&str> for Type {
1666        fn from(value: &str) -> Self {
1667            use std::string::ToString;
1668            match value {
1669                "TYPE_UNSPECIFIED" => Self::Unspecified,
1670                "MANUAL" => Self::Manual,
1671                "SCHEDULED" => Self::Scheduled,
1672                _ => Self::UnknownValue(r#type::UnknownValue(
1673                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1674                )),
1675            }
1676        }
1677    }
1678
1679    impl serde::ser::Serialize for Type {
1680        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1681        where
1682            S: serde::Serializer,
1683        {
1684            match self {
1685                Self::Unspecified => serializer.serialize_i32(0),
1686                Self::Manual => serializer.serialize_i32(1),
1687                Self::Scheduled => serializer.serialize_i32(2),
1688                Self::UnknownValue(u) => u.0.serialize(serializer),
1689            }
1690        }
1691    }
1692
1693    impl<'de> serde::de::Deserialize<'de> for Type {
1694        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1695        where
1696            D: serde::Deserializer<'de>,
1697        {
1698            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
1699                ".google.cloud.netapp.v1.Backup.Type",
1700            ))
1701        }
1702    }
1703}
1704
1705/// ListBackupsRequest lists backups.
1706#[derive(Clone, Default, PartialEq)]
1707#[non_exhaustive]
1708pub struct ListBackupsRequest {
1709    /// Required. The backupVault for which to retrieve backup information,
1710    /// in the format
1711    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`.
1712    /// To retrieve backup information for all locations, use "-" for the
1713    /// `{location}` value.
1714    /// To retrieve backup information for all backupVaults, use "-" for the
1715    /// `{backup_vault_id}` value.
1716    /// To retrieve backup information for a volume, use "-" for the
1717    /// `{backup_vault_id}` value and specify volume full name with the filter.
1718    pub parent: std::string::String,
1719
1720    /// The maximum number of items to return. The service may return fewer
1721    /// than this value. The maximum value
1722    /// is 1000; values above 1000 will be coerced to 1000.
1723    pub page_size: i32,
1724
1725    /// The next_page_token value to use if there are additional
1726    /// results to retrieve for this list request.
1727    pub page_token: std::string::String,
1728
1729    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
1730    pub order_by: std::string::String,
1731
1732    /// The standard list filter.
1733    /// If specified, backups will be returned based on the attribute name that
1734    /// matches the filter expression. If empty, then no backups are filtered out.
1735    /// See <https://google.aip.dev/160>
1736    pub filter: std::string::String,
1737
1738    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1739}
1740
1741impl ListBackupsRequest {
1742    pub fn new() -> Self {
1743        std::default::Default::default()
1744    }
1745
1746    /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
1747    ///
1748    /// # Example
1749    /// ```ignore,no_run
1750    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1751    /// let x = ListBackupsRequest::new().set_parent("example");
1752    /// ```
1753    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1754        self.parent = v.into();
1755        self
1756    }
1757
1758    /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
1759    ///
1760    /// # Example
1761    /// ```ignore,no_run
1762    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1763    /// let x = ListBackupsRequest::new().set_page_size(42);
1764    /// ```
1765    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1766        self.page_size = v.into();
1767        self
1768    }
1769
1770    /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
1771    ///
1772    /// # Example
1773    /// ```ignore,no_run
1774    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1775    /// let x = ListBackupsRequest::new().set_page_token("example");
1776    /// ```
1777    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1778        self.page_token = v.into();
1779        self
1780    }
1781
1782    /// Sets the value of [order_by][crate::model::ListBackupsRequest::order_by].
1783    ///
1784    /// # Example
1785    /// ```ignore,no_run
1786    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1787    /// let x = ListBackupsRequest::new().set_order_by("example");
1788    /// ```
1789    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1790        self.order_by = v.into();
1791        self
1792    }
1793
1794    /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
1795    ///
1796    /// # Example
1797    /// ```ignore,no_run
1798    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1799    /// let x = ListBackupsRequest::new().set_filter("example");
1800    /// ```
1801    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1802        self.filter = v.into();
1803        self
1804    }
1805}
1806
1807impl wkt::message::Message for ListBackupsRequest {
1808    fn typename() -> &'static str {
1809        "type.googleapis.com/google.cloud.netapp.v1.ListBackupsRequest"
1810    }
1811}
1812
1813/// ListBackupsResponse is the result of ListBackupsRequest.
1814#[derive(Clone, Default, PartialEq)]
1815#[non_exhaustive]
1816pub struct ListBackupsResponse {
1817    /// A list of backups in the project.
1818    pub backups: std::vec::Vec<crate::model::Backup>,
1819
1820    /// The token you can use to retrieve the next page of results. Not returned
1821    /// if there are no more results in the list.
1822    pub next_page_token: std::string::String,
1823
1824    /// Locations that could not be reached.
1825    pub unreachable: std::vec::Vec<std::string::String>,
1826
1827    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1828}
1829
1830impl ListBackupsResponse {
1831    pub fn new() -> Self {
1832        std::default::Default::default()
1833    }
1834
1835    /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
1836    ///
1837    /// # Example
1838    /// ```ignore,no_run
1839    /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1840    /// use google_cloud_netapp_v1::model::Backup;
1841    /// let x = ListBackupsResponse::new()
1842    ///     .set_backups([
1843    ///         Backup::default()/* use setters */,
1844    ///         Backup::default()/* use (different) setters */,
1845    ///     ]);
1846    /// ```
1847    pub fn set_backups<T, V>(mut self, v: T) -> Self
1848    where
1849        T: std::iter::IntoIterator<Item = V>,
1850        V: std::convert::Into<crate::model::Backup>,
1851    {
1852        use std::iter::Iterator;
1853        self.backups = v.into_iter().map(|i| i.into()).collect();
1854        self
1855    }
1856
1857    /// Sets the value of [next_page_token][crate::model::ListBackupsResponse::next_page_token].
1858    ///
1859    /// # Example
1860    /// ```ignore,no_run
1861    /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1862    /// let x = ListBackupsResponse::new().set_next_page_token("example");
1863    /// ```
1864    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1865        self.next_page_token = v.into();
1866        self
1867    }
1868
1869    /// Sets the value of [unreachable][crate::model::ListBackupsResponse::unreachable].
1870    ///
1871    /// # Example
1872    /// ```ignore,no_run
1873    /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1874    /// let x = ListBackupsResponse::new().set_unreachable(["a", "b", "c"]);
1875    /// ```
1876    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1877    where
1878        T: std::iter::IntoIterator<Item = V>,
1879        V: std::convert::Into<std::string::String>,
1880    {
1881        use std::iter::Iterator;
1882        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1883        self
1884    }
1885}
1886
1887impl wkt::message::Message for ListBackupsResponse {
1888    fn typename() -> &'static str {
1889        "type.googleapis.com/google.cloud.netapp.v1.ListBackupsResponse"
1890    }
1891}
1892
1893#[doc(hidden)]
1894impl gax::paginator::internal::PageableResponse for ListBackupsResponse {
1895    type PageItem = crate::model::Backup;
1896
1897    fn items(self) -> std::vec::Vec<Self::PageItem> {
1898        self.backups
1899    }
1900
1901    fn next_page_token(&self) -> std::string::String {
1902        use std::clone::Clone;
1903        self.next_page_token.clone()
1904    }
1905}
1906
1907/// GetBackupRequest gets the state of a backup.
1908#[derive(Clone, Default, PartialEq)]
1909#[non_exhaustive]
1910pub struct GetBackupRequest {
1911    /// Required. The backup resource name, in the format
1912    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
1913    pub name: std::string::String,
1914
1915    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1916}
1917
1918impl GetBackupRequest {
1919    pub fn new() -> Self {
1920        std::default::Default::default()
1921    }
1922
1923    /// Sets the value of [name][crate::model::GetBackupRequest::name].
1924    ///
1925    /// # Example
1926    /// ```ignore,no_run
1927    /// # use google_cloud_netapp_v1::model::GetBackupRequest;
1928    /// let x = GetBackupRequest::new().set_name("example");
1929    /// ```
1930    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1931        self.name = v.into();
1932        self
1933    }
1934}
1935
1936impl wkt::message::Message for GetBackupRequest {
1937    fn typename() -> &'static str {
1938        "type.googleapis.com/google.cloud.netapp.v1.GetBackupRequest"
1939    }
1940}
1941
1942/// CreateBackupRequest creates a backup.
1943#[derive(Clone, Default, PartialEq)]
1944#[non_exhaustive]
1945pub struct CreateBackupRequest {
1946    /// Required. The NetApp backupVault to create the backups of, in the format
1947    /// `projects/*/locations/*/backupVaults/{backup_vault_id}`
1948    pub parent: std::string::String,
1949
1950    /// Required. The ID to use for the backup.
1951    /// The ID must be unique within the specified backupVault.
1952    /// Must contain only letters, numbers and hyphen, with the first
1953    /// character a letter, the last a letter or a
1954    /// number, and a 63 character maximum.
1955    pub backup_id: std::string::String,
1956
1957    /// Required. A backup resource
1958    pub backup: std::option::Option<crate::model::Backup>,
1959
1960    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1961}
1962
1963impl CreateBackupRequest {
1964    pub fn new() -> Self {
1965        std::default::Default::default()
1966    }
1967
1968    /// Sets the value of [parent][crate::model::CreateBackupRequest::parent].
1969    ///
1970    /// # Example
1971    /// ```ignore,no_run
1972    /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
1973    /// let x = CreateBackupRequest::new().set_parent("example");
1974    /// ```
1975    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1976        self.parent = v.into();
1977        self
1978    }
1979
1980    /// Sets the value of [backup_id][crate::model::CreateBackupRequest::backup_id].
1981    ///
1982    /// # Example
1983    /// ```ignore,no_run
1984    /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
1985    /// let x = CreateBackupRequest::new().set_backup_id("example");
1986    /// ```
1987    pub fn set_backup_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1988        self.backup_id = v.into();
1989        self
1990    }
1991
1992    /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
1993    ///
1994    /// # Example
1995    /// ```ignore,no_run
1996    /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
1997    /// use google_cloud_netapp_v1::model::Backup;
1998    /// let x = CreateBackupRequest::new().set_backup(Backup::default()/* use setters */);
1999    /// ```
2000    pub fn set_backup<T>(mut self, v: T) -> Self
2001    where
2002        T: std::convert::Into<crate::model::Backup>,
2003    {
2004        self.backup = std::option::Option::Some(v.into());
2005        self
2006    }
2007
2008    /// Sets or clears the value of [backup][crate::model::CreateBackupRequest::backup].
2009    ///
2010    /// # Example
2011    /// ```ignore,no_run
2012    /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
2013    /// use google_cloud_netapp_v1::model::Backup;
2014    /// let x = CreateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
2015    /// let x = CreateBackupRequest::new().set_or_clear_backup(None::<Backup>);
2016    /// ```
2017    pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
2018    where
2019        T: std::convert::Into<crate::model::Backup>,
2020    {
2021        self.backup = v.map(|x| x.into());
2022        self
2023    }
2024}
2025
2026impl wkt::message::Message for CreateBackupRequest {
2027    fn typename() -> &'static str {
2028        "type.googleapis.com/google.cloud.netapp.v1.CreateBackupRequest"
2029    }
2030}
2031
2032/// DeleteBackupRequest deletes a backup.
2033#[derive(Clone, Default, PartialEq)]
2034#[non_exhaustive]
2035pub struct DeleteBackupRequest {
2036    /// Required. The backup resource name, in the format
2037    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
2038    pub name: std::string::String,
2039
2040    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2041}
2042
2043impl DeleteBackupRequest {
2044    pub fn new() -> Self {
2045        std::default::Default::default()
2046    }
2047
2048    /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
2049    ///
2050    /// # Example
2051    /// ```ignore,no_run
2052    /// # use google_cloud_netapp_v1::model::DeleteBackupRequest;
2053    /// let x = DeleteBackupRequest::new().set_name("example");
2054    /// ```
2055    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2056        self.name = v.into();
2057        self
2058    }
2059}
2060
2061impl wkt::message::Message for DeleteBackupRequest {
2062    fn typename() -> &'static str {
2063        "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupRequest"
2064    }
2065}
2066
2067/// UpdateBackupRequest updates description and/or labels for a backup.
2068#[derive(Clone, Default, PartialEq)]
2069#[non_exhaustive]
2070pub struct UpdateBackupRequest {
2071    /// Required. Field mask is used to specify the fields to be overwritten in the
2072    /// Backup resource to be updated.
2073    /// The fields specified in the update_mask are relative to the resource, not
2074    /// the full request. A field will be overwritten if it is in the mask. If the
2075    /// user does not provide a mask then all fields will be overwritten.
2076    pub update_mask: std::option::Option<wkt::FieldMask>,
2077
2078    /// Required. The backup being updated
2079    pub backup: std::option::Option<crate::model::Backup>,
2080
2081    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2082}
2083
2084impl UpdateBackupRequest {
2085    pub fn new() -> Self {
2086        std::default::Default::default()
2087    }
2088
2089    /// Sets the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
2090    ///
2091    /// # Example
2092    /// ```ignore,no_run
2093    /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2094    /// use wkt::FieldMask;
2095    /// let x = UpdateBackupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2096    /// ```
2097    pub fn set_update_mask<T>(mut self, v: T) -> Self
2098    where
2099        T: std::convert::Into<wkt::FieldMask>,
2100    {
2101        self.update_mask = std::option::Option::Some(v.into());
2102        self
2103    }
2104
2105    /// Sets or clears the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
2106    ///
2107    /// # Example
2108    /// ```ignore,no_run
2109    /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2110    /// use wkt::FieldMask;
2111    /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2112    /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2113    /// ```
2114    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2115    where
2116        T: std::convert::Into<wkt::FieldMask>,
2117    {
2118        self.update_mask = v.map(|x| x.into());
2119        self
2120    }
2121
2122    /// Sets the value of [backup][crate::model::UpdateBackupRequest::backup].
2123    ///
2124    /// # Example
2125    /// ```ignore,no_run
2126    /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2127    /// use google_cloud_netapp_v1::model::Backup;
2128    /// let x = UpdateBackupRequest::new().set_backup(Backup::default()/* use setters */);
2129    /// ```
2130    pub fn set_backup<T>(mut self, v: T) -> Self
2131    where
2132        T: std::convert::Into<crate::model::Backup>,
2133    {
2134        self.backup = std::option::Option::Some(v.into());
2135        self
2136    }
2137
2138    /// Sets or clears the value of [backup][crate::model::UpdateBackupRequest::backup].
2139    ///
2140    /// # Example
2141    /// ```ignore,no_run
2142    /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2143    /// use google_cloud_netapp_v1::model::Backup;
2144    /// let x = UpdateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
2145    /// let x = UpdateBackupRequest::new().set_or_clear_backup(None::<Backup>);
2146    /// ```
2147    pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
2148    where
2149        T: std::convert::Into<crate::model::Backup>,
2150    {
2151        self.backup = v.map(|x| x.into());
2152        self
2153    }
2154}
2155
2156impl wkt::message::Message for UpdateBackupRequest {
2157    fn typename() -> &'static str {
2158        "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupRequest"
2159    }
2160}
2161
2162/// Backup Policy.
2163#[derive(Clone, Default, PartialEq)]
2164#[non_exhaustive]
2165pub struct BackupPolicy {
2166    /// Identifier. The resource name of the backup policy.
2167    /// Format:
2168    /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`.
2169    pub name: std::string::String,
2170
2171    /// Number of daily backups to keep. Note that the minimum daily backup limit
2172    /// is 2.
2173    pub daily_backup_limit: std::option::Option<i32>,
2174
2175    /// Number of weekly backups to keep. Note that the sum of daily, weekly and
2176    /// monthly backups should be greater than 1.
2177    pub weekly_backup_limit: std::option::Option<i32>,
2178
2179    /// Number of monthly backups to keep. Note that the sum of daily, weekly and
2180    /// monthly backups should be greater than 1.
2181    pub monthly_backup_limit: std::option::Option<i32>,
2182
2183    /// Description of the backup policy.
2184    pub description: std::option::Option<std::string::String>,
2185
2186    /// If enabled, make backups automatically according to the schedules.
2187    /// This will be applied to all volumes that have this policy attached and
2188    /// enforced on volume level. If not specified, default is true.
2189    pub enabled: std::option::Option<bool>,
2190
2191    /// Output only. The total number of volumes assigned by this backup policy.
2192    pub assigned_volume_count: std::option::Option<i32>,
2193
2194    /// Output only. The time when the backup policy was created.
2195    pub create_time: std::option::Option<wkt::Timestamp>,
2196
2197    /// Resource labels to represent user provided metadata.
2198    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2199
2200    /// Output only. The backup policy state.
2201    pub state: crate::model::backup_policy::State,
2202
2203    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2204}
2205
2206impl BackupPolicy {
2207    pub fn new() -> Self {
2208        std::default::Default::default()
2209    }
2210
2211    /// Sets the value of [name][crate::model::BackupPolicy::name].
2212    ///
2213    /// # Example
2214    /// ```ignore,no_run
2215    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2216    /// let x = BackupPolicy::new().set_name("example");
2217    /// ```
2218    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2219        self.name = v.into();
2220        self
2221    }
2222
2223    /// Sets the value of [daily_backup_limit][crate::model::BackupPolicy::daily_backup_limit].
2224    ///
2225    /// # Example
2226    /// ```ignore,no_run
2227    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2228    /// let x = BackupPolicy::new().set_daily_backup_limit(42);
2229    /// ```
2230    pub fn set_daily_backup_limit<T>(mut self, v: T) -> Self
2231    where
2232        T: std::convert::Into<i32>,
2233    {
2234        self.daily_backup_limit = std::option::Option::Some(v.into());
2235        self
2236    }
2237
2238    /// Sets or clears the value of [daily_backup_limit][crate::model::BackupPolicy::daily_backup_limit].
2239    ///
2240    /// # Example
2241    /// ```ignore,no_run
2242    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2243    /// let x = BackupPolicy::new().set_or_clear_daily_backup_limit(Some(42));
2244    /// let x = BackupPolicy::new().set_or_clear_daily_backup_limit(None::<i32>);
2245    /// ```
2246    pub fn set_or_clear_daily_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2247    where
2248        T: std::convert::Into<i32>,
2249    {
2250        self.daily_backup_limit = v.map(|x| x.into());
2251        self
2252    }
2253
2254    /// Sets the value of [weekly_backup_limit][crate::model::BackupPolicy::weekly_backup_limit].
2255    ///
2256    /// # Example
2257    /// ```ignore,no_run
2258    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2259    /// let x = BackupPolicy::new().set_weekly_backup_limit(42);
2260    /// ```
2261    pub fn set_weekly_backup_limit<T>(mut self, v: T) -> Self
2262    where
2263        T: std::convert::Into<i32>,
2264    {
2265        self.weekly_backup_limit = std::option::Option::Some(v.into());
2266        self
2267    }
2268
2269    /// Sets or clears the value of [weekly_backup_limit][crate::model::BackupPolicy::weekly_backup_limit].
2270    ///
2271    /// # Example
2272    /// ```ignore,no_run
2273    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2274    /// let x = BackupPolicy::new().set_or_clear_weekly_backup_limit(Some(42));
2275    /// let x = BackupPolicy::new().set_or_clear_weekly_backup_limit(None::<i32>);
2276    /// ```
2277    pub fn set_or_clear_weekly_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2278    where
2279        T: std::convert::Into<i32>,
2280    {
2281        self.weekly_backup_limit = v.map(|x| x.into());
2282        self
2283    }
2284
2285    /// Sets the value of [monthly_backup_limit][crate::model::BackupPolicy::monthly_backup_limit].
2286    ///
2287    /// # Example
2288    /// ```ignore,no_run
2289    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2290    /// let x = BackupPolicy::new().set_monthly_backup_limit(42);
2291    /// ```
2292    pub fn set_monthly_backup_limit<T>(mut self, v: T) -> Self
2293    where
2294        T: std::convert::Into<i32>,
2295    {
2296        self.monthly_backup_limit = std::option::Option::Some(v.into());
2297        self
2298    }
2299
2300    /// Sets or clears the value of [monthly_backup_limit][crate::model::BackupPolicy::monthly_backup_limit].
2301    ///
2302    /// # Example
2303    /// ```ignore,no_run
2304    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2305    /// let x = BackupPolicy::new().set_or_clear_monthly_backup_limit(Some(42));
2306    /// let x = BackupPolicy::new().set_or_clear_monthly_backup_limit(None::<i32>);
2307    /// ```
2308    pub fn set_or_clear_monthly_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2309    where
2310        T: std::convert::Into<i32>,
2311    {
2312        self.monthly_backup_limit = v.map(|x| x.into());
2313        self
2314    }
2315
2316    /// Sets the value of [description][crate::model::BackupPolicy::description].
2317    ///
2318    /// # Example
2319    /// ```ignore,no_run
2320    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2321    /// let x = BackupPolicy::new().set_description("example");
2322    /// ```
2323    pub fn set_description<T>(mut self, v: T) -> Self
2324    where
2325        T: std::convert::Into<std::string::String>,
2326    {
2327        self.description = std::option::Option::Some(v.into());
2328        self
2329    }
2330
2331    /// Sets or clears the value of [description][crate::model::BackupPolicy::description].
2332    ///
2333    /// # Example
2334    /// ```ignore,no_run
2335    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2336    /// let x = BackupPolicy::new().set_or_clear_description(Some("example"));
2337    /// let x = BackupPolicy::new().set_or_clear_description(None::<String>);
2338    /// ```
2339    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
2340    where
2341        T: std::convert::Into<std::string::String>,
2342    {
2343        self.description = v.map(|x| x.into());
2344        self
2345    }
2346
2347    /// Sets the value of [enabled][crate::model::BackupPolicy::enabled].
2348    ///
2349    /// # Example
2350    /// ```ignore,no_run
2351    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2352    /// let x = BackupPolicy::new().set_enabled(true);
2353    /// ```
2354    pub fn set_enabled<T>(mut self, v: T) -> Self
2355    where
2356        T: std::convert::Into<bool>,
2357    {
2358        self.enabled = std::option::Option::Some(v.into());
2359        self
2360    }
2361
2362    /// Sets or clears the value of [enabled][crate::model::BackupPolicy::enabled].
2363    ///
2364    /// # Example
2365    /// ```ignore,no_run
2366    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2367    /// let x = BackupPolicy::new().set_or_clear_enabled(Some(false));
2368    /// let x = BackupPolicy::new().set_or_clear_enabled(None::<bool>);
2369    /// ```
2370    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
2371    where
2372        T: std::convert::Into<bool>,
2373    {
2374        self.enabled = v.map(|x| x.into());
2375        self
2376    }
2377
2378    /// Sets the value of [assigned_volume_count][crate::model::BackupPolicy::assigned_volume_count].
2379    ///
2380    /// # Example
2381    /// ```ignore,no_run
2382    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2383    /// let x = BackupPolicy::new().set_assigned_volume_count(42);
2384    /// ```
2385    pub fn set_assigned_volume_count<T>(mut self, v: T) -> Self
2386    where
2387        T: std::convert::Into<i32>,
2388    {
2389        self.assigned_volume_count = std::option::Option::Some(v.into());
2390        self
2391    }
2392
2393    /// Sets or clears the value of [assigned_volume_count][crate::model::BackupPolicy::assigned_volume_count].
2394    ///
2395    /// # Example
2396    /// ```ignore,no_run
2397    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2398    /// let x = BackupPolicy::new().set_or_clear_assigned_volume_count(Some(42));
2399    /// let x = BackupPolicy::new().set_or_clear_assigned_volume_count(None::<i32>);
2400    /// ```
2401    pub fn set_or_clear_assigned_volume_count<T>(mut self, v: std::option::Option<T>) -> Self
2402    where
2403        T: std::convert::Into<i32>,
2404    {
2405        self.assigned_volume_count = v.map(|x| x.into());
2406        self
2407    }
2408
2409    /// Sets the value of [create_time][crate::model::BackupPolicy::create_time].
2410    ///
2411    /// # Example
2412    /// ```ignore,no_run
2413    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2414    /// use wkt::Timestamp;
2415    /// let x = BackupPolicy::new().set_create_time(Timestamp::default()/* use setters */);
2416    /// ```
2417    pub fn set_create_time<T>(mut self, v: T) -> Self
2418    where
2419        T: std::convert::Into<wkt::Timestamp>,
2420    {
2421        self.create_time = std::option::Option::Some(v.into());
2422        self
2423    }
2424
2425    /// Sets or clears the value of [create_time][crate::model::BackupPolicy::create_time].
2426    ///
2427    /// # Example
2428    /// ```ignore,no_run
2429    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2430    /// use wkt::Timestamp;
2431    /// let x = BackupPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2432    /// let x = BackupPolicy::new().set_or_clear_create_time(None::<Timestamp>);
2433    /// ```
2434    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2435    where
2436        T: std::convert::Into<wkt::Timestamp>,
2437    {
2438        self.create_time = v.map(|x| x.into());
2439        self
2440    }
2441
2442    /// Sets the value of [labels][crate::model::BackupPolicy::labels].
2443    ///
2444    /// # Example
2445    /// ```ignore,no_run
2446    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2447    /// let x = BackupPolicy::new().set_labels([
2448    ///     ("key0", "abc"),
2449    ///     ("key1", "xyz"),
2450    /// ]);
2451    /// ```
2452    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2453    where
2454        T: std::iter::IntoIterator<Item = (K, V)>,
2455        K: std::convert::Into<std::string::String>,
2456        V: std::convert::Into<std::string::String>,
2457    {
2458        use std::iter::Iterator;
2459        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2460        self
2461    }
2462
2463    /// Sets the value of [state][crate::model::BackupPolicy::state].
2464    ///
2465    /// # Example
2466    /// ```ignore,no_run
2467    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2468    /// use google_cloud_netapp_v1::model::backup_policy::State;
2469    /// let x0 = BackupPolicy::new().set_state(State::Creating);
2470    /// let x1 = BackupPolicy::new().set_state(State::Ready);
2471    /// let x2 = BackupPolicy::new().set_state(State::Deleting);
2472    /// ```
2473    pub fn set_state<T: std::convert::Into<crate::model::backup_policy::State>>(
2474        mut self,
2475        v: T,
2476    ) -> Self {
2477        self.state = v.into();
2478        self
2479    }
2480}
2481
2482impl wkt::message::Message for BackupPolicy {
2483    fn typename() -> &'static str {
2484        "type.googleapis.com/google.cloud.netapp.v1.BackupPolicy"
2485    }
2486}
2487
2488/// Defines additional types related to [BackupPolicy].
2489pub mod backup_policy {
2490    #[allow(unused_imports)]
2491    use super::*;
2492
2493    ///
2494    /// # Working with unknown values
2495    ///
2496    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2497    /// additional enum variants at any time. Adding new variants is not considered
2498    /// a breaking change. Applications should write their code in anticipation of:
2499    ///
2500    /// - New values appearing in future releases of the client library, **and**
2501    /// - New values received dynamically, without application changes.
2502    ///
2503    /// Please consult the [Working with enums] section in the user guide for some
2504    /// guidelines.
2505    ///
2506    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2507    #[derive(Clone, Debug, PartialEq)]
2508    #[non_exhaustive]
2509    pub enum State {
2510        /// State not set.
2511        Unspecified,
2512        /// BackupPolicy is being created.
2513        Creating,
2514        /// BackupPolicy is available for use.
2515        Ready,
2516        /// BackupPolicy is being deleted.
2517        Deleting,
2518        /// BackupPolicy is not valid and cannot be used.
2519        Error,
2520        /// BackupPolicy is being updated.
2521        Updating,
2522        /// If set, the enum was initialized with an unknown value.
2523        ///
2524        /// Applications can examine the value using [State::value] or
2525        /// [State::name].
2526        UnknownValue(state::UnknownValue),
2527    }
2528
2529    #[doc(hidden)]
2530    pub mod state {
2531        #[allow(unused_imports)]
2532        use super::*;
2533        #[derive(Clone, Debug, PartialEq)]
2534        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2535    }
2536
2537    impl State {
2538        /// Gets the enum value.
2539        ///
2540        /// Returns `None` if the enum contains an unknown value deserialized from
2541        /// the string representation of enums.
2542        pub fn value(&self) -> std::option::Option<i32> {
2543            match self {
2544                Self::Unspecified => std::option::Option::Some(0),
2545                Self::Creating => std::option::Option::Some(1),
2546                Self::Ready => std::option::Option::Some(2),
2547                Self::Deleting => std::option::Option::Some(3),
2548                Self::Error => std::option::Option::Some(4),
2549                Self::Updating => std::option::Option::Some(5),
2550                Self::UnknownValue(u) => u.0.value(),
2551            }
2552        }
2553
2554        /// Gets the enum value as a string.
2555        ///
2556        /// Returns `None` if the enum contains an unknown value deserialized from
2557        /// the integer representation of enums.
2558        pub fn name(&self) -> std::option::Option<&str> {
2559            match self {
2560                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2561                Self::Creating => std::option::Option::Some("CREATING"),
2562                Self::Ready => std::option::Option::Some("READY"),
2563                Self::Deleting => std::option::Option::Some("DELETING"),
2564                Self::Error => std::option::Option::Some("ERROR"),
2565                Self::Updating => std::option::Option::Some("UPDATING"),
2566                Self::UnknownValue(u) => u.0.name(),
2567            }
2568        }
2569    }
2570
2571    impl std::default::Default for State {
2572        fn default() -> Self {
2573            use std::convert::From;
2574            Self::from(0)
2575        }
2576    }
2577
2578    impl std::fmt::Display for State {
2579        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2580            wkt::internal::display_enum(f, self.name(), self.value())
2581        }
2582    }
2583
2584    impl std::convert::From<i32> for State {
2585        fn from(value: i32) -> Self {
2586            match value {
2587                0 => Self::Unspecified,
2588                1 => Self::Creating,
2589                2 => Self::Ready,
2590                3 => Self::Deleting,
2591                4 => Self::Error,
2592                5 => Self::Updating,
2593                _ => Self::UnknownValue(state::UnknownValue(
2594                    wkt::internal::UnknownEnumValue::Integer(value),
2595                )),
2596            }
2597        }
2598    }
2599
2600    impl std::convert::From<&str> for State {
2601        fn from(value: &str) -> Self {
2602            use std::string::ToString;
2603            match value {
2604                "STATE_UNSPECIFIED" => Self::Unspecified,
2605                "CREATING" => Self::Creating,
2606                "READY" => Self::Ready,
2607                "DELETING" => Self::Deleting,
2608                "ERROR" => Self::Error,
2609                "UPDATING" => Self::Updating,
2610                _ => Self::UnknownValue(state::UnknownValue(
2611                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2612                )),
2613            }
2614        }
2615    }
2616
2617    impl serde::ser::Serialize for State {
2618        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2619        where
2620            S: serde::Serializer,
2621        {
2622            match self {
2623                Self::Unspecified => serializer.serialize_i32(0),
2624                Self::Creating => serializer.serialize_i32(1),
2625                Self::Ready => serializer.serialize_i32(2),
2626                Self::Deleting => serializer.serialize_i32(3),
2627                Self::Error => serializer.serialize_i32(4),
2628                Self::Updating => serializer.serialize_i32(5),
2629                Self::UnknownValue(u) => u.0.serialize(serializer),
2630            }
2631        }
2632    }
2633
2634    impl<'de> serde::de::Deserialize<'de> for State {
2635        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2636        where
2637            D: serde::Deserializer<'de>,
2638        {
2639            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2640                ".google.cloud.netapp.v1.BackupPolicy.State",
2641            ))
2642        }
2643    }
2644}
2645
2646/// CreateBackupPolicyRequest creates a backupPolicy.
2647#[derive(Clone, Default, PartialEq)]
2648#[non_exhaustive]
2649pub struct CreateBackupPolicyRequest {
2650    /// Required. The location to create the backup policies of, in the format
2651    /// `projects/{project_id}/locations/{location}`
2652    pub parent: std::string::String,
2653
2654    /// Required. A backupPolicy resource
2655    pub backup_policy: std::option::Option<crate::model::BackupPolicy>,
2656
2657    /// Required. The ID to use for the backup policy.
2658    /// The ID must be unique within the specified location.
2659    /// Must contain only letters, numbers and hyphen, with the first
2660    /// character a letter, the last a letter or a
2661    /// number, and a 63 character maximum.
2662    pub backup_policy_id: std::string::String,
2663
2664    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2665}
2666
2667impl CreateBackupPolicyRequest {
2668    pub fn new() -> Self {
2669        std::default::Default::default()
2670    }
2671
2672    /// Sets the value of [parent][crate::model::CreateBackupPolicyRequest::parent].
2673    ///
2674    /// # Example
2675    /// ```ignore,no_run
2676    /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2677    /// let x = CreateBackupPolicyRequest::new().set_parent("example");
2678    /// ```
2679    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2680        self.parent = v.into();
2681        self
2682    }
2683
2684    /// Sets the value of [backup_policy][crate::model::CreateBackupPolicyRequest::backup_policy].
2685    ///
2686    /// # Example
2687    /// ```ignore,no_run
2688    /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2689    /// use google_cloud_netapp_v1::model::BackupPolicy;
2690    /// let x = CreateBackupPolicyRequest::new().set_backup_policy(BackupPolicy::default()/* use setters */);
2691    /// ```
2692    pub fn set_backup_policy<T>(mut self, v: T) -> Self
2693    where
2694        T: std::convert::Into<crate::model::BackupPolicy>,
2695    {
2696        self.backup_policy = std::option::Option::Some(v.into());
2697        self
2698    }
2699
2700    /// Sets or clears the value of [backup_policy][crate::model::CreateBackupPolicyRequest::backup_policy].
2701    ///
2702    /// # Example
2703    /// ```ignore,no_run
2704    /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2705    /// use google_cloud_netapp_v1::model::BackupPolicy;
2706    /// let x = CreateBackupPolicyRequest::new().set_or_clear_backup_policy(Some(BackupPolicy::default()/* use setters */));
2707    /// let x = CreateBackupPolicyRequest::new().set_or_clear_backup_policy(None::<BackupPolicy>);
2708    /// ```
2709    pub fn set_or_clear_backup_policy<T>(mut self, v: std::option::Option<T>) -> Self
2710    where
2711        T: std::convert::Into<crate::model::BackupPolicy>,
2712    {
2713        self.backup_policy = v.map(|x| x.into());
2714        self
2715    }
2716
2717    /// Sets the value of [backup_policy_id][crate::model::CreateBackupPolicyRequest::backup_policy_id].
2718    ///
2719    /// # Example
2720    /// ```ignore,no_run
2721    /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2722    /// let x = CreateBackupPolicyRequest::new().set_backup_policy_id("example");
2723    /// ```
2724    pub fn set_backup_policy_id<T: std::convert::Into<std::string::String>>(
2725        mut self,
2726        v: T,
2727    ) -> Self {
2728        self.backup_policy_id = v.into();
2729        self
2730    }
2731}
2732
2733impl wkt::message::Message for CreateBackupPolicyRequest {
2734    fn typename() -> &'static str {
2735        "type.googleapis.com/google.cloud.netapp.v1.CreateBackupPolicyRequest"
2736    }
2737}
2738
2739/// GetBackupPolicyRequest gets the state of a backupPolicy.
2740#[derive(Clone, Default, PartialEq)]
2741#[non_exhaustive]
2742pub struct GetBackupPolicyRequest {
2743    /// Required. The backupPolicy resource name, in the format
2744    /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`
2745    pub name: std::string::String,
2746
2747    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2748}
2749
2750impl GetBackupPolicyRequest {
2751    pub fn new() -> Self {
2752        std::default::Default::default()
2753    }
2754
2755    /// Sets the value of [name][crate::model::GetBackupPolicyRequest::name].
2756    ///
2757    /// # Example
2758    /// ```ignore,no_run
2759    /// # use google_cloud_netapp_v1::model::GetBackupPolicyRequest;
2760    /// let x = GetBackupPolicyRequest::new().set_name("example");
2761    /// ```
2762    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2763        self.name = v.into();
2764        self
2765    }
2766}
2767
2768impl wkt::message::Message for GetBackupPolicyRequest {
2769    fn typename() -> &'static str {
2770        "type.googleapis.com/google.cloud.netapp.v1.GetBackupPolicyRequest"
2771    }
2772}
2773
2774/// ListBackupPoliciesRequest for requesting multiple backup policies.
2775#[derive(Clone, Default, PartialEq)]
2776#[non_exhaustive]
2777pub struct ListBackupPoliciesRequest {
2778    /// Required. Parent value for ListBackupPoliciesRequest
2779    pub parent: std::string::String,
2780
2781    /// Requested page size. Server may return fewer items than requested.
2782    /// If unspecified, the server will pick an appropriate default.
2783    pub page_size: i32,
2784
2785    /// A token identifying a page of results the server should return.
2786    pub page_token: std::string::String,
2787
2788    /// Filtering results
2789    pub filter: std::string::String,
2790
2791    /// Hint for how to order the results
2792    pub order_by: std::string::String,
2793
2794    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2795}
2796
2797impl ListBackupPoliciesRequest {
2798    pub fn new() -> Self {
2799        std::default::Default::default()
2800    }
2801
2802    /// Sets the value of [parent][crate::model::ListBackupPoliciesRequest::parent].
2803    ///
2804    /// # Example
2805    /// ```ignore,no_run
2806    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2807    /// let x = ListBackupPoliciesRequest::new().set_parent("example");
2808    /// ```
2809    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2810        self.parent = v.into();
2811        self
2812    }
2813
2814    /// Sets the value of [page_size][crate::model::ListBackupPoliciesRequest::page_size].
2815    ///
2816    /// # Example
2817    /// ```ignore,no_run
2818    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2819    /// let x = ListBackupPoliciesRequest::new().set_page_size(42);
2820    /// ```
2821    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2822        self.page_size = v.into();
2823        self
2824    }
2825
2826    /// Sets the value of [page_token][crate::model::ListBackupPoliciesRequest::page_token].
2827    ///
2828    /// # Example
2829    /// ```ignore,no_run
2830    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2831    /// let x = ListBackupPoliciesRequest::new().set_page_token("example");
2832    /// ```
2833    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2834        self.page_token = v.into();
2835        self
2836    }
2837
2838    /// Sets the value of [filter][crate::model::ListBackupPoliciesRequest::filter].
2839    ///
2840    /// # Example
2841    /// ```ignore,no_run
2842    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2843    /// let x = ListBackupPoliciesRequest::new().set_filter("example");
2844    /// ```
2845    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2846        self.filter = v.into();
2847        self
2848    }
2849
2850    /// Sets the value of [order_by][crate::model::ListBackupPoliciesRequest::order_by].
2851    ///
2852    /// # Example
2853    /// ```ignore,no_run
2854    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2855    /// let x = ListBackupPoliciesRequest::new().set_order_by("example");
2856    /// ```
2857    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2858        self.order_by = v.into();
2859        self
2860    }
2861}
2862
2863impl wkt::message::Message for ListBackupPoliciesRequest {
2864    fn typename() -> &'static str {
2865        "type.googleapis.com/google.cloud.netapp.v1.ListBackupPoliciesRequest"
2866    }
2867}
2868
2869/// ListBackupPoliciesResponse contains all the backup policies requested.
2870#[derive(Clone, Default, PartialEq)]
2871#[non_exhaustive]
2872pub struct ListBackupPoliciesResponse {
2873    /// The list of backup policies.
2874    pub backup_policies: std::vec::Vec<crate::model::BackupPolicy>,
2875
2876    /// A token identifying a page of results the server should return.
2877    pub next_page_token: std::string::String,
2878
2879    /// Locations that could not be reached.
2880    pub unreachable: std::vec::Vec<std::string::String>,
2881
2882    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2883}
2884
2885impl ListBackupPoliciesResponse {
2886    pub fn new() -> Self {
2887        std::default::Default::default()
2888    }
2889
2890    /// Sets the value of [backup_policies][crate::model::ListBackupPoliciesResponse::backup_policies].
2891    ///
2892    /// # Example
2893    /// ```ignore,no_run
2894    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
2895    /// use google_cloud_netapp_v1::model::BackupPolicy;
2896    /// let x = ListBackupPoliciesResponse::new()
2897    ///     .set_backup_policies([
2898    ///         BackupPolicy::default()/* use setters */,
2899    ///         BackupPolicy::default()/* use (different) setters */,
2900    ///     ]);
2901    /// ```
2902    pub fn set_backup_policies<T, V>(mut self, v: T) -> Self
2903    where
2904        T: std::iter::IntoIterator<Item = V>,
2905        V: std::convert::Into<crate::model::BackupPolicy>,
2906    {
2907        use std::iter::Iterator;
2908        self.backup_policies = v.into_iter().map(|i| i.into()).collect();
2909        self
2910    }
2911
2912    /// Sets the value of [next_page_token][crate::model::ListBackupPoliciesResponse::next_page_token].
2913    ///
2914    /// # Example
2915    /// ```ignore,no_run
2916    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
2917    /// let x = ListBackupPoliciesResponse::new().set_next_page_token("example");
2918    /// ```
2919    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2920        self.next_page_token = v.into();
2921        self
2922    }
2923
2924    /// Sets the value of [unreachable][crate::model::ListBackupPoliciesResponse::unreachable].
2925    ///
2926    /// # Example
2927    /// ```ignore,no_run
2928    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
2929    /// let x = ListBackupPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
2930    /// ```
2931    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2932    where
2933        T: std::iter::IntoIterator<Item = V>,
2934        V: std::convert::Into<std::string::String>,
2935    {
2936        use std::iter::Iterator;
2937        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2938        self
2939    }
2940}
2941
2942impl wkt::message::Message for ListBackupPoliciesResponse {
2943    fn typename() -> &'static str {
2944        "type.googleapis.com/google.cloud.netapp.v1.ListBackupPoliciesResponse"
2945    }
2946}
2947
2948#[doc(hidden)]
2949impl gax::paginator::internal::PageableResponse for ListBackupPoliciesResponse {
2950    type PageItem = crate::model::BackupPolicy;
2951
2952    fn items(self) -> std::vec::Vec<Self::PageItem> {
2953        self.backup_policies
2954    }
2955
2956    fn next_page_token(&self) -> std::string::String {
2957        use std::clone::Clone;
2958        self.next_page_token.clone()
2959    }
2960}
2961
2962/// UpdateBackupPolicyRequest for updating a backup policy.
2963#[derive(Clone, Default, PartialEq)]
2964#[non_exhaustive]
2965pub struct UpdateBackupPolicyRequest {
2966    /// Required. Field mask is used to specify the fields to be overwritten in the
2967    /// Backup Policy resource by the update.
2968    /// The fields specified in the update_mask are relative to the resource, not
2969    /// the full request. A field will be overwritten if it is in the mask. If the
2970    /// user does not provide a mask then all fields will be overwritten.
2971    pub update_mask: std::option::Option<wkt::FieldMask>,
2972
2973    /// Required. The backup policy being updated
2974    pub backup_policy: std::option::Option<crate::model::BackupPolicy>,
2975
2976    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2977}
2978
2979impl UpdateBackupPolicyRequest {
2980    pub fn new() -> Self {
2981        std::default::Default::default()
2982    }
2983
2984    /// Sets the value of [update_mask][crate::model::UpdateBackupPolicyRequest::update_mask].
2985    ///
2986    /// # Example
2987    /// ```ignore,no_run
2988    /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
2989    /// use wkt::FieldMask;
2990    /// let x = UpdateBackupPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2991    /// ```
2992    pub fn set_update_mask<T>(mut self, v: T) -> Self
2993    where
2994        T: std::convert::Into<wkt::FieldMask>,
2995    {
2996        self.update_mask = std::option::Option::Some(v.into());
2997        self
2998    }
2999
3000    /// Sets or clears the value of [update_mask][crate::model::UpdateBackupPolicyRequest::update_mask].
3001    ///
3002    /// # Example
3003    /// ```ignore,no_run
3004    /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3005    /// use wkt::FieldMask;
3006    /// let x = UpdateBackupPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3007    /// let x = UpdateBackupPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3008    /// ```
3009    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3010    where
3011        T: std::convert::Into<wkt::FieldMask>,
3012    {
3013        self.update_mask = v.map(|x| x.into());
3014        self
3015    }
3016
3017    /// Sets the value of [backup_policy][crate::model::UpdateBackupPolicyRequest::backup_policy].
3018    ///
3019    /// # Example
3020    /// ```ignore,no_run
3021    /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3022    /// use google_cloud_netapp_v1::model::BackupPolicy;
3023    /// let x = UpdateBackupPolicyRequest::new().set_backup_policy(BackupPolicy::default()/* use setters */);
3024    /// ```
3025    pub fn set_backup_policy<T>(mut self, v: T) -> Self
3026    where
3027        T: std::convert::Into<crate::model::BackupPolicy>,
3028    {
3029        self.backup_policy = std::option::Option::Some(v.into());
3030        self
3031    }
3032
3033    /// Sets or clears the value of [backup_policy][crate::model::UpdateBackupPolicyRequest::backup_policy].
3034    ///
3035    /// # Example
3036    /// ```ignore,no_run
3037    /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3038    /// use google_cloud_netapp_v1::model::BackupPolicy;
3039    /// let x = UpdateBackupPolicyRequest::new().set_or_clear_backup_policy(Some(BackupPolicy::default()/* use setters */));
3040    /// let x = UpdateBackupPolicyRequest::new().set_or_clear_backup_policy(None::<BackupPolicy>);
3041    /// ```
3042    pub fn set_or_clear_backup_policy<T>(mut self, v: std::option::Option<T>) -> Self
3043    where
3044        T: std::convert::Into<crate::model::BackupPolicy>,
3045    {
3046        self.backup_policy = v.map(|x| x.into());
3047        self
3048    }
3049}
3050
3051impl wkt::message::Message for UpdateBackupPolicyRequest {
3052    fn typename() -> &'static str {
3053        "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupPolicyRequest"
3054    }
3055}
3056
3057/// DeleteBackupPolicyRequest deletes a backup policy.
3058#[derive(Clone, Default, PartialEq)]
3059#[non_exhaustive]
3060pub struct DeleteBackupPolicyRequest {
3061    /// Required. The backup policy resource name, in the format
3062    /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`
3063    pub name: std::string::String,
3064
3065    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3066}
3067
3068impl DeleteBackupPolicyRequest {
3069    pub fn new() -> Self {
3070        std::default::Default::default()
3071    }
3072
3073    /// Sets the value of [name][crate::model::DeleteBackupPolicyRequest::name].
3074    ///
3075    /// # Example
3076    /// ```ignore,no_run
3077    /// # use google_cloud_netapp_v1::model::DeleteBackupPolicyRequest;
3078    /// let x = DeleteBackupPolicyRequest::new().set_name("example");
3079    /// ```
3080    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3081        self.name = v.into();
3082        self
3083    }
3084}
3085
3086impl wkt::message::Message for DeleteBackupPolicyRequest {
3087    fn typename() -> &'static str {
3088        "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupPolicyRequest"
3089    }
3090}
3091
3092/// A NetApp BackupVault.
3093#[derive(Clone, Default, PartialEq)]
3094#[non_exhaustive]
3095pub struct BackupVault {
3096    /// Identifier. The resource name of the backup vault.
3097    /// Format:
3098    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`.
3099    pub name: std::string::String,
3100
3101    /// Output only. The backup vault state.
3102    pub state: crate::model::backup_vault::State,
3103
3104    /// Output only. Create time of the backup vault.
3105    pub create_time: std::option::Option<wkt::Timestamp>,
3106
3107    /// Description of the backup vault.
3108    pub description: std::string::String,
3109
3110    /// Resource labels to represent user provided metadata.
3111    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3112
3113    /// Optional. Type of backup vault to be created.
3114    /// Default is IN_REGION.
3115    pub backup_vault_type: crate::model::backup_vault::BackupVaultType,
3116
3117    /// Output only. Region in which the backup vault is created.
3118    /// Format: `projects/{project_id}/locations/{location}`
3119    pub source_region: std::string::String,
3120
3121    /// Optional. Region where the backups are stored.
3122    /// Format: `projects/{project_id}/locations/{location}`
3123    pub backup_region: std::string::String,
3124
3125    /// Output only. Name of the Backup vault created in source region.
3126    /// Format:
3127    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
3128    pub source_backup_vault: std::string::String,
3129
3130    /// Output only. Name of the Backup vault created in backup region.
3131    /// Format:
3132    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
3133    pub destination_backup_vault: std::string::String,
3134
3135    /// Optional. Backup retention policy defining the retention of backups.
3136    pub backup_retention_policy:
3137        std::option::Option<crate::model::backup_vault::BackupRetentionPolicy>,
3138
3139    /// Optional. Specifies the Key Management System (KMS) configuration to be
3140    /// used for backup encryption. Format:
3141    /// `projects/{project}/locations/{location}/kmsConfigs/{kms_config}`
3142    pub kms_config: std::string::String,
3143
3144    /// Output only. Field indicating encryption state of CMEK backups.
3145    pub encryption_state: crate::model::backup_vault::EncryptionState,
3146
3147    /// Output only. The crypto key version used to encrypt the backup vault.
3148    /// Format:
3149    /// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`
3150    pub backups_crypto_key_version: std::string::String,
3151
3152    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3153}
3154
3155impl BackupVault {
3156    pub fn new() -> Self {
3157        std::default::Default::default()
3158    }
3159
3160    /// Sets the value of [name][crate::model::BackupVault::name].
3161    ///
3162    /// # Example
3163    /// ```ignore,no_run
3164    /// # use google_cloud_netapp_v1::model::BackupVault;
3165    /// let x = BackupVault::new().set_name("example");
3166    /// ```
3167    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3168        self.name = v.into();
3169        self
3170    }
3171
3172    /// Sets the value of [state][crate::model::BackupVault::state].
3173    ///
3174    /// # Example
3175    /// ```ignore,no_run
3176    /// # use google_cloud_netapp_v1::model::BackupVault;
3177    /// use google_cloud_netapp_v1::model::backup_vault::State;
3178    /// let x0 = BackupVault::new().set_state(State::Creating);
3179    /// let x1 = BackupVault::new().set_state(State::Ready);
3180    /// let x2 = BackupVault::new().set_state(State::Deleting);
3181    /// ```
3182    pub fn set_state<T: std::convert::Into<crate::model::backup_vault::State>>(
3183        mut self,
3184        v: T,
3185    ) -> Self {
3186        self.state = v.into();
3187        self
3188    }
3189
3190    /// Sets the value of [create_time][crate::model::BackupVault::create_time].
3191    ///
3192    /// # Example
3193    /// ```ignore,no_run
3194    /// # use google_cloud_netapp_v1::model::BackupVault;
3195    /// use wkt::Timestamp;
3196    /// let x = BackupVault::new().set_create_time(Timestamp::default()/* use setters */);
3197    /// ```
3198    pub fn set_create_time<T>(mut self, v: T) -> Self
3199    where
3200        T: std::convert::Into<wkt::Timestamp>,
3201    {
3202        self.create_time = std::option::Option::Some(v.into());
3203        self
3204    }
3205
3206    /// Sets or clears the value of [create_time][crate::model::BackupVault::create_time].
3207    ///
3208    /// # Example
3209    /// ```ignore,no_run
3210    /// # use google_cloud_netapp_v1::model::BackupVault;
3211    /// use wkt::Timestamp;
3212    /// let x = BackupVault::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3213    /// let x = BackupVault::new().set_or_clear_create_time(None::<Timestamp>);
3214    /// ```
3215    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3216    where
3217        T: std::convert::Into<wkt::Timestamp>,
3218    {
3219        self.create_time = v.map(|x| x.into());
3220        self
3221    }
3222
3223    /// Sets the value of [description][crate::model::BackupVault::description].
3224    ///
3225    /// # Example
3226    /// ```ignore,no_run
3227    /// # use google_cloud_netapp_v1::model::BackupVault;
3228    /// let x = BackupVault::new().set_description("example");
3229    /// ```
3230    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3231        self.description = v.into();
3232        self
3233    }
3234
3235    /// Sets the value of [labels][crate::model::BackupVault::labels].
3236    ///
3237    /// # Example
3238    /// ```ignore,no_run
3239    /// # use google_cloud_netapp_v1::model::BackupVault;
3240    /// let x = BackupVault::new().set_labels([
3241    ///     ("key0", "abc"),
3242    ///     ("key1", "xyz"),
3243    /// ]);
3244    /// ```
3245    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3246    where
3247        T: std::iter::IntoIterator<Item = (K, V)>,
3248        K: std::convert::Into<std::string::String>,
3249        V: std::convert::Into<std::string::String>,
3250    {
3251        use std::iter::Iterator;
3252        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3253        self
3254    }
3255
3256    /// Sets the value of [backup_vault_type][crate::model::BackupVault::backup_vault_type].
3257    ///
3258    /// # Example
3259    /// ```ignore,no_run
3260    /// # use google_cloud_netapp_v1::model::BackupVault;
3261    /// use google_cloud_netapp_v1::model::backup_vault::BackupVaultType;
3262    /// let x0 = BackupVault::new().set_backup_vault_type(BackupVaultType::InRegion);
3263    /// let x1 = BackupVault::new().set_backup_vault_type(BackupVaultType::CrossRegion);
3264    /// ```
3265    pub fn set_backup_vault_type<
3266        T: std::convert::Into<crate::model::backup_vault::BackupVaultType>,
3267    >(
3268        mut self,
3269        v: T,
3270    ) -> Self {
3271        self.backup_vault_type = v.into();
3272        self
3273    }
3274
3275    /// Sets the value of [source_region][crate::model::BackupVault::source_region].
3276    ///
3277    /// # Example
3278    /// ```ignore,no_run
3279    /// # use google_cloud_netapp_v1::model::BackupVault;
3280    /// let x = BackupVault::new().set_source_region("example");
3281    /// ```
3282    pub fn set_source_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3283        self.source_region = v.into();
3284        self
3285    }
3286
3287    /// Sets the value of [backup_region][crate::model::BackupVault::backup_region].
3288    ///
3289    /// # Example
3290    /// ```ignore,no_run
3291    /// # use google_cloud_netapp_v1::model::BackupVault;
3292    /// let x = BackupVault::new().set_backup_region("example");
3293    /// ```
3294    pub fn set_backup_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3295        self.backup_region = v.into();
3296        self
3297    }
3298
3299    /// Sets the value of [source_backup_vault][crate::model::BackupVault::source_backup_vault].
3300    ///
3301    /// # Example
3302    /// ```ignore,no_run
3303    /// # use google_cloud_netapp_v1::model::BackupVault;
3304    /// let x = BackupVault::new().set_source_backup_vault("example");
3305    /// ```
3306    pub fn set_source_backup_vault<T: std::convert::Into<std::string::String>>(
3307        mut self,
3308        v: T,
3309    ) -> Self {
3310        self.source_backup_vault = v.into();
3311        self
3312    }
3313
3314    /// Sets the value of [destination_backup_vault][crate::model::BackupVault::destination_backup_vault].
3315    ///
3316    /// # Example
3317    /// ```ignore,no_run
3318    /// # use google_cloud_netapp_v1::model::BackupVault;
3319    /// let x = BackupVault::new().set_destination_backup_vault("example");
3320    /// ```
3321    pub fn set_destination_backup_vault<T: std::convert::Into<std::string::String>>(
3322        mut self,
3323        v: T,
3324    ) -> Self {
3325        self.destination_backup_vault = v.into();
3326        self
3327    }
3328
3329    /// Sets the value of [backup_retention_policy][crate::model::BackupVault::backup_retention_policy].
3330    ///
3331    /// # Example
3332    /// ```ignore,no_run
3333    /// # use google_cloud_netapp_v1::model::BackupVault;
3334    /// use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3335    /// let x = BackupVault::new().set_backup_retention_policy(BackupRetentionPolicy::default()/* use setters */);
3336    /// ```
3337    pub fn set_backup_retention_policy<T>(mut self, v: T) -> Self
3338    where
3339        T: std::convert::Into<crate::model::backup_vault::BackupRetentionPolicy>,
3340    {
3341        self.backup_retention_policy = std::option::Option::Some(v.into());
3342        self
3343    }
3344
3345    /// Sets or clears the value of [backup_retention_policy][crate::model::BackupVault::backup_retention_policy].
3346    ///
3347    /// # Example
3348    /// ```ignore,no_run
3349    /// # use google_cloud_netapp_v1::model::BackupVault;
3350    /// use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3351    /// let x = BackupVault::new().set_or_clear_backup_retention_policy(Some(BackupRetentionPolicy::default()/* use setters */));
3352    /// let x = BackupVault::new().set_or_clear_backup_retention_policy(None::<BackupRetentionPolicy>);
3353    /// ```
3354    pub fn set_or_clear_backup_retention_policy<T>(mut self, v: std::option::Option<T>) -> Self
3355    where
3356        T: std::convert::Into<crate::model::backup_vault::BackupRetentionPolicy>,
3357    {
3358        self.backup_retention_policy = v.map(|x| x.into());
3359        self
3360    }
3361
3362    /// Sets the value of [kms_config][crate::model::BackupVault::kms_config].
3363    ///
3364    /// # Example
3365    /// ```ignore,no_run
3366    /// # use google_cloud_netapp_v1::model::BackupVault;
3367    /// let x = BackupVault::new().set_kms_config("example");
3368    /// ```
3369    pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3370        self.kms_config = v.into();
3371        self
3372    }
3373
3374    /// Sets the value of [encryption_state][crate::model::BackupVault::encryption_state].
3375    ///
3376    /// # Example
3377    /// ```ignore,no_run
3378    /// # use google_cloud_netapp_v1::model::BackupVault;
3379    /// use google_cloud_netapp_v1::model::backup_vault::EncryptionState;
3380    /// let x0 = BackupVault::new().set_encryption_state(EncryptionState::Pending);
3381    /// let x1 = BackupVault::new().set_encryption_state(EncryptionState::Completed);
3382    /// let x2 = BackupVault::new().set_encryption_state(EncryptionState::InProgress);
3383    /// ```
3384    pub fn set_encryption_state<
3385        T: std::convert::Into<crate::model::backup_vault::EncryptionState>,
3386    >(
3387        mut self,
3388        v: T,
3389    ) -> Self {
3390        self.encryption_state = v.into();
3391        self
3392    }
3393
3394    /// Sets the value of [backups_crypto_key_version][crate::model::BackupVault::backups_crypto_key_version].
3395    ///
3396    /// # Example
3397    /// ```ignore,no_run
3398    /// # use google_cloud_netapp_v1::model::BackupVault;
3399    /// let x = BackupVault::new().set_backups_crypto_key_version("example");
3400    /// ```
3401    pub fn set_backups_crypto_key_version<T: std::convert::Into<std::string::String>>(
3402        mut self,
3403        v: T,
3404    ) -> Self {
3405        self.backups_crypto_key_version = v.into();
3406        self
3407    }
3408}
3409
3410impl wkt::message::Message for BackupVault {
3411    fn typename() -> &'static str {
3412        "type.googleapis.com/google.cloud.netapp.v1.BackupVault"
3413    }
3414}
3415
3416/// Defines additional types related to [BackupVault].
3417pub mod backup_vault {
3418    #[allow(unused_imports)]
3419    use super::*;
3420
3421    /// Retention policy for backups in the backup vault
3422    #[derive(Clone, Default, PartialEq)]
3423    #[non_exhaustive]
3424    pub struct BackupRetentionPolicy {
3425        /// Required. Minimum retention duration in days for backups in the backup
3426        /// vault.
3427        pub backup_minimum_enforced_retention_days: i32,
3428
3429        /// Optional. Indicates if the daily backups are immutable.
3430        /// At least one of daily_backup_immutable, weekly_backup_immutable,
3431        /// monthly_backup_immutable and manual_backup_immutable must be true.
3432        pub daily_backup_immutable: bool,
3433
3434        /// Optional. Indicates if the weekly backups are immutable.
3435        /// At least one of daily_backup_immutable, weekly_backup_immutable,
3436        /// monthly_backup_immutable and manual_backup_immutable must be true.
3437        pub weekly_backup_immutable: bool,
3438
3439        /// Optional. Indicates if the monthly backups are immutable.
3440        /// At least one of daily_backup_immutable, weekly_backup_immutable,
3441        /// monthly_backup_immutable and manual_backup_immutable must be true.
3442        pub monthly_backup_immutable: bool,
3443
3444        /// Optional. Indicates if the manual backups are immutable.
3445        /// At least one of daily_backup_immutable, weekly_backup_immutable,
3446        /// monthly_backup_immutable and manual_backup_immutable must be true.
3447        pub manual_backup_immutable: bool,
3448
3449        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3450    }
3451
3452    impl BackupRetentionPolicy {
3453        pub fn new() -> Self {
3454            std::default::Default::default()
3455        }
3456
3457        /// Sets the value of [backup_minimum_enforced_retention_days][crate::model::backup_vault::BackupRetentionPolicy::backup_minimum_enforced_retention_days].
3458        ///
3459        /// # Example
3460        /// ```ignore,no_run
3461        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3462        /// let x = BackupRetentionPolicy::new().set_backup_minimum_enforced_retention_days(42);
3463        /// ```
3464        pub fn set_backup_minimum_enforced_retention_days<T: std::convert::Into<i32>>(
3465            mut self,
3466            v: T,
3467        ) -> Self {
3468            self.backup_minimum_enforced_retention_days = v.into();
3469            self
3470        }
3471
3472        /// Sets the value of [daily_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::daily_backup_immutable].
3473        ///
3474        /// # Example
3475        /// ```ignore,no_run
3476        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3477        /// let x = BackupRetentionPolicy::new().set_daily_backup_immutable(true);
3478        /// ```
3479        pub fn set_daily_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3480            self.daily_backup_immutable = v.into();
3481            self
3482        }
3483
3484        /// Sets the value of [weekly_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::weekly_backup_immutable].
3485        ///
3486        /// # Example
3487        /// ```ignore,no_run
3488        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3489        /// let x = BackupRetentionPolicy::new().set_weekly_backup_immutable(true);
3490        /// ```
3491        pub fn set_weekly_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3492            self.weekly_backup_immutable = v.into();
3493            self
3494        }
3495
3496        /// Sets the value of [monthly_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::monthly_backup_immutable].
3497        ///
3498        /// # Example
3499        /// ```ignore,no_run
3500        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3501        /// let x = BackupRetentionPolicy::new().set_monthly_backup_immutable(true);
3502        /// ```
3503        pub fn set_monthly_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3504            self.monthly_backup_immutable = v.into();
3505            self
3506        }
3507
3508        /// Sets the value of [manual_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::manual_backup_immutable].
3509        ///
3510        /// # Example
3511        /// ```ignore,no_run
3512        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3513        /// let x = BackupRetentionPolicy::new().set_manual_backup_immutable(true);
3514        /// ```
3515        pub fn set_manual_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3516            self.manual_backup_immutable = v.into();
3517            self
3518        }
3519    }
3520
3521    impl wkt::message::Message for BackupRetentionPolicy {
3522        fn typename() -> &'static str {
3523            "type.googleapis.com/google.cloud.netapp.v1.BackupVault.BackupRetentionPolicy"
3524        }
3525    }
3526
3527    /// The Backup Vault States
3528    ///
3529    /// # Working with unknown values
3530    ///
3531    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3532    /// additional enum variants at any time. Adding new variants is not considered
3533    /// a breaking change. Applications should write their code in anticipation of:
3534    ///
3535    /// - New values appearing in future releases of the client library, **and**
3536    /// - New values received dynamically, without application changes.
3537    ///
3538    /// Please consult the [Working with enums] section in the user guide for some
3539    /// guidelines.
3540    ///
3541    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3542    #[derive(Clone, Debug, PartialEq)]
3543    #[non_exhaustive]
3544    pub enum State {
3545        /// State not set.
3546        Unspecified,
3547        /// BackupVault is being created.
3548        Creating,
3549        /// BackupVault is available for use.
3550        Ready,
3551        /// BackupVault is being deleted.
3552        Deleting,
3553        /// BackupVault is not valid and cannot be used.
3554        Error,
3555        /// BackupVault is being updated.
3556        Updating,
3557        /// If set, the enum was initialized with an unknown value.
3558        ///
3559        /// Applications can examine the value using [State::value] or
3560        /// [State::name].
3561        UnknownValue(state::UnknownValue),
3562    }
3563
3564    #[doc(hidden)]
3565    pub mod state {
3566        #[allow(unused_imports)]
3567        use super::*;
3568        #[derive(Clone, Debug, PartialEq)]
3569        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3570    }
3571
3572    impl State {
3573        /// Gets the enum value.
3574        ///
3575        /// Returns `None` if the enum contains an unknown value deserialized from
3576        /// the string representation of enums.
3577        pub fn value(&self) -> std::option::Option<i32> {
3578            match self {
3579                Self::Unspecified => std::option::Option::Some(0),
3580                Self::Creating => std::option::Option::Some(1),
3581                Self::Ready => std::option::Option::Some(2),
3582                Self::Deleting => std::option::Option::Some(3),
3583                Self::Error => std::option::Option::Some(4),
3584                Self::Updating => std::option::Option::Some(5),
3585                Self::UnknownValue(u) => u.0.value(),
3586            }
3587        }
3588
3589        /// Gets the enum value as a string.
3590        ///
3591        /// Returns `None` if the enum contains an unknown value deserialized from
3592        /// the integer representation of enums.
3593        pub fn name(&self) -> std::option::Option<&str> {
3594            match self {
3595                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3596                Self::Creating => std::option::Option::Some("CREATING"),
3597                Self::Ready => std::option::Option::Some("READY"),
3598                Self::Deleting => std::option::Option::Some("DELETING"),
3599                Self::Error => std::option::Option::Some("ERROR"),
3600                Self::Updating => std::option::Option::Some("UPDATING"),
3601                Self::UnknownValue(u) => u.0.name(),
3602            }
3603        }
3604    }
3605
3606    impl std::default::Default for State {
3607        fn default() -> Self {
3608            use std::convert::From;
3609            Self::from(0)
3610        }
3611    }
3612
3613    impl std::fmt::Display for State {
3614        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3615            wkt::internal::display_enum(f, self.name(), self.value())
3616        }
3617    }
3618
3619    impl std::convert::From<i32> for State {
3620        fn from(value: i32) -> Self {
3621            match value {
3622                0 => Self::Unspecified,
3623                1 => Self::Creating,
3624                2 => Self::Ready,
3625                3 => Self::Deleting,
3626                4 => Self::Error,
3627                5 => Self::Updating,
3628                _ => Self::UnknownValue(state::UnknownValue(
3629                    wkt::internal::UnknownEnumValue::Integer(value),
3630                )),
3631            }
3632        }
3633    }
3634
3635    impl std::convert::From<&str> for State {
3636        fn from(value: &str) -> Self {
3637            use std::string::ToString;
3638            match value {
3639                "STATE_UNSPECIFIED" => Self::Unspecified,
3640                "CREATING" => Self::Creating,
3641                "READY" => Self::Ready,
3642                "DELETING" => Self::Deleting,
3643                "ERROR" => Self::Error,
3644                "UPDATING" => Self::Updating,
3645                _ => Self::UnknownValue(state::UnknownValue(
3646                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3647                )),
3648            }
3649        }
3650    }
3651
3652    impl serde::ser::Serialize for State {
3653        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3654        where
3655            S: serde::Serializer,
3656        {
3657            match self {
3658                Self::Unspecified => serializer.serialize_i32(0),
3659                Self::Creating => serializer.serialize_i32(1),
3660                Self::Ready => serializer.serialize_i32(2),
3661                Self::Deleting => serializer.serialize_i32(3),
3662                Self::Error => serializer.serialize_i32(4),
3663                Self::Updating => serializer.serialize_i32(5),
3664                Self::UnknownValue(u) => u.0.serialize(serializer),
3665            }
3666        }
3667    }
3668
3669    impl<'de> serde::de::Deserialize<'de> for State {
3670        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3671        where
3672            D: serde::Deserializer<'de>,
3673        {
3674            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3675                ".google.cloud.netapp.v1.BackupVault.State",
3676            ))
3677        }
3678    }
3679
3680    /// Backup Vault Type.
3681    ///
3682    /// # Working with unknown values
3683    ///
3684    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3685    /// additional enum variants at any time. Adding new variants is not considered
3686    /// a breaking change. Applications should write their code in anticipation of:
3687    ///
3688    /// - New values appearing in future releases of the client library, **and**
3689    /// - New values received dynamically, without application changes.
3690    ///
3691    /// Please consult the [Working with enums] section in the user guide for some
3692    /// guidelines.
3693    ///
3694    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3695    #[derive(Clone, Debug, PartialEq)]
3696    #[non_exhaustive]
3697    pub enum BackupVaultType {
3698        /// BackupVault type not set.
3699        Unspecified,
3700        /// BackupVault type is IN_REGION.
3701        InRegion,
3702        /// BackupVault type is CROSS_REGION.
3703        CrossRegion,
3704        /// If set, the enum was initialized with an unknown value.
3705        ///
3706        /// Applications can examine the value using [BackupVaultType::value] or
3707        /// [BackupVaultType::name].
3708        UnknownValue(backup_vault_type::UnknownValue),
3709    }
3710
3711    #[doc(hidden)]
3712    pub mod backup_vault_type {
3713        #[allow(unused_imports)]
3714        use super::*;
3715        #[derive(Clone, Debug, PartialEq)]
3716        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3717    }
3718
3719    impl BackupVaultType {
3720        /// Gets the enum value.
3721        ///
3722        /// Returns `None` if the enum contains an unknown value deserialized from
3723        /// the string representation of enums.
3724        pub fn value(&self) -> std::option::Option<i32> {
3725            match self {
3726                Self::Unspecified => std::option::Option::Some(0),
3727                Self::InRegion => std::option::Option::Some(1),
3728                Self::CrossRegion => std::option::Option::Some(2),
3729                Self::UnknownValue(u) => u.0.value(),
3730            }
3731        }
3732
3733        /// Gets the enum value as a string.
3734        ///
3735        /// Returns `None` if the enum contains an unknown value deserialized from
3736        /// the integer representation of enums.
3737        pub fn name(&self) -> std::option::Option<&str> {
3738            match self {
3739                Self::Unspecified => std::option::Option::Some("BACKUP_VAULT_TYPE_UNSPECIFIED"),
3740                Self::InRegion => std::option::Option::Some("IN_REGION"),
3741                Self::CrossRegion => std::option::Option::Some("CROSS_REGION"),
3742                Self::UnknownValue(u) => u.0.name(),
3743            }
3744        }
3745    }
3746
3747    impl std::default::Default for BackupVaultType {
3748        fn default() -> Self {
3749            use std::convert::From;
3750            Self::from(0)
3751        }
3752    }
3753
3754    impl std::fmt::Display for BackupVaultType {
3755        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3756            wkt::internal::display_enum(f, self.name(), self.value())
3757        }
3758    }
3759
3760    impl std::convert::From<i32> for BackupVaultType {
3761        fn from(value: i32) -> Self {
3762            match value {
3763                0 => Self::Unspecified,
3764                1 => Self::InRegion,
3765                2 => Self::CrossRegion,
3766                _ => Self::UnknownValue(backup_vault_type::UnknownValue(
3767                    wkt::internal::UnknownEnumValue::Integer(value),
3768                )),
3769            }
3770        }
3771    }
3772
3773    impl std::convert::From<&str> for BackupVaultType {
3774        fn from(value: &str) -> Self {
3775            use std::string::ToString;
3776            match value {
3777                "BACKUP_VAULT_TYPE_UNSPECIFIED" => Self::Unspecified,
3778                "IN_REGION" => Self::InRegion,
3779                "CROSS_REGION" => Self::CrossRegion,
3780                _ => Self::UnknownValue(backup_vault_type::UnknownValue(
3781                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3782                )),
3783            }
3784        }
3785    }
3786
3787    impl serde::ser::Serialize for BackupVaultType {
3788        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3789        where
3790            S: serde::Serializer,
3791        {
3792            match self {
3793                Self::Unspecified => serializer.serialize_i32(0),
3794                Self::InRegion => serializer.serialize_i32(1),
3795                Self::CrossRegion => serializer.serialize_i32(2),
3796                Self::UnknownValue(u) => u.0.serialize(serializer),
3797            }
3798        }
3799    }
3800
3801    impl<'de> serde::de::Deserialize<'de> for BackupVaultType {
3802        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3803        where
3804            D: serde::Deserializer<'de>,
3805        {
3806            deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupVaultType>::new(
3807                ".google.cloud.netapp.v1.BackupVault.BackupVaultType",
3808            ))
3809        }
3810    }
3811
3812    /// Encryption state of customer-managed encryption keys (CMEK) backups.
3813    ///
3814    /// # Working with unknown values
3815    ///
3816    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3817    /// additional enum variants at any time. Adding new variants is not considered
3818    /// a breaking change. Applications should write their code in anticipation of:
3819    ///
3820    /// - New values appearing in future releases of the client library, **and**
3821    /// - New values received dynamically, without application changes.
3822    ///
3823    /// Please consult the [Working with enums] section in the user guide for some
3824    /// guidelines.
3825    ///
3826    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3827    #[derive(Clone, Debug, PartialEq)]
3828    #[non_exhaustive]
3829    pub enum EncryptionState {
3830        /// Encryption state not set.
3831        Unspecified,
3832        /// Encryption state is pending.
3833        Pending,
3834        /// Encryption is complete.
3835        Completed,
3836        /// Encryption is in progress.
3837        InProgress,
3838        /// Encryption has failed.
3839        Failed,
3840        /// If set, the enum was initialized with an unknown value.
3841        ///
3842        /// Applications can examine the value using [EncryptionState::value] or
3843        /// [EncryptionState::name].
3844        UnknownValue(encryption_state::UnknownValue),
3845    }
3846
3847    #[doc(hidden)]
3848    pub mod encryption_state {
3849        #[allow(unused_imports)]
3850        use super::*;
3851        #[derive(Clone, Debug, PartialEq)]
3852        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3853    }
3854
3855    impl EncryptionState {
3856        /// Gets the enum value.
3857        ///
3858        /// Returns `None` if the enum contains an unknown value deserialized from
3859        /// the string representation of enums.
3860        pub fn value(&self) -> std::option::Option<i32> {
3861            match self {
3862                Self::Unspecified => std::option::Option::Some(0),
3863                Self::Pending => std::option::Option::Some(1),
3864                Self::Completed => std::option::Option::Some(2),
3865                Self::InProgress => std::option::Option::Some(3),
3866                Self::Failed => std::option::Option::Some(4),
3867                Self::UnknownValue(u) => u.0.value(),
3868            }
3869        }
3870
3871        /// Gets the enum value as a string.
3872        ///
3873        /// Returns `None` if the enum contains an unknown value deserialized from
3874        /// the integer representation of enums.
3875        pub fn name(&self) -> std::option::Option<&str> {
3876            match self {
3877                Self::Unspecified => std::option::Option::Some("ENCRYPTION_STATE_UNSPECIFIED"),
3878                Self::Pending => std::option::Option::Some("ENCRYPTION_STATE_PENDING"),
3879                Self::Completed => std::option::Option::Some("ENCRYPTION_STATE_COMPLETED"),
3880                Self::InProgress => std::option::Option::Some("ENCRYPTION_STATE_IN_PROGRESS"),
3881                Self::Failed => std::option::Option::Some("ENCRYPTION_STATE_FAILED"),
3882                Self::UnknownValue(u) => u.0.name(),
3883            }
3884        }
3885    }
3886
3887    impl std::default::Default for EncryptionState {
3888        fn default() -> Self {
3889            use std::convert::From;
3890            Self::from(0)
3891        }
3892    }
3893
3894    impl std::fmt::Display for EncryptionState {
3895        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3896            wkt::internal::display_enum(f, self.name(), self.value())
3897        }
3898    }
3899
3900    impl std::convert::From<i32> for EncryptionState {
3901        fn from(value: i32) -> Self {
3902            match value {
3903                0 => Self::Unspecified,
3904                1 => Self::Pending,
3905                2 => Self::Completed,
3906                3 => Self::InProgress,
3907                4 => Self::Failed,
3908                _ => Self::UnknownValue(encryption_state::UnknownValue(
3909                    wkt::internal::UnknownEnumValue::Integer(value),
3910                )),
3911            }
3912        }
3913    }
3914
3915    impl std::convert::From<&str> for EncryptionState {
3916        fn from(value: &str) -> Self {
3917            use std::string::ToString;
3918            match value {
3919                "ENCRYPTION_STATE_UNSPECIFIED" => Self::Unspecified,
3920                "ENCRYPTION_STATE_PENDING" => Self::Pending,
3921                "ENCRYPTION_STATE_COMPLETED" => Self::Completed,
3922                "ENCRYPTION_STATE_IN_PROGRESS" => Self::InProgress,
3923                "ENCRYPTION_STATE_FAILED" => Self::Failed,
3924                _ => Self::UnknownValue(encryption_state::UnknownValue(
3925                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3926                )),
3927            }
3928        }
3929    }
3930
3931    impl serde::ser::Serialize for EncryptionState {
3932        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3933        where
3934            S: serde::Serializer,
3935        {
3936            match self {
3937                Self::Unspecified => serializer.serialize_i32(0),
3938                Self::Pending => serializer.serialize_i32(1),
3939                Self::Completed => serializer.serialize_i32(2),
3940                Self::InProgress => serializer.serialize_i32(3),
3941                Self::Failed => serializer.serialize_i32(4),
3942                Self::UnknownValue(u) => u.0.serialize(serializer),
3943            }
3944        }
3945    }
3946
3947    impl<'de> serde::de::Deserialize<'de> for EncryptionState {
3948        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3949        where
3950            D: serde::Deserializer<'de>,
3951        {
3952            deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionState>::new(
3953                ".google.cloud.netapp.v1.BackupVault.EncryptionState",
3954            ))
3955        }
3956    }
3957}
3958
3959/// GetBackupVaultRequest gets the state of a backupVault.
3960#[derive(Clone, Default, PartialEq)]
3961#[non_exhaustive]
3962pub struct GetBackupVaultRequest {
3963    /// Required. The backupVault resource name, in the format
3964    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
3965    pub name: std::string::String,
3966
3967    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3968}
3969
3970impl GetBackupVaultRequest {
3971    pub fn new() -> Self {
3972        std::default::Default::default()
3973    }
3974
3975    /// Sets the value of [name][crate::model::GetBackupVaultRequest::name].
3976    ///
3977    /// # Example
3978    /// ```ignore,no_run
3979    /// # use google_cloud_netapp_v1::model::GetBackupVaultRequest;
3980    /// let x = GetBackupVaultRequest::new().set_name("example");
3981    /// ```
3982    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3983        self.name = v.into();
3984        self
3985    }
3986}
3987
3988impl wkt::message::Message for GetBackupVaultRequest {
3989    fn typename() -> &'static str {
3990        "type.googleapis.com/google.cloud.netapp.v1.GetBackupVaultRequest"
3991    }
3992}
3993
3994/// ListBackupVaultsRequest lists backupVaults.
3995#[derive(Clone, Default, PartialEq)]
3996#[non_exhaustive]
3997pub struct ListBackupVaultsRequest {
3998    /// Required. The location for which to retrieve backupVault information,
3999    /// in the format
4000    /// `projects/{project_id}/locations/{location}`.
4001    pub parent: std::string::String,
4002
4003    /// The maximum number of items to return.
4004    pub page_size: i32,
4005
4006    /// The next_page_token value to use if there are additional
4007    /// results to retrieve for this list request.
4008    pub page_token: std::string::String,
4009
4010    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
4011    pub order_by: std::string::String,
4012
4013    /// List filter.
4014    pub filter: std::string::String,
4015
4016    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4017}
4018
4019impl ListBackupVaultsRequest {
4020    pub fn new() -> Self {
4021        std::default::Default::default()
4022    }
4023
4024    /// Sets the value of [parent][crate::model::ListBackupVaultsRequest::parent].
4025    ///
4026    /// # Example
4027    /// ```ignore,no_run
4028    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4029    /// let x = ListBackupVaultsRequest::new().set_parent("example");
4030    /// ```
4031    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4032        self.parent = v.into();
4033        self
4034    }
4035
4036    /// Sets the value of [page_size][crate::model::ListBackupVaultsRequest::page_size].
4037    ///
4038    /// # Example
4039    /// ```ignore,no_run
4040    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4041    /// let x = ListBackupVaultsRequest::new().set_page_size(42);
4042    /// ```
4043    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4044        self.page_size = v.into();
4045        self
4046    }
4047
4048    /// Sets the value of [page_token][crate::model::ListBackupVaultsRequest::page_token].
4049    ///
4050    /// # Example
4051    /// ```ignore,no_run
4052    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4053    /// let x = ListBackupVaultsRequest::new().set_page_token("example");
4054    /// ```
4055    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4056        self.page_token = v.into();
4057        self
4058    }
4059
4060    /// Sets the value of [order_by][crate::model::ListBackupVaultsRequest::order_by].
4061    ///
4062    /// # Example
4063    /// ```ignore,no_run
4064    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4065    /// let x = ListBackupVaultsRequest::new().set_order_by("example");
4066    /// ```
4067    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4068        self.order_by = v.into();
4069        self
4070    }
4071
4072    /// Sets the value of [filter][crate::model::ListBackupVaultsRequest::filter].
4073    ///
4074    /// # Example
4075    /// ```ignore,no_run
4076    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4077    /// let x = ListBackupVaultsRequest::new().set_filter("example");
4078    /// ```
4079    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4080        self.filter = v.into();
4081        self
4082    }
4083}
4084
4085impl wkt::message::Message for ListBackupVaultsRequest {
4086    fn typename() -> &'static str {
4087        "type.googleapis.com/google.cloud.netapp.v1.ListBackupVaultsRequest"
4088    }
4089}
4090
4091/// ListBackupVaultsResponse is the result of ListBackupVaultsRequest.
4092#[derive(Clone, Default, PartialEq)]
4093#[non_exhaustive]
4094pub struct ListBackupVaultsResponse {
4095    /// A list of backupVaults in the project for the specified location.
4096    pub backup_vaults: std::vec::Vec<crate::model::BackupVault>,
4097
4098    /// The token you can use to retrieve the next page of results. Not returned
4099    /// if there are no more results in the list.
4100    pub next_page_token: std::string::String,
4101
4102    /// Locations that could not be reached.
4103    pub unreachable: std::vec::Vec<std::string::String>,
4104
4105    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4106}
4107
4108impl ListBackupVaultsResponse {
4109    pub fn new() -> Self {
4110        std::default::Default::default()
4111    }
4112
4113    /// Sets the value of [backup_vaults][crate::model::ListBackupVaultsResponse::backup_vaults].
4114    ///
4115    /// # Example
4116    /// ```ignore,no_run
4117    /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
4118    /// use google_cloud_netapp_v1::model::BackupVault;
4119    /// let x = ListBackupVaultsResponse::new()
4120    ///     .set_backup_vaults([
4121    ///         BackupVault::default()/* use setters */,
4122    ///         BackupVault::default()/* use (different) setters */,
4123    ///     ]);
4124    /// ```
4125    pub fn set_backup_vaults<T, V>(mut self, v: T) -> Self
4126    where
4127        T: std::iter::IntoIterator<Item = V>,
4128        V: std::convert::Into<crate::model::BackupVault>,
4129    {
4130        use std::iter::Iterator;
4131        self.backup_vaults = v.into_iter().map(|i| i.into()).collect();
4132        self
4133    }
4134
4135    /// Sets the value of [next_page_token][crate::model::ListBackupVaultsResponse::next_page_token].
4136    ///
4137    /// # Example
4138    /// ```ignore,no_run
4139    /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
4140    /// let x = ListBackupVaultsResponse::new().set_next_page_token("example");
4141    /// ```
4142    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4143        self.next_page_token = v.into();
4144        self
4145    }
4146
4147    /// Sets the value of [unreachable][crate::model::ListBackupVaultsResponse::unreachable].
4148    ///
4149    /// # Example
4150    /// ```ignore,no_run
4151    /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
4152    /// let x = ListBackupVaultsResponse::new().set_unreachable(["a", "b", "c"]);
4153    /// ```
4154    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4155    where
4156        T: std::iter::IntoIterator<Item = V>,
4157        V: std::convert::Into<std::string::String>,
4158    {
4159        use std::iter::Iterator;
4160        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4161        self
4162    }
4163}
4164
4165impl wkt::message::Message for ListBackupVaultsResponse {
4166    fn typename() -> &'static str {
4167        "type.googleapis.com/google.cloud.netapp.v1.ListBackupVaultsResponse"
4168    }
4169}
4170
4171#[doc(hidden)]
4172impl gax::paginator::internal::PageableResponse for ListBackupVaultsResponse {
4173    type PageItem = crate::model::BackupVault;
4174
4175    fn items(self) -> std::vec::Vec<Self::PageItem> {
4176        self.backup_vaults
4177    }
4178
4179    fn next_page_token(&self) -> std::string::String {
4180        use std::clone::Clone;
4181        self.next_page_token.clone()
4182    }
4183}
4184
4185/// CreateBackupVaultRequest creates a backup vault.
4186#[derive(Clone, Default, PartialEq)]
4187#[non_exhaustive]
4188pub struct CreateBackupVaultRequest {
4189    /// Required. The location to create the backup vaults, in the format
4190    /// `projects/{project_id}/locations/{location}`
4191    pub parent: std::string::String,
4192
4193    /// Required. The ID to use for the backupVault.
4194    /// The ID must be unique within the specified location.
4195    /// Must contain only letters, numbers and hyphen, with the first
4196    /// character a letter, the last a letter or a
4197    /// number, and a 63 character maximum.
4198    pub backup_vault_id: std::string::String,
4199
4200    /// Required. A backupVault resource
4201    pub backup_vault: std::option::Option<crate::model::BackupVault>,
4202
4203    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4204}
4205
4206impl CreateBackupVaultRequest {
4207    pub fn new() -> Self {
4208        std::default::Default::default()
4209    }
4210
4211    /// Sets the value of [parent][crate::model::CreateBackupVaultRequest::parent].
4212    ///
4213    /// # Example
4214    /// ```ignore,no_run
4215    /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4216    /// let x = CreateBackupVaultRequest::new().set_parent("example");
4217    /// ```
4218    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4219        self.parent = v.into();
4220        self
4221    }
4222
4223    /// Sets the value of [backup_vault_id][crate::model::CreateBackupVaultRequest::backup_vault_id].
4224    ///
4225    /// # Example
4226    /// ```ignore,no_run
4227    /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4228    /// let x = CreateBackupVaultRequest::new().set_backup_vault_id("example");
4229    /// ```
4230    pub fn set_backup_vault_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4231        self.backup_vault_id = v.into();
4232        self
4233    }
4234
4235    /// Sets the value of [backup_vault][crate::model::CreateBackupVaultRequest::backup_vault].
4236    ///
4237    /// # Example
4238    /// ```ignore,no_run
4239    /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4240    /// use google_cloud_netapp_v1::model::BackupVault;
4241    /// let x = CreateBackupVaultRequest::new().set_backup_vault(BackupVault::default()/* use setters */);
4242    /// ```
4243    pub fn set_backup_vault<T>(mut self, v: T) -> Self
4244    where
4245        T: std::convert::Into<crate::model::BackupVault>,
4246    {
4247        self.backup_vault = std::option::Option::Some(v.into());
4248        self
4249    }
4250
4251    /// Sets or clears the value of [backup_vault][crate::model::CreateBackupVaultRequest::backup_vault].
4252    ///
4253    /// # Example
4254    /// ```ignore,no_run
4255    /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4256    /// use google_cloud_netapp_v1::model::BackupVault;
4257    /// let x = CreateBackupVaultRequest::new().set_or_clear_backup_vault(Some(BackupVault::default()/* use setters */));
4258    /// let x = CreateBackupVaultRequest::new().set_or_clear_backup_vault(None::<BackupVault>);
4259    /// ```
4260    pub fn set_or_clear_backup_vault<T>(mut self, v: std::option::Option<T>) -> Self
4261    where
4262        T: std::convert::Into<crate::model::BackupVault>,
4263    {
4264        self.backup_vault = v.map(|x| x.into());
4265        self
4266    }
4267}
4268
4269impl wkt::message::Message for CreateBackupVaultRequest {
4270    fn typename() -> &'static str {
4271        "type.googleapis.com/google.cloud.netapp.v1.CreateBackupVaultRequest"
4272    }
4273}
4274
4275/// DeleteBackupVaultRequest deletes a backupVault.
4276#[derive(Clone, Default, PartialEq)]
4277#[non_exhaustive]
4278pub struct DeleteBackupVaultRequest {
4279    /// Required. The backupVault resource name, in the format
4280    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
4281    pub name: std::string::String,
4282
4283    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4284}
4285
4286impl DeleteBackupVaultRequest {
4287    pub fn new() -> Self {
4288        std::default::Default::default()
4289    }
4290
4291    /// Sets the value of [name][crate::model::DeleteBackupVaultRequest::name].
4292    ///
4293    /// # Example
4294    /// ```ignore,no_run
4295    /// # use google_cloud_netapp_v1::model::DeleteBackupVaultRequest;
4296    /// let x = DeleteBackupVaultRequest::new().set_name("example");
4297    /// ```
4298    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4299        self.name = v.into();
4300        self
4301    }
4302}
4303
4304impl wkt::message::Message for DeleteBackupVaultRequest {
4305    fn typename() -> &'static str {
4306        "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupVaultRequest"
4307    }
4308}
4309
4310/// UpdateBackupVaultRequest updates description and/or labels for a backupVault.
4311#[derive(Clone, Default, PartialEq)]
4312#[non_exhaustive]
4313pub struct UpdateBackupVaultRequest {
4314    /// Required. Field mask is used to specify the fields to be overwritten in the
4315    /// Backup resource to be updated.
4316    /// The fields specified in the update_mask are relative to the resource, not
4317    /// the full request. A field will be overwritten if it is in the mask. If the
4318    /// user does not provide a mask then all fields will be overwritten.
4319    pub update_mask: std::option::Option<wkt::FieldMask>,
4320
4321    /// Required. The backupVault being updated
4322    pub backup_vault: std::option::Option<crate::model::BackupVault>,
4323
4324    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4325}
4326
4327impl UpdateBackupVaultRequest {
4328    pub fn new() -> Self {
4329        std::default::Default::default()
4330    }
4331
4332    /// Sets the value of [update_mask][crate::model::UpdateBackupVaultRequest::update_mask].
4333    ///
4334    /// # Example
4335    /// ```ignore,no_run
4336    /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4337    /// use wkt::FieldMask;
4338    /// let x = UpdateBackupVaultRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4339    /// ```
4340    pub fn set_update_mask<T>(mut self, v: T) -> Self
4341    where
4342        T: std::convert::Into<wkt::FieldMask>,
4343    {
4344        self.update_mask = std::option::Option::Some(v.into());
4345        self
4346    }
4347
4348    /// Sets or clears the value of [update_mask][crate::model::UpdateBackupVaultRequest::update_mask].
4349    ///
4350    /// # Example
4351    /// ```ignore,no_run
4352    /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4353    /// use wkt::FieldMask;
4354    /// let x = UpdateBackupVaultRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4355    /// let x = UpdateBackupVaultRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4356    /// ```
4357    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4358    where
4359        T: std::convert::Into<wkt::FieldMask>,
4360    {
4361        self.update_mask = v.map(|x| x.into());
4362        self
4363    }
4364
4365    /// Sets the value of [backup_vault][crate::model::UpdateBackupVaultRequest::backup_vault].
4366    ///
4367    /// # Example
4368    /// ```ignore,no_run
4369    /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4370    /// use google_cloud_netapp_v1::model::BackupVault;
4371    /// let x = UpdateBackupVaultRequest::new().set_backup_vault(BackupVault::default()/* use setters */);
4372    /// ```
4373    pub fn set_backup_vault<T>(mut self, v: T) -> Self
4374    where
4375        T: std::convert::Into<crate::model::BackupVault>,
4376    {
4377        self.backup_vault = std::option::Option::Some(v.into());
4378        self
4379    }
4380
4381    /// Sets or clears the value of [backup_vault][crate::model::UpdateBackupVaultRequest::backup_vault].
4382    ///
4383    /// # Example
4384    /// ```ignore,no_run
4385    /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4386    /// use google_cloud_netapp_v1::model::BackupVault;
4387    /// let x = UpdateBackupVaultRequest::new().set_or_clear_backup_vault(Some(BackupVault::default()/* use setters */));
4388    /// let x = UpdateBackupVaultRequest::new().set_or_clear_backup_vault(None::<BackupVault>);
4389    /// ```
4390    pub fn set_or_clear_backup_vault<T>(mut self, v: std::option::Option<T>) -> Self
4391    where
4392        T: std::convert::Into<crate::model::BackupVault>,
4393    {
4394        self.backup_vault = v.map(|x| x.into());
4395        self
4396    }
4397}
4398
4399impl wkt::message::Message for UpdateBackupVaultRequest {
4400    fn typename() -> &'static str {
4401        "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupVaultRequest"
4402    }
4403}
4404
4405/// Represents the metadata of the long-running operation.
4406#[derive(Clone, Default, PartialEq)]
4407#[non_exhaustive]
4408pub struct OperationMetadata {
4409    /// Output only. The time the operation was created.
4410    pub create_time: std::option::Option<wkt::Timestamp>,
4411
4412    /// Output only. The time the operation finished running.
4413    pub end_time: std::option::Option<wkt::Timestamp>,
4414
4415    /// Output only. Server-defined resource path for the target of the operation.
4416    pub target: std::string::String,
4417
4418    /// Output only. Name of the verb executed by the operation.
4419    pub verb: std::string::String,
4420
4421    /// Output only. Human-readable status of the operation, if any.
4422    pub status_message: std::string::String,
4423
4424    /// Output only. Identifies whether the user has requested cancellation
4425    /// of the operation. Operations that have been canceled successfully
4426    /// have [Operation.error][] value with a
4427    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
4428    /// `Code.CANCELLED`.
4429    ///
4430    /// [google.rpc.Status.code]: rpc::model::Status::code
4431    pub requested_cancellation: bool,
4432
4433    /// Output only. API version used to start the operation.
4434    pub api_version: std::string::String,
4435
4436    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4437}
4438
4439impl OperationMetadata {
4440    pub fn new() -> Self {
4441        std::default::Default::default()
4442    }
4443
4444    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
4445    ///
4446    /// # Example
4447    /// ```ignore,no_run
4448    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4449    /// use wkt::Timestamp;
4450    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
4451    /// ```
4452    pub fn set_create_time<T>(mut self, v: T) -> Self
4453    where
4454        T: std::convert::Into<wkt::Timestamp>,
4455    {
4456        self.create_time = std::option::Option::Some(v.into());
4457        self
4458    }
4459
4460    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
4461    ///
4462    /// # Example
4463    /// ```ignore,no_run
4464    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4465    /// use wkt::Timestamp;
4466    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4467    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
4468    /// ```
4469    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4470    where
4471        T: std::convert::Into<wkt::Timestamp>,
4472    {
4473        self.create_time = v.map(|x| x.into());
4474        self
4475    }
4476
4477    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
4478    ///
4479    /// # Example
4480    /// ```ignore,no_run
4481    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4482    /// use wkt::Timestamp;
4483    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
4484    /// ```
4485    pub fn set_end_time<T>(mut self, v: T) -> Self
4486    where
4487        T: std::convert::Into<wkt::Timestamp>,
4488    {
4489        self.end_time = std::option::Option::Some(v.into());
4490        self
4491    }
4492
4493    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
4494    ///
4495    /// # Example
4496    /// ```ignore,no_run
4497    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4498    /// use wkt::Timestamp;
4499    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
4500    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
4501    /// ```
4502    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4503    where
4504        T: std::convert::Into<wkt::Timestamp>,
4505    {
4506        self.end_time = v.map(|x| x.into());
4507        self
4508    }
4509
4510    /// Sets the value of [target][crate::model::OperationMetadata::target].
4511    ///
4512    /// # Example
4513    /// ```ignore,no_run
4514    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4515    /// let x = OperationMetadata::new().set_target("example");
4516    /// ```
4517    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4518        self.target = v.into();
4519        self
4520    }
4521
4522    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
4523    ///
4524    /// # Example
4525    /// ```ignore,no_run
4526    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4527    /// let x = OperationMetadata::new().set_verb("example");
4528    /// ```
4529    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4530        self.verb = v.into();
4531        self
4532    }
4533
4534    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
4535    ///
4536    /// # Example
4537    /// ```ignore,no_run
4538    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4539    /// let x = OperationMetadata::new().set_status_message("example");
4540    /// ```
4541    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4542        self.status_message = v.into();
4543        self
4544    }
4545
4546    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
4547    ///
4548    /// # Example
4549    /// ```ignore,no_run
4550    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4551    /// let x = OperationMetadata::new().set_requested_cancellation(true);
4552    /// ```
4553    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4554        self.requested_cancellation = v.into();
4555        self
4556    }
4557
4558    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
4559    ///
4560    /// # Example
4561    /// ```ignore,no_run
4562    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4563    /// let x = OperationMetadata::new().set_api_version("example");
4564    /// ```
4565    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4566        self.api_version = v.into();
4567        self
4568    }
4569}
4570
4571impl wkt::message::Message for OperationMetadata {
4572    fn typename() -> &'static str {
4573        "type.googleapis.com/google.cloud.netapp.v1.OperationMetadata"
4574    }
4575}
4576
4577/// Metadata for a given
4578/// [google.cloud.location.Location][google.cloud.location.Location].
4579///
4580/// [google.cloud.location.Location]: location::model::Location
4581#[derive(Clone, Default, PartialEq)]
4582#[non_exhaustive]
4583pub struct LocationMetadata {
4584    /// Output only. Supported service levels in a location.
4585    pub supported_service_levels: std::vec::Vec<crate::model::ServiceLevel>,
4586
4587    /// Output only. Supported flex performance in a location.
4588    pub supported_flex_performance: std::vec::Vec<crate::model::FlexPerformance>,
4589
4590    /// Output only. Indicates if the location has VCP support.
4591    pub has_vcp: bool,
4592
4593    /// Output only. Indicates if the location has ONTAP Proxy support.
4594    pub has_ontap_proxy: bool,
4595
4596    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4597}
4598
4599impl LocationMetadata {
4600    pub fn new() -> Self {
4601        std::default::Default::default()
4602    }
4603
4604    /// Sets the value of [supported_service_levels][crate::model::LocationMetadata::supported_service_levels].
4605    ///
4606    /// # Example
4607    /// ```ignore,no_run
4608    /// # use google_cloud_netapp_v1::model::LocationMetadata;
4609    /// use google_cloud_netapp_v1::model::ServiceLevel;
4610    /// let x = LocationMetadata::new().set_supported_service_levels([
4611    ///     ServiceLevel::Premium,
4612    ///     ServiceLevel::Extreme,
4613    ///     ServiceLevel::Standard,
4614    /// ]);
4615    /// ```
4616    pub fn set_supported_service_levels<T, V>(mut self, v: T) -> Self
4617    where
4618        T: std::iter::IntoIterator<Item = V>,
4619        V: std::convert::Into<crate::model::ServiceLevel>,
4620    {
4621        use std::iter::Iterator;
4622        self.supported_service_levels = v.into_iter().map(|i| i.into()).collect();
4623        self
4624    }
4625
4626    /// Sets the value of [supported_flex_performance][crate::model::LocationMetadata::supported_flex_performance].
4627    ///
4628    /// # Example
4629    /// ```ignore,no_run
4630    /// # use google_cloud_netapp_v1::model::LocationMetadata;
4631    /// use google_cloud_netapp_v1::model::FlexPerformance;
4632    /// let x = LocationMetadata::new().set_supported_flex_performance([
4633    ///     FlexPerformance::Default,
4634    ///     FlexPerformance::Custom,
4635    /// ]);
4636    /// ```
4637    pub fn set_supported_flex_performance<T, V>(mut self, v: T) -> Self
4638    where
4639        T: std::iter::IntoIterator<Item = V>,
4640        V: std::convert::Into<crate::model::FlexPerformance>,
4641    {
4642        use std::iter::Iterator;
4643        self.supported_flex_performance = v.into_iter().map(|i| i.into()).collect();
4644        self
4645    }
4646
4647    /// Sets the value of [has_vcp][crate::model::LocationMetadata::has_vcp].
4648    ///
4649    /// # Example
4650    /// ```ignore,no_run
4651    /// # use google_cloud_netapp_v1::model::LocationMetadata;
4652    /// let x = LocationMetadata::new().set_has_vcp(true);
4653    /// ```
4654    pub fn set_has_vcp<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4655        self.has_vcp = v.into();
4656        self
4657    }
4658
4659    /// Sets the value of [has_ontap_proxy][crate::model::LocationMetadata::has_ontap_proxy].
4660    ///
4661    /// # Example
4662    /// ```ignore,no_run
4663    /// # use google_cloud_netapp_v1::model::LocationMetadata;
4664    /// let x = LocationMetadata::new().set_has_ontap_proxy(true);
4665    /// ```
4666    pub fn set_has_ontap_proxy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4667        self.has_ontap_proxy = v.into();
4668        self
4669    }
4670}
4671
4672impl wkt::message::Message for LocationMetadata {
4673    fn typename() -> &'static str {
4674        "type.googleapis.com/google.cloud.netapp.v1.LocationMetadata"
4675    }
4676}
4677
4678/// UserCommands contains the commands to be executed by the customer.
4679#[derive(Clone, Default, PartialEq)]
4680#[non_exhaustive]
4681pub struct UserCommands {
4682    /// Output only. List of commands to be executed by the customer.
4683    pub commands: std::vec::Vec<std::string::String>,
4684
4685    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4686}
4687
4688impl UserCommands {
4689    pub fn new() -> Self {
4690        std::default::Default::default()
4691    }
4692
4693    /// Sets the value of [commands][crate::model::UserCommands::commands].
4694    ///
4695    /// # Example
4696    /// ```ignore,no_run
4697    /// # use google_cloud_netapp_v1::model::UserCommands;
4698    /// let x = UserCommands::new().set_commands(["a", "b", "c"]);
4699    /// ```
4700    pub fn set_commands<T, V>(mut self, v: T) -> Self
4701    where
4702        T: std::iter::IntoIterator<Item = V>,
4703        V: std::convert::Into<std::string::String>,
4704    {
4705        use std::iter::Iterator;
4706        self.commands = v.into_iter().map(|i| i.into()).collect();
4707        self
4708    }
4709}
4710
4711impl wkt::message::Message for UserCommands {
4712    fn typename() -> &'static str {
4713        "type.googleapis.com/google.cloud.netapp.v1.UserCommands"
4714    }
4715}
4716
4717/// ListHostGroupsRequest for listing host groups.
4718#[derive(Clone, Default, PartialEq)]
4719#[non_exhaustive]
4720pub struct ListHostGroupsRequest {
4721    /// Required. Parent value for ListHostGroupsRequest
4722    pub parent: std::string::String,
4723
4724    /// Optional. Requested page size. Server may return fewer items than
4725    /// requested. If unspecified, the server will pick an appropriate default.
4726    pub page_size: i32,
4727
4728    /// Optional. A token identifying a page of results the server should return.
4729    pub page_token: std::string::String,
4730
4731    /// Optional. Filter to apply to the request.
4732    pub filter: std::string::String,
4733
4734    /// Optional. Hint for how to order the results
4735    pub order_by: std::string::String,
4736
4737    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4738}
4739
4740impl ListHostGroupsRequest {
4741    pub fn new() -> Self {
4742        std::default::Default::default()
4743    }
4744
4745    /// Sets the value of [parent][crate::model::ListHostGroupsRequest::parent].
4746    ///
4747    /// # Example
4748    /// ```ignore,no_run
4749    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4750    /// let x = ListHostGroupsRequest::new().set_parent("example");
4751    /// ```
4752    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4753        self.parent = v.into();
4754        self
4755    }
4756
4757    /// Sets the value of [page_size][crate::model::ListHostGroupsRequest::page_size].
4758    ///
4759    /// # Example
4760    /// ```ignore,no_run
4761    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4762    /// let x = ListHostGroupsRequest::new().set_page_size(42);
4763    /// ```
4764    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4765        self.page_size = v.into();
4766        self
4767    }
4768
4769    /// Sets the value of [page_token][crate::model::ListHostGroupsRequest::page_token].
4770    ///
4771    /// # Example
4772    /// ```ignore,no_run
4773    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4774    /// let x = ListHostGroupsRequest::new().set_page_token("example");
4775    /// ```
4776    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4777        self.page_token = v.into();
4778        self
4779    }
4780
4781    /// Sets the value of [filter][crate::model::ListHostGroupsRequest::filter].
4782    ///
4783    /// # Example
4784    /// ```ignore,no_run
4785    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4786    /// let x = ListHostGroupsRequest::new().set_filter("example");
4787    /// ```
4788    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4789        self.filter = v.into();
4790        self
4791    }
4792
4793    /// Sets the value of [order_by][crate::model::ListHostGroupsRequest::order_by].
4794    ///
4795    /// # Example
4796    /// ```ignore,no_run
4797    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4798    /// let x = ListHostGroupsRequest::new().set_order_by("example");
4799    /// ```
4800    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4801        self.order_by = v.into();
4802        self
4803    }
4804}
4805
4806impl wkt::message::Message for ListHostGroupsRequest {
4807    fn typename() -> &'static str {
4808        "type.googleapis.com/google.cloud.netapp.v1.ListHostGroupsRequest"
4809    }
4810}
4811
4812/// ListHostGroupsResponse is the response to a ListHostGroupsRequest.
4813#[derive(Clone, Default, PartialEq)]
4814#[non_exhaustive]
4815pub struct ListHostGroupsResponse {
4816    /// The list of host groups.
4817    pub host_groups: std::vec::Vec<crate::model::HostGroup>,
4818
4819    /// A token identifying a page of results the server should return.
4820    pub next_page_token: std::string::String,
4821
4822    /// Locations that could not be reached.
4823    pub unreachable: std::vec::Vec<std::string::String>,
4824
4825    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4826}
4827
4828impl ListHostGroupsResponse {
4829    pub fn new() -> Self {
4830        std::default::Default::default()
4831    }
4832
4833    /// Sets the value of [host_groups][crate::model::ListHostGroupsResponse::host_groups].
4834    ///
4835    /// # Example
4836    /// ```ignore,no_run
4837    /// # use google_cloud_netapp_v1::model::ListHostGroupsResponse;
4838    /// use google_cloud_netapp_v1::model::HostGroup;
4839    /// let x = ListHostGroupsResponse::new()
4840    ///     .set_host_groups([
4841    ///         HostGroup::default()/* use setters */,
4842    ///         HostGroup::default()/* use (different) setters */,
4843    ///     ]);
4844    /// ```
4845    pub fn set_host_groups<T, V>(mut self, v: T) -> Self
4846    where
4847        T: std::iter::IntoIterator<Item = V>,
4848        V: std::convert::Into<crate::model::HostGroup>,
4849    {
4850        use std::iter::Iterator;
4851        self.host_groups = v.into_iter().map(|i| i.into()).collect();
4852        self
4853    }
4854
4855    /// Sets the value of [next_page_token][crate::model::ListHostGroupsResponse::next_page_token].
4856    ///
4857    /// # Example
4858    /// ```ignore,no_run
4859    /// # use google_cloud_netapp_v1::model::ListHostGroupsResponse;
4860    /// let x = ListHostGroupsResponse::new().set_next_page_token("example");
4861    /// ```
4862    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4863        self.next_page_token = v.into();
4864        self
4865    }
4866
4867    /// Sets the value of [unreachable][crate::model::ListHostGroupsResponse::unreachable].
4868    ///
4869    /// # Example
4870    /// ```ignore,no_run
4871    /// # use google_cloud_netapp_v1::model::ListHostGroupsResponse;
4872    /// let x = ListHostGroupsResponse::new().set_unreachable(["a", "b", "c"]);
4873    /// ```
4874    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4875    where
4876        T: std::iter::IntoIterator<Item = V>,
4877        V: std::convert::Into<std::string::String>,
4878    {
4879        use std::iter::Iterator;
4880        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4881        self
4882    }
4883}
4884
4885impl wkt::message::Message for ListHostGroupsResponse {
4886    fn typename() -> &'static str {
4887        "type.googleapis.com/google.cloud.netapp.v1.ListHostGroupsResponse"
4888    }
4889}
4890
4891#[doc(hidden)]
4892impl gax::paginator::internal::PageableResponse for ListHostGroupsResponse {
4893    type PageItem = crate::model::HostGroup;
4894
4895    fn items(self) -> std::vec::Vec<Self::PageItem> {
4896        self.host_groups
4897    }
4898
4899    fn next_page_token(&self) -> std::string::String {
4900        use std::clone::Clone;
4901        self.next_page_token.clone()
4902    }
4903}
4904
4905/// GetHostGroupRequest for getting a host group.
4906#[derive(Clone, Default, PartialEq)]
4907#[non_exhaustive]
4908pub struct GetHostGroupRequest {
4909    /// Required. The resource name of the host group.
4910    /// Format:
4911    /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
4912    pub name: std::string::String,
4913
4914    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4915}
4916
4917impl GetHostGroupRequest {
4918    pub fn new() -> Self {
4919        std::default::Default::default()
4920    }
4921
4922    /// Sets the value of [name][crate::model::GetHostGroupRequest::name].
4923    ///
4924    /// # Example
4925    /// ```ignore,no_run
4926    /// # use google_cloud_netapp_v1::model::GetHostGroupRequest;
4927    /// let x = GetHostGroupRequest::new().set_name("example");
4928    /// ```
4929    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4930        self.name = v.into();
4931        self
4932    }
4933}
4934
4935impl wkt::message::Message for GetHostGroupRequest {
4936    fn typename() -> &'static str {
4937        "type.googleapis.com/google.cloud.netapp.v1.GetHostGroupRequest"
4938    }
4939}
4940
4941/// CreateHostGroupRequest for creating a host group.
4942#[derive(Clone, Default, PartialEq)]
4943#[non_exhaustive]
4944pub struct CreateHostGroupRequest {
4945    /// Required. Parent value for CreateHostGroupRequest
4946    pub parent: std::string::String,
4947
4948    /// Required. Fields of the host group to create.
4949    pub host_group: std::option::Option<crate::model::HostGroup>,
4950
4951    /// Required. ID of the host group to create. Must be unique within the parent
4952    /// resource. Must contain only letters, numbers, and hyphen, with
4953    /// the first character a letter or underscore, the last a letter or underscore
4954    /// or a number, and a 63 character maximum.
4955    pub host_group_id: std::string::String,
4956
4957    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4958}
4959
4960impl CreateHostGroupRequest {
4961    pub fn new() -> Self {
4962        std::default::Default::default()
4963    }
4964
4965    /// Sets the value of [parent][crate::model::CreateHostGroupRequest::parent].
4966    ///
4967    /// # Example
4968    /// ```ignore,no_run
4969    /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
4970    /// let x = CreateHostGroupRequest::new().set_parent("example");
4971    /// ```
4972    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4973        self.parent = v.into();
4974        self
4975    }
4976
4977    /// Sets the value of [host_group][crate::model::CreateHostGroupRequest::host_group].
4978    ///
4979    /// # Example
4980    /// ```ignore,no_run
4981    /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
4982    /// use google_cloud_netapp_v1::model::HostGroup;
4983    /// let x = CreateHostGroupRequest::new().set_host_group(HostGroup::default()/* use setters */);
4984    /// ```
4985    pub fn set_host_group<T>(mut self, v: T) -> Self
4986    where
4987        T: std::convert::Into<crate::model::HostGroup>,
4988    {
4989        self.host_group = std::option::Option::Some(v.into());
4990        self
4991    }
4992
4993    /// Sets or clears the value of [host_group][crate::model::CreateHostGroupRequest::host_group].
4994    ///
4995    /// # Example
4996    /// ```ignore,no_run
4997    /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
4998    /// use google_cloud_netapp_v1::model::HostGroup;
4999    /// let x = CreateHostGroupRequest::new().set_or_clear_host_group(Some(HostGroup::default()/* use setters */));
5000    /// let x = CreateHostGroupRequest::new().set_or_clear_host_group(None::<HostGroup>);
5001    /// ```
5002    pub fn set_or_clear_host_group<T>(mut self, v: std::option::Option<T>) -> Self
5003    where
5004        T: std::convert::Into<crate::model::HostGroup>,
5005    {
5006        self.host_group = v.map(|x| x.into());
5007        self
5008    }
5009
5010    /// Sets the value of [host_group_id][crate::model::CreateHostGroupRequest::host_group_id].
5011    ///
5012    /// # Example
5013    /// ```ignore,no_run
5014    /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
5015    /// let x = CreateHostGroupRequest::new().set_host_group_id("example");
5016    /// ```
5017    pub fn set_host_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5018        self.host_group_id = v.into();
5019        self
5020    }
5021}
5022
5023impl wkt::message::Message for CreateHostGroupRequest {
5024    fn typename() -> &'static str {
5025        "type.googleapis.com/google.cloud.netapp.v1.CreateHostGroupRequest"
5026    }
5027}
5028
5029/// UpdateHostGroupRequest for updating a host group.
5030#[derive(Clone, Default, PartialEq)]
5031#[non_exhaustive]
5032pub struct UpdateHostGroupRequest {
5033    /// Required. The host group to update.
5034    /// The host group's `name` field is used to identify the host group.
5035    /// Format:
5036    /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5037    pub host_group: std::option::Option<crate::model::HostGroup>,
5038
5039    /// Optional. The list of fields to update.
5040    pub update_mask: std::option::Option<wkt::FieldMask>,
5041
5042    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5043}
5044
5045impl UpdateHostGroupRequest {
5046    pub fn new() -> Self {
5047        std::default::Default::default()
5048    }
5049
5050    /// Sets the value of [host_group][crate::model::UpdateHostGroupRequest::host_group].
5051    ///
5052    /// # Example
5053    /// ```ignore,no_run
5054    /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5055    /// use google_cloud_netapp_v1::model::HostGroup;
5056    /// let x = UpdateHostGroupRequest::new().set_host_group(HostGroup::default()/* use setters */);
5057    /// ```
5058    pub fn set_host_group<T>(mut self, v: T) -> Self
5059    where
5060        T: std::convert::Into<crate::model::HostGroup>,
5061    {
5062        self.host_group = std::option::Option::Some(v.into());
5063        self
5064    }
5065
5066    /// Sets or clears the value of [host_group][crate::model::UpdateHostGroupRequest::host_group].
5067    ///
5068    /// # Example
5069    /// ```ignore,no_run
5070    /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5071    /// use google_cloud_netapp_v1::model::HostGroup;
5072    /// let x = UpdateHostGroupRequest::new().set_or_clear_host_group(Some(HostGroup::default()/* use setters */));
5073    /// let x = UpdateHostGroupRequest::new().set_or_clear_host_group(None::<HostGroup>);
5074    /// ```
5075    pub fn set_or_clear_host_group<T>(mut self, v: std::option::Option<T>) -> Self
5076    where
5077        T: std::convert::Into<crate::model::HostGroup>,
5078    {
5079        self.host_group = v.map(|x| x.into());
5080        self
5081    }
5082
5083    /// Sets the value of [update_mask][crate::model::UpdateHostGroupRequest::update_mask].
5084    ///
5085    /// # Example
5086    /// ```ignore,no_run
5087    /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5088    /// use wkt::FieldMask;
5089    /// let x = UpdateHostGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5090    /// ```
5091    pub fn set_update_mask<T>(mut self, v: T) -> Self
5092    where
5093        T: std::convert::Into<wkt::FieldMask>,
5094    {
5095        self.update_mask = std::option::Option::Some(v.into());
5096        self
5097    }
5098
5099    /// Sets or clears the value of [update_mask][crate::model::UpdateHostGroupRequest::update_mask].
5100    ///
5101    /// # Example
5102    /// ```ignore,no_run
5103    /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5104    /// use wkt::FieldMask;
5105    /// let x = UpdateHostGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5106    /// let x = UpdateHostGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5107    /// ```
5108    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5109    where
5110        T: std::convert::Into<wkt::FieldMask>,
5111    {
5112        self.update_mask = v.map(|x| x.into());
5113        self
5114    }
5115}
5116
5117impl wkt::message::Message for UpdateHostGroupRequest {
5118    fn typename() -> &'static str {
5119        "type.googleapis.com/google.cloud.netapp.v1.UpdateHostGroupRequest"
5120    }
5121}
5122
5123/// DeleteHostGroupRequest for deleting a single host group.
5124#[derive(Clone, Default, PartialEq)]
5125#[non_exhaustive]
5126pub struct DeleteHostGroupRequest {
5127    /// Required. The resource name of the host group.
5128    /// Format:
5129    /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5130    pub name: std::string::String,
5131
5132    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5133}
5134
5135impl DeleteHostGroupRequest {
5136    pub fn new() -> Self {
5137        std::default::Default::default()
5138    }
5139
5140    /// Sets the value of [name][crate::model::DeleteHostGroupRequest::name].
5141    ///
5142    /// # Example
5143    /// ```ignore,no_run
5144    /// # use google_cloud_netapp_v1::model::DeleteHostGroupRequest;
5145    /// let x = DeleteHostGroupRequest::new().set_name("example");
5146    /// ```
5147    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5148        self.name = v.into();
5149        self
5150    }
5151}
5152
5153impl wkt::message::Message for DeleteHostGroupRequest {
5154    fn typename() -> &'static str {
5155        "type.googleapis.com/google.cloud.netapp.v1.DeleteHostGroupRequest"
5156    }
5157}
5158
5159/// Host group is a collection of hosts that can be used for accessing a Block
5160/// Volume.
5161#[derive(Clone, Default, PartialEq)]
5162#[non_exhaustive]
5163pub struct HostGroup {
5164    /// Identifier. The resource name of the host group.
5165    /// Format:
5166    /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5167    pub name: std::string::String,
5168
5169    /// Required. Type of the host group.
5170    pub r#type: crate::model::host_group::Type,
5171
5172    /// Output only. State of the host group.
5173    pub state: crate::model::host_group::State,
5174
5175    /// Output only. Create time of the host group.
5176    pub create_time: std::option::Option<wkt::Timestamp>,
5177
5178    /// Required. The list of hosts associated with the host group.
5179    pub hosts: std::vec::Vec<std::string::String>,
5180
5181    /// Required. The OS type of the host group. It indicates the type of operating
5182    /// system used by all of the hosts in the HostGroup. All hosts in a HostGroup
5183    /// must be of the same OS type. This can be set only when creating a
5184    /// HostGroup.
5185    pub os_type: crate::model::OsType,
5186
5187    /// Optional. Description of the host group.
5188    pub description: std::string::String,
5189
5190    /// Optional. Labels of the host group.
5191    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5192
5193    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5194}
5195
5196impl HostGroup {
5197    pub fn new() -> Self {
5198        std::default::Default::default()
5199    }
5200
5201    /// Sets the value of [name][crate::model::HostGroup::name].
5202    ///
5203    /// # Example
5204    /// ```ignore,no_run
5205    /// # use google_cloud_netapp_v1::model::HostGroup;
5206    /// let x = HostGroup::new().set_name("example");
5207    /// ```
5208    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5209        self.name = v.into();
5210        self
5211    }
5212
5213    /// Sets the value of [r#type][crate::model::HostGroup::type].
5214    ///
5215    /// # Example
5216    /// ```ignore,no_run
5217    /// # use google_cloud_netapp_v1::model::HostGroup;
5218    /// use google_cloud_netapp_v1::model::host_group::Type;
5219    /// let x0 = HostGroup::new().set_type(Type::IscsiInitiator);
5220    /// ```
5221    pub fn set_type<T: std::convert::Into<crate::model::host_group::Type>>(mut self, v: T) -> Self {
5222        self.r#type = v.into();
5223        self
5224    }
5225
5226    /// Sets the value of [state][crate::model::HostGroup::state].
5227    ///
5228    /// # Example
5229    /// ```ignore,no_run
5230    /// # use google_cloud_netapp_v1::model::HostGroup;
5231    /// use google_cloud_netapp_v1::model::host_group::State;
5232    /// let x0 = HostGroup::new().set_state(State::Creating);
5233    /// let x1 = HostGroup::new().set_state(State::Ready);
5234    /// let x2 = HostGroup::new().set_state(State::Updating);
5235    /// ```
5236    pub fn set_state<T: std::convert::Into<crate::model::host_group::State>>(
5237        mut self,
5238        v: T,
5239    ) -> Self {
5240        self.state = v.into();
5241        self
5242    }
5243
5244    /// Sets the value of [create_time][crate::model::HostGroup::create_time].
5245    ///
5246    /// # Example
5247    /// ```ignore,no_run
5248    /// # use google_cloud_netapp_v1::model::HostGroup;
5249    /// use wkt::Timestamp;
5250    /// let x = HostGroup::new().set_create_time(Timestamp::default()/* use setters */);
5251    /// ```
5252    pub fn set_create_time<T>(mut self, v: T) -> Self
5253    where
5254        T: std::convert::Into<wkt::Timestamp>,
5255    {
5256        self.create_time = std::option::Option::Some(v.into());
5257        self
5258    }
5259
5260    /// Sets or clears the value of [create_time][crate::model::HostGroup::create_time].
5261    ///
5262    /// # Example
5263    /// ```ignore,no_run
5264    /// # use google_cloud_netapp_v1::model::HostGroup;
5265    /// use wkt::Timestamp;
5266    /// let x = HostGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5267    /// let x = HostGroup::new().set_or_clear_create_time(None::<Timestamp>);
5268    /// ```
5269    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5270    where
5271        T: std::convert::Into<wkt::Timestamp>,
5272    {
5273        self.create_time = v.map(|x| x.into());
5274        self
5275    }
5276
5277    /// Sets the value of [hosts][crate::model::HostGroup::hosts].
5278    ///
5279    /// # Example
5280    /// ```ignore,no_run
5281    /// # use google_cloud_netapp_v1::model::HostGroup;
5282    /// let x = HostGroup::new().set_hosts(["a", "b", "c"]);
5283    /// ```
5284    pub fn set_hosts<T, V>(mut self, v: T) -> Self
5285    where
5286        T: std::iter::IntoIterator<Item = V>,
5287        V: std::convert::Into<std::string::String>,
5288    {
5289        use std::iter::Iterator;
5290        self.hosts = v.into_iter().map(|i| i.into()).collect();
5291        self
5292    }
5293
5294    /// Sets the value of [os_type][crate::model::HostGroup::os_type].
5295    ///
5296    /// # Example
5297    /// ```ignore,no_run
5298    /// # use google_cloud_netapp_v1::model::HostGroup;
5299    /// use google_cloud_netapp_v1::model::OsType;
5300    /// let x0 = HostGroup::new().set_os_type(OsType::Linux);
5301    /// let x1 = HostGroup::new().set_os_type(OsType::Windows);
5302    /// let x2 = HostGroup::new().set_os_type(OsType::Esxi);
5303    /// ```
5304    pub fn set_os_type<T: std::convert::Into<crate::model::OsType>>(mut self, v: T) -> Self {
5305        self.os_type = v.into();
5306        self
5307    }
5308
5309    /// Sets the value of [description][crate::model::HostGroup::description].
5310    ///
5311    /// # Example
5312    /// ```ignore,no_run
5313    /// # use google_cloud_netapp_v1::model::HostGroup;
5314    /// let x = HostGroup::new().set_description("example");
5315    /// ```
5316    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5317        self.description = v.into();
5318        self
5319    }
5320
5321    /// Sets the value of [labels][crate::model::HostGroup::labels].
5322    ///
5323    /// # Example
5324    /// ```ignore,no_run
5325    /// # use google_cloud_netapp_v1::model::HostGroup;
5326    /// let x = HostGroup::new().set_labels([
5327    ///     ("key0", "abc"),
5328    ///     ("key1", "xyz"),
5329    /// ]);
5330    /// ```
5331    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5332    where
5333        T: std::iter::IntoIterator<Item = (K, V)>,
5334        K: std::convert::Into<std::string::String>,
5335        V: std::convert::Into<std::string::String>,
5336    {
5337        use std::iter::Iterator;
5338        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5339        self
5340    }
5341}
5342
5343impl wkt::message::Message for HostGroup {
5344    fn typename() -> &'static str {
5345        "type.googleapis.com/google.cloud.netapp.v1.HostGroup"
5346    }
5347}
5348
5349/// Defines additional types related to [HostGroup].
5350pub mod host_group {
5351    #[allow(unused_imports)]
5352    use super::*;
5353
5354    /// Types of host group.
5355    ///
5356    /// # Working with unknown values
5357    ///
5358    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5359    /// additional enum variants at any time. Adding new variants is not considered
5360    /// a breaking change. Applications should write their code in anticipation of:
5361    ///
5362    /// - New values appearing in future releases of the client library, **and**
5363    /// - New values received dynamically, without application changes.
5364    ///
5365    /// Please consult the [Working with enums] section in the user guide for some
5366    /// guidelines.
5367    ///
5368    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5369    #[derive(Clone, Debug, PartialEq)]
5370    #[non_exhaustive]
5371    pub enum Type {
5372        /// Unspecified type for host group.
5373        Unspecified,
5374        /// iSCSI initiator host group.
5375        IscsiInitiator,
5376        /// If set, the enum was initialized with an unknown value.
5377        ///
5378        /// Applications can examine the value using [Type::value] or
5379        /// [Type::name].
5380        UnknownValue(r#type::UnknownValue),
5381    }
5382
5383    #[doc(hidden)]
5384    pub mod r#type {
5385        #[allow(unused_imports)]
5386        use super::*;
5387        #[derive(Clone, Debug, PartialEq)]
5388        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5389    }
5390
5391    impl Type {
5392        /// Gets the enum value.
5393        ///
5394        /// Returns `None` if the enum contains an unknown value deserialized from
5395        /// the string representation of enums.
5396        pub fn value(&self) -> std::option::Option<i32> {
5397            match self {
5398                Self::Unspecified => std::option::Option::Some(0),
5399                Self::IscsiInitiator => std::option::Option::Some(1),
5400                Self::UnknownValue(u) => u.0.value(),
5401            }
5402        }
5403
5404        /// Gets the enum value as a string.
5405        ///
5406        /// Returns `None` if the enum contains an unknown value deserialized from
5407        /// the integer representation of enums.
5408        pub fn name(&self) -> std::option::Option<&str> {
5409            match self {
5410                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
5411                Self::IscsiInitiator => std::option::Option::Some("ISCSI_INITIATOR"),
5412                Self::UnknownValue(u) => u.0.name(),
5413            }
5414        }
5415    }
5416
5417    impl std::default::Default for Type {
5418        fn default() -> Self {
5419            use std::convert::From;
5420            Self::from(0)
5421        }
5422    }
5423
5424    impl std::fmt::Display for Type {
5425        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5426            wkt::internal::display_enum(f, self.name(), self.value())
5427        }
5428    }
5429
5430    impl std::convert::From<i32> for Type {
5431        fn from(value: i32) -> Self {
5432            match value {
5433                0 => Self::Unspecified,
5434                1 => Self::IscsiInitiator,
5435                _ => Self::UnknownValue(r#type::UnknownValue(
5436                    wkt::internal::UnknownEnumValue::Integer(value),
5437                )),
5438            }
5439        }
5440    }
5441
5442    impl std::convert::From<&str> for Type {
5443        fn from(value: &str) -> Self {
5444            use std::string::ToString;
5445            match value {
5446                "TYPE_UNSPECIFIED" => Self::Unspecified,
5447                "ISCSI_INITIATOR" => Self::IscsiInitiator,
5448                _ => Self::UnknownValue(r#type::UnknownValue(
5449                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5450                )),
5451            }
5452        }
5453    }
5454
5455    impl serde::ser::Serialize for Type {
5456        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5457        where
5458            S: serde::Serializer,
5459        {
5460            match self {
5461                Self::Unspecified => serializer.serialize_i32(0),
5462                Self::IscsiInitiator => serializer.serialize_i32(1),
5463                Self::UnknownValue(u) => u.0.serialize(serializer),
5464            }
5465        }
5466    }
5467
5468    impl<'de> serde::de::Deserialize<'de> for Type {
5469        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5470        where
5471            D: serde::Deserializer<'de>,
5472        {
5473            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
5474                ".google.cloud.netapp.v1.HostGroup.Type",
5475            ))
5476        }
5477    }
5478
5479    /// Host group states.
5480    ///
5481    /// # Working with unknown values
5482    ///
5483    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5484    /// additional enum variants at any time. Adding new variants is not considered
5485    /// a breaking change. Applications should write their code in anticipation of:
5486    ///
5487    /// - New values appearing in future releases of the client library, **and**
5488    /// - New values received dynamically, without application changes.
5489    ///
5490    /// Please consult the [Working with enums] section in the user guide for some
5491    /// guidelines.
5492    ///
5493    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5494    #[derive(Clone, Debug, PartialEq)]
5495    #[non_exhaustive]
5496    pub enum State {
5497        /// Unspecified state for host group.
5498        Unspecified,
5499        /// Host group is creating.
5500        Creating,
5501        /// Host group is ready.
5502        Ready,
5503        /// Host group is updating.
5504        Updating,
5505        /// Host group is deleting.
5506        Deleting,
5507        /// Host group is disabled.
5508        Disabled,
5509        /// If set, the enum was initialized with an unknown value.
5510        ///
5511        /// Applications can examine the value using [State::value] or
5512        /// [State::name].
5513        UnknownValue(state::UnknownValue),
5514    }
5515
5516    #[doc(hidden)]
5517    pub mod state {
5518        #[allow(unused_imports)]
5519        use super::*;
5520        #[derive(Clone, Debug, PartialEq)]
5521        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5522    }
5523
5524    impl State {
5525        /// Gets the enum value.
5526        ///
5527        /// Returns `None` if the enum contains an unknown value deserialized from
5528        /// the string representation of enums.
5529        pub fn value(&self) -> std::option::Option<i32> {
5530            match self {
5531                Self::Unspecified => std::option::Option::Some(0),
5532                Self::Creating => std::option::Option::Some(1),
5533                Self::Ready => std::option::Option::Some(2),
5534                Self::Updating => std::option::Option::Some(3),
5535                Self::Deleting => std::option::Option::Some(4),
5536                Self::Disabled => std::option::Option::Some(5),
5537                Self::UnknownValue(u) => u.0.value(),
5538            }
5539        }
5540
5541        /// Gets the enum value as a string.
5542        ///
5543        /// Returns `None` if the enum contains an unknown value deserialized from
5544        /// the integer representation of enums.
5545        pub fn name(&self) -> std::option::Option<&str> {
5546            match self {
5547                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5548                Self::Creating => std::option::Option::Some("CREATING"),
5549                Self::Ready => std::option::Option::Some("READY"),
5550                Self::Updating => std::option::Option::Some("UPDATING"),
5551                Self::Deleting => std::option::Option::Some("DELETING"),
5552                Self::Disabled => std::option::Option::Some("DISABLED"),
5553                Self::UnknownValue(u) => u.0.name(),
5554            }
5555        }
5556    }
5557
5558    impl std::default::Default for State {
5559        fn default() -> Self {
5560            use std::convert::From;
5561            Self::from(0)
5562        }
5563    }
5564
5565    impl std::fmt::Display for State {
5566        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5567            wkt::internal::display_enum(f, self.name(), self.value())
5568        }
5569    }
5570
5571    impl std::convert::From<i32> for State {
5572        fn from(value: i32) -> Self {
5573            match value {
5574                0 => Self::Unspecified,
5575                1 => Self::Creating,
5576                2 => Self::Ready,
5577                3 => Self::Updating,
5578                4 => Self::Deleting,
5579                5 => Self::Disabled,
5580                _ => Self::UnknownValue(state::UnknownValue(
5581                    wkt::internal::UnknownEnumValue::Integer(value),
5582                )),
5583            }
5584        }
5585    }
5586
5587    impl std::convert::From<&str> for State {
5588        fn from(value: &str) -> Self {
5589            use std::string::ToString;
5590            match value {
5591                "STATE_UNSPECIFIED" => Self::Unspecified,
5592                "CREATING" => Self::Creating,
5593                "READY" => Self::Ready,
5594                "UPDATING" => Self::Updating,
5595                "DELETING" => Self::Deleting,
5596                "DISABLED" => Self::Disabled,
5597                _ => Self::UnknownValue(state::UnknownValue(
5598                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5599                )),
5600            }
5601        }
5602    }
5603
5604    impl serde::ser::Serialize for State {
5605        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5606        where
5607            S: serde::Serializer,
5608        {
5609            match self {
5610                Self::Unspecified => serializer.serialize_i32(0),
5611                Self::Creating => serializer.serialize_i32(1),
5612                Self::Ready => serializer.serialize_i32(2),
5613                Self::Updating => serializer.serialize_i32(3),
5614                Self::Deleting => serializer.serialize_i32(4),
5615                Self::Disabled => serializer.serialize_i32(5),
5616                Self::UnknownValue(u) => u.0.serialize(serializer),
5617            }
5618        }
5619    }
5620
5621    impl<'de> serde::de::Deserialize<'de> for State {
5622        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5623        where
5624            D: serde::Deserializer<'de>,
5625        {
5626            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5627                ".google.cloud.netapp.v1.HostGroup.State",
5628            ))
5629        }
5630    }
5631}
5632
5633/// GetKmsConfigRequest gets a KMS Config.
5634#[derive(Clone, Default, PartialEq)]
5635#[non_exhaustive]
5636pub struct GetKmsConfigRequest {
5637    /// Required. Name of the KmsConfig
5638    pub name: std::string::String,
5639
5640    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5641}
5642
5643impl GetKmsConfigRequest {
5644    pub fn new() -> Self {
5645        std::default::Default::default()
5646    }
5647
5648    /// Sets the value of [name][crate::model::GetKmsConfigRequest::name].
5649    ///
5650    /// # Example
5651    /// ```ignore,no_run
5652    /// # use google_cloud_netapp_v1::model::GetKmsConfigRequest;
5653    /// let x = GetKmsConfigRequest::new().set_name("example");
5654    /// ```
5655    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5656        self.name = v.into();
5657        self
5658    }
5659}
5660
5661impl wkt::message::Message for GetKmsConfigRequest {
5662    fn typename() -> &'static str {
5663        "type.googleapis.com/google.cloud.netapp.v1.GetKmsConfigRequest"
5664    }
5665}
5666
5667/// ListKmsConfigsRequest lists KMS Configs.
5668#[derive(Clone, Default, PartialEq)]
5669#[non_exhaustive]
5670pub struct ListKmsConfigsRequest {
5671    /// Required. Parent value
5672    pub parent: std::string::String,
5673
5674    /// The maximum number of items to return.
5675    pub page_size: i32,
5676
5677    /// The next_page_token value to use if there are additional
5678    /// results to retrieve for this list request.
5679    pub page_token: std::string::String,
5680
5681    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
5682    pub order_by: std::string::String,
5683
5684    /// List filter.
5685    pub filter: std::string::String,
5686
5687    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5688}
5689
5690impl ListKmsConfigsRequest {
5691    pub fn new() -> Self {
5692        std::default::Default::default()
5693    }
5694
5695    /// Sets the value of [parent][crate::model::ListKmsConfigsRequest::parent].
5696    ///
5697    /// # Example
5698    /// ```ignore,no_run
5699    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5700    /// let x = ListKmsConfigsRequest::new().set_parent("example");
5701    /// ```
5702    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5703        self.parent = v.into();
5704        self
5705    }
5706
5707    /// Sets the value of [page_size][crate::model::ListKmsConfigsRequest::page_size].
5708    ///
5709    /// # Example
5710    /// ```ignore,no_run
5711    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5712    /// let x = ListKmsConfigsRequest::new().set_page_size(42);
5713    /// ```
5714    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5715        self.page_size = v.into();
5716        self
5717    }
5718
5719    /// Sets the value of [page_token][crate::model::ListKmsConfigsRequest::page_token].
5720    ///
5721    /// # Example
5722    /// ```ignore,no_run
5723    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5724    /// let x = ListKmsConfigsRequest::new().set_page_token("example");
5725    /// ```
5726    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5727        self.page_token = v.into();
5728        self
5729    }
5730
5731    /// Sets the value of [order_by][crate::model::ListKmsConfigsRequest::order_by].
5732    ///
5733    /// # Example
5734    /// ```ignore,no_run
5735    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5736    /// let x = ListKmsConfigsRequest::new().set_order_by("example");
5737    /// ```
5738    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5739        self.order_by = v.into();
5740        self
5741    }
5742
5743    /// Sets the value of [filter][crate::model::ListKmsConfigsRequest::filter].
5744    ///
5745    /// # Example
5746    /// ```ignore,no_run
5747    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5748    /// let x = ListKmsConfigsRequest::new().set_filter("example");
5749    /// ```
5750    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5751        self.filter = v.into();
5752        self
5753    }
5754}
5755
5756impl wkt::message::Message for ListKmsConfigsRequest {
5757    fn typename() -> &'static str {
5758        "type.googleapis.com/google.cloud.netapp.v1.ListKmsConfigsRequest"
5759    }
5760}
5761
5762/// ListKmsConfigsResponse is the response to a ListKmsConfigsRequest.
5763#[derive(Clone, Default, PartialEq)]
5764#[non_exhaustive]
5765pub struct ListKmsConfigsResponse {
5766    /// The list of KmsConfigs
5767    pub kms_configs: std::vec::Vec<crate::model::KmsConfig>,
5768
5769    /// A token identifying a page of results the server should return.
5770    pub next_page_token: std::string::String,
5771
5772    /// Locations that could not be reached.
5773    pub unreachable: std::vec::Vec<std::string::String>,
5774
5775    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5776}
5777
5778impl ListKmsConfigsResponse {
5779    pub fn new() -> Self {
5780        std::default::Default::default()
5781    }
5782
5783    /// Sets the value of [kms_configs][crate::model::ListKmsConfigsResponse::kms_configs].
5784    ///
5785    /// # Example
5786    /// ```ignore,no_run
5787    /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
5788    /// use google_cloud_netapp_v1::model::KmsConfig;
5789    /// let x = ListKmsConfigsResponse::new()
5790    ///     .set_kms_configs([
5791    ///         KmsConfig::default()/* use setters */,
5792    ///         KmsConfig::default()/* use (different) setters */,
5793    ///     ]);
5794    /// ```
5795    pub fn set_kms_configs<T, V>(mut self, v: T) -> Self
5796    where
5797        T: std::iter::IntoIterator<Item = V>,
5798        V: std::convert::Into<crate::model::KmsConfig>,
5799    {
5800        use std::iter::Iterator;
5801        self.kms_configs = v.into_iter().map(|i| i.into()).collect();
5802        self
5803    }
5804
5805    /// Sets the value of [next_page_token][crate::model::ListKmsConfigsResponse::next_page_token].
5806    ///
5807    /// # Example
5808    /// ```ignore,no_run
5809    /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
5810    /// let x = ListKmsConfigsResponse::new().set_next_page_token("example");
5811    /// ```
5812    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5813        self.next_page_token = v.into();
5814        self
5815    }
5816
5817    /// Sets the value of [unreachable][crate::model::ListKmsConfigsResponse::unreachable].
5818    ///
5819    /// # Example
5820    /// ```ignore,no_run
5821    /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
5822    /// let x = ListKmsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
5823    /// ```
5824    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5825    where
5826        T: std::iter::IntoIterator<Item = V>,
5827        V: std::convert::Into<std::string::String>,
5828    {
5829        use std::iter::Iterator;
5830        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5831        self
5832    }
5833}
5834
5835impl wkt::message::Message for ListKmsConfigsResponse {
5836    fn typename() -> &'static str {
5837        "type.googleapis.com/google.cloud.netapp.v1.ListKmsConfigsResponse"
5838    }
5839}
5840
5841#[doc(hidden)]
5842impl gax::paginator::internal::PageableResponse for ListKmsConfigsResponse {
5843    type PageItem = crate::model::KmsConfig;
5844
5845    fn items(self) -> std::vec::Vec<Self::PageItem> {
5846        self.kms_configs
5847    }
5848
5849    fn next_page_token(&self) -> std::string::String {
5850        use std::clone::Clone;
5851        self.next_page_token.clone()
5852    }
5853}
5854
5855/// CreateKmsConfigRequest creates a KMS Config.
5856#[derive(Clone, Default, PartialEq)]
5857#[non_exhaustive]
5858pub struct CreateKmsConfigRequest {
5859    /// Required. Value for parent.
5860    pub parent: std::string::String,
5861
5862    /// Required. Id of the requesting KmsConfig. Must be unique within the parent
5863    /// resource. Must contain only letters, numbers and hyphen, with the first
5864    /// character a letter, the last a letter or a
5865    /// number, and a 63 character maximum.
5866    pub kms_config_id: std::string::String,
5867
5868    /// Required. The required parameters to create a new KmsConfig.
5869    pub kms_config: std::option::Option<crate::model::KmsConfig>,
5870
5871    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5872}
5873
5874impl CreateKmsConfigRequest {
5875    pub fn new() -> Self {
5876        std::default::Default::default()
5877    }
5878
5879    /// Sets the value of [parent][crate::model::CreateKmsConfigRequest::parent].
5880    ///
5881    /// # Example
5882    /// ```ignore,no_run
5883    /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
5884    /// let x = CreateKmsConfigRequest::new().set_parent("example");
5885    /// ```
5886    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5887        self.parent = v.into();
5888        self
5889    }
5890
5891    /// Sets the value of [kms_config_id][crate::model::CreateKmsConfigRequest::kms_config_id].
5892    ///
5893    /// # Example
5894    /// ```ignore,no_run
5895    /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
5896    /// let x = CreateKmsConfigRequest::new().set_kms_config_id("example");
5897    /// ```
5898    pub fn set_kms_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5899        self.kms_config_id = v.into();
5900        self
5901    }
5902
5903    /// Sets the value of [kms_config][crate::model::CreateKmsConfigRequest::kms_config].
5904    ///
5905    /// # Example
5906    /// ```ignore,no_run
5907    /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
5908    /// use google_cloud_netapp_v1::model::KmsConfig;
5909    /// let x = CreateKmsConfigRequest::new().set_kms_config(KmsConfig::default()/* use setters */);
5910    /// ```
5911    pub fn set_kms_config<T>(mut self, v: T) -> Self
5912    where
5913        T: std::convert::Into<crate::model::KmsConfig>,
5914    {
5915        self.kms_config = std::option::Option::Some(v.into());
5916        self
5917    }
5918
5919    /// Sets or clears the value of [kms_config][crate::model::CreateKmsConfigRequest::kms_config].
5920    ///
5921    /// # Example
5922    /// ```ignore,no_run
5923    /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
5924    /// use google_cloud_netapp_v1::model::KmsConfig;
5925    /// let x = CreateKmsConfigRequest::new().set_or_clear_kms_config(Some(KmsConfig::default()/* use setters */));
5926    /// let x = CreateKmsConfigRequest::new().set_or_clear_kms_config(None::<KmsConfig>);
5927    /// ```
5928    pub fn set_or_clear_kms_config<T>(mut self, v: std::option::Option<T>) -> Self
5929    where
5930        T: std::convert::Into<crate::model::KmsConfig>,
5931    {
5932        self.kms_config = v.map(|x| x.into());
5933        self
5934    }
5935}
5936
5937impl wkt::message::Message for CreateKmsConfigRequest {
5938    fn typename() -> &'static str {
5939        "type.googleapis.com/google.cloud.netapp.v1.CreateKmsConfigRequest"
5940    }
5941}
5942
5943/// UpdateKmsConfigRequest updates a KMS Config.
5944#[derive(Clone, Default, PartialEq)]
5945#[non_exhaustive]
5946pub struct UpdateKmsConfigRequest {
5947    /// Required. Field mask is used to specify the fields to be overwritten in the
5948    /// KmsConfig resource by the update.
5949    /// The fields specified in the update_mask are relative to the resource, not
5950    /// the full request. A field will be overwritten if it is in the mask. If the
5951    /// user does not provide a mask then all fields will be overwritten.
5952    pub update_mask: std::option::Option<wkt::FieldMask>,
5953
5954    /// Required. The KmsConfig being updated
5955    pub kms_config: std::option::Option<crate::model::KmsConfig>,
5956
5957    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5958}
5959
5960impl UpdateKmsConfigRequest {
5961    pub fn new() -> Self {
5962        std::default::Default::default()
5963    }
5964
5965    /// Sets the value of [update_mask][crate::model::UpdateKmsConfigRequest::update_mask].
5966    ///
5967    /// # Example
5968    /// ```ignore,no_run
5969    /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
5970    /// use wkt::FieldMask;
5971    /// let x = UpdateKmsConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5972    /// ```
5973    pub fn set_update_mask<T>(mut self, v: T) -> Self
5974    where
5975        T: std::convert::Into<wkt::FieldMask>,
5976    {
5977        self.update_mask = std::option::Option::Some(v.into());
5978        self
5979    }
5980
5981    /// Sets or clears the value of [update_mask][crate::model::UpdateKmsConfigRequest::update_mask].
5982    ///
5983    /// # Example
5984    /// ```ignore,no_run
5985    /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
5986    /// use wkt::FieldMask;
5987    /// let x = UpdateKmsConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5988    /// let x = UpdateKmsConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5989    /// ```
5990    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5991    where
5992        T: std::convert::Into<wkt::FieldMask>,
5993    {
5994        self.update_mask = v.map(|x| x.into());
5995        self
5996    }
5997
5998    /// Sets the value of [kms_config][crate::model::UpdateKmsConfigRequest::kms_config].
5999    ///
6000    /// # Example
6001    /// ```ignore,no_run
6002    /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
6003    /// use google_cloud_netapp_v1::model::KmsConfig;
6004    /// let x = UpdateKmsConfigRequest::new().set_kms_config(KmsConfig::default()/* use setters */);
6005    /// ```
6006    pub fn set_kms_config<T>(mut self, v: T) -> Self
6007    where
6008        T: std::convert::Into<crate::model::KmsConfig>,
6009    {
6010        self.kms_config = std::option::Option::Some(v.into());
6011        self
6012    }
6013
6014    /// Sets or clears the value of [kms_config][crate::model::UpdateKmsConfigRequest::kms_config].
6015    ///
6016    /// # Example
6017    /// ```ignore,no_run
6018    /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
6019    /// use google_cloud_netapp_v1::model::KmsConfig;
6020    /// let x = UpdateKmsConfigRequest::new().set_or_clear_kms_config(Some(KmsConfig::default()/* use setters */));
6021    /// let x = UpdateKmsConfigRequest::new().set_or_clear_kms_config(None::<KmsConfig>);
6022    /// ```
6023    pub fn set_or_clear_kms_config<T>(mut self, v: std::option::Option<T>) -> Self
6024    where
6025        T: std::convert::Into<crate::model::KmsConfig>,
6026    {
6027        self.kms_config = v.map(|x| x.into());
6028        self
6029    }
6030}
6031
6032impl wkt::message::Message for UpdateKmsConfigRequest {
6033    fn typename() -> &'static str {
6034        "type.googleapis.com/google.cloud.netapp.v1.UpdateKmsConfigRequest"
6035    }
6036}
6037
6038/// DeleteKmsConfigRequest deletes a KMS Config.
6039#[derive(Clone, Default, PartialEq)]
6040#[non_exhaustive]
6041pub struct DeleteKmsConfigRequest {
6042    /// Required. Name of the KmsConfig.
6043    pub name: std::string::String,
6044
6045    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6046}
6047
6048impl DeleteKmsConfigRequest {
6049    pub fn new() -> Self {
6050        std::default::Default::default()
6051    }
6052
6053    /// Sets the value of [name][crate::model::DeleteKmsConfigRequest::name].
6054    ///
6055    /// # Example
6056    /// ```ignore,no_run
6057    /// # use google_cloud_netapp_v1::model::DeleteKmsConfigRequest;
6058    /// let x = DeleteKmsConfigRequest::new().set_name("example");
6059    /// ```
6060    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6061        self.name = v.into();
6062        self
6063    }
6064}
6065
6066impl wkt::message::Message for DeleteKmsConfigRequest {
6067    fn typename() -> &'static str {
6068        "type.googleapis.com/google.cloud.netapp.v1.DeleteKmsConfigRequest"
6069    }
6070}
6071
6072/// EncryptVolumesRequest specifies the KMS config to encrypt existing volumes.
6073#[derive(Clone, Default, PartialEq)]
6074#[non_exhaustive]
6075pub struct EncryptVolumesRequest {
6076    /// Required. Name of the KmsConfig.
6077    pub name: std::string::String,
6078
6079    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6080}
6081
6082impl EncryptVolumesRequest {
6083    pub fn new() -> Self {
6084        std::default::Default::default()
6085    }
6086
6087    /// Sets the value of [name][crate::model::EncryptVolumesRequest::name].
6088    ///
6089    /// # Example
6090    /// ```ignore,no_run
6091    /// # use google_cloud_netapp_v1::model::EncryptVolumesRequest;
6092    /// let x = EncryptVolumesRequest::new().set_name("example");
6093    /// ```
6094    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6095        self.name = v.into();
6096        self
6097    }
6098}
6099
6100impl wkt::message::Message for EncryptVolumesRequest {
6101    fn typename() -> &'static str {
6102        "type.googleapis.com/google.cloud.netapp.v1.EncryptVolumesRequest"
6103    }
6104}
6105
6106/// VerifyKmsConfigRequest specifies the KMS config to be validated.
6107#[derive(Clone, Default, PartialEq)]
6108#[non_exhaustive]
6109pub struct VerifyKmsConfigRequest {
6110    /// Required. Name of the KMS Config to be verified.
6111    pub name: std::string::String,
6112
6113    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6114}
6115
6116impl VerifyKmsConfigRequest {
6117    pub fn new() -> Self {
6118        std::default::Default::default()
6119    }
6120
6121    /// Sets the value of [name][crate::model::VerifyKmsConfigRequest::name].
6122    ///
6123    /// # Example
6124    /// ```ignore,no_run
6125    /// # use google_cloud_netapp_v1::model::VerifyKmsConfigRequest;
6126    /// let x = VerifyKmsConfigRequest::new().set_name("example");
6127    /// ```
6128    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6129        self.name = v.into();
6130        self
6131    }
6132}
6133
6134impl wkt::message::Message for VerifyKmsConfigRequest {
6135    fn typename() -> &'static str {
6136        "type.googleapis.com/google.cloud.netapp.v1.VerifyKmsConfigRequest"
6137    }
6138}
6139
6140/// VerifyKmsConfigResponse contains the information if the config is correctly
6141/// and error message.
6142#[derive(Clone, Default, PartialEq)]
6143#[non_exhaustive]
6144pub struct VerifyKmsConfigResponse {
6145    /// Output only. If the customer key configured correctly to the encrypt
6146    /// volume.
6147    pub healthy: bool,
6148
6149    /// Output only. Error message if config is not healthy.
6150    pub health_error: std::string::String,
6151
6152    /// Output only. Instructions for the customers to provide the access to the
6153    /// encryption key.
6154    pub instructions: std::string::String,
6155
6156    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6157}
6158
6159impl VerifyKmsConfigResponse {
6160    pub fn new() -> Self {
6161        std::default::Default::default()
6162    }
6163
6164    /// Sets the value of [healthy][crate::model::VerifyKmsConfigResponse::healthy].
6165    ///
6166    /// # Example
6167    /// ```ignore,no_run
6168    /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
6169    /// let x = VerifyKmsConfigResponse::new().set_healthy(true);
6170    /// ```
6171    pub fn set_healthy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6172        self.healthy = v.into();
6173        self
6174    }
6175
6176    /// Sets the value of [health_error][crate::model::VerifyKmsConfigResponse::health_error].
6177    ///
6178    /// # Example
6179    /// ```ignore,no_run
6180    /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
6181    /// let x = VerifyKmsConfigResponse::new().set_health_error("example");
6182    /// ```
6183    pub fn set_health_error<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6184        self.health_error = v.into();
6185        self
6186    }
6187
6188    /// Sets the value of [instructions][crate::model::VerifyKmsConfigResponse::instructions].
6189    ///
6190    /// # Example
6191    /// ```ignore,no_run
6192    /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
6193    /// let x = VerifyKmsConfigResponse::new().set_instructions("example");
6194    /// ```
6195    pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6196        self.instructions = v.into();
6197        self
6198    }
6199}
6200
6201impl wkt::message::Message for VerifyKmsConfigResponse {
6202    fn typename() -> &'static str {
6203        "type.googleapis.com/google.cloud.netapp.v1.VerifyKmsConfigResponse"
6204    }
6205}
6206
6207/// KmsConfig is the customer-managed encryption key(CMEK) configuration.
6208#[derive(Clone, Default, PartialEq)]
6209#[non_exhaustive]
6210pub struct KmsConfig {
6211    /// Identifier. Name of the KmsConfig.
6212    /// Format: `projects/{project}/locations/{location}/kmsConfigs/{kms_config}`
6213    pub name: std::string::String,
6214
6215    /// Required. Customer-managed crypto key resource full name. Format:
6216    /// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`
6217    pub crypto_key_name: std::string::String,
6218
6219    /// Output only. State of the KmsConfig.
6220    pub state: crate::model::kms_config::State,
6221
6222    /// Output only. State details of the KmsConfig.
6223    pub state_details: std::string::String,
6224
6225    /// Output only. Create time of the KmsConfig.
6226    pub create_time: std::option::Option<wkt::Timestamp>,
6227
6228    /// Description of the KmsConfig.
6229    pub description: std::string::String,
6230
6231    /// Labels as key value pairs
6232    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6233
6234    /// Output only. Instructions to provide the access to the customer provided
6235    /// encryption key.
6236    pub instructions: std::string::String,
6237
6238    /// Output only. The Service account which will have access to the customer
6239    /// provided encryption key.
6240    pub service_account: std::string::String,
6241
6242    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6243}
6244
6245impl KmsConfig {
6246    pub fn new() -> Self {
6247        std::default::Default::default()
6248    }
6249
6250    /// Sets the value of [name][crate::model::KmsConfig::name].
6251    ///
6252    /// # Example
6253    /// ```ignore,no_run
6254    /// # use google_cloud_netapp_v1::model::KmsConfig;
6255    /// let x = KmsConfig::new().set_name("example");
6256    /// ```
6257    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6258        self.name = v.into();
6259        self
6260    }
6261
6262    /// Sets the value of [crypto_key_name][crate::model::KmsConfig::crypto_key_name].
6263    ///
6264    /// # Example
6265    /// ```ignore,no_run
6266    /// # use google_cloud_netapp_v1::model::KmsConfig;
6267    /// let x = KmsConfig::new().set_crypto_key_name("example");
6268    /// ```
6269    pub fn set_crypto_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6270        self.crypto_key_name = v.into();
6271        self
6272    }
6273
6274    /// Sets the value of [state][crate::model::KmsConfig::state].
6275    ///
6276    /// # Example
6277    /// ```ignore,no_run
6278    /// # use google_cloud_netapp_v1::model::KmsConfig;
6279    /// use google_cloud_netapp_v1::model::kms_config::State;
6280    /// let x0 = KmsConfig::new().set_state(State::Ready);
6281    /// let x1 = KmsConfig::new().set_state(State::Creating);
6282    /// let x2 = KmsConfig::new().set_state(State::Deleting);
6283    /// ```
6284    pub fn set_state<T: std::convert::Into<crate::model::kms_config::State>>(
6285        mut self,
6286        v: T,
6287    ) -> Self {
6288        self.state = v.into();
6289        self
6290    }
6291
6292    /// Sets the value of [state_details][crate::model::KmsConfig::state_details].
6293    ///
6294    /// # Example
6295    /// ```ignore,no_run
6296    /// # use google_cloud_netapp_v1::model::KmsConfig;
6297    /// let x = KmsConfig::new().set_state_details("example");
6298    /// ```
6299    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6300        self.state_details = v.into();
6301        self
6302    }
6303
6304    /// Sets the value of [create_time][crate::model::KmsConfig::create_time].
6305    ///
6306    /// # Example
6307    /// ```ignore,no_run
6308    /// # use google_cloud_netapp_v1::model::KmsConfig;
6309    /// use wkt::Timestamp;
6310    /// let x = KmsConfig::new().set_create_time(Timestamp::default()/* use setters */);
6311    /// ```
6312    pub fn set_create_time<T>(mut self, v: T) -> Self
6313    where
6314        T: std::convert::Into<wkt::Timestamp>,
6315    {
6316        self.create_time = std::option::Option::Some(v.into());
6317        self
6318    }
6319
6320    /// Sets or clears the value of [create_time][crate::model::KmsConfig::create_time].
6321    ///
6322    /// # Example
6323    /// ```ignore,no_run
6324    /// # use google_cloud_netapp_v1::model::KmsConfig;
6325    /// use wkt::Timestamp;
6326    /// let x = KmsConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6327    /// let x = KmsConfig::new().set_or_clear_create_time(None::<Timestamp>);
6328    /// ```
6329    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6330    where
6331        T: std::convert::Into<wkt::Timestamp>,
6332    {
6333        self.create_time = v.map(|x| x.into());
6334        self
6335    }
6336
6337    /// Sets the value of [description][crate::model::KmsConfig::description].
6338    ///
6339    /// # Example
6340    /// ```ignore,no_run
6341    /// # use google_cloud_netapp_v1::model::KmsConfig;
6342    /// let x = KmsConfig::new().set_description("example");
6343    /// ```
6344    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6345        self.description = v.into();
6346        self
6347    }
6348
6349    /// Sets the value of [labels][crate::model::KmsConfig::labels].
6350    ///
6351    /// # Example
6352    /// ```ignore,no_run
6353    /// # use google_cloud_netapp_v1::model::KmsConfig;
6354    /// let x = KmsConfig::new().set_labels([
6355    ///     ("key0", "abc"),
6356    ///     ("key1", "xyz"),
6357    /// ]);
6358    /// ```
6359    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6360    where
6361        T: std::iter::IntoIterator<Item = (K, V)>,
6362        K: std::convert::Into<std::string::String>,
6363        V: std::convert::Into<std::string::String>,
6364    {
6365        use std::iter::Iterator;
6366        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6367        self
6368    }
6369
6370    /// Sets the value of [instructions][crate::model::KmsConfig::instructions].
6371    ///
6372    /// # Example
6373    /// ```ignore,no_run
6374    /// # use google_cloud_netapp_v1::model::KmsConfig;
6375    /// let x = KmsConfig::new().set_instructions("example");
6376    /// ```
6377    pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6378        self.instructions = v.into();
6379        self
6380    }
6381
6382    /// Sets the value of [service_account][crate::model::KmsConfig::service_account].
6383    ///
6384    /// # Example
6385    /// ```ignore,no_run
6386    /// # use google_cloud_netapp_v1::model::KmsConfig;
6387    /// let x = KmsConfig::new().set_service_account("example");
6388    /// ```
6389    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6390        self.service_account = v.into();
6391        self
6392    }
6393}
6394
6395impl wkt::message::Message for KmsConfig {
6396    fn typename() -> &'static str {
6397        "type.googleapis.com/google.cloud.netapp.v1.KmsConfig"
6398    }
6399}
6400
6401/// Defines additional types related to [KmsConfig].
6402pub mod kms_config {
6403    #[allow(unused_imports)]
6404    use super::*;
6405
6406    /// The KmsConfig States
6407    ///
6408    /// # Working with unknown values
6409    ///
6410    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6411    /// additional enum variants at any time. Adding new variants is not considered
6412    /// a breaking change. Applications should write their code in anticipation of:
6413    ///
6414    /// - New values appearing in future releases of the client library, **and**
6415    /// - New values received dynamically, without application changes.
6416    ///
6417    /// Please consult the [Working with enums] section in the user guide for some
6418    /// guidelines.
6419    ///
6420    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6421    #[derive(Clone, Debug, PartialEq)]
6422    #[non_exhaustive]
6423    pub enum State {
6424        /// Unspecified KmsConfig State
6425        Unspecified,
6426        /// KmsConfig State is Ready
6427        Ready,
6428        /// KmsConfig State is Creating
6429        Creating,
6430        /// KmsConfig State is Deleting
6431        Deleting,
6432        /// KmsConfig State is Updating
6433        Updating,
6434        /// KmsConfig State is In Use.
6435        InUse,
6436        /// KmsConfig State is Error
6437        Error,
6438        /// KmsConfig State is Pending to verify crypto key access.
6439        KeyCheckPending,
6440        /// KmsConfig State is Not accessbile by the SDE service account to the
6441        /// crypto key.
6442        KeyNotReachable,
6443        /// KmsConfig State is Disabling.
6444        Disabling,
6445        /// KmsConfig State is Disabled.
6446        Disabled,
6447        /// KmsConfig State is Migrating.
6448        /// The existing volumes are migrating from SMEK to CMEK.
6449        Migrating,
6450        /// If set, the enum was initialized with an unknown value.
6451        ///
6452        /// Applications can examine the value using [State::value] or
6453        /// [State::name].
6454        UnknownValue(state::UnknownValue),
6455    }
6456
6457    #[doc(hidden)]
6458    pub mod state {
6459        #[allow(unused_imports)]
6460        use super::*;
6461        #[derive(Clone, Debug, PartialEq)]
6462        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6463    }
6464
6465    impl State {
6466        /// Gets the enum value.
6467        ///
6468        /// Returns `None` if the enum contains an unknown value deserialized from
6469        /// the string representation of enums.
6470        pub fn value(&self) -> std::option::Option<i32> {
6471            match self {
6472                Self::Unspecified => std::option::Option::Some(0),
6473                Self::Ready => std::option::Option::Some(1),
6474                Self::Creating => std::option::Option::Some(2),
6475                Self::Deleting => std::option::Option::Some(3),
6476                Self::Updating => std::option::Option::Some(4),
6477                Self::InUse => std::option::Option::Some(5),
6478                Self::Error => std::option::Option::Some(6),
6479                Self::KeyCheckPending => std::option::Option::Some(7),
6480                Self::KeyNotReachable => std::option::Option::Some(8),
6481                Self::Disabling => std::option::Option::Some(9),
6482                Self::Disabled => std::option::Option::Some(10),
6483                Self::Migrating => std::option::Option::Some(11),
6484                Self::UnknownValue(u) => u.0.value(),
6485            }
6486        }
6487
6488        /// Gets the enum value as a string.
6489        ///
6490        /// Returns `None` if the enum contains an unknown value deserialized from
6491        /// the integer representation of enums.
6492        pub fn name(&self) -> std::option::Option<&str> {
6493            match self {
6494                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6495                Self::Ready => std::option::Option::Some("READY"),
6496                Self::Creating => std::option::Option::Some("CREATING"),
6497                Self::Deleting => std::option::Option::Some("DELETING"),
6498                Self::Updating => std::option::Option::Some("UPDATING"),
6499                Self::InUse => std::option::Option::Some("IN_USE"),
6500                Self::Error => std::option::Option::Some("ERROR"),
6501                Self::KeyCheckPending => std::option::Option::Some("KEY_CHECK_PENDING"),
6502                Self::KeyNotReachable => std::option::Option::Some("KEY_NOT_REACHABLE"),
6503                Self::Disabling => std::option::Option::Some("DISABLING"),
6504                Self::Disabled => std::option::Option::Some("DISABLED"),
6505                Self::Migrating => std::option::Option::Some("MIGRATING"),
6506                Self::UnknownValue(u) => u.0.name(),
6507            }
6508        }
6509    }
6510
6511    impl std::default::Default for State {
6512        fn default() -> Self {
6513            use std::convert::From;
6514            Self::from(0)
6515        }
6516    }
6517
6518    impl std::fmt::Display for State {
6519        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6520            wkt::internal::display_enum(f, self.name(), self.value())
6521        }
6522    }
6523
6524    impl std::convert::From<i32> for State {
6525        fn from(value: i32) -> Self {
6526            match value {
6527                0 => Self::Unspecified,
6528                1 => Self::Ready,
6529                2 => Self::Creating,
6530                3 => Self::Deleting,
6531                4 => Self::Updating,
6532                5 => Self::InUse,
6533                6 => Self::Error,
6534                7 => Self::KeyCheckPending,
6535                8 => Self::KeyNotReachable,
6536                9 => Self::Disabling,
6537                10 => Self::Disabled,
6538                11 => Self::Migrating,
6539                _ => Self::UnknownValue(state::UnknownValue(
6540                    wkt::internal::UnknownEnumValue::Integer(value),
6541                )),
6542            }
6543        }
6544    }
6545
6546    impl std::convert::From<&str> for State {
6547        fn from(value: &str) -> Self {
6548            use std::string::ToString;
6549            match value {
6550                "STATE_UNSPECIFIED" => Self::Unspecified,
6551                "READY" => Self::Ready,
6552                "CREATING" => Self::Creating,
6553                "DELETING" => Self::Deleting,
6554                "UPDATING" => Self::Updating,
6555                "IN_USE" => Self::InUse,
6556                "ERROR" => Self::Error,
6557                "KEY_CHECK_PENDING" => Self::KeyCheckPending,
6558                "KEY_NOT_REACHABLE" => Self::KeyNotReachable,
6559                "DISABLING" => Self::Disabling,
6560                "DISABLED" => Self::Disabled,
6561                "MIGRATING" => Self::Migrating,
6562                _ => Self::UnknownValue(state::UnknownValue(
6563                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6564                )),
6565            }
6566        }
6567    }
6568
6569    impl serde::ser::Serialize for State {
6570        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6571        where
6572            S: serde::Serializer,
6573        {
6574            match self {
6575                Self::Unspecified => serializer.serialize_i32(0),
6576                Self::Ready => serializer.serialize_i32(1),
6577                Self::Creating => serializer.serialize_i32(2),
6578                Self::Deleting => serializer.serialize_i32(3),
6579                Self::Updating => serializer.serialize_i32(4),
6580                Self::InUse => serializer.serialize_i32(5),
6581                Self::Error => serializer.serialize_i32(6),
6582                Self::KeyCheckPending => serializer.serialize_i32(7),
6583                Self::KeyNotReachable => serializer.serialize_i32(8),
6584                Self::Disabling => serializer.serialize_i32(9),
6585                Self::Disabled => serializer.serialize_i32(10),
6586                Self::Migrating => serializer.serialize_i32(11),
6587                Self::UnknownValue(u) => u.0.serialize(serializer),
6588            }
6589        }
6590    }
6591
6592    impl<'de> serde::de::Deserialize<'de> for State {
6593        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6594        where
6595            D: serde::Deserializer<'de>,
6596        {
6597            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6598                ".google.cloud.netapp.v1.KmsConfig.State",
6599            ))
6600        }
6601    }
6602}
6603
6604/// ListQuotaRulesRequest for listing quota rules.
6605#[derive(Clone, Default, PartialEq)]
6606#[non_exhaustive]
6607pub struct ListQuotaRulesRequest {
6608    /// Required. Parent value for ListQuotaRulesRequest
6609    pub parent: std::string::String,
6610
6611    /// Optional. Requested page size. Server may return fewer items than
6612    /// requested. If unspecified, the server will pick an appropriate default.
6613    pub page_size: i32,
6614
6615    /// Optional. A token identifying a page of results the server should return.
6616    pub page_token: std::string::String,
6617
6618    /// Optional. Filtering results
6619    pub filter: std::string::String,
6620
6621    /// Optional. Hint for how to order the results
6622    pub order_by: std::string::String,
6623
6624    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6625}
6626
6627impl ListQuotaRulesRequest {
6628    pub fn new() -> Self {
6629        std::default::Default::default()
6630    }
6631
6632    /// Sets the value of [parent][crate::model::ListQuotaRulesRequest::parent].
6633    ///
6634    /// # Example
6635    /// ```ignore,no_run
6636    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
6637    /// let x = ListQuotaRulesRequest::new().set_parent("example");
6638    /// ```
6639    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6640        self.parent = v.into();
6641        self
6642    }
6643
6644    /// Sets the value of [page_size][crate::model::ListQuotaRulesRequest::page_size].
6645    ///
6646    /// # Example
6647    /// ```ignore,no_run
6648    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
6649    /// let x = ListQuotaRulesRequest::new().set_page_size(42);
6650    /// ```
6651    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6652        self.page_size = v.into();
6653        self
6654    }
6655
6656    /// Sets the value of [page_token][crate::model::ListQuotaRulesRequest::page_token].
6657    ///
6658    /// # Example
6659    /// ```ignore,no_run
6660    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
6661    /// let x = ListQuotaRulesRequest::new().set_page_token("example");
6662    /// ```
6663    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6664        self.page_token = v.into();
6665        self
6666    }
6667
6668    /// Sets the value of [filter][crate::model::ListQuotaRulesRequest::filter].
6669    ///
6670    /// # Example
6671    /// ```ignore,no_run
6672    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
6673    /// let x = ListQuotaRulesRequest::new().set_filter("example");
6674    /// ```
6675    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6676        self.filter = v.into();
6677        self
6678    }
6679
6680    /// Sets the value of [order_by][crate::model::ListQuotaRulesRequest::order_by].
6681    ///
6682    /// # Example
6683    /// ```ignore,no_run
6684    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
6685    /// let x = ListQuotaRulesRequest::new().set_order_by("example");
6686    /// ```
6687    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6688        self.order_by = v.into();
6689        self
6690    }
6691}
6692
6693impl wkt::message::Message for ListQuotaRulesRequest {
6694    fn typename() -> &'static str {
6695        "type.googleapis.com/google.cloud.netapp.v1.ListQuotaRulesRequest"
6696    }
6697}
6698
6699/// ListQuotaRulesResponse is the response to a ListQuotaRulesRequest.
6700#[derive(Clone, Default, PartialEq)]
6701#[non_exhaustive]
6702pub struct ListQuotaRulesResponse {
6703    /// List of quota rules
6704    pub quota_rules: std::vec::Vec<crate::model::QuotaRule>,
6705
6706    /// A token identifying a page of results the server should return.
6707    pub next_page_token: std::string::String,
6708
6709    /// Locations that could not be reached.
6710    pub unreachable: std::vec::Vec<std::string::String>,
6711
6712    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6713}
6714
6715impl ListQuotaRulesResponse {
6716    pub fn new() -> Self {
6717        std::default::Default::default()
6718    }
6719
6720    /// Sets the value of [quota_rules][crate::model::ListQuotaRulesResponse::quota_rules].
6721    ///
6722    /// # Example
6723    /// ```ignore,no_run
6724    /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
6725    /// use google_cloud_netapp_v1::model::QuotaRule;
6726    /// let x = ListQuotaRulesResponse::new()
6727    ///     .set_quota_rules([
6728    ///         QuotaRule::default()/* use setters */,
6729    ///         QuotaRule::default()/* use (different) setters */,
6730    ///     ]);
6731    /// ```
6732    pub fn set_quota_rules<T, V>(mut self, v: T) -> Self
6733    where
6734        T: std::iter::IntoIterator<Item = V>,
6735        V: std::convert::Into<crate::model::QuotaRule>,
6736    {
6737        use std::iter::Iterator;
6738        self.quota_rules = v.into_iter().map(|i| i.into()).collect();
6739        self
6740    }
6741
6742    /// Sets the value of [next_page_token][crate::model::ListQuotaRulesResponse::next_page_token].
6743    ///
6744    /// # Example
6745    /// ```ignore,no_run
6746    /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
6747    /// let x = ListQuotaRulesResponse::new().set_next_page_token("example");
6748    /// ```
6749    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6750        self.next_page_token = v.into();
6751        self
6752    }
6753
6754    /// Sets the value of [unreachable][crate::model::ListQuotaRulesResponse::unreachable].
6755    ///
6756    /// # Example
6757    /// ```ignore,no_run
6758    /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
6759    /// let x = ListQuotaRulesResponse::new().set_unreachable(["a", "b", "c"]);
6760    /// ```
6761    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6762    where
6763        T: std::iter::IntoIterator<Item = V>,
6764        V: std::convert::Into<std::string::String>,
6765    {
6766        use std::iter::Iterator;
6767        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6768        self
6769    }
6770}
6771
6772impl wkt::message::Message for ListQuotaRulesResponse {
6773    fn typename() -> &'static str {
6774        "type.googleapis.com/google.cloud.netapp.v1.ListQuotaRulesResponse"
6775    }
6776}
6777
6778#[doc(hidden)]
6779impl gax::paginator::internal::PageableResponse for ListQuotaRulesResponse {
6780    type PageItem = crate::model::QuotaRule;
6781
6782    fn items(self) -> std::vec::Vec<Self::PageItem> {
6783        self.quota_rules
6784    }
6785
6786    fn next_page_token(&self) -> std::string::String {
6787        use std::clone::Clone;
6788        self.next_page_token.clone()
6789    }
6790}
6791
6792/// GetQuotaRuleRequest for getting a quota rule.
6793#[derive(Clone, Default, PartialEq)]
6794#[non_exhaustive]
6795pub struct GetQuotaRuleRequest {
6796    /// Required. Name of the quota rule
6797    pub name: std::string::String,
6798
6799    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6800}
6801
6802impl GetQuotaRuleRequest {
6803    pub fn new() -> Self {
6804        std::default::Default::default()
6805    }
6806
6807    /// Sets the value of [name][crate::model::GetQuotaRuleRequest::name].
6808    ///
6809    /// # Example
6810    /// ```ignore,no_run
6811    /// # use google_cloud_netapp_v1::model::GetQuotaRuleRequest;
6812    /// let x = GetQuotaRuleRequest::new().set_name("example");
6813    /// ```
6814    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6815        self.name = v.into();
6816        self
6817    }
6818}
6819
6820impl wkt::message::Message for GetQuotaRuleRequest {
6821    fn typename() -> &'static str {
6822        "type.googleapis.com/google.cloud.netapp.v1.GetQuotaRuleRequest"
6823    }
6824}
6825
6826/// CreateQuotaRuleRequest for creating a quota rule.
6827#[derive(Clone, Default, PartialEq)]
6828#[non_exhaustive]
6829pub struct CreateQuotaRuleRequest {
6830    /// Required. Parent value for CreateQuotaRuleRequest
6831    pub parent: std::string::String,
6832
6833    /// Required. Fields of the to be created quota rule.
6834    pub quota_rule: std::option::Option<crate::model::QuotaRule>,
6835
6836    /// Required. ID of the quota rule to create. Must be unique within the parent
6837    /// resource. Must contain only letters, numbers, underscore and hyphen, with
6838    /// the first character a letter or underscore, the last a letter or underscore
6839    /// or a number, and a 63 character maximum.
6840    pub quota_rule_id: std::string::String,
6841
6842    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6843}
6844
6845impl CreateQuotaRuleRequest {
6846    pub fn new() -> Self {
6847        std::default::Default::default()
6848    }
6849
6850    /// Sets the value of [parent][crate::model::CreateQuotaRuleRequest::parent].
6851    ///
6852    /// # Example
6853    /// ```ignore,no_run
6854    /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
6855    /// let x = CreateQuotaRuleRequest::new().set_parent("example");
6856    /// ```
6857    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6858        self.parent = v.into();
6859        self
6860    }
6861
6862    /// Sets the value of [quota_rule][crate::model::CreateQuotaRuleRequest::quota_rule].
6863    ///
6864    /// # Example
6865    /// ```ignore,no_run
6866    /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
6867    /// use google_cloud_netapp_v1::model::QuotaRule;
6868    /// let x = CreateQuotaRuleRequest::new().set_quota_rule(QuotaRule::default()/* use setters */);
6869    /// ```
6870    pub fn set_quota_rule<T>(mut self, v: T) -> Self
6871    where
6872        T: std::convert::Into<crate::model::QuotaRule>,
6873    {
6874        self.quota_rule = std::option::Option::Some(v.into());
6875        self
6876    }
6877
6878    /// Sets or clears the value of [quota_rule][crate::model::CreateQuotaRuleRequest::quota_rule].
6879    ///
6880    /// # Example
6881    /// ```ignore,no_run
6882    /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
6883    /// use google_cloud_netapp_v1::model::QuotaRule;
6884    /// let x = CreateQuotaRuleRequest::new().set_or_clear_quota_rule(Some(QuotaRule::default()/* use setters */));
6885    /// let x = CreateQuotaRuleRequest::new().set_or_clear_quota_rule(None::<QuotaRule>);
6886    /// ```
6887    pub fn set_or_clear_quota_rule<T>(mut self, v: std::option::Option<T>) -> Self
6888    where
6889        T: std::convert::Into<crate::model::QuotaRule>,
6890    {
6891        self.quota_rule = v.map(|x| x.into());
6892        self
6893    }
6894
6895    /// Sets the value of [quota_rule_id][crate::model::CreateQuotaRuleRequest::quota_rule_id].
6896    ///
6897    /// # Example
6898    /// ```ignore,no_run
6899    /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
6900    /// let x = CreateQuotaRuleRequest::new().set_quota_rule_id("example");
6901    /// ```
6902    pub fn set_quota_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6903        self.quota_rule_id = v.into();
6904        self
6905    }
6906}
6907
6908impl wkt::message::Message for CreateQuotaRuleRequest {
6909    fn typename() -> &'static str {
6910        "type.googleapis.com/google.cloud.netapp.v1.CreateQuotaRuleRequest"
6911    }
6912}
6913
6914/// UpdateQuotaRuleRequest for updating a quota rule.
6915#[derive(Clone, Default, PartialEq)]
6916#[non_exhaustive]
6917pub struct UpdateQuotaRuleRequest {
6918    /// Optional. Field mask is used to specify the fields to be overwritten in the
6919    /// Quota Rule resource by the update.
6920    /// The fields specified in the update_mask are relative to the resource, not
6921    /// the full request. A field will be overwritten if it is in the mask. If the
6922    /// user does not provide a mask then all fields will be overwritten.
6923    pub update_mask: std::option::Option<wkt::FieldMask>,
6924
6925    /// Required. The quota rule being updated
6926    pub quota_rule: std::option::Option<crate::model::QuotaRule>,
6927
6928    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6929}
6930
6931impl UpdateQuotaRuleRequest {
6932    pub fn new() -> Self {
6933        std::default::Default::default()
6934    }
6935
6936    /// Sets the value of [update_mask][crate::model::UpdateQuotaRuleRequest::update_mask].
6937    ///
6938    /// # Example
6939    /// ```ignore,no_run
6940    /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
6941    /// use wkt::FieldMask;
6942    /// let x = UpdateQuotaRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6943    /// ```
6944    pub fn set_update_mask<T>(mut self, v: T) -> Self
6945    where
6946        T: std::convert::Into<wkt::FieldMask>,
6947    {
6948        self.update_mask = std::option::Option::Some(v.into());
6949        self
6950    }
6951
6952    /// Sets or clears the value of [update_mask][crate::model::UpdateQuotaRuleRequest::update_mask].
6953    ///
6954    /// # Example
6955    /// ```ignore,no_run
6956    /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
6957    /// use wkt::FieldMask;
6958    /// let x = UpdateQuotaRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6959    /// let x = UpdateQuotaRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6960    /// ```
6961    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6962    where
6963        T: std::convert::Into<wkt::FieldMask>,
6964    {
6965        self.update_mask = v.map(|x| x.into());
6966        self
6967    }
6968
6969    /// Sets the value of [quota_rule][crate::model::UpdateQuotaRuleRequest::quota_rule].
6970    ///
6971    /// # Example
6972    /// ```ignore,no_run
6973    /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
6974    /// use google_cloud_netapp_v1::model::QuotaRule;
6975    /// let x = UpdateQuotaRuleRequest::new().set_quota_rule(QuotaRule::default()/* use setters */);
6976    /// ```
6977    pub fn set_quota_rule<T>(mut self, v: T) -> Self
6978    where
6979        T: std::convert::Into<crate::model::QuotaRule>,
6980    {
6981        self.quota_rule = std::option::Option::Some(v.into());
6982        self
6983    }
6984
6985    /// Sets or clears the value of [quota_rule][crate::model::UpdateQuotaRuleRequest::quota_rule].
6986    ///
6987    /// # Example
6988    /// ```ignore,no_run
6989    /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
6990    /// use google_cloud_netapp_v1::model::QuotaRule;
6991    /// let x = UpdateQuotaRuleRequest::new().set_or_clear_quota_rule(Some(QuotaRule::default()/* use setters */));
6992    /// let x = UpdateQuotaRuleRequest::new().set_or_clear_quota_rule(None::<QuotaRule>);
6993    /// ```
6994    pub fn set_or_clear_quota_rule<T>(mut self, v: std::option::Option<T>) -> Self
6995    where
6996        T: std::convert::Into<crate::model::QuotaRule>,
6997    {
6998        self.quota_rule = v.map(|x| x.into());
6999        self
7000    }
7001}
7002
7003impl wkt::message::Message for UpdateQuotaRuleRequest {
7004    fn typename() -> &'static str {
7005        "type.googleapis.com/google.cloud.netapp.v1.UpdateQuotaRuleRequest"
7006    }
7007}
7008
7009/// DeleteQuotaRuleRequest for deleting a single quota rule.
7010#[derive(Clone, Default, PartialEq)]
7011#[non_exhaustive]
7012pub struct DeleteQuotaRuleRequest {
7013    /// Required. Name of the quota rule.
7014    pub name: std::string::String,
7015
7016    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7017}
7018
7019impl DeleteQuotaRuleRequest {
7020    pub fn new() -> Self {
7021        std::default::Default::default()
7022    }
7023
7024    /// Sets the value of [name][crate::model::DeleteQuotaRuleRequest::name].
7025    ///
7026    /// # Example
7027    /// ```ignore,no_run
7028    /// # use google_cloud_netapp_v1::model::DeleteQuotaRuleRequest;
7029    /// let x = DeleteQuotaRuleRequest::new().set_name("example");
7030    /// ```
7031    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7032        self.name = v.into();
7033        self
7034    }
7035}
7036
7037impl wkt::message::Message for DeleteQuotaRuleRequest {
7038    fn typename() -> &'static str {
7039        "type.googleapis.com/google.cloud.netapp.v1.DeleteQuotaRuleRequest"
7040    }
7041}
7042
7043/// QuotaRule specifies the maximum disk space a user or group can use within a
7044/// volume. They can be used for creating default and individual quota rules.
7045#[derive(Clone, Default, PartialEq)]
7046#[non_exhaustive]
7047pub struct QuotaRule {
7048    /// Identifier. The resource name of the quota rule.
7049    /// Format:
7050    /// `projects/{project_number}/locations/{location_id}/volumes/volumes/{volume_id}/quotaRules/{quota_rule_id}`.
7051    pub name: std::string::String,
7052
7053    /// Optional. The quota rule applies to the specified user or group, identified
7054    /// by a Unix UID/GID, Windows SID, or null for default.
7055    pub target: std::string::String,
7056
7057    /// Required. The type of quota rule.
7058    pub r#type: crate::model::quota_rule::Type,
7059
7060    /// Required. The maximum allowed disk space in MiB.
7061    pub disk_limit_mib: i32,
7062
7063    /// Output only. State of the quota rule
7064    pub state: crate::model::quota_rule::State,
7065
7066    /// Output only. State details of the quota rule
7067    pub state_details: std::string::String,
7068
7069    /// Output only. Create time of the quota rule
7070    pub create_time: std::option::Option<wkt::Timestamp>,
7071
7072    /// Optional. Description of the quota rule
7073    pub description: std::string::String,
7074
7075    /// Optional. Labels of the quota rule
7076    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7077
7078    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7079}
7080
7081impl QuotaRule {
7082    pub fn new() -> Self {
7083        std::default::Default::default()
7084    }
7085
7086    /// Sets the value of [name][crate::model::QuotaRule::name].
7087    ///
7088    /// # Example
7089    /// ```ignore,no_run
7090    /// # use google_cloud_netapp_v1::model::QuotaRule;
7091    /// let x = QuotaRule::new().set_name("example");
7092    /// ```
7093    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7094        self.name = v.into();
7095        self
7096    }
7097
7098    /// Sets the value of [target][crate::model::QuotaRule::target].
7099    ///
7100    /// # Example
7101    /// ```ignore,no_run
7102    /// # use google_cloud_netapp_v1::model::QuotaRule;
7103    /// let x = QuotaRule::new().set_target("example");
7104    /// ```
7105    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7106        self.target = v.into();
7107        self
7108    }
7109
7110    /// Sets the value of [r#type][crate::model::QuotaRule::type].
7111    ///
7112    /// # Example
7113    /// ```ignore,no_run
7114    /// # use google_cloud_netapp_v1::model::QuotaRule;
7115    /// use google_cloud_netapp_v1::model::quota_rule::Type;
7116    /// let x0 = QuotaRule::new().set_type(Type::IndividualUserQuota);
7117    /// let x1 = QuotaRule::new().set_type(Type::IndividualGroupQuota);
7118    /// let x2 = QuotaRule::new().set_type(Type::DefaultUserQuota);
7119    /// ```
7120    pub fn set_type<T: std::convert::Into<crate::model::quota_rule::Type>>(mut self, v: T) -> Self {
7121        self.r#type = v.into();
7122        self
7123    }
7124
7125    /// Sets the value of [disk_limit_mib][crate::model::QuotaRule::disk_limit_mib].
7126    ///
7127    /// # Example
7128    /// ```ignore,no_run
7129    /// # use google_cloud_netapp_v1::model::QuotaRule;
7130    /// let x = QuotaRule::new().set_disk_limit_mib(42);
7131    /// ```
7132    pub fn set_disk_limit_mib<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7133        self.disk_limit_mib = v.into();
7134        self
7135    }
7136
7137    /// Sets the value of [state][crate::model::QuotaRule::state].
7138    ///
7139    /// # Example
7140    /// ```ignore,no_run
7141    /// # use google_cloud_netapp_v1::model::QuotaRule;
7142    /// use google_cloud_netapp_v1::model::quota_rule::State;
7143    /// let x0 = QuotaRule::new().set_state(State::Creating);
7144    /// let x1 = QuotaRule::new().set_state(State::Updating);
7145    /// let x2 = QuotaRule::new().set_state(State::Deleting);
7146    /// ```
7147    pub fn set_state<T: std::convert::Into<crate::model::quota_rule::State>>(
7148        mut self,
7149        v: T,
7150    ) -> Self {
7151        self.state = v.into();
7152        self
7153    }
7154
7155    /// Sets the value of [state_details][crate::model::QuotaRule::state_details].
7156    ///
7157    /// # Example
7158    /// ```ignore,no_run
7159    /// # use google_cloud_netapp_v1::model::QuotaRule;
7160    /// let x = QuotaRule::new().set_state_details("example");
7161    /// ```
7162    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7163        self.state_details = v.into();
7164        self
7165    }
7166
7167    /// Sets the value of [create_time][crate::model::QuotaRule::create_time].
7168    ///
7169    /// # Example
7170    /// ```ignore,no_run
7171    /// # use google_cloud_netapp_v1::model::QuotaRule;
7172    /// use wkt::Timestamp;
7173    /// let x = QuotaRule::new().set_create_time(Timestamp::default()/* use setters */);
7174    /// ```
7175    pub fn set_create_time<T>(mut self, v: T) -> Self
7176    where
7177        T: std::convert::Into<wkt::Timestamp>,
7178    {
7179        self.create_time = std::option::Option::Some(v.into());
7180        self
7181    }
7182
7183    /// Sets or clears the value of [create_time][crate::model::QuotaRule::create_time].
7184    ///
7185    /// # Example
7186    /// ```ignore,no_run
7187    /// # use google_cloud_netapp_v1::model::QuotaRule;
7188    /// use wkt::Timestamp;
7189    /// let x = QuotaRule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7190    /// let x = QuotaRule::new().set_or_clear_create_time(None::<Timestamp>);
7191    /// ```
7192    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7193    where
7194        T: std::convert::Into<wkt::Timestamp>,
7195    {
7196        self.create_time = v.map(|x| x.into());
7197        self
7198    }
7199
7200    /// Sets the value of [description][crate::model::QuotaRule::description].
7201    ///
7202    /// # Example
7203    /// ```ignore,no_run
7204    /// # use google_cloud_netapp_v1::model::QuotaRule;
7205    /// let x = QuotaRule::new().set_description("example");
7206    /// ```
7207    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7208        self.description = v.into();
7209        self
7210    }
7211
7212    /// Sets the value of [labels][crate::model::QuotaRule::labels].
7213    ///
7214    /// # Example
7215    /// ```ignore,no_run
7216    /// # use google_cloud_netapp_v1::model::QuotaRule;
7217    /// let x = QuotaRule::new().set_labels([
7218    ///     ("key0", "abc"),
7219    ///     ("key1", "xyz"),
7220    /// ]);
7221    /// ```
7222    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7223    where
7224        T: std::iter::IntoIterator<Item = (K, V)>,
7225        K: std::convert::Into<std::string::String>,
7226        V: std::convert::Into<std::string::String>,
7227    {
7228        use std::iter::Iterator;
7229        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7230        self
7231    }
7232}
7233
7234impl wkt::message::Message for QuotaRule {
7235    fn typename() -> &'static str {
7236        "type.googleapis.com/google.cloud.netapp.v1.QuotaRule"
7237    }
7238}
7239
7240/// Defines additional types related to [QuotaRule].
7241pub mod quota_rule {
7242    #[allow(unused_imports)]
7243    use super::*;
7244
7245    /// Types of Quota Rule
7246    ///
7247    /// # Working with unknown values
7248    ///
7249    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7250    /// additional enum variants at any time. Adding new variants is not considered
7251    /// a breaking change. Applications should write their code in anticipation of:
7252    ///
7253    /// - New values appearing in future releases of the client library, **and**
7254    /// - New values received dynamically, without application changes.
7255    ///
7256    /// Please consult the [Working with enums] section in the user guide for some
7257    /// guidelines.
7258    ///
7259    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7260    #[derive(Clone, Debug, PartialEq)]
7261    #[non_exhaustive]
7262    pub enum Type {
7263        /// Unspecified type for quota rule
7264        Unspecified,
7265        /// Individual user quota rule
7266        IndividualUserQuota,
7267        /// Individual group quota rule
7268        IndividualGroupQuota,
7269        /// Default user quota rule
7270        DefaultUserQuota,
7271        /// Default group quota rule
7272        DefaultGroupQuota,
7273        /// If set, the enum was initialized with an unknown value.
7274        ///
7275        /// Applications can examine the value using [Type::value] or
7276        /// [Type::name].
7277        UnknownValue(r#type::UnknownValue),
7278    }
7279
7280    #[doc(hidden)]
7281    pub mod r#type {
7282        #[allow(unused_imports)]
7283        use super::*;
7284        #[derive(Clone, Debug, PartialEq)]
7285        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7286    }
7287
7288    impl Type {
7289        /// Gets the enum value.
7290        ///
7291        /// Returns `None` if the enum contains an unknown value deserialized from
7292        /// the string representation of enums.
7293        pub fn value(&self) -> std::option::Option<i32> {
7294            match self {
7295                Self::Unspecified => std::option::Option::Some(0),
7296                Self::IndividualUserQuota => std::option::Option::Some(1),
7297                Self::IndividualGroupQuota => std::option::Option::Some(2),
7298                Self::DefaultUserQuota => std::option::Option::Some(3),
7299                Self::DefaultGroupQuota => std::option::Option::Some(4),
7300                Self::UnknownValue(u) => u.0.value(),
7301            }
7302        }
7303
7304        /// Gets the enum value as a string.
7305        ///
7306        /// Returns `None` if the enum contains an unknown value deserialized from
7307        /// the integer representation of enums.
7308        pub fn name(&self) -> std::option::Option<&str> {
7309            match self {
7310                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
7311                Self::IndividualUserQuota => std::option::Option::Some("INDIVIDUAL_USER_QUOTA"),
7312                Self::IndividualGroupQuota => std::option::Option::Some("INDIVIDUAL_GROUP_QUOTA"),
7313                Self::DefaultUserQuota => std::option::Option::Some("DEFAULT_USER_QUOTA"),
7314                Self::DefaultGroupQuota => std::option::Option::Some("DEFAULT_GROUP_QUOTA"),
7315                Self::UnknownValue(u) => u.0.name(),
7316            }
7317        }
7318    }
7319
7320    impl std::default::Default for Type {
7321        fn default() -> Self {
7322            use std::convert::From;
7323            Self::from(0)
7324        }
7325    }
7326
7327    impl std::fmt::Display for Type {
7328        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7329            wkt::internal::display_enum(f, self.name(), self.value())
7330        }
7331    }
7332
7333    impl std::convert::From<i32> for Type {
7334        fn from(value: i32) -> Self {
7335            match value {
7336                0 => Self::Unspecified,
7337                1 => Self::IndividualUserQuota,
7338                2 => Self::IndividualGroupQuota,
7339                3 => Self::DefaultUserQuota,
7340                4 => Self::DefaultGroupQuota,
7341                _ => Self::UnknownValue(r#type::UnknownValue(
7342                    wkt::internal::UnknownEnumValue::Integer(value),
7343                )),
7344            }
7345        }
7346    }
7347
7348    impl std::convert::From<&str> for Type {
7349        fn from(value: &str) -> Self {
7350            use std::string::ToString;
7351            match value {
7352                "TYPE_UNSPECIFIED" => Self::Unspecified,
7353                "INDIVIDUAL_USER_QUOTA" => Self::IndividualUserQuota,
7354                "INDIVIDUAL_GROUP_QUOTA" => Self::IndividualGroupQuota,
7355                "DEFAULT_USER_QUOTA" => Self::DefaultUserQuota,
7356                "DEFAULT_GROUP_QUOTA" => Self::DefaultGroupQuota,
7357                _ => Self::UnknownValue(r#type::UnknownValue(
7358                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7359                )),
7360            }
7361        }
7362    }
7363
7364    impl serde::ser::Serialize for Type {
7365        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7366        where
7367            S: serde::Serializer,
7368        {
7369            match self {
7370                Self::Unspecified => serializer.serialize_i32(0),
7371                Self::IndividualUserQuota => serializer.serialize_i32(1),
7372                Self::IndividualGroupQuota => serializer.serialize_i32(2),
7373                Self::DefaultUserQuota => serializer.serialize_i32(3),
7374                Self::DefaultGroupQuota => serializer.serialize_i32(4),
7375                Self::UnknownValue(u) => u.0.serialize(serializer),
7376            }
7377        }
7378    }
7379
7380    impl<'de> serde::de::Deserialize<'de> for Type {
7381        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7382        where
7383            D: serde::Deserializer<'de>,
7384        {
7385            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
7386                ".google.cloud.netapp.v1.QuotaRule.Type",
7387            ))
7388        }
7389    }
7390
7391    /// Quota Rule states
7392    ///
7393    /// # Working with unknown values
7394    ///
7395    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7396    /// additional enum variants at any time. Adding new variants is not considered
7397    /// a breaking change. Applications should write their code in anticipation of:
7398    ///
7399    /// - New values appearing in future releases of the client library, **and**
7400    /// - New values received dynamically, without application changes.
7401    ///
7402    /// Please consult the [Working with enums] section in the user guide for some
7403    /// guidelines.
7404    ///
7405    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7406    #[derive(Clone, Debug, PartialEq)]
7407    #[non_exhaustive]
7408    pub enum State {
7409        /// Unspecified state for quota rule
7410        Unspecified,
7411        /// Quota rule is creating
7412        Creating,
7413        /// Quota rule is updating
7414        Updating,
7415        /// Quota rule is deleting
7416        Deleting,
7417        /// Quota rule is ready
7418        Ready,
7419        /// Quota rule is in error state.
7420        Error,
7421        /// If set, the enum was initialized with an unknown value.
7422        ///
7423        /// Applications can examine the value using [State::value] or
7424        /// [State::name].
7425        UnknownValue(state::UnknownValue),
7426    }
7427
7428    #[doc(hidden)]
7429    pub mod state {
7430        #[allow(unused_imports)]
7431        use super::*;
7432        #[derive(Clone, Debug, PartialEq)]
7433        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7434    }
7435
7436    impl State {
7437        /// Gets the enum value.
7438        ///
7439        /// Returns `None` if the enum contains an unknown value deserialized from
7440        /// the string representation of enums.
7441        pub fn value(&self) -> std::option::Option<i32> {
7442            match self {
7443                Self::Unspecified => std::option::Option::Some(0),
7444                Self::Creating => std::option::Option::Some(1),
7445                Self::Updating => std::option::Option::Some(2),
7446                Self::Deleting => std::option::Option::Some(3),
7447                Self::Ready => std::option::Option::Some(4),
7448                Self::Error => std::option::Option::Some(5),
7449                Self::UnknownValue(u) => u.0.value(),
7450            }
7451        }
7452
7453        /// Gets the enum value as a string.
7454        ///
7455        /// Returns `None` if the enum contains an unknown value deserialized from
7456        /// the integer representation of enums.
7457        pub fn name(&self) -> std::option::Option<&str> {
7458            match self {
7459                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7460                Self::Creating => std::option::Option::Some("CREATING"),
7461                Self::Updating => std::option::Option::Some("UPDATING"),
7462                Self::Deleting => std::option::Option::Some("DELETING"),
7463                Self::Ready => std::option::Option::Some("READY"),
7464                Self::Error => std::option::Option::Some("ERROR"),
7465                Self::UnknownValue(u) => u.0.name(),
7466            }
7467        }
7468    }
7469
7470    impl std::default::Default for State {
7471        fn default() -> Self {
7472            use std::convert::From;
7473            Self::from(0)
7474        }
7475    }
7476
7477    impl std::fmt::Display for State {
7478        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7479            wkt::internal::display_enum(f, self.name(), self.value())
7480        }
7481    }
7482
7483    impl std::convert::From<i32> for State {
7484        fn from(value: i32) -> Self {
7485            match value {
7486                0 => Self::Unspecified,
7487                1 => Self::Creating,
7488                2 => Self::Updating,
7489                3 => Self::Deleting,
7490                4 => Self::Ready,
7491                5 => Self::Error,
7492                _ => Self::UnknownValue(state::UnknownValue(
7493                    wkt::internal::UnknownEnumValue::Integer(value),
7494                )),
7495            }
7496        }
7497    }
7498
7499    impl std::convert::From<&str> for State {
7500        fn from(value: &str) -> Self {
7501            use std::string::ToString;
7502            match value {
7503                "STATE_UNSPECIFIED" => Self::Unspecified,
7504                "CREATING" => Self::Creating,
7505                "UPDATING" => Self::Updating,
7506                "DELETING" => Self::Deleting,
7507                "READY" => Self::Ready,
7508                "ERROR" => Self::Error,
7509                _ => Self::UnknownValue(state::UnknownValue(
7510                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7511                )),
7512            }
7513        }
7514    }
7515
7516    impl serde::ser::Serialize for State {
7517        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7518        where
7519            S: serde::Serializer,
7520        {
7521            match self {
7522                Self::Unspecified => serializer.serialize_i32(0),
7523                Self::Creating => serializer.serialize_i32(1),
7524                Self::Updating => serializer.serialize_i32(2),
7525                Self::Deleting => serializer.serialize_i32(3),
7526                Self::Ready => serializer.serialize_i32(4),
7527                Self::Error => serializer.serialize_i32(5),
7528                Self::UnknownValue(u) => u.0.serialize(serializer),
7529            }
7530        }
7531    }
7532
7533    impl<'de> serde::de::Deserialize<'de> for State {
7534        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7535        where
7536            D: serde::Deserializer<'de>,
7537        {
7538            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7539                ".google.cloud.netapp.v1.QuotaRule.State",
7540            ))
7541        }
7542    }
7543}
7544
7545/// TransferStats reports all statistics related to replication transfer.
7546#[derive(Clone, Default, PartialEq)]
7547#[non_exhaustive]
7548pub struct TransferStats {
7549    /// Cumulative bytes transferred so far for the replication relationship.
7550    pub transfer_bytes: std::option::Option<i64>,
7551
7552    /// Cumulative time taken across all transfers for the replication
7553    /// relationship.
7554    pub total_transfer_duration: std::option::Option<wkt::Duration>,
7555
7556    /// Last transfer size in bytes.
7557    pub last_transfer_bytes: std::option::Option<i64>,
7558
7559    /// Time taken during last transfer.
7560    pub last_transfer_duration: std::option::Option<wkt::Duration>,
7561
7562    /// Lag duration indicates the duration by which Destination region volume
7563    /// content lags behind the primary region volume content.
7564    pub lag_duration: std::option::Option<wkt::Duration>,
7565
7566    /// Time when progress was updated last.
7567    pub update_time: std::option::Option<wkt::Timestamp>,
7568
7569    /// Time when last transfer completed.
7570    pub last_transfer_end_time: std::option::Option<wkt::Timestamp>,
7571
7572    /// A message describing the cause of the last transfer failure.
7573    pub last_transfer_error: std::option::Option<std::string::String>,
7574
7575    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7576}
7577
7578impl TransferStats {
7579    pub fn new() -> Self {
7580        std::default::Default::default()
7581    }
7582
7583    /// Sets the value of [transfer_bytes][crate::model::TransferStats::transfer_bytes].
7584    ///
7585    /// # Example
7586    /// ```ignore,no_run
7587    /// # use google_cloud_netapp_v1::model::TransferStats;
7588    /// let x = TransferStats::new().set_transfer_bytes(42);
7589    /// ```
7590    pub fn set_transfer_bytes<T>(mut self, v: T) -> Self
7591    where
7592        T: std::convert::Into<i64>,
7593    {
7594        self.transfer_bytes = std::option::Option::Some(v.into());
7595        self
7596    }
7597
7598    /// Sets or clears the value of [transfer_bytes][crate::model::TransferStats::transfer_bytes].
7599    ///
7600    /// # Example
7601    /// ```ignore,no_run
7602    /// # use google_cloud_netapp_v1::model::TransferStats;
7603    /// let x = TransferStats::new().set_or_clear_transfer_bytes(Some(42));
7604    /// let x = TransferStats::new().set_or_clear_transfer_bytes(None::<i32>);
7605    /// ```
7606    pub fn set_or_clear_transfer_bytes<T>(mut self, v: std::option::Option<T>) -> Self
7607    where
7608        T: std::convert::Into<i64>,
7609    {
7610        self.transfer_bytes = v.map(|x| x.into());
7611        self
7612    }
7613
7614    /// Sets the value of [total_transfer_duration][crate::model::TransferStats::total_transfer_duration].
7615    ///
7616    /// # Example
7617    /// ```ignore,no_run
7618    /// # use google_cloud_netapp_v1::model::TransferStats;
7619    /// use wkt::Duration;
7620    /// let x = TransferStats::new().set_total_transfer_duration(Duration::default()/* use setters */);
7621    /// ```
7622    pub fn set_total_transfer_duration<T>(mut self, v: T) -> Self
7623    where
7624        T: std::convert::Into<wkt::Duration>,
7625    {
7626        self.total_transfer_duration = std::option::Option::Some(v.into());
7627        self
7628    }
7629
7630    /// Sets or clears the value of [total_transfer_duration][crate::model::TransferStats::total_transfer_duration].
7631    ///
7632    /// # Example
7633    /// ```ignore,no_run
7634    /// # use google_cloud_netapp_v1::model::TransferStats;
7635    /// use wkt::Duration;
7636    /// let x = TransferStats::new().set_or_clear_total_transfer_duration(Some(Duration::default()/* use setters */));
7637    /// let x = TransferStats::new().set_or_clear_total_transfer_duration(None::<Duration>);
7638    /// ```
7639    pub fn set_or_clear_total_transfer_duration<T>(mut self, v: std::option::Option<T>) -> Self
7640    where
7641        T: std::convert::Into<wkt::Duration>,
7642    {
7643        self.total_transfer_duration = v.map(|x| x.into());
7644        self
7645    }
7646
7647    /// Sets the value of [last_transfer_bytes][crate::model::TransferStats::last_transfer_bytes].
7648    ///
7649    /// # Example
7650    /// ```ignore,no_run
7651    /// # use google_cloud_netapp_v1::model::TransferStats;
7652    /// let x = TransferStats::new().set_last_transfer_bytes(42);
7653    /// ```
7654    pub fn set_last_transfer_bytes<T>(mut self, v: T) -> Self
7655    where
7656        T: std::convert::Into<i64>,
7657    {
7658        self.last_transfer_bytes = std::option::Option::Some(v.into());
7659        self
7660    }
7661
7662    /// Sets or clears the value of [last_transfer_bytes][crate::model::TransferStats::last_transfer_bytes].
7663    ///
7664    /// # Example
7665    /// ```ignore,no_run
7666    /// # use google_cloud_netapp_v1::model::TransferStats;
7667    /// let x = TransferStats::new().set_or_clear_last_transfer_bytes(Some(42));
7668    /// let x = TransferStats::new().set_or_clear_last_transfer_bytes(None::<i32>);
7669    /// ```
7670    pub fn set_or_clear_last_transfer_bytes<T>(mut self, v: std::option::Option<T>) -> Self
7671    where
7672        T: std::convert::Into<i64>,
7673    {
7674        self.last_transfer_bytes = v.map(|x| x.into());
7675        self
7676    }
7677
7678    /// Sets the value of [last_transfer_duration][crate::model::TransferStats::last_transfer_duration].
7679    ///
7680    /// # Example
7681    /// ```ignore,no_run
7682    /// # use google_cloud_netapp_v1::model::TransferStats;
7683    /// use wkt::Duration;
7684    /// let x = TransferStats::new().set_last_transfer_duration(Duration::default()/* use setters */);
7685    /// ```
7686    pub fn set_last_transfer_duration<T>(mut self, v: T) -> Self
7687    where
7688        T: std::convert::Into<wkt::Duration>,
7689    {
7690        self.last_transfer_duration = std::option::Option::Some(v.into());
7691        self
7692    }
7693
7694    /// Sets or clears the value of [last_transfer_duration][crate::model::TransferStats::last_transfer_duration].
7695    ///
7696    /// # Example
7697    /// ```ignore,no_run
7698    /// # use google_cloud_netapp_v1::model::TransferStats;
7699    /// use wkt::Duration;
7700    /// let x = TransferStats::new().set_or_clear_last_transfer_duration(Some(Duration::default()/* use setters */));
7701    /// let x = TransferStats::new().set_or_clear_last_transfer_duration(None::<Duration>);
7702    /// ```
7703    pub fn set_or_clear_last_transfer_duration<T>(mut self, v: std::option::Option<T>) -> Self
7704    where
7705        T: std::convert::Into<wkt::Duration>,
7706    {
7707        self.last_transfer_duration = v.map(|x| x.into());
7708        self
7709    }
7710
7711    /// Sets the value of [lag_duration][crate::model::TransferStats::lag_duration].
7712    ///
7713    /// # Example
7714    /// ```ignore,no_run
7715    /// # use google_cloud_netapp_v1::model::TransferStats;
7716    /// use wkt::Duration;
7717    /// let x = TransferStats::new().set_lag_duration(Duration::default()/* use setters */);
7718    /// ```
7719    pub fn set_lag_duration<T>(mut self, v: T) -> Self
7720    where
7721        T: std::convert::Into<wkt::Duration>,
7722    {
7723        self.lag_duration = std::option::Option::Some(v.into());
7724        self
7725    }
7726
7727    /// Sets or clears the value of [lag_duration][crate::model::TransferStats::lag_duration].
7728    ///
7729    /// # Example
7730    /// ```ignore,no_run
7731    /// # use google_cloud_netapp_v1::model::TransferStats;
7732    /// use wkt::Duration;
7733    /// let x = TransferStats::new().set_or_clear_lag_duration(Some(Duration::default()/* use setters */));
7734    /// let x = TransferStats::new().set_or_clear_lag_duration(None::<Duration>);
7735    /// ```
7736    pub fn set_or_clear_lag_duration<T>(mut self, v: std::option::Option<T>) -> Self
7737    where
7738        T: std::convert::Into<wkt::Duration>,
7739    {
7740        self.lag_duration = v.map(|x| x.into());
7741        self
7742    }
7743
7744    /// Sets the value of [update_time][crate::model::TransferStats::update_time].
7745    ///
7746    /// # Example
7747    /// ```ignore,no_run
7748    /// # use google_cloud_netapp_v1::model::TransferStats;
7749    /// use wkt::Timestamp;
7750    /// let x = TransferStats::new().set_update_time(Timestamp::default()/* use setters */);
7751    /// ```
7752    pub fn set_update_time<T>(mut self, v: T) -> Self
7753    where
7754        T: std::convert::Into<wkt::Timestamp>,
7755    {
7756        self.update_time = std::option::Option::Some(v.into());
7757        self
7758    }
7759
7760    /// Sets or clears the value of [update_time][crate::model::TransferStats::update_time].
7761    ///
7762    /// # Example
7763    /// ```ignore,no_run
7764    /// # use google_cloud_netapp_v1::model::TransferStats;
7765    /// use wkt::Timestamp;
7766    /// let x = TransferStats::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7767    /// let x = TransferStats::new().set_or_clear_update_time(None::<Timestamp>);
7768    /// ```
7769    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7770    where
7771        T: std::convert::Into<wkt::Timestamp>,
7772    {
7773        self.update_time = v.map(|x| x.into());
7774        self
7775    }
7776
7777    /// Sets the value of [last_transfer_end_time][crate::model::TransferStats::last_transfer_end_time].
7778    ///
7779    /// # Example
7780    /// ```ignore,no_run
7781    /// # use google_cloud_netapp_v1::model::TransferStats;
7782    /// use wkt::Timestamp;
7783    /// let x = TransferStats::new().set_last_transfer_end_time(Timestamp::default()/* use setters */);
7784    /// ```
7785    pub fn set_last_transfer_end_time<T>(mut self, v: T) -> Self
7786    where
7787        T: std::convert::Into<wkt::Timestamp>,
7788    {
7789        self.last_transfer_end_time = std::option::Option::Some(v.into());
7790        self
7791    }
7792
7793    /// Sets or clears the value of [last_transfer_end_time][crate::model::TransferStats::last_transfer_end_time].
7794    ///
7795    /// # Example
7796    /// ```ignore,no_run
7797    /// # use google_cloud_netapp_v1::model::TransferStats;
7798    /// use wkt::Timestamp;
7799    /// let x = TransferStats::new().set_or_clear_last_transfer_end_time(Some(Timestamp::default()/* use setters */));
7800    /// let x = TransferStats::new().set_or_clear_last_transfer_end_time(None::<Timestamp>);
7801    /// ```
7802    pub fn set_or_clear_last_transfer_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7803    where
7804        T: std::convert::Into<wkt::Timestamp>,
7805    {
7806        self.last_transfer_end_time = v.map(|x| x.into());
7807        self
7808    }
7809
7810    /// Sets the value of [last_transfer_error][crate::model::TransferStats::last_transfer_error].
7811    ///
7812    /// # Example
7813    /// ```ignore,no_run
7814    /// # use google_cloud_netapp_v1::model::TransferStats;
7815    /// let x = TransferStats::new().set_last_transfer_error("example");
7816    /// ```
7817    pub fn set_last_transfer_error<T>(mut self, v: T) -> Self
7818    where
7819        T: std::convert::Into<std::string::String>,
7820    {
7821        self.last_transfer_error = std::option::Option::Some(v.into());
7822        self
7823    }
7824
7825    /// Sets or clears the value of [last_transfer_error][crate::model::TransferStats::last_transfer_error].
7826    ///
7827    /// # Example
7828    /// ```ignore,no_run
7829    /// # use google_cloud_netapp_v1::model::TransferStats;
7830    /// let x = TransferStats::new().set_or_clear_last_transfer_error(Some("example"));
7831    /// let x = TransferStats::new().set_or_clear_last_transfer_error(None::<String>);
7832    /// ```
7833    pub fn set_or_clear_last_transfer_error<T>(mut self, v: std::option::Option<T>) -> Self
7834    where
7835        T: std::convert::Into<std::string::String>,
7836    {
7837        self.last_transfer_error = v.map(|x| x.into());
7838        self
7839    }
7840}
7841
7842impl wkt::message::Message for TransferStats {
7843    fn typename() -> &'static str {
7844        "type.googleapis.com/google.cloud.netapp.v1.TransferStats"
7845    }
7846}
7847
7848/// Replication is a nested resource under Volume, that describes a
7849/// cross-region replication relationship between 2 volumes in different
7850/// regions.
7851#[derive(Clone, Default, PartialEq)]
7852#[non_exhaustive]
7853pub struct Replication {
7854    /// Identifier. The resource name of the Replication.
7855    /// Format:
7856    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}`.
7857    pub name: std::string::String,
7858
7859    /// Output only. State of the replication.
7860    pub state: crate::model::replication::State,
7861
7862    /// Output only. State details of the replication.
7863    pub state_details: std::string::String,
7864
7865    /// Output only. Indicates whether this points to source or destination.
7866    pub role: crate::model::replication::ReplicationRole,
7867
7868    /// Required. Indicates the schedule for replication.
7869    pub replication_schedule: crate::model::replication::ReplicationSchedule,
7870
7871    /// Output only. Indicates the state of mirroring.
7872    pub mirror_state: crate::model::replication::MirrorState,
7873
7874    /// Output only. Condition of the relationship. Can be one of the following:
7875    ///
7876    /// - true: The replication relationship is healthy. It has not missed the most
7877    ///   recent scheduled transfer.
7878    /// - false: The replication relationship is not healthy. It has missed the
7879    ///   most recent scheduled transfer.
7880    pub healthy: std::option::Option<bool>,
7881
7882    /// Output only. Replication create time.
7883    pub create_time: std::option::Option<wkt::Timestamp>,
7884
7885    /// Output only. Full name of destination volume resource.
7886    /// Example : "projects/{project}/locations/{location}/volumes/{volume_id}"
7887    pub destination_volume: std::string::String,
7888
7889    /// Output only. Replication transfer statistics.
7890    pub transfer_stats: std::option::Option<crate::model::TransferStats>,
7891
7892    /// Resource labels to represent user provided metadata.
7893    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7894
7895    /// A description about this replication relationship.
7896    pub description: std::option::Option<std::string::String>,
7897
7898    /// Required. Input only. Destination volume parameters
7899    pub destination_volume_parameters:
7900        std::option::Option<crate::model::DestinationVolumeParameters>,
7901
7902    /// Output only. Full name of source volume resource.
7903    /// Example : "projects/{project}/locations/{location}/volumes/{volume_id}"
7904    pub source_volume: std::string::String,
7905
7906    /// Output only. Hybrid peering details.
7907    pub hybrid_peering_details: std::option::Option<crate::model::HybridPeeringDetails>,
7908
7909    /// Optional. Location of the user cluster.
7910    pub cluster_location: std::string::String,
7911
7912    /// Output only. Type of the hybrid replication.
7913    pub hybrid_replication_type: crate::model::replication::HybridReplicationType,
7914
7915    /// Output only. Copy pastable snapmirror commands to be executed on onprem
7916    /// cluster by the customer.
7917    pub hybrid_replication_user_commands: std::option::Option<crate::model::UserCommands>,
7918
7919    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7920}
7921
7922impl Replication {
7923    pub fn new() -> Self {
7924        std::default::Default::default()
7925    }
7926
7927    /// Sets the value of [name][crate::model::Replication::name].
7928    ///
7929    /// # Example
7930    /// ```ignore,no_run
7931    /// # use google_cloud_netapp_v1::model::Replication;
7932    /// let x = Replication::new().set_name("example");
7933    /// ```
7934    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7935        self.name = v.into();
7936        self
7937    }
7938
7939    /// Sets the value of [state][crate::model::Replication::state].
7940    ///
7941    /// # Example
7942    /// ```ignore,no_run
7943    /// # use google_cloud_netapp_v1::model::Replication;
7944    /// use google_cloud_netapp_v1::model::replication::State;
7945    /// let x0 = Replication::new().set_state(State::Creating);
7946    /// let x1 = Replication::new().set_state(State::Ready);
7947    /// let x2 = Replication::new().set_state(State::Updating);
7948    /// ```
7949    pub fn set_state<T: std::convert::Into<crate::model::replication::State>>(
7950        mut self,
7951        v: T,
7952    ) -> Self {
7953        self.state = v.into();
7954        self
7955    }
7956
7957    /// Sets the value of [state_details][crate::model::Replication::state_details].
7958    ///
7959    /// # Example
7960    /// ```ignore,no_run
7961    /// # use google_cloud_netapp_v1::model::Replication;
7962    /// let x = Replication::new().set_state_details("example");
7963    /// ```
7964    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7965        self.state_details = v.into();
7966        self
7967    }
7968
7969    /// Sets the value of [role][crate::model::Replication::role].
7970    ///
7971    /// # Example
7972    /// ```ignore,no_run
7973    /// # use google_cloud_netapp_v1::model::Replication;
7974    /// use google_cloud_netapp_v1::model::replication::ReplicationRole;
7975    /// let x0 = Replication::new().set_role(ReplicationRole::Source);
7976    /// let x1 = Replication::new().set_role(ReplicationRole::Destination);
7977    /// ```
7978    pub fn set_role<T: std::convert::Into<crate::model::replication::ReplicationRole>>(
7979        mut self,
7980        v: T,
7981    ) -> Self {
7982        self.role = v.into();
7983        self
7984    }
7985
7986    /// Sets the value of [replication_schedule][crate::model::Replication::replication_schedule].
7987    ///
7988    /// # Example
7989    /// ```ignore,no_run
7990    /// # use google_cloud_netapp_v1::model::Replication;
7991    /// use google_cloud_netapp_v1::model::replication::ReplicationSchedule;
7992    /// let x0 = Replication::new().set_replication_schedule(ReplicationSchedule::Every10Minutes);
7993    /// let x1 = Replication::new().set_replication_schedule(ReplicationSchedule::Hourly);
7994    /// let x2 = Replication::new().set_replication_schedule(ReplicationSchedule::Daily);
7995    /// ```
7996    pub fn set_replication_schedule<
7997        T: std::convert::Into<crate::model::replication::ReplicationSchedule>,
7998    >(
7999        mut self,
8000        v: T,
8001    ) -> Self {
8002        self.replication_schedule = v.into();
8003        self
8004    }
8005
8006    /// Sets the value of [mirror_state][crate::model::Replication::mirror_state].
8007    ///
8008    /// # Example
8009    /// ```ignore,no_run
8010    /// # use google_cloud_netapp_v1::model::Replication;
8011    /// use google_cloud_netapp_v1::model::replication::MirrorState;
8012    /// let x0 = Replication::new().set_mirror_state(MirrorState::Preparing);
8013    /// let x1 = Replication::new().set_mirror_state(MirrorState::Mirrored);
8014    /// let x2 = Replication::new().set_mirror_state(MirrorState::Stopped);
8015    /// ```
8016    pub fn set_mirror_state<T: std::convert::Into<crate::model::replication::MirrorState>>(
8017        mut self,
8018        v: T,
8019    ) -> Self {
8020        self.mirror_state = v.into();
8021        self
8022    }
8023
8024    /// Sets the value of [healthy][crate::model::Replication::healthy].
8025    ///
8026    /// # Example
8027    /// ```ignore,no_run
8028    /// # use google_cloud_netapp_v1::model::Replication;
8029    /// let x = Replication::new().set_healthy(true);
8030    /// ```
8031    pub fn set_healthy<T>(mut self, v: T) -> Self
8032    where
8033        T: std::convert::Into<bool>,
8034    {
8035        self.healthy = std::option::Option::Some(v.into());
8036        self
8037    }
8038
8039    /// Sets or clears the value of [healthy][crate::model::Replication::healthy].
8040    ///
8041    /// # Example
8042    /// ```ignore,no_run
8043    /// # use google_cloud_netapp_v1::model::Replication;
8044    /// let x = Replication::new().set_or_clear_healthy(Some(false));
8045    /// let x = Replication::new().set_or_clear_healthy(None::<bool>);
8046    /// ```
8047    pub fn set_or_clear_healthy<T>(mut self, v: std::option::Option<T>) -> Self
8048    where
8049        T: std::convert::Into<bool>,
8050    {
8051        self.healthy = v.map(|x| x.into());
8052        self
8053    }
8054
8055    /// Sets the value of [create_time][crate::model::Replication::create_time].
8056    ///
8057    /// # Example
8058    /// ```ignore,no_run
8059    /// # use google_cloud_netapp_v1::model::Replication;
8060    /// use wkt::Timestamp;
8061    /// let x = Replication::new().set_create_time(Timestamp::default()/* use setters */);
8062    /// ```
8063    pub fn set_create_time<T>(mut self, v: T) -> Self
8064    where
8065        T: std::convert::Into<wkt::Timestamp>,
8066    {
8067        self.create_time = std::option::Option::Some(v.into());
8068        self
8069    }
8070
8071    /// Sets or clears the value of [create_time][crate::model::Replication::create_time].
8072    ///
8073    /// # Example
8074    /// ```ignore,no_run
8075    /// # use google_cloud_netapp_v1::model::Replication;
8076    /// use wkt::Timestamp;
8077    /// let x = Replication::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8078    /// let x = Replication::new().set_or_clear_create_time(None::<Timestamp>);
8079    /// ```
8080    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8081    where
8082        T: std::convert::Into<wkt::Timestamp>,
8083    {
8084        self.create_time = v.map(|x| x.into());
8085        self
8086    }
8087
8088    /// Sets the value of [destination_volume][crate::model::Replication::destination_volume].
8089    ///
8090    /// # Example
8091    /// ```ignore,no_run
8092    /// # use google_cloud_netapp_v1::model::Replication;
8093    /// let x = Replication::new().set_destination_volume("example");
8094    /// ```
8095    pub fn set_destination_volume<T: std::convert::Into<std::string::String>>(
8096        mut self,
8097        v: T,
8098    ) -> Self {
8099        self.destination_volume = v.into();
8100        self
8101    }
8102
8103    /// Sets the value of [transfer_stats][crate::model::Replication::transfer_stats].
8104    ///
8105    /// # Example
8106    /// ```ignore,no_run
8107    /// # use google_cloud_netapp_v1::model::Replication;
8108    /// use google_cloud_netapp_v1::model::TransferStats;
8109    /// let x = Replication::new().set_transfer_stats(TransferStats::default()/* use setters */);
8110    /// ```
8111    pub fn set_transfer_stats<T>(mut self, v: T) -> Self
8112    where
8113        T: std::convert::Into<crate::model::TransferStats>,
8114    {
8115        self.transfer_stats = std::option::Option::Some(v.into());
8116        self
8117    }
8118
8119    /// Sets or clears the value of [transfer_stats][crate::model::Replication::transfer_stats].
8120    ///
8121    /// # Example
8122    /// ```ignore,no_run
8123    /// # use google_cloud_netapp_v1::model::Replication;
8124    /// use google_cloud_netapp_v1::model::TransferStats;
8125    /// let x = Replication::new().set_or_clear_transfer_stats(Some(TransferStats::default()/* use setters */));
8126    /// let x = Replication::new().set_or_clear_transfer_stats(None::<TransferStats>);
8127    /// ```
8128    pub fn set_or_clear_transfer_stats<T>(mut self, v: std::option::Option<T>) -> Self
8129    where
8130        T: std::convert::Into<crate::model::TransferStats>,
8131    {
8132        self.transfer_stats = v.map(|x| x.into());
8133        self
8134    }
8135
8136    /// Sets the value of [labels][crate::model::Replication::labels].
8137    ///
8138    /// # Example
8139    /// ```ignore,no_run
8140    /// # use google_cloud_netapp_v1::model::Replication;
8141    /// let x = Replication::new().set_labels([
8142    ///     ("key0", "abc"),
8143    ///     ("key1", "xyz"),
8144    /// ]);
8145    /// ```
8146    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8147    where
8148        T: std::iter::IntoIterator<Item = (K, V)>,
8149        K: std::convert::Into<std::string::String>,
8150        V: std::convert::Into<std::string::String>,
8151    {
8152        use std::iter::Iterator;
8153        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8154        self
8155    }
8156
8157    /// Sets the value of [description][crate::model::Replication::description].
8158    ///
8159    /// # Example
8160    /// ```ignore,no_run
8161    /// # use google_cloud_netapp_v1::model::Replication;
8162    /// let x = Replication::new().set_description("example");
8163    /// ```
8164    pub fn set_description<T>(mut self, v: T) -> Self
8165    where
8166        T: std::convert::Into<std::string::String>,
8167    {
8168        self.description = std::option::Option::Some(v.into());
8169        self
8170    }
8171
8172    /// Sets or clears the value of [description][crate::model::Replication::description].
8173    ///
8174    /// # Example
8175    /// ```ignore,no_run
8176    /// # use google_cloud_netapp_v1::model::Replication;
8177    /// let x = Replication::new().set_or_clear_description(Some("example"));
8178    /// let x = Replication::new().set_or_clear_description(None::<String>);
8179    /// ```
8180    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
8181    where
8182        T: std::convert::Into<std::string::String>,
8183    {
8184        self.description = v.map(|x| x.into());
8185        self
8186    }
8187
8188    /// Sets the value of [destination_volume_parameters][crate::model::Replication::destination_volume_parameters].
8189    ///
8190    /// # Example
8191    /// ```ignore,no_run
8192    /// # use google_cloud_netapp_v1::model::Replication;
8193    /// use google_cloud_netapp_v1::model::DestinationVolumeParameters;
8194    /// let x = Replication::new().set_destination_volume_parameters(DestinationVolumeParameters::default()/* use setters */);
8195    /// ```
8196    pub fn set_destination_volume_parameters<T>(mut self, v: T) -> Self
8197    where
8198        T: std::convert::Into<crate::model::DestinationVolumeParameters>,
8199    {
8200        self.destination_volume_parameters = std::option::Option::Some(v.into());
8201        self
8202    }
8203
8204    /// Sets or clears the value of [destination_volume_parameters][crate::model::Replication::destination_volume_parameters].
8205    ///
8206    /// # Example
8207    /// ```ignore,no_run
8208    /// # use google_cloud_netapp_v1::model::Replication;
8209    /// use google_cloud_netapp_v1::model::DestinationVolumeParameters;
8210    /// let x = Replication::new().set_or_clear_destination_volume_parameters(Some(DestinationVolumeParameters::default()/* use setters */));
8211    /// let x = Replication::new().set_or_clear_destination_volume_parameters(None::<DestinationVolumeParameters>);
8212    /// ```
8213    pub fn set_or_clear_destination_volume_parameters<T>(
8214        mut self,
8215        v: std::option::Option<T>,
8216    ) -> Self
8217    where
8218        T: std::convert::Into<crate::model::DestinationVolumeParameters>,
8219    {
8220        self.destination_volume_parameters = v.map(|x| x.into());
8221        self
8222    }
8223
8224    /// Sets the value of [source_volume][crate::model::Replication::source_volume].
8225    ///
8226    /// # Example
8227    /// ```ignore,no_run
8228    /// # use google_cloud_netapp_v1::model::Replication;
8229    /// let x = Replication::new().set_source_volume("example");
8230    /// ```
8231    pub fn set_source_volume<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8232        self.source_volume = v.into();
8233        self
8234    }
8235
8236    /// Sets the value of [hybrid_peering_details][crate::model::Replication::hybrid_peering_details].
8237    ///
8238    /// # Example
8239    /// ```ignore,no_run
8240    /// # use google_cloud_netapp_v1::model::Replication;
8241    /// use google_cloud_netapp_v1::model::HybridPeeringDetails;
8242    /// let x = Replication::new().set_hybrid_peering_details(HybridPeeringDetails::default()/* use setters */);
8243    /// ```
8244    pub fn set_hybrid_peering_details<T>(mut self, v: T) -> Self
8245    where
8246        T: std::convert::Into<crate::model::HybridPeeringDetails>,
8247    {
8248        self.hybrid_peering_details = std::option::Option::Some(v.into());
8249        self
8250    }
8251
8252    /// Sets or clears the value of [hybrid_peering_details][crate::model::Replication::hybrid_peering_details].
8253    ///
8254    /// # Example
8255    /// ```ignore,no_run
8256    /// # use google_cloud_netapp_v1::model::Replication;
8257    /// use google_cloud_netapp_v1::model::HybridPeeringDetails;
8258    /// let x = Replication::new().set_or_clear_hybrid_peering_details(Some(HybridPeeringDetails::default()/* use setters */));
8259    /// let x = Replication::new().set_or_clear_hybrid_peering_details(None::<HybridPeeringDetails>);
8260    /// ```
8261    pub fn set_or_clear_hybrid_peering_details<T>(mut self, v: std::option::Option<T>) -> Self
8262    where
8263        T: std::convert::Into<crate::model::HybridPeeringDetails>,
8264    {
8265        self.hybrid_peering_details = v.map(|x| x.into());
8266        self
8267    }
8268
8269    /// Sets the value of [cluster_location][crate::model::Replication::cluster_location].
8270    ///
8271    /// # Example
8272    /// ```ignore,no_run
8273    /// # use google_cloud_netapp_v1::model::Replication;
8274    /// let x = Replication::new().set_cluster_location("example");
8275    /// ```
8276    pub fn set_cluster_location<T: std::convert::Into<std::string::String>>(
8277        mut self,
8278        v: T,
8279    ) -> Self {
8280        self.cluster_location = v.into();
8281        self
8282    }
8283
8284    /// Sets the value of [hybrid_replication_type][crate::model::Replication::hybrid_replication_type].
8285    ///
8286    /// # Example
8287    /// ```ignore,no_run
8288    /// # use google_cloud_netapp_v1::model::Replication;
8289    /// use google_cloud_netapp_v1::model::replication::HybridReplicationType;
8290    /// let x0 = Replication::new().set_hybrid_replication_type(HybridReplicationType::Migration);
8291    /// let x1 = Replication::new().set_hybrid_replication_type(HybridReplicationType::ContinuousReplication);
8292    /// let x2 = Replication::new().set_hybrid_replication_type(HybridReplicationType::OnpremReplication);
8293    /// ```
8294    pub fn set_hybrid_replication_type<
8295        T: std::convert::Into<crate::model::replication::HybridReplicationType>,
8296    >(
8297        mut self,
8298        v: T,
8299    ) -> Self {
8300        self.hybrid_replication_type = v.into();
8301        self
8302    }
8303
8304    /// Sets the value of [hybrid_replication_user_commands][crate::model::Replication::hybrid_replication_user_commands].
8305    ///
8306    /// # Example
8307    /// ```ignore,no_run
8308    /// # use google_cloud_netapp_v1::model::Replication;
8309    /// use google_cloud_netapp_v1::model::UserCommands;
8310    /// let x = Replication::new().set_hybrid_replication_user_commands(UserCommands::default()/* use setters */);
8311    /// ```
8312    pub fn set_hybrid_replication_user_commands<T>(mut self, v: T) -> Self
8313    where
8314        T: std::convert::Into<crate::model::UserCommands>,
8315    {
8316        self.hybrid_replication_user_commands = std::option::Option::Some(v.into());
8317        self
8318    }
8319
8320    /// Sets or clears the value of [hybrid_replication_user_commands][crate::model::Replication::hybrid_replication_user_commands].
8321    ///
8322    /// # Example
8323    /// ```ignore,no_run
8324    /// # use google_cloud_netapp_v1::model::Replication;
8325    /// use google_cloud_netapp_v1::model::UserCommands;
8326    /// let x = Replication::new().set_or_clear_hybrid_replication_user_commands(Some(UserCommands::default()/* use setters */));
8327    /// let x = Replication::new().set_or_clear_hybrid_replication_user_commands(None::<UserCommands>);
8328    /// ```
8329    pub fn set_or_clear_hybrid_replication_user_commands<T>(
8330        mut self,
8331        v: std::option::Option<T>,
8332    ) -> Self
8333    where
8334        T: std::convert::Into<crate::model::UserCommands>,
8335    {
8336        self.hybrid_replication_user_commands = v.map(|x| x.into());
8337        self
8338    }
8339}
8340
8341impl wkt::message::Message for Replication {
8342    fn typename() -> &'static str {
8343        "type.googleapis.com/google.cloud.netapp.v1.Replication"
8344    }
8345}
8346
8347/// Defines additional types related to [Replication].
8348pub mod replication {
8349    #[allow(unused_imports)]
8350    use super::*;
8351
8352    /// The replication states
8353    /// New enum values may be added in future to indicate possible new states.
8354    ///
8355    /// # Working with unknown values
8356    ///
8357    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8358    /// additional enum variants at any time. Adding new variants is not considered
8359    /// a breaking change. Applications should write their code in anticipation of:
8360    ///
8361    /// - New values appearing in future releases of the client library, **and**
8362    /// - New values received dynamically, without application changes.
8363    ///
8364    /// Please consult the [Working with enums] section in the user guide for some
8365    /// guidelines.
8366    ///
8367    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8368    #[derive(Clone, Debug, PartialEq)]
8369    #[non_exhaustive]
8370    pub enum State {
8371        /// Unspecified replication State
8372        Unspecified,
8373        /// Replication is creating.
8374        Creating,
8375        /// Replication is ready.
8376        Ready,
8377        /// Replication is updating.
8378        Updating,
8379        /// Replication is deleting.
8380        Deleting,
8381        /// Replication is in error state.
8382        Error,
8383        /// Replication is waiting for cluster peering to be established.
8384        PendingClusterPeering,
8385        /// Replication is waiting for SVM peering to be established.
8386        PendingSvmPeering,
8387        /// Replication is waiting for Commands to be executed on Onprem ONTAP.
8388        PendingRemoteResync,
8389        /// Onprem ONTAP is destination and Replication can only be managed from
8390        /// Onprem.
8391        ExternallyManagedReplication,
8392        /// If set, the enum was initialized with an unknown value.
8393        ///
8394        /// Applications can examine the value using [State::value] or
8395        /// [State::name].
8396        UnknownValue(state::UnknownValue),
8397    }
8398
8399    #[doc(hidden)]
8400    pub mod state {
8401        #[allow(unused_imports)]
8402        use super::*;
8403        #[derive(Clone, Debug, PartialEq)]
8404        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8405    }
8406
8407    impl State {
8408        /// Gets the enum value.
8409        ///
8410        /// Returns `None` if the enum contains an unknown value deserialized from
8411        /// the string representation of enums.
8412        pub fn value(&self) -> std::option::Option<i32> {
8413            match self {
8414                Self::Unspecified => std::option::Option::Some(0),
8415                Self::Creating => std::option::Option::Some(1),
8416                Self::Ready => std::option::Option::Some(2),
8417                Self::Updating => std::option::Option::Some(3),
8418                Self::Deleting => std::option::Option::Some(5),
8419                Self::Error => std::option::Option::Some(6),
8420                Self::PendingClusterPeering => std::option::Option::Some(8),
8421                Self::PendingSvmPeering => std::option::Option::Some(9),
8422                Self::PendingRemoteResync => std::option::Option::Some(10),
8423                Self::ExternallyManagedReplication => std::option::Option::Some(11),
8424                Self::UnknownValue(u) => u.0.value(),
8425            }
8426        }
8427
8428        /// Gets the enum value as a string.
8429        ///
8430        /// Returns `None` if the enum contains an unknown value deserialized from
8431        /// the integer representation of enums.
8432        pub fn name(&self) -> std::option::Option<&str> {
8433            match self {
8434                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8435                Self::Creating => std::option::Option::Some("CREATING"),
8436                Self::Ready => std::option::Option::Some("READY"),
8437                Self::Updating => std::option::Option::Some("UPDATING"),
8438                Self::Deleting => std::option::Option::Some("DELETING"),
8439                Self::Error => std::option::Option::Some("ERROR"),
8440                Self::PendingClusterPeering => std::option::Option::Some("PENDING_CLUSTER_PEERING"),
8441                Self::PendingSvmPeering => std::option::Option::Some("PENDING_SVM_PEERING"),
8442                Self::PendingRemoteResync => std::option::Option::Some("PENDING_REMOTE_RESYNC"),
8443                Self::ExternallyManagedReplication => {
8444                    std::option::Option::Some("EXTERNALLY_MANAGED_REPLICATION")
8445                }
8446                Self::UnknownValue(u) => u.0.name(),
8447            }
8448        }
8449    }
8450
8451    impl std::default::Default for State {
8452        fn default() -> Self {
8453            use std::convert::From;
8454            Self::from(0)
8455        }
8456    }
8457
8458    impl std::fmt::Display for State {
8459        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8460            wkt::internal::display_enum(f, self.name(), self.value())
8461        }
8462    }
8463
8464    impl std::convert::From<i32> for State {
8465        fn from(value: i32) -> Self {
8466            match value {
8467                0 => Self::Unspecified,
8468                1 => Self::Creating,
8469                2 => Self::Ready,
8470                3 => Self::Updating,
8471                5 => Self::Deleting,
8472                6 => Self::Error,
8473                8 => Self::PendingClusterPeering,
8474                9 => Self::PendingSvmPeering,
8475                10 => Self::PendingRemoteResync,
8476                11 => Self::ExternallyManagedReplication,
8477                _ => Self::UnknownValue(state::UnknownValue(
8478                    wkt::internal::UnknownEnumValue::Integer(value),
8479                )),
8480            }
8481        }
8482    }
8483
8484    impl std::convert::From<&str> for State {
8485        fn from(value: &str) -> Self {
8486            use std::string::ToString;
8487            match value {
8488                "STATE_UNSPECIFIED" => Self::Unspecified,
8489                "CREATING" => Self::Creating,
8490                "READY" => Self::Ready,
8491                "UPDATING" => Self::Updating,
8492                "DELETING" => Self::Deleting,
8493                "ERROR" => Self::Error,
8494                "PENDING_CLUSTER_PEERING" => Self::PendingClusterPeering,
8495                "PENDING_SVM_PEERING" => Self::PendingSvmPeering,
8496                "PENDING_REMOTE_RESYNC" => Self::PendingRemoteResync,
8497                "EXTERNALLY_MANAGED_REPLICATION" => Self::ExternallyManagedReplication,
8498                _ => Self::UnknownValue(state::UnknownValue(
8499                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8500                )),
8501            }
8502        }
8503    }
8504
8505    impl serde::ser::Serialize for State {
8506        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8507        where
8508            S: serde::Serializer,
8509        {
8510            match self {
8511                Self::Unspecified => serializer.serialize_i32(0),
8512                Self::Creating => serializer.serialize_i32(1),
8513                Self::Ready => serializer.serialize_i32(2),
8514                Self::Updating => serializer.serialize_i32(3),
8515                Self::Deleting => serializer.serialize_i32(5),
8516                Self::Error => serializer.serialize_i32(6),
8517                Self::PendingClusterPeering => serializer.serialize_i32(8),
8518                Self::PendingSvmPeering => serializer.serialize_i32(9),
8519                Self::PendingRemoteResync => serializer.serialize_i32(10),
8520                Self::ExternallyManagedReplication => serializer.serialize_i32(11),
8521                Self::UnknownValue(u) => u.0.serialize(serializer),
8522            }
8523        }
8524    }
8525
8526    impl<'de> serde::de::Deserialize<'de> for State {
8527        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8528        where
8529            D: serde::Deserializer<'de>,
8530        {
8531            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8532                ".google.cloud.netapp.v1.Replication.State",
8533            ))
8534        }
8535    }
8536
8537    /// New enum values may be added in future to support different replication
8538    /// topology.
8539    ///
8540    /// # Working with unknown values
8541    ///
8542    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8543    /// additional enum variants at any time. Adding new variants is not considered
8544    /// a breaking change. Applications should write their code in anticipation of:
8545    ///
8546    /// - New values appearing in future releases of the client library, **and**
8547    /// - New values received dynamically, without application changes.
8548    ///
8549    /// Please consult the [Working with enums] section in the user guide for some
8550    /// guidelines.
8551    ///
8552    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8553    #[derive(Clone, Debug, PartialEq)]
8554    #[non_exhaustive]
8555    pub enum ReplicationRole {
8556        /// Unspecified replication role
8557        Unspecified,
8558        /// Indicates Source volume.
8559        Source,
8560        /// Indicates Destination volume.
8561        Destination,
8562        /// If set, the enum was initialized with an unknown value.
8563        ///
8564        /// Applications can examine the value using [ReplicationRole::value] or
8565        /// [ReplicationRole::name].
8566        UnknownValue(replication_role::UnknownValue),
8567    }
8568
8569    #[doc(hidden)]
8570    pub mod replication_role {
8571        #[allow(unused_imports)]
8572        use super::*;
8573        #[derive(Clone, Debug, PartialEq)]
8574        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8575    }
8576
8577    impl ReplicationRole {
8578        /// Gets the enum value.
8579        ///
8580        /// Returns `None` if the enum contains an unknown value deserialized from
8581        /// the string representation of enums.
8582        pub fn value(&self) -> std::option::Option<i32> {
8583            match self {
8584                Self::Unspecified => std::option::Option::Some(0),
8585                Self::Source => std::option::Option::Some(1),
8586                Self::Destination => std::option::Option::Some(2),
8587                Self::UnknownValue(u) => u.0.value(),
8588            }
8589        }
8590
8591        /// Gets the enum value as a string.
8592        ///
8593        /// Returns `None` if the enum contains an unknown value deserialized from
8594        /// the integer representation of enums.
8595        pub fn name(&self) -> std::option::Option<&str> {
8596            match self {
8597                Self::Unspecified => std::option::Option::Some("REPLICATION_ROLE_UNSPECIFIED"),
8598                Self::Source => std::option::Option::Some("SOURCE"),
8599                Self::Destination => std::option::Option::Some("DESTINATION"),
8600                Self::UnknownValue(u) => u.0.name(),
8601            }
8602        }
8603    }
8604
8605    impl std::default::Default for ReplicationRole {
8606        fn default() -> Self {
8607            use std::convert::From;
8608            Self::from(0)
8609        }
8610    }
8611
8612    impl std::fmt::Display for ReplicationRole {
8613        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8614            wkt::internal::display_enum(f, self.name(), self.value())
8615        }
8616    }
8617
8618    impl std::convert::From<i32> for ReplicationRole {
8619        fn from(value: i32) -> Self {
8620            match value {
8621                0 => Self::Unspecified,
8622                1 => Self::Source,
8623                2 => Self::Destination,
8624                _ => Self::UnknownValue(replication_role::UnknownValue(
8625                    wkt::internal::UnknownEnumValue::Integer(value),
8626                )),
8627            }
8628        }
8629    }
8630
8631    impl std::convert::From<&str> for ReplicationRole {
8632        fn from(value: &str) -> Self {
8633            use std::string::ToString;
8634            match value {
8635                "REPLICATION_ROLE_UNSPECIFIED" => Self::Unspecified,
8636                "SOURCE" => Self::Source,
8637                "DESTINATION" => Self::Destination,
8638                _ => Self::UnknownValue(replication_role::UnknownValue(
8639                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8640                )),
8641            }
8642        }
8643    }
8644
8645    impl serde::ser::Serialize for ReplicationRole {
8646        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8647        where
8648            S: serde::Serializer,
8649        {
8650            match self {
8651                Self::Unspecified => serializer.serialize_i32(0),
8652                Self::Source => serializer.serialize_i32(1),
8653                Self::Destination => serializer.serialize_i32(2),
8654                Self::UnknownValue(u) => u.0.serialize(serializer),
8655            }
8656        }
8657    }
8658
8659    impl<'de> serde::de::Deserialize<'de> for ReplicationRole {
8660        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8661        where
8662            D: serde::Deserializer<'de>,
8663        {
8664            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicationRole>::new(
8665                ".google.cloud.netapp.v1.Replication.ReplicationRole",
8666            ))
8667        }
8668    }
8669
8670    /// Schedule for Replication.
8671    /// New enum values may be added in future to support different frequency of
8672    /// replication.
8673    ///
8674    /// # Working with unknown values
8675    ///
8676    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8677    /// additional enum variants at any time. Adding new variants is not considered
8678    /// a breaking change. Applications should write their code in anticipation of:
8679    ///
8680    /// - New values appearing in future releases of the client library, **and**
8681    /// - New values received dynamically, without application changes.
8682    ///
8683    /// Please consult the [Working with enums] section in the user guide for some
8684    /// guidelines.
8685    ///
8686    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8687    #[derive(Clone, Debug, PartialEq)]
8688    #[non_exhaustive]
8689    pub enum ReplicationSchedule {
8690        /// Unspecified ReplicationSchedule
8691        Unspecified,
8692        /// Replication happens once every 10 minutes.
8693        Every10Minutes,
8694        /// Replication happens once every hour.
8695        Hourly,
8696        /// Replication happens once every day.
8697        Daily,
8698        /// If set, the enum was initialized with an unknown value.
8699        ///
8700        /// Applications can examine the value using [ReplicationSchedule::value] or
8701        /// [ReplicationSchedule::name].
8702        UnknownValue(replication_schedule::UnknownValue),
8703    }
8704
8705    #[doc(hidden)]
8706    pub mod replication_schedule {
8707        #[allow(unused_imports)]
8708        use super::*;
8709        #[derive(Clone, Debug, PartialEq)]
8710        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8711    }
8712
8713    impl ReplicationSchedule {
8714        /// Gets the enum value.
8715        ///
8716        /// Returns `None` if the enum contains an unknown value deserialized from
8717        /// the string representation of enums.
8718        pub fn value(&self) -> std::option::Option<i32> {
8719            match self {
8720                Self::Unspecified => std::option::Option::Some(0),
8721                Self::Every10Minutes => std::option::Option::Some(1),
8722                Self::Hourly => std::option::Option::Some(2),
8723                Self::Daily => std::option::Option::Some(3),
8724                Self::UnknownValue(u) => u.0.value(),
8725            }
8726        }
8727
8728        /// Gets the enum value as a string.
8729        ///
8730        /// Returns `None` if the enum contains an unknown value deserialized from
8731        /// the integer representation of enums.
8732        pub fn name(&self) -> std::option::Option<&str> {
8733            match self {
8734                Self::Unspecified => std::option::Option::Some("REPLICATION_SCHEDULE_UNSPECIFIED"),
8735                Self::Every10Minutes => std::option::Option::Some("EVERY_10_MINUTES"),
8736                Self::Hourly => std::option::Option::Some("HOURLY"),
8737                Self::Daily => std::option::Option::Some("DAILY"),
8738                Self::UnknownValue(u) => u.0.name(),
8739            }
8740        }
8741    }
8742
8743    impl std::default::Default for ReplicationSchedule {
8744        fn default() -> Self {
8745            use std::convert::From;
8746            Self::from(0)
8747        }
8748    }
8749
8750    impl std::fmt::Display for ReplicationSchedule {
8751        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8752            wkt::internal::display_enum(f, self.name(), self.value())
8753        }
8754    }
8755
8756    impl std::convert::From<i32> for ReplicationSchedule {
8757        fn from(value: i32) -> Self {
8758            match value {
8759                0 => Self::Unspecified,
8760                1 => Self::Every10Minutes,
8761                2 => Self::Hourly,
8762                3 => Self::Daily,
8763                _ => Self::UnknownValue(replication_schedule::UnknownValue(
8764                    wkt::internal::UnknownEnumValue::Integer(value),
8765                )),
8766            }
8767        }
8768    }
8769
8770    impl std::convert::From<&str> for ReplicationSchedule {
8771        fn from(value: &str) -> Self {
8772            use std::string::ToString;
8773            match value {
8774                "REPLICATION_SCHEDULE_UNSPECIFIED" => Self::Unspecified,
8775                "EVERY_10_MINUTES" => Self::Every10Minutes,
8776                "HOURLY" => Self::Hourly,
8777                "DAILY" => Self::Daily,
8778                _ => Self::UnknownValue(replication_schedule::UnknownValue(
8779                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8780                )),
8781            }
8782        }
8783    }
8784
8785    impl serde::ser::Serialize for ReplicationSchedule {
8786        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8787        where
8788            S: serde::Serializer,
8789        {
8790            match self {
8791                Self::Unspecified => serializer.serialize_i32(0),
8792                Self::Every10Minutes => serializer.serialize_i32(1),
8793                Self::Hourly => serializer.serialize_i32(2),
8794                Self::Daily => serializer.serialize_i32(3),
8795                Self::UnknownValue(u) => u.0.serialize(serializer),
8796            }
8797        }
8798    }
8799
8800    impl<'de> serde::de::Deserialize<'de> for ReplicationSchedule {
8801        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8802        where
8803            D: serde::Deserializer<'de>,
8804        {
8805            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicationSchedule>::new(
8806                ".google.cloud.netapp.v1.Replication.ReplicationSchedule",
8807            ))
8808        }
8809    }
8810
8811    /// Mirroring states.
8812    /// No new value is expected to be added in future.
8813    ///
8814    /// # Working with unknown values
8815    ///
8816    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8817    /// additional enum variants at any time. Adding new variants is not considered
8818    /// a breaking change. Applications should write their code in anticipation of:
8819    ///
8820    /// - New values appearing in future releases of the client library, **and**
8821    /// - New values received dynamically, without application changes.
8822    ///
8823    /// Please consult the [Working with enums] section in the user guide for some
8824    /// guidelines.
8825    ///
8826    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8827    #[derive(Clone, Debug, PartialEq)]
8828    #[non_exhaustive]
8829    pub enum MirrorState {
8830        /// Unspecified MirrorState
8831        Unspecified,
8832        /// Destination volume is being prepared.
8833        Preparing,
8834        /// Destination volume has been initialized and is ready to receive
8835        /// replication transfers.
8836        Mirrored,
8837        /// Destination volume is not receiving replication transfers.
8838        Stopped,
8839        /// Incremental replication is in progress.
8840        Transferring,
8841        /// Baseline replication is in progress.
8842        BaselineTransferring,
8843        /// Replication is aborted.
8844        Aborted,
8845        /// Replication is being managed from Onprem ONTAP.
8846        ExternallyManaged,
8847        /// Peering is yet to be established.
8848        PendingPeering,
8849        /// If set, the enum was initialized with an unknown value.
8850        ///
8851        /// Applications can examine the value using [MirrorState::value] or
8852        /// [MirrorState::name].
8853        UnknownValue(mirror_state::UnknownValue),
8854    }
8855
8856    #[doc(hidden)]
8857    pub mod mirror_state {
8858        #[allow(unused_imports)]
8859        use super::*;
8860        #[derive(Clone, Debug, PartialEq)]
8861        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8862    }
8863
8864    impl MirrorState {
8865        /// Gets the enum value.
8866        ///
8867        /// Returns `None` if the enum contains an unknown value deserialized from
8868        /// the string representation of enums.
8869        pub fn value(&self) -> std::option::Option<i32> {
8870            match self {
8871                Self::Unspecified => std::option::Option::Some(0),
8872                Self::Preparing => std::option::Option::Some(1),
8873                Self::Mirrored => std::option::Option::Some(2),
8874                Self::Stopped => std::option::Option::Some(3),
8875                Self::Transferring => std::option::Option::Some(4),
8876                Self::BaselineTransferring => std::option::Option::Some(5),
8877                Self::Aborted => std::option::Option::Some(6),
8878                Self::ExternallyManaged => std::option::Option::Some(7),
8879                Self::PendingPeering => std::option::Option::Some(8),
8880                Self::UnknownValue(u) => u.0.value(),
8881            }
8882        }
8883
8884        /// Gets the enum value as a string.
8885        ///
8886        /// Returns `None` if the enum contains an unknown value deserialized from
8887        /// the integer representation of enums.
8888        pub fn name(&self) -> std::option::Option<&str> {
8889            match self {
8890                Self::Unspecified => std::option::Option::Some("MIRROR_STATE_UNSPECIFIED"),
8891                Self::Preparing => std::option::Option::Some("PREPARING"),
8892                Self::Mirrored => std::option::Option::Some("MIRRORED"),
8893                Self::Stopped => std::option::Option::Some("STOPPED"),
8894                Self::Transferring => std::option::Option::Some("TRANSFERRING"),
8895                Self::BaselineTransferring => std::option::Option::Some("BASELINE_TRANSFERRING"),
8896                Self::Aborted => std::option::Option::Some("ABORTED"),
8897                Self::ExternallyManaged => std::option::Option::Some("EXTERNALLY_MANAGED"),
8898                Self::PendingPeering => std::option::Option::Some("PENDING_PEERING"),
8899                Self::UnknownValue(u) => u.0.name(),
8900            }
8901        }
8902    }
8903
8904    impl std::default::Default for MirrorState {
8905        fn default() -> Self {
8906            use std::convert::From;
8907            Self::from(0)
8908        }
8909    }
8910
8911    impl std::fmt::Display for MirrorState {
8912        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8913            wkt::internal::display_enum(f, self.name(), self.value())
8914        }
8915    }
8916
8917    impl std::convert::From<i32> for MirrorState {
8918        fn from(value: i32) -> Self {
8919            match value {
8920                0 => Self::Unspecified,
8921                1 => Self::Preparing,
8922                2 => Self::Mirrored,
8923                3 => Self::Stopped,
8924                4 => Self::Transferring,
8925                5 => Self::BaselineTransferring,
8926                6 => Self::Aborted,
8927                7 => Self::ExternallyManaged,
8928                8 => Self::PendingPeering,
8929                _ => Self::UnknownValue(mirror_state::UnknownValue(
8930                    wkt::internal::UnknownEnumValue::Integer(value),
8931                )),
8932            }
8933        }
8934    }
8935
8936    impl std::convert::From<&str> for MirrorState {
8937        fn from(value: &str) -> Self {
8938            use std::string::ToString;
8939            match value {
8940                "MIRROR_STATE_UNSPECIFIED" => Self::Unspecified,
8941                "PREPARING" => Self::Preparing,
8942                "MIRRORED" => Self::Mirrored,
8943                "STOPPED" => Self::Stopped,
8944                "TRANSFERRING" => Self::Transferring,
8945                "BASELINE_TRANSFERRING" => Self::BaselineTransferring,
8946                "ABORTED" => Self::Aborted,
8947                "EXTERNALLY_MANAGED" => Self::ExternallyManaged,
8948                "PENDING_PEERING" => Self::PendingPeering,
8949                _ => Self::UnknownValue(mirror_state::UnknownValue(
8950                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8951                )),
8952            }
8953        }
8954    }
8955
8956    impl serde::ser::Serialize for MirrorState {
8957        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8958        where
8959            S: serde::Serializer,
8960        {
8961            match self {
8962                Self::Unspecified => serializer.serialize_i32(0),
8963                Self::Preparing => serializer.serialize_i32(1),
8964                Self::Mirrored => serializer.serialize_i32(2),
8965                Self::Stopped => serializer.serialize_i32(3),
8966                Self::Transferring => serializer.serialize_i32(4),
8967                Self::BaselineTransferring => serializer.serialize_i32(5),
8968                Self::Aborted => serializer.serialize_i32(6),
8969                Self::ExternallyManaged => serializer.serialize_i32(7),
8970                Self::PendingPeering => serializer.serialize_i32(8),
8971                Self::UnknownValue(u) => u.0.serialize(serializer),
8972            }
8973        }
8974    }
8975
8976    impl<'de> serde::de::Deserialize<'de> for MirrorState {
8977        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8978        where
8979            D: serde::Deserializer<'de>,
8980        {
8981            deserializer.deserialize_any(wkt::internal::EnumVisitor::<MirrorState>::new(
8982                ".google.cloud.netapp.v1.Replication.MirrorState",
8983            ))
8984        }
8985    }
8986
8987    /// Hybrid replication type.
8988    ///
8989    /// # Working with unknown values
8990    ///
8991    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8992    /// additional enum variants at any time. Adding new variants is not considered
8993    /// a breaking change. Applications should write their code in anticipation of:
8994    ///
8995    /// - New values appearing in future releases of the client library, **and**
8996    /// - New values received dynamically, without application changes.
8997    ///
8998    /// Please consult the [Working with enums] section in the user guide for some
8999    /// guidelines.
9000    ///
9001    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9002    #[derive(Clone, Debug, PartialEq)]
9003    #[non_exhaustive]
9004    pub enum HybridReplicationType {
9005        /// Unspecified hybrid replication type.
9006        Unspecified,
9007        /// Hybrid replication type for migration.
9008        Migration,
9009        /// Hybrid replication type for continuous replication.
9010        ContinuousReplication,
9011        /// New field for reversible OnPrem replication, to be used for data
9012        /// protection.
9013        OnpremReplication,
9014        /// Hybrid replication type for incremental Transfer in the reverse direction
9015        /// (GCNV is source and Onprem is destination)
9016        ReverseOnpremReplication,
9017        /// If set, the enum was initialized with an unknown value.
9018        ///
9019        /// Applications can examine the value using [HybridReplicationType::value] or
9020        /// [HybridReplicationType::name].
9021        UnknownValue(hybrid_replication_type::UnknownValue),
9022    }
9023
9024    #[doc(hidden)]
9025    pub mod hybrid_replication_type {
9026        #[allow(unused_imports)]
9027        use super::*;
9028        #[derive(Clone, Debug, PartialEq)]
9029        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9030    }
9031
9032    impl HybridReplicationType {
9033        /// Gets the enum value.
9034        ///
9035        /// Returns `None` if the enum contains an unknown value deserialized from
9036        /// the string representation of enums.
9037        pub fn value(&self) -> std::option::Option<i32> {
9038            match self {
9039                Self::Unspecified => std::option::Option::Some(0),
9040                Self::Migration => std::option::Option::Some(1),
9041                Self::ContinuousReplication => std::option::Option::Some(2),
9042                Self::OnpremReplication => std::option::Option::Some(3),
9043                Self::ReverseOnpremReplication => std::option::Option::Some(4),
9044                Self::UnknownValue(u) => u.0.value(),
9045            }
9046        }
9047
9048        /// Gets the enum value as a string.
9049        ///
9050        /// Returns `None` if the enum contains an unknown value deserialized from
9051        /// the integer representation of enums.
9052        pub fn name(&self) -> std::option::Option<&str> {
9053            match self {
9054                Self::Unspecified => {
9055                    std::option::Option::Some("HYBRID_REPLICATION_TYPE_UNSPECIFIED")
9056                }
9057                Self::Migration => std::option::Option::Some("MIGRATION"),
9058                Self::ContinuousReplication => std::option::Option::Some("CONTINUOUS_REPLICATION"),
9059                Self::OnpremReplication => std::option::Option::Some("ONPREM_REPLICATION"),
9060                Self::ReverseOnpremReplication => {
9061                    std::option::Option::Some("REVERSE_ONPREM_REPLICATION")
9062                }
9063                Self::UnknownValue(u) => u.0.name(),
9064            }
9065        }
9066    }
9067
9068    impl std::default::Default for HybridReplicationType {
9069        fn default() -> Self {
9070            use std::convert::From;
9071            Self::from(0)
9072        }
9073    }
9074
9075    impl std::fmt::Display for HybridReplicationType {
9076        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9077            wkt::internal::display_enum(f, self.name(), self.value())
9078        }
9079    }
9080
9081    impl std::convert::From<i32> for HybridReplicationType {
9082        fn from(value: i32) -> Self {
9083            match value {
9084                0 => Self::Unspecified,
9085                1 => Self::Migration,
9086                2 => Self::ContinuousReplication,
9087                3 => Self::OnpremReplication,
9088                4 => Self::ReverseOnpremReplication,
9089                _ => Self::UnknownValue(hybrid_replication_type::UnknownValue(
9090                    wkt::internal::UnknownEnumValue::Integer(value),
9091                )),
9092            }
9093        }
9094    }
9095
9096    impl std::convert::From<&str> for HybridReplicationType {
9097        fn from(value: &str) -> Self {
9098            use std::string::ToString;
9099            match value {
9100                "HYBRID_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
9101                "MIGRATION" => Self::Migration,
9102                "CONTINUOUS_REPLICATION" => Self::ContinuousReplication,
9103                "ONPREM_REPLICATION" => Self::OnpremReplication,
9104                "REVERSE_ONPREM_REPLICATION" => Self::ReverseOnpremReplication,
9105                _ => Self::UnknownValue(hybrid_replication_type::UnknownValue(
9106                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9107                )),
9108            }
9109        }
9110    }
9111
9112    impl serde::ser::Serialize for HybridReplicationType {
9113        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9114        where
9115            S: serde::Serializer,
9116        {
9117            match self {
9118                Self::Unspecified => serializer.serialize_i32(0),
9119                Self::Migration => serializer.serialize_i32(1),
9120                Self::ContinuousReplication => serializer.serialize_i32(2),
9121                Self::OnpremReplication => serializer.serialize_i32(3),
9122                Self::ReverseOnpremReplication => serializer.serialize_i32(4),
9123                Self::UnknownValue(u) => u.0.serialize(serializer),
9124            }
9125        }
9126    }
9127
9128    impl<'de> serde::de::Deserialize<'de> for HybridReplicationType {
9129        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9130        where
9131            D: serde::Deserializer<'de>,
9132        {
9133            deserializer.deserialize_any(wkt::internal::EnumVisitor::<HybridReplicationType>::new(
9134                ".google.cloud.netapp.v1.Replication.HybridReplicationType",
9135            ))
9136        }
9137    }
9138}
9139
9140/// HybridPeeringDetails contains details about the hybrid peering.
9141#[derive(Clone, Default, PartialEq)]
9142#[non_exhaustive]
9143pub struct HybridPeeringDetails {
9144    /// Output only. IP address of the subnet.
9145    pub subnet_ip: std::string::String,
9146
9147    /// Output only. Copy-paste-able commands to be used on user's ONTAP to accept
9148    /// peering requests.
9149    pub command: std::string::String,
9150
9151    /// Output only. Expiration time for the peering command to be executed on
9152    /// user's ONTAP.
9153    pub command_expiry_time: std::option::Option<wkt::Timestamp>,
9154
9155    /// Output only. Temporary passphrase generated to accept cluster peering
9156    /// command.
9157    pub passphrase: std::string::String,
9158
9159    /// Output only. Name of the user's local source volume to be peered with the
9160    /// destination volume.
9161    pub peer_volume_name: std::string::String,
9162
9163    /// Output only. Name of the user's local source cluster to be peered with the
9164    /// destination cluster.
9165    pub peer_cluster_name: std::string::String,
9166
9167    /// Output only. Name of the user's local source vserver svm to be peered with
9168    /// the destination vserver svm.
9169    pub peer_svm_name: std::string::String,
9170
9171    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9172}
9173
9174impl HybridPeeringDetails {
9175    pub fn new() -> Self {
9176        std::default::Default::default()
9177    }
9178
9179    /// Sets the value of [subnet_ip][crate::model::HybridPeeringDetails::subnet_ip].
9180    ///
9181    /// # Example
9182    /// ```ignore,no_run
9183    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9184    /// let x = HybridPeeringDetails::new().set_subnet_ip("example");
9185    /// ```
9186    pub fn set_subnet_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9187        self.subnet_ip = v.into();
9188        self
9189    }
9190
9191    /// Sets the value of [command][crate::model::HybridPeeringDetails::command].
9192    ///
9193    /// # Example
9194    /// ```ignore,no_run
9195    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9196    /// let x = HybridPeeringDetails::new().set_command("example");
9197    /// ```
9198    pub fn set_command<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9199        self.command = v.into();
9200        self
9201    }
9202
9203    /// Sets the value of [command_expiry_time][crate::model::HybridPeeringDetails::command_expiry_time].
9204    ///
9205    /// # Example
9206    /// ```ignore,no_run
9207    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9208    /// use wkt::Timestamp;
9209    /// let x = HybridPeeringDetails::new().set_command_expiry_time(Timestamp::default()/* use setters */);
9210    /// ```
9211    pub fn set_command_expiry_time<T>(mut self, v: T) -> Self
9212    where
9213        T: std::convert::Into<wkt::Timestamp>,
9214    {
9215        self.command_expiry_time = std::option::Option::Some(v.into());
9216        self
9217    }
9218
9219    /// Sets or clears the value of [command_expiry_time][crate::model::HybridPeeringDetails::command_expiry_time].
9220    ///
9221    /// # Example
9222    /// ```ignore,no_run
9223    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9224    /// use wkt::Timestamp;
9225    /// let x = HybridPeeringDetails::new().set_or_clear_command_expiry_time(Some(Timestamp::default()/* use setters */));
9226    /// let x = HybridPeeringDetails::new().set_or_clear_command_expiry_time(None::<Timestamp>);
9227    /// ```
9228    pub fn set_or_clear_command_expiry_time<T>(mut self, v: std::option::Option<T>) -> Self
9229    where
9230        T: std::convert::Into<wkt::Timestamp>,
9231    {
9232        self.command_expiry_time = v.map(|x| x.into());
9233        self
9234    }
9235
9236    /// Sets the value of [passphrase][crate::model::HybridPeeringDetails::passphrase].
9237    ///
9238    /// # Example
9239    /// ```ignore,no_run
9240    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9241    /// let x = HybridPeeringDetails::new().set_passphrase("example");
9242    /// ```
9243    pub fn set_passphrase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9244        self.passphrase = v.into();
9245        self
9246    }
9247
9248    /// Sets the value of [peer_volume_name][crate::model::HybridPeeringDetails::peer_volume_name].
9249    ///
9250    /// # Example
9251    /// ```ignore,no_run
9252    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9253    /// let x = HybridPeeringDetails::new().set_peer_volume_name("example");
9254    /// ```
9255    pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
9256        mut self,
9257        v: T,
9258    ) -> Self {
9259        self.peer_volume_name = v.into();
9260        self
9261    }
9262
9263    /// Sets the value of [peer_cluster_name][crate::model::HybridPeeringDetails::peer_cluster_name].
9264    ///
9265    /// # Example
9266    /// ```ignore,no_run
9267    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9268    /// let x = HybridPeeringDetails::new().set_peer_cluster_name("example");
9269    /// ```
9270    pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
9271        mut self,
9272        v: T,
9273    ) -> Self {
9274        self.peer_cluster_name = v.into();
9275        self
9276    }
9277
9278    /// Sets the value of [peer_svm_name][crate::model::HybridPeeringDetails::peer_svm_name].
9279    ///
9280    /// # Example
9281    /// ```ignore,no_run
9282    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9283    /// let x = HybridPeeringDetails::new().set_peer_svm_name("example");
9284    /// ```
9285    pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9286        self.peer_svm_name = v.into();
9287        self
9288    }
9289}
9290
9291impl wkt::message::Message for HybridPeeringDetails {
9292    fn typename() -> &'static str {
9293        "type.googleapis.com/google.cloud.netapp.v1.HybridPeeringDetails"
9294    }
9295}
9296
9297/// ListReplications lists replications.
9298#[derive(Clone, Default, PartialEq)]
9299#[non_exhaustive]
9300pub struct ListReplicationsRequest {
9301    /// Required. The volume for which to retrieve replication information,
9302    /// in the format
9303    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`.
9304    pub parent: std::string::String,
9305
9306    /// The maximum number of items to return.
9307    pub page_size: i32,
9308
9309    /// The next_page_token value to use if there are additional
9310    /// results to retrieve for this list request.
9311    pub page_token: std::string::String,
9312
9313    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
9314    pub order_by: std::string::String,
9315
9316    /// List filter.
9317    pub filter: std::string::String,
9318
9319    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9320}
9321
9322impl ListReplicationsRequest {
9323    pub fn new() -> Self {
9324        std::default::Default::default()
9325    }
9326
9327    /// Sets the value of [parent][crate::model::ListReplicationsRequest::parent].
9328    ///
9329    /// # Example
9330    /// ```ignore,no_run
9331    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9332    /// let x = ListReplicationsRequest::new().set_parent("example");
9333    /// ```
9334    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9335        self.parent = v.into();
9336        self
9337    }
9338
9339    /// Sets the value of [page_size][crate::model::ListReplicationsRequest::page_size].
9340    ///
9341    /// # Example
9342    /// ```ignore,no_run
9343    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9344    /// let x = ListReplicationsRequest::new().set_page_size(42);
9345    /// ```
9346    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9347        self.page_size = v.into();
9348        self
9349    }
9350
9351    /// Sets the value of [page_token][crate::model::ListReplicationsRequest::page_token].
9352    ///
9353    /// # Example
9354    /// ```ignore,no_run
9355    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9356    /// let x = ListReplicationsRequest::new().set_page_token("example");
9357    /// ```
9358    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9359        self.page_token = v.into();
9360        self
9361    }
9362
9363    /// Sets the value of [order_by][crate::model::ListReplicationsRequest::order_by].
9364    ///
9365    /// # Example
9366    /// ```ignore,no_run
9367    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9368    /// let x = ListReplicationsRequest::new().set_order_by("example");
9369    /// ```
9370    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9371        self.order_by = v.into();
9372        self
9373    }
9374
9375    /// Sets the value of [filter][crate::model::ListReplicationsRequest::filter].
9376    ///
9377    /// # Example
9378    /// ```ignore,no_run
9379    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9380    /// let x = ListReplicationsRequest::new().set_filter("example");
9381    /// ```
9382    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9383        self.filter = v.into();
9384        self
9385    }
9386}
9387
9388impl wkt::message::Message for ListReplicationsRequest {
9389    fn typename() -> &'static str {
9390        "type.googleapis.com/google.cloud.netapp.v1.ListReplicationsRequest"
9391    }
9392}
9393
9394/// ListReplicationsResponse is the result of ListReplicationsRequest.
9395#[derive(Clone, Default, PartialEq)]
9396#[non_exhaustive]
9397pub struct ListReplicationsResponse {
9398    /// A list of replications in the project for the specified volume.
9399    pub replications: std::vec::Vec<crate::model::Replication>,
9400
9401    /// The token you can use to retrieve the next page of results. Not returned
9402    /// if there are no more results in the list.
9403    pub next_page_token: std::string::String,
9404
9405    /// Locations that could not be reached.
9406    pub unreachable: std::vec::Vec<std::string::String>,
9407
9408    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9409}
9410
9411impl ListReplicationsResponse {
9412    pub fn new() -> Self {
9413        std::default::Default::default()
9414    }
9415
9416    /// Sets the value of [replications][crate::model::ListReplicationsResponse::replications].
9417    ///
9418    /// # Example
9419    /// ```ignore,no_run
9420    /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
9421    /// use google_cloud_netapp_v1::model::Replication;
9422    /// let x = ListReplicationsResponse::new()
9423    ///     .set_replications([
9424    ///         Replication::default()/* use setters */,
9425    ///         Replication::default()/* use (different) setters */,
9426    ///     ]);
9427    /// ```
9428    pub fn set_replications<T, V>(mut self, v: T) -> Self
9429    where
9430        T: std::iter::IntoIterator<Item = V>,
9431        V: std::convert::Into<crate::model::Replication>,
9432    {
9433        use std::iter::Iterator;
9434        self.replications = v.into_iter().map(|i| i.into()).collect();
9435        self
9436    }
9437
9438    /// Sets the value of [next_page_token][crate::model::ListReplicationsResponse::next_page_token].
9439    ///
9440    /// # Example
9441    /// ```ignore,no_run
9442    /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
9443    /// let x = ListReplicationsResponse::new().set_next_page_token("example");
9444    /// ```
9445    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9446        self.next_page_token = v.into();
9447        self
9448    }
9449
9450    /// Sets the value of [unreachable][crate::model::ListReplicationsResponse::unreachable].
9451    ///
9452    /// # Example
9453    /// ```ignore,no_run
9454    /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
9455    /// let x = ListReplicationsResponse::new().set_unreachable(["a", "b", "c"]);
9456    /// ```
9457    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9458    where
9459        T: std::iter::IntoIterator<Item = V>,
9460        V: std::convert::Into<std::string::String>,
9461    {
9462        use std::iter::Iterator;
9463        self.unreachable = v.into_iter().map(|i| i.into()).collect();
9464        self
9465    }
9466}
9467
9468impl wkt::message::Message for ListReplicationsResponse {
9469    fn typename() -> &'static str {
9470        "type.googleapis.com/google.cloud.netapp.v1.ListReplicationsResponse"
9471    }
9472}
9473
9474#[doc(hidden)]
9475impl gax::paginator::internal::PageableResponse for ListReplicationsResponse {
9476    type PageItem = crate::model::Replication;
9477
9478    fn items(self) -> std::vec::Vec<Self::PageItem> {
9479        self.replications
9480    }
9481
9482    fn next_page_token(&self) -> std::string::String {
9483        use std::clone::Clone;
9484        self.next_page_token.clone()
9485    }
9486}
9487
9488/// GetReplicationRequest gets the state of a replication.
9489#[derive(Clone, Default, PartialEq)]
9490#[non_exhaustive]
9491pub struct GetReplicationRequest {
9492    /// Required. The replication resource name, in the format
9493    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}`
9494    pub name: std::string::String,
9495
9496    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9497}
9498
9499impl GetReplicationRequest {
9500    pub fn new() -> Self {
9501        std::default::Default::default()
9502    }
9503
9504    /// Sets the value of [name][crate::model::GetReplicationRequest::name].
9505    ///
9506    /// # Example
9507    /// ```ignore,no_run
9508    /// # use google_cloud_netapp_v1::model::GetReplicationRequest;
9509    /// let x = GetReplicationRequest::new().set_name("example");
9510    /// ```
9511    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9512        self.name = v.into();
9513        self
9514    }
9515}
9516
9517impl wkt::message::Message for GetReplicationRequest {
9518    fn typename() -> &'static str {
9519        "type.googleapis.com/google.cloud.netapp.v1.GetReplicationRequest"
9520    }
9521}
9522
9523/// DestinationVolumeParameters specify input parameters used for creating
9524/// destination volume.
9525#[derive(Clone, Default, PartialEq)]
9526#[non_exhaustive]
9527pub struct DestinationVolumeParameters {
9528    /// Required. Existing destination StoragePool name.
9529    pub storage_pool: std::string::String,
9530
9531    /// Desired destination volume resource id. If not specified, source volume's
9532    /// resource id will be used.
9533    /// This value must start with a lowercase letter followed by up to 62
9534    /// lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
9535    pub volume_id: std::string::String,
9536
9537    /// Destination volume's share name. If not specified, source volume's share
9538    /// name will be used.
9539    pub share_name: std::string::String,
9540
9541    /// Description for the destination volume.
9542    pub description: std::option::Option<std::string::String>,
9543
9544    /// Optional. Tiering policy for the volume.
9545    pub tiering_policy: std::option::Option<crate::model::TieringPolicy>,
9546
9547    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9548}
9549
9550impl DestinationVolumeParameters {
9551    pub fn new() -> Self {
9552        std::default::Default::default()
9553    }
9554
9555    /// Sets the value of [storage_pool][crate::model::DestinationVolumeParameters::storage_pool].
9556    ///
9557    /// # Example
9558    /// ```ignore,no_run
9559    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
9560    /// let x = DestinationVolumeParameters::new().set_storage_pool("example");
9561    /// ```
9562    pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9563        self.storage_pool = v.into();
9564        self
9565    }
9566
9567    /// Sets the value of [volume_id][crate::model::DestinationVolumeParameters::volume_id].
9568    ///
9569    /// # Example
9570    /// ```ignore,no_run
9571    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
9572    /// let x = DestinationVolumeParameters::new().set_volume_id("example");
9573    /// ```
9574    pub fn set_volume_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9575        self.volume_id = v.into();
9576        self
9577    }
9578
9579    /// Sets the value of [share_name][crate::model::DestinationVolumeParameters::share_name].
9580    ///
9581    /// # Example
9582    /// ```ignore,no_run
9583    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
9584    /// let x = DestinationVolumeParameters::new().set_share_name("example");
9585    /// ```
9586    pub fn set_share_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9587        self.share_name = v.into();
9588        self
9589    }
9590
9591    /// Sets the value of [description][crate::model::DestinationVolumeParameters::description].
9592    ///
9593    /// # Example
9594    /// ```ignore,no_run
9595    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
9596    /// let x = DestinationVolumeParameters::new().set_description("example");
9597    /// ```
9598    pub fn set_description<T>(mut self, v: T) -> Self
9599    where
9600        T: std::convert::Into<std::string::String>,
9601    {
9602        self.description = std::option::Option::Some(v.into());
9603        self
9604    }
9605
9606    /// Sets or clears the value of [description][crate::model::DestinationVolumeParameters::description].
9607    ///
9608    /// # Example
9609    /// ```ignore,no_run
9610    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
9611    /// let x = DestinationVolumeParameters::new().set_or_clear_description(Some("example"));
9612    /// let x = DestinationVolumeParameters::new().set_or_clear_description(None::<String>);
9613    /// ```
9614    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
9615    where
9616        T: std::convert::Into<std::string::String>,
9617    {
9618        self.description = v.map(|x| x.into());
9619        self
9620    }
9621
9622    /// Sets the value of [tiering_policy][crate::model::DestinationVolumeParameters::tiering_policy].
9623    ///
9624    /// # Example
9625    /// ```ignore,no_run
9626    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
9627    /// use google_cloud_netapp_v1::model::TieringPolicy;
9628    /// let x = DestinationVolumeParameters::new().set_tiering_policy(TieringPolicy::default()/* use setters */);
9629    /// ```
9630    pub fn set_tiering_policy<T>(mut self, v: T) -> Self
9631    where
9632        T: std::convert::Into<crate::model::TieringPolicy>,
9633    {
9634        self.tiering_policy = std::option::Option::Some(v.into());
9635        self
9636    }
9637
9638    /// Sets or clears the value of [tiering_policy][crate::model::DestinationVolumeParameters::tiering_policy].
9639    ///
9640    /// # Example
9641    /// ```ignore,no_run
9642    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
9643    /// use google_cloud_netapp_v1::model::TieringPolicy;
9644    /// let x = DestinationVolumeParameters::new().set_or_clear_tiering_policy(Some(TieringPolicy::default()/* use setters */));
9645    /// let x = DestinationVolumeParameters::new().set_or_clear_tiering_policy(None::<TieringPolicy>);
9646    /// ```
9647    pub fn set_or_clear_tiering_policy<T>(mut self, v: std::option::Option<T>) -> Self
9648    where
9649        T: std::convert::Into<crate::model::TieringPolicy>,
9650    {
9651        self.tiering_policy = v.map(|x| x.into());
9652        self
9653    }
9654}
9655
9656impl wkt::message::Message for DestinationVolumeParameters {
9657    fn typename() -> &'static str {
9658        "type.googleapis.com/google.cloud.netapp.v1.DestinationVolumeParameters"
9659    }
9660}
9661
9662/// CreateReplicationRequest creates a replication.
9663#[derive(Clone, Default, PartialEq)]
9664#[non_exhaustive]
9665pub struct CreateReplicationRequest {
9666    /// Required. The NetApp volume to create the replications of, in the format
9667    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
9668    pub parent: std::string::String,
9669
9670    /// Required. A replication resource
9671    pub replication: std::option::Option<crate::model::Replication>,
9672
9673    /// Required. ID of the replication to create. Must be unique within the parent
9674    /// resource. Must contain only letters, numbers and hyphen, with the first
9675    /// character a letter, the last a letter or a
9676    /// number, and a 63 character maximum.
9677    pub replication_id: std::string::String,
9678
9679    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9680}
9681
9682impl CreateReplicationRequest {
9683    pub fn new() -> Self {
9684        std::default::Default::default()
9685    }
9686
9687    /// Sets the value of [parent][crate::model::CreateReplicationRequest::parent].
9688    ///
9689    /// # Example
9690    /// ```ignore,no_run
9691    /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
9692    /// let x = CreateReplicationRequest::new().set_parent("example");
9693    /// ```
9694    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9695        self.parent = v.into();
9696        self
9697    }
9698
9699    /// Sets the value of [replication][crate::model::CreateReplicationRequest::replication].
9700    ///
9701    /// # Example
9702    /// ```ignore,no_run
9703    /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
9704    /// use google_cloud_netapp_v1::model::Replication;
9705    /// let x = CreateReplicationRequest::new().set_replication(Replication::default()/* use setters */);
9706    /// ```
9707    pub fn set_replication<T>(mut self, v: T) -> Self
9708    where
9709        T: std::convert::Into<crate::model::Replication>,
9710    {
9711        self.replication = std::option::Option::Some(v.into());
9712        self
9713    }
9714
9715    /// Sets or clears the value of [replication][crate::model::CreateReplicationRequest::replication].
9716    ///
9717    /// # Example
9718    /// ```ignore,no_run
9719    /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
9720    /// use google_cloud_netapp_v1::model::Replication;
9721    /// let x = CreateReplicationRequest::new().set_or_clear_replication(Some(Replication::default()/* use setters */));
9722    /// let x = CreateReplicationRequest::new().set_or_clear_replication(None::<Replication>);
9723    /// ```
9724    pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
9725    where
9726        T: std::convert::Into<crate::model::Replication>,
9727    {
9728        self.replication = v.map(|x| x.into());
9729        self
9730    }
9731
9732    /// Sets the value of [replication_id][crate::model::CreateReplicationRequest::replication_id].
9733    ///
9734    /// # Example
9735    /// ```ignore,no_run
9736    /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
9737    /// let x = CreateReplicationRequest::new().set_replication_id("example");
9738    /// ```
9739    pub fn set_replication_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9740        self.replication_id = v.into();
9741        self
9742    }
9743}
9744
9745impl wkt::message::Message for CreateReplicationRequest {
9746    fn typename() -> &'static str {
9747        "type.googleapis.com/google.cloud.netapp.v1.CreateReplicationRequest"
9748    }
9749}
9750
9751/// DeleteReplicationRequest deletes a replication.
9752#[derive(Clone, Default, PartialEq)]
9753#[non_exhaustive]
9754pub struct DeleteReplicationRequest {
9755    /// Required. The replication resource name, in the format
9756    /// `projects/*/locations/*/volumes/*/replications/{replication_id}`
9757    pub name: std::string::String,
9758
9759    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9760}
9761
9762impl DeleteReplicationRequest {
9763    pub fn new() -> Self {
9764        std::default::Default::default()
9765    }
9766
9767    /// Sets the value of [name][crate::model::DeleteReplicationRequest::name].
9768    ///
9769    /// # Example
9770    /// ```ignore,no_run
9771    /// # use google_cloud_netapp_v1::model::DeleteReplicationRequest;
9772    /// let x = DeleteReplicationRequest::new().set_name("example");
9773    /// ```
9774    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9775        self.name = v.into();
9776        self
9777    }
9778}
9779
9780impl wkt::message::Message for DeleteReplicationRequest {
9781    fn typename() -> &'static str {
9782        "type.googleapis.com/google.cloud.netapp.v1.DeleteReplicationRequest"
9783    }
9784}
9785
9786/// UpdateReplicationRequest updates description and/or labels for a replication.
9787#[derive(Clone, Default, PartialEq)]
9788#[non_exhaustive]
9789pub struct UpdateReplicationRequest {
9790    /// Required. Mask of fields to update.  At least one path must be supplied in
9791    /// this field.
9792    pub update_mask: std::option::Option<wkt::FieldMask>,
9793
9794    /// Required. A replication resource
9795    pub replication: std::option::Option<crate::model::Replication>,
9796
9797    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9798}
9799
9800impl UpdateReplicationRequest {
9801    pub fn new() -> Self {
9802        std::default::Default::default()
9803    }
9804
9805    /// Sets the value of [update_mask][crate::model::UpdateReplicationRequest::update_mask].
9806    ///
9807    /// # Example
9808    /// ```ignore,no_run
9809    /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
9810    /// use wkt::FieldMask;
9811    /// let x = UpdateReplicationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
9812    /// ```
9813    pub fn set_update_mask<T>(mut self, v: T) -> Self
9814    where
9815        T: std::convert::Into<wkt::FieldMask>,
9816    {
9817        self.update_mask = std::option::Option::Some(v.into());
9818        self
9819    }
9820
9821    /// Sets or clears the value of [update_mask][crate::model::UpdateReplicationRequest::update_mask].
9822    ///
9823    /// # Example
9824    /// ```ignore,no_run
9825    /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
9826    /// use wkt::FieldMask;
9827    /// let x = UpdateReplicationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
9828    /// let x = UpdateReplicationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
9829    /// ```
9830    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9831    where
9832        T: std::convert::Into<wkt::FieldMask>,
9833    {
9834        self.update_mask = v.map(|x| x.into());
9835        self
9836    }
9837
9838    /// Sets the value of [replication][crate::model::UpdateReplicationRequest::replication].
9839    ///
9840    /// # Example
9841    /// ```ignore,no_run
9842    /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
9843    /// use google_cloud_netapp_v1::model::Replication;
9844    /// let x = UpdateReplicationRequest::new().set_replication(Replication::default()/* use setters */);
9845    /// ```
9846    pub fn set_replication<T>(mut self, v: T) -> Self
9847    where
9848        T: std::convert::Into<crate::model::Replication>,
9849    {
9850        self.replication = std::option::Option::Some(v.into());
9851        self
9852    }
9853
9854    /// Sets or clears the value of [replication][crate::model::UpdateReplicationRequest::replication].
9855    ///
9856    /// # Example
9857    /// ```ignore,no_run
9858    /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
9859    /// use google_cloud_netapp_v1::model::Replication;
9860    /// let x = UpdateReplicationRequest::new().set_or_clear_replication(Some(Replication::default()/* use setters */));
9861    /// let x = UpdateReplicationRequest::new().set_or_clear_replication(None::<Replication>);
9862    /// ```
9863    pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
9864    where
9865        T: std::convert::Into<crate::model::Replication>,
9866    {
9867        self.replication = v.map(|x| x.into());
9868        self
9869    }
9870}
9871
9872impl wkt::message::Message for UpdateReplicationRequest {
9873    fn typename() -> &'static str {
9874        "type.googleapis.com/google.cloud.netapp.v1.UpdateReplicationRequest"
9875    }
9876}
9877
9878/// StopReplicationRequest stops a replication until resumed.
9879#[derive(Clone, Default, PartialEq)]
9880#[non_exhaustive]
9881pub struct StopReplicationRequest {
9882    /// Required. The resource name of the replication, in the format of
9883    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
9884    pub name: std::string::String,
9885
9886    /// Indicates whether to stop replication forcefully while data transfer is in
9887    /// progress.
9888    /// Warning! if force is true, this will abort any current transfers
9889    /// and can lead to data loss due to partial transfer.
9890    /// If force is false, stop replication will fail while data transfer is in
9891    /// progress and you will need to retry later.
9892    pub force: bool,
9893
9894    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9895}
9896
9897impl StopReplicationRequest {
9898    pub fn new() -> Self {
9899        std::default::Default::default()
9900    }
9901
9902    /// Sets the value of [name][crate::model::StopReplicationRequest::name].
9903    ///
9904    /// # Example
9905    /// ```ignore,no_run
9906    /// # use google_cloud_netapp_v1::model::StopReplicationRequest;
9907    /// let x = StopReplicationRequest::new().set_name("example");
9908    /// ```
9909    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9910        self.name = v.into();
9911        self
9912    }
9913
9914    /// Sets the value of [force][crate::model::StopReplicationRequest::force].
9915    ///
9916    /// # Example
9917    /// ```ignore,no_run
9918    /// # use google_cloud_netapp_v1::model::StopReplicationRequest;
9919    /// let x = StopReplicationRequest::new().set_force(true);
9920    /// ```
9921    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9922        self.force = v.into();
9923        self
9924    }
9925}
9926
9927impl wkt::message::Message for StopReplicationRequest {
9928    fn typename() -> &'static str {
9929        "type.googleapis.com/google.cloud.netapp.v1.StopReplicationRequest"
9930    }
9931}
9932
9933/// ResumeReplicationRequest resumes a stopped replication.
9934#[derive(Clone, Default, PartialEq)]
9935#[non_exhaustive]
9936pub struct ResumeReplicationRequest {
9937    /// Required. The resource name of the replication, in the format of
9938    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
9939    pub name: std::string::String,
9940
9941    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9942}
9943
9944impl ResumeReplicationRequest {
9945    pub fn new() -> Self {
9946        std::default::Default::default()
9947    }
9948
9949    /// Sets the value of [name][crate::model::ResumeReplicationRequest::name].
9950    ///
9951    /// # Example
9952    /// ```ignore,no_run
9953    /// # use google_cloud_netapp_v1::model::ResumeReplicationRequest;
9954    /// let x = ResumeReplicationRequest::new().set_name("example");
9955    /// ```
9956    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9957        self.name = v.into();
9958        self
9959    }
9960}
9961
9962impl wkt::message::Message for ResumeReplicationRequest {
9963    fn typename() -> &'static str {
9964        "type.googleapis.com/google.cloud.netapp.v1.ResumeReplicationRequest"
9965    }
9966}
9967
9968/// ReverseReplicationDirectionRequest reverses direction of replication. Source
9969/// becomes destination and destination becomes source.
9970#[derive(Clone, Default, PartialEq)]
9971#[non_exhaustive]
9972pub struct ReverseReplicationDirectionRequest {
9973    /// Required. The resource name of the replication, in the format of
9974    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
9975    pub name: std::string::String,
9976
9977    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9978}
9979
9980impl ReverseReplicationDirectionRequest {
9981    pub fn new() -> Self {
9982        std::default::Default::default()
9983    }
9984
9985    /// Sets the value of [name][crate::model::ReverseReplicationDirectionRequest::name].
9986    ///
9987    /// # Example
9988    /// ```ignore,no_run
9989    /// # use google_cloud_netapp_v1::model::ReverseReplicationDirectionRequest;
9990    /// let x = ReverseReplicationDirectionRequest::new().set_name("example");
9991    /// ```
9992    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9993        self.name = v.into();
9994        self
9995    }
9996}
9997
9998impl wkt::message::Message for ReverseReplicationDirectionRequest {
9999    fn typename() -> &'static str {
10000        "type.googleapis.com/google.cloud.netapp.v1.ReverseReplicationDirectionRequest"
10001    }
10002}
10003
10004/// EstablishPeeringRequest establishes cluster and svm peerings between the
10005/// source and the destination replications.
10006#[derive(Clone, Default, PartialEq)]
10007#[non_exhaustive]
10008pub struct EstablishPeeringRequest {
10009    /// Required. The resource name of the replication, in the format of
10010    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10011    pub name: std::string::String,
10012
10013    /// Required. Name of the user's local source cluster to be peered with the
10014    /// destination cluster.
10015    pub peer_cluster_name: std::string::String,
10016
10017    /// Required. Name of the user's local source vserver svm to be peered with the
10018    /// destination vserver svm.
10019    pub peer_svm_name: std::string::String,
10020
10021    /// Optional. List of IPv4 ip addresses to be used for peering.
10022    pub peer_ip_addresses: std::vec::Vec<std::string::String>,
10023
10024    /// Required. Name of the user's local source volume to be peered with the
10025    /// destination volume.
10026    pub peer_volume_name: std::string::String,
10027
10028    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10029}
10030
10031impl EstablishPeeringRequest {
10032    pub fn new() -> Self {
10033        std::default::Default::default()
10034    }
10035
10036    /// Sets the value of [name][crate::model::EstablishPeeringRequest::name].
10037    ///
10038    /// # Example
10039    /// ```ignore,no_run
10040    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10041    /// let x = EstablishPeeringRequest::new().set_name("example");
10042    /// ```
10043    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10044        self.name = v.into();
10045        self
10046    }
10047
10048    /// Sets the value of [peer_cluster_name][crate::model::EstablishPeeringRequest::peer_cluster_name].
10049    ///
10050    /// # Example
10051    /// ```ignore,no_run
10052    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10053    /// let x = EstablishPeeringRequest::new().set_peer_cluster_name("example");
10054    /// ```
10055    pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
10056        mut self,
10057        v: T,
10058    ) -> Self {
10059        self.peer_cluster_name = v.into();
10060        self
10061    }
10062
10063    /// Sets the value of [peer_svm_name][crate::model::EstablishPeeringRequest::peer_svm_name].
10064    ///
10065    /// # Example
10066    /// ```ignore,no_run
10067    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10068    /// let x = EstablishPeeringRequest::new().set_peer_svm_name("example");
10069    /// ```
10070    pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10071        self.peer_svm_name = v.into();
10072        self
10073    }
10074
10075    /// Sets the value of [peer_ip_addresses][crate::model::EstablishPeeringRequest::peer_ip_addresses].
10076    ///
10077    /// # Example
10078    /// ```ignore,no_run
10079    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10080    /// let x = EstablishPeeringRequest::new().set_peer_ip_addresses(["a", "b", "c"]);
10081    /// ```
10082    pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
10083    where
10084        T: std::iter::IntoIterator<Item = V>,
10085        V: std::convert::Into<std::string::String>,
10086    {
10087        use std::iter::Iterator;
10088        self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
10089        self
10090    }
10091
10092    /// Sets the value of [peer_volume_name][crate::model::EstablishPeeringRequest::peer_volume_name].
10093    ///
10094    /// # Example
10095    /// ```ignore,no_run
10096    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10097    /// let x = EstablishPeeringRequest::new().set_peer_volume_name("example");
10098    /// ```
10099    pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
10100        mut self,
10101        v: T,
10102    ) -> Self {
10103        self.peer_volume_name = v.into();
10104        self
10105    }
10106}
10107
10108impl wkt::message::Message for EstablishPeeringRequest {
10109    fn typename() -> &'static str {
10110        "type.googleapis.com/google.cloud.netapp.v1.EstablishPeeringRequest"
10111    }
10112}
10113
10114/// SyncReplicationRequest syncs the replication from source to destination.
10115#[derive(Clone, Default, PartialEq)]
10116#[non_exhaustive]
10117pub struct SyncReplicationRequest {
10118    /// Required. The resource name of the replication, in the format of
10119    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10120    pub name: std::string::String,
10121
10122    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10123}
10124
10125impl SyncReplicationRequest {
10126    pub fn new() -> Self {
10127        std::default::Default::default()
10128    }
10129
10130    /// Sets the value of [name][crate::model::SyncReplicationRequest::name].
10131    ///
10132    /// # Example
10133    /// ```ignore,no_run
10134    /// # use google_cloud_netapp_v1::model::SyncReplicationRequest;
10135    /// let x = SyncReplicationRequest::new().set_name("example");
10136    /// ```
10137    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10138        self.name = v.into();
10139        self
10140    }
10141}
10142
10143impl wkt::message::Message for SyncReplicationRequest {
10144    fn typename() -> &'static str {
10145        "type.googleapis.com/google.cloud.netapp.v1.SyncReplicationRequest"
10146    }
10147}
10148
10149/// ListSnapshotsRequest lists snapshots.
10150#[derive(Clone, Default, PartialEq)]
10151#[non_exhaustive]
10152pub struct ListSnapshotsRequest {
10153    /// Required. The volume for which to retrieve snapshot information,
10154    /// in the format
10155    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`.
10156    pub parent: std::string::String,
10157
10158    /// The maximum number of items to return.
10159    pub page_size: i32,
10160
10161    /// The next_page_token value to use if there are additional
10162    /// results to retrieve for this list request.
10163    pub page_token: std::string::String,
10164
10165    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
10166    pub order_by: std::string::String,
10167
10168    /// List filter.
10169    pub filter: std::string::String,
10170
10171    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10172}
10173
10174impl ListSnapshotsRequest {
10175    pub fn new() -> Self {
10176        std::default::Default::default()
10177    }
10178
10179    /// Sets the value of [parent][crate::model::ListSnapshotsRequest::parent].
10180    ///
10181    /// # Example
10182    /// ```ignore,no_run
10183    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10184    /// let x = ListSnapshotsRequest::new().set_parent("example");
10185    /// ```
10186    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10187        self.parent = v.into();
10188        self
10189    }
10190
10191    /// Sets the value of [page_size][crate::model::ListSnapshotsRequest::page_size].
10192    ///
10193    /// # Example
10194    /// ```ignore,no_run
10195    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10196    /// let x = ListSnapshotsRequest::new().set_page_size(42);
10197    /// ```
10198    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10199        self.page_size = v.into();
10200        self
10201    }
10202
10203    /// Sets the value of [page_token][crate::model::ListSnapshotsRequest::page_token].
10204    ///
10205    /// # Example
10206    /// ```ignore,no_run
10207    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10208    /// let x = ListSnapshotsRequest::new().set_page_token("example");
10209    /// ```
10210    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10211        self.page_token = v.into();
10212        self
10213    }
10214
10215    /// Sets the value of [order_by][crate::model::ListSnapshotsRequest::order_by].
10216    ///
10217    /// # Example
10218    /// ```ignore,no_run
10219    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10220    /// let x = ListSnapshotsRequest::new().set_order_by("example");
10221    /// ```
10222    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10223        self.order_by = v.into();
10224        self
10225    }
10226
10227    /// Sets the value of [filter][crate::model::ListSnapshotsRequest::filter].
10228    ///
10229    /// # Example
10230    /// ```ignore,no_run
10231    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10232    /// let x = ListSnapshotsRequest::new().set_filter("example");
10233    /// ```
10234    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10235        self.filter = v.into();
10236        self
10237    }
10238}
10239
10240impl wkt::message::Message for ListSnapshotsRequest {
10241    fn typename() -> &'static str {
10242        "type.googleapis.com/google.cloud.netapp.v1.ListSnapshotsRequest"
10243    }
10244}
10245
10246/// ListSnapshotsResponse is the result of ListSnapshotsRequest.
10247#[derive(Clone, Default, PartialEq)]
10248#[non_exhaustive]
10249pub struct ListSnapshotsResponse {
10250    /// A list of snapshots in the project for the specified volume.
10251    pub snapshots: std::vec::Vec<crate::model::Snapshot>,
10252
10253    /// The token you can use to retrieve the next page of results. Not returned
10254    /// if there are no more results in the list.
10255    pub next_page_token: std::string::String,
10256
10257    /// Locations that could not be reached.
10258    pub unreachable: std::vec::Vec<std::string::String>,
10259
10260    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10261}
10262
10263impl ListSnapshotsResponse {
10264    pub fn new() -> Self {
10265        std::default::Default::default()
10266    }
10267
10268    /// Sets the value of [snapshots][crate::model::ListSnapshotsResponse::snapshots].
10269    ///
10270    /// # Example
10271    /// ```ignore,no_run
10272    /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
10273    /// use google_cloud_netapp_v1::model::Snapshot;
10274    /// let x = ListSnapshotsResponse::new()
10275    ///     .set_snapshots([
10276    ///         Snapshot::default()/* use setters */,
10277    ///         Snapshot::default()/* use (different) setters */,
10278    ///     ]);
10279    /// ```
10280    pub fn set_snapshots<T, V>(mut self, v: T) -> Self
10281    where
10282        T: std::iter::IntoIterator<Item = V>,
10283        V: std::convert::Into<crate::model::Snapshot>,
10284    {
10285        use std::iter::Iterator;
10286        self.snapshots = v.into_iter().map(|i| i.into()).collect();
10287        self
10288    }
10289
10290    /// Sets the value of [next_page_token][crate::model::ListSnapshotsResponse::next_page_token].
10291    ///
10292    /// # Example
10293    /// ```ignore,no_run
10294    /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
10295    /// let x = ListSnapshotsResponse::new().set_next_page_token("example");
10296    /// ```
10297    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10298        self.next_page_token = v.into();
10299        self
10300    }
10301
10302    /// Sets the value of [unreachable][crate::model::ListSnapshotsResponse::unreachable].
10303    ///
10304    /// # Example
10305    /// ```ignore,no_run
10306    /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
10307    /// let x = ListSnapshotsResponse::new().set_unreachable(["a", "b", "c"]);
10308    /// ```
10309    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10310    where
10311        T: std::iter::IntoIterator<Item = V>,
10312        V: std::convert::Into<std::string::String>,
10313    {
10314        use std::iter::Iterator;
10315        self.unreachable = v.into_iter().map(|i| i.into()).collect();
10316        self
10317    }
10318}
10319
10320impl wkt::message::Message for ListSnapshotsResponse {
10321    fn typename() -> &'static str {
10322        "type.googleapis.com/google.cloud.netapp.v1.ListSnapshotsResponse"
10323    }
10324}
10325
10326#[doc(hidden)]
10327impl gax::paginator::internal::PageableResponse for ListSnapshotsResponse {
10328    type PageItem = crate::model::Snapshot;
10329
10330    fn items(self) -> std::vec::Vec<Self::PageItem> {
10331        self.snapshots
10332    }
10333
10334    fn next_page_token(&self) -> std::string::String {
10335        use std::clone::Clone;
10336        self.next_page_token.clone()
10337    }
10338}
10339
10340/// GetSnapshotRequest gets the state of a snapshot.
10341#[derive(Clone, Default, PartialEq)]
10342#[non_exhaustive]
10343pub struct GetSnapshotRequest {
10344    /// Required. The snapshot resource name, in the format
10345    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`
10346    pub name: std::string::String,
10347
10348    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10349}
10350
10351impl GetSnapshotRequest {
10352    pub fn new() -> Self {
10353        std::default::Default::default()
10354    }
10355
10356    /// Sets the value of [name][crate::model::GetSnapshotRequest::name].
10357    ///
10358    /// # Example
10359    /// ```ignore,no_run
10360    /// # use google_cloud_netapp_v1::model::GetSnapshotRequest;
10361    /// let x = GetSnapshotRequest::new().set_name("example");
10362    /// ```
10363    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10364        self.name = v.into();
10365        self
10366    }
10367}
10368
10369impl wkt::message::Message for GetSnapshotRequest {
10370    fn typename() -> &'static str {
10371        "type.googleapis.com/google.cloud.netapp.v1.GetSnapshotRequest"
10372    }
10373}
10374
10375/// CreateSnapshotRequest creates a snapshot.
10376#[derive(Clone, Default, PartialEq)]
10377#[non_exhaustive]
10378pub struct CreateSnapshotRequest {
10379    /// Required. The NetApp volume to create the snapshots of, in the format
10380    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
10381    pub parent: std::string::String,
10382
10383    /// Required. A snapshot resource
10384    pub snapshot: std::option::Option<crate::model::Snapshot>,
10385
10386    /// Required. ID of the snapshot to create. Must be unique within the parent
10387    /// resource. Must contain only letters, numbers and hyphen, with the first
10388    /// character a letter, the last a letter or a
10389    /// number, and a 63 character maximum.
10390    pub snapshot_id: std::string::String,
10391
10392    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10393}
10394
10395impl CreateSnapshotRequest {
10396    pub fn new() -> Self {
10397        std::default::Default::default()
10398    }
10399
10400    /// Sets the value of [parent][crate::model::CreateSnapshotRequest::parent].
10401    ///
10402    /// # Example
10403    /// ```ignore,no_run
10404    /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
10405    /// let x = CreateSnapshotRequest::new().set_parent("example");
10406    /// ```
10407    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10408        self.parent = v.into();
10409        self
10410    }
10411
10412    /// Sets the value of [snapshot][crate::model::CreateSnapshotRequest::snapshot].
10413    ///
10414    /// # Example
10415    /// ```ignore,no_run
10416    /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
10417    /// use google_cloud_netapp_v1::model::Snapshot;
10418    /// let x = CreateSnapshotRequest::new().set_snapshot(Snapshot::default()/* use setters */);
10419    /// ```
10420    pub fn set_snapshot<T>(mut self, v: T) -> Self
10421    where
10422        T: std::convert::Into<crate::model::Snapshot>,
10423    {
10424        self.snapshot = std::option::Option::Some(v.into());
10425        self
10426    }
10427
10428    /// Sets or clears the value of [snapshot][crate::model::CreateSnapshotRequest::snapshot].
10429    ///
10430    /// # Example
10431    /// ```ignore,no_run
10432    /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
10433    /// use google_cloud_netapp_v1::model::Snapshot;
10434    /// let x = CreateSnapshotRequest::new().set_or_clear_snapshot(Some(Snapshot::default()/* use setters */));
10435    /// let x = CreateSnapshotRequest::new().set_or_clear_snapshot(None::<Snapshot>);
10436    /// ```
10437    pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
10438    where
10439        T: std::convert::Into<crate::model::Snapshot>,
10440    {
10441        self.snapshot = v.map(|x| x.into());
10442        self
10443    }
10444
10445    /// Sets the value of [snapshot_id][crate::model::CreateSnapshotRequest::snapshot_id].
10446    ///
10447    /// # Example
10448    /// ```ignore,no_run
10449    /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
10450    /// let x = CreateSnapshotRequest::new().set_snapshot_id("example");
10451    /// ```
10452    pub fn set_snapshot_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10453        self.snapshot_id = v.into();
10454        self
10455    }
10456}
10457
10458impl wkt::message::Message for CreateSnapshotRequest {
10459    fn typename() -> &'static str {
10460        "type.googleapis.com/google.cloud.netapp.v1.CreateSnapshotRequest"
10461    }
10462}
10463
10464/// DeleteSnapshotRequest deletes a snapshot.
10465#[derive(Clone, Default, PartialEq)]
10466#[non_exhaustive]
10467pub struct DeleteSnapshotRequest {
10468    /// Required. The snapshot resource name, in the format
10469    /// `projects/*/locations/*/volumes/*/snapshots/{snapshot_id}`
10470    pub name: std::string::String,
10471
10472    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10473}
10474
10475impl DeleteSnapshotRequest {
10476    pub fn new() -> Self {
10477        std::default::Default::default()
10478    }
10479
10480    /// Sets the value of [name][crate::model::DeleteSnapshotRequest::name].
10481    ///
10482    /// # Example
10483    /// ```ignore,no_run
10484    /// # use google_cloud_netapp_v1::model::DeleteSnapshotRequest;
10485    /// let x = DeleteSnapshotRequest::new().set_name("example");
10486    /// ```
10487    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10488        self.name = v.into();
10489        self
10490    }
10491}
10492
10493impl wkt::message::Message for DeleteSnapshotRequest {
10494    fn typename() -> &'static str {
10495        "type.googleapis.com/google.cloud.netapp.v1.DeleteSnapshotRequest"
10496    }
10497}
10498
10499/// UpdateSnapshotRequest updates description and/or labels for a snapshot.
10500#[derive(Clone, Default, PartialEq)]
10501#[non_exhaustive]
10502pub struct UpdateSnapshotRequest {
10503    /// Required. Mask of fields to update.  At least one path must be supplied in
10504    /// this field.
10505    pub update_mask: std::option::Option<wkt::FieldMask>,
10506
10507    /// Required. A snapshot resource
10508    pub snapshot: std::option::Option<crate::model::Snapshot>,
10509
10510    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10511}
10512
10513impl UpdateSnapshotRequest {
10514    pub fn new() -> Self {
10515        std::default::Default::default()
10516    }
10517
10518    /// Sets the value of [update_mask][crate::model::UpdateSnapshotRequest::update_mask].
10519    ///
10520    /// # Example
10521    /// ```ignore,no_run
10522    /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
10523    /// use wkt::FieldMask;
10524    /// let x = UpdateSnapshotRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10525    /// ```
10526    pub fn set_update_mask<T>(mut self, v: T) -> Self
10527    where
10528        T: std::convert::Into<wkt::FieldMask>,
10529    {
10530        self.update_mask = std::option::Option::Some(v.into());
10531        self
10532    }
10533
10534    /// Sets or clears the value of [update_mask][crate::model::UpdateSnapshotRequest::update_mask].
10535    ///
10536    /// # Example
10537    /// ```ignore,no_run
10538    /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
10539    /// use wkt::FieldMask;
10540    /// let x = UpdateSnapshotRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10541    /// let x = UpdateSnapshotRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10542    /// ```
10543    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10544    where
10545        T: std::convert::Into<wkt::FieldMask>,
10546    {
10547        self.update_mask = v.map(|x| x.into());
10548        self
10549    }
10550
10551    /// Sets the value of [snapshot][crate::model::UpdateSnapshotRequest::snapshot].
10552    ///
10553    /// # Example
10554    /// ```ignore,no_run
10555    /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
10556    /// use google_cloud_netapp_v1::model::Snapshot;
10557    /// let x = UpdateSnapshotRequest::new().set_snapshot(Snapshot::default()/* use setters */);
10558    /// ```
10559    pub fn set_snapshot<T>(mut self, v: T) -> Self
10560    where
10561        T: std::convert::Into<crate::model::Snapshot>,
10562    {
10563        self.snapshot = std::option::Option::Some(v.into());
10564        self
10565    }
10566
10567    /// Sets or clears the value of [snapshot][crate::model::UpdateSnapshotRequest::snapshot].
10568    ///
10569    /// # Example
10570    /// ```ignore,no_run
10571    /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
10572    /// use google_cloud_netapp_v1::model::Snapshot;
10573    /// let x = UpdateSnapshotRequest::new().set_or_clear_snapshot(Some(Snapshot::default()/* use setters */));
10574    /// let x = UpdateSnapshotRequest::new().set_or_clear_snapshot(None::<Snapshot>);
10575    /// ```
10576    pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
10577    where
10578        T: std::convert::Into<crate::model::Snapshot>,
10579    {
10580        self.snapshot = v.map(|x| x.into());
10581        self
10582    }
10583}
10584
10585impl wkt::message::Message for UpdateSnapshotRequest {
10586    fn typename() -> &'static str {
10587        "type.googleapis.com/google.cloud.netapp.v1.UpdateSnapshotRequest"
10588    }
10589}
10590
10591/// Snapshot is a point-in-time version of a Volume's content.
10592#[derive(Clone, Default, PartialEq)]
10593#[non_exhaustive]
10594pub struct Snapshot {
10595    /// Identifier. The resource name of the snapshot.
10596    /// Format:
10597    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`.
10598    pub name: std::string::String,
10599
10600    /// Output only. The snapshot state.
10601    pub state: crate::model::snapshot::State,
10602
10603    /// Output only. State details of the storage pool
10604    pub state_details: std::string::String,
10605
10606    /// A description of the snapshot with 2048 characters or less.
10607    /// Requests with longer descriptions will be rejected.
10608    pub description: std::string::String,
10609
10610    /// Output only. Current storage usage for the snapshot in bytes.
10611    pub used_bytes: f64,
10612
10613    /// Output only. The time when the snapshot was created.
10614    pub create_time: std::option::Option<wkt::Timestamp>,
10615
10616    /// Resource labels to represent user provided metadata.
10617    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
10618
10619    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10620}
10621
10622impl Snapshot {
10623    pub fn new() -> Self {
10624        std::default::Default::default()
10625    }
10626
10627    /// Sets the value of [name][crate::model::Snapshot::name].
10628    ///
10629    /// # Example
10630    /// ```ignore,no_run
10631    /// # use google_cloud_netapp_v1::model::Snapshot;
10632    /// let x = Snapshot::new().set_name("example");
10633    /// ```
10634    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10635        self.name = v.into();
10636        self
10637    }
10638
10639    /// Sets the value of [state][crate::model::Snapshot::state].
10640    ///
10641    /// # Example
10642    /// ```ignore,no_run
10643    /// # use google_cloud_netapp_v1::model::Snapshot;
10644    /// use google_cloud_netapp_v1::model::snapshot::State;
10645    /// let x0 = Snapshot::new().set_state(State::Ready);
10646    /// let x1 = Snapshot::new().set_state(State::Creating);
10647    /// let x2 = Snapshot::new().set_state(State::Deleting);
10648    /// ```
10649    pub fn set_state<T: std::convert::Into<crate::model::snapshot::State>>(mut self, v: T) -> Self {
10650        self.state = v.into();
10651        self
10652    }
10653
10654    /// Sets the value of [state_details][crate::model::Snapshot::state_details].
10655    ///
10656    /// # Example
10657    /// ```ignore,no_run
10658    /// # use google_cloud_netapp_v1::model::Snapshot;
10659    /// let x = Snapshot::new().set_state_details("example");
10660    /// ```
10661    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10662        self.state_details = v.into();
10663        self
10664    }
10665
10666    /// Sets the value of [description][crate::model::Snapshot::description].
10667    ///
10668    /// # Example
10669    /// ```ignore,no_run
10670    /// # use google_cloud_netapp_v1::model::Snapshot;
10671    /// let x = Snapshot::new().set_description("example");
10672    /// ```
10673    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10674        self.description = v.into();
10675        self
10676    }
10677
10678    /// Sets the value of [used_bytes][crate::model::Snapshot::used_bytes].
10679    ///
10680    /// # Example
10681    /// ```ignore,no_run
10682    /// # use google_cloud_netapp_v1::model::Snapshot;
10683    /// let x = Snapshot::new().set_used_bytes(42.0);
10684    /// ```
10685    pub fn set_used_bytes<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
10686        self.used_bytes = v.into();
10687        self
10688    }
10689
10690    /// Sets the value of [create_time][crate::model::Snapshot::create_time].
10691    ///
10692    /// # Example
10693    /// ```ignore,no_run
10694    /// # use google_cloud_netapp_v1::model::Snapshot;
10695    /// use wkt::Timestamp;
10696    /// let x = Snapshot::new().set_create_time(Timestamp::default()/* use setters */);
10697    /// ```
10698    pub fn set_create_time<T>(mut self, v: T) -> Self
10699    where
10700        T: std::convert::Into<wkt::Timestamp>,
10701    {
10702        self.create_time = std::option::Option::Some(v.into());
10703        self
10704    }
10705
10706    /// Sets or clears the value of [create_time][crate::model::Snapshot::create_time].
10707    ///
10708    /// # Example
10709    /// ```ignore,no_run
10710    /// # use google_cloud_netapp_v1::model::Snapshot;
10711    /// use wkt::Timestamp;
10712    /// let x = Snapshot::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10713    /// let x = Snapshot::new().set_or_clear_create_time(None::<Timestamp>);
10714    /// ```
10715    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10716    where
10717        T: std::convert::Into<wkt::Timestamp>,
10718    {
10719        self.create_time = v.map(|x| x.into());
10720        self
10721    }
10722
10723    /// Sets the value of [labels][crate::model::Snapshot::labels].
10724    ///
10725    /// # Example
10726    /// ```ignore,no_run
10727    /// # use google_cloud_netapp_v1::model::Snapshot;
10728    /// let x = Snapshot::new().set_labels([
10729    ///     ("key0", "abc"),
10730    ///     ("key1", "xyz"),
10731    /// ]);
10732    /// ```
10733    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
10734    where
10735        T: std::iter::IntoIterator<Item = (K, V)>,
10736        K: std::convert::Into<std::string::String>,
10737        V: std::convert::Into<std::string::String>,
10738    {
10739        use std::iter::Iterator;
10740        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10741        self
10742    }
10743}
10744
10745impl wkt::message::Message for Snapshot {
10746    fn typename() -> &'static str {
10747        "type.googleapis.com/google.cloud.netapp.v1.Snapshot"
10748    }
10749}
10750
10751/// Defines additional types related to [Snapshot].
10752pub mod snapshot {
10753    #[allow(unused_imports)]
10754    use super::*;
10755
10756    /// The Snapshot States
10757    ///
10758    /// # Working with unknown values
10759    ///
10760    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10761    /// additional enum variants at any time. Adding new variants is not considered
10762    /// a breaking change. Applications should write their code in anticipation of:
10763    ///
10764    /// - New values appearing in future releases of the client library, **and**
10765    /// - New values received dynamically, without application changes.
10766    ///
10767    /// Please consult the [Working with enums] section in the user guide for some
10768    /// guidelines.
10769    ///
10770    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10771    #[derive(Clone, Debug, PartialEq)]
10772    #[non_exhaustive]
10773    pub enum State {
10774        /// Unspecified Snapshot State
10775        Unspecified,
10776        /// Snapshot State is Ready
10777        Ready,
10778        /// Snapshot State is Creating
10779        Creating,
10780        /// Snapshot State is Deleting
10781        Deleting,
10782        /// Snapshot State is Updating
10783        Updating,
10784        /// Snapshot State is Disabled
10785        Disabled,
10786        /// Snapshot State is Error
10787        Error,
10788        /// If set, the enum was initialized with an unknown value.
10789        ///
10790        /// Applications can examine the value using [State::value] or
10791        /// [State::name].
10792        UnknownValue(state::UnknownValue),
10793    }
10794
10795    #[doc(hidden)]
10796    pub mod state {
10797        #[allow(unused_imports)]
10798        use super::*;
10799        #[derive(Clone, Debug, PartialEq)]
10800        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10801    }
10802
10803    impl State {
10804        /// Gets the enum value.
10805        ///
10806        /// Returns `None` if the enum contains an unknown value deserialized from
10807        /// the string representation of enums.
10808        pub fn value(&self) -> std::option::Option<i32> {
10809            match self {
10810                Self::Unspecified => std::option::Option::Some(0),
10811                Self::Ready => std::option::Option::Some(1),
10812                Self::Creating => std::option::Option::Some(2),
10813                Self::Deleting => std::option::Option::Some(3),
10814                Self::Updating => std::option::Option::Some(4),
10815                Self::Disabled => std::option::Option::Some(5),
10816                Self::Error => std::option::Option::Some(6),
10817                Self::UnknownValue(u) => u.0.value(),
10818            }
10819        }
10820
10821        /// Gets the enum value as a string.
10822        ///
10823        /// Returns `None` if the enum contains an unknown value deserialized from
10824        /// the integer representation of enums.
10825        pub fn name(&self) -> std::option::Option<&str> {
10826            match self {
10827                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10828                Self::Ready => std::option::Option::Some("READY"),
10829                Self::Creating => std::option::Option::Some("CREATING"),
10830                Self::Deleting => std::option::Option::Some("DELETING"),
10831                Self::Updating => std::option::Option::Some("UPDATING"),
10832                Self::Disabled => std::option::Option::Some("DISABLED"),
10833                Self::Error => std::option::Option::Some("ERROR"),
10834                Self::UnknownValue(u) => u.0.name(),
10835            }
10836        }
10837    }
10838
10839    impl std::default::Default for State {
10840        fn default() -> Self {
10841            use std::convert::From;
10842            Self::from(0)
10843        }
10844    }
10845
10846    impl std::fmt::Display for State {
10847        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10848            wkt::internal::display_enum(f, self.name(), self.value())
10849        }
10850    }
10851
10852    impl std::convert::From<i32> for State {
10853        fn from(value: i32) -> Self {
10854            match value {
10855                0 => Self::Unspecified,
10856                1 => Self::Ready,
10857                2 => Self::Creating,
10858                3 => Self::Deleting,
10859                4 => Self::Updating,
10860                5 => Self::Disabled,
10861                6 => Self::Error,
10862                _ => Self::UnknownValue(state::UnknownValue(
10863                    wkt::internal::UnknownEnumValue::Integer(value),
10864                )),
10865            }
10866        }
10867    }
10868
10869    impl std::convert::From<&str> for State {
10870        fn from(value: &str) -> Self {
10871            use std::string::ToString;
10872            match value {
10873                "STATE_UNSPECIFIED" => Self::Unspecified,
10874                "READY" => Self::Ready,
10875                "CREATING" => Self::Creating,
10876                "DELETING" => Self::Deleting,
10877                "UPDATING" => Self::Updating,
10878                "DISABLED" => Self::Disabled,
10879                "ERROR" => Self::Error,
10880                _ => Self::UnknownValue(state::UnknownValue(
10881                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10882                )),
10883            }
10884        }
10885    }
10886
10887    impl serde::ser::Serialize for State {
10888        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10889        where
10890            S: serde::Serializer,
10891        {
10892            match self {
10893                Self::Unspecified => serializer.serialize_i32(0),
10894                Self::Ready => serializer.serialize_i32(1),
10895                Self::Creating => serializer.serialize_i32(2),
10896                Self::Deleting => serializer.serialize_i32(3),
10897                Self::Updating => serializer.serialize_i32(4),
10898                Self::Disabled => serializer.serialize_i32(5),
10899                Self::Error => serializer.serialize_i32(6),
10900                Self::UnknownValue(u) => u.0.serialize(serializer),
10901            }
10902        }
10903    }
10904
10905    impl<'de> serde::de::Deserialize<'de> for State {
10906        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10907        where
10908            D: serde::Deserializer<'de>,
10909        {
10910            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10911                ".google.cloud.netapp.v1.Snapshot.State",
10912            ))
10913        }
10914    }
10915}
10916
10917/// GetStoragePoolRequest gets a Storage Pool.
10918#[derive(Clone, Default, PartialEq)]
10919#[non_exhaustive]
10920pub struct GetStoragePoolRequest {
10921    /// Required. Name of the storage pool
10922    pub name: std::string::String,
10923
10924    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10925}
10926
10927impl GetStoragePoolRequest {
10928    pub fn new() -> Self {
10929        std::default::Default::default()
10930    }
10931
10932    /// Sets the value of [name][crate::model::GetStoragePoolRequest::name].
10933    ///
10934    /// # Example
10935    /// ```ignore,no_run
10936    /// # use google_cloud_netapp_v1::model::GetStoragePoolRequest;
10937    /// let x = GetStoragePoolRequest::new().set_name("example");
10938    /// ```
10939    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10940        self.name = v.into();
10941        self
10942    }
10943}
10944
10945impl wkt::message::Message for GetStoragePoolRequest {
10946    fn typename() -> &'static str {
10947        "type.googleapis.com/google.cloud.netapp.v1.GetStoragePoolRequest"
10948    }
10949}
10950
10951/// ListStoragePoolsRequest lists Storage Pools.
10952#[derive(Clone, Default, PartialEq)]
10953#[non_exhaustive]
10954pub struct ListStoragePoolsRequest {
10955    /// Required. Parent value
10956    pub parent: std::string::String,
10957
10958    /// Optional. The maximum number of items to return.
10959    pub page_size: i32,
10960
10961    /// Optional. The next_page_token value to use if there are additional
10962    /// results to retrieve for this list request.
10963    pub page_token: std::string::String,
10964
10965    /// Optional. Sort results. Supported values are "name", "name desc" or ""
10966    /// (unsorted).
10967    pub order_by: std::string::String,
10968
10969    /// Optional. List filter.
10970    pub filter: std::string::String,
10971
10972    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10973}
10974
10975impl ListStoragePoolsRequest {
10976    pub fn new() -> Self {
10977        std::default::Default::default()
10978    }
10979
10980    /// Sets the value of [parent][crate::model::ListStoragePoolsRequest::parent].
10981    ///
10982    /// # Example
10983    /// ```ignore,no_run
10984    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
10985    /// let x = ListStoragePoolsRequest::new().set_parent("example");
10986    /// ```
10987    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10988        self.parent = v.into();
10989        self
10990    }
10991
10992    /// Sets the value of [page_size][crate::model::ListStoragePoolsRequest::page_size].
10993    ///
10994    /// # Example
10995    /// ```ignore,no_run
10996    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
10997    /// let x = ListStoragePoolsRequest::new().set_page_size(42);
10998    /// ```
10999    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11000        self.page_size = v.into();
11001        self
11002    }
11003
11004    /// Sets the value of [page_token][crate::model::ListStoragePoolsRequest::page_token].
11005    ///
11006    /// # Example
11007    /// ```ignore,no_run
11008    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11009    /// let x = ListStoragePoolsRequest::new().set_page_token("example");
11010    /// ```
11011    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11012        self.page_token = v.into();
11013        self
11014    }
11015
11016    /// Sets the value of [order_by][crate::model::ListStoragePoolsRequest::order_by].
11017    ///
11018    /// # Example
11019    /// ```ignore,no_run
11020    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11021    /// let x = ListStoragePoolsRequest::new().set_order_by("example");
11022    /// ```
11023    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11024        self.order_by = v.into();
11025        self
11026    }
11027
11028    /// Sets the value of [filter][crate::model::ListStoragePoolsRequest::filter].
11029    ///
11030    /// # Example
11031    /// ```ignore,no_run
11032    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11033    /// let x = ListStoragePoolsRequest::new().set_filter("example");
11034    /// ```
11035    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11036        self.filter = v.into();
11037        self
11038    }
11039}
11040
11041impl wkt::message::Message for ListStoragePoolsRequest {
11042    fn typename() -> &'static str {
11043        "type.googleapis.com/google.cloud.netapp.v1.ListStoragePoolsRequest"
11044    }
11045}
11046
11047/// ListStoragePoolsResponse is the response to a ListStoragePoolsRequest.
11048#[derive(Clone, Default, PartialEq)]
11049#[non_exhaustive]
11050pub struct ListStoragePoolsResponse {
11051    /// The list of StoragePools
11052    pub storage_pools: std::vec::Vec<crate::model::StoragePool>,
11053
11054    /// A token identifying a page of results the server should return.
11055    pub next_page_token: std::string::String,
11056
11057    /// Locations that could not be reached.
11058    pub unreachable: std::vec::Vec<std::string::String>,
11059
11060    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11061}
11062
11063impl ListStoragePoolsResponse {
11064    pub fn new() -> Self {
11065        std::default::Default::default()
11066    }
11067
11068    /// Sets the value of [storage_pools][crate::model::ListStoragePoolsResponse::storage_pools].
11069    ///
11070    /// # Example
11071    /// ```ignore,no_run
11072    /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
11073    /// use google_cloud_netapp_v1::model::StoragePool;
11074    /// let x = ListStoragePoolsResponse::new()
11075    ///     .set_storage_pools([
11076    ///         StoragePool::default()/* use setters */,
11077    ///         StoragePool::default()/* use (different) setters */,
11078    ///     ]);
11079    /// ```
11080    pub fn set_storage_pools<T, V>(mut self, v: T) -> Self
11081    where
11082        T: std::iter::IntoIterator<Item = V>,
11083        V: std::convert::Into<crate::model::StoragePool>,
11084    {
11085        use std::iter::Iterator;
11086        self.storage_pools = v.into_iter().map(|i| i.into()).collect();
11087        self
11088    }
11089
11090    /// Sets the value of [next_page_token][crate::model::ListStoragePoolsResponse::next_page_token].
11091    ///
11092    /// # Example
11093    /// ```ignore,no_run
11094    /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
11095    /// let x = ListStoragePoolsResponse::new().set_next_page_token("example");
11096    /// ```
11097    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11098        self.next_page_token = v.into();
11099        self
11100    }
11101
11102    /// Sets the value of [unreachable][crate::model::ListStoragePoolsResponse::unreachable].
11103    ///
11104    /// # Example
11105    /// ```ignore,no_run
11106    /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
11107    /// let x = ListStoragePoolsResponse::new().set_unreachable(["a", "b", "c"]);
11108    /// ```
11109    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11110    where
11111        T: std::iter::IntoIterator<Item = V>,
11112        V: std::convert::Into<std::string::String>,
11113    {
11114        use std::iter::Iterator;
11115        self.unreachable = v.into_iter().map(|i| i.into()).collect();
11116        self
11117    }
11118}
11119
11120impl wkt::message::Message for ListStoragePoolsResponse {
11121    fn typename() -> &'static str {
11122        "type.googleapis.com/google.cloud.netapp.v1.ListStoragePoolsResponse"
11123    }
11124}
11125
11126#[doc(hidden)]
11127impl gax::paginator::internal::PageableResponse for ListStoragePoolsResponse {
11128    type PageItem = crate::model::StoragePool;
11129
11130    fn items(self) -> std::vec::Vec<Self::PageItem> {
11131        self.storage_pools
11132    }
11133
11134    fn next_page_token(&self) -> std::string::String {
11135        use std::clone::Clone;
11136        self.next_page_token.clone()
11137    }
11138}
11139
11140/// CreateStoragePoolRequest creates a Storage Pool.
11141#[derive(Clone, Default, PartialEq)]
11142#[non_exhaustive]
11143pub struct CreateStoragePoolRequest {
11144    /// Required. Value for parent.
11145    pub parent: std::string::String,
11146
11147    /// Required. Id of the requesting storage pool. Must be unique within the
11148    /// parent resource. Must contain only letters, numbers and hyphen, with the
11149    /// first character a letter, the last a letter or a number, and a 63 character
11150    /// maximum.
11151    pub storage_pool_id: std::string::String,
11152
11153    /// Required. The required parameters to create a new storage pool.
11154    pub storage_pool: std::option::Option<crate::model::StoragePool>,
11155
11156    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11157}
11158
11159impl CreateStoragePoolRequest {
11160    pub fn new() -> Self {
11161        std::default::Default::default()
11162    }
11163
11164    /// Sets the value of [parent][crate::model::CreateStoragePoolRequest::parent].
11165    ///
11166    /// # Example
11167    /// ```ignore,no_run
11168    /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11169    /// let x = CreateStoragePoolRequest::new().set_parent("example");
11170    /// ```
11171    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11172        self.parent = v.into();
11173        self
11174    }
11175
11176    /// Sets the value of [storage_pool_id][crate::model::CreateStoragePoolRequest::storage_pool_id].
11177    ///
11178    /// # Example
11179    /// ```ignore,no_run
11180    /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11181    /// let x = CreateStoragePoolRequest::new().set_storage_pool_id("example");
11182    /// ```
11183    pub fn set_storage_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11184        self.storage_pool_id = v.into();
11185        self
11186    }
11187
11188    /// Sets the value of [storage_pool][crate::model::CreateStoragePoolRequest::storage_pool].
11189    ///
11190    /// # Example
11191    /// ```ignore,no_run
11192    /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11193    /// use google_cloud_netapp_v1::model::StoragePool;
11194    /// let x = CreateStoragePoolRequest::new().set_storage_pool(StoragePool::default()/* use setters */);
11195    /// ```
11196    pub fn set_storage_pool<T>(mut self, v: T) -> Self
11197    where
11198        T: std::convert::Into<crate::model::StoragePool>,
11199    {
11200        self.storage_pool = std::option::Option::Some(v.into());
11201        self
11202    }
11203
11204    /// Sets or clears the value of [storage_pool][crate::model::CreateStoragePoolRequest::storage_pool].
11205    ///
11206    /// # Example
11207    /// ```ignore,no_run
11208    /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11209    /// use google_cloud_netapp_v1::model::StoragePool;
11210    /// let x = CreateStoragePoolRequest::new().set_or_clear_storage_pool(Some(StoragePool::default()/* use setters */));
11211    /// let x = CreateStoragePoolRequest::new().set_or_clear_storage_pool(None::<StoragePool>);
11212    /// ```
11213    pub fn set_or_clear_storage_pool<T>(mut self, v: std::option::Option<T>) -> Self
11214    where
11215        T: std::convert::Into<crate::model::StoragePool>,
11216    {
11217        self.storage_pool = v.map(|x| x.into());
11218        self
11219    }
11220}
11221
11222impl wkt::message::Message for CreateStoragePoolRequest {
11223    fn typename() -> &'static str {
11224        "type.googleapis.com/google.cloud.netapp.v1.CreateStoragePoolRequest"
11225    }
11226}
11227
11228/// UpdateStoragePoolRequest updates a Storage Pool.
11229#[derive(Clone, Default, PartialEq)]
11230#[non_exhaustive]
11231pub struct UpdateStoragePoolRequest {
11232    /// Required. Field mask is used to specify the fields to be overwritten in the
11233    /// StoragePool resource by the update.
11234    /// The fields specified in the update_mask are relative to the resource, not
11235    /// the full request. A field will be overwritten if it is in the mask. If the
11236    /// user does not provide a mask then all fields will be overwritten.
11237    pub update_mask: std::option::Option<wkt::FieldMask>,
11238
11239    /// Required. The pool being updated
11240    pub storage_pool: std::option::Option<crate::model::StoragePool>,
11241
11242    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11243}
11244
11245impl UpdateStoragePoolRequest {
11246    pub fn new() -> Self {
11247        std::default::Default::default()
11248    }
11249
11250    /// Sets the value of [update_mask][crate::model::UpdateStoragePoolRequest::update_mask].
11251    ///
11252    /// # Example
11253    /// ```ignore,no_run
11254    /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
11255    /// use wkt::FieldMask;
11256    /// let x = UpdateStoragePoolRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11257    /// ```
11258    pub fn set_update_mask<T>(mut self, v: T) -> Self
11259    where
11260        T: std::convert::Into<wkt::FieldMask>,
11261    {
11262        self.update_mask = std::option::Option::Some(v.into());
11263        self
11264    }
11265
11266    /// Sets or clears the value of [update_mask][crate::model::UpdateStoragePoolRequest::update_mask].
11267    ///
11268    /// # Example
11269    /// ```ignore,no_run
11270    /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
11271    /// use wkt::FieldMask;
11272    /// let x = UpdateStoragePoolRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11273    /// let x = UpdateStoragePoolRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11274    /// ```
11275    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11276    where
11277        T: std::convert::Into<wkt::FieldMask>,
11278    {
11279        self.update_mask = v.map(|x| x.into());
11280        self
11281    }
11282
11283    /// Sets the value of [storage_pool][crate::model::UpdateStoragePoolRequest::storage_pool].
11284    ///
11285    /// # Example
11286    /// ```ignore,no_run
11287    /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
11288    /// use google_cloud_netapp_v1::model::StoragePool;
11289    /// let x = UpdateStoragePoolRequest::new().set_storage_pool(StoragePool::default()/* use setters */);
11290    /// ```
11291    pub fn set_storage_pool<T>(mut self, v: T) -> Self
11292    where
11293        T: std::convert::Into<crate::model::StoragePool>,
11294    {
11295        self.storage_pool = std::option::Option::Some(v.into());
11296        self
11297    }
11298
11299    /// Sets or clears the value of [storage_pool][crate::model::UpdateStoragePoolRequest::storage_pool].
11300    ///
11301    /// # Example
11302    /// ```ignore,no_run
11303    /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
11304    /// use google_cloud_netapp_v1::model::StoragePool;
11305    /// let x = UpdateStoragePoolRequest::new().set_or_clear_storage_pool(Some(StoragePool::default()/* use setters */));
11306    /// let x = UpdateStoragePoolRequest::new().set_or_clear_storage_pool(None::<StoragePool>);
11307    /// ```
11308    pub fn set_or_clear_storage_pool<T>(mut self, v: std::option::Option<T>) -> Self
11309    where
11310        T: std::convert::Into<crate::model::StoragePool>,
11311    {
11312        self.storage_pool = v.map(|x| x.into());
11313        self
11314    }
11315}
11316
11317impl wkt::message::Message for UpdateStoragePoolRequest {
11318    fn typename() -> &'static str {
11319        "type.googleapis.com/google.cloud.netapp.v1.UpdateStoragePoolRequest"
11320    }
11321}
11322
11323/// DeleteStoragePoolRequest deletes a Storage Pool.
11324#[derive(Clone, Default, PartialEq)]
11325#[non_exhaustive]
11326pub struct DeleteStoragePoolRequest {
11327    /// Required. Name of the storage pool
11328    pub name: std::string::String,
11329
11330    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11331}
11332
11333impl DeleteStoragePoolRequest {
11334    pub fn new() -> Self {
11335        std::default::Default::default()
11336    }
11337
11338    /// Sets the value of [name][crate::model::DeleteStoragePoolRequest::name].
11339    ///
11340    /// # Example
11341    /// ```ignore,no_run
11342    /// # use google_cloud_netapp_v1::model::DeleteStoragePoolRequest;
11343    /// let x = DeleteStoragePoolRequest::new().set_name("example");
11344    /// ```
11345    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11346        self.name = v.into();
11347        self
11348    }
11349}
11350
11351impl wkt::message::Message for DeleteStoragePoolRequest {
11352    fn typename() -> &'static str {
11353        "type.googleapis.com/google.cloud.netapp.v1.DeleteStoragePoolRequest"
11354    }
11355}
11356
11357/// SwitchActiveReplicaZoneRequest switch the active/replica zone for a regional
11358/// storagePool.
11359#[derive(Clone, Default, PartialEq)]
11360#[non_exhaustive]
11361pub struct SwitchActiveReplicaZoneRequest {
11362    /// Required. Name of the storage pool
11363    pub name: std::string::String,
11364
11365    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11366}
11367
11368impl SwitchActiveReplicaZoneRequest {
11369    pub fn new() -> Self {
11370        std::default::Default::default()
11371    }
11372
11373    /// Sets the value of [name][crate::model::SwitchActiveReplicaZoneRequest::name].
11374    ///
11375    /// # Example
11376    /// ```ignore,no_run
11377    /// # use google_cloud_netapp_v1::model::SwitchActiveReplicaZoneRequest;
11378    /// let x = SwitchActiveReplicaZoneRequest::new().set_name("example");
11379    /// ```
11380    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11381        self.name = v.into();
11382        self
11383    }
11384}
11385
11386impl wkt::message::Message for SwitchActiveReplicaZoneRequest {
11387    fn typename() -> &'static str {
11388        "type.googleapis.com/google.cloud.netapp.v1.SwitchActiveReplicaZoneRequest"
11389    }
11390}
11391
11392/// StoragePool is a container for volumes with a service level and capacity.
11393/// Volumes can be created in a pool of sufficient available capacity.
11394/// StoragePool capacity is what you are billed for.
11395#[derive(Clone, Default, PartialEq)]
11396#[non_exhaustive]
11397pub struct StoragePool {
11398    /// Identifier. Name of the storage pool
11399    pub name: std::string::String,
11400
11401    /// Required. Service level of the storage pool
11402    pub service_level: crate::model::ServiceLevel,
11403
11404    /// Required. Capacity in GIB of the pool
11405    pub capacity_gib: i64,
11406
11407    /// Output only. Allocated size of all volumes in GIB in the storage pool
11408    pub volume_capacity_gib: i64,
11409
11410    /// Output only. Volume count of the storage pool
11411    pub volume_count: i32,
11412
11413    /// Output only. State of the storage pool
11414    pub state: crate::model::storage_pool::State,
11415
11416    /// Output only. State details of the storage pool
11417    pub state_details: std::string::String,
11418
11419    /// Output only. Create time of the storage pool
11420    pub create_time: std::option::Option<wkt::Timestamp>,
11421
11422    /// Optional. Description of the storage pool
11423    pub description: std::string::String,
11424
11425    /// Optional. Labels as key value pairs
11426    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11427
11428    /// Required. VPC Network name.
11429    /// Format: projects/{project}/global/networks/{network}
11430    pub network: std::string::String,
11431
11432    /// Optional. Specifies the Active Directory to be used for creating a SMB
11433    /// volume.
11434    pub active_directory: std::string::String,
11435
11436    /// Optional. Specifies the KMS config to be used for volume encryption.
11437    pub kms_config: std::string::String,
11438
11439    /// Optional. Flag indicating if the pool is NFS LDAP enabled or not.
11440    pub ldap_enabled: bool,
11441
11442    /// Optional. This field is not implemented. The values provided in this field
11443    /// are ignored.
11444    pub psa_range: std::string::String,
11445
11446    /// Output only. Specifies the current pool encryption key source.
11447    pub encryption_type: crate::model::EncryptionType,
11448
11449    /// Deprecated. Used to allow SO pool to access AD or DNS server from other
11450    /// regions.
11451    #[deprecated]
11452    pub global_access_allowed: std::option::Option<bool>,
11453
11454    /// Optional. True if the storage pool supports Auto Tiering enabled volumes.
11455    /// Default is false. Auto-tiering can be enabled after storage pool creation
11456    /// but it can't be disabled once enabled.
11457    pub allow_auto_tiering: bool,
11458
11459    /// Optional. Specifies the replica zone for regional storagePool.
11460    pub replica_zone: std::string::String,
11461
11462    /// Optional. Specifies the active zone for regional storagePool.
11463    pub zone: std::string::String,
11464
11465    /// Output only. Reserved for future use
11466    pub satisfies_pzs: bool,
11467
11468    /// Output only. Reserved for future use
11469    pub satisfies_pzi: bool,
11470
11471    /// Optional. True if using Independent Scaling of capacity and performance
11472    /// (Hyperdisk) By default set to false
11473    pub custom_performance_enabled: bool,
11474
11475    /// Optional. Custom Performance Total Throughput of the pool (in MiBps)
11476    pub total_throughput_mibps: i64,
11477
11478    /// Optional. Custom Performance Total IOPS of the pool
11479    /// if not provided, it will be calculated based on the total_throughput_mibps
11480    pub total_iops: i64,
11481
11482    /// Optional. Total hot tier capacity for the Storage Pool. It is applicable
11483    /// only to Flex service level. It should be less than the minimum storage pool
11484    /// size and cannot be more than the current storage pool size. It cannot be
11485    /// decreased once set.
11486    pub hot_tier_size_gib: i64,
11487
11488    /// Optional. Flag indicating that the hot-tier threshold will be
11489    /// auto-increased by 10% of the hot-tier when it hits 100%. Default is true.
11490    /// The increment will kick in only if the new size after increment is
11491    /// still less than or equal to storage pool size.
11492    pub enable_hot_tier_auto_resize: std::option::Option<bool>,
11493
11494    /// Optional. QoS (Quality of Service) Type of the storage pool
11495    pub qos_type: crate::model::QosType,
11496
11497    /// Output only. Available throughput of the storage pool (in MiB/s).
11498    pub available_throughput_mibps: f64,
11499
11500    /// Output only. Total cold tier data rounded down to the nearest GiB used by
11501    /// the storage pool.
11502    pub cold_tier_size_used_gib: i64,
11503
11504    /// Output only. Total hot tier data rounded down to the nearest GiB used by
11505    /// the storage pool.
11506    pub hot_tier_size_used_gib: i64,
11507
11508    /// Optional. Type of the storage pool. This field is used to control whether
11509    /// the pool supports `FILE` based volumes only or `UNIFIED` (both `FILE` and
11510    /// `BLOCK`) volumes or `UNIFIED_LARGE_CAPACITY` (both `FILE` and `BLOCK`)
11511    /// volumes with large capacity. If not specified during creation, it defaults
11512    /// to `FILE`.
11513    pub r#type: std::option::Option<crate::model::StoragePoolType>,
11514
11515    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11516}
11517
11518impl StoragePool {
11519    pub fn new() -> Self {
11520        std::default::Default::default()
11521    }
11522
11523    /// Sets the value of [name][crate::model::StoragePool::name].
11524    ///
11525    /// # Example
11526    /// ```ignore,no_run
11527    /// # use google_cloud_netapp_v1::model::StoragePool;
11528    /// let x = StoragePool::new().set_name("example");
11529    /// ```
11530    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11531        self.name = v.into();
11532        self
11533    }
11534
11535    /// Sets the value of [service_level][crate::model::StoragePool::service_level].
11536    ///
11537    /// # Example
11538    /// ```ignore,no_run
11539    /// # use google_cloud_netapp_v1::model::StoragePool;
11540    /// use google_cloud_netapp_v1::model::ServiceLevel;
11541    /// let x0 = StoragePool::new().set_service_level(ServiceLevel::Premium);
11542    /// let x1 = StoragePool::new().set_service_level(ServiceLevel::Extreme);
11543    /// let x2 = StoragePool::new().set_service_level(ServiceLevel::Standard);
11544    /// ```
11545    pub fn set_service_level<T: std::convert::Into<crate::model::ServiceLevel>>(
11546        mut self,
11547        v: T,
11548    ) -> Self {
11549        self.service_level = v.into();
11550        self
11551    }
11552
11553    /// Sets the value of [capacity_gib][crate::model::StoragePool::capacity_gib].
11554    ///
11555    /// # Example
11556    /// ```ignore,no_run
11557    /// # use google_cloud_netapp_v1::model::StoragePool;
11558    /// let x = StoragePool::new().set_capacity_gib(42);
11559    /// ```
11560    pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11561        self.capacity_gib = v.into();
11562        self
11563    }
11564
11565    /// Sets the value of [volume_capacity_gib][crate::model::StoragePool::volume_capacity_gib].
11566    ///
11567    /// # Example
11568    /// ```ignore,no_run
11569    /// # use google_cloud_netapp_v1::model::StoragePool;
11570    /// let x = StoragePool::new().set_volume_capacity_gib(42);
11571    /// ```
11572    pub fn set_volume_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11573        self.volume_capacity_gib = v.into();
11574        self
11575    }
11576
11577    /// Sets the value of [volume_count][crate::model::StoragePool::volume_count].
11578    ///
11579    /// # Example
11580    /// ```ignore,no_run
11581    /// # use google_cloud_netapp_v1::model::StoragePool;
11582    /// let x = StoragePool::new().set_volume_count(42);
11583    /// ```
11584    pub fn set_volume_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11585        self.volume_count = v.into();
11586        self
11587    }
11588
11589    /// Sets the value of [state][crate::model::StoragePool::state].
11590    ///
11591    /// # Example
11592    /// ```ignore,no_run
11593    /// # use google_cloud_netapp_v1::model::StoragePool;
11594    /// use google_cloud_netapp_v1::model::storage_pool::State;
11595    /// let x0 = StoragePool::new().set_state(State::Ready);
11596    /// let x1 = StoragePool::new().set_state(State::Creating);
11597    /// let x2 = StoragePool::new().set_state(State::Deleting);
11598    /// ```
11599    pub fn set_state<T: std::convert::Into<crate::model::storage_pool::State>>(
11600        mut self,
11601        v: T,
11602    ) -> Self {
11603        self.state = v.into();
11604        self
11605    }
11606
11607    /// Sets the value of [state_details][crate::model::StoragePool::state_details].
11608    ///
11609    /// # Example
11610    /// ```ignore,no_run
11611    /// # use google_cloud_netapp_v1::model::StoragePool;
11612    /// let x = StoragePool::new().set_state_details("example");
11613    /// ```
11614    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11615        self.state_details = v.into();
11616        self
11617    }
11618
11619    /// Sets the value of [create_time][crate::model::StoragePool::create_time].
11620    ///
11621    /// # Example
11622    /// ```ignore,no_run
11623    /// # use google_cloud_netapp_v1::model::StoragePool;
11624    /// use wkt::Timestamp;
11625    /// let x = StoragePool::new().set_create_time(Timestamp::default()/* use setters */);
11626    /// ```
11627    pub fn set_create_time<T>(mut self, v: T) -> Self
11628    where
11629        T: std::convert::Into<wkt::Timestamp>,
11630    {
11631        self.create_time = std::option::Option::Some(v.into());
11632        self
11633    }
11634
11635    /// Sets or clears the value of [create_time][crate::model::StoragePool::create_time].
11636    ///
11637    /// # Example
11638    /// ```ignore,no_run
11639    /// # use google_cloud_netapp_v1::model::StoragePool;
11640    /// use wkt::Timestamp;
11641    /// let x = StoragePool::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11642    /// let x = StoragePool::new().set_or_clear_create_time(None::<Timestamp>);
11643    /// ```
11644    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11645    where
11646        T: std::convert::Into<wkt::Timestamp>,
11647    {
11648        self.create_time = v.map(|x| x.into());
11649        self
11650    }
11651
11652    /// Sets the value of [description][crate::model::StoragePool::description].
11653    ///
11654    /// # Example
11655    /// ```ignore,no_run
11656    /// # use google_cloud_netapp_v1::model::StoragePool;
11657    /// let x = StoragePool::new().set_description("example");
11658    /// ```
11659    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11660        self.description = v.into();
11661        self
11662    }
11663
11664    /// Sets the value of [labels][crate::model::StoragePool::labels].
11665    ///
11666    /// # Example
11667    /// ```ignore,no_run
11668    /// # use google_cloud_netapp_v1::model::StoragePool;
11669    /// let x = StoragePool::new().set_labels([
11670    ///     ("key0", "abc"),
11671    ///     ("key1", "xyz"),
11672    /// ]);
11673    /// ```
11674    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11675    where
11676        T: std::iter::IntoIterator<Item = (K, V)>,
11677        K: std::convert::Into<std::string::String>,
11678        V: std::convert::Into<std::string::String>,
11679    {
11680        use std::iter::Iterator;
11681        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11682        self
11683    }
11684
11685    /// Sets the value of [network][crate::model::StoragePool::network].
11686    ///
11687    /// # Example
11688    /// ```ignore,no_run
11689    /// # use google_cloud_netapp_v1::model::StoragePool;
11690    /// let x = StoragePool::new().set_network("example");
11691    /// ```
11692    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11693        self.network = v.into();
11694        self
11695    }
11696
11697    /// Sets the value of [active_directory][crate::model::StoragePool::active_directory].
11698    ///
11699    /// # Example
11700    /// ```ignore,no_run
11701    /// # use google_cloud_netapp_v1::model::StoragePool;
11702    /// let x = StoragePool::new().set_active_directory("example");
11703    /// ```
11704    pub fn set_active_directory<T: std::convert::Into<std::string::String>>(
11705        mut self,
11706        v: T,
11707    ) -> Self {
11708        self.active_directory = v.into();
11709        self
11710    }
11711
11712    /// Sets the value of [kms_config][crate::model::StoragePool::kms_config].
11713    ///
11714    /// # Example
11715    /// ```ignore,no_run
11716    /// # use google_cloud_netapp_v1::model::StoragePool;
11717    /// let x = StoragePool::new().set_kms_config("example");
11718    /// ```
11719    pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11720        self.kms_config = v.into();
11721        self
11722    }
11723
11724    /// Sets the value of [ldap_enabled][crate::model::StoragePool::ldap_enabled].
11725    ///
11726    /// # Example
11727    /// ```ignore,no_run
11728    /// # use google_cloud_netapp_v1::model::StoragePool;
11729    /// let x = StoragePool::new().set_ldap_enabled(true);
11730    /// ```
11731    pub fn set_ldap_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11732        self.ldap_enabled = v.into();
11733        self
11734    }
11735
11736    /// Sets the value of [psa_range][crate::model::StoragePool::psa_range].
11737    ///
11738    /// # Example
11739    /// ```ignore,no_run
11740    /// # use google_cloud_netapp_v1::model::StoragePool;
11741    /// let x = StoragePool::new().set_psa_range("example");
11742    /// ```
11743    pub fn set_psa_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11744        self.psa_range = v.into();
11745        self
11746    }
11747
11748    /// Sets the value of [encryption_type][crate::model::StoragePool::encryption_type].
11749    ///
11750    /// # Example
11751    /// ```ignore,no_run
11752    /// # use google_cloud_netapp_v1::model::StoragePool;
11753    /// use google_cloud_netapp_v1::model::EncryptionType;
11754    /// let x0 = StoragePool::new().set_encryption_type(EncryptionType::ServiceManaged);
11755    /// let x1 = StoragePool::new().set_encryption_type(EncryptionType::CloudKms);
11756    /// ```
11757    pub fn set_encryption_type<T: std::convert::Into<crate::model::EncryptionType>>(
11758        mut self,
11759        v: T,
11760    ) -> Self {
11761        self.encryption_type = v.into();
11762        self
11763    }
11764
11765    /// Sets the value of [global_access_allowed][crate::model::StoragePool::global_access_allowed].
11766    ///
11767    /// # Example
11768    /// ```ignore,no_run
11769    /// # use google_cloud_netapp_v1::model::StoragePool;
11770    /// let x = StoragePool::new().set_global_access_allowed(true);
11771    /// ```
11772    #[deprecated]
11773    pub fn set_global_access_allowed<T>(mut self, v: T) -> Self
11774    where
11775        T: std::convert::Into<bool>,
11776    {
11777        self.global_access_allowed = std::option::Option::Some(v.into());
11778        self
11779    }
11780
11781    /// Sets or clears the value of [global_access_allowed][crate::model::StoragePool::global_access_allowed].
11782    ///
11783    /// # Example
11784    /// ```ignore,no_run
11785    /// # use google_cloud_netapp_v1::model::StoragePool;
11786    /// let x = StoragePool::new().set_or_clear_global_access_allowed(Some(false));
11787    /// let x = StoragePool::new().set_or_clear_global_access_allowed(None::<bool>);
11788    /// ```
11789    #[deprecated]
11790    pub fn set_or_clear_global_access_allowed<T>(mut self, v: std::option::Option<T>) -> Self
11791    where
11792        T: std::convert::Into<bool>,
11793    {
11794        self.global_access_allowed = v.map(|x| x.into());
11795        self
11796    }
11797
11798    /// Sets the value of [allow_auto_tiering][crate::model::StoragePool::allow_auto_tiering].
11799    ///
11800    /// # Example
11801    /// ```ignore,no_run
11802    /// # use google_cloud_netapp_v1::model::StoragePool;
11803    /// let x = StoragePool::new().set_allow_auto_tiering(true);
11804    /// ```
11805    pub fn set_allow_auto_tiering<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11806        self.allow_auto_tiering = v.into();
11807        self
11808    }
11809
11810    /// Sets the value of [replica_zone][crate::model::StoragePool::replica_zone].
11811    ///
11812    /// # Example
11813    /// ```ignore,no_run
11814    /// # use google_cloud_netapp_v1::model::StoragePool;
11815    /// let x = StoragePool::new().set_replica_zone("example");
11816    /// ```
11817    pub fn set_replica_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11818        self.replica_zone = v.into();
11819        self
11820    }
11821
11822    /// Sets the value of [zone][crate::model::StoragePool::zone].
11823    ///
11824    /// # Example
11825    /// ```ignore,no_run
11826    /// # use google_cloud_netapp_v1::model::StoragePool;
11827    /// let x = StoragePool::new().set_zone("example");
11828    /// ```
11829    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11830        self.zone = v.into();
11831        self
11832    }
11833
11834    /// Sets the value of [satisfies_pzs][crate::model::StoragePool::satisfies_pzs].
11835    ///
11836    /// # Example
11837    /// ```ignore,no_run
11838    /// # use google_cloud_netapp_v1::model::StoragePool;
11839    /// let x = StoragePool::new().set_satisfies_pzs(true);
11840    /// ```
11841    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11842        self.satisfies_pzs = v.into();
11843        self
11844    }
11845
11846    /// Sets the value of [satisfies_pzi][crate::model::StoragePool::satisfies_pzi].
11847    ///
11848    /// # Example
11849    /// ```ignore,no_run
11850    /// # use google_cloud_netapp_v1::model::StoragePool;
11851    /// let x = StoragePool::new().set_satisfies_pzi(true);
11852    /// ```
11853    pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11854        self.satisfies_pzi = v.into();
11855        self
11856    }
11857
11858    /// Sets the value of [custom_performance_enabled][crate::model::StoragePool::custom_performance_enabled].
11859    ///
11860    /// # Example
11861    /// ```ignore,no_run
11862    /// # use google_cloud_netapp_v1::model::StoragePool;
11863    /// let x = StoragePool::new().set_custom_performance_enabled(true);
11864    /// ```
11865    pub fn set_custom_performance_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11866        self.custom_performance_enabled = v.into();
11867        self
11868    }
11869
11870    /// Sets the value of [total_throughput_mibps][crate::model::StoragePool::total_throughput_mibps].
11871    ///
11872    /// # Example
11873    /// ```ignore,no_run
11874    /// # use google_cloud_netapp_v1::model::StoragePool;
11875    /// let x = StoragePool::new().set_total_throughput_mibps(42);
11876    /// ```
11877    pub fn set_total_throughput_mibps<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11878        self.total_throughput_mibps = v.into();
11879        self
11880    }
11881
11882    /// Sets the value of [total_iops][crate::model::StoragePool::total_iops].
11883    ///
11884    /// # Example
11885    /// ```ignore,no_run
11886    /// # use google_cloud_netapp_v1::model::StoragePool;
11887    /// let x = StoragePool::new().set_total_iops(42);
11888    /// ```
11889    pub fn set_total_iops<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11890        self.total_iops = v.into();
11891        self
11892    }
11893
11894    /// Sets the value of [hot_tier_size_gib][crate::model::StoragePool::hot_tier_size_gib].
11895    ///
11896    /// # Example
11897    /// ```ignore,no_run
11898    /// # use google_cloud_netapp_v1::model::StoragePool;
11899    /// let x = StoragePool::new().set_hot_tier_size_gib(42);
11900    /// ```
11901    pub fn set_hot_tier_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11902        self.hot_tier_size_gib = v.into();
11903        self
11904    }
11905
11906    /// Sets the value of [enable_hot_tier_auto_resize][crate::model::StoragePool::enable_hot_tier_auto_resize].
11907    ///
11908    /// # Example
11909    /// ```ignore,no_run
11910    /// # use google_cloud_netapp_v1::model::StoragePool;
11911    /// let x = StoragePool::new().set_enable_hot_tier_auto_resize(true);
11912    /// ```
11913    pub fn set_enable_hot_tier_auto_resize<T>(mut self, v: T) -> Self
11914    where
11915        T: std::convert::Into<bool>,
11916    {
11917        self.enable_hot_tier_auto_resize = std::option::Option::Some(v.into());
11918        self
11919    }
11920
11921    /// Sets or clears the value of [enable_hot_tier_auto_resize][crate::model::StoragePool::enable_hot_tier_auto_resize].
11922    ///
11923    /// # Example
11924    /// ```ignore,no_run
11925    /// # use google_cloud_netapp_v1::model::StoragePool;
11926    /// let x = StoragePool::new().set_or_clear_enable_hot_tier_auto_resize(Some(false));
11927    /// let x = StoragePool::new().set_or_clear_enable_hot_tier_auto_resize(None::<bool>);
11928    /// ```
11929    pub fn set_or_clear_enable_hot_tier_auto_resize<T>(mut self, v: std::option::Option<T>) -> Self
11930    where
11931        T: std::convert::Into<bool>,
11932    {
11933        self.enable_hot_tier_auto_resize = v.map(|x| x.into());
11934        self
11935    }
11936
11937    /// Sets the value of [qos_type][crate::model::StoragePool::qos_type].
11938    ///
11939    /// # Example
11940    /// ```ignore,no_run
11941    /// # use google_cloud_netapp_v1::model::StoragePool;
11942    /// use google_cloud_netapp_v1::model::QosType;
11943    /// let x0 = StoragePool::new().set_qos_type(QosType::Auto);
11944    /// let x1 = StoragePool::new().set_qos_type(QosType::Manual);
11945    /// ```
11946    pub fn set_qos_type<T: std::convert::Into<crate::model::QosType>>(mut self, v: T) -> Self {
11947        self.qos_type = v.into();
11948        self
11949    }
11950
11951    /// Sets the value of [available_throughput_mibps][crate::model::StoragePool::available_throughput_mibps].
11952    ///
11953    /// # Example
11954    /// ```ignore,no_run
11955    /// # use google_cloud_netapp_v1::model::StoragePool;
11956    /// let x = StoragePool::new().set_available_throughput_mibps(42.0);
11957    /// ```
11958    pub fn set_available_throughput_mibps<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11959        self.available_throughput_mibps = v.into();
11960        self
11961    }
11962
11963    /// Sets the value of [cold_tier_size_used_gib][crate::model::StoragePool::cold_tier_size_used_gib].
11964    ///
11965    /// # Example
11966    /// ```ignore,no_run
11967    /// # use google_cloud_netapp_v1::model::StoragePool;
11968    /// let x = StoragePool::new().set_cold_tier_size_used_gib(42);
11969    /// ```
11970    pub fn set_cold_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11971        self.cold_tier_size_used_gib = v.into();
11972        self
11973    }
11974
11975    /// Sets the value of [hot_tier_size_used_gib][crate::model::StoragePool::hot_tier_size_used_gib].
11976    ///
11977    /// # Example
11978    /// ```ignore,no_run
11979    /// # use google_cloud_netapp_v1::model::StoragePool;
11980    /// let x = StoragePool::new().set_hot_tier_size_used_gib(42);
11981    /// ```
11982    pub fn set_hot_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11983        self.hot_tier_size_used_gib = v.into();
11984        self
11985    }
11986
11987    /// Sets the value of [r#type][crate::model::StoragePool::type].
11988    ///
11989    /// # Example
11990    /// ```ignore,no_run
11991    /// # use google_cloud_netapp_v1::model::StoragePool;
11992    /// use google_cloud_netapp_v1::model::StoragePoolType;
11993    /// let x0 = StoragePool::new().set_type(StoragePoolType::File);
11994    /// let x1 = StoragePool::new().set_type(StoragePoolType::Unified);
11995    /// let x2 = StoragePool::new().set_type(StoragePoolType::UnifiedLargeCapacity);
11996    /// ```
11997    pub fn set_type<T>(mut self, v: T) -> Self
11998    where
11999        T: std::convert::Into<crate::model::StoragePoolType>,
12000    {
12001        self.r#type = std::option::Option::Some(v.into());
12002        self
12003    }
12004
12005    /// Sets or clears the value of [r#type][crate::model::StoragePool::type].
12006    ///
12007    /// # Example
12008    /// ```ignore,no_run
12009    /// # use google_cloud_netapp_v1::model::StoragePool;
12010    /// use google_cloud_netapp_v1::model::StoragePoolType;
12011    /// let x0 = StoragePool::new().set_or_clear_type(Some(StoragePoolType::File));
12012    /// let x1 = StoragePool::new().set_or_clear_type(Some(StoragePoolType::Unified));
12013    /// let x2 = StoragePool::new().set_or_clear_type(Some(StoragePoolType::UnifiedLargeCapacity));
12014    /// let x_none = StoragePool::new().set_or_clear_type(None::<StoragePoolType>);
12015    /// ```
12016    pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
12017    where
12018        T: std::convert::Into<crate::model::StoragePoolType>,
12019    {
12020        self.r#type = v.map(|x| x.into());
12021        self
12022    }
12023}
12024
12025impl wkt::message::Message for StoragePool {
12026    fn typename() -> &'static str {
12027        "type.googleapis.com/google.cloud.netapp.v1.StoragePool"
12028    }
12029}
12030
12031/// Defines additional types related to [StoragePool].
12032pub mod storage_pool {
12033    #[allow(unused_imports)]
12034    use super::*;
12035
12036    /// The Storage Pool States
12037    ///
12038    /// # Working with unknown values
12039    ///
12040    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12041    /// additional enum variants at any time. Adding new variants is not considered
12042    /// a breaking change. Applications should write their code in anticipation of:
12043    ///
12044    /// - New values appearing in future releases of the client library, **and**
12045    /// - New values received dynamically, without application changes.
12046    ///
12047    /// Please consult the [Working with enums] section in the user guide for some
12048    /// guidelines.
12049    ///
12050    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12051    #[derive(Clone, Debug, PartialEq)]
12052    #[non_exhaustive]
12053    pub enum State {
12054        /// Unspecified Storage Pool State
12055        Unspecified,
12056        /// Storage Pool State is Ready
12057        Ready,
12058        /// Storage Pool State is Creating
12059        Creating,
12060        /// Storage Pool State is Deleting
12061        Deleting,
12062        /// Storage Pool State is Updating
12063        Updating,
12064        /// Storage Pool State is Restoring
12065        Restoring,
12066        /// Storage Pool State is Disabled
12067        Disabled,
12068        /// Storage Pool State is Error
12069        Error,
12070        /// If set, the enum was initialized with an unknown value.
12071        ///
12072        /// Applications can examine the value using [State::value] or
12073        /// [State::name].
12074        UnknownValue(state::UnknownValue),
12075    }
12076
12077    #[doc(hidden)]
12078    pub mod state {
12079        #[allow(unused_imports)]
12080        use super::*;
12081        #[derive(Clone, Debug, PartialEq)]
12082        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12083    }
12084
12085    impl State {
12086        /// Gets the enum value.
12087        ///
12088        /// Returns `None` if the enum contains an unknown value deserialized from
12089        /// the string representation of enums.
12090        pub fn value(&self) -> std::option::Option<i32> {
12091            match self {
12092                Self::Unspecified => std::option::Option::Some(0),
12093                Self::Ready => std::option::Option::Some(1),
12094                Self::Creating => std::option::Option::Some(2),
12095                Self::Deleting => std::option::Option::Some(3),
12096                Self::Updating => std::option::Option::Some(4),
12097                Self::Restoring => std::option::Option::Some(5),
12098                Self::Disabled => std::option::Option::Some(6),
12099                Self::Error => std::option::Option::Some(7),
12100                Self::UnknownValue(u) => u.0.value(),
12101            }
12102        }
12103
12104        /// Gets the enum value as a string.
12105        ///
12106        /// Returns `None` if the enum contains an unknown value deserialized from
12107        /// the integer representation of enums.
12108        pub fn name(&self) -> std::option::Option<&str> {
12109            match self {
12110                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12111                Self::Ready => std::option::Option::Some("READY"),
12112                Self::Creating => std::option::Option::Some("CREATING"),
12113                Self::Deleting => std::option::Option::Some("DELETING"),
12114                Self::Updating => std::option::Option::Some("UPDATING"),
12115                Self::Restoring => std::option::Option::Some("RESTORING"),
12116                Self::Disabled => std::option::Option::Some("DISABLED"),
12117                Self::Error => std::option::Option::Some("ERROR"),
12118                Self::UnknownValue(u) => u.0.name(),
12119            }
12120        }
12121    }
12122
12123    impl std::default::Default for State {
12124        fn default() -> Self {
12125            use std::convert::From;
12126            Self::from(0)
12127        }
12128    }
12129
12130    impl std::fmt::Display for State {
12131        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12132            wkt::internal::display_enum(f, self.name(), self.value())
12133        }
12134    }
12135
12136    impl std::convert::From<i32> for State {
12137        fn from(value: i32) -> Self {
12138            match value {
12139                0 => Self::Unspecified,
12140                1 => Self::Ready,
12141                2 => Self::Creating,
12142                3 => Self::Deleting,
12143                4 => Self::Updating,
12144                5 => Self::Restoring,
12145                6 => Self::Disabled,
12146                7 => Self::Error,
12147                _ => Self::UnknownValue(state::UnknownValue(
12148                    wkt::internal::UnknownEnumValue::Integer(value),
12149                )),
12150            }
12151        }
12152    }
12153
12154    impl std::convert::From<&str> for State {
12155        fn from(value: &str) -> Self {
12156            use std::string::ToString;
12157            match value {
12158                "STATE_UNSPECIFIED" => Self::Unspecified,
12159                "READY" => Self::Ready,
12160                "CREATING" => Self::Creating,
12161                "DELETING" => Self::Deleting,
12162                "UPDATING" => Self::Updating,
12163                "RESTORING" => Self::Restoring,
12164                "DISABLED" => Self::Disabled,
12165                "ERROR" => Self::Error,
12166                _ => Self::UnknownValue(state::UnknownValue(
12167                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12168                )),
12169            }
12170        }
12171    }
12172
12173    impl serde::ser::Serialize for State {
12174        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12175        where
12176            S: serde::Serializer,
12177        {
12178            match self {
12179                Self::Unspecified => serializer.serialize_i32(0),
12180                Self::Ready => serializer.serialize_i32(1),
12181                Self::Creating => serializer.serialize_i32(2),
12182                Self::Deleting => serializer.serialize_i32(3),
12183                Self::Updating => serializer.serialize_i32(4),
12184                Self::Restoring => serializer.serialize_i32(5),
12185                Self::Disabled => serializer.serialize_i32(6),
12186                Self::Error => serializer.serialize_i32(7),
12187                Self::UnknownValue(u) => u.0.serialize(serializer),
12188            }
12189        }
12190    }
12191
12192    impl<'de> serde::de::Deserialize<'de> for State {
12193        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12194        where
12195            D: serde::Deserializer<'de>,
12196        {
12197            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12198                ".google.cloud.netapp.v1.StoragePool.State",
12199            ))
12200        }
12201    }
12202}
12203
12204/// ValidateDirectoryServiceRequest validates the directory service policy
12205/// attached to the storage pool.
12206#[derive(Clone, Default, PartialEq)]
12207#[non_exhaustive]
12208pub struct ValidateDirectoryServiceRequest {
12209    /// Required. Name of the storage pool
12210    pub name: std::string::String,
12211
12212    /// Type of directory service policy attached to the storage pool.
12213    pub directory_service_type: crate::model::DirectoryServiceType,
12214
12215    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12216}
12217
12218impl ValidateDirectoryServiceRequest {
12219    pub fn new() -> Self {
12220        std::default::Default::default()
12221    }
12222
12223    /// Sets the value of [name][crate::model::ValidateDirectoryServiceRequest::name].
12224    ///
12225    /// # Example
12226    /// ```ignore,no_run
12227    /// # use google_cloud_netapp_v1::model::ValidateDirectoryServiceRequest;
12228    /// let x = ValidateDirectoryServiceRequest::new().set_name("example");
12229    /// ```
12230    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12231        self.name = v.into();
12232        self
12233    }
12234
12235    /// Sets the value of [directory_service_type][crate::model::ValidateDirectoryServiceRequest::directory_service_type].
12236    ///
12237    /// # Example
12238    /// ```ignore,no_run
12239    /// # use google_cloud_netapp_v1::model::ValidateDirectoryServiceRequest;
12240    /// use google_cloud_netapp_v1::model::DirectoryServiceType;
12241    /// let x0 = ValidateDirectoryServiceRequest::new().set_directory_service_type(DirectoryServiceType::ActiveDirectory);
12242    /// ```
12243    pub fn set_directory_service_type<T: std::convert::Into<crate::model::DirectoryServiceType>>(
12244        mut self,
12245        v: T,
12246    ) -> Self {
12247        self.directory_service_type = v.into();
12248        self
12249    }
12250}
12251
12252impl wkt::message::Message for ValidateDirectoryServiceRequest {
12253    fn typename() -> &'static str {
12254        "type.googleapis.com/google.cloud.netapp.v1.ValidateDirectoryServiceRequest"
12255    }
12256}
12257
12258/// Message for requesting list of Volumes
12259#[derive(Clone, Default, PartialEq)]
12260#[non_exhaustive]
12261pub struct ListVolumesRequest {
12262    /// Required. Parent value for ListVolumesRequest
12263    pub parent: std::string::String,
12264
12265    /// Requested page size. Server may return fewer items than requested.
12266    /// If unspecified, the server will pick an appropriate default.
12267    pub page_size: i32,
12268
12269    /// A token identifying a page of results the server should return.
12270    pub page_token: std::string::String,
12271
12272    /// Filtering results
12273    pub filter: std::string::String,
12274
12275    /// Hint for how to order the results
12276    pub order_by: std::string::String,
12277
12278    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12279}
12280
12281impl ListVolumesRequest {
12282    pub fn new() -> Self {
12283        std::default::Default::default()
12284    }
12285
12286    /// Sets the value of [parent][crate::model::ListVolumesRequest::parent].
12287    ///
12288    /// # Example
12289    /// ```ignore,no_run
12290    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12291    /// let x = ListVolumesRequest::new().set_parent("example");
12292    /// ```
12293    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12294        self.parent = v.into();
12295        self
12296    }
12297
12298    /// Sets the value of [page_size][crate::model::ListVolumesRequest::page_size].
12299    ///
12300    /// # Example
12301    /// ```ignore,no_run
12302    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12303    /// let x = ListVolumesRequest::new().set_page_size(42);
12304    /// ```
12305    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12306        self.page_size = v.into();
12307        self
12308    }
12309
12310    /// Sets the value of [page_token][crate::model::ListVolumesRequest::page_token].
12311    ///
12312    /// # Example
12313    /// ```ignore,no_run
12314    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12315    /// let x = ListVolumesRequest::new().set_page_token("example");
12316    /// ```
12317    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12318        self.page_token = v.into();
12319        self
12320    }
12321
12322    /// Sets the value of [filter][crate::model::ListVolumesRequest::filter].
12323    ///
12324    /// # Example
12325    /// ```ignore,no_run
12326    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12327    /// let x = ListVolumesRequest::new().set_filter("example");
12328    /// ```
12329    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12330        self.filter = v.into();
12331        self
12332    }
12333
12334    /// Sets the value of [order_by][crate::model::ListVolumesRequest::order_by].
12335    ///
12336    /// # Example
12337    /// ```ignore,no_run
12338    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12339    /// let x = ListVolumesRequest::new().set_order_by("example");
12340    /// ```
12341    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12342        self.order_by = v.into();
12343        self
12344    }
12345}
12346
12347impl wkt::message::Message for ListVolumesRequest {
12348    fn typename() -> &'static str {
12349        "type.googleapis.com/google.cloud.netapp.v1.ListVolumesRequest"
12350    }
12351}
12352
12353/// Message for response to listing Volumes
12354#[derive(Clone, Default, PartialEq)]
12355#[non_exhaustive]
12356pub struct ListVolumesResponse {
12357    /// The list of Volume
12358    pub volumes: std::vec::Vec<crate::model::Volume>,
12359
12360    /// A token identifying a page of results the server should return.
12361    pub next_page_token: std::string::String,
12362
12363    /// Locations that could not be reached.
12364    pub unreachable: std::vec::Vec<std::string::String>,
12365
12366    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12367}
12368
12369impl ListVolumesResponse {
12370    pub fn new() -> Self {
12371        std::default::Default::default()
12372    }
12373
12374    /// Sets the value of [volumes][crate::model::ListVolumesResponse::volumes].
12375    ///
12376    /// # Example
12377    /// ```ignore,no_run
12378    /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
12379    /// use google_cloud_netapp_v1::model::Volume;
12380    /// let x = ListVolumesResponse::new()
12381    ///     .set_volumes([
12382    ///         Volume::default()/* use setters */,
12383    ///         Volume::default()/* use (different) setters */,
12384    ///     ]);
12385    /// ```
12386    pub fn set_volumes<T, V>(mut self, v: T) -> Self
12387    where
12388        T: std::iter::IntoIterator<Item = V>,
12389        V: std::convert::Into<crate::model::Volume>,
12390    {
12391        use std::iter::Iterator;
12392        self.volumes = v.into_iter().map(|i| i.into()).collect();
12393        self
12394    }
12395
12396    /// Sets the value of [next_page_token][crate::model::ListVolumesResponse::next_page_token].
12397    ///
12398    /// # Example
12399    /// ```ignore,no_run
12400    /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
12401    /// let x = ListVolumesResponse::new().set_next_page_token("example");
12402    /// ```
12403    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12404        self.next_page_token = v.into();
12405        self
12406    }
12407
12408    /// Sets the value of [unreachable][crate::model::ListVolumesResponse::unreachable].
12409    ///
12410    /// # Example
12411    /// ```ignore,no_run
12412    /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
12413    /// let x = ListVolumesResponse::new().set_unreachable(["a", "b", "c"]);
12414    /// ```
12415    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
12416    where
12417        T: std::iter::IntoIterator<Item = V>,
12418        V: std::convert::Into<std::string::String>,
12419    {
12420        use std::iter::Iterator;
12421        self.unreachable = v.into_iter().map(|i| i.into()).collect();
12422        self
12423    }
12424}
12425
12426impl wkt::message::Message for ListVolumesResponse {
12427    fn typename() -> &'static str {
12428        "type.googleapis.com/google.cloud.netapp.v1.ListVolumesResponse"
12429    }
12430}
12431
12432#[doc(hidden)]
12433impl gax::paginator::internal::PageableResponse for ListVolumesResponse {
12434    type PageItem = crate::model::Volume;
12435
12436    fn items(self) -> std::vec::Vec<Self::PageItem> {
12437        self.volumes
12438    }
12439
12440    fn next_page_token(&self) -> std::string::String {
12441        use std::clone::Clone;
12442        self.next_page_token.clone()
12443    }
12444}
12445
12446/// Message for getting a Volume
12447#[derive(Clone, Default, PartialEq)]
12448#[non_exhaustive]
12449pub struct GetVolumeRequest {
12450    /// Required. Name of the volume
12451    pub name: std::string::String,
12452
12453    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12454}
12455
12456impl GetVolumeRequest {
12457    pub fn new() -> Self {
12458        std::default::Default::default()
12459    }
12460
12461    /// Sets the value of [name][crate::model::GetVolumeRequest::name].
12462    ///
12463    /// # Example
12464    /// ```ignore,no_run
12465    /// # use google_cloud_netapp_v1::model::GetVolumeRequest;
12466    /// let x = GetVolumeRequest::new().set_name("example");
12467    /// ```
12468    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12469        self.name = v.into();
12470        self
12471    }
12472}
12473
12474impl wkt::message::Message for GetVolumeRequest {
12475    fn typename() -> &'static str {
12476        "type.googleapis.com/google.cloud.netapp.v1.GetVolumeRequest"
12477    }
12478}
12479
12480/// Message for creating a Volume
12481#[derive(Clone, Default, PartialEq)]
12482#[non_exhaustive]
12483pub struct CreateVolumeRequest {
12484    /// Required. Value for parent.
12485    pub parent: std::string::String,
12486
12487    /// Required. Id of the requesting volume. Must be unique within the parent
12488    /// resource. Must contain only letters, numbers and hyphen, with the first
12489    /// character a letter, the last a letter or a number,
12490    /// and a 63 character maximum.
12491    pub volume_id: std::string::String,
12492
12493    /// Required. The volume being created.
12494    pub volume: std::option::Option<crate::model::Volume>,
12495
12496    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12497}
12498
12499impl CreateVolumeRequest {
12500    pub fn new() -> Self {
12501        std::default::Default::default()
12502    }
12503
12504    /// Sets the value of [parent][crate::model::CreateVolumeRequest::parent].
12505    ///
12506    /// # Example
12507    /// ```ignore,no_run
12508    /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
12509    /// let x = CreateVolumeRequest::new().set_parent("example");
12510    /// ```
12511    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12512        self.parent = v.into();
12513        self
12514    }
12515
12516    /// Sets the value of [volume_id][crate::model::CreateVolumeRequest::volume_id].
12517    ///
12518    /// # Example
12519    /// ```ignore,no_run
12520    /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
12521    /// let x = CreateVolumeRequest::new().set_volume_id("example");
12522    /// ```
12523    pub fn set_volume_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12524        self.volume_id = v.into();
12525        self
12526    }
12527
12528    /// Sets the value of [volume][crate::model::CreateVolumeRequest::volume].
12529    ///
12530    /// # Example
12531    /// ```ignore,no_run
12532    /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
12533    /// use google_cloud_netapp_v1::model::Volume;
12534    /// let x = CreateVolumeRequest::new().set_volume(Volume::default()/* use setters */);
12535    /// ```
12536    pub fn set_volume<T>(mut self, v: T) -> Self
12537    where
12538        T: std::convert::Into<crate::model::Volume>,
12539    {
12540        self.volume = std::option::Option::Some(v.into());
12541        self
12542    }
12543
12544    /// Sets or clears the value of [volume][crate::model::CreateVolumeRequest::volume].
12545    ///
12546    /// # Example
12547    /// ```ignore,no_run
12548    /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
12549    /// use google_cloud_netapp_v1::model::Volume;
12550    /// let x = CreateVolumeRequest::new().set_or_clear_volume(Some(Volume::default()/* use setters */));
12551    /// let x = CreateVolumeRequest::new().set_or_clear_volume(None::<Volume>);
12552    /// ```
12553    pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
12554    where
12555        T: std::convert::Into<crate::model::Volume>,
12556    {
12557        self.volume = v.map(|x| x.into());
12558        self
12559    }
12560}
12561
12562impl wkt::message::Message for CreateVolumeRequest {
12563    fn typename() -> &'static str {
12564        "type.googleapis.com/google.cloud.netapp.v1.CreateVolumeRequest"
12565    }
12566}
12567
12568/// Message for updating a Volume
12569#[derive(Clone, Default, PartialEq)]
12570#[non_exhaustive]
12571pub struct UpdateVolumeRequest {
12572    /// Required. Field mask is used to specify the fields to be overwritten in the
12573    /// Volume resource by the update.
12574    /// The fields specified in the update_mask are relative to the resource, not
12575    /// the full request. A field will be overwritten if it is in the mask. If the
12576    /// user does not provide a mask then all fields will be overwritten.
12577    pub update_mask: std::option::Option<wkt::FieldMask>,
12578
12579    /// Required. The volume being updated
12580    pub volume: std::option::Option<crate::model::Volume>,
12581
12582    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12583}
12584
12585impl UpdateVolumeRequest {
12586    pub fn new() -> Self {
12587        std::default::Default::default()
12588    }
12589
12590    /// Sets the value of [update_mask][crate::model::UpdateVolumeRequest::update_mask].
12591    ///
12592    /// # Example
12593    /// ```ignore,no_run
12594    /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
12595    /// use wkt::FieldMask;
12596    /// let x = UpdateVolumeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
12597    /// ```
12598    pub fn set_update_mask<T>(mut self, v: T) -> Self
12599    where
12600        T: std::convert::Into<wkt::FieldMask>,
12601    {
12602        self.update_mask = std::option::Option::Some(v.into());
12603        self
12604    }
12605
12606    /// Sets or clears the value of [update_mask][crate::model::UpdateVolumeRequest::update_mask].
12607    ///
12608    /// # Example
12609    /// ```ignore,no_run
12610    /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
12611    /// use wkt::FieldMask;
12612    /// let x = UpdateVolumeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
12613    /// let x = UpdateVolumeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
12614    /// ```
12615    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12616    where
12617        T: std::convert::Into<wkt::FieldMask>,
12618    {
12619        self.update_mask = v.map(|x| x.into());
12620        self
12621    }
12622
12623    /// Sets the value of [volume][crate::model::UpdateVolumeRequest::volume].
12624    ///
12625    /// # Example
12626    /// ```ignore,no_run
12627    /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
12628    /// use google_cloud_netapp_v1::model::Volume;
12629    /// let x = UpdateVolumeRequest::new().set_volume(Volume::default()/* use setters */);
12630    /// ```
12631    pub fn set_volume<T>(mut self, v: T) -> Self
12632    where
12633        T: std::convert::Into<crate::model::Volume>,
12634    {
12635        self.volume = std::option::Option::Some(v.into());
12636        self
12637    }
12638
12639    /// Sets or clears the value of [volume][crate::model::UpdateVolumeRequest::volume].
12640    ///
12641    /// # Example
12642    /// ```ignore,no_run
12643    /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
12644    /// use google_cloud_netapp_v1::model::Volume;
12645    /// let x = UpdateVolumeRequest::new().set_or_clear_volume(Some(Volume::default()/* use setters */));
12646    /// let x = UpdateVolumeRequest::new().set_or_clear_volume(None::<Volume>);
12647    /// ```
12648    pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
12649    where
12650        T: std::convert::Into<crate::model::Volume>,
12651    {
12652        self.volume = v.map(|x| x.into());
12653        self
12654    }
12655}
12656
12657impl wkt::message::Message for UpdateVolumeRequest {
12658    fn typename() -> &'static str {
12659        "type.googleapis.com/google.cloud.netapp.v1.UpdateVolumeRequest"
12660    }
12661}
12662
12663/// Message for deleting a Volume
12664#[derive(Clone, Default, PartialEq)]
12665#[non_exhaustive]
12666pub struct DeleteVolumeRequest {
12667    /// Required. Name of the volume
12668    pub name: std::string::String,
12669
12670    /// If this field is set as true, CCFE will not block the volume resource
12671    /// deletion even if it has any snapshots resource. (Otherwise, the request
12672    /// will only work if the volume has no snapshots.)
12673    pub force: bool,
12674
12675    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12676}
12677
12678impl DeleteVolumeRequest {
12679    pub fn new() -> Self {
12680        std::default::Default::default()
12681    }
12682
12683    /// Sets the value of [name][crate::model::DeleteVolumeRequest::name].
12684    ///
12685    /// # Example
12686    /// ```ignore,no_run
12687    /// # use google_cloud_netapp_v1::model::DeleteVolumeRequest;
12688    /// let x = DeleteVolumeRequest::new().set_name("example");
12689    /// ```
12690    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12691        self.name = v.into();
12692        self
12693    }
12694
12695    /// Sets the value of [force][crate::model::DeleteVolumeRequest::force].
12696    ///
12697    /// # Example
12698    /// ```ignore,no_run
12699    /// # use google_cloud_netapp_v1::model::DeleteVolumeRequest;
12700    /// let x = DeleteVolumeRequest::new().set_force(true);
12701    /// ```
12702    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12703        self.force = v.into();
12704        self
12705    }
12706}
12707
12708impl wkt::message::Message for DeleteVolumeRequest {
12709    fn typename() -> &'static str {
12710        "type.googleapis.com/google.cloud.netapp.v1.DeleteVolumeRequest"
12711    }
12712}
12713
12714/// RevertVolumeRequest reverts the given volume to the specified snapshot.
12715#[derive(Clone, Default, PartialEq)]
12716#[non_exhaustive]
12717pub struct RevertVolumeRequest {
12718    /// Required. The resource name of the volume, in the format of
12719    /// projects/{project_id}/locations/{location}/volumes/{volume_id}.
12720    pub name: std::string::String,
12721
12722    /// Required. The snapshot resource ID, in the format 'my-snapshot', where the
12723    /// specified ID is the {snapshot_id} of the fully qualified name like
12724    /// projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}
12725    pub snapshot_id: std::string::String,
12726
12727    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12728}
12729
12730impl RevertVolumeRequest {
12731    pub fn new() -> Self {
12732        std::default::Default::default()
12733    }
12734
12735    /// Sets the value of [name][crate::model::RevertVolumeRequest::name].
12736    ///
12737    /// # Example
12738    /// ```ignore,no_run
12739    /// # use google_cloud_netapp_v1::model::RevertVolumeRequest;
12740    /// let x = RevertVolumeRequest::new().set_name("example");
12741    /// ```
12742    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12743        self.name = v.into();
12744        self
12745    }
12746
12747    /// Sets the value of [snapshot_id][crate::model::RevertVolumeRequest::snapshot_id].
12748    ///
12749    /// # Example
12750    /// ```ignore,no_run
12751    /// # use google_cloud_netapp_v1::model::RevertVolumeRequest;
12752    /// let x = RevertVolumeRequest::new().set_snapshot_id("example");
12753    /// ```
12754    pub fn set_snapshot_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12755        self.snapshot_id = v.into();
12756        self
12757    }
12758}
12759
12760impl wkt::message::Message for RevertVolumeRequest {
12761    fn typename() -> &'static str {
12762        "type.googleapis.com/google.cloud.netapp.v1.RevertVolumeRequest"
12763    }
12764}
12765
12766/// Volume provides a filesystem that you can mount.
12767#[derive(Clone, Default, PartialEq)]
12768#[non_exhaustive]
12769pub struct Volume {
12770    /// Identifier. Name of the volume
12771    pub name: std::string::String,
12772
12773    /// Output only. State of the volume
12774    pub state: crate::model::volume::State,
12775
12776    /// Output only. State details of the volume
12777    pub state_details: std::string::String,
12778
12779    /// Output only. Create time of the volume
12780    pub create_time: std::option::Option<wkt::Timestamp>,
12781
12782    /// Required. Share name of the volume
12783    pub share_name: std::string::String,
12784
12785    /// Output only. This field is not implemented. The values provided in this
12786    /// field are ignored.
12787    pub psa_range: std::string::String,
12788
12789    /// Required. StoragePool name of the volume
12790    pub storage_pool: std::string::String,
12791
12792    /// Output only. VPC Network name.
12793    /// Format: projects/{project}/global/networks/{network}
12794    pub network: std::string::String,
12795
12796    /// Output only. Service level of the volume
12797    pub service_level: crate::model::ServiceLevel,
12798
12799    /// Required. Capacity in GIB of the volume
12800    pub capacity_gib: i64,
12801
12802    /// Optional. Export policy of the volume
12803    pub export_policy: std::option::Option<crate::model::ExportPolicy>,
12804
12805    /// Required. Protocols required for the volume
12806    pub protocols: std::vec::Vec<crate::model::Protocols>,
12807
12808    /// Optional. SMB share settings for the volume.
12809    pub smb_settings: std::vec::Vec<crate::model::SMBSettings>,
12810
12811    /// Output only. Mount options of this volume
12812    pub mount_options: std::vec::Vec<crate::model::MountOption>,
12813
12814    /// Optional. Default unix style permission (e.g. 777) the mount point will be
12815    /// created with. Applicable for NFS protocol types only.
12816    pub unix_permissions: std::string::String,
12817
12818    /// Optional. Labels as key value pairs
12819    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12820
12821    /// Optional. Description of the volume
12822    pub description: std::string::String,
12823
12824    /// Optional. SnapshotPolicy for a volume.
12825    pub snapshot_policy: std::option::Option<crate::model::SnapshotPolicy>,
12826
12827    /// Optional. Snap_reserve specifies percentage of volume storage reserved for
12828    /// snapshot storage. Default is 0 percent.
12829    pub snap_reserve: f64,
12830
12831    /// Optional. Snapshot_directory if enabled (true) the volume will contain a
12832    /// read-only .snapshot directory which provides access to each of the volume's
12833    /// snapshots.
12834    pub snapshot_directory: bool,
12835
12836    /// Output only. Used capacity in GIB of the volume. This is computed
12837    /// periodically and it does not represent the realtime usage.
12838    pub used_gib: i64,
12839
12840    /// Optional. Security Style of the Volume
12841    pub security_style: crate::model::SecurityStyle,
12842
12843    /// Optional. Flag indicating if the volume is a kerberos volume or not, export
12844    /// policy rules control kerberos security modes (krb5, krb5i, krb5p).
12845    pub kerberos_enabled: bool,
12846
12847    /// Output only. Flag indicating if the volume is NFS LDAP enabled or not.
12848    pub ldap_enabled: bool,
12849
12850    /// Output only. Specifies the ActiveDirectory name of a SMB volume.
12851    pub active_directory: std::string::String,
12852
12853    /// Optional. Specifies the source of the volume to be created from.
12854    pub restore_parameters: std::option::Option<crate::model::RestoreParameters>,
12855
12856    /// Output only. Specifies the KMS config to be used for volume encryption.
12857    pub kms_config: std::string::String,
12858
12859    /// Output only. Specified the current volume encryption key source.
12860    pub encryption_type: crate::model::EncryptionType,
12861
12862    /// Output only. Indicates whether the volume is part of a replication
12863    /// relationship.
12864    pub has_replication: bool,
12865
12866    /// BackupConfig of the volume.
12867    pub backup_config: std::option::Option<crate::model::BackupConfig>,
12868
12869    /// Optional. List of actions that are restricted on this volume.
12870    pub restricted_actions: std::vec::Vec<crate::model::RestrictedAction>,
12871
12872    /// Optional. Flag indicating if the volume will be a large capacity volume or
12873    /// a regular volume.
12874    pub large_capacity: bool,
12875
12876    /// Optional. Flag indicating if the volume will have an IP address per node
12877    /// for volumes supporting multiple IP endpoints. Only the volume with
12878    /// large_capacity will be allowed to have multiple endpoints.
12879    pub multiple_endpoints: bool,
12880
12881    /// Tiering policy for the volume.
12882    pub tiering_policy: std::option::Option<crate::model::TieringPolicy>,
12883
12884    /// Output only. Specifies the replica zone for regional volume.
12885    pub replica_zone: std::string::String,
12886
12887    /// Output only. Specifies the active zone for regional volume.
12888    pub zone: std::string::String,
12889
12890    /// Output only. Size of the volume cold tier data rounded down to the nearest
12891    /// GiB.
12892    pub cold_tier_size_gib: i64,
12893
12894    /// Optional. The Hybrid Replication parameters for the volume.
12895    pub hybrid_replication_parameters:
12896        std::option::Option<crate::model::HybridReplicationParameters>,
12897
12898    /// Optional. Throughput of the volume (in MiB/s)
12899    pub throughput_mibps: f64,
12900
12901    /// Optional. Cache parameters for the volume.
12902    pub cache_parameters: std::option::Option<crate::model::CacheParameters>,
12903
12904    /// Output only. Total hot tier data rounded down to the nearest GiB used by
12905    /// the Volume. This field is only used for flex Service Level
12906    pub hot_tier_size_used_gib: i64,
12907
12908    /// Optional. Block devices for the volume.
12909    /// Currently, only one block device is permitted per Volume.
12910    pub block_devices: std::vec::Vec<crate::model::BlockDevice>,
12911
12912    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12913}
12914
12915impl Volume {
12916    pub fn new() -> Self {
12917        std::default::Default::default()
12918    }
12919
12920    /// Sets the value of [name][crate::model::Volume::name].
12921    ///
12922    /// # Example
12923    /// ```ignore,no_run
12924    /// # use google_cloud_netapp_v1::model::Volume;
12925    /// let x = Volume::new().set_name("example");
12926    /// ```
12927    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12928        self.name = v.into();
12929        self
12930    }
12931
12932    /// Sets the value of [state][crate::model::Volume::state].
12933    ///
12934    /// # Example
12935    /// ```ignore,no_run
12936    /// # use google_cloud_netapp_v1::model::Volume;
12937    /// use google_cloud_netapp_v1::model::volume::State;
12938    /// let x0 = Volume::new().set_state(State::Ready);
12939    /// let x1 = Volume::new().set_state(State::Creating);
12940    /// let x2 = Volume::new().set_state(State::Deleting);
12941    /// ```
12942    pub fn set_state<T: std::convert::Into<crate::model::volume::State>>(mut self, v: T) -> Self {
12943        self.state = v.into();
12944        self
12945    }
12946
12947    /// Sets the value of [state_details][crate::model::Volume::state_details].
12948    ///
12949    /// # Example
12950    /// ```ignore,no_run
12951    /// # use google_cloud_netapp_v1::model::Volume;
12952    /// let x = Volume::new().set_state_details("example");
12953    /// ```
12954    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12955        self.state_details = v.into();
12956        self
12957    }
12958
12959    /// Sets the value of [create_time][crate::model::Volume::create_time].
12960    ///
12961    /// # Example
12962    /// ```ignore,no_run
12963    /// # use google_cloud_netapp_v1::model::Volume;
12964    /// use wkt::Timestamp;
12965    /// let x = Volume::new().set_create_time(Timestamp::default()/* use setters */);
12966    /// ```
12967    pub fn set_create_time<T>(mut self, v: T) -> Self
12968    where
12969        T: std::convert::Into<wkt::Timestamp>,
12970    {
12971        self.create_time = std::option::Option::Some(v.into());
12972        self
12973    }
12974
12975    /// Sets or clears the value of [create_time][crate::model::Volume::create_time].
12976    ///
12977    /// # Example
12978    /// ```ignore,no_run
12979    /// # use google_cloud_netapp_v1::model::Volume;
12980    /// use wkt::Timestamp;
12981    /// let x = Volume::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
12982    /// let x = Volume::new().set_or_clear_create_time(None::<Timestamp>);
12983    /// ```
12984    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12985    where
12986        T: std::convert::Into<wkt::Timestamp>,
12987    {
12988        self.create_time = v.map(|x| x.into());
12989        self
12990    }
12991
12992    /// Sets the value of [share_name][crate::model::Volume::share_name].
12993    ///
12994    /// # Example
12995    /// ```ignore,no_run
12996    /// # use google_cloud_netapp_v1::model::Volume;
12997    /// let x = Volume::new().set_share_name("example");
12998    /// ```
12999    pub fn set_share_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13000        self.share_name = v.into();
13001        self
13002    }
13003
13004    /// Sets the value of [psa_range][crate::model::Volume::psa_range].
13005    ///
13006    /// # Example
13007    /// ```ignore,no_run
13008    /// # use google_cloud_netapp_v1::model::Volume;
13009    /// let x = Volume::new().set_psa_range("example");
13010    /// ```
13011    pub fn set_psa_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13012        self.psa_range = v.into();
13013        self
13014    }
13015
13016    /// Sets the value of [storage_pool][crate::model::Volume::storage_pool].
13017    ///
13018    /// # Example
13019    /// ```ignore,no_run
13020    /// # use google_cloud_netapp_v1::model::Volume;
13021    /// let x = Volume::new().set_storage_pool("example");
13022    /// ```
13023    pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13024        self.storage_pool = v.into();
13025        self
13026    }
13027
13028    /// Sets the value of [network][crate::model::Volume::network].
13029    ///
13030    /// # Example
13031    /// ```ignore,no_run
13032    /// # use google_cloud_netapp_v1::model::Volume;
13033    /// let x = Volume::new().set_network("example");
13034    /// ```
13035    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13036        self.network = v.into();
13037        self
13038    }
13039
13040    /// Sets the value of [service_level][crate::model::Volume::service_level].
13041    ///
13042    /// # Example
13043    /// ```ignore,no_run
13044    /// # use google_cloud_netapp_v1::model::Volume;
13045    /// use google_cloud_netapp_v1::model::ServiceLevel;
13046    /// let x0 = Volume::new().set_service_level(ServiceLevel::Premium);
13047    /// let x1 = Volume::new().set_service_level(ServiceLevel::Extreme);
13048    /// let x2 = Volume::new().set_service_level(ServiceLevel::Standard);
13049    /// ```
13050    pub fn set_service_level<T: std::convert::Into<crate::model::ServiceLevel>>(
13051        mut self,
13052        v: T,
13053    ) -> Self {
13054        self.service_level = v.into();
13055        self
13056    }
13057
13058    /// Sets the value of [capacity_gib][crate::model::Volume::capacity_gib].
13059    ///
13060    /// # Example
13061    /// ```ignore,no_run
13062    /// # use google_cloud_netapp_v1::model::Volume;
13063    /// let x = Volume::new().set_capacity_gib(42);
13064    /// ```
13065    pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13066        self.capacity_gib = v.into();
13067        self
13068    }
13069
13070    /// Sets the value of [export_policy][crate::model::Volume::export_policy].
13071    ///
13072    /// # Example
13073    /// ```ignore,no_run
13074    /// # use google_cloud_netapp_v1::model::Volume;
13075    /// use google_cloud_netapp_v1::model::ExportPolicy;
13076    /// let x = Volume::new().set_export_policy(ExportPolicy::default()/* use setters */);
13077    /// ```
13078    pub fn set_export_policy<T>(mut self, v: T) -> Self
13079    where
13080        T: std::convert::Into<crate::model::ExportPolicy>,
13081    {
13082        self.export_policy = std::option::Option::Some(v.into());
13083        self
13084    }
13085
13086    /// Sets or clears the value of [export_policy][crate::model::Volume::export_policy].
13087    ///
13088    /// # Example
13089    /// ```ignore,no_run
13090    /// # use google_cloud_netapp_v1::model::Volume;
13091    /// use google_cloud_netapp_v1::model::ExportPolicy;
13092    /// let x = Volume::new().set_or_clear_export_policy(Some(ExportPolicy::default()/* use setters */));
13093    /// let x = Volume::new().set_or_clear_export_policy(None::<ExportPolicy>);
13094    /// ```
13095    pub fn set_or_clear_export_policy<T>(mut self, v: std::option::Option<T>) -> Self
13096    where
13097        T: std::convert::Into<crate::model::ExportPolicy>,
13098    {
13099        self.export_policy = v.map(|x| x.into());
13100        self
13101    }
13102
13103    /// Sets the value of [protocols][crate::model::Volume::protocols].
13104    ///
13105    /// # Example
13106    /// ```ignore,no_run
13107    /// # use google_cloud_netapp_v1::model::Volume;
13108    /// use google_cloud_netapp_v1::model::Protocols;
13109    /// let x = Volume::new().set_protocols([
13110    ///     Protocols::Nfsv3,
13111    ///     Protocols::Nfsv4,
13112    ///     Protocols::Smb,
13113    /// ]);
13114    /// ```
13115    pub fn set_protocols<T, V>(mut self, v: T) -> Self
13116    where
13117        T: std::iter::IntoIterator<Item = V>,
13118        V: std::convert::Into<crate::model::Protocols>,
13119    {
13120        use std::iter::Iterator;
13121        self.protocols = v.into_iter().map(|i| i.into()).collect();
13122        self
13123    }
13124
13125    /// Sets the value of [smb_settings][crate::model::Volume::smb_settings].
13126    ///
13127    /// # Example
13128    /// ```ignore,no_run
13129    /// # use google_cloud_netapp_v1::model::Volume;
13130    /// use google_cloud_netapp_v1::model::SMBSettings;
13131    /// let x = Volume::new().set_smb_settings([
13132    ///     SMBSettings::EncryptData,
13133    ///     SMBSettings::Browsable,
13134    ///     SMBSettings::ChangeNotify,
13135    /// ]);
13136    /// ```
13137    pub fn set_smb_settings<T, V>(mut self, v: T) -> Self
13138    where
13139        T: std::iter::IntoIterator<Item = V>,
13140        V: std::convert::Into<crate::model::SMBSettings>,
13141    {
13142        use std::iter::Iterator;
13143        self.smb_settings = v.into_iter().map(|i| i.into()).collect();
13144        self
13145    }
13146
13147    /// Sets the value of [mount_options][crate::model::Volume::mount_options].
13148    ///
13149    /// # Example
13150    /// ```ignore,no_run
13151    /// # use google_cloud_netapp_v1::model::Volume;
13152    /// use google_cloud_netapp_v1::model::MountOption;
13153    /// let x = Volume::new()
13154    ///     .set_mount_options([
13155    ///         MountOption::default()/* use setters */,
13156    ///         MountOption::default()/* use (different) setters */,
13157    ///     ]);
13158    /// ```
13159    pub fn set_mount_options<T, V>(mut self, v: T) -> Self
13160    where
13161        T: std::iter::IntoIterator<Item = V>,
13162        V: std::convert::Into<crate::model::MountOption>,
13163    {
13164        use std::iter::Iterator;
13165        self.mount_options = v.into_iter().map(|i| i.into()).collect();
13166        self
13167    }
13168
13169    /// Sets the value of [unix_permissions][crate::model::Volume::unix_permissions].
13170    ///
13171    /// # Example
13172    /// ```ignore,no_run
13173    /// # use google_cloud_netapp_v1::model::Volume;
13174    /// let x = Volume::new().set_unix_permissions("example");
13175    /// ```
13176    pub fn set_unix_permissions<T: std::convert::Into<std::string::String>>(
13177        mut self,
13178        v: T,
13179    ) -> Self {
13180        self.unix_permissions = v.into();
13181        self
13182    }
13183
13184    /// Sets the value of [labels][crate::model::Volume::labels].
13185    ///
13186    /// # Example
13187    /// ```ignore,no_run
13188    /// # use google_cloud_netapp_v1::model::Volume;
13189    /// let x = Volume::new().set_labels([
13190    ///     ("key0", "abc"),
13191    ///     ("key1", "xyz"),
13192    /// ]);
13193    /// ```
13194    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
13195    where
13196        T: std::iter::IntoIterator<Item = (K, V)>,
13197        K: std::convert::Into<std::string::String>,
13198        V: std::convert::Into<std::string::String>,
13199    {
13200        use std::iter::Iterator;
13201        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13202        self
13203    }
13204
13205    /// Sets the value of [description][crate::model::Volume::description].
13206    ///
13207    /// # Example
13208    /// ```ignore,no_run
13209    /// # use google_cloud_netapp_v1::model::Volume;
13210    /// let x = Volume::new().set_description("example");
13211    /// ```
13212    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13213        self.description = v.into();
13214        self
13215    }
13216
13217    /// Sets the value of [snapshot_policy][crate::model::Volume::snapshot_policy].
13218    ///
13219    /// # Example
13220    /// ```ignore,no_run
13221    /// # use google_cloud_netapp_v1::model::Volume;
13222    /// use google_cloud_netapp_v1::model::SnapshotPolicy;
13223    /// let x = Volume::new().set_snapshot_policy(SnapshotPolicy::default()/* use setters */);
13224    /// ```
13225    pub fn set_snapshot_policy<T>(mut self, v: T) -> Self
13226    where
13227        T: std::convert::Into<crate::model::SnapshotPolicy>,
13228    {
13229        self.snapshot_policy = std::option::Option::Some(v.into());
13230        self
13231    }
13232
13233    /// Sets or clears the value of [snapshot_policy][crate::model::Volume::snapshot_policy].
13234    ///
13235    /// # Example
13236    /// ```ignore,no_run
13237    /// # use google_cloud_netapp_v1::model::Volume;
13238    /// use google_cloud_netapp_v1::model::SnapshotPolicy;
13239    /// let x = Volume::new().set_or_clear_snapshot_policy(Some(SnapshotPolicy::default()/* use setters */));
13240    /// let x = Volume::new().set_or_clear_snapshot_policy(None::<SnapshotPolicy>);
13241    /// ```
13242    pub fn set_or_clear_snapshot_policy<T>(mut self, v: std::option::Option<T>) -> Self
13243    where
13244        T: std::convert::Into<crate::model::SnapshotPolicy>,
13245    {
13246        self.snapshot_policy = v.map(|x| x.into());
13247        self
13248    }
13249
13250    /// Sets the value of [snap_reserve][crate::model::Volume::snap_reserve].
13251    ///
13252    /// # Example
13253    /// ```ignore,no_run
13254    /// # use google_cloud_netapp_v1::model::Volume;
13255    /// let x = Volume::new().set_snap_reserve(42.0);
13256    /// ```
13257    pub fn set_snap_reserve<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
13258        self.snap_reserve = v.into();
13259        self
13260    }
13261
13262    /// Sets the value of [snapshot_directory][crate::model::Volume::snapshot_directory].
13263    ///
13264    /// # Example
13265    /// ```ignore,no_run
13266    /// # use google_cloud_netapp_v1::model::Volume;
13267    /// let x = Volume::new().set_snapshot_directory(true);
13268    /// ```
13269    pub fn set_snapshot_directory<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13270        self.snapshot_directory = v.into();
13271        self
13272    }
13273
13274    /// Sets the value of [used_gib][crate::model::Volume::used_gib].
13275    ///
13276    /// # Example
13277    /// ```ignore,no_run
13278    /// # use google_cloud_netapp_v1::model::Volume;
13279    /// let x = Volume::new().set_used_gib(42);
13280    /// ```
13281    pub fn set_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13282        self.used_gib = v.into();
13283        self
13284    }
13285
13286    /// Sets the value of [security_style][crate::model::Volume::security_style].
13287    ///
13288    /// # Example
13289    /// ```ignore,no_run
13290    /// # use google_cloud_netapp_v1::model::Volume;
13291    /// use google_cloud_netapp_v1::model::SecurityStyle;
13292    /// let x0 = Volume::new().set_security_style(SecurityStyle::Ntfs);
13293    /// let x1 = Volume::new().set_security_style(SecurityStyle::Unix);
13294    /// ```
13295    pub fn set_security_style<T: std::convert::Into<crate::model::SecurityStyle>>(
13296        mut self,
13297        v: T,
13298    ) -> Self {
13299        self.security_style = v.into();
13300        self
13301    }
13302
13303    /// Sets the value of [kerberos_enabled][crate::model::Volume::kerberos_enabled].
13304    ///
13305    /// # Example
13306    /// ```ignore,no_run
13307    /// # use google_cloud_netapp_v1::model::Volume;
13308    /// let x = Volume::new().set_kerberos_enabled(true);
13309    /// ```
13310    pub fn set_kerberos_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13311        self.kerberos_enabled = v.into();
13312        self
13313    }
13314
13315    /// Sets the value of [ldap_enabled][crate::model::Volume::ldap_enabled].
13316    ///
13317    /// # Example
13318    /// ```ignore,no_run
13319    /// # use google_cloud_netapp_v1::model::Volume;
13320    /// let x = Volume::new().set_ldap_enabled(true);
13321    /// ```
13322    pub fn set_ldap_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13323        self.ldap_enabled = v.into();
13324        self
13325    }
13326
13327    /// Sets the value of [active_directory][crate::model::Volume::active_directory].
13328    ///
13329    /// # Example
13330    /// ```ignore,no_run
13331    /// # use google_cloud_netapp_v1::model::Volume;
13332    /// let x = Volume::new().set_active_directory("example");
13333    /// ```
13334    pub fn set_active_directory<T: std::convert::Into<std::string::String>>(
13335        mut self,
13336        v: T,
13337    ) -> Self {
13338        self.active_directory = v.into();
13339        self
13340    }
13341
13342    /// Sets the value of [restore_parameters][crate::model::Volume::restore_parameters].
13343    ///
13344    /// # Example
13345    /// ```ignore,no_run
13346    /// # use google_cloud_netapp_v1::model::Volume;
13347    /// use google_cloud_netapp_v1::model::RestoreParameters;
13348    /// let x = Volume::new().set_restore_parameters(RestoreParameters::default()/* use setters */);
13349    /// ```
13350    pub fn set_restore_parameters<T>(mut self, v: T) -> Self
13351    where
13352        T: std::convert::Into<crate::model::RestoreParameters>,
13353    {
13354        self.restore_parameters = std::option::Option::Some(v.into());
13355        self
13356    }
13357
13358    /// Sets or clears the value of [restore_parameters][crate::model::Volume::restore_parameters].
13359    ///
13360    /// # Example
13361    /// ```ignore,no_run
13362    /// # use google_cloud_netapp_v1::model::Volume;
13363    /// use google_cloud_netapp_v1::model::RestoreParameters;
13364    /// let x = Volume::new().set_or_clear_restore_parameters(Some(RestoreParameters::default()/* use setters */));
13365    /// let x = Volume::new().set_or_clear_restore_parameters(None::<RestoreParameters>);
13366    /// ```
13367    pub fn set_or_clear_restore_parameters<T>(mut self, v: std::option::Option<T>) -> Self
13368    where
13369        T: std::convert::Into<crate::model::RestoreParameters>,
13370    {
13371        self.restore_parameters = v.map(|x| x.into());
13372        self
13373    }
13374
13375    /// Sets the value of [kms_config][crate::model::Volume::kms_config].
13376    ///
13377    /// # Example
13378    /// ```ignore,no_run
13379    /// # use google_cloud_netapp_v1::model::Volume;
13380    /// let x = Volume::new().set_kms_config("example");
13381    /// ```
13382    pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13383        self.kms_config = v.into();
13384        self
13385    }
13386
13387    /// Sets the value of [encryption_type][crate::model::Volume::encryption_type].
13388    ///
13389    /// # Example
13390    /// ```ignore,no_run
13391    /// # use google_cloud_netapp_v1::model::Volume;
13392    /// use google_cloud_netapp_v1::model::EncryptionType;
13393    /// let x0 = Volume::new().set_encryption_type(EncryptionType::ServiceManaged);
13394    /// let x1 = Volume::new().set_encryption_type(EncryptionType::CloudKms);
13395    /// ```
13396    pub fn set_encryption_type<T: std::convert::Into<crate::model::EncryptionType>>(
13397        mut self,
13398        v: T,
13399    ) -> Self {
13400        self.encryption_type = v.into();
13401        self
13402    }
13403
13404    /// Sets the value of [has_replication][crate::model::Volume::has_replication].
13405    ///
13406    /// # Example
13407    /// ```ignore,no_run
13408    /// # use google_cloud_netapp_v1::model::Volume;
13409    /// let x = Volume::new().set_has_replication(true);
13410    /// ```
13411    pub fn set_has_replication<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13412        self.has_replication = v.into();
13413        self
13414    }
13415
13416    /// Sets the value of [backup_config][crate::model::Volume::backup_config].
13417    ///
13418    /// # Example
13419    /// ```ignore,no_run
13420    /// # use google_cloud_netapp_v1::model::Volume;
13421    /// use google_cloud_netapp_v1::model::BackupConfig;
13422    /// let x = Volume::new().set_backup_config(BackupConfig::default()/* use setters */);
13423    /// ```
13424    pub fn set_backup_config<T>(mut self, v: T) -> Self
13425    where
13426        T: std::convert::Into<crate::model::BackupConfig>,
13427    {
13428        self.backup_config = std::option::Option::Some(v.into());
13429        self
13430    }
13431
13432    /// Sets or clears the value of [backup_config][crate::model::Volume::backup_config].
13433    ///
13434    /// # Example
13435    /// ```ignore,no_run
13436    /// # use google_cloud_netapp_v1::model::Volume;
13437    /// use google_cloud_netapp_v1::model::BackupConfig;
13438    /// let x = Volume::new().set_or_clear_backup_config(Some(BackupConfig::default()/* use setters */));
13439    /// let x = Volume::new().set_or_clear_backup_config(None::<BackupConfig>);
13440    /// ```
13441    pub fn set_or_clear_backup_config<T>(mut self, v: std::option::Option<T>) -> Self
13442    where
13443        T: std::convert::Into<crate::model::BackupConfig>,
13444    {
13445        self.backup_config = v.map(|x| x.into());
13446        self
13447    }
13448
13449    /// Sets the value of [restricted_actions][crate::model::Volume::restricted_actions].
13450    ///
13451    /// # Example
13452    /// ```ignore,no_run
13453    /// # use google_cloud_netapp_v1::model::Volume;
13454    /// use google_cloud_netapp_v1::model::RestrictedAction;
13455    /// let x = Volume::new().set_restricted_actions([
13456    ///     RestrictedAction::Delete,
13457    /// ]);
13458    /// ```
13459    pub fn set_restricted_actions<T, V>(mut self, v: T) -> Self
13460    where
13461        T: std::iter::IntoIterator<Item = V>,
13462        V: std::convert::Into<crate::model::RestrictedAction>,
13463    {
13464        use std::iter::Iterator;
13465        self.restricted_actions = v.into_iter().map(|i| i.into()).collect();
13466        self
13467    }
13468
13469    /// Sets the value of [large_capacity][crate::model::Volume::large_capacity].
13470    ///
13471    /// # Example
13472    /// ```ignore,no_run
13473    /// # use google_cloud_netapp_v1::model::Volume;
13474    /// let x = Volume::new().set_large_capacity(true);
13475    /// ```
13476    pub fn set_large_capacity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13477        self.large_capacity = v.into();
13478        self
13479    }
13480
13481    /// Sets the value of [multiple_endpoints][crate::model::Volume::multiple_endpoints].
13482    ///
13483    /// # Example
13484    /// ```ignore,no_run
13485    /// # use google_cloud_netapp_v1::model::Volume;
13486    /// let x = Volume::new().set_multiple_endpoints(true);
13487    /// ```
13488    pub fn set_multiple_endpoints<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13489        self.multiple_endpoints = v.into();
13490        self
13491    }
13492
13493    /// Sets the value of [tiering_policy][crate::model::Volume::tiering_policy].
13494    ///
13495    /// # Example
13496    /// ```ignore,no_run
13497    /// # use google_cloud_netapp_v1::model::Volume;
13498    /// use google_cloud_netapp_v1::model::TieringPolicy;
13499    /// let x = Volume::new().set_tiering_policy(TieringPolicy::default()/* use setters */);
13500    /// ```
13501    pub fn set_tiering_policy<T>(mut self, v: T) -> Self
13502    where
13503        T: std::convert::Into<crate::model::TieringPolicy>,
13504    {
13505        self.tiering_policy = std::option::Option::Some(v.into());
13506        self
13507    }
13508
13509    /// Sets or clears the value of [tiering_policy][crate::model::Volume::tiering_policy].
13510    ///
13511    /// # Example
13512    /// ```ignore,no_run
13513    /// # use google_cloud_netapp_v1::model::Volume;
13514    /// use google_cloud_netapp_v1::model::TieringPolicy;
13515    /// let x = Volume::new().set_or_clear_tiering_policy(Some(TieringPolicy::default()/* use setters */));
13516    /// let x = Volume::new().set_or_clear_tiering_policy(None::<TieringPolicy>);
13517    /// ```
13518    pub fn set_or_clear_tiering_policy<T>(mut self, v: std::option::Option<T>) -> Self
13519    where
13520        T: std::convert::Into<crate::model::TieringPolicy>,
13521    {
13522        self.tiering_policy = v.map(|x| x.into());
13523        self
13524    }
13525
13526    /// Sets the value of [replica_zone][crate::model::Volume::replica_zone].
13527    ///
13528    /// # Example
13529    /// ```ignore,no_run
13530    /// # use google_cloud_netapp_v1::model::Volume;
13531    /// let x = Volume::new().set_replica_zone("example");
13532    /// ```
13533    pub fn set_replica_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13534        self.replica_zone = v.into();
13535        self
13536    }
13537
13538    /// Sets the value of [zone][crate::model::Volume::zone].
13539    ///
13540    /// # Example
13541    /// ```ignore,no_run
13542    /// # use google_cloud_netapp_v1::model::Volume;
13543    /// let x = Volume::new().set_zone("example");
13544    /// ```
13545    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13546        self.zone = v.into();
13547        self
13548    }
13549
13550    /// Sets the value of [cold_tier_size_gib][crate::model::Volume::cold_tier_size_gib].
13551    ///
13552    /// # Example
13553    /// ```ignore,no_run
13554    /// # use google_cloud_netapp_v1::model::Volume;
13555    /// let x = Volume::new().set_cold_tier_size_gib(42);
13556    /// ```
13557    pub fn set_cold_tier_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13558        self.cold_tier_size_gib = v.into();
13559        self
13560    }
13561
13562    /// Sets the value of [hybrid_replication_parameters][crate::model::Volume::hybrid_replication_parameters].
13563    ///
13564    /// # Example
13565    /// ```ignore,no_run
13566    /// # use google_cloud_netapp_v1::model::Volume;
13567    /// use google_cloud_netapp_v1::model::HybridReplicationParameters;
13568    /// let x = Volume::new().set_hybrid_replication_parameters(HybridReplicationParameters::default()/* use setters */);
13569    /// ```
13570    pub fn set_hybrid_replication_parameters<T>(mut self, v: T) -> Self
13571    where
13572        T: std::convert::Into<crate::model::HybridReplicationParameters>,
13573    {
13574        self.hybrid_replication_parameters = std::option::Option::Some(v.into());
13575        self
13576    }
13577
13578    /// Sets or clears the value of [hybrid_replication_parameters][crate::model::Volume::hybrid_replication_parameters].
13579    ///
13580    /// # Example
13581    /// ```ignore,no_run
13582    /// # use google_cloud_netapp_v1::model::Volume;
13583    /// use google_cloud_netapp_v1::model::HybridReplicationParameters;
13584    /// let x = Volume::new().set_or_clear_hybrid_replication_parameters(Some(HybridReplicationParameters::default()/* use setters */));
13585    /// let x = Volume::new().set_or_clear_hybrid_replication_parameters(None::<HybridReplicationParameters>);
13586    /// ```
13587    pub fn set_or_clear_hybrid_replication_parameters<T>(
13588        mut self,
13589        v: std::option::Option<T>,
13590    ) -> Self
13591    where
13592        T: std::convert::Into<crate::model::HybridReplicationParameters>,
13593    {
13594        self.hybrid_replication_parameters = v.map(|x| x.into());
13595        self
13596    }
13597
13598    /// Sets the value of [throughput_mibps][crate::model::Volume::throughput_mibps].
13599    ///
13600    /// # Example
13601    /// ```ignore,no_run
13602    /// # use google_cloud_netapp_v1::model::Volume;
13603    /// let x = Volume::new().set_throughput_mibps(42.0);
13604    /// ```
13605    pub fn set_throughput_mibps<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
13606        self.throughput_mibps = v.into();
13607        self
13608    }
13609
13610    /// Sets the value of [cache_parameters][crate::model::Volume::cache_parameters].
13611    ///
13612    /// # Example
13613    /// ```ignore,no_run
13614    /// # use google_cloud_netapp_v1::model::Volume;
13615    /// use google_cloud_netapp_v1::model::CacheParameters;
13616    /// let x = Volume::new().set_cache_parameters(CacheParameters::default()/* use setters */);
13617    /// ```
13618    pub fn set_cache_parameters<T>(mut self, v: T) -> Self
13619    where
13620        T: std::convert::Into<crate::model::CacheParameters>,
13621    {
13622        self.cache_parameters = std::option::Option::Some(v.into());
13623        self
13624    }
13625
13626    /// Sets or clears the value of [cache_parameters][crate::model::Volume::cache_parameters].
13627    ///
13628    /// # Example
13629    /// ```ignore,no_run
13630    /// # use google_cloud_netapp_v1::model::Volume;
13631    /// use google_cloud_netapp_v1::model::CacheParameters;
13632    /// let x = Volume::new().set_or_clear_cache_parameters(Some(CacheParameters::default()/* use setters */));
13633    /// let x = Volume::new().set_or_clear_cache_parameters(None::<CacheParameters>);
13634    /// ```
13635    pub fn set_or_clear_cache_parameters<T>(mut self, v: std::option::Option<T>) -> Self
13636    where
13637        T: std::convert::Into<crate::model::CacheParameters>,
13638    {
13639        self.cache_parameters = v.map(|x| x.into());
13640        self
13641    }
13642
13643    /// Sets the value of [hot_tier_size_used_gib][crate::model::Volume::hot_tier_size_used_gib].
13644    ///
13645    /// # Example
13646    /// ```ignore,no_run
13647    /// # use google_cloud_netapp_v1::model::Volume;
13648    /// let x = Volume::new().set_hot_tier_size_used_gib(42);
13649    /// ```
13650    pub fn set_hot_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13651        self.hot_tier_size_used_gib = v.into();
13652        self
13653    }
13654
13655    /// Sets the value of [block_devices][crate::model::Volume::block_devices].
13656    ///
13657    /// # Example
13658    /// ```ignore,no_run
13659    /// # use google_cloud_netapp_v1::model::Volume;
13660    /// use google_cloud_netapp_v1::model::BlockDevice;
13661    /// let x = Volume::new()
13662    ///     .set_block_devices([
13663    ///         BlockDevice::default()/* use setters */,
13664    ///         BlockDevice::default()/* use (different) setters */,
13665    ///     ]);
13666    /// ```
13667    pub fn set_block_devices<T, V>(mut self, v: T) -> Self
13668    where
13669        T: std::iter::IntoIterator<Item = V>,
13670        V: std::convert::Into<crate::model::BlockDevice>,
13671    {
13672        use std::iter::Iterator;
13673        self.block_devices = v.into_iter().map(|i| i.into()).collect();
13674        self
13675    }
13676}
13677
13678impl wkt::message::Message for Volume {
13679    fn typename() -> &'static str {
13680        "type.googleapis.com/google.cloud.netapp.v1.Volume"
13681    }
13682}
13683
13684/// Defines additional types related to [Volume].
13685pub mod volume {
13686    #[allow(unused_imports)]
13687    use super::*;
13688
13689    /// The volume states
13690    ///
13691    /// # Working with unknown values
13692    ///
13693    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13694    /// additional enum variants at any time. Adding new variants is not considered
13695    /// a breaking change. Applications should write their code in anticipation of:
13696    ///
13697    /// - New values appearing in future releases of the client library, **and**
13698    /// - New values received dynamically, without application changes.
13699    ///
13700    /// Please consult the [Working with enums] section in the user guide for some
13701    /// guidelines.
13702    ///
13703    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13704    #[derive(Clone, Debug, PartialEq)]
13705    #[non_exhaustive]
13706    pub enum State {
13707        /// Unspecified Volume State
13708        Unspecified,
13709        /// Volume State is Ready
13710        Ready,
13711        /// Volume State is Creating
13712        Creating,
13713        /// Volume State is Deleting
13714        Deleting,
13715        /// Volume State is Updating
13716        Updating,
13717        /// Volume State is Restoring
13718        Restoring,
13719        /// Volume State is Disabled
13720        Disabled,
13721        /// Volume State is Error
13722        Error,
13723        /// Volume State is Preparing. Note that this is different from CREATING
13724        /// where CREATING means the volume is being created, while PREPARING means
13725        /// the volume is created and now being prepared for the replication.
13726        Preparing,
13727        /// Volume State is Read Only
13728        ReadOnly,
13729        /// If set, the enum was initialized with an unknown value.
13730        ///
13731        /// Applications can examine the value using [State::value] or
13732        /// [State::name].
13733        UnknownValue(state::UnknownValue),
13734    }
13735
13736    #[doc(hidden)]
13737    pub mod state {
13738        #[allow(unused_imports)]
13739        use super::*;
13740        #[derive(Clone, Debug, PartialEq)]
13741        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13742    }
13743
13744    impl State {
13745        /// Gets the enum value.
13746        ///
13747        /// Returns `None` if the enum contains an unknown value deserialized from
13748        /// the string representation of enums.
13749        pub fn value(&self) -> std::option::Option<i32> {
13750            match self {
13751                Self::Unspecified => std::option::Option::Some(0),
13752                Self::Ready => std::option::Option::Some(1),
13753                Self::Creating => std::option::Option::Some(2),
13754                Self::Deleting => std::option::Option::Some(3),
13755                Self::Updating => std::option::Option::Some(4),
13756                Self::Restoring => std::option::Option::Some(5),
13757                Self::Disabled => std::option::Option::Some(6),
13758                Self::Error => std::option::Option::Some(7),
13759                Self::Preparing => std::option::Option::Some(8),
13760                Self::ReadOnly => std::option::Option::Some(9),
13761                Self::UnknownValue(u) => u.0.value(),
13762            }
13763        }
13764
13765        /// Gets the enum value as a string.
13766        ///
13767        /// Returns `None` if the enum contains an unknown value deserialized from
13768        /// the integer representation of enums.
13769        pub fn name(&self) -> std::option::Option<&str> {
13770            match self {
13771                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13772                Self::Ready => std::option::Option::Some("READY"),
13773                Self::Creating => std::option::Option::Some("CREATING"),
13774                Self::Deleting => std::option::Option::Some("DELETING"),
13775                Self::Updating => std::option::Option::Some("UPDATING"),
13776                Self::Restoring => std::option::Option::Some("RESTORING"),
13777                Self::Disabled => std::option::Option::Some("DISABLED"),
13778                Self::Error => std::option::Option::Some("ERROR"),
13779                Self::Preparing => std::option::Option::Some("PREPARING"),
13780                Self::ReadOnly => std::option::Option::Some("READ_ONLY"),
13781                Self::UnknownValue(u) => u.0.name(),
13782            }
13783        }
13784    }
13785
13786    impl std::default::Default for State {
13787        fn default() -> Self {
13788            use std::convert::From;
13789            Self::from(0)
13790        }
13791    }
13792
13793    impl std::fmt::Display for State {
13794        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13795            wkt::internal::display_enum(f, self.name(), self.value())
13796        }
13797    }
13798
13799    impl std::convert::From<i32> for State {
13800        fn from(value: i32) -> Self {
13801            match value {
13802                0 => Self::Unspecified,
13803                1 => Self::Ready,
13804                2 => Self::Creating,
13805                3 => Self::Deleting,
13806                4 => Self::Updating,
13807                5 => Self::Restoring,
13808                6 => Self::Disabled,
13809                7 => Self::Error,
13810                8 => Self::Preparing,
13811                9 => Self::ReadOnly,
13812                _ => Self::UnknownValue(state::UnknownValue(
13813                    wkt::internal::UnknownEnumValue::Integer(value),
13814                )),
13815            }
13816        }
13817    }
13818
13819    impl std::convert::From<&str> for State {
13820        fn from(value: &str) -> Self {
13821            use std::string::ToString;
13822            match value {
13823                "STATE_UNSPECIFIED" => Self::Unspecified,
13824                "READY" => Self::Ready,
13825                "CREATING" => Self::Creating,
13826                "DELETING" => Self::Deleting,
13827                "UPDATING" => Self::Updating,
13828                "RESTORING" => Self::Restoring,
13829                "DISABLED" => Self::Disabled,
13830                "ERROR" => Self::Error,
13831                "PREPARING" => Self::Preparing,
13832                "READ_ONLY" => Self::ReadOnly,
13833                _ => Self::UnknownValue(state::UnknownValue(
13834                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13835                )),
13836            }
13837        }
13838    }
13839
13840    impl serde::ser::Serialize for State {
13841        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13842        where
13843            S: serde::Serializer,
13844        {
13845            match self {
13846                Self::Unspecified => serializer.serialize_i32(0),
13847                Self::Ready => serializer.serialize_i32(1),
13848                Self::Creating => serializer.serialize_i32(2),
13849                Self::Deleting => serializer.serialize_i32(3),
13850                Self::Updating => serializer.serialize_i32(4),
13851                Self::Restoring => serializer.serialize_i32(5),
13852                Self::Disabled => serializer.serialize_i32(6),
13853                Self::Error => serializer.serialize_i32(7),
13854                Self::Preparing => serializer.serialize_i32(8),
13855                Self::ReadOnly => serializer.serialize_i32(9),
13856                Self::UnknownValue(u) => u.0.serialize(serializer),
13857            }
13858        }
13859    }
13860
13861    impl<'de> serde::de::Deserialize<'de> for State {
13862        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13863        where
13864            D: serde::Deserializer<'de>,
13865        {
13866            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13867                ".google.cloud.netapp.v1.Volume.State",
13868            ))
13869        }
13870    }
13871}
13872
13873/// Defines the export policy for the volume.
13874#[derive(Clone, Default, PartialEq)]
13875#[non_exhaustive]
13876pub struct ExportPolicy {
13877    /// Required. List of export policy rules
13878    pub rules: std::vec::Vec<crate::model::SimpleExportPolicyRule>,
13879
13880    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13881}
13882
13883impl ExportPolicy {
13884    pub fn new() -> Self {
13885        std::default::Default::default()
13886    }
13887
13888    /// Sets the value of [rules][crate::model::ExportPolicy::rules].
13889    ///
13890    /// # Example
13891    /// ```ignore,no_run
13892    /// # use google_cloud_netapp_v1::model::ExportPolicy;
13893    /// use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
13894    /// let x = ExportPolicy::new()
13895    ///     .set_rules([
13896    ///         SimpleExportPolicyRule::default()/* use setters */,
13897    ///         SimpleExportPolicyRule::default()/* use (different) setters */,
13898    ///     ]);
13899    /// ```
13900    pub fn set_rules<T, V>(mut self, v: T) -> Self
13901    where
13902        T: std::iter::IntoIterator<Item = V>,
13903        V: std::convert::Into<crate::model::SimpleExportPolicyRule>,
13904    {
13905        use std::iter::Iterator;
13906        self.rules = v.into_iter().map(|i| i.into()).collect();
13907        self
13908    }
13909}
13910
13911impl wkt::message::Message for ExportPolicy {
13912    fn typename() -> &'static str {
13913        "type.googleapis.com/google.cloud.netapp.v1.ExportPolicy"
13914    }
13915}
13916
13917/// An export policy rule describing various export options.
13918#[derive(Clone, Default, PartialEq)]
13919#[non_exhaustive]
13920pub struct SimpleExportPolicyRule {
13921    /// Comma separated list of allowed clients IP addresses
13922    pub allowed_clients: std::option::Option<std::string::String>,
13923
13924    /// Whether Unix root access will be granted.
13925    pub has_root_access: std::option::Option<std::string::String>,
13926
13927    /// Access type (ReadWrite, ReadOnly, None)
13928    pub access_type: std::option::Option<crate::model::AccessType>,
13929
13930    /// NFS V3 protocol.
13931    pub nfsv3: std::option::Option<bool>,
13932
13933    /// NFS V4 protocol.
13934    pub nfsv4: std::option::Option<bool>,
13935
13936    /// If enabled (true) the rule defines a read only access for clients matching
13937    /// the 'allowedClients' specification. It enables nfs clients to mount using
13938    /// 'authentication' kerberos security mode.
13939    pub kerberos_5_read_only: std::option::Option<bool>,
13940
13941    /// If enabled (true) the rule defines read and write access for clients
13942    /// matching the 'allowedClients' specification. It enables nfs clients to
13943    /// mount using 'authentication' kerberos security mode. The
13944    /// 'kerberos5ReadOnly' value be ignored if this is enabled.
13945    pub kerberos_5_read_write: std::option::Option<bool>,
13946
13947    /// If enabled (true) the rule defines a read only access for clients matching
13948    /// the 'allowedClients' specification. It enables nfs clients to mount using
13949    /// 'integrity' kerberos security mode.
13950    pub kerberos_5i_read_only: std::option::Option<bool>,
13951
13952    /// If enabled (true) the rule defines read and write access for clients
13953    /// matching the 'allowedClients' specification. It enables nfs clients to
13954    /// mount using 'integrity' kerberos security mode. The 'kerberos5iReadOnly'
13955    /// value be ignored if this is enabled.
13956    pub kerberos_5i_read_write: std::option::Option<bool>,
13957
13958    /// If enabled (true) the rule defines a read only access for clients matching
13959    /// the 'allowedClients' specification. It enables nfs clients to mount using
13960    /// 'privacy' kerberos security mode.
13961    pub kerberos_5p_read_only: std::option::Option<bool>,
13962
13963    /// If enabled (true) the rule defines read and write access for clients
13964    /// matching the 'allowedClients' specification. It enables nfs clients to
13965    /// mount using 'privacy' kerberos security mode. The 'kerberos5pReadOnly'
13966    /// value be ignored if this is enabled.
13967    pub kerberos_5p_read_write: std::option::Option<bool>,
13968
13969    /// Optional. Defines how user identity squashing is applied for this export
13970    /// rule. This field is the preferred way to configure squashing behavior and
13971    /// takes precedence over `has_root_access` if both are provided.
13972    pub squash_mode: std::option::Option<crate::model::simple_export_policy_rule::SquashMode>,
13973
13974    /// Optional. An integer representing the anonymous user ID. Range is 0 to
13975    /// `4294967295`. Required when `squash_mode` is `ROOT_SQUASH` or `ALL_SQUASH`.
13976    pub anon_uid: std::option::Option<i64>,
13977
13978    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13979}
13980
13981impl SimpleExportPolicyRule {
13982    pub fn new() -> Self {
13983        std::default::Default::default()
13984    }
13985
13986    /// Sets the value of [allowed_clients][crate::model::SimpleExportPolicyRule::allowed_clients].
13987    ///
13988    /// # Example
13989    /// ```ignore,no_run
13990    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
13991    /// let x = SimpleExportPolicyRule::new().set_allowed_clients("example");
13992    /// ```
13993    pub fn set_allowed_clients<T>(mut self, v: T) -> Self
13994    where
13995        T: std::convert::Into<std::string::String>,
13996    {
13997        self.allowed_clients = std::option::Option::Some(v.into());
13998        self
13999    }
14000
14001    /// Sets or clears the value of [allowed_clients][crate::model::SimpleExportPolicyRule::allowed_clients].
14002    ///
14003    /// # Example
14004    /// ```ignore,no_run
14005    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14006    /// let x = SimpleExportPolicyRule::new().set_or_clear_allowed_clients(Some("example"));
14007    /// let x = SimpleExportPolicyRule::new().set_or_clear_allowed_clients(None::<String>);
14008    /// ```
14009    pub fn set_or_clear_allowed_clients<T>(mut self, v: std::option::Option<T>) -> Self
14010    where
14011        T: std::convert::Into<std::string::String>,
14012    {
14013        self.allowed_clients = v.map(|x| x.into());
14014        self
14015    }
14016
14017    /// Sets the value of [has_root_access][crate::model::SimpleExportPolicyRule::has_root_access].
14018    ///
14019    /// # Example
14020    /// ```ignore,no_run
14021    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14022    /// let x = SimpleExportPolicyRule::new().set_has_root_access("example");
14023    /// ```
14024    pub fn set_has_root_access<T>(mut self, v: T) -> Self
14025    where
14026        T: std::convert::Into<std::string::String>,
14027    {
14028        self.has_root_access = std::option::Option::Some(v.into());
14029        self
14030    }
14031
14032    /// Sets or clears the value of [has_root_access][crate::model::SimpleExportPolicyRule::has_root_access].
14033    ///
14034    /// # Example
14035    /// ```ignore,no_run
14036    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14037    /// let x = SimpleExportPolicyRule::new().set_or_clear_has_root_access(Some("example"));
14038    /// let x = SimpleExportPolicyRule::new().set_or_clear_has_root_access(None::<String>);
14039    /// ```
14040    pub fn set_or_clear_has_root_access<T>(mut self, v: std::option::Option<T>) -> Self
14041    where
14042        T: std::convert::Into<std::string::String>,
14043    {
14044        self.has_root_access = v.map(|x| x.into());
14045        self
14046    }
14047
14048    /// Sets the value of [access_type][crate::model::SimpleExportPolicyRule::access_type].
14049    ///
14050    /// # Example
14051    /// ```ignore,no_run
14052    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14053    /// use google_cloud_netapp_v1::model::AccessType;
14054    /// let x0 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadOnly);
14055    /// let x1 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadWrite);
14056    /// let x2 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadNone);
14057    /// ```
14058    pub fn set_access_type<T>(mut self, v: T) -> Self
14059    where
14060        T: std::convert::Into<crate::model::AccessType>,
14061    {
14062        self.access_type = std::option::Option::Some(v.into());
14063        self
14064    }
14065
14066    /// Sets or clears the value of [access_type][crate::model::SimpleExportPolicyRule::access_type].
14067    ///
14068    /// # Example
14069    /// ```ignore,no_run
14070    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14071    /// use google_cloud_netapp_v1::model::AccessType;
14072    /// let x0 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadOnly));
14073    /// let x1 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadWrite));
14074    /// let x2 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadNone));
14075    /// let x_none = SimpleExportPolicyRule::new().set_or_clear_access_type(None::<AccessType>);
14076    /// ```
14077    pub fn set_or_clear_access_type<T>(mut self, v: std::option::Option<T>) -> Self
14078    where
14079        T: std::convert::Into<crate::model::AccessType>,
14080    {
14081        self.access_type = v.map(|x| x.into());
14082        self
14083    }
14084
14085    /// Sets the value of [nfsv3][crate::model::SimpleExportPolicyRule::nfsv3].
14086    ///
14087    /// # Example
14088    /// ```ignore,no_run
14089    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14090    /// let x = SimpleExportPolicyRule::new().set_nfsv3(true);
14091    /// ```
14092    pub fn set_nfsv3<T>(mut self, v: T) -> Self
14093    where
14094        T: std::convert::Into<bool>,
14095    {
14096        self.nfsv3 = std::option::Option::Some(v.into());
14097        self
14098    }
14099
14100    /// Sets or clears the value of [nfsv3][crate::model::SimpleExportPolicyRule::nfsv3].
14101    ///
14102    /// # Example
14103    /// ```ignore,no_run
14104    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14105    /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv3(Some(false));
14106    /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv3(None::<bool>);
14107    /// ```
14108    pub fn set_or_clear_nfsv3<T>(mut self, v: std::option::Option<T>) -> Self
14109    where
14110        T: std::convert::Into<bool>,
14111    {
14112        self.nfsv3 = v.map(|x| x.into());
14113        self
14114    }
14115
14116    /// Sets the value of [nfsv4][crate::model::SimpleExportPolicyRule::nfsv4].
14117    ///
14118    /// # Example
14119    /// ```ignore,no_run
14120    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14121    /// let x = SimpleExportPolicyRule::new().set_nfsv4(true);
14122    /// ```
14123    pub fn set_nfsv4<T>(mut self, v: T) -> Self
14124    where
14125        T: std::convert::Into<bool>,
14126    {
14127        self.nfsv4 = std::option::Option::Some(v.into());
14128        self
14129    }
14130
14131    /// Sets or clears the value of [nfsv4][crate::model::SimpleExportPolicyRule::nfsv4].
14132    ///
14133    /// # Example
14134    /// ```ignore,no_run
14135    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14136    /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv4(Some(false));
14137    /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv4(None::<bool>);
14138    /// ```
14139    pub fn set_or_clear_nfsv4<T>(mut self, v: std::option::Option<T>) -> Self
14140    where
14141        T: std::convert::Into<bool>,
14142    {
14143        self.nfsv4 = v.map(|x| x.into());
14144        self
14145    }
14146
14147    /// Sets the value of [kerberos_5_read_only][crate::model::SimpleExportPolicyRule::kerberos_5_read_only].
14148    ///
14149    /// # Example
14150    /// ```ignore,no_run
14151    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14152    /// let x = SimpleExportPolicyRule::new().set_kerberos_5_read_only(true);
14153    /// ```
14154    pub fn set_kerberos_5_read_only<T>(mut self, v: T) -> Self
14155    where
14156        T: std::convert::Into<bool>,
14157    {
14158        self.kerberos_5_read_only = std::option::Option::Some(v.into());
14159        self
14160    }
14161
14162    /// Sets or clears the value of [kerberos_5_read_only][crate::model::SimpleExportPolicyRule::kerberos_5_read_only].
14163    ///
14164    /// # Example
14165    /// ```ignore,no_run
14166    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14167    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_only(Some(false));
14168    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_only(None::<bool>);
14169    /// ```
14170    pub fn set_or_clear_kerberos_5_read_only<T>(mut self, v: std::option::Option<T>) -> Self
14171    where
14172        T: std::convert::Into<bool>,
14173    {
14174        self.kerberos_5_read_only = v.map(|x| x.into());
14175        self
14176    }
14177
14178    /// Sets the value of [kerberos_5_read_write][crate::model::SimpleExportPolicyRule::kerberos_5_read_write].
14179    ///
14180    /// # Example
14181    /// ```ignore,no_run
14182    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14183    /// let x = SimpleExportPolicyRule::new().set_kerberos_5_read_write(true);
14184    /// ```
14185    pub fn set_kerberos_5_read_write<T>(mut self, v: T) -> Self
14186    where
14187        T: std::convert::Into<bool>,
14188    {
14189        self.kerberos_5_read_write = std::option::Option::Some(v.into());
14190        self
14191    }
14192
14193    /// Sets or clears the value of [kerberos_5_read_write][crate::model::SimpleExportPolicyRule::kerberos_5_read_write].
14194    ///
14195    /// # Example
14196    /// ```ignore,no_run
14197    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14198    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_write(Some(false));
14199    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_write(None::<bool>);
14200    /// ```
14201    pub fn set_or_clear_kerberos_5_read_write<T>(mut self, v: std::option::Option<T>) -> Self
14202    where
14203        T: std::convert::Into<bool>,
14204    {
14205        self.kerberos_5_read_write = v.map(|x| x.into());
14206        self
14207    }
14208
14209    /// Sets the value of [kerberos_5i_read_only][crate::model::SimpleExportPolicyRule::kerberos_5i_read_only].
14210    ///
14211    /// # Example
14212    /// ```ignore,no_run
14213    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14214    /// let x = SimpleExportPolicyRule::new().set_kerberos_5i_read_only(true);
14215    /// ```
14216    pub fn set_kerberos_5i_read_only<T>(mut self, v: T) -> Self
14217    where
14218        T: std::convert::Into<bool>,
14219    {
14220        self.kerberos_5i_read_only = std::option::Option::Some(v.into());
14221        self
14222    }
14223
14224    /// Sets or clears the value of [kerberos_5i_read_only][crate::model::SimpleExportPolicyRule::kerberos_5i_read_only].
14225    ///
14226    /// # Example
14227    /// ```ignore,no_run
14228    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14229    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_only(Some(false));
14230    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_only(None::<bool>);
14231    /// ```
14232    pub fn set_or_clear_kerberos_5i_read_only<T>(mut self, v: std::option::Option<T>) -> Self
14233    where
14234        T: std::convert::Into<bool>,
14235    {
14236        self.kerberos_5i_read_only = v.map(|x| x.into());
14237        self
14238    }
14239
14240    /// Sets the value of [kerberos_5i_read_write][crate::model::SimpleExportPolicyRule::kerberos_5i_read_write].
14241    ///
14242    /// # Example
14243    /// ```ignore,no_run
14244    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14245    /// let x = SimpleExportPolicyRule::new().set_kerberos_5i_read_write(true);
14246    /// ```
14247    pub fn set_kerberos_5i_read_write<T>(mut self, v: T) -> Self
14248    where
14249        T: std::convert::Into<bool>,
14250    {
14251        self.kerberos_5i_read_write = std::option::Option::Some(v.into());
14252        self
14253    }
14254
14255    /// Sets or clears the value of [kerberos_5i_read_write][crate::model::SimpleExportPolicyRule::kerberos_5i_read_write].
14256    ///
14257    /// # Example
14258    /// ```ignore,no_run
14259    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14260    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_write(Some(false));
14261    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_write(None::<bool>);
14262    /// ```
14263    pub fn set_or_clear_kerberos_5i_read_write<T>(mut self, v: std::option::Option<T>) -> Self
14264    where
14265        T: std::convert::Into<bool>,
14266    {
14267        self.kerberos_5i_read_write = v.map(|x| x.into());
14268        self
14269    }
14270
14271    /// Sets the value of [kerberos_5p_read_only][crate::model::SimpleExportPolicyRule::kerberos_5p_read_only].
14272    ///
14273    /// # Example
14274    /// ```ignore,no_run
14275    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14276    /// let x = SimpleExportPolicyRule::new().set_kerberos_5p_read_only(true);
14277    /// ```
14278    pub fn set_kerberos_5p_read_only<T>(mut self, v: T) -> Self
14279    where
14280        T: std::convert::Into<bool>,
14281    {
14282        self.kerberos_5p_read_only = std::option::Option::Some(v.into());
14283        self
14284    }
14285
14286    /// Sets or clears the value of [kerberos_5p_read_only][crate::model::SimpleExportPolicyRule::kerberos_5p_read_only].
14287    ///
14288    /// # Example
14289    /// ```ignore,no_run
14290    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14291    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_only(Some(false));
14292    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_only(None::<bool>);
14293    /// ```
14294    pub fn set_or_clear_kerberos_5p_read_only<T>(mut self, v: std::option::Option<T>) -> Self
14295    where
14296        T: std::convert::Into<bool>,
14297    {
14298        self.kerberos_5p_read_only = v.map(|x| x.into());
14299        self
14300    }
14301
14302    /// Sets the value of [kerberos_5p_read_write][crate::model::SimpleExportPolicyRule::kerberos_5p_read_write].
14303    ///
14304    /// # Example
14305    /// ```ignore,no_run
14306    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14307    /// let x = SimpleExportPolicyRule::new().set_kerberos_5p_read_write(true);
14308    /// ```
14309    pub fn set_kerberos_5p_read_write<T>(mut self, v: T) -> Self
14310    where
14311        T: std::convert::Into<bool>,
14312    {
14313        self.kerberos_5p_read_write = std::option::Option::Some(v.into());
14314        self
14315    }
14316
14317    /// Sets or clears the value of [kerberos_5p_read_write][crate::model::SimpleExportPolicyRule::kerberos_5p_read_write].
14318    ///
14319    /// # Example
14320    /// ```ignore,no_run
14321    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14322    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_write(Some(false));
14323    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_write(None::<bool>);
14324    /// ```
14325    pub fn set_or_clear_kerberos_5p_read_write<T>(mut self, v: std::option::Option<T>) -> Self
14326    where
14327        T: std::convert::Into<bool>,
14328    {
14329        self.kerberos_5p_read_write = v.map(|x| x.into());
14330        self
14331    }
14332
14333    /// Sets the value of [squash_mode][crate::model::SimpleExportPolicyRule::squash_mode].
14334    ///
14335    /// # Example
14336    /// ```ignore,no_run
14337    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14338    /// use google_cloud_netapp_v1::model::simple_export_policy_rule::SquashMode;
14339    /// let x0 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::NoRootSquash);
14340    /// let x1 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::RootSquash);
14341    /// let x2 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::AllSquash);
14342    /// ```
14343    pub fn set_squash_mode<T>(mut self, v: T) -> Self
14344    where
14345        T: std::convert::Into<crate::model::simple_export_policy_rule::SquashMode>,
14346    {
14347        self.squash_mode = std::option::Option::Some(v.into());
14348        self
14349    }
14350
14351    /// Sets or clears the value of [squash_mode][crate::model::SimpleExportPolicyRule::squash_mode].
14352    ///
14353    /// # Example
14354    /// ```ignore,no_run
14355    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14356    /// use google_cloud_netapp_v1::model::simple_export_policy_rule::SquashMode;
14357    /// let x0 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::NoRootSquash));
14358    /// let x1 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::RootSquash));
14359    /// let x2 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::AllSquash));
14360    /// let x_none = SimpleExportPolicyRule::new().set_or_clear_squash_mode(None::<SquashMode>);
14361    /// ```
14362    pub fn set_or_clear_squash_mode<T>(mut self, v: std::option::Option<T>) -> Self
14363    where
14364        T: std::convert::Into<crate::model::simple_export_policy_rule::SquashMode>,
14365    {
14366        self.squash_mode = v.map(|x| x.into());
14367        self
14368    }
14369
14370    /// Sets the value of [anon_uid][crate::model::SimpleExportPolicyRule::anon_uid].
14371    ///
14372    /// # Example
14373    /// ```ignore,no_run
14374    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14375    /// let x = SimpleExportPolicyRule::new().set_anon_uid(42);
14376    /// ```
14377    pub fn set_anon_uid<T>(mut self, v: T) -> Self
14378    where
14379        T: std::convert::Into<i64>,
14380    {
14381        self.anon_uid = std::option::Option::Some(v.into());
14382        self
14383    }
14384
14385    /// Sets or clears the value of [anon_uid][crate::model::SimpleExportPolicyRule::anon_uid].
14386    ///
14387    /// # Example
14388    /// ```ignore,no_run
14389    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14390    /// let x = SimpleExportPolicyRule::new().set_or_clear_anon_uid(Some(42));
14391    /// let x = SimpleExportPolicyRule::new().set_or_clear_anon_uid(None::<i32>);
14392    /// ```
14393    pub fn set_or_clear_anon_uid<T>(mut self, v: std::option::Option<T>) -> Self
14394    where
14395        T: std::convert::Into<i64>,
14396    {
14397        self.anon_uid = v.map(|x| x.into());
14398        self
14399    }
14400}
14401
14402impl wkt::message::Message for SimpleExportPolicyRule {
14403    fn typename() -> &'static str {
14404        "type.googleapis.com/google.cloud.netapp.v1.SimpleExportPolicyRule"
14405    }
14406}
14407
14408/// Defines additional types related to [SimpleExportPolicyRule].
14409pub mod simple_export_policy_rule {
14410    #[allow(unused_imports)]
14411    use super::*;
14412
14413    /// `SquashMode` defines how remote user privileges are restricted when
14414    /// accessing an NFS export. It controls how user identities (like root) are
14415    /// mapped to anonymous users to limit access and enforce security.
14416    ///
14417    /// # Working with unknown values
14418    ///
14419    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14420    /// additional enum variants at any time. Adding new variants is not considered
14421    /// a breaking change. Applications should write their code in anticipation of:
14422    ///
14423    /// - New values appearing in future releases of the client library, **and**
14424    /// - New values received dynamically, without application changes.
14425    ///
14426    /// Please consult the [Working with enums] section in the user guide for some
14427    /// guidelines.
14428    ///
14429    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14430    #[derive(Clone, Debug, PartialEq)]
14431    #[non_exhaustive]
14432    pub enum SquashMode {
14433        /// Defaults to `NO_ROOT_SQUASH`.
14434        Unspecified,
14435        /// The root user (UID 0) retains full access. Other users are
14436        /// unaffected.
14437        NoRootSquash,
14438        /// The root user (UID 0) is squashed to anonymous user ID. Other users are
14439        /// unaffected.
14440        RootSquash,
14441        /// All users are squashed to anonymous user ID.
14442        AllSquash,
14443        /// If set, the enum was initialized with an unknown value.
14444        ///
14445        /// Applications can examine the value using [SquashMode::value] or
14446        /// [SquashMode::name].
14447        UnknownValue(squash_mode::UnknownValue),
14448    }
14449
14450    #[doc(hidden)]
14451    pub mod squash_mode {
14452        #[allow(unused_imports)]
14453        use super::*;
14454        #[derive(Clone, Debug, PartialEq)]
14455        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14456    }
14457
14458    impl SquashMode {
14459        /// Gets the enum value.
14460        ///
14461        /// Returns `None` if the enum contains an unknown value deserialized from
14462        /// the string representation of enums.
14463        pub fn value(&self) -> std::option::Option<i32> {
14464            match self {
14465                Self::Unspecified => std::option::Option::Some(0),
14466                Self::NoRootSquash => std::option::Option::Some(1),
14467                Self::RootSquash => std::option::Option::Some(2),
14468                Self::AllSquash => std::option::Option::Some(3),
14469                Self::UnknownValue(u) => u.0.value(),
14470            }
14471        }
14472
14473        /// Gets the enum value as a string.
14474        ///
14475        /// Returns `None` if the enum contains an unknown value deserialized from
14476        /// the integer representation of enums.
14477        pub fn name(&self) -> std::option::Option<&str> {
14478            match self {
14479                Self::Unspecified => std::option::Option::Some("SQUASH_MODE_UNSPECIFIED"),
14480                Self::NoRootSquash => std::option::Option::Some("NO_ROOT_SQUASH"),
14481                Self::RootSquash => std::option::Option::Some("ROOT_SQUASH"),
14482                Self::AllSquash => std::option::Option::Some("ALL_SQUASH"),
14483                Self::UnknownValue(u) => u.0.name(),
14484            }
14485        }
14486    }
14487
14488    impl std::default::Default for SquashMode {
14489        fn default() -> Self {
14490            use std::convert::From;
14491            Self::from(0)
14492        }
14493    }
14494
14495    impl std::fmt::Display for SquashMode {
14496        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14497            wkt::internal::display_enum(f, self.name(), self.value())
14498        }
14499    }
14500
14501    impl std::convert::From<i32> for SquashMode {
14502        fn from(value: i32) -> Self {
14503            match value {
14504                0 => Self::Unspecified,
14505                1 => Self::NoRootSquash,
14506                2 => Self::RootSquash,
14507                3 => Self::AllSquash,
14508                _ => Self::UnknownValue(squash_mode::UnknownValue(
14509                    wkt::internal::UnknownEnumValue::Integer(value),
14510                )),
14511            }
14512        }
14513    }
14514
14515    impl std::convert::From<&str> for SquashMode {
14516        fn from(value: &str) -> Self {
14517            use std::string::ToString;
14518            match value {
14519                "SQUASH_MODE_UNSPECIFIED" => Self::Unspecified,
14520                "NO_ROOT_SQUASH" => Self::NoRootSquash,
14521                "ROOT_SQUASH" => Self::RootSquash,
14522                "ALL_SQUASH" => Self::AllSquash,
14523                _ => Self::UnknownValue(squash_mode::UnknownValue(
14524                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14525                )),
14526            }
14527        }
14528    }
14529
14530    impl serde::ser::Serialize for SquashMode {
14531        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14532        where
14533            S: serde::Serializer,
14534        {
14535            match self {
14536                Self::Unspecified => serializer.serialize_i32(0),
14537                Self::NoRootSquash => serializer.serialize_i32(1),
14538                Self::RootSquash => serializer.serialize_i32(2),
14539                Self::AllSquash => serializer.serialize_i32(3),
14540                Self::UnknownValue(u) => u.0.serialize(serializer),
14541            }
14542        }
14543    }
14544
14545    impl<'de> serde::de::Deserialize<'de> for SquashMode {
14546        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14547        where
14548            D: serde::Deserializer<'de>,
14549        {
14550            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SquashMode>::new(
14551                ".google.cloud.netapp.v1.SimpleExportPolicyRule.SquashMode",
14552            ))
14553        }
14554    }
14555}
14556
14557/// Snapshot Policy for a volume.
14558#[derive(Clone, Default, PartialEq)]
14559#[non_exhaustive]
14560pub struct SnapshotPolicy {
14561    /// If enabled, make snapshots automatically according to the schedules.
14562    /// Default is false.
14563    pub enabled: std::option::Option<bool>,
14564
14565    /// Hourly schedule policy.
14566    pub hourly_schedule: std::option::Option<crate::model::HourlySchedule>,
14567
14568    /// Daily schedule policy.
14569    pub daily_schedule: std::option::Option<crate::model::DailySchedule>,
14570
14571    /// Weekly schedule policy.
14572    pub weekly_schedule: std::option::Option<crate::model::WeeklySchedule>,
14573
14574    /// Monthly schedule policy.
14575    pub monthly_schedule: std::option::Option<crate::model::MonthlySchedule>,
14576
14577    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14578}
14579
14580impl SnapshotPolicy {
14581    pub fn new() -> Self {
14582        std::default::Default::default()
14583    }
14584
14585    /// Sets the value of [enabled][crate::model::SnapshotPolicy::enabled].
14586    ///
14587    /// # Example
14588    /// ```ignore,no_run
14589    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14590    /// let x = SnapshotPolicy::new().set_enabled(true);
14591    /// ```
14592    pub fn set_enabled<T>(mut self, v: T) -> Self
14593    where
14594        T: std::convert::Into<bool>,
14595    {
14596        self.enabled = std::option::Option::Some(v.into());
14597        self
14598    }
14599
14600    /// Sets or clears the value of [enabled][crate::model::SnapshotPolicy::enabled].
14601    ///
14602    /// # Example
14603    /// ```ignore,no_run
14604    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14605    /// let x = SnapshotPolicy::new().set_or_clear_enabled(Some(false));
14606    /// let x = SnapshotPolicy::new().set_or_clear_enabled(None::<bool>);
14607    /// ```
14608    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
14609    where
14610        T: std::convert::Into<bool>,
14611    {
14612        self.enabled = v.map(|x| x.into());
14613        self
14614    }
14615
14616    /// Sets the value of [hourly_schedule][crate::model::SnapshotPolicy::hourly_schedule].
14617    ///
14618    /// # Example
14619    /// ```ignore,no_run
14620    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14621    /// use google_cloud_netapp_v1::model::HourlySchedule;
14622    /// let x = SnapshotPolicy::new().set_hourly_schedule(HourlySchedule::default()/* use setters */);
14623    /// ```
14624    pub fn set_hourly_schedule<T>(mut self, v: T) -> Self
14625    where
14626        T: std::convert::Into<crate::model::HourlySchedule>,
14627    {
14628        self.hourly_schedule = std::option::Option::Some(v.into());
14629        self
14630    }
14631
14632    /// Sets or clears the value of [hourly_schedule][crate::model::SnapshotPolicy::hourly_schedule].
14633    ///
14634    /// # Example
14635    /// ```ignore,no_run
14636    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14637    /// use google_cloud_netapp_v1::model::HourlySchedule;
14638    /// let x = SnapshotPolicy::new().set_or_clear_hourly_schedule(Some(HourlySchedule::default()/* use setters */));
14639    /// let x = SnapshotPolicy::new().set_or_clear_hourly_schedule(None::<HourlySchedule>);
14640    /// ```
14641    pub fn set_or_clear_hourly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
14642    where
14643        T: std::convert::Into<crate::model::HourlySchedule>,
14644    {
14645        self.hourly_schedule = v.map(|x| x.into());
14646        self
14647    }
14648
14649    /// Sets the value of [daily_schedule][crate::model::SnapshotPolicy::daily_schedule].
14650    ///
14651    /// # Example
14652    /// ```ignore,no_run
14653    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14654    /// use google_cloud_netapp_v1::model::DailySchedule;
14655    /// let x = SnapshotPolicy::new().set_daily_schedule(DailySchedule::default()/* use setters */);
14656    /// ```
14657    pub fn set_daily_schedule<T>(mut self, v: T) -> Self
14658    where
14659        T: std::convert::Into<crate::model::DailySchedule>,
14660    {
14661        self.daily_schedule = std::option::Option::Some(v.into());
14662        self
14663    }
14664
14665    /// Sets or clears the value of [daily_schedule][crate::model::SnapshotPolicy::daily_schedule].
14666    ///
14667    /// # Example
14668    /// ```ignore,no_run
14669    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14670    /// use google_cloud_netapp_v1::model::DailySchedule;
14671    /// let x = SnapshotPolicy::new().set_or_clear_daily_schedule(Some(DailySchedule::default()/* use setters */));
14672    /// let x = SnapshotPolicy::new().set_or_clear_daily_schedule(None::<DailySchedule>);
14673    /// ```
14674    pub fn set_or_clear_daily_schedule<T>(mut self, v: std::option::Option<T>) -> Self
14675    where
14676        T: std::convert::Into<crate::model::DailySchedule>,
14677    {
14678        self.daily_schedule = v.map(|x| x.into());
14679        self
14680    }
14681
14682    /// Sets the value of [weekly_schedule][crate::model::SnapshotPolicy::weekly_schedule].
14683    ///
14684    /// # Example
14685    /// ```ignore,no_run
14686    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14687    /// use google_cloud_netapp_v1::model::WeeklySchedule;
14688    /// let x = SnapshotPolicy::new().set_weekly_schedule(WeeklySchedule::default()/* use setters */);
14689    /// ```
14690    pub fn set_weekly_schedule<T>(mut self, v: T) -> Self
14691    where
14692        T: std::convert::Into<crate::model::WeeklySchedule>,
14693    {
14694        self.weekly_schedule = std::option::Option::Some(v.into());
14695        self
14696    }
14697
14698    /// Sets or clears the value of [weekly_schedule][crate::model::SnapshotPolicy::weekly_schedule].
14699    ///
14700    /// # Example
14701    /// ```ignore,no_run
14702    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14703    /// use google_cloud_netapp_v1::model::WeeklySchedule;
14704    /// let x = SnapshotPolicy::new().set_or_clear_weekly_schedule(Some(WeeklySchedule::default()/* use setters */));
14705    /// let x = SnapshotPolicy::new().set_or_clear_weekly_schedule(None::<WeeklySchedule>);
14706    /// ```
14707    pub fn set_or_clear_weekly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
14708    where
14709        T: std::convert::Into<crate::model::WeeklySchedule>,
14710    {
14711        self.weekly_schedule = v.map(|x| x.into());
14712        self
14713    }
14714
14715    /// Sets the value of [monthly_schedule][crate::model::SnapshotPolicy::monthly_schedule].
14716    ///
14717    /// # Example
14718    /// ```ignore,no_run
14719    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14720    /// use google_cloud_netapp_v1::model::MonthlySchedule;
14721    /// let x = SnapshotPolicy::new().set_monthly_schedule(MonthlySchedule::default()/* use setters */);
14722    /// ```
14723    pub fn set_monthly_schedule<T>(mut self, v: T) -> Self
14724    where
14725        T: std::convert::Into<crate::model::MonthlySchedule>,
14726    {
14727        self.monthly_schedule = std::option::Option::Some(v.into());
14728        self
14729    }
14730
14731    /// Sets or clears the value of [monthly_schedule][crate::model::SnapshotPolicy::monthly_schedule].
14732    ///
14733    /// # Example
14734    /// ```ignore,no_run
14735    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14736    /// use google_cloud_netapp_v1::model::MonthlySchedule;
14737    /// let x = SnapshotPolicy::new().set_or_clear_monthly_schedule(Some(MonthlySchedule::default()/* use setters */));
14738    /// let x = SnapshotPolicy::new().set_or_clear_monthly_schedule(None::<MonthlySchedule>);
14739    /// ```
14740    pub fn set_or_clear_monthly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
14741    where
14742        T: std::convert::Into<crate::model::MonthlySchedule>,
14743    {
14744        self.monthly_schedule = v.map(|x| x.into());
14745        self
14746    }
14747}
14748
14749impl wkt::message::Message for SnapshotPolicy {
14750    fn typename() -> &'static str {
14751        "type.googleapis.com/google.cloud.netapp.v1.SnapshotPolicy"
14752    }
14753}
14754
14755/// Make a snapshot every hour e.g. at 04:00, 05:00, 06:00.
14756#[derive(Clone, Default, PartialEq)]
14757#[non_exhaustive]
14758pub struct HourlySchedule {
14759    /// The maximum number of Snapshots to keep for the hourly schedule
14760    pub snapshots_to_keep: std::option::Option<f64>,
14761
14762    /// Set the minute of the hour to start the snapshot (0-59), defaults to the
14763    /// top of the hour (0).
14764    pub minute: std::option::Option<f64>,
14765
14766    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14767}
14768
14769impl HourlySchedule {
14770    pub fn new() -> Self {
14771        std::default::Default::default()
14772    }
14773
14774    /// Sets the value of [snapshots_to_keep][crate::model::HourlySchedule::snapshots_to_keep].
14775    ///
14776    /// # Example
14777    /// ```ignore,no_run
14778    /// # use google_cloud_netapp_v1::model::HourlySchedule;
14779    /// let x = HourlySchedule::new().set_snapshots_to_keep(42.0);
14780    /// ```
14781    pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
14782    where
14783        T: std::convert::Into<f64>,
14784    {
14785        self.snapshots_to_keep = std::option::Option::Some(v.into());
14786        self
14787    }
14788
14789    /// Sets or clears the value of [snapshots_to_keep][crate::model::HourlySchedule::snapshots_to_keep].
14790    ///
14791    /// # Example
14792    /// ```ignore,no_run
14793    /// # use google_cloud_netapp_v1::model::HourlySchedule;
14794    /// let x = HourlySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
14795    /// let x = HourlySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
14796    /// ```
14797    pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
14798    where
14799        T: std::convert::Into<f64>,
14800    {
14801        self.snapshots_to_keep = v.map(|x| x.into());
14802        self
14803    }
14804
14805    /// Sets the value of [minute][crate::model::HourlySchedule::minute].
14806    ///
14807    /// # Example
14808    /// ```ignore,no_run
14809    /// # use google_cloud_netapp_v1::model::HourlySchedule;
14810    /// let x = HourlySchedule::new().set_minute(42.0);
14811    /// ```
14812    pub fn set_minute<T>(mut self, v: T) -> Self
14813    where
14814        T: std::convert::Into<f64>,
14815    {
14816        self.minute = std::option::Option::Some(v.into());
14817        self
14818    }
14819
14820    /// Sets or clears the value of [minute][crate::model::HourlySchedule::minute].
14821    ///
14822    /// # Example
14823    /// ```ignore,no_run
14824    /// # use google_cloud_netapp_v1::model::HourlySchedule;
14825    /// let x = HourlySchedule::new().set_or_clear_minute(Some(42.0));
14826    /// let x = HourlySchedule::new().set_or_clear_minute(None::<f32>);
14827    /// ```
14828    pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
14829    where
14830        T: std::convert::Into<f64>,
14831    {
14832        self.minute = v.map(|x| x.into());
14833        self
14834    }
14835}
14836
14837impl wkt::message::Message for HourlySchedule {
14838    fn typename() -> &'static str {
14839        "type.googleapis.com/google.cloud.netapp.v1.HourlySchedule"
14840    }
14841}
14842
14843/// Make a snapshot every day e.g. at 04:00, 05:20, 23:50
14844#[derive(Clone, Default, PartialEq)]
14845#[non_exhaustive]
14846pub struct DailySchedule {
14847    /// The maximum number of Snapshots to keep for the hourly schedule
14848    pub snapshots_to_keep: std::option::Option<f64>,
14849
14850    /// Set the minute of the hour to start the snapshot (0-59), defaults to the
14851    /// top of the hour (0).
14852    pub minute: std::option::Option<f64>,
14853
14854    /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
14855    pub hour: std::option::Option<f64>,
14856
14857    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14858}
14859
14860impl DailySchedule {
14861    pub fn new() -> Self {
14862        std::default::Default::default()
14863    }
14864
14865    /// Sets the value of [snapshots_to_keep][crate::model::DailySchedule::snapshots_to_keep].
14866    ///
14867    /// # Example
14868    /// ```ignore,no_run
14869    /// # use google_cloud_netapp_v1::model::DailySchedule;
14870    /// let x = DailySchedule::new().set_snapshots_to_keep(42.0);
14871    /// ```
14872    pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
14873    where
14874        T: std::convert::Into<f64>,
14875    {
14876        self.snapshots_to_keep = std::option::Option::Some(v.into());
14877        self
14878    }
14879
14880    /// Sets or clears the value of [snapshots_to_keep][crate::model::DailySchedule::snapshots_to_keep].
14881    ///
14882    /// # Example
14883    /// ```ignore,no_run
14884    /// # use google_cloud_netapp_v1::model::DailySchedule;
14885    /// let x = DailySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
14886    /// let x = DailySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
14887    /// ```
14888    pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
14889    where
14890        T: std::convert::Into<f64>,
14891    {
14892        self.snapshots_to_keep = v.map(|x| x.into());
14893        self
14894    }
14895
14896    /// Sets the value of [minute][crate::model::DailySchedule::minute].
14897    ///
14898    /// # Example
14899    /// ```ignore,no_run
14900    /// # use google_cloud_netapp_v1::model::DailySchedule;
14901    /// let x = DailySchedule::new().set_minute(42.0);
14902    /// ```
14903    pub fn set_minute<T>(mut self, v: T) -> Self
14904    where
14905        T: std::convert::Into<f64>,
14906    {
14907        self.minute = std::option::Option::Some(v.into());
14908        self
14909    }
14910
14911    /// Sets or clears the value of [minute][crate::model::DailySchedule::minute].
14912    ///
14913    /// # Example
14914    /// ```ignore,no_run
14915    /// # use google_cloud_netapp_v1::model::DailySchedule;
14916    /// let x = DailySchedule::new().set_or_clear_minute(Some(42.0));
14917    /// let x = DailySchedule::new().set_or_clear_minute(None::<f32>);
14918    /// ```
14919    pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
14920    where
14921        T: std::convert::Into<f64>,
14922    {
14923        self.minute = v.map(|x| x.into());
14924        self
14925    }
14926
14927    /// Sets the value of [hour][crate::model::DailySchedule::hour].
14928    ///
14929    /// # Example
14930    /// ```ignore,no_run
14931    /// # use google_cloud_netapp_v1::model::DailySchedule;
14932    /// let x = DailySchedule::new().set_hour(42.0);
14933    /// ```
14934    pub fn set_hour<T>(mut self, v: T) -> Self
14935    where
14936        T: std::convert::Into<f64>,
14937    {
14938        self.hour = std::option::Option::Some(v.into());
14939        self
14940    }
14941
14942    /// Sets or clears the value of [hour][crate::model::DailySchedule::hour].
14943    ///
14944    /// # Example
14945    /// ```ignore,no_run
14946    /// # use google_cloud_netapp_v1::model::DailySchedule;
14947    /// let x = DailySchedule::new().set_or_clear_hour(Some(42.0));
14948    /// let x = DailySchedule::new().set_or_clear_hour(None::<f32>);
14949    /// ```
14950    pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
14951    where
14952        T: std::convert::Into<f64>,
14953    {
14954        self.hour = v.map(|x| x.into());
14955        self
14956    }
14957}
14958
14959impl wkt::message::Message for DailySchedule {
14960    fn typename() -> &'static str {
14961        "type.googleapis.com/google.cloud.netapp.v1.DailySchedule"
14962    }
14963}
14964
14965/// Make a snapshot every week e.g. at Monday 04:00, Wednesday 05:20, Sunday
14966/// 23:50
14967#[derive(Clone, Default, PartialEq)]
14968#[non_exhaustive]
14969pub struct WeeklySchedule {
14970    /// The maximum number of Snapshots to keep for the hourly schedule
14971    pub snapshots_to_keep: std::option::Option<f64>,
14972
14973    /// Set the minute of the hour to start the snapshot (0-59), defaults to the
14974    /// top of the hour (0).
14975    pub minute: std::option::Option<f64>,
14976
14977    /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
14978    pub hour: std::option::Option<f64>,
14979
14980    /// Set the day or days of the week to make a snapshot. Accepts a comma
14981    /// separated days of the week. Defaults to 'Sunday'.
14982    pub day: std::option::Option<std::string::String>,
14983
14984    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14985}
14986
14987impl WeeklySchedule {
14988    pub fn new() -> Self {
14989        std::default::Default::default()
14990    }
14991
14992    /// Sets the value of [snapshots_to_keep][crate::model::WeeklySchedule::snapshots_to_keep].
14993    ///
14994    /// # Example
14995    /// ```ignore,no_run
14996    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
14997    /// let x = WeeklySchedule::new().set_snapshots_to_keep(42.0);
14998    /// ```
14999    pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
15000    where
15001        T: std::convert::Into<f64>,
15002    {
15003        self.snapshots_to_keep = std::option::Option::Some(v.into());
15004        self
15005    }
15006
15007    /// Sets or clears the value of [snapshots_to_keep][crate::model::WeeklySchedule::snapshots_to_keep].
15008    ///
15009    /// # Example
15010    /// ```ignore,no_run
15011    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15012    /// let x = WeeklySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
15013    /// let x = WeeklySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
15014    /// ```
15015    pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
15016    where
15017        T: std::convert::Into<f64>,
15018    {
15019        self.snapshots_to_keep = v.map(|x| x.into());
15020        self
15021    }
15022
15023    /// Sets the value of [minute][crate::model::WeeklySchedule::minute].
15024    ///
15025    /// # Example
15026    /// ```ignore,no_run
15027    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15028    /// let x = WeeklySchedule::new().set_minute(42.0);
15029    /// ```
15030    pub fn set_minute<T>(mut self, v: T) -> Self
15031    where
15032        T: std::convert::Into<f64>,
15033    {
15034        self.minute = std::option::Option::Some(v.into());
15035        self
15036    }
15037
15038    /// Sets or clears the value of [minute][crate::model::WeeklySchedule::minute].
15039    ///
15040    /// # Example
15041    /// ```ignore,no_run
15042    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15043    /// let x = WeeklySchedule::new().set_or_clear_minute(Some(42.0));
15044    /// let x = WeeklySchedule::new().set_or_clear_minute(None::<f32>);
15045    /// ```
15046    pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
15047    where
15048        T: std::convert::Into<f64>,
15049    {
15050        self.minute = v.map(|x| x.into());
15051        self
15052    }
15053
15054    /// Sets the value of [hour][crate::model::WeeklySchedule::hour].
15055    ///
15056    /// # Example
15057    /// ```ignore,no_run
15058    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15059    /// let x = WeeklySchedule::new().set_hour(42.0);
15060    /// ```
15061    pub fn set_hour<T>(mut self, v: T) -> Self
15062    where
15063        T: std::convert::Into<f64>,
15064    {
15065        self.hour = std::option::Option::Some(v.into());
15066        self
15067    }
15068
15069    /// Sets or clears the value of [hour][crate::model::WeeklySchedule::hour].
15070    ///
15071    /// # Example
15072    /// ```ignore,no_run
15073    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15074    /// let x = WeeklySchedule::new().set_or_clear_hour(Some(42.0));
15075    /// let x = WeeklySchedule::new().set_or_clear_hour(None::<f32>);
15076    /// ```
15077    pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
15078    where
15079        T: std::convert::Into<f64>,
15080    {
15081        self.hour = v.map(|x| x.into());
15082        self
15083    }
15084
15085    /// Sets the value of [day][crate::model::WeeklySchedule::day].
15086    ///
15087    /// # Example
15088    /// ```ignore,no_run
15089    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15090    /// let x = WeeklySchedule::new().set_day("example");
15091    /// ```
15092    pub fn set_day<T>(mut self, v: T) -> Self
15093    where
15094        T: std::convert::Into<std::string::String>,
15095    {
15096        self.day = std::option::Option::Some(v.into());
15097        self
15098    }
15099
15100    /// Sets or clears the value of [day][crate::model::WeeklySchedule::day].
15101    ///
15102    /// # Example
15103    /// ```ignore,no_run
15104    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15105    /// let x = WeeklySchedule::new().set_or_clear_day(Some("example"));
15106    /// let x = WeeklySchedule::new().set_or_clear_day(None::<String>);
15107    /// ```
15108    pub fn set_or_clear_day<T>(mut self, v: std::option::Option<T>) -> Self
15109    where
15110        T: std::convert::Into<std::string::String>,
15111    {
15112        self.day = v.map(|x| x.into());
15113        self
15114    }
15115}
15116
15117impl wkt::message::Message for WeeklySchedule {
15118    fn typename() -> &'static str {
15119        "type.googleapis.com/google.cloud.netapp.v1.WeeklySchedule"
15120    }
15121}
15122
15123/// Make a snapshot once a month e.g. at 2nd 04:00, 7th 05:20, 24th 23:50
15124#[derive(Clone, Default, PartialEq)]
15125#[non_exhaustive]
15126pub struct MonthlySchedule {
15127    /// The maximum number of Snapshots to keep for the hourly schedule
15128    pub snapshots_to_keep: std::option::Option<f64>,
15129
15130    /// Set the minute of the hour to start the snapshot (0-59), defaults to the
15131    /// top of the hour (0).
15132    pub minute: std::option::Option<f64>,
15133
15134    /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
15135    pub hour: std::option::Option<f64>,
15136
15137    /// Set the day or days of the month to make a snapshot (1-31). Accepts a
15138    /// comma separated number of days. Defaults to '1'.
15139    pub days_of_month: std::option::Option<std::string::String>,
15140
15141    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15142}
15143
15144impl MonthlySchedule {
15145    pub fn new() -> Self {
15146        std::default::Default::default()
15147    }
15148
15149    /// Sets the value of [snapshots_to_keep][crate::model::MonthlySchedule::snapshots_to_keep].
15150    ///
15151    /// # Example
15152    /// ```ignore,no_run
15153    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15154    /// let x = MonthlySchedule::new().set_snapshots_to_keep(42.0);
15155    /// ```
15156    pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
15157    where
15158        T: std::convert::Into<f64>,
15159    {
15160        self.snapshots_to_keep = std::option::Option::Some(v.into());
15161        self
15162    }
15163
15164    /// Sets or clears the value of [snapshots_to_keep][crate::model::MonthlySchedule::snapshots_to_keep].
15165    ///
15166    /// # Example
15167    /// ```ignore,no_run
15168    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15169    /// let x = MonthlySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
15170    /// let x = MonthlySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
15171    /// ```
15172    pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
15173    where
15174        T: std::convert::Into<f64>,
15175    {
15176        self.snapshots_to_keep = v.map(|x| x.into());
15177        self
15178    }
15179
15180    /// Sets the value of [minute][crate::model::MonthlySchedule::minute].
15181    ///
15182    /// # Example
15183    /// ```ignore,no_run
15184    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15185    /// let x = MonthlySchedule::new().set_minute(42.0);
15186    /// ```
15187    pub fn set_minute<T>(mut self, v: T) -> Self
15188    where
15189        T: std::convert::Into<f64>,
15190    {
15191        self.minute = std::option::Option::Some(v.into());
15192        self
15193    }
15194
15195    /// Sets or clears the value of [minute][crate::model::MonthlySchedule::minute].
15196    ///
15197    /// # Example
15198    /// ```ignore,no_run
15199    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15200    /// let x = MonthlySchedule::new().set_or_clear_minute(Some(42.0));
15201    /// let x = MonthlySchedule::new().set_or_clear_minute(None::<f32>);
15202    /// ```
15203    pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
15204    where
15205        T: std::convert::Into<f64>,
15206    {
15207        self.minute = v.map(|x| x.into());
15208        self
15209    }
15210
15211    /// Sets the value of [hour][crate::model::MonthlySchedule::hour].
15212    ///
15213    /// # Example
15214    /// ```ignore,no_run
15215    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15216    /// let x = MonthlySchedule::new().set_hour(42.0);
15217    /// ```
15218    pub fn set_hour<T>(mut self, v: T) -> Self
15219    where
15220        T: std::convert::Into<f64>,
15221    {
15222        self.hour = std::option::Option::Some(v.into());
15223        self
15224    }
15225
15226    /// Sets or clears the value of [hour][crate::model::MonthlySchedule::hour].
15227    ///
15228    /// # Example
15229    /// ```ignore,no_run
15230    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15231    /// let x = MonthlySchedule::new().set_or_clear_hour(Some(42.0));
15232    /// let x = MonthlySchedule::new().set_or_clear_hour(None::<f32>);
15233    /// ```
15234    pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
15235    where
15236        T: std::convert::Into<f64>,
15237    {
15238        self.hour = v.map(|x| x.into());
15239        self
15240    }
15241
15242    /// Sets the value of [days_of_month][crate::model::MonthlySchedule::days_of_month].
15243    ///
15244    /// # Example
15245    /// ```ignore,no_run
15246    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15247    /// let x = MonthlySchedule::new().set_days_of_month("example");
15248    /// ```
15249    pub fn set_days_of_month<T>(mut self, v: T) -> Self
15250    where
15251        T: std::convert::Into<std::string::String>,
15252    {
15253        self.days_of_month = std::option::Option::Some(v.into());
15254        self
15255    }
15256
15257    /// Sets or clears the value of [days_of_month][crate::model::MonthlySchedule::days_of_month].
15258    ///
15259    /// # Example
15260    /// ```ignore,no_run
15261    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15262    /// let x = MonthlySchedule::new().set_or_clear_days_of_month(Some("example"));
15263    /// let x = MonthlySchedule::new().set_or_clear_days_of_month(None::<String>);
15264    /// ```
15265    pub fn set_or_clear_days_of_month<T>(mut self, v: std::option::Option<T>) -> Self
15266    where
15267        T: std::convert::Into<std::string::String>,
15268    {
15269        self.days_of_month = v.map(|x| x.into());
15270        self
15271    }
15272}
15273
15274impl wkt::message::Message for MonthlySchedule {
15275    fn typename() -> &'static str {
15276        "type.googleapis.com/google.cloud.netapp.v1.MonthlySchedule"
15277    }
15278}
15279
15280/// View only mount options for a volume.
15281#[derive(Clone, Default, PartialEq)]
15282#[non_exhaustive]
15283pub struct MountOption {
15284    /// Export string
15285    pub export: std::string::String,
15286
15287    /// Full export string
15288    pub export_full: std::string::String,
15289
15290    /// Protocol to mount with.
15291    pub protocol: crate::model::Protocols,
15292
15293    /// Instructions for mounting
15294    pub instructions: std::string::String,
15295
15296    /// Output only. IP Address.
15297    pub ip_address: std::string::String,
15298
15299    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15300}
15301
15302impl MountOption {
15303    pub fn new() -> Self {
15304        std::default::Default::default()
15305    }
15306
15307    /// Sets the value of [export][crate::model::MountOption::export].
15308    ///
15309    /// # Example
15310    /// ```ignore,no_run
15311    /// # use google_cloud_netapp_v1::model::MountOption;
15312    /// let x = MountOption::new().set_export("example");
15313    /// ```
15314    pub fn set_export<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15315        self.export = v.into();
15316        self
15317    }
15318
15319    /// Sets the value of [export_full][crate::model::MountOption::export_full].
15320    ///
15321    /// # Example
15322    /// ```ignore,no_run
15323    /// # use google_cloud_netapp_v1::model::MountOption;
15324    /// let x = MountOption::new().set_export_full("example");
15325    /// ```
15326    pub fn set_export_full<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15327        self.export_full = v.into();
15328        self
15329    }
15330
15331    /// Sets the value of [protocol][crate::model::MountOption::protocol].
15332    ///
15333    /// # Example
15334    /// ```ignore,no_run
15335    /// # use google_cloud_netapp_v1::model::MountOption;
15336    /// use google_cloud_netapp_v1::model::Protocols;
15337    /// let x0 = MountOption::new().set_protocol(Protocols::Nfsv3);
15338    /// let x1 = MountOption::new().set_protocol(Protocols::Nfsv4);
15339    /// let x2 = MountOption::new().set_protocol(Protocols::Smb);
15340    /// ```
15341    pub fn set_protocol<T: std::convert::Into<crate::model::Protocols>>(mut self, v: T) -> Self {
15342        self.protocol = v.into();
15343        self
15344    }
15345
15346    /// Sets the value of [instructions][crate::model::MountOption::instructions].
15347    ///
15348    /// # Example
15349    /// ```ignore,no_run
15350    /// # use google_cloud_netapp_v1::model::MountOption;
15351    /// let x = MountOption::new().set_instructions("example");
15352    /// ```
15353    pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15354        self.instructions = v.into();
15355        self
15356    }
15357
15358    /// Sets the value of [ip_address][crate::model::MountOption::ip_address].
15359    ///
15360    /// # Example
15361    /// ```ignore,no_run
15362    /// # use google_cloud_netapp_v1::model::MountOption;
15363    /// let x = MountOption::new().set_ip_address("example");
15364    /// ```
15365    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15366        self.ip_address = v.into();
15367        self
15368    }
15369}
15370
15371impl wkt::message::Message for MountOption {
15372    fn typename() -> &'static str {
15373        "type.googleapis.com/google.cloud.netapp.v1.MountOption"
15374    }
15375}
15376
15377/// The RestoreParameters if volume is created from a snapshot or backup.
15378#[derive(Clone, Default, PartialEq)]
15379#[non_exhaustive]
15380pub struct RestoreParameters {
15381    /// The source that the volume is created from.
15382    pub source: std::option::Option<crate::model::restore_parameters::Source>,
15383
15384    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15385}
15386
15387impl RestoreParameters {
15388    pub fn new() -> Self {
15389        std::default::Default::default()
15390    }
15391
15392    /// Sets the value of [source][crate::model::RestoreParameters::source].
15393    ///
15394    /// Note that all the setters affecting `source` are mutually
15395    /// exclusive.
15396    ///
15397    /// # Example
15398    /// ```ignore,no_run
15399    /// # use google_cloud_netapp_v1::model::RestoreParameters;
15400    /// use google_cloud_netapp_v1::model::restore_parameters::Source;
15401    /// let x = RestoreParameters::new().set_source(Some(Source::SourceSnapshot("example".to_string())));
15402    /// ```
15403    pub fn set_source<
15404        T: std::convert::Into<std::option::Option<crate::model::restore_parameters::Source>>,
15405    >(
15406        mut self,
15407        v: T,
15408    ) -> Self {
15409        self.source = v.into();
15410        self
15411    }
15412
15413    /// The value of [source][crate::model::RestoreParameters::source]
15414    /// if it holds a `SourceSnapshot`, `None` if the field is not set or
15415    /// holds a different branch.
15416    pub fn source_snapshot(&self) -> std::option::Option<&std::string::String> {
15417        #[allow(unreachable_patterns)]
15418        self.source.as_ref().and_then(|v| match v {
15419            crate::model::restore_parameters::Source::SourceSnapshot(v) => {
15420                std::option::Option::Some(v)
15421            }
15422            _ => std::option::Option::None,
15423        })
15424    }
15425
15426    /// Sets the value of [source][crate::model::RestoreParameters::source]
15427    /// to hold a `SourceSnapshot`.
15428    ///
15429    /// Note that all the setters affecting `source` are
15430    /// mutually exclusive.
15431    ///
15432    /// # Example
15433    /// ```ignore,no_run
15434    /// # use google_cloud_netapp_v1::model::RestoreParameters;
15435    /// let x = RestoreParameters::new().set_source_snapshot("example");
15436    /// assert!(x.source_snapshot().is_some());
15437    /// assert!(x.source_backup().is_none());
15438    /// ```
15439    pub fn set_source_snapshot<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15440        self.source = std::option::Option::Some(
15441            crate::model::restore_parameters::Source::SourceSnapshot(v.into()),
15442        );
15443        self
15444    }
15445
15446    /// The value of [source][crate::model::RestoreParameters::source]
15447    /// if it holds a `SourceBackup`, `None` if the field is not set or
15448    /// holds a different branch.
15449    pub fn source_backup(&self) -> std::option::Option<&std::string::String> {
15450        #[allow(unreachable_patterns)]
15451        self.source.as_ref().and_then(|v| match v {
15452            crate::model::restore_parameters::Source::SourceBackup(v) => {
15453                std::option::Option::Some(v)
15454            }
15455            _ => std::option::Option::None,
15456        })
15457    }
15458
15459    /// Sets the value of [source][crate::model::RestoreParameters::source]
15460    /// to hold a `SourceBackup`.
15461    ///
15462    /// Note that all the setters affecting `source` are
15463    /// mutually exclusive.
15464    ///
15465    /// # Example
15466    /// ```ignore,no_run
15467    /// # use google_cloud_netapp_v1::model::RestoreParameters;
15468    /// let x = RestoreParameters::new().set_source_backup("example");
15469    /// assert!(x.source_backup().is_some());
15470    /// assert!(x.source_snapshot().is_none());
15471    /// ```
15472    pub fn set_source_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15473        self.source = std::option::Option::Some(
15474            crate::model::restore_parameters::Source::SourceBackup(v.into()),
15475        );
15476        self
15477    }
15478}
15479
15480impl wkt::message::Message for RestoreParameters {
15481    fn typename() -> &'static str {
15482        "type.googleapis.com/google.cloud.netapp.v1.RestoreParameters"
15483    }
15484}
15485
15486/// Defines additional types related to [RestoreParameters].
15487pub mod restore_parameters {
15488    #[allow(unused_imports)]
15489    use super::*;
15490
15491    /// The source that the volume is created from.
15492    #[derive(Clone, Debug, PartialEq)]
15493    #[non_exhaustive]
15494    pub enum Source {
15495        /// Full name of the snapshot resource.
15496        /// Format:
15497        /// projects/{project}/locations/{location}/volumes/{volume}/snapshots/{snapshot}
15498        SourceSnapshot(std::string::String),
15499        /// Full name of the backup resource.
15500        /// Format:
15501        /// projects/{project}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}
15502        SourceBackup(std::string::String),
15503    }
15504}
15505
15506/// BackupConfig contains backup related config on a volume.
15507#[derive(Clone, Default, PartialEq)]
15508#[non_exhaustive]
15509pub struct BackupConfig {
15510    /// Optional. When specified, schedule backups will be created based on the
15511    /// policy configuration.
15512    pub backup_policies: std::vec::Vec<std::string::String>,
15513
15514    /// Optional. Name of backup vault.
15515    /// Format:
15516    /// projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}
15517    pub backup_vault: std::string::String,
15518
15519    /// Optional. When set to true, scheduled backup is enabled on the volume.
15520    /// This field should be nil when there's no backup policy attached.
15521    pub scheduled_backup_enabled: std::option::Option<bool>,
15522
15523    /// Output only. Total size of all backups in a chain in bytes = baseline
15524    /// backup size + sum(incremental backup size).
15525    pub backup_chain_bytes: std::option::Option<i64>,
15526
15527    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15528}
15529
15530impl BackupConfig {
15531    pub fn new() -> Self {
15532        std::default::Default::default()
15533    }
15534
15535    /// Sets the value of [backup_policies][crate::model::BackupConfig::backup_policies].
15536    ///
15537    /// # Example
15538    /// ```ignore,no_run
15539    /// # use google_cloud_netapp_v1::model::BackupConfig;
15540    /// let x = BackupConfig::new().set_backup_policies(["a", "b", "c"]);
15541    /// ```
15542    pub fn set_backup_policies<T, V>(mut self, v: T) -> Self
15543    where
15544        T: std::iter::IntoIterator<Item = V>,
15545        V: std::convert::Into<std::string::String>,
15546    {
15547        use std::iter::Iterator;
15548        self.backup_policies = v.into_iter().map(|i| i.into()).collect();
15549        self
15550    }
15551
15552    /// Sets the value of [backup_vault][crate::model::BackupConfig::backup_vault].
15553    ///
15554    /// # Example
15555    /// ```ignore,no_run
15556    /// # use google_cloud_netapp_v1::model::BackupConfig;
15557    /// let x = BackupConfig::new().set_backup_vault("example");
15558    /// ```
15559    pub fn set_backup_vault<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15560        self.backup_vault = v.into();
15561        self
15562    }
15563
15564    /// Sets the value of [scheduled_backup_enabled][crate::model::BackupConfig::scheduled_backup_enabled].
15565    ///
15566    /// # Example
15567    /// ```ignore,no_run
15568    /// # use google_cloud_netapp_v1::model::BackupConfig;
15569    /// let x = BackupConfig::new().set_scheduled_backup_enabled(true);
15570    /// ```
15571    pub fn set_scheduled_backup_enabled<T>(mut self, v: T) -> Self
15572    where
15573        T: std::convert::Into<bool>,
15574    {
15575        self.scheduled_backup_enabled = std::option::Option::Some(v.into());
15576        self
15577    }
15578
15579    /// Sets or clears the value of [scheduled_backup_enabled][crate::model::BackupConfig::scheduled_backup_enabled].
15580    ///
15581    /// # Example
15582    /// ```ignore,no_run
15583    /// # use google_cloud_netapp_v1::model::BackupConfig;
15584    /// let x = BackupConfig::new().set_or_clear_scheduled_backup_enabled(Some(false));
15585    /// let x = BackupConfig::new().set_or_clear_scheduled_backup_enabled(None::<bool>);
15586    /// ```
15587    pub fn set_or_clear_scheduled_backup_enabled<T>(mut self, v: std::option::Option<T>) -> Self
15588    where
15589        T: std::convert::Into<bool>,
15590    {
15591        self.scheduled_backup_enabled = v.map(|x| x.into());
15592        self
15593    }
15594
15595    /// Sets the value of [backup_chain_bytes][crate::model::BackupConfig::backup_chain_bytes].
15596    ///
15597    /// # Example
15598    /// ```ignore,no_run
15599    /// # use google_cloud_netapp_v1::model::BackupConfig;
15600    /// let x = BackupConfig::new().set_backup_chain_bytes(42);
15601    /// ```
15602    pub fn set_backup_chain_bytes<T>(mut self, v: T) -> Self
15603    where
15604        T: std::convert::Into<i64>,
15605    {
15606        self.backup_chain_bytes = std::option::Option::Some(v.into());
15607        self
15608    }
15609
15610    /// Sets or clears the value of [backup_chain_bytes][crate::model::BackupConfig::backup_chain_bytes].
15611    ///
15612    /// # Example
15613    /// ```ignore,no_run
15614    /// # use google_cloud_netapp_v1::model::BackupConfig;
15615    /// let x = BackupConfig::new().set_or_clear_backup_chain_bytes(Some(42));
15616    /// let x = BackupConfig::new().set_or_clear_backup_chain_bytes(None::<i32>);
15617    /// ```
15618    pub fn set_or_clear_backup_chain_bytes<T>(mut self, v: std::option::Option<T>) -> Self
15619    where
15620        T: std::convert::Into<i64>,
15621    {
15622        self.backup_chain_bytes = v.map(|x| x.into());
15623        self
15624    }
15625}
15626
15627impl wkt::message::Message for BackupConfig {
15628    fn typename() -> &'static str {
15629        "type.googleapis.com/google.cloud.netapp.v1.BackupConfig"
15630    }
15631}
15632
15633/// Defines tiering policy for the volume.
15634#[derive(Clone, Default, PartialEq)]
15635#[non_exhaustive]
15636pub struct TieringPolicy {
15637    /// Optional. Flag indicating if the volume has tiering policy enable/pause.
15638    /// Default is PAUSED.
15639    pub tier_action: std::option::Option<crate::model::tiering_policy::TierAction>,
15640
15641    /// Optional. Time in days to mark the volume's data block as cold and make it
15642    /// eligible for tiering, can be range from 2-183. Default is 31.
15643    pub cooling_threshold_days: std::option::Option<i32>,
15644
15645    /// Optional. Flag indicating that the hot tier bypass mode is enabled. Default
15646    /// is false. This is only applicable to Flex service level.
15647    pub hot_tier_bypass_mode_enabled: std::option::Option<bool>,
15648
15649    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15650}
15651
15652impl TieringPolicy {
15653    pub fn new() -> Self {
15654        std::default::Default::default()
15655    }
15656
15657    /// Sets the value of [tier_action][crate::model::TieringPolicy::tier_action].
15658    ///
15659    /// # Example
15660    /// ```ignore,no_run
15661    /// # use google_cloud_netapp_v1::model::TieringPolicy;
15662    /// use google_cloud_netapp_v1::model::tiering_policy::TierAction;
15663    /// let x0 = TieringPolicy::new().set_tier_action(TierAction::Enabled);
15664    /// let x1 = TieringPolicy::new().set_tier_action(TierAction::Paused);
15665    /// ```
15666    pub fn set_tier_action<T>(mut self, v: T) -> Self
15667    where
15668        T: std::convert::Into<crate::model::tiering_policy::TierAction>,
15669    {
15670        self.tier_action = std::option::Option::Some(v.into());
15671        self
15672    }
15673
15674    /// Sets or clears the value of [tier_action][crate::model::TieringPolicy::tier_action].
15675    ///
15676    /// # Example
15677    /// ```ignore,no_run
15678    /// # use google_cloud_netapp_v1::model::TieringPolicy;
15679    /// use google_cloud_netapp_v1::model::tiering_policy::TierAction;
15680    /// let x0 = TieringPolicy::new().set_or_clear_tier_action(Some(TierAction::Enabled));
15681    /// let x1 = TieringPolicy::new().set_or_clear_tier_action(Some(TierAction::Paused));
15682    /// let x_none = TieringPolicy::new().set_or_clear_tier_action(None::<TierAction>);
15683    /// ```
15684    pub fn set_or_clear_tier_action<T>(mut self, v: std::option::Option<T>) -> Self
15685    where
15686        T: std::convert::Into<crate::model::tiering_policy::TierAction>,
15687    {
15688        self.tier_action = v.map(|x| x.into());
15689        self
15690    }
15691
15692    /// Sets the value of [cooling_threshold_days][crate::model::TieringPolicy::cooling_threshold_days].
15693    ///
15694    /// # Example
15695    /// ```ignore,no_run
15696    /// # use google_cloud_netapp_v1::model::TieringPolicy;
15697    /// let x = TieringPolicy::new().set_cooling_threshold_days(42);
15698    /// ```
15699    pub fn set_cooling_threshold_days<T>(mut self, v: T) -> Self
15700    where
15701        T: std::convert::Into<i32>,
15702    {
15703        self.cooling_threshold_days = std::option::Option::Some(v.into());
15704        self
15705    }
15706
15707    /// Sets or clears the value of [cooling_threshold_days][crate::model::TieringPolicy::cooling_threshold_days].
15708    ///
15709    /// # Example
15710    /// ```ignore,no_run
15711    /// # use google_cloud_netapp_v1::model::TieringPolicy;
15712    /// let x = TieringPolicy::new().set_or_clear_cooling_threshold_days(Some(42));
15713    /// let x = TieringPolicy::new().set_or_clear_cooling_threshold_days(None::<i32>);
15714    /// ```
15715    pub fn set_or_clear_cooling_threshold_days<T>(mut self, v: std::option::Option<T>) -> Self
15716    where
15717        T: std::convert::Into<i32>,
15718    {
15719        self.cooling_threshold_days = v.map(|x| x.into());
15720        self
15721    }
15722
15723    /// Sets the value of [hot_tier_bypass_mode_enabled][crate::model::TieringPolicy::hot_tier_bypass_mode_enabled].
15724    ///
15725    /// # Example
15726    /// ```ignore,no_run
15727    /// # use google_cloud_netapp_v1::model::TieringPolicy;
15728    /// let x = TieringPolicy::new().set_hot_tier_bypass_mode_enabled(true);
15729    /// ```
15730    pub fn set_hot_tier_bypass_mode_enabled<T>(mut self, v: T) -> Self
15731    where
15732        T: std::convert::Into<bool>,
15733    {
15734        self.hot_tier_bypass_mode_enabled = std::option::Option::Some(v.into());
15735        self
15736    }
15737
15738    /// Sets or clears the value of [hot_tier_bypass_mode_enabled][crate::model::TieringPolicy::hot_tier_bypass_mode_enabled].
15739    ///
15740    /// # Example
15741    /// ```ignore,no_run
15742    /// # use google_cloud_netapp_v1::model::TieringPolicy;
15743    /// let x = TieringPolicy::new().set_or_clear_hot_tier_bypass_mode_enabled(Some(false));
15744    /// let x = TieringPolicy::new().set_or_clear_hot_tier_bypass_mode_enabled(None::<bool>);
15745    /// ```
15746    pub fn set_or_clear_hot_tier_bypass_mode_enabled<T>(mut self, v: std::option::Option<T>) -> Self
15747    where
15748        T: std::convert::Into<bool>,
15749    {
15750        self.hot_tier_bypass_mode_enabled = v.map(|x| x.into());
15751        self
15752    }
15753}
15754
15755impl wkt::message::Message for TieringPolicy {
15756    fn typename() -> &'static str {
15757        "type.googleapis.com/google.cloud.netapp.v1.TieringPolicy"
15758    }
15759}
15760
15761/// Defines additional types related to [TieringPolicy].
15762pub mod tiering_policy {
15763    #[allow(unused_imports)]
15764    use super::*;
15765
15766    /// Tier action for the volume.
15767    ///
15768    /// # Working with unknown values
15769    ///
15770    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15771    /// additional enum variants at any time. Adding new variants is not considered
15772    /// a breaking change. Applications should write their code in anticipation of:
15773    ///
15774    /// - New values appearing in future releases of the client library, **and**
15775    /// - New values received dynamically, without application changes.
15776    ///
15777    /// Please consult the [Working with enums] section in the user guide for some
15778    /// guidelines.
15779    ///
15780    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15781    #[derive(Clone, Debug, PartialEq)]
15782    #[non_exhaustive]
15783    pub enum TierAction {
15784        /// Unspecified.
15785        Unspecified,
15786        /// When tiering is enabled, new cold data will be tiered.
15787        Enabled,
15788        /// When paused, tiering won't be performed on new data. Existing data stays
15789        /// tiered until accessed.
15790        Paused,
15791        /// If set, the enum was initialized with an unknown value.
15792        ///
15793        /// Applications can examine the value using [TierAction::value] or
15794        /// [TierAction::name].
15795        UnknownValue(tier_action::UnknownValue),
15796    }
15797
15798    #[doc(hidden)]
15799    pub mod tier_action {
15800        #[allow(unused_imports)]
15801        use super::*;
15802        #[derive(Clone, Debug, PartialEq)]
15803        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15804    }
15805
15806    impl TierAction {
15807        /// Gets the enum value.
15808        ///
15809        /// Returns `None` if the enum contains an unknown value deserialized from
15810        /// the string representation of enums.
15811        pub fn value(&self) -> std::option::Option<i32> {
15812            match self {
15813                Self::Unspecified => std::option::Option::Some(0),
15814                Self::Enabled => std::option::Option::Some(1),
15815                Self::Paused => std::option::Option::Some(2),
15816                Self::UnknownValue(u) => u.0.value(),
15817            }
15818        }
15819
15820        /// Gets the enum value as a string.
15821        ///
15822        /// Returns `None` if the enum contains an unknown value deserialized from
15823        /// the integer representation of enums.
15824        pub fn name(&self) -> std::option::Option<&str> {
15825            match self {
15826                Self::Unspecified => std::option::Option::Some("TIER_ACTION_UNSPECIFIED"),
15827                Self::Enabled => std::option::Option::Some("ENABLED"),
15828                Self::Paused => std::option::Option::Some("PAUSED"),
15829                Self::UnknownValue(u) => u.0.name(),
15830            }
15831        }
15832    }
15833
15834    impl std::default::Default for TierAction {
15835        fn default() -> Self {
15836            use std::convert::From;
15837            Self::from(0)
15838        }
15839    }
15840
15841    impl std::fmt::Display for TierAction {
15842        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15843            wkt::internal::display_enum(f, self.name(), self.value())
15844        }
15845    }
15846
15847    impl std::convert::From<i32> for TierAction {
15848        fn from(value: i32) -> Self {
15849            match value {
15850                0 => Self::Unspecified,
15851                1 => Self::Enabled,
15852                2 => Self::Paused,
15853                _ => Self::UnknownValue(tier_action::UnknownValue(
15854                    wkt::internal::UnknownEnumValue::Integer(value),
15855                )),
15856            }
15857        }
15858    }
15859
15860    impl std::convert::From<&str> for TierAction {
15861        fn from(value: &str) -> Self {
15862            use std::string::ToString;
15863            match value {
15864                "TIER_ACTION_UNSPECIFIED" => Self::Unspecified,
15865                "ENABLED" => Self::Enabled,
15866                "PAUSED" => Self::Paused,
15867                _ => Self::UnknownValue(tier_action::UnknownValue(
15868                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15869                )),
15870            }
15871        }
15872    }
15873
15874    impl serde::ser::Serialize for TierAction {
15875        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15876        where
15877            S: serde::Serializer,
15878        {
15879            match self {
15880                Self::Unspecified => serializer.serialize_i32(0),
15881                Self::Enabled => serializer.serialize_i32(1),
15882                Self::Paused => serializer.serialize_i32(2),
15883                Self::UnknownValue(u) => u.0.serialize(serializer),
15884            }
15885        }
15886    }
15887
15888    impl<'de> serde::de::Deserialize<'de> for TierAction {
15889        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15890        where
15891            D: serde::Deserializer<'de>,
15892        {
15893            deserializer.deserialize_any(wkt::internal::EnumVisitor::<TierAction>::new(
15894                ".google.cloud.netapp.v1.TieringPolicy.TierAction",
15895            ))
15896        }
15897    }
15898}
15899
15900/// The Hybrid Replication parameters for the volume.
15901#[derive(Clone, Default, PartialEq)]
15902#[non_exhaustive]
15903pub struct HybridReplicationParameters {
15904    /// Required. Desired name for the replication of this volume.
15905    pub replication: std::string::String,
15906
15907    /// Required. Name of the user's local source volume to be peered with the
15908    /// destination volume.
15909    pub peer_volume_name: std::string::String,
15910
15911    /// Required. Name of the user's local source cluster to be peered with the
15912    /// destination cluster.
15913    pub peer_cluster_name: std::string::String,
15914
15915    /// Required. Name of the user's local source vserver svm to be peered with the
15916    /// destination vserver svm.
15917    pub peer_svm_name: std::string::String,
15918
15919    /// Required. List of node ip addresses to be peered with.
15920    pub peer_ip_addresses: std::vec::Vec<std::string::String>,
15921
15922    /// Optional. Name of source cluster location associated with the Hybrid
15923    /// replication. This is a free-form field for the display purpose only.
15924    pub cluster_location: std::string::String,
15925
15926    /// Optional. Description of the replication.
15927    pub description: std::string::String,
15928
15929    /// Optional. Labels to be added to the replication as the key value pairs.
15930    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
15931
15932    /// Optional. Replication Schedule for the replication created.
15933    pub replication_schedule: crate::model::HybridReplicationSchedule,
15934
15935    /// Optional. Type of the hybrid replication.
15936    pub hybrid_replication_type:
15937        crate::model::hybrid_replication_parameters::VolumeHybridReplicationType,
15938
15939    /// Optional. Constituent volume count for large volume.
15940    pub large_volume_constituent_count: i32,
15941
15942    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15943}
15944
15945impl HybridReplicationParameters {
15946    pub fn new() -> Self {
15947        std::default::Default::default()
15948    }
15949
15950    /// Sets the value of [replication][crate::model::HybridReplicationParameters::replication].
15951    ///
15952    /// # Example
15953    /// ```ignore,no_run
15954    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
15955    /// let x = HybridReplicationParameters::new().set_replication("example");
15956    /// ```
15957    pub fn set_replication<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15958        self.replication = v.into();
15959        self
15960    }
15961
15962    /// Sets the value of [peer_volume_name][crate::model::HybridReplicationParameters::peer_volume_name].
15963    ///
15964    /// # Example
15965    /// ```ignore,no_run
15966    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
15967    /// let x = HybridReplicationParameters::new().set_peer_volume_name("example");
15968    /// ```
15969    pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
15970        mut self,
15971        v: T,
15972    ) -> Self {
15973        self.peer_volume_name = v.into();
15974        self
15975    }
15976
15977    /// Sets the value of [peer_cluster_name][crate::model::HybridReplicationParameters::peer_cluster_name].
15978    ///
15979    /// # Example
15980    /// ```ignore,no_run
15981    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
15982    /// let x = HybridReplicationParameters::new().set_peer_cluster_name("example");
15983    /// ```
15984    pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
15985        mut self,
15986        v: T,
15987    ) -> Self {
15988        self.peer_cluster_name = v.into();
15989        self
15990    }
15991
15992    /// Sets the value of [peer_svm_name][crate::model::HybridReplicationParameters::peer_svm_name].
15993    ///
15994    /// # Example
15995    /// ```ignore,no_run
15996    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
15997    /// let x = HybridReplicationParameters::new().set_peer_svm_name("example");
15998    /// ```
15999    pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16000        self.peer_svm_name = v.into();
16001        self
16002    }
16003
16004    /// Sets the value of [peer_ip_addresses][crate::model::HybridReplicationParameters::peer_ip_addresses].
16005    ///
16006    /// # Example
16007    /// ```ignore,no_run
16008    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16009    /// let x = HybridReplicationParameters::new().set_peer_ip_addresses(["a", "b", "c"]);
16010    /// ```
16011    pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
16012    where
16013        T: std::iter::IntoIterator<Item = V>,
16014        V: std::convert::Into<std::string::String>,
16015    {
16016        use std::iter::Iterator;
16017        self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
16018        self
16019    }
16020
16021    /// Sets the value of [cluster_location][crate::model::HybridReplicationParameters::cluster_location].
16022    ///
16023    /// # Example
16024    /// ```ignore,no_run
16025    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16026    /// let x = HybridReplicationParameters::new().set_cluster_location("example");
16027    /// ```
16028    pub fn set_cluster_location<T: std::convert::Into<std::string::String>>(
16029        mut self,
16030        v: T,
16031    ) -> Self {
16032        self.cluster_location = v.into();
16033        self
16034    }
16035
16036    /// Sets the value of [description][crate::model::HybridReplicationParameters::description].
16037    ///
16038    /// # Example
16039    /// ```ignore,no_run
16040    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16041    /// let x = HybridReplicationParameters::new().set_description("example");
16042    /// ```
16043    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16044        self.description = v.into();
16045        self
16046    }
16047
16048    /// Sets the value of [labels][crate::model::HybridReplicationParameters::labels].
16049    ///
16050    /// # Example
16051    /// ```ignore,no_run
16052    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16053    /// let x = HybridReplicationParameters::new().set_labels([
16054    ///     ("key0", "abc"),
16055    ///     ("key1", "xyz"),
16056    /// ]);
16057    /// ```
16058    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
16059    where
16060        T: std::iter::IntoIterator<Item = (K, V)>,
16061        K: std::convert::Into<std::string::String>,
16062        V: std::convert::Into<std::string::String>,
16063    {
16064        use std::iter::Iterator;
16065        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16066        self
16067    }
16068
16069    /// Sets the value of [replication_schedule][crate::model::HybridReplicationParameters::replication_schedule].
16070    ///
16071    /// # Example
16072    /// ```ignore,no_run
16073    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16074    /// use google_cloud_netapp_v1::model::HybridReplicationSchedule;
16075    /// let x0 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Every10Minutes);
16076    /// let x1 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Hourly);
16077    /// let x2 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Daily);
16078    /// ```
16079    pub fn set_replication_schedule<
16080        T: std::convert::Into<crate::model::HybridReplicationSchedule>,
16081    >(
16082        mut self,
16083        v: T,
16084    ) -> Self {
16085        self.replication_schedule = v.into();
16086        self
16087    }
16088
16089    /// Sets the value of [hybrid_replication_type][crate::model::HybridReplicationParameters::hybrid_replication_type].
16090    ///
16091    /// # Example
16092    /// ```ignore,no_run
16093    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16094    /// use google_cloud_netapp_v1::model::hybrid_replication_parameters::VolumeHybridReplicationType;
16095    /// let x0 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::Migration);
16096    /// let x1 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::ContinuousReplication);
16097    /// let x2 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::OnpremReplication);
16098    /// ```
16099    pub fn set_hybrid_replication_type<
16100        T: std::convert::Into<
16101                crate::model::hybrid_replication_parameters::VolumeHybridReplicationType,
16102            >,
16103    >(
16104        mut self,
16105        v: T,
16106    ) -> Self {
16107        self.hybrid_replication_type = v.into();
16108        self
16109    }
16110
16111    /// Sets the value of [large_volume_constituent_count][crate::model::HybridReplicationParameters::large_volume_constituent_count].
16112    ///
16113    /// # Example
16114    /// ```ignore,no_run
16115    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16116    /// let x = HybridReplicationParameters::new().set_large_volume_constituent_count(42);
16117    /// ```
16118    pub fn set_large_volume_constituent_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16119        self.large_volume_constituent_count = v.into();
16120        self
16121    }
16122}
16123
16124impl wkt::message::Message for HybridReplicationParameters {
16125    fn typename() -> &'static str {
16126        "type.googleapis.com/google.cloud.netapp.v1.HybridReplicationParameters"
16127    }
16128}
16129
16130/// Defines additional types related to [HybridReplicationParameters].
16131pub mod hybrid_replication_parameters {
16132    #[allow(unused_imports)]
16133    use super::*;
16134
16135    /// Type of the volume's hybrid replication.
16136    ///
16137    /// # Working with unknown values
16138    ///
16139    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16140    /// additional enum variants at any time. Adding new variants is not considered
16141    /// a breaking change. Applications should write their code in anticipation of:
16142    ///
16143    /// - New values appearing in future releases of the client library, **and**
16144    /// - New values received dynamically, without application changes.
16145    ///
16146    /// Please consult the [Working with enums] section in the user guide for some
16147    /// guidelines.
16148    ///
16149    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16150    #[derive(Clone, Debug, PartialEq)]
16151    #[non_exhaustive]
16152    pub enum VolumeHybridReplicationType {
16153        /// Unspecified hybrid replication type.
16154        Unspecified,
16155        /// Hybrid replication type for migration.
16156        Migration,
16157        /// Hybrid replication type for continuous replication.
16158        ContinuousReplication,
16159        /// New field for reversible OnPrem replication, to be used for data
16160        /// protection.
16161        OnpremReplication,
16162        /// New field for reversible OnPrem replication, to be used for data
16163        /// protection.
16164        ReverseOnpremReplication,
16165        /// If set, the enum was initialized with an unknown value.
16166        ///
16167        /// Applications can examine the value using [VolumeHybridReplicationType::value] or
16168        /// [VolumeHybridReplicationType::name].
16169        UnknownValue(volume_hybrid_replication_type::UnknownValue),
16170    }
16171
16172    #[doc(hidden)]
16173    pub mod volume_hybrid_replication_type {
16174        #[allow(unused_imports)]
16175        use super::*;
16176        #[derive(Clone, Debug, PartialEq)]
16177        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16178    }
16179
16180    impl VolumeHybridReplicationType {
16181        /// Gets the enum value.
16182        ///
16183        /// Returns `None` if the enum contains an unknown value deserialized from
16184        /// the string representation of enums.
16185        pub fn value(&self) -> std::option::Option<i32> {
16186            match self {
16187                Self::Unspecified => std::option::Option::Some(0),
16188                Self::Migration => std::option::Option::Some(1),
16189                Self::ContinuousReplication => std::option::Option::Some(2),
16190                Self::OnpremReplication => std::option::Option::Some(3),
16191                Self::ReverseOnpremReplication => std::option::Option::Some(4),
16192                Self::UnknownValue(u) => u.0.value(),
16193            }
16194        }
16195
16196        /// Gets the enum value as a string.
16197        ///
16198        /// Returns `None` if the enum contains an unknown value deserialized from
16199        /// the integer representation of enums.
16200        pub fn name(&self) -> std::option::Option<&str> {
16201            match self {
16202                Self::Unspecified => {
16203                    std::option::Option::Some("VOLUME_HYBRID_REPLICATION_TYPE_UNSPECIFIED")
16204                }
16205                Self::Migration => std::option::Option::Some("MIGRATION"),
16206                Self::ContinuousReplication => std::option::Option::Some("CONTINUOUS_REPLICATION"),
16207                Self::OnpremReplication => std::option::Option::Some("ONPREM_REPLICATION"),
16208                Self::ReverseOnpremReplication => {
16209                    std::option::Option::Some("REVERSE_ONPREM_REPLICATION")
16210                }
16211                Self::UnknownValue(u) => u.0.name(),
16212            }
16213        }
16214    }
16215
16216    impl std::default::Default for VolumeHybridReplicationType {
16217        fn default() -> Self {
16218            use std::convert::From;
16219            Self::from(0)
16220        }
16221    }
16222
16223    impl std::fmt::Display for VolumeHybridReplicationType {
16224        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16225            wkt::internal::display_enum(f, self.name(), self.value())
16226        }
16227    }
16228
16229    impl std::convert::From<i32> for VolumeHybridReplicationType {
16230        fn from(value: i32) -> Self {
16231            match value {
16232                0 => Self::Unspecified,
16233                1 => Self::Migration,
16234                2 => Self::ContinuousReplication,
16235                3 => Self::OnpremReplication,
16236                4 => Self::ReverseOnpremReplication,
16237                _ => Self::UnknownValue(volume_hybrid_replication_type::UnknownValue(
16238                    wkt::internal::UnknownEnumValue::Integer(value),
16239                )),
16240            }
16241        }
16242    }
16243
16244    impl std::convert::From<&str> for VolumeHybridReplicationType {
16245        fn from(value: &str) -> Self {
16246            use std::string::ToString;
16247            match value {
16248                "VOLUME_HYBRID_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
16249                "MIGRATION" => Self::Migration,
16250                "CONTINUOUS_REPLICATION" => Self::ContinuousReplication,
16251                "ONPREM_REPLICATION" => Self::OnpremReplication,
16252                "REVERSE_ONPREM_REPLICATION" => Self::ReverseOnpremReplication,
16253                _ => Self::UnknownValue(volume_hybrid_replication_type::UnknownValue(
16254                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16255                )),
16256            }
16257        }
16258    }
16259
16260    impl serde::ser::Serialize for VolumeHybridReplicationType {
16261        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16262        where
16263            S: serde::Serializer,
16264        {
16265            match self {
16266                Self::Unspecified => serializer.serialize_i32(0),
16267                Self::Migration => serializer.serialize_i32(1),
16268                Self::ContinuousReplication => serializer.serialize_i32(2),
16269                Self::OnpremReplication => serializer.serialize_i32(3),
16270                Self::ReverseOnpremReplication => serializer.serialize_i32(4),
16271                Self::UnknownValue(u) => u.0.serialize(serializer),
16272            }
16273        }
16274    }
16275
16276    impl<'de> serde::de::Deserialize<'de> for VolumeHybridReplicationType {
16277        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16278        where
16279            D: serde::Deserializer<'de>,
16280        {
16281            deserializer.deserialize_any(wkt::internal::EnumVisitor::<VolumeHybridReplicationType>::new(
16282                ".google.cloud.netapp.v1.HybridReplicationParameters.VolumeHybridReplicationType"))
16283        }
16284    }
16285}
16286
16287/// Cache Parameters for the volume.
16288#[derive(Clone, Default, PartialEq)]
16289#[non_exhaustive]
16290pub struct CacheParameters {
16291    /// Required. Name of the origin volume for the cache volume.
16292    pub peer_volume_name: std::string::String,
16293
16294    /// Required. Name of the origin volume's ONTAP cluster.
16295    pub peer_cluster_name: std::string::String,
16296
16297    /// Required. Name of the origin volume's SVM.
16298    pub peer_svm_name: std::string::String,
16299
16300    /// Required. List of IC LIF addresses of the origin volume's ONTAP cluster.
16301    pub peer_ip_addresses: std::vec::Vec<std::string::String>,
16302
16303    /// Optional. Indicates whether the cache volume has global file lock enabled.
16304    pub enable_global_file_lock: std::option::Option<bool>,
16305
16306    /// Optional. Configuration of the cache volume.
16307    pub cache_config: std::option::Option<crate::model::CacheConfig>,
16308
16309    /// Output only. State of the cache volume indicating the peering status.
16310    pub cache_state: crate::model::cache_parameters::CacheState,
16311
16312    /// Output only. Copy-paste-able commands to be used on user's ONTAP to accept
16313    /// peering requests.
16314    pub command: std::string::String,
16315
16316    /// Optional. Expiration time for the peering command to be executed on user's
16317    /// ONTAP.
16318    pub peering_command_expiry_time: std::option::Option<wkt::Timestamp>,
16319
16320    /// Output only. Temporary passphrase generated to accept cluster peering
16321    /// command.
16322    pub passphrase: std::string::String,
16323
16324    /// Output only. Detailed description of the current cache state.
16325    pub state_details: std::string::String,
16326
16327    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16328}
16329
16330impl CacheParameters {
16331    pub fn new() -> Self {
16332        std::default::Default::default()
16333    }
16334
16335    /// Sets the value of [peer_volume_name][crate::model::CacheParameters::peer_volume_name].
16336    ///
16337    /// # Example
16338    /// ```ignore,no_run
16339    /// # use google_cloud_netapp_v1::model::CacheParameters;
16340    /// let x = CacheParameters::new().set_peer_volume_name("example");
16341    /// ```
16342    pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
16343        mut self,
16344        v: T,
16345    ) -> Self {
16346        self.peer_volume_name = v.into();
16347        self
16348    }
16349
16350    /// Sets the value of [peer_cluster_name][crate::model::CacheParameters::peer_cluster_name].
16351    ///
16352    /// # Example
16353    /// ```ignore,no_run
16354    /// # use google_cloud_netapp_v1::model::CacheParameters;
16355    /// let x = CacheParameters::new().set_peer_cluster_name("example");
16356    /// ```
16357    pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
16358        mut self,
16359        v: T,
16360    ) -> Self {
16361        self.peer_cluster_name = v.into();
16362        self
16363    }
16364
16365    /// Sets the value of [peer_svm_name][crate::model::CacheParameters::peer_svm_name].
16366    ///
16367    /// # Example
16368    /// ```ignore,no_run
16369    /// # use google_cloud_netapp_v1::model::CacheParameters;
16370    /// let x = CacheParameters::new().set_peer_svm_name("example");
16371    /// ```
16372    pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16373        self.peer_svm_name = v.into();
16374        self
16375    }
16376
16377    /// Sets the value of [peer_ip_addresses][crate::model::CacheParameters::peer_ip_addresses].
16378    ///
16379    /// # Example
16380    /// ```ignore,no_run
16381    /// # use google_cloud_netapp_v1::model::CacheParameters;
16382    /// let x = CacheParameters::new().set_peer_ip_addresses(["a", "b", "c"]);
16383    /// ```
16384    pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
16385    where
16386        T: std::iter::IntoIterator<Item = V>,
16387        V: std::convert::Into<std::string::String>,
16388    {
16389        use std::iter::Iterator;
16390        self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
16391        self
16392    }
16393
16394    /// Sets the value of [enable_global_file_lock][crate::model::CacheParameters::enable_global_file_lock].
16395    ///
16396    /// # Example
16397    /// ```ignore,no_run
16398    /// # use google_cloud_netapp_v1::model::CacheParameters;
16399    /// let x = CacheParameters::new().set_enable_global_file_lock(true);
16400    /// ```
16401    pub fn set_enable_global_file_lock<T>(mut self, v: T) -> Self
16402    where
16403        T: std::convert::Into<bool>,
16404    {
16405        self.enable_global_file_lock = std::option::Option::Some(v.into());
16406        self
16407    }
16408
16409    /// Sets or clears the value of [enable_global_file_lock][crate::model::CacheParameters::enable_global_file_lock].
16410    ///
16411    /// # Example
16412    /// ```ignore,no_run
16413    /// # use google_cloud_netapp_v1::model::CacheParameters;
16414    /// let x = CacheParameters::new().set_or_clear_enable_global_file_lock(Some(false));
16415    /// let x = CacheParameters::new().set_or_clear_enable_global_file_lock(None::<bool>);
16416    /// ```
16417    pub fn set_or_clear_enable_global_file_lock<T>(mut self, v: std::option::Option<T>) -> Self
16418    where
16419        T: std::convert::Into<bool>,
16420    {
16421        self.enable_global_file_lock = v.map(|x| x.into());
16422        self
16423    }
16424
16425    /// Sets the value of [cache_config][crate::model::CacheParameters::cache_config].
16426    ///
16427    /// # Example
16428    /// ```ignore,no_run
16429    /// # use google_cloud_netapp_v1::model::CacheParameters;
16430    /// use google_cloud_netapp_v1::model::CacheConfig;
16431    /// let x = CacheParameters::new().set_cache_config(CacheConfig::default()/* use setters */);
16432    /// ```
16433    pub fn set_cache_config<T>(mut self, v: T) -> Self
16434    where
16435        T: std::convert::Into<crate::model::CacheConfig>,
16436    {
16437        self.cache_config = std::option::Option::Some(v.into());
16438        self
16439    }
16440
16441    /// Sets or clears the value of [cache_config][crate::model::CacheParameters::cache_config].
16442    ///
16443    /// # Example
16444    /// ```ignore,no_run
16445    /// # use google_cloud_netapp_v1::model::CacheParameters;
16446    /// use google_cloud_netapp_v1::model::CacheConfig;
16447    /// let x = CacheParameters::new().set_or_clear_cache_config(Some(CacheConfig::default()/* use setters */));
16448    /// let x = CacheParameters::new().set_or_clear_cache_config(None::<CacheConfig>);
16449    /// ```
16450    pub fn set_or_clear_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
16451    where
16452        T: std::convert::Into<crate::model::CacheConfig>,
16453    {
16454        self.cache_config = v.map(|x| x.into());
16455        self
16456    }
16457
16458    /// Sets the value of [cache_state][crate::model::CacheParameters::cache_state].
16459    ///
16460    /// # Example
16461    /// ```ignore,no_run
16462    /// # use google_cloud_netapp_v1::model::CacheParameters;
16463    /// use google_cloud_netapp_v1::model::cache_parameters::CacheState;
16464    /// let x0 = CacheParameters::new().set_cache_state(CacheState::PendingClusterPeering);
16465    /// let x1 = CacheParameters::new().set_cache_state(CacheState::PendingSvmPeering);
16466    /// let x2 = CacheParameters::new().set_cache_state(CacheState::Peered);
16467    /// ```
16468    pub fn set_cache_state<T: std::convert::Into<crate::model::cache_parameters::CacheState>>(
16469        mut self,
16470        v: T,
16471    ) -> Self {
16472        self.cache_state = v.into();
16473        self
16474    }
16475
16476    /// Sets the value of [command][crate::model::CacheParameters::command].
16477    ///
16478    /// # Example
16479    /// ```ignore,no_run
16480    /// # use google_cloud_netapp_v1::model::CacheParameters;
16481    /// let x = CacheParameters::new().set_command("example");
16482    /// ```
16483    pub fn set_command<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16484        self.command = v.into();
16485        self
16486    }
16487
16488    /// Sets the value of [peering_command_expiry_time][crate::model::CacheParameters::peering_command_expiry_time].
16489    ///
16490    /// # Example
16491    /// ```ignore,no_run
16492    /// # use google_cloud_netapp_v1::model::CacheParameters;
16493    /// use wkt::Timestamp;
16494    /// let x = CacheParameters::new().set_peering_command_expiry_time(Timestamp::default()/* use setters */);
16495    /// ```
16496    pub fn set_peering_command_expiry_time<T>(mut self, v: T) -> Self
16497    where
16498        T: std::convert::Into<wkt::Timestamp>,
16499    {
16500        self.peering_command_expiry_time = std::option::Option::Some(v.into());
16501        self
16502    }
16503
16504    /// Sets or clears the value of [peering_command_expiry_time][crate::model::CacheParameters::peering_command_expiry_time].
16505    ///
16506    /// # Example
16507    /// ```ignore,no_run
16508    /// # use google_cloud_netapp_v1::model::CacheParameters;
16509    /// use wkt::Timestamp;
16510    /// let x = CacheParameters::new().set_or_clear_peering_command_expiry_time(Some(Timestamp::default()/* use setters */));
16511    /// let x = CacheParameters::new().set_or_clear_peering_command_expiry_time(None::<Timestamp>);
16512    /// ```
16513    pub fn set_or_clear_peering_command_expiry_time<T>(mut self, v: std::option::Option<T>) -> Self
16514    where
16515        T: std::convert::Into<wkt::Timestamp>,
16516    {
16517        self.peering_command_expiry_time = v.map(|x| x.into());
16518        self
16519    }
16520
16521    /// Sets the value of [passphrase][crate::model::CacheParameters::passphrase].
16522    ///
16523    /// # Example
16524    /// ```ignore,no_run
16525    /// # use google_cloud_netapp_v1::model::CacheParameters;
16526    /// let x = CacheParameters::new().set_passphrase("example");
16527    /// ```
16528    pub fn set_passphrase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16529        self.passphrase = v.into();
16530        self
16531    }
16532
16533    /// Sets the value of [state_details][crate::model::CacheParameters::state_details].
16534    ///
16535    /// # Example
16536    /// ```ignore,no_run
16537    /// # use google_cloud_netapp_v1::model::CacheParameters;
16538    /// let x = CacheParameters::new().set_state_details("example");
16539    /// ```
16540    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16541        self.state_details = v.into();
16542        self
16543    }
16544}
16545
16546impl wkt::message::Message for CacheParameters {
16547    fn typename() -> &'static str {
16548        "type.googleapis.com/google.cloud.netapp.v1.CacheParameters"
16549    }
16550}
16551
16552/// Defines additional types related to [CacheParameters].
16553pub mod cache_parameters {
16554    #[allow(unused_imports)]
16555    use super::*;
16556
16557    /// State of the cache volume indicating the peering status.
16558    ///
16559    /// # Working with unknown values
16560    ///
16561    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16562    /// additional enum variants at any time. Adding new variants is not considered
16563    /// a breaking change. Applications should write their code in anticipation of:
16564    ///
16565    /// - New values appearing in future releases of the client library, **and**
16566    /// - New values received dynamically, without application changes.
16567    ///
16568    /// Please consult the [Working with enums] section in the user guide for some
16569    /// guidelines.
16570    ///
16571    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16572    #[derive(Clone, Debug, PartialEq)]
16573    #[non_exhaustive]
16574    pub enum CacheState {
16575        /// Default unspecified state.
16576        Unspecified,
16577        /// State indicating waiting for cluster peering to be established.
16578        PendingClusterPeering,
16579        /// State indicating waiting for SVM peering to be established.
16580        PendingSvmPeering,
16581        /// State indicating successful establishment of peering with origin
16582        /// volumes's ONTAP cluster.
16583        Peered,
16584        /// Terminal state wherein peering with origin volume's ONTAP cluster
16585        /// has failed.
16586        Error,
16587        /// If set, the enum was initialized with an unknown value.
16588        ///
16589        /// Applications can examine the value using [CacheState::value] or
16590        /// [CacheState::name].
16591        UnknownValue(cache_state::UnknownValue),
16592    }
16593
16594    #[doc(hidden)]
16595    pub mod cache_state {
16596        #[allow(unused_imports)]
16597        use super::*;
16598        #[derive(Clone, Debug, PartialEq)]
16599        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16600    }
16601
16602    impl CacheState {
16603        /// Gets the enum value.
16604        ///
16605        /// Returns `None` if the enum contains an unknown value deserialized from
16606        /// the string representation of enums.
16607        pub fn value(&self) -> std::option::Option<i32> {
16608            match self {
16609                Self::Unspecified => std::option::Option::Some(0),
16610                Self::PendingClusterPeering => std::option::Option::Some(1),
16611                Self::PendingSvmPeering => std::option::Option::Some(2),
16612                Self::Peered => std::option::Option::Some(3),
16613                Self::Error => std::option::Option::Some(4),
16614                Self::UnknownValue(u) => u.0.value(),
16615            }
16616        }
16617
16618        /// Gets the enum value as a string.
16619        ///
16620        /// Returns `None` if the enum contains an unknown value deserialized from
16621        /// the integer representation of enums.
16622        pub fn name(&self) -> std::option::Option<&str> {
16623            match self {
16624                Self::Unspecified => std::option::Option::Some("CACHE_STATE_UNSPECIFIED"),
16625                Self::PendingClusterPeering => std::option::Option::Some("PENDING_CLUSTER_PEERING"),
16626                Self::PendingSvmPeering => std::option::Option::Some("PENDING_SVM_PEERING"),
16627                Self::Peered => std::option::Option::Some("PEERED"),
16628                Self::Error => std::option::Option::Some("ERROR"),
16629                Self::UnknownValue(u) => u.0.name(),
16630            }
16631        }
16632    }
16633
16634    impl std::default::Default for CacheState {
16635        fn default() -> Self {
16636            use std::convert::From;
16637            Self::from(0)
16638        }
16639    }
16640
16641    impl std::fmt::Display for CacheState {
16642        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16643            wkt::internal::display_enum(f, self.name(), self.value())
16644        }
16645    }
16646
16647    impl std::convert::From<i32> for CacheState {
16648        fn from(value: i32) -> Self {
16649            match value {
16650                0 => Self::Unspecified,
16651                1 => Self::PendingClusterPeering,
16652                2 => Self::PendingSvmPeering,
16653                3 => Self::Peered,
16654                4 => Self::Error,
16655                _ => Self::UnknownValue(cache_state::UnknownValue(
16656                    wkt::internal::UnknownEnumValue::Integer(value),
16657                )),
16658            }
16659        }
16660    }
16661
16662    impl std::convert::From<&str> for CacheState {
16663        fn from(value: &str) -> Self {
16664            use std::string::ToString;
16665            match value {
16666                "CACHE_STATE_UNSPECIFIED" => Self::Unspecified,
16667                "PENDING_CLUSTER_PEERING" => Self::PendingClusterPeering,
16668                "PENDING_SVM_PEERING" => Self::PendingSvmPeering,
16669                "PEERED" => Self::Peered,
16670                "ERROR" => Self::Error,
16671                _ => Self::UnknownValue(cache_state::UnknownValue(
16672                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16673                )),
16674            }
16675        }
16676    }
16677
16678    impl serde::ser::Serialize for CacheState {
16679        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16680        where
16681            S: serde::Serializer,
16682        {
16683            match self {
16684                Self::Unspecified => serializer.serialize_i32(0),
16685                Self::PendingClusterPeering => serializer.serialize_i32(1),
16686                Self::PendingSvmPeering => serializer.serialize_i32(2),
16687                Self::Peered => serializer.serialize_i32(3),
16688                Self::Error => serializer.serialize_i32(4),
16689                Self::UnknownValue(u) => u.0.serialize(serializer),
16690            }
16691        }
16692    }
16693
16694    impl<'de> serde::de::Deserialize<'de> for CacheState {
16695        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16696        where
16697            D: serde::Deserializer<'de>,
16698        {
16699            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CacheState>::new(
16700                ".google.cloud.netapp.v1.CacheParameters.CacheState",
16701            ))
16702        }
16703    }
16704}
16705
16706/// Configuration of the cache volume.
16707#[derive(Clone, Default, PartialEq)]
16708#[non_exhaustive]
16709pub struct CacheConfig {
16710    /// Optional. Pre-populate cache volume with data from the origin volume.
16711    pub cache_pre_populate: std::option::Option<crate::model::CachePrePopulate>,
16712
16713    /// Optional. Flag indicating whether writeback is enabled for the FlexCache
16714    /// volume.
16715    pub writeback_enabled: std::option::Option<bool>,
16716
16717    /// Optional. Flag indicating whether a CIFS change notification is enabled for
16718    /// the FlexCache volume.
16719    pub cifs_change_notify_enabled: std::option::Option<bool>,
16720
16721    /// Output only. State of the prepopulation job indicating how the
16722    /// prepopulation is progressing.
16723    pub cache_pre_populate_state: crate::model::cache_config::CachePrePopulateState,
16724
16725    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16726}
16727
16728impl CacheConfig {
16729    pub fn new() -> Self {
16730        std::default::Default::default()
16731    }
16732
16733    /// Sets the value of [cache_pre_populate][crate::model::CacheConfig::cache_pre_populate].
16734    ///
16735    /// # Example
16736    /// ```ignore,no_run
16737    /// # use google_cloud_netapp_v1::model::CacheConfig;
16738    /// use google_cloud_netapp_v1::model::CachePrePopulate;
16739    /// let x = CacheConfig::new().set_cache_pre_populate(CachePrePopulate::default()/* use setters */);
16740    /// ```
16741    pub fn set_cache_pre_populate<T>(mut self, v: T) -> Self
16742    where
16743        T: std::convert::Into<crate::model::CachePrePopulate>,
16744    {
16745        self.cache_pre_populate = std::option::Option::Some(v.into());
16746        self
16747    }
16748
16749    /// Sets or clears the value of [cache_pre_populate][crate::model::CacheConfig::cache_pre_populate].
16750    ///
16751    /// # Example
16752    /// ```ignore,no_run
16753    /// # use google_cloud_netapp_v1::model::CacheConfig;
16754    /// use google_cloud_netapp_v1::model::CachePrePopulate;
16755    /// let x = CacheConfig::new().set_or_clear_cache_pre_populate(Some(CachePrePopulate::default()/* use setters */));
16756    /// let x = CacheConfig::new().set_or_clear_cache_pre_populate(None::<CachePrePopulate>);
16757    /// ```
16758    pub fn set_or_clear_cache_pre_populate<T>(mut self, v: std::option::Option<T>) -> Self
16759    where
16760        T: std::convert::Into<crate::model::CachePrePopulate>,
16761    {
16762        self.cache_pre_populate = v.map(|x| x.into());
16763        self
16764    }
16765
16766    /// Sets the value of [writeback_enabled][crate::model::CacheConfig::writeback_enabled].
16767    ///
16768    /// # Example
16769    /// ```ignore,no_run
16770    /// # use google_cloud_netapp_v1::model::CacheConfig;
16771    /// let x = CacheConfig::new().set_writeback_enabled(true);
16772    /// ```
16773    pub fn set_writeback_enabled<T>(mut self, v: T) -> Self
16774    where
16775        T: std::convert::Into<bool>,
16776    {
16777        self.writeback_enabled = std::option::Option::Some(v.into());
16778        self
16779    }
16780
16781    /// Sets or clears the value of [writeback_enabled][crate::model::CacheConfig::writeback_enabled].
16782    ///
16783    /// # Example
16784    /// ```ignore,no_run
16785    /// # use google_cloud_netapp_v1::model::CacheConfig;
16786    /// let x = CacheConfig::new().set_or_clear_writeback_enabled(Some(false));
16787    /// let x = CacheConfig::new().set_or_clear_writeback_enabled(None::<bool>);
16788    /// ```
16789    pub fn set_or_clear_writeback_enabled<T>(mut self, v: std::option::Option<T>) -> Self
16790    where
16791        T: std::convert::Into<bool>,
16792    {
16793        self.writeback_enabled = v.map(|x| x.into());
16794        self
16795    }
16796
16797    /// Sets the value of [cifs_change_notify_enabled][crate::model::CacheConfig::cifs_change_notify_enabled].
16798    ///
16799    /// # Example
16800    /// ```ignore,no_run
16801    /// # use google_cloud_netapp_v1::model::CacheConfig;
16802    /// let x = CacheConfig::new().set_cifs_change_notify_enabled(true);
16803    /// ```
16804    pub fn set_cifs_change_notify_enabled<T>(mut self, v: T) -> Self
16805    where
16806        T: std::convert::Into<bool>,
16807    {
16808        self.cifs_change_notify_enabled = std::option::Option::Some(v.into());
16809        self
16810    }
16811
16812    /// Sets or clears the value of [cifs_change_notify_enabled][crate::model::CacheConfig::cifs_change_notify_enabled].
16813    ///
16814    /// # Example
16815    /// ```ignore,no_run
16816    /// # use google_cloud_netapp_v1::model::CacheConfig;
16817    /// let x = CacheConfig::new().set_or_clear_cifs_change_notify_enabled(Some(false));
16818    /// let x = CacheConfig::new().set_or_clear_cifs_change_notify_enabled(None::<bool>);
16819    /// ```
16820    pub fn set_or_clear_cifs_change_notify_enabled<T>(mut self, v: std::option::Option<T>) -> Self
16821    where
16822        T: std::convert::Into<bool>,
16823    {
16824        self.cifs_change_notify_enabled = v.map(|x| x.into());
16825        self
16826    }
16827
16828    /// Sets the value of [cache_pre_populate_state][crate::model::CacheConfig::cache_pre_populate_state].
16829    ///
16830    /// # Example
16831    /// ```ignore,no_run
16832    /// # use google_cloud_netapp_v1::model::CacheConfig;
16833    /// use google_cloud_netapp_v1::model::cache_config::CachePrePopulateState;
16834    /// let x0 = CacheConfig::new().set_cache_pre_populate_state(CachePrePopulateState::NotNeeded);
16835    /// let x1 = CacheConfig::new().set_cache_pre_populate_state(CachePrePopulateState::InProgress);
16836    /// let x2 = CacheConfig::new().set_cache_pre_populate_state(CachePrePopulateState::Complete);
16837    /// ```
16838    pub fn set_cache_pre_populate_state<
16839        T: std::convert::Into<crate::model::cache_config::CachePrePopulateState>,
16840    >(
16841        mut self,
16842        v: T,
16843    ) -> Self {
16844        self.cache_pre_populate_state = v.into();
16845        self
16846    }
16847}
16848
16849impl wkt::message::Message for CacheConfig {
16850    fn typename() -> &'static str {
16851        "type.googleapis.com/google.cloud.netapp.v1.CacheConfig"
16852    }
16853}
16854
16855/// Defines additional types related to [CacheConfig].
16856pub mod cache_config {
16857    #[allow(unused_imports)]
16858    use super::*;
16859
16860    /// State of the prepopulation job indicating how the prepopulation is
16861    /// progressing.
16862    ///
16863    /// # Working with unknown values
16864    ///
16865    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16866    /// additional enum variants at any time. Adding new variants is not considered
16867    /// a breaking change. Applications should write their code in anticipation of:
16868    ///
16869    /// - New values appearing in future releases of the client library, **and**
16870    /// - New values received dynamically, without application changes.
16871    ///
16872    /// Please consult the [Working with enums] section in the user guide for some
16873    /// guidelines.
16874    ///
16875    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16876    #[derive(Clone, Debug, PartialEq)]
16877    #[non_exhaustive]
16878    pub enum CachePrePopulateState {
16879        /// Default unspecified state.
16880        Unspecified,
16881        /// State representing when the most recent create or update request did not
16882        /// require a prepopulation job.
16883        NotNeeded,
16884        /// State representing when the most recent update request requested a
16885        /// prepopulation job but it has not yet completed.
16886        InProgress,
16887        /// State representing when the most recent update request requested a
16888        /// prepopulation job and it has completed successfully.
16889        Complete,
16890        /// State representing when the most recent update request requested a
16891        /// prepopulation job but the prepopulate job failed.
16892        Error,
16893        /// If set, the enum was initialized with an unknown value.
16894        ///
16895        /// Applications can examine the value using [CachePrePopulateState::value] or
16896        /// [CachePrePopulateState::name].
16897        UnknownValue(cache_pre_populate_state::UnknownValue),
16898    }
16899
16900    #[doc(hidden)]
16901    pub mod cache_pre_populate_state {
16902        #[allow(unused_imports)]
16903        use super::*;
16904        #[derive(Clone, Debug, PartialEq)]
16905        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16906    }
16907
16908    impl CachePrePopulateState {
16909        /// Gets the enum value.
16910        ///
16911        /// Returns `None` if the enum contains an unknown value deserialized from
16912        /// the string representation of enums.
16913        pub fn value(&self) -> std::option::Option<i32> {
16914            match self {
16915                Self::Unspecified => std::option::Option::Some(0),
16916                Self::NotNeeded => std::option::Option::Some(1),
16917                Self::InProgress => std::option::Option::Some(2),
16918                Self::Complete => std::option::Option::Some(3),
16919                Self::Error => std::option::Option::Some(4),
16920                Self::UnknownValue(u) => u.0.value(),
16921            }
16922        }
16923
16924        /// Gets the enum value as a string.
16925        ///
16926        /// Returns `None` if the enum contains an unknown value deserialized from
16927        /// the integer representation of enums.
16928        pub fn name(&self) -> std::option::Option<&str> {
16929            match self {
16930                Self::Unspecified => {
16931                    std::option::Option::Some("CACHE_PRE_POPULATE_STATE_UNSPECIFIED")
16932                }
16933                Self::NotNeeded => std::option::Option::Some("NOT_NEEDED"),
16934                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
16935                Self::Complete => std::option::Option::Some("COMPLETE"),
16936                Self::Error => std::option::Option::Some("ERROR"),
16937                Self::UnknownValue(u) => u.0.name(),
16938            }
16939        }
16940    }
16941
16942    impl std::default::Default for CachePrePopulateState {
16943        fn default() -> Self {
16944            use std::convert::From;
16945            Self::from(0)
16946        }
16947    }
16948
16949    impl std::fmt::Display for CachePrePopulateState {
16950        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16951            wkt::internal::display_enum(f, self.name(), self.value())
16952        }
16953    }
16954
16955    impl std::convert::From<i32> for CachePrePopulateState {
16956        fn from(value: i32) -> Self {
16957            match value {
16958                0 => Self::Unspecified,
16959                1 => Self::NotNeeded,
16960                2 => Self::InProgress,
16961                3 => Self::Complete,
16962                4 => Self::Error,
16963                _ => Self::UnknownValue(cache_pre_populate_state::UnknownValue(
16964                    wkt::internal::UnknownEnumValue::Integer(value),
16965                )),
16966            }
16967        }
16968    }
16969
16970    impl std::convert::From<&str> for CachePrePopulateState {
16971        fn from(value: &str) -> Self {
16972            use std::string::ToString;
16973            match value {
16974                "CACHE_PRE_POPULATE_STATE_UNSPECIFIED" => Self::Unspecified,
16975                "NOT_NEEDED" => Self::NotNeeded,
16976                "IN_PROGRESS" => Self::InProgress,
16977                "COMPLETE" => Self::Complete,
16978                "ERROR" => Self::Error,
16979                _ => Self::UnknownValue(cache_pre_populate_state::UnknownValue(
16980                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16981                )),
16982            }
16983        }
16984    }
16985
16986    impl serde::ser::Serialize for CachePrePopulateState {
16987        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16988        where
16989            S: serde::Serializer,
16990        {
16991            match self {
16992                Self::Unspecified => serializer.serialize_i32(0),
16993                Self::NotNeeded => serializer.serialize_i32(1),
16994                Self::InProgress => serializer.serialize_i32(2),
16995                Self::Complete => serializer.serialize_i32(3),
16996                Self::Error => serializer.serialize_i32(4),
16997                Self::UnknownValue(u) => u.0.serialize(serializer),
16998            }
16999        }
17000    }
17001
17002    impl<'de> serde::de::Deserialize<'de> for CachePrePopulateState {
17003        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17004        where
17005            D: serde::Deserializer<'de>,
17006        {
17007            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CachePrePopulateState>::new(
17008                ".google.cloud.netapp.v1.CacheConfig.CachePrePopulateState",
17009            ))
17010        }
17011    }
17012}
17013
17014/// Pre-populate cache volume with data from the origin volume.
17015#[derive(Clone, Default, PartialEq)]
17016#[non_exhaustive]
17017pub struct CachePrePopulate {
17018    /// Optional. List of directory-paths to be pre-populated for the FlexCache
17019    /// volume.
17020    pub path_list: std::vec::Vec<std::string::String>,
17021
17022    /// Optional. List of directory-paths to be excluded for pre-population for the
17023    /// FlexCache volume.
17024    pub exclude_path_list: std::vec::Vec<std::string::String>,
17025
17026    /// Optional. Flag indicating whether the directories listed with the
17027    /// `path_list` need to be recursively pre-populated.
17028    pub recursion: std::option::Option<bool>,
17029
17030    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17031}
17032
17033impl CachePrePopulate {
17034    pub fn new() -> Self {
17035        std::default::Default::default()
17036    }
17037
17038    /// Sets the value of [path_list][crate::model::CachePrePopulate::path_list].
17039    ///
17040    /// # Example
17041    /// ```ignore,no_run
17042    /// # use google_cloud_netapp_v1::model::CachePrePopulate;
17043    /// let x = CachePrePopulate::new().set_path_list(["a", "b", "c"]);
17044    /// ```
17045    pub fn set_path_list<T, V>(mut self, v: T) -> Self
17046    where
17047        T: std::iter::IntoIterator<Item = V>,
17048        V: std::convert::Into<std::string::String>,
17049    {
17050        use std::iter::Iterator;
17051        self.path_list = v.into_iter().map(|i| i.into()).collect();
17052        self
17053    }
17054
17055    /// Sets the value of [exclude_path_list][crate::model::CachePrePopulate::exclude_path_list].
17056    ///
17057    /// # Example
17058    /// ```ignore,no_run
17059    /// # use google_cloud_netapp_v1::model::CachePrePopulate;
17060    /// let x = CachePrePopulate::new().set_exclude_path_list(["a", "b", "c"]);
17061    /// ```
17062    pub fn set_exclude_path_list<T, V>(mut self, v: T) -> Self
17063    where
17064        T: std::iter::IntoIterator<Item = V>,
17065        V: std::convert::Into<std::string::String>,
17066    {
17067        use std::iter::Iterator;
17068        self.exclude_path_list = v.into_iter().map(|i| i.into()).collect();
17069        self
17070    }
17071
17072    /// Sets the value of [recursion][crate::model::CachePrePopulate::recursion].
17073    ///
17074    /// # Example
17075    /// ```ignore,no_run
17076    /// # use google_cloud_netapp_v1::model::CachePrePopulate;
17077    /// let x = CachePrePopulate::new().set_recursion(true);
17078    /// ```
17079    pub fn set_recursion<T>(mut self, v: T) -> Self
17080    where
17081        T: std::convert::Into<bool>,
17082    {
17083        self.recursion = std::option::Option::Some(v.into());
17084        self
17085    }
17086
17087    /// Sets or clears the value of [recursion][crate::model::CachePrePopulate::recursion].
17088    ///
17089    /// # Example
17090    /// ```ignore,no_run
17091    /// # use google_cloud_netapp_v1::model::CachePrePopulate;
17092    /// let x = CachePrePopulate::new().set_or_clear_recursion(Some(false));
17093    /// let x = CachePrePopulate::new().set_or_clear_recursion(None::<bool>);
17094    /// ```
17095    pub fn set_or_clear_recursion<T>(mut self, v: std::option::Option<T>) -> Self
17096    where
17097        T: std::convert::Into<bool>,
17098    {
17099        self.recursion = v.map(|x| x.into());
17100        self
17101    }
17102}
17103
17104impl wkt::message::Message for CachePrePopulate {
17105    fn typename() -> &'static str {
17106        "type.googleapis.com/google.cloud.netapp.v1.CachePrePopulate"
17107    }
17108}
17109
17110/// Block device represents the device(s) which are stored in the block volume.
17111#[derive(Clone, Default, PartialEq)]
17112#[non_exhaustive]
17113pub struct BlockDevice {
17114    /// Optional. User-defined name for the block device, unique within the volume.
17115    /// In case no user input is provided, name will be auto-generated in the
17116    /// backend. The name must meet the following requirements:
17117    ///
17118    /// * Be between 1 and 255 characters long.
17119    /// * Contain only uppercase or lowercase letters (A-Z, a-z), numbers (0-9),
17120    ///   and the following special characters: "-", "_", "}", "{", ".".
17121    /// * Spaces are not allowed.
17122    pub name: std::option::Option<std::string::String>,
17123
17124    /// Optional. A list of host groups that identify hosts that can mount the
17125    /// block volume. Format:
17126    /// `projects/{project_id}/locations/{location}/hostGroups/{host_group_id}`
17127    /// This field can be updated after the block device is created.
17128    pub host_groups: std::vec::Vec<std::string::String>,
17129
17130    /// Output only. Device identifier of the block volume. This represents
17131    /// `lun_serial_number` for iSCSI volumes.
17132    pub identifier: std::string::String,
17133
17134    /// Optional. The size of the block device in GiB.
17135    /// Any value provided for the `size_gib` field during volume creation is
17136    /// ignored. The block device's size is system-managed and will be set to match
17137    /// the parent Volume's `capacity_gib`.
17138    pub size_gib: std::option::Option<i64>,
17139
17140    /// Required. Immutable. The OS type of the volume.
17141    /// This field can't be changed after the block device is created.
17142    pub os_type: crate::model::OsType,
17143
17144    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17145}
17146
17147impl BlockDevice {
17148    pub fn new() -> Self {
17149        std::default::Default::default()
17150    }
17151
17152    /// Sets the value of [name][crate::model::BlockDevice::name].
17153    ///
17154    /// # Example
17155    /// ```ignore,no_run
17156    /// # use google_cloud_netapp_v1::model::BlockDevice;
17157    /// let x = BlockDevice::new().set_name("example");
17158    /// ```
17159    pub fn set_name<T>(mut self, v: T) -> Self
17160    where
17161        T: std::convert::Into<std::string::String>,
17162    {
17163        self.name = std::option::Option::Some(v.into());
17164        self
17165    }
17166
17167    /// Sets or clears the value of [name][crate::model::BlockDevice::name].
17168    ///
17169    /// # Example
17170    /// ```ignore,no_run
17171    /// # use google_cloud_netapp_v1::model::BlockDevice;
17172    /// let x = BlockDevice::new().set_or_clear_name(Some("example"));
17173    /// let x = BlockDevice::new().set_or_clear_name(None::<String>);
17174    /// ```
17175    pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
17176    where
17177        T: std::convert::Into<std::string::String>,
17178    {
17179        self.name = v.map(|x| x.into());
17180        self
17181    }
17182
17183    /// Sets the value of [host_groups][crate::model::BlockDevice::host_groups].
17184    ///
17185    /// # Example
17186    /// ```ignore,no_run
17187    /// # use google_cloud_netapp_v1::model::BlockDevice;
17188    /// let x = BlockDevice::new().set_host_groups(["a", "b", "c"]);
17189    /// ```
17190    pub fn set_host_groups<T, V>(mut self, v: T) -> Self
17191    where
17192        T: std::iter::IntoIterator<Item = V>,
17193        V: std::convert::Into<std::string::String>,
17194    {
17195        use std::iter::Iterator;
17196        self.host_groups = v.into_iter().map(|i| i.into()).collect();
17197        self
17198    }
17199
17200    /// Sets the value of [identifier][crate::model::BlockDevice::identifier].
17201    ///
17202    /// # Example
17203    /// ```ignore,no_run
17204    /// # use google_cloud_netapp_v1::model::BlockDevice;
17205    /// let x = BlockDevice::new().set_identifier("example");
17206    /// ```
17207    pub fn set_identifier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17208        self.identifier = v.into();
17209        self
17210    }
17211
17212    /// Sets the value of [size_gib][crate::model::BlockDevice::size_gib].
17213    ///
17214    /// # Example
17215    /// ```ignore,no_run
17216    /// # use google_cloud_netapp_v1::model::BlockDevice;
17217    /// let x = BlockDevice::new().set_size_gib(42);
17218    /// ```
17219    pub fn set_size_gib<T>(mut self, v: T) -> Self
17220    where
17221        T: std::convert::Into<i64>,
17222    {
17223        self.size_gib = std::option::Option::Some(v.into());
17224        self
17225    }
17226
17227    /// Sets or clears the value of [size_gib][crate::model::BlockDevice::size_gib].
17228    ///
17229    /// # Example
17230    /// ```ignore,no_run
17231    /// # use google_cloud_netapp_v1::model::BlockDevice;
17232    /// let x = BlockDevice::new().set_or_clear_size_gib(Some(42));
17233    /// let x = BlockDevice::new().set_or_clear_size_gib(None::<i32>);
17234    /// ```
17235    pub fn set_or_clear_size_gib<T>(mut self, v: std::option::Option<T>) -> Self
17236    where
17237        T: std::convert::Into<i64>,
17238    {
17239        self.size_gib = v.map(|x| x.into());
17240        self
17241    }
17242
17243    /// Sets the value of [os_type][crate::model::BlockDevice::os_type].
17244    ///
17245    /// # Example
17246    /// ```ignore,no_run
17247    /// # use google_cloud_netapp_v1::model::BlockDevice;
17248    /// use google_cloud_netapp_v1::model::OsType;
17249    /// let x0 = BlockDevice::new().set_os_type(OsType::Linux);
17250    /// let x1 = BlockDevice::new().set_os_type(OsType::Windows);
17251    /// let x2 = BlockDevice::new().set_os_type(OsType::Esxi);
17252    /// ```
17253    pub fn set_os_type<T: std::convert::Into<crate::model::OsType>>(mut self, v: T) -> Self {
17254        self.os_type = v.into();
17255        self
17256    }
17257}
17258
17259impl wkt::message::Message for BlockDevice {
17260    fn typename() -> &'static str {
17261        "type.googleapis.com/google.cloud.netapp.v1.BlockDevice"
17262    }
17263}
17264
17265/// RestoreBackupFilesRequest restores files from a backup to a volume.
17266#[derive(Clone, Default, PartialEq)]
17267#[non_exhaustive]
17268pub struct RestoreBackupFilesRequest {
17269    /// Required. The volume resource name, in the format
17270    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
17271    pub name: std::string::String,
17272
17273    /// Required. The backup resource name, in the format
17274    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
17275    pub backup: std::string::String,
17276
17277    /// Required. List of files to be restored, specified by their absolute path in
17278    /// the source volume.
17279    pub file_list: std::vec::Vec<std::string::String>,
17280
17281    /// Optional. Absolute directory path in the destination volume. This is
17282    /// required if the `file_list` is provided.
17283    pub restore_destination_path: std::string::String,
17284
17285    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17286}
17287
17288impl RestoreBackupFilesRequest {
17289    pub fn new() -> Self {
17290        std::default::Default::default()
17291    }
17292
17293    /// Sets the value of [name][crate::model::RestoreBackupFilesRequest::name].
17294    ///
17295    /// # Example
17296    /// ```ignore,no_run
17297    /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
17298    /// let x = RestoreBackupFilesRequest::new().set_name("example");
17299    /// ```
17300    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17301        self.name = v.into();
17302        self
17303    }
17304
17305    /// Sets the value of [backup][crate::model::RestoreBackupFilesRequest::backup].
17306    ///
17307    /// # Example
17308    /// ```ignore,no_run
17309    /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
17310    /// let x = RestoreBackupFilesRequest::new().set_backup("example");
17311    /// ```
17312    pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17313        self.backup = v.into();
17314        self
17315    }
17316
17317    /// Sets the value of [file_list][crate::model::RestoreBackupFilesRequest::file_list].
17318    ///
17319    /// # Example
17320    /// ```ignore,no_run
17321    /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
17322    /// let x = RestoreBackupFilesRequest::new().set_file_list(["a", "b", "c"]);
17323    /// ```
17324    pub fn set_file_list<T, V>(mut self, v: T) -> Self
17325    where
17326        T: std::iter::IntoIterator<Item = V>,
17327        V: std::convert::Into<std::string::String>,
17328    {
17329        use std::iter::Iterator;
17330        self.file_list = v.into_iter().map(|i| i.into()).collect();
17331        self
17332    }
17333
17334    /// Sets the value of [restore_destination_path][crate::model::RestoreBackupFilesRequest::restore_destination_path].
17335    ///
17336    /// # Example
17337    /// ```ignore,no_run
17338    /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
17339    /// let x = RestoreBackupFilesRequest::new().set_restore_destination_path("example");
17340    /// ```
17341    pub fn set_restore_destination_path<T: std::convert::Into<std::string::String>>(
17342        mut self,
17343        v: T,
17344    ) -> Self {
17345        self.restore_destination_path = v.into();
17346        self
17347    }
17348}
17349
17350impl wkt::message::Message for RestoreBackupFilesRequest {
17351    fn typename() -> &'static str {
17352        "type.googleapis.com/google.cloud.netapp.v1.RestoreBackupFilesRequest"
17353    }
17354}
17355
17356/// RestoreBackupFilesResponse is the result of RestoreBackupFilesRequest.
17357#[derive(Clone, Default, PartialEq)]
17358#[non_exhaustive]
17359pub struct RestoreBackupFilesResponse {
17360    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17361}
17362
17363impl RestoreBackupFilesResponse {
17364    pub fn new() -> Self {
17365        std::default::Default::default()
17366    }
17367}
17368
17369impl wkt::message::Message for RestoreBackupFilesResponse {
17370    fn typename() -> &'static str {
17371        "type.googleapis.com/google.cloud.netapp.v1.RestoreBackupFilesResponse"
17372    }
17373}
17374
17375/// The service level of a storage pool and its volumes.
17376///
17377/// # Working with unknown values
17378///
17379/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17380/// additional enum variants at any time. Adding new variants is not considered
17381/// a breaking change. Applications should write their code in anticipation of:
17382///
17383/// - New values appearing in future releases of the client library, **and**
17384/// - New values received dynamically, without application changes.
17385///
17386/// Please consult the [Working with enums] section in the user guide for some
17387/// guidelines.
17388///
17389/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17390#[derive(Clone, Debug, PartialEq)]
17391#[non_exhaustive]
17392pub enum ServiceLevel {
17393    /// Unspecified service level.
17394    Unspecified,
17395    /// Premium service level.
17396    Premium,
17397    /// Extreme service level.
17398    Extreme,
17399    /// Standard service level.
17400    Standard,
17401    /// Flex service level.
17402    Flex,
17403    /// If set, the enum was initialized with an unknown value.
17404    ///
17405    /// Applications can examine the value using [ServiceLevel::value] or
17406    /// [ServiceLevel::name].
17407    UnknownValue(service_level::UnknownValue),
17408}
17409
17410#[doc(hidden)]
17411pub mod service_level {
17412    #[allow(unused_imports)]
17413    use super::*;
17414    #[derive(Clone, Debug, PartialEq)]
17415    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17416}
17417
17418impl ServiceLevel {
17419    /// Gets the enum value.
17420    ///
17421    /// Returns `None` if the enum contains an unknown value deserialized from
17422    /// the string representation of enums.
17423    pub fn value(&self) -> std::option::Option<i32> {
17424        match self {
17425            Self::Unspecified => std::option::Option::Some(0),
17426            Self::Premium => std::option::Option::Some(1),
17427            Self::Extreme => std::option::Option::Some(2),
17428            Self::Standard => std::option::Option::Some(3),
17429            Self::Flex => std::option::Option::Some(4),
17430            Self::UnknownValue(u) => u.0.value(),
17431        }
17432    }
17433
17434    /// Gets the enum value as a string.
17435    ///
17436    /// Returns `None` if the enum contains an unknown value deserialized from
17437    /// the integer representation of enums.
17438    pub fn name(&self) -> std::option::Option<&str> {
17439        match self {
17440            Self::Unspecified => std::option::Option::Some("SERVICE_LEVEL_UNSPECIFIED"),
17441            Self::Premium => std::option::Option::Some("PREMIUM"),
17442            Self::Extreme => std::option::Option::Some("EXTREME"),
17443            Self::Standard => std::option::Option::Some("STANDARD"),
17444            Self::Flex => std::option::Option::Some("FLEX"),
17445            Self::UnknownValue(u) => u.0.name(),
17446        }
17447    }
17448}
17449
17450impl std::default::Default for ServiceLevel {
17451    fn default() -> Self {
17452        use std::convert::From;
17453        Self::from(0)
17454    }
17455}
17456
17457impl std::fmt::Display for ServiceLevel {
17458    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17459        wkt::internal::display_enum(f, self.name(), self.value())
17460    }
17461}
17462
17463impl std::convert::From<i32> for ServiceLevel {
17464    fn from(value: i32) -> Self {
17465        match value {
17466            0 => Self::Unspecified,
17467            1 => Self::Premium,
17468            2 => Self::Extreme,
17469            3 => Self::Standard,
17470            4 => Self::Flex,
17471            _ => Self::UnknownValue(service_level::UnknownValue(
17472                wkt::internal::UnknownEnumValue::Integer(value),
17473            )),
17474        }
17475    }
17476}
17477
17478impl std::convert::From<&str> for ServiceLevel {
17479    fn from(value: &str) -> Self {
17480        use std::string::ToString;
17481        match value {
17482            "SERVICE_LEVEL_UNSPECIFIED" => Self::Unspecified,
17483            "PREMIUM" => Self::Premium,
17484            "EXTREME" => Self::Extreme,
17485            "STANDARD" => Self::Standard,
17486            "FLEX" => Self::Flex,
17487            _ => Self::UnknownValue(service_level::UnknownValue(
17488                wkt::internal::UnknownEnumValue::String(value.to_string()),
17489            )),
17490        }
17491    }
17492}
17493
17494impl serde::ser::Serialize for ServiceLevel {
17495    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17496    where
17497        S: serde::Serializer,
17498    {
17499        match self {
17500            Self::Unspecified => serializer.serialize_i32(0),
17501            Self::Premium => serializer.serialize_i32(1),
17502            Self::Extreme => serializer.serialize_i32(2),
17503            Self::Standard => serializer.serialize_i32(3),
17504            Self::Flex => serializer.serialize_i32(4),
17505            Self::UnknownValue(u) => u.0.serialize(serializer),
17506        }
17507    }
17508}
17509
17510impl<'de> serde::de::Deserialize<'de> for ServiceLevel {
17511    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17512    where
17513        D: serde::Deserializer<'de>,
17514    {
17515        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ServiceLevel>::new(
17516            ".google.cloud.netapp.v1.ServiceLevel",
17517        ))
17518    }
17519}
17520
17521/// Flex Storage Pool performance.
17522///
17523/// # Working with unknown values
17524///
17525/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17526/// additional enum variants at any time. Adding new variants is not considered
17527/// a breaking change. Applications should write their code in anticipation of:
17528///
17529/// - New values appearing in future releases of the client library, **and**
17530/// - New values received dynamically, without application changes.
17531///
17532/// Please consult the [Working with enums] section in the user guide for some
17533/// guidelines.
17534///
17535/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17536#[derive(Clone, Debug, PartialEq)]
17537#[non_exhaustive]
17538pub enum FlexPerformance {
17539    /// Unspecified flex performance.
17540    Unspecified,
17541    /// Flex Storage Pool with default performance.
17542    Default,
17543    /// Flex Storage Pool with custom performance.
17544    Custom,
17545    /// If set, the enum was initialized with an unknown value.
17546    ///
17547    /// Applications can examine the value using [FlexPerformance::value] or
17548    /// [FlexPerformance::name].
17549    UnknownValue(flex_performance::UnknownValue),
17550}
17551
17552#[doc(hidden)]
17553pub mod flex_performance {
17554    #[allow(unused_imports)]
17555    use super::*;
17556    #[derive(Clone, Debug, PartialEq)]
17557    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17558}
17559
17560impl FlexPerformance {
17561    /// Gets the enum value.
17562    ///
17563    /// Returns `None` if the enum contains an unknown value deserialized from
17564    /// the string representation of enums.
17565    pub fn value(&self) -> std::option::Option<i32> {
17566        match self {
17567            Self::Unspecified => std::option::Option::Some(0),
17568            Self::Default => std::option::Option::Some(1),
17569            Self::Custom => std::option::Option::Some(2),
17570            Self::UnknownValue(u) => u.0.value(),
17571        }
17572    }
17573
17574    /// Gets the enum value as a string.
17575    ///
17576    /// Returns `None` if the enum contains an unknown value deserialized from
17577    /// the integer representation of enums.
17578    pub fn name(&self) -> std::option::Option<&str> {
17579        match self {
17580            Self::Unspecified => std::option::Option::Some("FLEX_PERFORMANCE_UNSPECIFIED"),
17581            Self::Default => std::option::Option::Some("FLEX_PERFORMANCE_DEFAULT"),
17582            Self::Custom => std::option::Option::Some("FLEX_PERFORMANCE_CUSTOM"),
17583            Self::UnknownValue(u) => u.0.name(),
17584        }
17585    }
17586}
17587
17588impl std::default::Default for FlexPerformance {
17589    fn default() -> Self {
17590        use std::convert::From;
17591        Self::from(0)
17592    }
17593}
17594
17595impl std::fmt::Display for FlexPerformance {
17596    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17597        wkt::internal::display_enum(f, self.name(), self.value())
17598    }
17599}
17600
17601impl std::convert::From<i32> for FlexPerformance {
17602    fn from(value: i32) -> Self {
17603        match value {
17604            0 => Self::Unspecified,
17605            1 => Self::Default,
17606            2 => Self::Custom,
17607            _ => Self::UnknownValue(flex_performance::UnknownValue(
17608                wkt::internal::UnknownEnumValue::Integer(value),
17609            )),
17610        }
17611    }
17612}
17613
17614impl std::convert::From<&str> for FlexPerformance {
17615    fn from(value: &str) -> Self {
17616        use std::string::ToString;
17617        match value {
17618            "FLEX_PERFORMANCE_UNSPECIFIED" => Self::Unspecified,
17619            "FLEX_PERFORMANCE_DEFAULT" => Self::Default,
17620            "FLEX_PERFORMANCE_CUSTOM" => Self::Custom,
17621            _ => Self::UnknownValue(flex_performance::UnknownValue(
17622                wkt::internal::UnknownEnumValue::String(value.to_string()),
17623            )),
17624        }
17625    }
17626}
17627
17628impl serde::ser::Serialize for FlexPerformance {
17629    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17630    where
17631        S: serde::Serializer,
17632    {
17633        match self {
17634            Self::Unspecified => serializer.serialize_i32(0),
17635            Self::Default => serializer.serialize_i32(1),
17636            Self::Custom => serializer.serialize_i32(2),
17637            Self::UnknownValue(u) => u.0.serialize(serializer),
17638        }
17639    }
17640}
17641
17642impl<'de> serde::de::Deserialize<'de> for FlexPerformance {
17643    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17644    where
17645        D: serde::Deserializer<'de>,
17646    {
17647        deserializer.deserialize_any(wkt::internal::EnumVisitor::<FlexPerformance>::new(
17648            ".google.cloud.netapp.v1.FlexPerformance",
17649        ))
17650    }
17651}
17652
17653/// The volume encryption key source.
17654///
17655/// # Working with unknown values
17656///
17657/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17658/// additional enum variants at any time. Adding new variants is not considered
17659/// a breaking change. Applications should write their code in anticipation of:
17660///
17661/// - New values appearing in future releases of the client library, **and**
17662/// - New values received dynamically, without application changes.
17663///
17664/// Please consult the [Working with enums] section in the user guide for some
17665/// guidelines.
17666///
17667/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17668#[derive(Clone, Debug, PartialEq)]
17669#[non_exhaustive]
17670pub enum EncryptionType {
17671    /// The source of the encryption key is not specified.
17672    Unspecified,
17673    /// Google managed encryption key.
17674    ServiceManaged,
17675    /// Customer managed encryption key, which is stored in KMS.
17676    CloudKms,
17677    /// If set, the enum was initialized with an unknown value.
17678    ///
17679    /// Applications can examine the value using [EncryptionType::value] or
17680    /// [EncryptionType::name].
17681    UnknownValue(encryption_type::UnknownValue),
17682}
17683
17684#[doc(hidden)]
17685pub mod encryption_type {
17686    #[allow(unused_imports)]
17687    use super::*;
17688    #[derive(Clone, Debug, PartialEq)]
17689    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17690}
17691
17692impl EncryptionType {
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::ServiceManaged => std::option::Option::Some(1),
17701            Self::CloudKms => std::option::Option::Some(2),
17702            Self::UnknownValue(u) => u.0.value(),
17703        }
17704    }
17705
17706    /// Gets the enum value as a string.
17707    ///
17708    /// Returns `None` if the enum contains an unknown value deserialized from
17709    /// the integer representation of enums.
17710    pub fn name(&self) -> std::option::Option<&str> {
17711        match self {
17712            Self::Unspecified => std::option::Option::Some("ENCRYPTION_TYPE_UNSPECIFIED"),
17713            Self::ServiceManaged => std::option::Option::Some("SERVICE_MANAGED"),
17714            Self::CloudKms => std::option::Option::Some("CLOUD_KMS"),
17715            Self::UnknownValue(u) => u.0.name(),
17716        }
17717    }
17718}
17719
17720impl std::default::Default for EncryptionType {
17721    fn default() -> Self {
17722        use std::convert::From;
17723        Self::from(0)
17724    }
17725}
17726
17727impl std::fmt::Display for EncryptionType {
17728    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17729        wkt::internal::display_enum(f, self.name(), self.value())
17730    }
17731}
17732
17733impl std::convert::From<i32> for EncryptionType {
17734    fn from(value: i32) -> Self {
17735        match value {
17736            0 => Self::Unspecified,
17737            1 => Self::ServiceManaged,
17738            2 => Self::CloudKms,
17739            _ => Self::UnknownValue(encryption_type::UnknownValue(
17740                wkt::internal::UnknownEnumValue::Integer(value),
17741            )),
17742        }
17743    }
17744}
17745
17746impl std::convert::From<&str> for EncryptionType {
17747    fn from(value: &str) -> Self {
17748        use std::string::ToString;
17749        match value {
17750            "ENCRYPTION_TYPE_UNSPECIFIED" => Self::Unspecified,
17751            "SERVICE_MANAGED" => Self::ServiceManaged,
17752            "CLOUD_KMS" => Self::CloudKms,
17753            _ => Self::UnknownValue(encryption_type::UnknownValue(
17754                wkt::internal::UnknownEnumValue::String(value.to_string()),
17755            )),
17756        }
17757    }
17758}
17759
17760impl serde::ser::Serialize for EncryptionType {
17761    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17762    where
17763        S: serde::Serializer,
17764    {
17765        match self {
17766            Self::Unspecified => serializer.serialize_i32(0),
17767            Self::ServiceManaged => serializer.serialize_i32(1),
17768            Self::CloudKms => serializer.serialize_i32(2),
17769            Self::UnknownValue(u) => u.0.serialize(serializer),
17770        }
17771    }
17772}
17773
17774impl<'de> serde::de::Deserialize<'de> for EncryptionType {
17775    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17776    where
17777        D: serde::Deserializer<'de>,
17778    {
17779        deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionType>::new(
17780            ".google.cloud.netapp.v1.EncryptionType",
17781        ))
17782    }
17783}
17784
17785/// Type of directory service
17786///
17787/// # Working with unknown values
17788///
17789/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17790/// additional enum variants at any time. Adding new variants is not considered
17791/// a breaking change. Applications should write their code in anticipation of:
17792///
17793/// - New values appearing in future releases of the client library, **and**
17794/// - New values received dynamically, without application changes.
17795///
17796/// Please consult the [Working with enums] section in the user guide for some
17797/// guidelines.
17798///
17799/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17800#[derive(Clone, Debug, PartialEq)]
17801#[non_exhaustive]
17802pub enum DirectoryServiceType {
17803    /// Directory service type is not specified.
17804    Unspecified,
17805    /// Active directory policy attached to the storage pool.
17806    ActiveDirectory,
17807    /// If set, the enum was initialized with an unknown value.
17808    ///
17809    /// Applications can examine the value using [DirectoryServiceType::value] or
17810    /// [DirectoryServiceType::name].
17811    UnknownValue(directory_service_type::UnknownValue),
17812}
17813
17814#[doc(hidden)]
17815pub mod directory_service_type {
17816    #[allow(unused_imports)]
17817    use super::*;
17818    #[derive(Clone, Debug, PartialEq)]
17819    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17820}
17821
17822impl DirectoryServiceType {
17823    /// Gets the enum value.
17824    ///
17825    /// Returns `None` if the enum contains an unknown value deserialized from
17826    /// the string representation of enums.
17827    pub fn value(&self) -> std::option::Option<i32> {
17828        match self {
17829            Self::Unspecified => std::option::Option::Some(0),
17830            Self::ActiveDirectory => std::option::Option::Some(1),
17831            Self::UnknownValue(u) => u.0.value(),
17832        }
17833    }
17834
17835    /// Gets the enum value as a string.
17836    ///
17837    /// Returns `None` if the enum contains an unknown value deserialized from
17838    /// the integer representation of enums.
17839    pub fn name(&self) -> std::option::Option<&str> {
17840        match self {
17841            Self::Unspecified => std::option::Option::Some("DIRECTORY_SERVICE_TYPE_UNSPECIFIED"),
17842            Self::ActiveDirectory => std::option::Option::Some("ACTIVE_DIRECTORY"),
17843            Self::UnknownValue(u) => u.0.name(),
17844        }
17845    }
17846}
17847
17848impl std::default::Default for DirectoryServiceType {
17849    fn default() -> Self {
17850        use std::convert::From;
17851        Self::from(0)
17852    }
17853}
17854
17855impl std::fmt::Display for DirectoryServiceType {
17856    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17857        wkt::internal::display_enum(f, self.name(), self.value())
17858    }
17859}
17860
17861impl std::convert::From<i32> for DirectoryServiceType {
17862    fn from(value: i32) -> Self {
17863        match value {
17864            0 => Self::Unspecified,
17865            1 => Self::ActiveDirectory,
17866            _ => Self::UnknownValue(directory_service_type::UnknownValue(
17867                wkt::internal::UnknownEnumValue::Integer(value),
17868            )),
17869        }
17870    }
17871}
17872
17873impl std::convert::From<&str> for DirectoryServiceType {
17874    fn from(value: &str) -> Self {
17875        use std::string::ToString;
17876        match value {
17877            "DIRECTORY_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
17878            "ACTIVE_DIRECTORY" => Self::ActiveDirectory,
17879            _ => Self::UnknownValue(directory_service_type::UnknownValue(
17880                wkt::internal::UnknownEnumValue::String(value.to_string()),
17881            )),
17882        }
17883    }
17884}
17885
17886impl serde::ser::Serialize for DirectoryServiceType {
17887    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17888    where
17889        S: serde::Serializer,
17890    {
17891        match self {
17892            Self::Unspecified => serializer.serialize_i32(0),
17893            Self::ActiveDirectory => serializer.serialize_i32(1),
17894            Self::UnknownValue(u) => u.0.serialize(serializer),
17895        }
17896    }
17897}
17898
17899impl<'de> serde::de::Deserialize<'de> for DirectoryServiceType {
17900    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17901    where
17902        D: serde::Deserializer<'de>,
17903    {
17904        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DirectoryServiceType>::new(
17905            ".google.cloud.netapp.v1.DirectoryServiceType",
17906        ))
17907    }
17908}
17909
17910/// Type of storage pool
17911///
17912/// # Working with unknown values
17913///
17914/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17915/// additional enum variants at any time. Adding new variants is not considered
17916/// a breaking change. Applications should write their code in anticipation of:
17917///
17918/// - New values appearing in future releases of the client library, **and**
17919/// - New values received dynamically, without application changes.
17920///
17921/// Please consult the [Working with enums] section in the user guide for some
17922/// guidelines.
17923///
17924/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17925#[derive(Clone, Debug, PartialEq)]
17926#[non_exhaustive]
17927pub enum StoragePoolType {
17928    /// Storage pool type is not specified.
17929    Unspecified,
17930    /// Storage pool type is file.
17931    File,
17932    /// Storage pool type is unified.
17933    Unified,
17934    /// Storage pool type is unified large capacity.
17935    UnifiedLargeCapacity,
17936    /// If set, the enum was initialized with an unknown value.
17937    ///
17938    /// Applications can examine the value using [StoragePoolType::value] or
17939    /// [StoragePoolType::name].
17940    UnknownValue(storage_pool_type::UnknownValue),
17941}
17942
17943#[doc(hidden)]
17944pub mod storage_pool_type {
17945    #[allow(unused_imports)]
17946    use super::*;
17947    #[derive(Clone, Debug, PartialEq)]
17948    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17949}
17950
17951impl StoragePoolType {
17952    /// Gets the enum value.
17953    ///
17954    /// Returns `None` if the enum contains an unknown value deserialized from
17955    /// the string representation of enums.
17956    pub fn value(&self) -> std::option::Option<i32> {
17957        match self {
17958            Self::Unspecified => std::option::Option::Some(0),
17959            Self::File => std::option::Option::Some(1),
17960            Self::Unified => std::option::Option::Some(2),
17961            Self::UnifiedLargeCapacity => std::option::Option::Some(3),
17962            Self::UnknownValue(u) => u.0.value(),
17963        }
17964    }
17965
17966    /// Gets the enum value as a string.
17967    ///
17968    /// Returns `None` if the enum contains an unknown value deserialized from
17969    /// the integer representation of enums.
17970    pub fn name(&self) -> std::option::Option<&str> {
17971        match self {
17972            Self::Unspecified => std::option::Option::Some("STORAGE_POOL_TYPE_UNSPECIFIED"),
17973            Self::File => std::option::Option::Some("FILE"),
17974            Self::Unified => std::option::Option::Some("UNIFIED"),
17975            Self::UnifiedLargeCapacity => std::option::Option::Some("UNIFIED_LARGE_CAPACITY"),
17976            Self::UnknownValue(u) => u.0.name(),
17977        }
17978    }
17979}
17980
17981impl std::default::Default for StoragePoolType {
17982    fn default() -> Self {
17983        use std::convert::From;
17984        Self::from(0)
17985    }
17986}
17987
17988impl std::fmt::Display for StoragePoolType {
17989    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17990        wkt::internal::display_enum(f, self.name(), self.value())
17991    }
17992}
17993
17994impl std::convert::From<i32> for StoragePoolType {
17995    fn from(value: i32) -> Self {
17996        match value {
17997            0 => Self::Unspecified,
17998            1 => Self::File,
17999            2 => Self::Unified,
18000            3 => Self::UnifiedLargeCapacity,
18001            _ => Self::UnknownValue(storage_pool_type::UnknownValue(
18002                wkt::internal::UnknownEnumValue::Integer(value),
18003            )),
18004        }
18005    }
18006}
18007
18008impl std::convert::From<&str> for StoragePoolType {
18009    fn from(value: &str) -> Self {
18010        use std::string::ToString;
18011        match value {
18012            "STORAGE_POOL_TYPE_UNSPECIFIED" => Self::Unspecified,
18013            "FILE" => Self::File,
18014            "UNIFIED" => Self::Unified,
18015            "UNIFIED_LARGE_CAPACITY" => Self::UnifiedLargeCapacity,
18016            _ => Self::UnknownValue(storage_pool_type::UnknownValue(
18017                wkt::internal::UnknownEnumValue::String(value.to_string()),
18018            )),
18019        }
18020    }
18021}
18022
18023impl serde::ser::Serialize for StoragePoolType {
18024    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18025    where
18026        S: serde::Serializer,
18027    {
18028        match self {
18029            Self::Unspecified => serializer.serialize_i32(0),
18030            Self::File => serializer.serialize_i32(1),
18031            Self::Unified => serializer.serialize_i32(2),
18032            Self::UnifiedLargeCapacity => serializer.serialize_i32(3),
18033            Self::UnknownValue(u) => u.0.serialize(serializer),
18034        }
18035    }
18036}
18037
18038impl<'de> serde::de::Deserialize<'de> for StoragePoolType {
18039    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18040    where
18041        D: serde::Deserializer<'de>,
18042    {
18043        deserializer.deserialize_any(wkt::internal::EnumVisitor::<StoragePoolType>::new(
18044            ".google.cloud.netapp.v1.StoragePoolType",
18045        ))
18046    }
18047}
18048
18049/// Schedule for Hybrid Replication.
18050/// New enum values may be added in future to support different frequency of
18051/// replication.
18052///
18053/// # Working with unknown values
18054///
18055/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18056/// additional enum variants at any time. Adding new variants is not considered
18057/// a breaking change. Applications should write their code in anticipation of:
18058///
18059/// - New values appearing in future releases of the client library, **and**
18060/// - New values received dynamically, without application changes.
18061///
18062/// Please consult the [Working with enums] section in the user guide for some
18063/// guidelines.
18064///
18065/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18066#[derive(Clone, Debug, PartialEq)]
18067#[non_exhaustive]
18068pub enum HybridReplicationSchedule {
18069    /// Unspecified HybridReplicationSchedule
18070    Unspecified,
18071    /// Replication happens once every 10 minutes.
18072    Every10Minutes,
18073    /// Replication happens once every hour.
18074    Hourly,
18075    /// Replication happens once every day.
18076    Daily,
18077    /// If set, the enum was initialized with an unknown value.
18078    ///
18079    /// Applications can examine the value using [HybridReplicationSchedule::value] or
18080    /// [HybridReplicationSchedule::name].
18081    UnknownValue(hybrid_replication_schedule::UnknownValue),
18082}
18083
18084#[doc(hidden)]
18085pub mod hybrid_replication_schedule {
18086    #[allow(unused_imports)]
18087    use super::*;
18088    #[derive(Clone, Debug, PartialEq)]
18089    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18090}
18091
18092impl HybridReplicationSchedule {
18093    /// Gets the enum value.
18094    ///
18095    /// Returns `None` if the enum contains an unknown value deserialized from
18096    /// the string representation of enums.
18097    pub fn value(&self) -> std::option::Option<i32> {
18098        match self {
18099            Self::Unspecified => std::option::Option::Some(0),
18100            Self::Every10Minutes => std::option::Option::Some(1),
18101            Self::Hourly => std::option::Option::Some(2),
18102            Self::Daily => std::option::Option::Some(3),
18103            Self::UnknownValue(u) => u.0.value(),
18104        }
18105    }
18106
18107    /// Gets the enum value as a string.
18108    ///
18109    /// Returns `None` if the enum contains an unknown value deserialized from
18110    /// the integer representation of enums.
18111    pub fn name(&self) -> std::option::Option<&str> {
18112        match self {
18113            Self::Unspecified => {
18114                std::option::Option::Some("HYBRID_REPLICATION_SCHEDULE_UNSPECIFIED")
18115            }
18116            Self::Every10Minutes => std::option::Option::Some("EVERY_10_MINUTES"),
18117            Self::Hourly => std::option::Option::Some("HOURLY"),
18118            Self::Daily => std::option::Option::Some("DAILY"),
18119            Self::UnknownValue(u) => u.0.name(),
18120        }
18121    }
18122}
18123
18124impl std::default::Default for HybridReplicationSchedule {
18125    fn default() -> Self {
18126        use std::convert::From;
18127        Self::from(0)
18128    }
18129}
18130
18131impl std::fmt::Display for HybridReplicationSchedule {
18132    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18133        wkt::internal::display_enum(f, self.name(), self.value())
18134    }
18135}
18136
18137impl std::convert::From<i32> for HybridReplicationSchedule {
18138    fn from(value: i32) -> Self {
18139        match value {
18140            0 => Self::Unspecified,
18141            1 => Self::Every10Minutes,
18142            2 => Self::Hourly,
18143            3 => Self::Daily,
18144            _ => Self::UnknownValue(hybrid_replication_schedule::UnknownValue(
18145                wkt::internal::UnknownEnumValue::Integer(value),
18146            )),
18147        }
18148    }
18149}
18150
18151impl std::convert::From<&str> for HybridReplicationSchedule {
18152    fn from(value: &str) -> Self {
18153        use std::string::ToString;
18154        match value {
18155            "HYBRID_REPLICATION_SCHEDULE_UNSPECIFIED" => Self::Unspecified,
18156            "EVERY_10_MINUTES" => Self::Every10Minutes,
18157            "HOURLY" => Self::Hourly,
18158            "DAILY" => Self::Daily,
18159            _ => Self::UnknownValue(hybrid_replication_schedule::UnknownValue(
18160                wkt::internal::UnknownEnumValue::String(value.to_string()),
18161            )),
18162        }
18163    }
18164}
18165
18166impl serde::ser::Serialize for HybridReplicationSchedule {
18167    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18168    where
18169        S: serde::Serializer,
18170    {
18171        match self {
18172            Self::Unspecified => serializer.serialize_i32(0),
18173            Self::Every10Minutes => serializer.serialize_i32(1),
18174            Self::Hourly => serializer.serialize_i32(2),
18175            Self::Daily => serializer.serialize_i32(3),
18176            Self::UnknownValue(u) => u.0.serialize(serializer),
18177        }
18178    }
18179}
18180
18181impl<'de> serde::de::Deserialize<'de> for HybridReplicationSchedule {
18182    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18183    where
18184        D: serde::Deserializer<'de>,
18185    {
18186        deserializer.deserialize_any(
18187            wkt::internal::EnumVisitor::<HybridReplicationSchedule>::new(
18188                ".google.cloud.netapp.v1.HybridReplicationSchedule",
18189            ),
18190        )
18191    }
18192}
18193
18194/// QoS (Quality of Service) Types of the storage pool
18195///
18196/// # Working with unknown values
18197///
18198/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18199/// additional enum variants at any time. Adding new variants is not considered
18200/// a breaking change. Applications should write their code in anticipation of:
18201///
18202/// - New values appearing in future releases of the client library, **and**
18203/// - New values received dynamically, without application changes.
18204///
18205/// Please consult the [Working with enums] section in the user guide for some
18206/// guidelines.
18207///
18208/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18209#[derive(Clone, Debug, PartialEq)]
18210#[non_exhaustive]
18211pub enum QosType {
18212    /// Unspecified QoS Type
18213    Unspecified,
18214    /// QoS Type is Auto
18215    Auto,
18216    /// QoS Type is Manual
18217    Manual,
18218    /// If set, the enum was initialized with an unknown value.
18219    ///
18220    /// Applications can examine the value using [QosType::value] or
18221    /// [QosType::name].
18222    UnknownValue(qos_type::UnknownValue),
18223}
18224
18225#[doc(hidden)]
18226pub mod qos_type {
18227    #[allow(unused_imports)]
18228    use super::*;
18229    #[derive(Clone, Debug, PartialEq)]
18230    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18231}
18232
18233impl QosType {
18234    /// Gets the enum value.
18235    ///
18236    /// Returns `None` if the enum contains an unknown value deserialized from
18237    /// the string representation of enums.
18238    pub fn value(&self) -> std::option::Option<i32> {
18239        match self {
18240            Self::Unspecified => std::option::Option::Some(0),
18241            Self::Auto => std::option::Option::Some(1),
18242            Self::Manual => std::option::Option::Some(2),
18243            Self::UnknownValue(u) => u.0.value(),
18244        }
18245    }
18246
18247    /// Gets the enum value as a string.
18248    ///
18249    /// Returns `None` if the enum contains an unknown value deserialized from
18250    /// the integer representation of enums.
18251    pub fn name(&self) -> std::option::Option<&str> {
18252        match self {
18253            Self::Unspecified => std::option::Option::Some("QOS_TYPE_UNSPECIFIED"),
18254            Self::Auto => std::option::Option::Some("AUTO"),
18255            Self::Manual => std::option::Option::Some("MANUAL"),
18256            Self::UnknownValue(u) => u.0.name(),
18257        }
18258    }
18259}
18260
18261impl std::default::Default for QosType {
18262    fn default() -> Self {
18263        use std::convert::From;
18264        Self::from(0)
18265    }
18266}
18267
18268impl std::fmt::Display for QosType {
18269    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18270        wkt::internal::display_enum(f, self.name(), self.value())
18271    }
18272}
18273
18274impl std::convert::From<i32> for QosType {
18275    fn from(value: i32) -> Self {
18276        match value {
18277            0 => Self::Unspecified,
18278            1 => Self::Auto,
18279            2 => Self::Manual,
18280            _ => Self::UnknownValue(qos_type::UnknownValue(
18281                wkt::internal::UnknownEnumValue::Integer(value),
18282            )),
18283        }
18284    }
18285}
18286
18287impl std::convert::From<&str> for QosType {
18288    fn from(value: &str) -> Self {
18289        use std::string::ToString;
18290        match value {
18291            "QOS_TYPE_UNSPECIFIED" => Self::Unspecified,
18292            "AUTO" => Self::Auto,
18293            "MANUAL" => Self::Manual,
18294            _ => Self::UnknownValue(qos_type::UnknownValue(
18295                wkt::internal::UnknownEnumValue::String(value.to_string()),
18296            )),
18297        }
18298    }
18299}
18300
18301impl serde::ser::Serialize for QosType {
18302    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18303    where
18304        S: serde::Serializer,
18305    {
18306        match self {
18307            Self::Unspecified => serializer.serialize_i32(0),
18308            Self::Auto => serializer.serialize_i32(1),
18309            Self::Manual => serializer.serialize_i32(2),
18310            Self::UnknownValue(u) => u.0.serialize(serializer),
18311        }
18312    }
18313}
18314
18315impl<'de> serde::de::Deserialize<'de> for QosType {
18316    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18317    where
18318        D: serde::Deserializer<'de>,
18319    {
18320        deserializer.deserialize_any(wkt::internal::EnumVisitor::<QosType>::new(
18321            ".google.cloud.netapp.v1.QosType",
18322        ))
18323    }
18324}
18325
18326/// OS types for the host group
18327///
18328/// # Working with unknown values
18329///
18330/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18331/// additional enum variants at any time. Adding new variants is not considered
18332/// a breaking change. Applications should write their code in anticipation of:
18333///
18334/// - New values appearing in future releases of the client library, **and**
18335/// - New values received dynamically, without application changes.
18336///
18337/// Please consult the [Working with enums] section in the user guide for some
18338/// guidelines.
18339///
18340/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18341#[derive(Clone, Debug, PartialEq)]
18342#[non_exhaustive]
18343pub enum OsType {
18344    /// Unspecified OS Type
18345    Unspecified,
18346    /// OS Type is Linux
18347    Linux,
18348    /// OS Type is Windows
18349    Windows,
18350    /// OS Type is VMware ESXi
18351    Esxi,
18352    /// If set, the enum was initialized with an unknown value.
18353    ///
18354    /// Applications can examine the value using [OsType::value] or
18355    /// [OsType::name].
18356    UnknownValue(os_type::UnknownValue),
18357}
18358
18359#[doc(hidden)]
18360pub mod os_type {
18361    #[allow(unused_imports)]
18362    use super::*;
18363    #[derive(Clone, Debug, PartialEq)]
18364    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18365}
18366
18367impl OsType {
18368    /// Gets the enum value.
18369    ///
18370    /// Returns `None` if the enum contains an unknown value deserialized from
18371    /// the string representation of enums.
18372    pub fn value(&self) -> std::option::Option<i32> {
18373        match self {
18374            Self::Unspecified => std::option::Option::Some(0),
18375            Self::Linux => std::option::Option::Some(1),
18376            Self::Windows => std::option::Option::Some(2),
18377            Self::Esxi => std::option::Option::Some(3),
18378            Self::UnknownValue(u) => u.0.value(),
18379        }
18380    }
18381
18382    /// Gets the enum value as a string.
18383    ///
18384    /// Returns `None` if the enum contains an unknown value deserialized from
18385    /// the integer representation of enums.
18386    pub fn name(&self) -> std::option::Option<&str> {
18387        match self {
18388            Self::Unspecified => std::option::Option::Some("OS_TYPE_UNSPECIFIED"),
18389            Self::Linux => std::option::Option::Some("LINUX"),
18390            Self::Windows => std::option::Option::Some("WINDOWS"),
18391            Self::Esxi => std::option::Option::Some("ESXI"),
18392            Self::UnknownValue(u) => u.0.name(),
18393        }
18394    }
18395}
18396
18397impl std::default::Default for OsType {
18398    fn default() -> Self {
18399        use std::convert::From;
18400        Self::from(0)
18401    }
18402}
18403
18404impl std::fmt::Display for OsType {
18405    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18406        wkt::internal::display_enum(f, self.name(), self.value())
18407    }
18408}
18409
18410impl std::convert::From<i32> for OsType {
18411    fn from(value: i32) -> Self {
18412        match value {
18413            0 => Self::Unspecified,
18414            1 => Self::Linux,
18415            2 => Self::Windows,
18416            3 => Self::Esxi,
18417            _ => Self::UnknownValue(os_type::UnknownValue(
18418                wkt::internal::UnknownEnumValue::Integer(value),
18419            )),
18420        }
18421    }
18422}
18423
18424impl std::convert::From<&str> for OsType {
18425    fn from(value: &str) -> Self {
18426        use std::string::ToString;
18427        match value {
18428            "OS_TYPE_UNSPECIFIED" => Self::Unspecified,
18429            "LINUX" => Self::Linux,
18430            "WINDOWS" => Self::Windows,
18431            "ESXI" => Self::Esxi,
18432            _ => Self::UnknownValue(os_type::UnknownValue(
18433                wkt::internal::UnknownEnumValue::String(value.to_string()),
18434            )),
18435        }
18436    }
18437}
18438
18439impl serde::ser::Serialize for OsType {
18440    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18441    where
18442        S: serde::Serializer,
18443    {
18444        match self {
18445            Self::Unspecified => serializer.serialize_i32(0),
18446            Self::Linux => serializer.serialize_i32(1),
18447            Self::Windows => serializer.serialize_i32(2),
18448            Self::Esxi => serializer.serialize_i32(3),
18449            Self::UnknownValue(u) => u.0.serialize(serializer),
18450        }
18451    }
18452}
18453
18454impl<'de> serde::de::Deserialize<'de> for OsType {
18455    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18456    where
18457        D: serde::Deserializer<'de>,
18458    {
18459        deserializer.deserialize_any(wkt::internal::EnumVisitor::<OsType>::new(
18460            ".google.cloud.netapp.v1.OsType",
18461        ))
18462    }
18463}
18464
18465/// Protocols is an enum of all the supported network protocols for a volume.
18466///
18467/// # Working with unknown values
18468///
18469/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18470/// additional enum variants at any time. Adding new variants is not considered
18471/// a breaking change. Applications should write their code in anticipation of:
18472///
18473/// - New values appearing in future releases of the client library, **and**
18474/// - New values received dynamically, without application changes.
18475///
18476/// Please consult the [Working with enums] section in the user guide for some
18477/// guidelines.
18478///
18479/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18480#[derive(Clone, Debug, PartialEq)]
18481#[non_exhaustive]
18482pub enum Protocols {
18483    /// Unspecified protocol
18484    Unspecified,
18485    /// NFS V3 protocol
18486    Nfsv3,
18487    /// NFS V4 protocol
18488    Nfsv4,
18489    /// SMB protocol
18490    Smb,
18491    /// ISCSI protocol
18492    Iscsi,
18493    /// If set, the enum was initialized with an unknown value.
18494    ///
18495    /// Applications can examine the value using [Protocols::value] or
18496    /// [Protocols::name].
18497    UnknownValue(protocols::UnknownValue),
18498}
18499
18500#[doc(hidden)]
18501pub mod protocols {
18502    #[allow(unused_imports)]
18503    use super::*;
18504    #[derive(Clone, Debug, PartialEq)]
18505    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18506}
18507
18508impl Protocols {
18509    /// Gets the enum value.
18510    ///
18511    /// Returns `None` if the enum contains an unknown value deserialized from
18512    /// the string representation of enums.
18513    pub fn value(&self) -> std::option::Option<i32> {
18514        match self {
18515            Self::Unspecified => std::option::Option::Some(0),
18516            Self::Nfsv3 => std::option::Option::Some(1),
18517            Self::Nfsv4 => std::option::Option::Some(2),
18518            Self::Smb => std::option::Option::Some(3),
18519            Self::Iscsi => std::option::Option::Some(4),
18520            Self::UnknownValue(u) => u.0.value(),
18521        }
18522    }
18523
18524    /// Gets the enum value as a string.
18525    ///
18526    /// Returns `None` if the enum contains an unknown value deserialized from
18527    /// the integer representation of enums.
18528    pub fn name(&self) -> std::option::Option<&str> {
18529        match self {
18530            Self::Unspecified => std::option::Option::Some("PROTOCOLS_UNSPECIFIED"),
18531            Self::Nfsv3 => std::option::Option::Some("NFSV3"),
18532            Self::Nfsv4 => std::option::Option::Some("NFSV4"),
18533            Self::Smb => std::option::Option::Some("SMB"),
18534            Self::Iscsi => std::option::Option::Some("ISCSI"),
18535            Self::UnknownValue(u) => u.0.name(),
18536        }
18537    }
18538}
18539
18540impl std::default::Default for Protocols {
18541    fn default() -> Self {
18542        use std::convert::From;
18543        Self::from(0)
18544    }
18545}
18546
18547impl std::fmt::Display for Protocols {
18548    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18549        wkt::internal::display_enum(f, self.name(), self.value())
18550    }
18551}
18552
18553impl std::convert::From<i32> for Protocols {
18554    fn from(value: i32) -> Self {
18555        match value {
18556            0 => Self::Unspecified,
18557            1 => Self::Nfsv3,
18558            2 => Self::Nfsv4,
18559            3 => Self::Smb,
18560            4 => Self::Iscsi,
18561            _ => Self::UnknownValue(protocols::UnknownValue(
18562                wkt::internal::UnknownEnumValue::Integer(value),
18563            )),
18564        }
18565    }
18566}
18567
18568impl std::convert::From<&str> for Protocols {
18569    fn from(value: &str) -> Self {
18570        use std::string::ToString;
18571        match value {
18572            "PROTOCOLS_UNSPECIFIED" => Self::Unspecified,
18573            "NFSV3" => Self::Nfsv3,
18574            "NFSV4" => Self::Nfsv4,
18575            "SMB" => Self::Smb,
18576            "ISCSI" => Self::Iscsi,
18577            _ => Self::UnknownValue(protocols::UnknownValue(
18578                wkt::internal::UnknownEnumValue::String(value.to_string()),
18579            )),
18580        }
18581    }
18582}
18583
18584impl serde::ser::Serialize for Protocols {
18585    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18586    where
18587        S: serde::Serializer,
18588    {
18589        match self {
18590            Self::Unspecified => serializer.serialize_i32(0),
18591            Self::Nfsv3 => serializer.serialize_i32(1),
18592            Self::Nfsv4 => serializer.serialize_i32(2),
18593            Self::Smb => serializer.serialize_i32(3),
18594            Self::Iscsi => serializer.serialize_i32(4),
18595            Self::UnknownValue(u) => u.0.serialize(serializer),
18596        }
18597    }
18598}
18599
18600impl<'de> serde::de::Deserialize<'de> for Protocols {
18601    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18602    where
18603        D: serde::Deserializer<'de>,
18604    {
18605        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocols>::new(
18606            ".google.cloud.netapp.v1.Protocols",
18607        ))
18608    }
18609}
18610
18611/// AccessType is an enum of all the supported access types for a volume.
18612///
18613/// # Working with unknown values
18614///
18615/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18616/// additional enum variants at any time. Adding new variants is not considered
18617/// a breaking change. Applications should write their code in anticipation of:
18618///
18619/// - New values appearing in future releases of the client library, **and**
18620/// - New values received dynamically, without application changes.
18621///
18622/// Please consult the [Working with enums] section in the user guide for some
18623/// guidelines.
18624///
18625/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18626#[derive(Clone, Debug, PartialEq)]
18627#[non_exhaustive]
18628pub enum AccessType {
18629    /// Unspecified Access Type
18630    Unspecified,
18631    /// Read Only
18632    ReadOnly,
18633    /// Read Write
18634    ReadWrite,
18635    /// None
18636    ReadNone,
18637    /// If set, the enum was initialized with an unknown value.
18638    ///
18639    /// Applications can examine the value using [AccessType::value] or
18640    /// [AccessType::name].
18641    UnknownValue(access_type::UnknownValue),
18642}
18643
18644#[doc(hidden)]
18645pub mod access_type {
18646    #[allow(unused_imports)]
18647    use super::*;
18648    #[derive(Clone, Debug, PartialEq)]
18649    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18650}
18651
18652impl AccessType {
18653    /// Gets the enum value.
18654    ///
18655    /// Returns `None` if the enum contains an unknown value deserialized from
18656    /// the string representation of enums.
18657    pub fn value(&self) -> std::option::Option<i32> {
18658        match self {
18659            Self::Unspecified => std::option::Option::Some(0),
18660            Self::ReadOnly => std::option::Option::Some(1),
18661            Self::ReadWrite => std::option::Option::Some(2),
18662            Self::ReadNone => std::option::Option::Some(3),
18663            Self::UnknownValue(u) => u.0.value(),
18664        }
18665    }
18666
18667    /// Gets the enum value as a string.
18668    ///
18669    /// Returns `None` if the enum contains an unknown value deserialized from
18670    /// the integer representation of enums.
18671    pub fn name(&self) -> std::option::Option<&str> {
18672        match self {
18673            Self::Unspecified => std::option::Option::Some("ACCESS_TYPE_UNSPECIFIED"),
18674            Self::ReadOnly => std::option::Option::Some("READ_ONLY"),
18675            Self::ReadWrite => std::option::Option::Some("READ_WRITE"),
18676            Self::ReadNone => std::option::Option::Some("READ_NONE"),
18677            Self::UnknownValue(u) => u.0.name(),
18678        }
18679    }
18680}
18681
18682impl std::default::Default for AccessType {
18683    fn default() -> Self {
18684        use std::convert::From;
18685        Self::from(0)
18686    }
18687}
18688
18689impl std::fmt::Display for AccessType {
18690    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18691        wkt::internal::display_enum(f, self.name(), self.value())
18692    }
18693}
18694
18695impl std::convert::From<i32> for AccessType {
18696    fn from(value: i32) -> Self {
18697        match value {
18698            0 => Self::Unspecified,
18699            1 => Self::ReadOnly,
18700            2 => Self::ReadWrite,
18701            3 => Self::ReadNone,
18702            _ => Self::UnknownValue(access_type::UnknownValue(
18703                wkt::internal::UnknownEnumValue::Integer(value),
18704            )),
18705        }
18706    }
18707}
18708
18709impl std::convert::From<&str> for AccessType {
18710    fn from(value: &str) -> Self {
18711        use std::string::ToString;
18712        match value {
18713            "ACCESS_TYPE_UNSPECIFIED" => Self::Unspecified,
18714            "READ_ONLY" => Self::ReadOnly,
18715            "READ_WRITE" => Self::ReadWrite,
18716            "READ_NONE" => Self::ReadNone,
18717            _ => Self::UnknownValue(access_type::UnknownValue(
18718                wkt::internal::UnknownEnumValue::String(value.to_string()),
18719            )),
18720        }
18721    }
18722}
18723
18724impl serde::ser::Serialize for AccessType {
18725    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18726    where
18727        S: serde::Serializer,
18728    {
18729        match self {
18730            Self::Unspecified => serializer.serialize_i32(0),
18731            Self::ReadOnly => serializer.serialize_i32(1),
18732            Self::ReadWrite => serializer.serialize_i32(2),
18733            Self::ReadNone => serializer.serialize_i32(3),
18734            Self::UnknownValue(u) => u.0.serialize(serializer),
18735        }
18736    }
18737}
18738
18739impl<'de> serde::de::Deserialize<'de> for AccessType {
18740    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18741    where
18742        D: serde::Deserializer<'de>,
18743    {
18744        deserializer.deserialize_any(wkt::internal::EnumVisitor::<AccessType>::new(
18745            ".google.cloud.netapp.v1.AccessType",
18746        ))
18747    }
18748}
18749
18750/// SMBSettings
18751/// Modifies the behaviour of a SMB volume.
18752///
18753/// # Working with unknown values
18754///
18755/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18756/// additional enum variants at any time. Adding new variants is not considered
18757/// a breaking change. Applications should write their code in anticipation of:
18758///
18759/// - New values appearing in future releases of the client library, **and**
18760/// - New values received dynamically, without application changes.
18761///
18762/// Please consult the [Working with enums] section in the user guide for some
18763/// guidelines.
18764///
18765/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18766#[derive(Clone, Debug, PartialEq)]
18767#[non_exhaustive]
18768pub enum SMBSettings {
18769    /// Unspecified default option
18770    Unspecified,
18771    /// SMB setting encrypt data
18772    EncryptData,
18773    /// SMB setting browsable
18774    Browsable,
18775    /// SMB setting notify change
18776    ChangeNotify,
18777    /// SMB setting not to notify change
18778    NonBrowsable,
18779    /// SMB setting oplocks
18780    Oplocks,
18781    /// SMB setting to show snapshots
18782    ShowSnapshot,
18783    /// SMB setting to show previous versions
18784    ShowPreviousVersions,
18785    /// SMB setting to access volume based on enumerartion
18786    AccessBasedEnumeration,
18787    /// Continuously available enumeration
18788    ContinuouslyAvailable,
18789    /// If set, the enum was initialized with an unknown value.
18790    ///
18791    /// Applications can examine the value using [SMBSettings::value] or
18792    /// [SMBSettings::name].
18793    UnknownValue(smb_settings::UnknownValue),
18794}
18795
18796#[doc(hidden)]
18797pub mod smb_settings {
18798    #[allow(unused_imports)]
18799    use super::*;
18800    #[derive(Clone, Debug, PartialEq)]
18801    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18802}
18803
18804impl SMBSettings {
18805    /// Gets the enum value.
18806    ///
18807    /// Returns `None` if the enum contains an unknown value deserialized from
18808    /// the string representation of enums.
18809    pub fn value(&self) -> std::option::Option<i32> {
18810        match self {
18811            Self::Unspecified => std::option::Option::Some(0),
18812            Self::EncryptData => std::option::Option::Some(1),
18813            Self::Browsable => std::option::Option::Some(2),
18814            Self::ChangeNotify => std::option::Option::Some(3),
18815            Self::NonBrowsable => std::option::Option::Some(4),
18816            Self::Oplocks => std::option::Option::Some(5),
18817            Self::ShowSnapshot => std::option::Option::Some(6),
18818            Self::ShowPreviousVersions => std::option::Option::Some(7),
18819            Self::AccessBasedEnumeration => std::option::Option::Some(8),
18820            Self::ContinuouslyAvailable => std::option::Option::Some(9),
18821            Self::UnknownValue(u) => u.0.value(),
18822        }
18823    }
18824
18825    /// Gets the enum value as a string.
18826    ///
18827    /// Returns `None` if the enum contains an unknown value deserialized from
18828    /// the integer representation of enums.
18829    pub fn name(&self) -> std::option::Option<&str> {
18830        match self {
18831            Self::Unspecified => std::option::Option::Some("SMB_SETTINGS_UNSPECIFIED"),
18832            Self::EncryptData => std::option::Option::Some("ENCRYPT_DATA"),
18833            Self::Browsable => std::option::Option::Some("BROWSABLE"),
18834            Self::ChangeNotify => std::option::Option::Some("CHANGE_NOTIFY"),
18835            Self::NonBrowsable => std::option::Option::Some("NON_BROWSABLE"),
18836            Self::Oplocks => std::option::Option::Some("OPLOCKS"),
18837            Self::ShowSnapshot => std::option::Option::Some("SHOW_SNAPSHOT"),
18838            Self::ShowPreviousVersions => std::option::Option::Some("SHOW_PREVIOUS_VERSIONS"),
18839            Self::AccessBasedEnumeration => std::option::Option::Some("ACCESS_BASED_ENUMERATION"),
18840            Self::ContinuouslyAvailable => std::option::Option::Some("CONTINUOUSLY_AVAILABLE"),
18841            Self::UnknownValue(u) => u.0.name(),
18842        }
18843    }
18844}
18845
18846impl std::default::Default for SMBSettings {
18847    fn default() -> Self {
18848        use std::convert::From;
18849        Self::from(0)
18850    }
18851}
18852
18853impl std::fmt::Display for SMBSettings {
18854    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18855        wkt::internal::display_enum(f, self.name(), self.value())
18856    }
18857}
18858
18859impl std::convert::From<i32> for SMBSettings {
18860    fn from(value: i32) -> Self {
18861        match value {
18862            0 => Self::Unspecified,
18863            1 => Self::EncryptData,
18864            2 => Self::Browsable,
18865            3 => Self::ChangeNotify,
18866            4 => Self::NonBrowsable,
18867            5 => Self::Oplocks,
18868            6 => Self::ShowSnapshot,
18869            7 => Self::ShowPreviousVersions,
18870            8 => Self::AccessBasedEnumeration,
18871            9 => Self::ContinuouslyAvailable,
18872            _ => Self::UnknownValue(smb_settings::UnknownValue(
18873                wkt::internal::UnknownEnumValue::Integer(value),
18874            )),
18875        }
18876    }
18877}
18878
18879impl std::convert::From<&str> for SMBSettings {
18880    fn from(value: &str) -> Self {
18881        use std::string::ToString;
18882        match value {
18883            "SMB_SETTINGS_UNSPECIFIED" => Self::Unspecified,
18884            "ENCRYPT_DATA" => Self::EncryptData,
18885            "BROWSABLE" => Self::Browsable,
18886            "CHANGE_NOTIFY" => Self::ChangeNotify,
18887            "NON_BROWSABLE" => Self::NonBrowsable,
18888            "OPLOCKS" => Self::Oplocks,
18889            "SHOW_SNAPSHOT" => Self::ShowSnapshot,
18890            "SHOW_PREVIOUS_VERSIONS" => Self::ShowPreviousVersions,
18891            "ACCESS_BASED_ENUMERATION" => Self::AccessBasedEnumeration,
18892            "CONTINUOUSLY_AVAILABLE" => Self::ContinuouslyAvailable,
18893            _ => Self::UnknownValue(smb_settings::UnknownValue(
18894                wkt::internal::UnknownEnumValue::String(value.to_string()),
18895            )),
18896        }
18897    }
18898}
18899
18900impl serde::ser::Serialize for SMBSettings {
18901    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18902    where
18903        S: serde::Serializer,
18904    {
18905        match self {
18906            Self::Unspecified => serializer.serialize_i32(0),
18907            Self::EncryptData => serializer.serialize_i32(1),
18908            Self::Browsable => serializer.serialize_i32(2),
18909            Self::ChangeNotify => serializer.serialize_i32(3),
18910            Self::NonBrowsable => serializer.serialize_i32(4),
18911            Self::Oplocks => serializer.serialize_i32(5),
18912            Self::ShowSnapshot => serializer.serialize_i32(6),
18913            Self::ShowPreviousVersions => serializer.serialize_i32(7),
18914            Self::AccessBasedEnumeration => serializer.serialize_i32(8),
18915            Self::ContinuouslyAvailable => serializer.serialize_i32(9),
18916            Self::UnknownValue(u) => u.0.serialize(serializer),
18917        }
18918    }
18919}
18920
18921impl<'de> serde::de::Deserialize<'de> for SMBSettings {
18922    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18923    where
18924        D: serde::Deserializer<'de>,
18925    {
18926        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SMBSettings>::new(
18927            ".google.cloud.netapp.v1.SMBSettings",
18928        ))
18929    }
18930}
18931
18932/// The security style of the volume, can be either UNIX or NTFS.
18933///
18934/// # Working with unknown values
18935///
18936/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18937/// additional enum variants at any time. Adding new variants is not considered
18938/// a breaking change. Applications should write their code in anticipation of:
18939///
18940/// - New values appearing in future releases of the client library, **and**
18941/// - New values received dynamically, without application changes.
18942///
18943/// Please consult the [Working with enums] section in the user guide for some
18944/// guidelines.
18945///
18946/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18947#[derive(Clone, Debug, PartialEq)]
18948#[non_exhaustive]
18949pub enum SecurityStyle {
18950    /// SecurityStyle is unspecified
18951    Unspecified,
18952    /// SecurityStyle uses NTFS
18953    Ntfs,
18954    /// SecurityStyle uses UNIX
18955    Unix,
18956    /// If set, the enum was initialized with an unknown value.
18957    ///
18958    /// Applications can examine the value using [SecurityStyle::value] or
18959    /// [SecurityStyle::name].
18960    UnknownValue(security_style::UnknownValue),
18961}
18962
18963#[doc(hidden)]
18964pub mod security_style {
18965    #[allow(unused_imports)]
18966    use super::*;
18967    #[derive(Clone, Debug, PartialEq)]
18968    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18969}
18970
18971impl SecurityStyle {
18972    /// Gets the enum value.
18973    ///
18974    /// Returns `None` if the enum contains an unknown value deserialized from
18975    /// the string representation of enums.
18976    pub fn value(&self) -> std::option::Option<i32> {
18977        match self {
18978            Self::Unspecified => std::option::Option::Some(0),
18979            Self::Ntfs => std::option::Option::Some(1),
18980            Self::Unix => std::option::Option::Some(2),
18981            Self::UnknownValue(u) => u.0.value(),
18982        }
18983    }
18984
18985    /// Gets the enum value as a string.
18986    ///
18987    /// Returns `None` if the enum contains an unknown value deserialized from
18988    /// the integer representation of enums.
18989    pub fn name(&self) -> std::option::Option<&str> {
18990        match self {
18991            Self::Unspecified => std::option::Option::Some("SECURITY_STYLE_UNSPECIFIED"),
18992            Self::Ntfs => std::option::Option::Some("NTFS"),
18993            Self::Unix => std::option::Option::Some("UNIX"),
18994            Self::UnknownValue(u) => u.0.name(),
18995        }
18996    }
18997}
18998
18999impl std::default::Default for SecurityStyle {
19000    fn default() -> Self {
19001        use std::convert::From;
19002        Self::from(0)
19003    }
19004}
19005
19006impl std::fmt::Display for SecurityStyle {
19007    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19008        wkt::internal::display_enum(f, self.name(), self.value())
19009    }
19010}
19011
19012impl std::convert::From<i32> for SecurityStyle {
19013    fn from(value: i32) -> Self {
19014        match value {
19015            0 => Self::Unspecified,
19016            1 => Self::Ntfs,
19017            2 => Self::Unix,
19018            _ => Self::UnknownValue(security_style::UnknownValue(
19019                wkt::internal::UnknownEnumValue::Integer(value),
19020            )),
19021        }
19022    }
19023}
19024
19025impl std::convert::From<&str> for SecurityStyle {
19026    fn from(value: &str) -> Self {
19027        use std::string::ToString;
19028        match value {
19029            "SECURITY_STYLE_UNSPECIFIED" => Self::Unspecified,
19030            "NTFS" => Self::Ntfs,
19031            "UNIX" => Self::Unix,
19032            _ => Self::UnknownValue(security_style::UnknownValue(
19033                wkt::internal::UnknownEnumValue::String(value.to_string()),
19034            )),
19035        }
19036    }
19037}
19038
19039impl serde::ser::Serialize for SecurityStyle {
19040    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19041    where
19042        S: serde::Serializer,
19043    {
19044        match self {
19045            Self::Unspecified => serializer.serialize_i32(0),
19046            Self::Ntfs => serializer.serialize_i32(1),
19047            Self::Unix => serializer.serialize_i32(2),
19048            Self::UnknownValue(u) => u.0.serialize(serializer),
19049        }
19050    }
19051}
19052
19053impl<'de> serde::de::Deserialize<'de> for SecurityStyle {
19054    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19055    where
19056        D: serde::Deserializer<'de>,
19057    {
19058        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SecurityStyle>::new(
19059            ".google.cloud.netapp.v1.SecurityStyle",
19060        ))
19061    }
19062}
19063
19064/// Actions to be restricted for a volume.
19065///
19066/// # Working with unknown values
19067///
19068/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19069/// additional enum variants at any time. Adding new variants is not considered
19070/// a breaking change. Applications should write their code in anticipation of:
19071///
19072/// - New values appearing in future releases of the client library, **and**
19073/// - New values received dynamically, without application changes.
19074///
19075/// Please consult the [Working with enums] section in the user guide for some
19076/// guidelines.
19077///
19078/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19079#[derive(Clone, Debug, PartialEq)]
19080#[non_exhaustive]
19081pub enum RestrictedAction {
19082    /// Unspecified restricted action
19083    Unspecified,
19084    /// Prevent volume from being deleted when mounted.
19085    Delete,
19086    /// If set, the enum was initialized with an unknown value.
19087    ///
19088    /// Applications can examine the value using [RestrictedAction::value] or
19089    /// [RestrictedAction::name].
19090    UnknownValue(restricted_action::UnknownValue),
19091}
19092
19093#[doc(hidden)]
19094pub mod restricted_action {
19095    #[allow(unused_imports)]
19096    use super::*;
19097    #[derive(Clone, Debug, PartialEq)]
19098    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19099}
19100
19101impl RestrictedAction {
19102    /// Gets the enum value.
19103    ///
19104    /// Returns `None` if the enum contains an unknown value deserialized from
19105    /// the string representation of enums.
19106    pub fn value(&self) -> std::option::Option<i32> {
19107        match self {
19108            Self::Unspecified => std::option::Option::Some(0),
19109            Self::Delete => std::option::Option::Some(1),
19110            Self::UnknownValue(u) => u.0.value(),
19111        }
19112    }
19113
19114    /// Gets the enum value as a string.
19115    ///
19116    /// Returns `None` if the enum contains an unknown value deserialized from
19117    /// the integer representation of enums.
19118    pub fn name(&self) -> std::option::Option<&str> {
19119        match self {
19120            Self::Unspecified => std::option::Option::Some("RESTRICTED_ACTION_UNSPECIFIED"),
19121            Self::Delete => std::option::Option::Some("DELETE"),
19122            Self::UnknownValue(u) => u.0.name(),
19123        }
19124    }
19125}
19126
19127impl std::default::Default for RestrictedAction {
19128    fn default() -> Self {
19129        use std::convert::From;
19130        Self::from(0)
19131    }
19132}
19133
19134impl std::fmt::Display for RestrictedAction {
19135    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19136        wkt::internal::display_enum(f, self.name(), self.value())
19137    }
19138}
19139
19140impl std::convert::From<i32> for RestrictedAction {
19141    fn from(value: i32) -> Self {
19142        match value {
19143            0 => Self::Unspecified,
19144            1 => Self::Delete,
19145            _ => Self::UnknownValue(restricted_action::UnknownValue(
19146                wkt::internal::UnknownEnumValue::Integer(value),
19147            )),
19148        }
19149    }
19150}
19151
19152impl std::convert::From<&str> for RestrictedAction {
19153    fn from(value: &str) -> Self {
19154        use std::string::ToString;
19155        match value {
19156            "RESTRICTED_ACTION_UNSPECIFIED" => Self::Unspecified,
19157            "DELETE" => Self::Delete,
19158            _ => Self::UnknownValue(restricted_action::UnknownValue(
19159                wkt::internal::UnknownEnumValue::String(value.to_string()),
19160            )),
19161        }
19162    }
19163}
19164
19165impl serde::ser::Serialize for RestrictedAction {
19166    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19167    where
19168        S: serde::Serializer,
19169    {
19170        match self {
19171            Self::Unspecified => serializer.serialize_i32(0),
19172            Self::Delete => serializer.serialize_i32(1),
19173            Self::UnknownValue(u) => u.0.serialize(serializer),
19174        }
19175    }
19176}
19177
19178impl<'de> serde::de::Deserialize<'de> for RestrictedAction {
19179    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19180    where
19181        D: serde::Deserializer<'de>,
19182    {
19183        deserializer.deserialize_any(wkt::internal::EnumVisitor::<RestrictedAction>::new(
19184            ".google.cloud.netapp.v1.RestrictedAction",
19185        ))
19186    }
19187}