Skip to main content

google_cloud_netapp_v1/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_location;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34mod debug;
35mod deserialize;
36mod serialize;
37
38/// ListActiveDirectoriesRequest for requesting multiple active directories.
39#[derive(Clone, Default, PartialEq)]
40#[non_exhaustive]
41pub struct ListActiveDirectoriesRequest {
42    /// Required. Parent value for ListActiveDirectoriesRequest
43    pub parent: std::string::String,
44
45    /// Requested page size. Server may return fewer items than requested.
46    /// If unspecified, the server will pick an appropriate default.
47    pub page_size: i32,
48
49    /// A token identifying a page of results the server should return.
50    pub page_token: std::string::String,
51
52    /// Filtering results
53    pub filter: std::string::String,
54
55    /// Hint for how to order the results
56    pub order_by: std::string::String,
57
58    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
59}
60
61impl ListActiveDirectoriesRequest {
62    pub fn new() -> Self {
63        std::default::Default::default()
64    }
65
66    /// Sets the value of [parent][crate::model::ListActiveDirectoriesRequest::parent].
67    ///
68    /// # Example
69    /// ```ignore,no_run
70    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
71    /// let x = ListActiveDirectoriesRequest::new().set_parent("example");
72    /// ```
73    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
74        self.parent = v.into();
75        self
76    }
77
78    /// Sets the value of [page_size][crate::model::ListActiveDirectoriesRequest::page_size].
79    ///
80    /// # Example
81    /// ```ignore,no_run
82    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
83    /// let x = ListActiveDirectoriesRequest::new().set_page_size(42);
84    /// ```
85    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
86        self.page_size = v.into();
87        self
88    }
89
90    /// Sets the value of [page_token][crate::model::ListActiveDirectoriesRequest::page_token].
91    ///
92    /// # Example
93    /// ```ignore,no_run
94    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
95    /// let x = ListActiveDirectoriesRequest::new().set_page_token("example");
96    /// ```
97    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
98        self.page_token = v.into();
99        self
100    }
101
102    /// Sets the value of [filter][crate::model::ListActiveDirectoriesRequest::filter].
103    ///
104    /// # Example
105    /// ```ignore,no_run
106    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
107    /// let x = ListActiveDirectoriesRequest::new().set_filter("example");
108    /// ```
109    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
110        self.filter = v.into();
111        self
112    }
113
114    /// Sets the value of [order_by][crate::model::ListActiveDirectoriesRequest::order_by].
115    ///
116    /// # Example
117    /// ```ignore,no_run
118    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
119    /// let x = ListActiveDirectoriesRequest::new().set_order_by("example");
120    /// ```
121    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
122        self.order_by = v.into();
123        self
124    }
125}
126
127impl wkt::message::Message for ListActiveDirectoriesRequest {
128    fn typename() -> &'static str {
129        "type.googleapis.com/google.cloud.netapp.v1.ListActiveDirectoriesRequest"
130    }
131}
132
133/// ListActiveDirectoriesResponse contains all the active directories requested.
134#[derive(Clone, Default, PartialEq)]
135#[non_exhaustive]
136pub struct ListActiveDirectoriesResponse {
137    /// The list of active directories.
138    pub active_directories: std::vec::Vec<crate::model::ActiveDirectory>,
139
140    /// A token identifying a page of results the server should return.
141    pub next_page_token: std::string::String,
142
143    /// Locations that could not be reached.
144    pub unreachable: std::vec::Vec<std::string::String>,
145
146    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
147}
148
149impl ListActiveDirectoriesResponse {
150    pub fn new() -> Self {
151        std::default::Default::default()
152    }
153
154    /// Sets the value of [active_directories][crate::model::ListActiveDirectoriesResponse::active_directories].
155    ///
156    /// # Example
157    /// ```ignore,no_run
158    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesResponse;
159    /// use google_cloud_netapp_v1::model::ActiveDirectory;
160    /// let x = ListActiveDirectoriesResponse::new()
161    ///     .set_active_directories([
162    ///         ActiveDirectory::default()/* use setters */,
163    ///         ActiveDirectory::default()/* use (different) setters */,
164    ///     ]);
165    /// ```
166    pub fn set_active_directories<T, V>(mut self, v: T) -> Self
167    where
168        T: std::iter::IntoIterator<Item = V>,
169        V: std::convert::Into<crate::model::ActiveDirectory>,
170    {
171        use std::iter::Iterator;
172        self.active_directories = v.into_iter().map(|i| i.into()).collect();
173        self
174    }
175
176    /// Sets the value of [next_page_token][crate::model::ListActiveDirectoriesResponse::next_page_token].
177    ///
178    /// # Example
179    /// ```ignore,no_run
180    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesResponse;
181    /// let x = ListActiveDirectoriesResponse::new().set_next_page_token("example");
182    /// ```
183    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
184        self.next_page_token = v.into();
185        self
186    }
187
188    /// Sets the value of [unreachable][crate::model::ListActiveDirectoriesResponse::unreachable].
189    ///
190    /// # Example
191    /// ```ignore,no_run
192    /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesResponse;
193    /// let x = ListActiveDirectoriesResponse::new().set_unreachable(["a", "b", "c"]);
194    /// ```
195    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
196    where
197        T: std::iter::IntoIterator<Item = V>,
198        V: std::convert::Into<std::string::String>,
199    {
200        use std::iter::Iterator;
201        self.unreachable = v.into_iter().map(|i| i.into()).collect();
202        self
203    }
204}
205
206impl wkt::message::Message for ListActiveDirectoriesResponse {
207    fn typename() -> &'static str {
208        "type.googleapis.com/google.cloud.netapp.v1.ListActiveDirectoriesResponse"
209    }
210}
211
212#[doc(hidden)]
213impl google_cloud_gax::paginator::internal::PageableResponse for ListActiveDirectoriesResponse {
214    type PageItem = crate::model::ActiveDirectory;
215
216    fn items(self) -> std::vec::Vec<Self::PageItem> {
217        self.active_directories
218    }
219
220    fn next_page_token(&self) -> std::string::String {
221        use std::clone::Clone;
222        self.next_page_token.clone()
223    }
224}
225
226/// GetActiveDirectory for getting a single active directory.
227#[derive(Clone, Default, PartialEq)]
228#[non_exhaustive]
229pub struct GetActiveDirectoryRequest {
230    /// Required. Name of the active directory.
231    pub name: std::string::String,
232
233    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
234}
235
236impl GetActiveDirectoryRequest {
237    pub fn new() -> Self {
238        std::default::Default::default()
239    }
240
241    /// Sets the value of [name][crate::model::GetActiveDirectoryRequest::name].
242    ///
243    /// # Example
244    /// ```ignore,no_run
245    /// # use google_cloud_netapp_v1::model::GetActiveDirectoryRequest;
246    /// let x = GetActiveDirectoryRequest::new().set_name("example");
247    /// ```
248    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
249        self.name = v.into();
250        self
251    }
252}
253
254impl wkt::message::Message for GetActiveDirectoryRequest {
255    fn typename() -> &'static str {
256        "type.googleapis.com/google.cloud.netapp.v1.GetActiveDirectoryRequest"
257    }
258}
259
260/// CreateActiveDirectoryRequest for creating an active directory.
261#[derive(Clone, Default, PartialEq)]
262#[non_exhaustive]
263pub struct CreateActiveDirectoryRequest {
264    /// Required. Value for parent.
265    pub parent: std::string::String,
266
267    /// Required. Fields of the to be created active directory.
268    pub active_directory: std::option::Option<crate::model::ActiveDirectory>,
269
270    /// Required. ID of the active directory to create. Must be unique within the
271    /// parent resource. Must contain only letters, numbers and hyphen, with the
272    /// first character a letter , the last a letter or a number, and a 63
273    /// character maximum.
274    pub active_directory_id: std::string::String,
275
276    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
277}
278
279impl CreateActiveDirectoryRequest {
280    pub fn new() -> Self {
281        std::default::Default::default()
282    }
283
284    /// Sets the value of [parent][crate::model::CreateActiveDirectoryRequest::parent].
285    ///
286    /// # Example
287    /// ```ignore,no_run
288    /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
289    /// let x = CreateActiveDirectoryRequest::new().set_parent("example");
290    /// ```
291    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
292        self.parent = v.into();
293        self
294    }
295
296    /// Sets the value of [active_directory][crate::model::CreateActiveDirectoryRequest::active_directory].
297    ///
298    /// # Example
299    /// ```ignore,no_run
300    /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
301    /// use google_cloud_netapp_v1::model::ActiveDirectory;
302    /// let x = CreateActiveDirectoryRequest::new().set_active_directory(ActiveDirectory::default()/* use setters */);
303    /// ```
304    pub fn set_active_directory<T>(mut self, v: T) -> Self
305    where
306        T: std::convert::Into<crate::model::ActiveDirectory>,
307    {
308        self.active_directory = std::option::Option::Some(v.into());
309        self
310    }
311
312    /// Sets or clears the value of [active_directory][crate::model::CreateActiveDirectoryRequest::active_directory].
313    ///
314    /// # Example
315    /// ```ignore,no_run
316    /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
317    /// use google_cloud_netapp_v1::model::ActiveDirectory;
318    /// let x = CreateActiveDirectoryRequest::new().set_or_clear_active_directory(Some(ActiveDirectory::default()/* use setters */));
319    /// let x = CreateActiveDirectoryRequest::new().set_or_clear_active_directory(None::<ActiveDirectory>);
320    /// ```
321    pub fn set_or_clear_active_directory<T>(mut self, v: std::option::Option<T>) -> Self
322    where
323        T: std::convert::Into<crate::model::ActiveDirectory>,
324    {
325        self.active_directory = v.map(|x| x.into());
326        self
327    }
328
329    /// Sets the value of [active_directory_id][crate::model::CreateActiveDirectoryRequest::active_directory_id].
330    ///
331    /// # Example
332    /// ```ignore,no_run
333    /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
334    /// let x = CreateActiveDirectoryRequest::new().set_active_directory_id("example");
335    /// ```
336    pub fn set_active_directory_id<T: std::convert::Into<std::string::String>>(
337        mut self,
338        v: T,
339    ) -> Self {
340        self.active_directory_id = v.into();
341        self
342    }
343}
344
345impl wkt::message::Message for CreateActiveDirectoryRequest {
346    fn typename() -> &'static str {
347        "type.googleapis.com/google.cloud.netapp.v1.CreateActiveDirectoryRequest"
348    }
349}
350
351/// UpdateActiveDirectoryRequest for updating an active directory.
352#[derive(Clone, Default, PartialEq)]
353#[non_exhaustive]
354pub struct UpdateActiveDirectoryRequest {
355    /// Required. Field mask is used to specify the fields to be overwritten in the
356    /// Active Directory resource by the update.
357    /// The fields specified in the update_mask are relative to the resource, not
358    /// the full request. A field will be overwritten if it is in the mask. If the
359    /// user does not provide a mask then all fields will be overwritten.
360    pub update_mask: std::option::Option<wkt::FieldMask>,
361
362    /// Required. The volume being updated
363    pub active_directory: std::option::Option<crate::model::ActiveDirectory>,
364
365    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
366}
367
368impl UpdateActiveDirectoryRequest {
369    pub fn new() -> Self {
370        std::default::Default::default()
371    }
372
373    /// Sets the value of [update_mask][crate::model::UpdateActiveDirectoryRequest::update_mask].
374    ///
375    /// # Example
376    /// ```ignore,no_run
377    /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
378    /// use wkt::FieldMask;
379    /// let x = UpdateActiveDirectoryRequest::new().set_update_mask(FieldMask::default()/* use setters */);
380    /// ```
381    pub fn set_update_mask<T>(mut self, v: T) -> Self
382    where
383        T: std::convert::Into<wkt::FieldMask>,
384    {
385        self.update_mask = std::option::Option::Some(v.into());
386        self
387    }
388
389    /// Sets or clears the value of [update_mask][crate::model::UpdateActiveDirectoryRequest::update_mask].
390    ///
391    /// # Example
392    /// ```ignore,no_run
393    /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
394    /// use wkt::FieldMask;
395    /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
396    /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_update_mask(None::<FieldMask>);
397    /// ```
398    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
399    where
400        T: std::convert::Into<wkt::FieldMask>,
401    {
402        self.update_mask = v.map(|x| x.into());
403        self
404    }
405
406    /// Sets the value of [active_directory][crate::model::UpdateActiveDirectoryRequest::active_directory].
407    ///
408    /// # Example
409    /// ```ignore,no_run
410    /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
411    /// use google_cloud_netapp_v1::model::ActiveDirectory;
412    /// let x = UpdateActiveDirectoryRequest::new().set_active_directory(ActiveDirectory::default()/* use setters */);
413    /// ```
414    pub fn set_active_directory<T>(mut self, v: T) -> Self
415    where
416        T: std::convert::Into<crate::model::ActiveDirectory>,
417    {
418        self.active_directory = std::option::Option::Some(v.into());
419        self
420    }
421
422    /// Sets or clears the value of [active_directory][crate::model::UpdateActiveDirectoryRequest::active_directory].
423    ///
424    /// # Example
425    /// ```ignore,no_run
426    /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
427    /// use google_cloud_netapp_v1::model::ActiveDirectory;
428    /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_active_directory(Some(ActiveDirectory::default()/* use setters */));
429    /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_active_directory(None::<ActiveDirectory>);
430    /// ```
431    pub fn set_or_clear_active_directory<T>(mut self, v: std::option::Option<T>) -> Self
432    where
433        T: std::convert::Into<crate::model::ActiveDirectory>,
434    {
435        self.active_directory = v.map(|x| x.into());
436        self
437    }
438}
439
440impl wkt::message::Message for UpdateActiveDirectoryRequest {
441    fn typename() -> &'static str {
442        "type.googleapis.com/google.cloud.netapp.v1.UpdateActiveDirectoryRequest"
443    }
444}
445
446/// DeleteActiveDirectoryRequest for deleting a single active directory.
447#[derive(Clone, Default, PartialEq)]
448#[non_exhaustive]
449pub struct DeleteActiveDirectoryRequest {
450    /// Required. Name of the active directory.
451    pub name: std::string::String,
452
453    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
454}
455
456impl DeleteActiveDirectoryRequest {
457    pub fn new() -> Self {
458        std::default::Default::default()
459    }
460
461    /// Sets the value of [name][crate::model::DeleteActiveDirectoryRequest::name].
462    ///
463    /// # Example
464    /// ```ignore,no_run
465    /// # use google_cloud_netapp_v1::model::DeleteActiveDirectoryRequest;
466    /// let x = DeleteActiveDirectoryRequest::new().set_name("example");
467    /// ```
468    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
469        self.name = v.into();
470        self
471    }
472}
473
474impl wkt::message::Message for DeleteActiveDirectoryRequest {
475    fn typename() -> &'static str {
476        "type.googleapis.com/google.cloud.netapp.v1.DeleteActiveDirectoryRequest"
477    }
478}
479
480/// ActiveDirectory is the public representation of the active directory config.
481#[derive(Clone, Default, PartialEq)]
482#[non_exhaustive]
483pub struct ActiveDirectory {
484    /// Identifier. The resource name of the active directory.
485    /// Format:
486    /// `projects/{project_number}/locations/{location_id}/activeDirectories/{active_directory_id}`.
487    pub name: std::string::String,
488
489    /// Output only. Create time of the active directory.
490    pub create_time: std::option::Option<wkt::Timestamp>,
491
492    /// Output only. The state of the AD.
493    pub state: crate::model::active_directory::State,
494
495    /// Required. Name of the Active Directory domain
496    pub domain: std::string::String,
497
498    /// The Active Directory site the service will limit Domain Controller
499    /// discovery too.
500    pub site: std::string::String,
501
502    /// Required. Comma separated list of DNS server IP addresses for the Active
503    /// Directory domain.
504    pub dns: std::string::String,
505
506    /// Required. NetBIOSPrefix is used as a prefix for SMB server name.
507    pub net_bios_prefix: std::string::String,
508
509    /// The Organizational Unit (OU) within the Windows Active Directory the user
510    /// belongs to.
511    pub organizational_unit: std::string::String,
512
513    /// If enabled, AES encryption will be enabled for SMB communication.
514    pub aes_encryption: bool,
515
516    /// Required. Username of the Active Directory domain administrator.
517    pub username: std::string::String,
518
519    /// Required. Password of the Active Directory domain administrator.
520    pub password: std::string::String,
521
522    /// Optional. Users to be added to the Built-in Backup Operator active
523    /// directory group.
524    pub backup_operators: std::vec::Vec<std::string::String>,
525
526    /// Optional. Users to be added to the Built-in Admininstrators group.
527    pub administrators: std::vec::Vec<std::string::String>,
528
529    /// Optional. Domain users to be given the SeSecurityPrivilege.
530    pub security_operators: std::vec::Vec<std::string::String>,
531
532    /// Name of the active directory machine. This optional parameter is used only
533    /// while creating kerberos volume
534    pub kdc_hostname: std::string::String,
535
536    /// KDC server IP address for the active directory machine.
537    pub kdc_ip: std::string::String,
538
539    /// If enabled, will allow access to local users and LDAP users. If access is
540    /// needed for only LDAP users, it has to be disabled.
541    pub nfs_users_with_ldap: bool,
542
543    /// Description of the active directory.
544    pub description: std::string::String,
545
546    /// Specifies whether or not the LDAP traffic needs to be signed.
547    pub ldap_signing: bool,
548
549    /// If enabled, traffic between the SMB server to Domain Controller (DC) will
550    /// be encrypted.
551    pub encrypt_dc_connections: bool,
552
553    /// Labels for the active directory.
554    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
555
556    /// Output only. The state details of the Active Directory.
557    pub state_details: std::string::String,
558
559    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
560}
561
562impl ActiveDirectory {
563    pub fn new() -> Self {
564        std::default::Default::default()
565    }
566
567    /// Sets the value of [name][crate::model::ActiveDirectory::name].
568    ///
569    /// # Example
570    /// ```ignore,no_run
571    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
572    /// let x = ActiveDirectory::new().set_name("example");
573    /// ```
574    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
575        self.name = v.into();
576        self
577    }
578
579    /// Sets the value of [create_time][crate::model::ActiveDirectory::create_time].
580    ///
581    /// # Example
582    /// ```ignore,no_run
583    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
584    /// use wkt::Timestamp;
585    /// let x = ActiveDirectory::new().set_create_time(Timestamp::default()/* use setters */);
586    /// ```
587    pub fn set_create_time<T>(mut self, v: T) -> Self
588    where
589        T: std::convert::Into<wkt::Timestamp>,
590    {
591        self.create_time = std::option::Option::Some(v.into());
592        self
593    }
594
595    /// Sets or clears the value of [create_time][crate::model::ActiveDirectory::create_time].
596    ///
597    /// # Example
598    /// ```ignore,no_run
599    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
600    /// use wkt::Timestamp;
601    /// let x = ActiveDirectory::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
602    /// let x = ActiveDirectory::new().set_or_clear_create_time(None::<Timestamp>);
603    /// ```
604    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
605    where
606        T: std::convert::Into<wkt::Timestamp>,
607    {
608        self.create_time = v.map(|x| x.into());
609        self
610    }
611
612    /// Sets the value of [state][crate::model::ActiveDirectory::state].
613    ///
614    /// # Example
615    /// ```ignore,no_run
616    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
617    /// use google_cloud_netapp_v1::model::active_directory::State;
618    /// let x0 = ActiveDirectory::new().set_state(State::Creating);
619    /// let x1 = ActiveDirectory::new().set_state(State::Ready);
620    /// let x2 = ActiveDirectory::new().set_state(State::Updating);
621    /// ```
622    pub fn set_state<T: std::convert::Into<crate::model::active_directory::State>>(
623        mut self,
624        v: T,
625    ) -> Self {
626        self.state = v.into();
627        self
628    }
629
630    /// Sets the value of [domain][crate::model::ActiveDirectory::domain].
631    ///
632    /// # Example
633    /// ```ignore,no_run
634    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
635    /// let x = ActiveDirectory::new().set_domain("example");
636    /// ```
637    pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
638        self.domain = v.into();
639        self
640    }
641
642    /// Sets the value of [site][crate::model::ActiveDirectory::site].
643    ///
644    /// # Example
645    /// ```ignore,no_run
646    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
647    /// let x = ActiveDirectory::new().set_site("example");
648    /// ```
649    pub fn set_site<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
650        self.site = v.into();
651        self
652    }
653
654    /// Sets the value of [dns][crate::model::ActiveDirectory::dns].
655    ///
656    /// # Example
657    /// ```ignore,no_run
658    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
659    /// let x = ActiveDirectory::new().set_dns("example");
660    /// ```
661    pub fn set_dns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
662        self.dns = v.into();
663        self
664    }
665
666    /// Sets the value of [net_bios_prefix][crate::model::ActiveDirectory::net_bios_prefix].
667    ///
668    /// # Example
669    /// ```ignore,no_run
670    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
671    /// let x = ActiveDirectory::new().set_net_bios_prefix("example");
672    /// ```
673    pub fn set_net_bios_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
674        self.net_bios_prefix = v.into();
675        self
676    }
677
678    /// Sets the value of [organizational_unit][crate::model::ActiveDirectory::organizational_unit].
679    ///
680    /// # Example
681    /// ```ignore,no_run
682    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
683    /// let x = ActiveDirectory::new().set_organizational_unit("example");
684    /// ```
685    pub fn set_organizational_unit<T: std::convert::Into<std::string::String>>(
686        mut self,
687        v: T,
688    ) -> Self {
689        self.organizational_unit = v.into();
690        self
691    }
692
693    /// Sets the value of [aes_encryption][crate::model::ActiveDirectory::aes_encryption].
694    ///
695    /// # Example
696    /// ```ignore,no_run
697    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
698    /// let x = ActiveDirectory::new().set_aes_encryption(true);
699    /// ```
700    pub fn set_aes_encryption<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
701        self.aes_encryption = v.into();
702        self
703    }
704
705    /// Sets the value of [username][crate::model::ActiveDirectory::username].
706    ///
707    /// # Example
708    /// ```ignore,no_run
709    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
710    /// let x = ActiveDirectory::new().set_username("example");
711    /// ```
712    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
713        self.username = v.into();
714        self
715    }
716
717    /// Sets the value of [password][crate::model::ActiveDirectory::password].
718    ///
719    /// # Example
720    /// ```ignore,no_run
721    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
722    /// let x = ActiveDirectory::new().set_password("example");
723    /// ```
724    pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
725        self.password = v.into();
726        self
727    }
728
729    /// Sets the value of [backup_operators][crate::model::ActiveDirectory::backup_operators].
730    ///
731    /// # Example
732    /// ```ignore,no_run
733    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
734    /// let x = ActiveDirectory::new().set_backup_operators(["a", "b", "c"]);
735    /// ```
736    pub fn set_backup_operators<T, V>(mut self, v: T) -> Self
737    where
738        T: std::iter::IntoIterator<Item = V>,
739        V: std::convert::Into<std::string::String>,
740    {
741        use std::iter::Iterator;
742        self.backup_operators = v.into_iter().map(|i| i.into()).collect();
743        self
744    }
745
746    /// Sets the value of [administrators][crate::model::ActiveDirectory::administrators].
747    ///
748    /// # Example
749    /// ```ignore,no_run
750    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
751    /// let x = ActiveDirectory::new().set_administrators(["a", "b", "c"]);
752    /// ```
753    pub fn set_administrators<T, V>(mut self, v: T) -> Self
754    where
755        T: std::iter::IntoIterator<Item = V>,
756        V: std::convert::Into<std::string::String>,
757    {
758        use std::iter::Iterator;
759        self.administrators = v.into_iter().map(|i| i.into()).collect();
760        self
761    }
762
763    /// Sets the value of [security_operators][crate::model::ActiveDirectory::security_operators].
764    ///
765    /// # Example
766    /// ```ignore,no_run
767    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
768    /// let x = ActiveDirectory::new().set_security_operators(["a", "b", "c"]);
769    /// ```
770    pub fn set_security_operators<T, V>(mut self, v: T) -> Self
771    where
772        T: std::iter::IntoIterator<Item = V>,
773        V: std::convert::Into<std::string::String>,
774    {
775        use std::iter::Iterator;
776        self.security_operators = v.into_iter().map(|i| i.into()).collect();
777        self
778    }
779
780    /// Sets the value of [kdc_hostname][crate::model::ActiveDirectory::kdc_hostname].
781    ///
782    /// # Example
783    /// ```ignore,no_run
784    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
785    /// let x = ActiveDirectory::new().set_kdc_hostname("example");
786    /// ```
787    pub fn set_kdc_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
788        self.kdc_hostname = v.into();
789        self
790    }
791
792    /// Sets the value of [kdc_ip][crate::model::ActiveDirectory::kdc_ip].
793    ///
794    /// # Example
795    /// ```ignore,no_run
796    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
797    /// let x = ActiveDirectory::new().set_kdc_ip("example");
798    /// ```
799    pub fn set_kdc_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
800        self.kdc_ip = v.into();
801        self
802    }
803
804    /// Sets the value of [nfs_users_with_ldap][crate::model::ActiveDirectory::nfs_users_with_ldap].
805    ///
806    /// # Example
807    /// ```ignore,no_run
808    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
809    /// let x = ActiveDirectory::new().set_nfs_users_with_ldap(true);
810    /// ```
811    pub fn set_nfs_users_with_ldap<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
812        self.nfs_users_with_ldap = v.into();
813        self
814    }
815
816    /// Sets the value of [description][crate::model::ActiveDirectory::description].
817    ///
818    /// # Example
819    /// ```ignore,no_run
820    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
821    /// let x = ActiveDirectory::new().set_description("example");
822    /// ```
823    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
824        self.description = v.into();
825        self
826    }
827
828    /// Sets the value of [ldap_signing][crate::model::ActiveDirectory::ldap_signing].
829    ///
830    /// # Example
831    /// ```ignore,no_run
832    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
833    /// let x = ActiveDirectory::new().set_ldap_signing(true);
834    /// ```
835    pub fn set_ldap_signing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
836        self.ldap_signing = v.into();
837        self
838    }
839
840    /// Sets the value of [encrypt_dc_connections][crate::model::ActiveDirectory::encrypt_dc_connections].
841    ///
842    /// # Example
843    /// ```ignore,no_run
844    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
845    /// let x = ActiveDirectory::new().set_encrypt_dc_connections(true);
846    /// ```
847    pub fn set_encrypt_dc_connections<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
848        self.encrypt_dc_connections = v.into();
849        self
850    }
851
852    /// Sets the value of [labels][crate::model::ActiveDirectory::labels].
853    ///
854    /// # Example
855    /// ```ignore,no_run
856    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
857    /// let x = ActiveDirectory::new().set_labels([
858    ///     ("key0", "abc"),
859    ///     ("key1", "xyz"),
860    /// ]);
861    /// ```
862    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
863    where
864        T: std::iter::IntoIterator<Item = (K, V)>,
865        K: std::convert::Into<std::string::String>,
866        V: std::convert::Into<std::string::String>,
867    {
868        use std::iter::Iterator;
869        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
870        self
871    }
872
873    /// Sets the value of [state_details][crate::model::ActiveDirectory::state_details].
874    ///
875    /// # Example
876    /// ```ignore,no_run
877    /// # use google_cloud_netapp_v1::model::ActiveDirectory;
878    /// let x = ActiveDirectory::new().set_state_details("example");
879    /// ```
880    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
881        self.state_details = v.into();
882        self
883    }
884}
885
886impl wkt::message::Message for ActiveDirectory {
887    fn typename() -> &'static str {
888        "type.googleapis.com/google.cloud.netapp.v1.ActiveDirectory"
889    }
890}
891
892/// Defines additional types related to [ActiveDirectory].
893pub mod active_directory {
894    #[allow(unused_imports)]
895    use super::*;
896
897    /// The Active Directory States
898    ///
899    /// # Working with unknown values
900    ///
901    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
902    /// additional enum variants at any time. Adding new variants is not considered
903    /// a breaking change. Applications should write their code in anticipation of:
904    ///
905    /// - New values appearing in future releases of the client library, **and**
906    /// - New values received dynamically, without application changes.
907    ///
908    /// Please consult the [Working with enums] section in the user guide for some
909    /// guidelines.
910    ///
911    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
912    #[derive(Clone, Debug, PartialEq)]
913    #[non_exhaustive]
914    pub enum State {
915        /// Unspecified Active Directory State
916        Unspecified,
917        /// Active Directory State is Creating
918        Creating,
919        /// Active Directory State is Ready
920        Ready,
921        /// Active Directory State is Updating
922        Updating,
923        /// Active Directory State is In use
924        InUse,
925        /// Active Directory State is Deleting
926        Deleting,
927        /// Active Directory State is Error
928        Error,
929        /// Active Directory State is Diagnosing.
930        Diagnosing,
931        /// If set, the enum was initialized with an unknown value.
932        ///
933        /// Applications can examine the value using [State::value] or
934        /// [State::name].
935        UnknownValue(state::UnknownValue),
936    }
937
938    #[doc(hidden)]
939    pub mod state {
940        #[allow(unused_imports)]
941        use super::*;
942        #[derive(Clone, Debug, PartialEq)]
943        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
944    }
945
946    impl State {
947        /// Gets the enum value.
948        ///
949        /// Returns `None` if the enum contains an unknown value deserialized from
950        /// the string representation of enums.
951        pub fn value(&self) -> std::option::Option<i32> {
952            match self {
953                Self::Unspecified => std::option::Option::Some(0),
954                Self::Creating => std::option::Option::Some(1),
955                Self::Ready => std::option::Option::Some(2),
956                Self::Updating => std::option::Option::Some(3),
957                Self::InUse => std::option::Option::Some(4),
958                Self::Deleting => std::option::Option::Some(5),
959                Self::Error => std::option::Option::Some(6),
960                Self::Diagnosing => std::option::Option::Some(7),
961                Self::UnknownValue(u) => u.0.value(),
962            }
963        }
964
965        /// Gets the enum value as a string.
966        ///
967        /// Returns `None` if the enum contains an unknown value deserialized from
968        /// the integer representation of enums.
969        pub fn name(&self) -> std::option::Option<&str> {
970            match self {
971                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
972                Self::Creating => std::option::Option::Some("CREATING"),
973                Self::Ready => std::option::Option::Some("READY"),
974                Self::Updating => std::option::Option::Some("UPDATING"),
975                Self::InUse => std::option::Option::Some("IN_USE"),
976                Self::Deleting => std::option::Option::Some("DELETING"),
977                Self::Error => std::option::Option::Some("ERROR"),
978                Self::Diagnosing => std::option::Option::Some("DIAGNOSING"),
979                Self::UnknownValue(u) => u.0.name(),
980            }
981        }
982    }
983
984    impl std::default::Default for State {
985        fn default() -> Self {
986            use std::convert::From;
987            Self::from(0)
988        }
989    }
990
991    impl std::fmt::Display for State {
992        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
993            wkt::internal::display_enum(f, self.name(), self.value())
994        }
995    }
996
997    impl std::convert::From<i32> for State {
998        fn from(value: i32) -> Self {
999            match value {
1000                0 => Self::Unspecified,
1001                1 => Self::Creating,
1002                2 => Self::Ready,
1003                3 => Self::Updating,
1004                4 => Self::InUse,
1005                5 => Self::Deleting,
1006                6 => Self::Error,
1007                7 => Self::Diagnosing,
1008                _ => Self::UnknownValue(state::UnknownValue(
1009                    wkt::internal::UnknownEnumValue::Integer(value),
1010                )),
1011            }
1012        }
1013    }
1014
1015    impl std::convert::From<&str> for State {
1016        fn from(value: &str) -> Self {
1017            use std::string::ToString;
1018            match value {
1019                "STATE_UNSPECIFIED" => Self::Unspecified,
1020                "CREATING" => Self::Creating,
1021                "READY" => Self::Ready,
1022                "UPDATING" => Self::Updating,
1023                "IN_USE" => Self::InUse,
1024                "DELETING" => Self::Deleting,
1025                "ERROR" => Self::Error,
1026                "DIAGNOSING" => Self::Diagnosing,
1027                _ => Self::UnknownValue(state::UnknownValue(
1028                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1029                )),
1030            }
1031        }
1032    }
1033
1034    impl serde::ser::Serialize for State {
1035        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1036        where
1037            S: serde::Serializer,
1038        {
1039            match self {
1040                Self::Unspecified => serializer.serialize_i32(0),
1041                Self::Creating => serializer.serialize_i32(1),
1042                Self::Ready => serializer.serialize_i32(2),
1043                Self::Updating => serializer.serialize_i32(3),
1044                Self::InUse => serializer.serialize_i32(4),
1045                Self::Deleting => serializer.serialize_i32(5),
1046                Self::Error => serializer.serialize_i32(6),
1047                Self::Diagnosing => serializer.serialize_i32(7),
1048                Self::UnknownValue(u) => u.0.serialize(serializer),
1049            }
1050        }
1051    }
1052
1053    impl<'de> serde::de::Deserialize<'de> for State {
1054        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1055        where
1056            D: serde::Deserializer<'de>,
1057        {
1058            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1059                ".google.cloud.netapp.v1.ActiveDirectory.State",
1060            ))
1061        }
1062    }
1063}
1064
1065/// A NetApp Backup.
1066#[derive(Clone, Default, PartialEq)]
1067#[non_exhaustive]
1068pub struct Backup {
1069    /// Identifier. The resource name of the backup.
1070    /// Format:
1071    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`.
1072    pub name: std::string::String,
1073
1074    /// Output only. The backup state.
1075    pub state: crate::model::backup::State,
1076
1077    /// A description of the backup with 2048 characters or less.
1078    /// Requests with longer descriptions will be rejected.
1079    pub description: std::string::String,
1080
1081    /// Output only. Size of the file system when the backup was created. When
1082    /// creating a new volume from the backup, the volume capacity will have to be
1083    /// at least as big.
1084    pub volume_usage_bytes: i64,
1085
1086    /// Output only. Type of backup, manually created or created by a backup
1087    /// policy.
1088    pub backup_type: crate::model::backup::Type,
1089
1090    /// Volume full name of this backup belongs to.
1091    /// Format:
1092    /// `projects/{projects_id}/locations/{location}/volumes/{volume_id}`
1093    pub source_volume: std::string::String,
1094
1095    /// If specified, backup will be created from the given snapshot.
1096    /// If not specified, there will be a new snapshot taken to initiate the backup
1097    /// creation. Format:
1098    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`
1099    pub source_snapshot: std::option::Option<std::string::String>,
1100
1101    /// Output only. The time when the backup was created.
1102    pub create_time: std::option::Option<wkt::Timestamp>,
1103
1104    /// Resource labels to represent user provided metadata.
1105    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1106
1107    /// Output only. Total size of all backups in a chain in bytes = baseline
1108    /// backup size + sum(incremental backup size)
1109    pub chain_storage_bytes: i64,
1110
1111    /// Output only. Reserved for future use
1112    pub satisfies_pzs: bool,
1113
1114    /// Output only. Reserved for future use
1115    pub satisfies_pzi: bool,
1116
1117    /// Output only. Region of the volume from which the backup was created.
1118    /// Format: `projects/{project_id}/locations/{location}`
1119    pub volume_region: std::string::String,
1120
1121    /// Output only. Region in which backup is stored.
1122    /// Format: `projects/{project_id}/locations/{location}`
1123    pub backup_region: std::string::String,
1124
1125    /// Output only. The time until which the backup is not deletable.
1126    pub enforced_retention_end_time: std::option::Option<wkt::Timestamp>,
1127
1128    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1129}
1130
1131impl Backup {
1132    pub fn new() -> Self {
1133        std::default::Default::default()
1134    }
1135
1136    /// Sets the value of [name][crate::model::Backup::name].
1137    ///
1138    /// # Example
1139    /// ```ignore,no_run
1140    /// # use google_cloud_netapp_v1::model::Backup;
1141    /// let x = Backup::new().set_name("example");
1142    /// ```
1143    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1144        self.name = v.into();
1145        self
1146    }
1147
1148    /// Sets the value of [state][crate::model::Backup::state].
1149    ///
1150    /// # Example
1151    /// ```ignore,no_run
1152    /// # use google_cloud_netapp_v1::model::Backup;
1153    /// use google_cloud_netapp_v1::model::backup::State;
1154    /// let x0 = Backup::new().set_state(State::Creating);
1155    /// let x1 = Backup::new().set_state(State::Uploading);
1156    /// let x2 = Backup::new().set_state(State::Ready);
1157    /// ```
1158    pub fn set_state<T: std::convert::Into<crate::model::backup::State>>(mut self, v: T) -> Self {
1159        self.state = v.into();
1160        self
1161    }
1162
1163    /// Sets the value of [description][crate::model::Backup::description].
1164    ///
1165    /// # Example
1166    /// ```ignore,no_run
1167    /// # use google_cloud_netapp_v1::model::Backup;
1168    /// let x = Backup::new().set_description("example");
1169    /// ```
1170    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1171        self.description = v.into();
1172        self
1173    }
1174
1175    /// Sets the value of [volume_usage_bytes][crate::model::Backup::volume_usage_bytes].
1176    ///
1177    /// # Example
1178    /// ```ignore,no_run
1179    /// # use google_cloud_netapp_v1::model::Backup;
1180    /// let x = Backup::new().set_volume_usage_bytes(42);
1181    /// ```
1182    pub fn set_volume_usage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1183        self.volume_usage_bytes = v.into();
1184        self
1185    }
1186
1187    /// Sets the value of [backup_type][crate::model::Backup::backup_type].
1188    ///
1189    /// # Example
1190    /// ```ignore,no_run
1191    /// # use google_cloud_netapp_v1::model::Backup;
1192    /// use google_cloud_netapp_v1::model::backup::Type;
1193    /// let x0 = Backup::new().set_backup_type(Type::Manual);
1194    /// let x1 = Backup::new().set_backup_type(Type::Scheduled);
1195    /// ```
1196    pub fn set_backup_type<T: std::convert::Into<crate::model::backup::Type>>(
1197        mut self,
1198        v: T,
1199    ) -> Self {
1200        self.backup_type = v.into();
1201        self
1202    }
1203
1204    /// Sets the value of [source_volume][crate::model::Backup::source_volume].
1205    ///
1206    /// # Example
1207    /// ```ignore,no_run
1208    /// # use google_cloud_netapp_v1::model::Backup;
1209    /// let x = Backup::new().set_source_volume("example");
1210    /// ```
1211    pub fn set_source_volume<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1212        self.source_volume = v.into();
1213        self
1214    }
1215
1216    /// Sets the value of [source_snapshot][crate::model::Backup::source_snapshot].
1217    ///
1218    /// # Example
1219    /// ```ignore,no_run
1220    /// # use google_cloud_netapp_v1::model::Backup;
1221    /// let x = Backup::new().set_source_snapshot("example");
1222    /// ```
1223    pub fn set_source_snapshot<T>(mut self, v: T) -> Self
1224    where
1225        T: std::convert::Into<std::string::String>,
1226    {
1227        self.source_snapshot = std::option::Option::Some(v.into());
1228        self
1229    }
1230
1231    /// Sets or clears the value of [source_snapshot][crate::model::Backup::source_snapshot].
1232    ///
1233    /// # Example
1234    /// ```ignore,no_run
1235    /// # use google_cloud_netapp_v1::model::Backup;
1236    /// let x = Backup::new().set_or_clear_source_snapshot(Some("example"));
1237    /// let x = Backup::new().set_or_clear_source_snapshot(None::<String>);
1238    /// ```
1239    pub fn set_or_clear_source_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
1240    where
1241        T: std::convert::Into<std::string::String>,
1242    {
1243        self.source_snapshot = v.map(|x| x.into());
1244        self
1245    }
1246
1247    /// Sets the value of [create_time][crate::model::Backup::create_time].
1248    ///
1249    /// # Example
1250    /// ```ignore,no_run
1251    /// # use google_cloud_netapp_v1::model::Backup;
1252    /// use wkt::Timestamp;
1253    /// let x = Backup::new().set_create_time(Timestamp::default()/* use setters */);
1254    /// ```
1255    pub fn set_create_time<T>(mut self, v: T) -> Self
1256    where
1257        T: std::convert::Into<wkt::Timestamp>,
1258    {
1259        self.create_time = std::option::Option::Some(v.into());
1260        self
1261    }
1262
1263    /// Sets or clears the value of [create_time][crate::model::Backup::create_time].
1264    ///
1265    /// # Example
1266    /// ```ignore,no_run
1267    /// # use google_cloud_netapp_v1::model::Backup;
1268    /// use wkt::Timestamp;
1269    /// let x = Backup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1270    /// let x = Backup::new().set_or_clear_create_time(None::<Timestamp>);
1271    /// ```
1272    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1273    where
1274        T: std::convert::Into<wkt::Timestamp>,
1275    {
1276        self.create_time = v.map(|x| x.into());
1277        self
1278    }
1279
1280    /// Sets the value of [labels][crate::model::Backup::labels].
1281    ///
1282    /// # Example
1283    /// ```ignore,no_run
1284    /// # use google_cloud_netapp_v1::model::Backup;
1285    /// let x = Backup::new().set_labels([
1286    ///     ("key0", "abc"),
1287    ///     ("key1", "xyz"),
1288    /// ]);
1289    /// ```
1290    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1291    where
1292        T: std::iter::IntoIterator<Item = (K, V)>,
1293        K: std::convert::Into<std::string::String>,
1294        V: std::convert::Into<std::string::String>,
1295    {
1296        use std::iter::Iterator;
1297        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1298        self
1299    }
1300
1301    /// Sets the value of [chain_storage_bytes][crate::model::Backup::chain_storage_bytes].
1302    ///
1303    /// # Example
1304    /// ```ignore,no_run
1305    /// # use google_cloud_netapp_v1::model::Backup;
1306    /// let x = Backup::new().set_chain_storage_bytes(42);
1307    /// ```
1308    pub fn set_chain_storage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1309        self.chain_storage_bytes = v.into();
1310        self
1311    }
1312
1313    /// Sets the value of [satisfies_pzs][crate::model::Backup::satisfies_pzs].
1314    ///
1315    /// # Example
1316    /// ```ignore,no_run
1317    /// # use google_cloud_netapp_v1::model::Backup;
1318    /// let x = Backup::new().set_satisfies_pzs(true);
1319    /// ```
1320    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1321        self.satisfies_pzs = v.into();
1322        self
1323    }
1324
1325    /// Sets the value of [satisfies_pzi][crate::model::Backup::satisfies_pzi].
1326    ///
1327    /// # Example
1328    /// ```ignore,no_run
1329    /// # use google_cloud_netapp_v1::model::Backup;
1330    /// let x = Backup::new().set_satisfies_pzi(true);
1331    /// ```
1332    pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1333        self.satisfies_pzi = v.into();
1334        self
1335    }
1336
1337    /// Sets the value of [volume_region][crate::model::Backup::volume_region].
1338    ///
1339    /// # Example
1340    /// ```ignore,no_run
1341    /// # use google_cloud_netapp_v1::model::Backup;
1342    /// let x = Backup::new().set_volume_region("example");
1343    /// ```
1344    pub fn set_volume_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1345        self.volume_region = v.into();
1346        self
1347    }
1348
1349    /// Sets the value of [backup_region][crate::model::Backup::backup_region].
1350    ///
1351    /// # Example
1352    /// ```ignore,no_run
1353    /// # use google_cloud_netapp_v1::model::Backup;
1354    /// let x = Backup::new().set_backup_region("example");
1355    /// ```
1356    pub fn set_backup_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1357        self.backup_region = v.into();
1358        self
1359    }
1360
1361    /// Sets the value of [enforced_retention_end_time][crate::model::Backup::enforced_retention_end_time].
1362    ///
1363    /// # Example
1364    /// ```ignore,no_run
1365    /// # use google_cloud_netapp_v1::model::Backup;
1366    /// use wkt::Timestamp;
1367    /// let x = Backup::new().set_enforced_retention_end_time(Timestamp::default()/* use setters */);
1368    /// ```
1369    pub fn set_enforced_retention_end_time<T>(mut self, v: T) -> Self
1370    where
1371        T: std::convert::Into<wkt::Timestamp>,
1372    {
1373        self.enforced_retention_end_time = std::option::Option::Some(v.into());
1374        self
1375    }
1376
1377    /// Sets or clears the value of [enforced_retention_end_time][crate::model::Backup::enforced_retention_end_time].
1378    ///
1379    /// # Example
1380    /// ```ignore,no_run
1381    /// # use google_cloud_netapp_v1::model::Backup;
1382    /// use wkt::Timestamp;
1383    /// let x = Backup::new().set_or_clear_enforced_retention_end_time(Some(Timestamp::default()/* use setters */));
1384    /// let x = Backup::new().set_or_clear_enforced_retention_end_time(None::<Timestamp>);
1385    /// ```
1386    pub fn set_or_clear_enforced_retention_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1387    where
1388        T: std::convert::Into<wkt::Timestamp>,
1389    {
1390        self.enforced_retention_end_time = v.map(|x| x.into());
1391        self
1392    }
1393}
1394
1395impl wkt::message::Message for Backup {
1396    fn typename() -> &'static str {
1397        "type.googleapis.com/google.cloud.netapp.v1.Backup"
1398    }
1399}
1400
1401/// Defines additional types related to [Backup].
1402pub mod backup {
1403    #[allow(unused_imports)]
1404    use super::*;
1405
1406    /// The Backup States
1407    ///
1408    /// # Working with unknown values
1409    ///
1410    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1411    /// additional enum variants at any time. Adding new variants is not considered
1412    /// a breaking change. Applications should write their code in anticipation of:
1413    ///
1414    /// - New values appearing in future releases of the client library, **and**
1415    /// - New values received dynamically, without application changes.
1416    ///
1417    /// Please consult the [Working with enums] section in the user guide for some
1418    /// guidelines.
1419    ///
1420    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1421    #[derive(Clone, Debug, PartialEq)]
1422    #[non_exhaustive]
1423    pub enum State {
1424        /// State not set.
1425        Unspecified,
1426        /// Backup is being created. While in this state, the snapshot for the backup
1427        /// point-in-time may not have been created yet, and so the point-in-time may
1428        /// not have been fixed.
1429        Creating,
1430        /// Backup is being uploaded. While in this state, none of the writes to the
1431        /// volume will be included in the backup.
1432        Uploading,
1433        /// Backup is available for use.
1434        Ready,
1435        /// Backup is being deleted.
1436        Deleting,
1437        /// Backup is not valid and cannot be used for creating new volumes or
1438        /// restoring existing volumes.
1439        Error,
1440        /// Backup is being updated.
1441        Updating,
1442        /// If set, the enum was initialized with an unknown value.
1443        ///
1444        /// Applications can examine the value using [State::value] or
1445        /// [State::name].
1446        UnknownValue(state::UnknownValue),
1447    }
1448
1449    #[doc(hidden)]
1450    pub mod state {
1451        #[allow(unused_imports)]
1452        use super::*;
1453        #[derive(Clone, Debug, PartialEq)]
1454        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1455    }
1456
1457    impl State {
1458        /// Gets the enum value.
1459        ///
1460        /// Returns `None` if the enum contains an unknown value deserialized from
1461        /// the string representation of enums.
1462        pub fn value(&self) -> std::option::Option<i32> {
1463            match self {
1464                Self::Unspecified => std::option::Option::Some(0),
1465                Self::Creating => std::option::Option::Some(1),
1466                Self::Uploading => std::option::Option::Some(2),
1467                Self::Ready => std::option::Option::Some(3),
1468                Self::Deleting => std::option::Option::Some(4),
1469                Self::Error => std::option::Option::Some(5),
1470                Self::Updating => std::option::Option::Some(6),
1471                Self::UnknownValue(u) => u.0.value(),
1472            }
1473        }
1474
1475        /// Gets the enum value as a string.
1476        ///
1477        /// Returns `None` if the enum contains an unknown value deserialized from
1478        /// the integer representation of enums.
1479        pub fn name(&self) -> std::option::Option<&str> {
1480            match self {
1481                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1482                Self::Creating => std::option::Option::Some("CREATING"),
1483                Self::Uploading => std::option::Option::Some("UPLOADING"),
1484                Self::Ready => std::option::Option::Some("READY"),
1485                Self::Deleting => std::option::Option::Some("DELETING"),
1486                Self::Error => std::option::Option::Some("ERROR"),
1487                Self::Updating => std::option::Option::Some("UPDATING"),
1488                Self::UnknownValue(u) => u.0.name(),
1489            }
1490        }
1491    }
1492
1493    impl std::default::Default for State {
1494        fn default() -> Self {
1495            use std::convert::From;
1496            Self::from(0)
1497        }
1498    }
1499
1500    impl std::fmt::Display for State {
1501        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1502            wkt::internal::display_enum(f, self.name(), self.value())
1503        }
1504    }
1505
1506    impl std::convert::From<i32> for State {
1507        fn from(value: i32) -> Self {
1508            match value {
1509                0 => Self::Unspecified,
1510                1 => Self::Creating,
1511                2 => Self::Uploading,
1512                3 => Self::Ready,
1513                4 => Self::Deleting,
1514                5 => Self::Error,
1515                6 => Self::Updating,
1516                _ => Self::UnknownValue(state::UnknownValue(
1517                    wkt::internal::UnknownEnumValue::Integer(value),
1518                )),
1519            }
1520        }
1521    }
1522
1523    impl std::convert::From<&str> for State {
1524        fn from(value: &str) -> Self {
1525            use std::string::ToString;
1526            match value {
1527                "STATE_UNSPECIFIED" => Self::Unspecified,
1528                "CREATING" => Self::Creating,
1529                "UPLOADING" => Self::Uploading,
1530                "READY" => Self::Ready,
1531                "DELETING" => Self::Deleting,
1532                "ERROR" => Self::Error,
1533                "UPDATING" => Self::Updating,
1534                _ => Self::UnknownValue(state::UnknownValue(
1535                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1536                )),
1537            }
1538        }
1539    }
1540
1541    impl serde::ser::Serialize for State {
1542        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1543        where
1544            S: serde::Serializer,
1545        {
1546            match self {
1547                Self::Unspecified => serializer.serialize_i32(0),
1548                Self::Creating => serializer.serialize_i32(1),
1549                Self::Uploading => serializer.serialize_i32(2),
1550                Self::Ready => serializer.serialize_i32(3),
1551                Self::Deleting => serializer.serialize_i32(4),
1552                Self::Error => serializer.serialize_i32(5),
1553                Self::Updating => serializer.serialize_i32(6),
1554                Self::UnknownValue(u) => u.0.serialize(serializer),
1555            }
1556        }
1557    }
1558
1559    impl<'de> serde::de::Deserialize<'de> for State {
1560        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1561        where
1562            D: serde::Deserializer<'de>,
1563        {
1564            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1565                ".google.cloud.netapp.v1.Backup.State",
1566            ))
1567        }
1568    }
1569
1570    /// Backup types.
1571    ///
1572    /// # Working with unknown values
1573    ///
1574    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1575    /// additional enum variants at any time. Adding new variants is not considered
1576    /// a breaking change. Applications should write their code in anticipation of:
1577    ///
1578    /// - New values appearing in future releases of the client library, **and**
1579    /// - New values received dynamically, without application changes.
1580    ///
1581    /// Please consult the [Working with enums] section in the user guide for some
1582    /// guidelines.
1583    ///
1584    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1585    #[derive(Clone, Debug, PartialEq)]
1586    #[non_exhaustive]
1587    pub enum Type {
1588        /// Unspecified backup type.
1589        Unspecified,
1590        /// Manual backup type.
1591        Manual,
1592        /// Scheduled backup type.
1593        Scheduled,
1594        /// If set, the enum was initialized with an unknown value.
1595        ///
1596        /// Applications can examine the value using [Type::value] or
1597        /// [Type::name].
1598        UnknownValue(r#type::UnknownValue),
1599    }
1600
1601    #[doc(hidden)]
1602    pub mod r#type {
1603        #[allow(unused_imports)]
1604        use super::*;
1605        #[derive(Clone, Debug, PartialEq)]
1606        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1607    }
1608
1609    impl Type {
1610        /// Gets the enum value.
1611        ///
1612        /// Returns `None` if the enum contains an unknown value deserialized from
1613        /// the string representation of enums.
1614        pub fn value(&self) -> std::option::Option<i32> {
1615            match self {
1616                Self::Unspecified => std::option::Option::Some(0),
1617                Self::Manual => std::option::Option::Some(1),
1618                Self::Scheduled => std::option::Option::Some(2),
1619                Self::UnknownValue(u) => u.0.value(),
1620            }
1621        }
1622
1623        /// Gets the enum value as a string.
1624        ///
1625        /// Returns `None` if the enum contains an unknown value deserialized from
1626        /// the integer representation of enums.
1627        pub fn name(&self) -> std::option::Option<&str> {
1628            match self {
1629                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
1630                Self::Manual => std::option::Option::Some("MANUAL"),
1631                Self::Scheduled => std::option::Option::Some("SCHEDULED"),
1632                Self::UnknownValue(u) => u.0.name(),
1633            }
1634        }
1635    }
1636
1637    impl std::default::Default for Type {
1638        fn default() -> Self {
1639            use std::convert::From;
1640            Self::from(0)
1641        }
1642    }
1643
1644    impl std::fmt::Display for Type {
1645        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1646            wkt::internal::display_enum(f, self.name(), self.value())
1647        }
1648    }
1649
1650    impl std::convert::From<i32> for Type {
1651        fn from(value: i32) -> Self {
1652            match value {
1653                0 => Self::Unspecified,
1654                1 => Self::Manual,
1655                2 => Self::Scheduled,
1656                _ => Self::UnknownValue(r#type::UnknownValue(
1657                    wkt::internal::UnknownEnumValue::Integer(value),
1658                )),
1659            }
1660        }
1661    }
1662
1663    impl std::convert::From<&str> for Type {
1664        fn from(value: &str) -> Self {
1665            use std::string::ToString;
1666            match value {
1667                "TYPE_UNSPECIFIED" => Self::Unspecified,
1668                "MANUAL" => Self::Manual,
1669                "SCHEDULED" => Self::Scheduled,
1670                _ => Self::UnknownValue(r#type::UnknownValue(
1671                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1672                )),
1673            }
1674        }
1675    }
1676
1677    impl serde::ser::Serialize for Type {
1678        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1679        where
1680            S: serde::Serializer,
1681        {
1682            match self {
1683                Self::Unspecified => serializer.serialize_i32(0),
1684                Self::Manual => serializer.serialize_i32(1),
1685                Self::Scheduled => serializer.serialize_i32(2),
1686                Self::UnknownValue(u) => u.0.serialize(serializer),
1687            }
1688        }
1689    }
1690
1691    impl<'de> serde::de::Deserialize<'de> for Type {
1692        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1693        where
1694            D: serde::Deserializer<'de>,
1695        {
1696            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
1697                ".google.cloud.netapp.v1.Backup.Type",
1698            ))
1699        }
1700    }
1701}
1702
1703/// ListBackupsRequest lists backups.
1704#[derive(Clone, Default, PartialEq)]
1705#[non_exhaustive]
1706pub struct ListBackupsRequest {
1707    /// Required. The backupVault for which to retrieve backup information,
1708    /// in the format
1709    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`.
1710    /// To retrieve backup information for all locations, use "-" for the
1711    /// `{location}` value.
1712    /// To retrieve backup information for all backupVaults, use "-" for the
1713    /// `{backup_vault_id}` value.
1714    /// To retrieve backup information for a volume, use "-" for the
1715    /// `{backup_vault_id}` value and specify volume full name with the filter.
1716    pub parent: std::string::String,
1717
1718    /// The maximum number of items to return. The service may return fewer
1719    /// than this value. The maximum value
1720    /// is 1000; values above 1000 will be coerced to 1000.
1721    pub page_size: i32,
1722
1723    /// The next_page_token value to use if there are additional
1724    /// results to retrieve for this list request.
1725    pub page_token: std::string::String,
1726
1727    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
1728    pub order_by: std::string::String,
1729
1730    /// The standard list filter.
1731    /// If specified, backups will be returned based on the attribute name that
1732    /// matches the filter expression. If empty, then no backups are filtered out.
1733    /// See <https://google.aip.dev/160>
1734    pub filter: std::string::String,
1735
1736    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1737}
1738
1739impl ListBackupsRequest {
1740    pub fn new() -> Self {
1741        std::default::Default::default()
1742    }
1743
1744    /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
1745    ///
1746    /// # Example
1747    /// ```ignore,no_run
1748    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1749    /// let x = ListBackupsRequest::new().set_parent("example");
1750    /// ```
1751    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1752        self.parent = v.into();
1753        self
1754    }
1755
1756    /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
1757    ///
1758    /// # Example
1759    /// ```ignore,no_run
1760    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1761    /// let x = ListBackupsRequest::new().set_page_size(42);
1762    /// ```
1763    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1764        self.page_size = v.into();
1765        self
1766    }
1767
1768    /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
1769    ///
1770    /// # Example
1771    /// ```ignore,no_run
1772    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1773    /// let x = ListBackupsRequest::new().set_page_token("example");
1774    /// ```
1775    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1776        self.page_token = v.into();
1777        self
1778    }
1779
1780    /// Sets the value of [order_by][crate::model::ListBackupsRequest::order_by].
1781    ///
1782    /// # Example
1783    /// ```ignore,no_run
1784    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1785    /// let x = ListBackupsRequest::new().set_order_by("example");
1786    /// ```
1787    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1788        self.order_by = v.into();
1789        self
1790    }
1791
1792    /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
1793    ///
1794    /// # Example
1795    /// ```ignore,no_run
1796    /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1797    /// let x = ListBackupsRequest::new().set_filter("example");
1798    /// ```
1799    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1800        self.filter = v.into();
1801        self
1802    }
1803}
1804
1805impl wkt::message::Message for ListBackupsRequest {
1806    fn typename() -> &'static str {
1807        "type.googleapis.com/google.cloud.netapp.v1.ListBackupsRequest"
1808    }
1809}
1810
1811/// ListBackupsResponse is the result of ListBackupsRequest.
1812#[derive(Clone, Default, PartialEq)]
1813#[non_exhaustive]
1814pub struct ListBackupsResponse {
1815    /// A list of backups in the project.
1816    pub backups: std::vec::Vec<crate::model::Backup>,
1817
1818    /// The token you can use to retrieve the next page of results. Not returned
1819    /// if there are no more results in the list.
1820    pub next_page_token: std::string::String,
1821
1822    /// Locations that could not be reached.
1823    pub unreachable: std::vec::Vec<std::string::String>,
1824
1825    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1826}
1827
1828impl ListBackupsResponse {
1829    pub fn new() -> Self {
1830        std::default::Default::default()
1831    }
1832
1833    /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
1834    ///
1835    /// # Example
1836    /// ```ignore,no_run
1837    /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1838    /// use google_cloud_netapp_v1::model::Backup;
1839    /// let x = ListBackupsResponse::new()
1840    ///     .set_backups([
1841    ///         Backup::default()/* use setters */,
1842    ///         Backup::default()/* use (different) setters */,
1843    ///     ]);
1844    /// ```
1845    pub fn set_backups<T, V>(mut self, v: T) -> Self
1846    where
1847        T: std::iter::IntoIterator<Item = V>,
1848        V: std::convert::Into<crate::model::Backup>,
1849    {
1850        use std::iter::Iterator;
1851        self.backups = v.into_iter().map(|i| i.into()).collect();
1852        self
1853    }
1854
1855    /// Sets the value of [next_page_token][crate::model::ListBackupsResponse::next_page_token].
1856    ///
1857    /// # Example
1858    /// ```ignore,no_run
1859    /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1860    /// let x = ListBackupsResponse::new().set_next_page_token("example");
1861    /// ```
1862    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1863        self.next_page_token = v.into();
1864        self
1865    }
1866
1867    /// Sets the value of [unreachable][crate::model::ListBackupsResponse::unreachable].
1868    ///
1869    /// # Example
1870    /// ```ignore,no_run
1871    /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1872    /// let x = ListBackupsResponse::new().set_unreachable(["a", "b", "c"]);
1873    /// ```
1874    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1875    where
1876        T: std::iter::IntoIterator<Item = V>,
1877        V: std::convert::Into<std::string::String>,
1878    {
1879        use std::iter::Iterator;
1880        self.unreachable = v.into_iter().map(|i| i.into()).collect();
1881        self
1882    }
1883}
1884
1885impl wkt::message::Message for ListBackupsResponse {
1886    fn typename() -> &'static str {
1887        "type.googleapis.com/google.cloud.netapp.v1.ListBackupsResponse"
1888    }
1889}
1890
1891#[doc(hidden)]
1892impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupsResponse {
1893    type PageItem = crate::model::Backup;
1894
1895    fn items(self) -> std::vec::Vec<Self::PageItem> {
1896        self.backups
1897    }
1898
1899    fn next_page_token(&self) -> std::string::String {
1900        use std::clone::Clone;
1901        self.next_page_token.clone()
1902    }
1903}
1904
1905/// GetBackupRequest gets the state of a backup.
1906#[derive(Clone, Default, PartialEq)]
1907#[non_exhaustive]
1908pub struct GetBackupRequest {
1909    /// Required. The backup resource name, in the format
1910    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
1911    pub name: std::string::String,
1912
1913    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1914}
1915
1916impl GetBackupRequest {
1917    pub fn new() -> Self {
1918        std::default::Default::default()
1919    }
1920
1921    /// Sets the value of [name][crate::model::GetBackupRequest::name].
1922    ///
1923    /// # Example
1924    /// ```ignore,no_run
1925    /// # use google_cloud_netapp_v1::model::GetBackupRequest;
1926    /// let x = GetBackupRequest::new().set_name("example");
1927    /// ```
1928    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1929        self.name = v.into();
1930        self
1931    }
1932}
1933
1934impl wkt::message::Message for GetBackupRequest {
1935    fn typename() -> &'static str {
1936        "type.googleapis.com/google.cloud.netapp.v1.GetBackupRequest"
1937    }
1938}
1939
1940/// CreateBackupRequest creates a backup.
1941#[derive(Clone, Default, PartialEq)]
1942#[non_exhaustive]
1943pub struct CreateBackupRequest {
1944    /// Required. The NetApp backupVault to create the backups of, in the format
1945    /// `projects/*/locations/*/backupVaults/{backup_vault_id}`
1946    pub parent: std::string::String,
1947
1948    /// Required. The ID to use for the backup.
1949    /// The ID must be unique within the specified backupVault.
1950    /// Must contain only letters, numbers and hyphen, with the first
1951    /// character a letter, the last a letter or a
1952    /// number, and a 63 character maximum.
1953    pub backup_id: std::string::String,
1954
1955    /// Required. A backup resource
1956    pub backup: std::option::Option<crate::model::Backup>,
1957
1958    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1959}
1960
1961impl CreateBackupRequest {
1962    pub fn new() -> Self {
1963        std::default::Default::default()
1964    }
1965
1966    /// Sets the value of [parent][crate::model::CreateBackupRequest::parent].
1967    ///
1968    /// # Example
1969    /// ```ignore,no_run
1970    /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
1971    /// let x = CreateBackupRequest::new().set_parent("example");
1972    /// ```
1973    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1974        self.parent = v.into();
1975        self
1976    }
1977
1978    /// Sets the value of [backup_id][crate::model::CreateBackupRequest::backup_id].
1979    ///
1980    /// # Example
1981    /// ```ignore,no_run
1982    /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
1983    /// let x = CreateBackupRequest::new().set_backup_id("example");
1984    /// ```
1985    pub fn set_backup_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1986        self.backup_id = v.into();
1987        self
1988    }
1989
1990    /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
1991    ///
1992    /// # Example
1993    /// ```ignore,no_run
1994    /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
1995    /// use google_cloud_netapp_v1::model::Backup;
1996    /// let x = CreateBackupRequest::new().set_backup(Backup::default()/* use setters */);
1997    /// ```
1998    pub fn set_backup<T>(mut self, v: T) -> Self
1999    where
2000        T: std::convert::Into<crate::model::Backup>,
2001    {
2002        self.backup = std::option::Option::Some(v.into());
2003        self
2004    }
2005
2006    /// Sets or clears the value of [backup][crate::model::CreateBackupRequest::backup].
2007    ///
2008    /// # Example
2009    /// ```ignore,no_run
2010    /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
2011    /// use google_cloud_netapp_v1::model::Backup;
2012    /// let x = CreateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
2013    /// let x = CreateBackupRequest::new().set_or_clear_backup(None::<Backup>);
2014    /// ```
2015    pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
2016    where
2017        T: std::convert::Into<crate::model::Backup>,
2018    {
2019        self.backup = v.map(|x| x.into());
2020        self
2021    }
2022}
2023
2024impl wkt::message::Message for CreateBackupRequest {
2025    fn typename() -> &'static str {
2026        "type.googleapis.com/google.cloud.netapp.v1.CreateBackupRequest"
2027    }
2028}
2029
2030/// DeleteBackupRequest deletes a backup.
2031#[derive(Clone, Default, PartialEq)]
2032#[non_exhaustive]
2033pub struct DeleteBackupRequest {
2034    /// Required. The backup resource name, in the format
2035    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
2036    pub name: std::string::String,
2037
2038    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2039}
2040
2041impl DeleteBackupRequest {
2042    pub fn new() -> Self {
2043        std::default::Default::default()
2044    }
2045
2046    /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
2047    ///
2048    /// # Example
2049    /// ```ignore,no_run
2050    /// # use google_cloud_netapp_v1::model::DeleteBackupRequest;
2051    /// let x = DeleteBackupRequest::new().set_name("example");
2052    /// ```
2053    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2054        self.name = v.into();
2055        self
2056    }
2057}
2058
2059impl wkt::message::Message for DeleteBackupRequest {
2060    fn typename() -> &'static str {
2061        "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupRequest"
2062    }
2063}
2064
2065/// UpdateBackupRequest updates description and/or labels for a backup.
2066#[derive(Clone, Default, PartialEq)]
2067#[non_exhaustive]
2068pub struct UpdateBackupRequest {
2069    /// Required. Field mask is used to specify the fields to be overwritten in the
2070    /// Backup resource to be updated.
2071    /// The fields specified in the update_mask are relative to the resource, not
2072    /// the full request. A field will be overwritten if it is in the mask. If the
2073    /// user does not provide a mask then all fields will be overwritten.
2074    pub update_mask: std::option::Option<wkt::FieldMask>,
2075
2076    /// Required. The backup being updated
2077    pub backup: std::option::Option<crate::model::Backup>,
2078
2079    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2080}
2081
2082impl UpdateBackupRequest {
2083    pub fn new() -> Self {
2084        std::default::Default::default()
2085    }
2086
2087    /// Sets the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
2088    ///
2089    /// # Example
2090    /// ```ignore,no_run
2091    /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2092    /// use wkt::FieldMask;
2093    /// let x = UpdateBackupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2094    /// ```
2095    pub fn set_update_mask<T>(mut self, v: T) -> Self
2096    where
2097        T: std::convert::Into<wkt::FieldMask>,
2098    {
2099        self.update_mask = std::option::Option::Some(v.into());
2100        self
2101    }
2102
2103    /// Sets or clears the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
2104    ///
2105    /// # Example
2106    /// ```ignore,no_run
2107    /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2108    /// use wkt::FieldMask;
2109    /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2110    /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2111    /// ```
2112    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2113    where
2114        T: std::convert::Into<wkt::FieldMask>,
2115    {
2116        self.update_mask = v.map(|x| x.into());
2117        self
2118    }
2119
2120    /// Sets the value of [backup][crate::model::UpdateBackupRequest::backup].
2121    ///
2122    /// # Example
2123    /// ```ignore,no_run
2124    /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2125    /// use google_cloud_netapp_v1::model::Backup;
2126    /// let x = UpdateBackupRequest::new().set_backup(Backup::default()/* use setters */);
2127    /// ```
2128    pub fn set_backup<T>(mut self, v: T) -> Self
2129    where
2130        T: std::convert::Into<crate::model::Backup>,
2131    {
2132        self.backup = std::option::Option::Some(v.into());
2133        self
2134    }
2135
2136    /// Sets or clears the value of [backup][crate::model::UpdateBackupRequest::backup].
2137    ///
2138    /// # Example
2139    /// ```ignore,no_run
2140    /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2141    /// use google_cloud_netapp_v1::model::Backup;
2142    /// let x = UpdateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
2143    /// let x = UpdateBackupRequest::new().set_or_clear_backup(None::<Backup>);
2144    /// ```
2145    pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
2146    where
2147        T: std::convert::Into<crate::model::Backup>,
2148    {
2149        self.backup = v.map(|x| x.into());
2150        self
2151    }
2152}
2153
2154impl wkt::message::Message for UpdateBackupRequest {
2155    fn typename() -> &'static str {
2156        "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupRequest"
2157    }
2158}
2159
2160/// Backup Policy.
2161#[derive(Clone, Default, PartialEq)]
2162#[non_exhaustive]
2163pub struct BackupPolicy {
2164    /// Identifier. The resource name of the backup policy.
2165    /// Format:
2166    /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`.
2167    pub name: std::string::String,
2168
2169    /// Number of daily backups to keep. Note that the minimum daily backup limit
2170    /// is 2.
2171    pub daily_backup_limit: std::option::Option<i32>,
2172
2173    /// Number of weekly backups to keep. Note that the sum of daily, weekly and
2174    /// monthly backups should be greater than 1.
2175    pub weekly_backup_limit: std::option::Option<i32>,
2176
2177    /// Number of monthly backups to keep. Note that the sum of daily, weekly and
2178    /// monthly backups should be greater than 1.
2179    pub monthly_backup_limit: std::option::Option<i32>,
2180
2181    /// Description of the backup policy.
2182    pub description: std::option::Option<std::string::String>,
2183
2184    /// If enabled, make backups automatically according to the schedules.
2185    /// This will be applied to all volumes that have this policy attached and
2186    /// enforced on volume level. If not specified, default is true.
2187    pub enabled: std::option::Option<bool>,
2188
2189    /// Output only. The total number of volumes assigned by this backup policy.
2190    pub assigned_volume_count: std::option::Option<i32>,
2191
2192    /// Output only. The time when the backup policy was created.
2193    pub create_time: std::option::Option<wkt::Timestamp>,
2194
2195    /// Resource labels to represent user provided metadata.
2196    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2197
2198    /// Output only. The backup policy state.
2199    pub state: crate::model::backup_policy::State,
2200
2201    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2202}
2203
2204impl BackupPolicy {
2205    pub fn new() -> Self {
2206        std::default::Default::default()
2207    }
2208
2209    /// Sets the value of [name][crate::model::BackupPolicy::name].
2210    ///
2211    /// # Example
2212    /// ```ignore,no_run
2213    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2214    /// let x = BackupPolicy::new().set_name("example");
2215    /// ```
2216    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2217        self.name = v.into();
2218        self
2219    }
2220
2221    /// Sets the value of [daily_backup_limit][crate::model::BackupPolicy::daily_backup_limit].
2222    ///
2223    /// # Example
2224    /// ```ignore,no_run
2225    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2226    /// let x = BackupPolicy::new().set_daily_backup_limit(42);
2227    /// ```
2228    pub fn set_daily_backup_limit<T>(mut self, v: T) -> Self
2229    where
2230        T: std::convert::Into<i32>,
2231    {
2232        self.daily_backup_limit = std::option::Option::Some(v.into());
2233        self
2234    }
2235
2236    /// Sets or clears the value of [daily_backup_limit][crate::model::BackupPolicy::daily_backup_limit].
2237    ///
2238    /// # Example
2239    /// ```ignore,no_run
2240    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2241    /// let x = BackupPolicy::new().set_or_clear_daily_backup_limit(Some(42));
2242    /// let x = BackupPolicy::new().set_or_clear_daily_backup_limit(None::<i32>);
2243    /// ```
2244    pub fn set_or_clear_daily_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2245    where
2246        T: std::convert::Into<i32>,
2247    {
2248        self.daily_backup_limit = v.map(|x| x.into());
2249        self
2250    }
2251
2252    /// Sets the value of [weekly_backup_limit][crate::model::BackupPolicy::weekly_backup_limit].
2253    ///
2254    /// # Example
2255    /// ```ignore,no_run
2256    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2257    /// let x = BackupPolicy::new().set_weekly_backup_limit(42);
2258    /// ```
2259    pub fn set_weekly_backup_limit<T>(mut self, v: T) -> Self
2260    where
2261        T: std::convert::Into<i32>,
2262    {
2263        self.weekly_backup_limit = std::option::Option::Some(v.into());
2264        self
2265    }
2266
2267    /// Sets or clears the value of [weekly_backup_limit][crate::model::BackupPolicy::weekly_backup_limit].
2268    ///
2269    /// # Example
2270    /// ```ignore,no_run
2271    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2272    /// let x = BackupPolicy::new().set_or_clear_weekly_backup_limit(Some(42));
2273    /// let x = BackupPolicy::new().set_or_clear_weekly_backup_limit(None::<i32>);
2274    /// ```
2275    pub fn set_or_clear_weekly_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2276    where
2277        T: std::convert::Into<i32>,
2278    {
2279        self.weekly_backup_limit = v.map(|x| x.into());
2280        self
2281    }
2282
2283    /// Sets the value of [monthly_backup_limit][crate::model::BackupPolicy::monthly_backup_limit].
2284    ///
2285    /// # Example
2286    /// ```ignore,no_run
2287    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2288    /// let x = BackupPolicy::new().set_monthly_backup_limit(42);
2289    /// ```
2290    pub fn set_monthly_backup_limit<T>(mut self, v: T) -> Self
2291    where
2292        T: std::convert::Into<i32>,
2293    {
2294        self.monthly_backup_limit = std::option::Option::Some(v.into());
2295        self
2296    }
2297
2298    /// Sets or clears the value of [monthly_backup_limit][crate::model::BackupPolicy::monthly_backup_limit].
2299    ///
2300    /// # Example
2301    /// ```ignore,no_run
2302    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2303    /// let x = BackupPolicy::new().set_or_clear_monthly_backup_limit(Some(42));
2304    /// let x = BackupPolicy::new().set_or_clear_monthly_backup_limit(None::<i32>);
2305    /// ```
2306    pub fn set_or_clear_monthly_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2307    where
2308        T: std::convert::Into<i32>,
2309    {
2310        self.monthly_backup_limit = v.map(|x| x.into());
2311        self
2312    }
2313
2314    /// Sets the value of [description][crate::model::BackupPolicy::description].
2315    ///
2316    /// # Example
2317    /// ```ignore,no_run
2318    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2319    /// let x = BackupPolicy::new().set_description("example");
2320    /// ```
2321    pub fn set_description<T>(mut self, v: T) -> Self
2322    where
2323        T: std::convert::Into<std::string::String>,
2324    {
2325        self.description = std::option::Option::Some(v.into());
2326        self
2327    }
2328
2329    /// Sets or clears the value of [description][crate::model::BackupPolicy::description].
2330    ///
2331    /// # Example
2332    /// ```ignore,no_run
2333    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2334    /// let x = BackupPolicy::new().set_or_clear_description(Some("example"));
2335    /// let x = BackupPolicy::new().set_or_clear_description(None::<String>);
2336    /// ```
2337    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
2338    where
2339        T: std::convert::Into<std::string::String>,
2340    {
2341        self.description = v.map(|x| x.into());
2342        self
2343    }
2344
2345    /// Sets the value of [enabled][crate::model::BackupPolicy::enabled].
2346    ///
2347    /// # Example
2348    /// ```ignore,no_run
2349    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2350    /// let x = BackupPolicy::new().set_enabled(true);
2351    /// ```
2352    pub fn set_enabled<T>(mut self, v: T) -> Self
2353    where
2354        T: std::convert::Into<bool>,
2355    {
2356        self.enabled = std::option::Option::Some(v.into());
2357        self
2358    }
2359
2360    /// Sets or clears the value of [enabled][crate::model::BackupPolicy::enabled].
2361    ///
2362    /// # Example
2363    /// ```ignore,no_run
2364    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2365    /// let x = BackupPolicy::new().set_or_clear_enabled(Some(false));
2366    /// let x = BackupPolicy::new().set_or_clear_enabled(None::<bool>);
2367    /// ```
2368    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
2369    where
2370        T: std::convert::Into<bool>,
2371    {
2372        self.enabled = v.map(|x| x.into());
2373        self
2374    }
2375
2376    /// Sets the value of [assigned_volume_count][crate::model::BackupPolicy::assigned_volume_count].
2377    ///
2378    /// # Example
2379    /// ```ignore,no_run
2380    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2381    /// let x = BackupPolicy::new().set_assigned_volume_count(42);
2382    /// ```
2383    pub fn set_assigned_volume_count<T>(mut self, v: T) -> Self
2384    where
2385        T: std::convert::Into<i32>,
2386    {
2387        self.assigned_volume_count = std::option::Option::Some(v.into());
2388        self
2389    }
2390
2391    /// Sets or clears the value of [assigned_volume_count][crate::model::BackupPolicy::assigned_volume_count].
2392    ///
2393    /// # Example
2394    /// ```ignore,no_run
2395    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2396    /// let x = BackupPolicy::new().set_or_clear_assigned_volume_count(Some(42));
2397    /// let x = BackupPolicy::new().set_or_clear_assigned_volume_count(None::<i32>);
2398    /// ```
2399    pub fn set_or_clear_assigned_volume_count<T>(mut self, v: std::option::Option<T>) -> Self
2400    where
2401        T: std::convert::Into<i32>,
2402    {
2403        self.assigned_volume_count = v.map(|x| x.into());
2404        self
2405    }
2406
2407    /// Sets the value of [create_time][crate::model::BackupPolicy::create_time].
2408    ///
2409    /// # Example
2410    /// ```ignore,no_run
2411    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2412    /// use wkt::Timestamp;
2413    /// let x = BackupPolicy::new().set_create_time(Timestamp::default()/* use setters */);
2414    /// ```
2415    pub fn set_create_time<T>(mut self, v: T) -> Self
2416    where
2417        T: std::convert::Into<wkt::Timestamp>,
2418    {
2419        self.create_time = std::option::Option::Some(v.into());
2420        self
2421    }
2422
2423    /// Sets or clears the value of [create_time][crate::model::BackupPolicy::create_time].
2424    ///
2425    /// # Example
2426    /// ```ignore,no_run
2427    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2428    /// use wkt::Timestamp;
2429    /// let x = BackupPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2430    /// let x = BackupPolicy::new().set_or_clear_create_time(None::<Timestamp>);
2431    /// ```
2432    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2433    where
2434        T: std::convert::Into<wkt::Timestamp>,
2435    {
2436        self.create_time = v.map(|x| x.into());
2437        self
2438    }
2439
2440    /// Sets the value of [labels][crate::model::BackupPolicy::labels].
2441    ///
2442    /// # Example
2443    /// ```ignore,no_run
2444    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2445    /// let x = BackupPolicy::new().set_labels([
2446    ///     ("key0", "abc"),
2447    ///     ("key1", "xyz"),
2448    /// ]);
2449    /// ```
2450    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2451    where
2452        T: std::iter::IntoIterator<Item = (K, V)>,
2453        K: std::convert::Into<std::string::String>,
2454        V: std::convert::Into<std::string::String>,
2455    {
2456        use std::iter::Iterator;
2457        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2458        self
2459    }
2460
2461    /// Sets the value of [state][crate::model::BackupPolicy::state].
2462    ///
2463    /// # Example
2464    /// ```ignore,no_run
2465    /// # use google_cloud_netapp_v1::model::BackupPolicy;
2466    /// use google_cloud_netapp_v1::model::backup_policy::State;
2467    /// let x0 = BackupPolicy::new().set_state(State::Creating);
2468    /// let x1 = BackupPolicy::new().set_state(State::Ready);
2469    /// let x2 = BackupPolicy::new().set_state(State::Deleting);
2470    /// ```
2471    pub fn set_state<T: std::convert::Into<crate::model::backup_policy::State>>(
2472        mut self,
2473        v: T,
2474    ) -> Self {
2475        self.state = v.into();
2476        self
2477    }
2478}
2479
2480impl wkt::message::Message for BackupPolicy {
2481    fn typename() -> &'static str {
2482        "type.googleapis.com/google.cloud.netapp.v1.BackupPolicy"
2483    }
2484}
2485
2486/// Defines additional types related to [BackupPolicy].
2487pub mod backup_policy {
2488    #[allow(unused_imports)]
2489    use super::*;
2490
2491    ///
2492    /// # Working with unknown values
2493    ///
2494    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2495    /// additional enum variants at any time. Adding new variants is not considered
2496    /// a breaking change. Applications should write their code in anticipation of:
2497    ///
2498    /// - New values appearing in future releases of the client library, **and**
2499    /// - New values received dynamically, without application changes.
2500    ///
2501    /// Please consult the [Working with enums] section in the user guide for some
2502    /// guidelines.
2503    ///
2504    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2505    #[derive(Clone, Debug, PartialEq)]
2506    #[non_exhaustive]
2507    pub enum State {
2508        /// State not set.
2509        Unspecified,
2510        /// BackupPolicy is being created.
2511        Creating,
2512        /// BackupPolicy is available for use.
2513        Ready,
2514        /// BackupPolicy is being deleted.
2515        Deleting,
2516        /// BackupPolicy is not valid and cannot be used.
2517        Error,
2518        /// BackupPolicy is being updated.
2519        Updating,
2520        /// If set, the enum was initialized with an unknown value.
2521        ///
2522        /// Applications can examine the value using [State::value] or
2523        /// [State::name].
2524        UnknownValue(state::UnknownValue),
2525    }
2526
2527    #[doc(hidden)]
2528    pub mod state {
2529        #[allow(unused_imports)]
2530        use super::*;
2531        #[derive(Clone, Debug, PartialEq)]
2532        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2533    }
2534
2535    impl State {
2536        /// Gets the enum value.
2537        ///
2538        /// Returns `None` if the enum contains an unknown value deserialized from
2539        /// the string representation of enums.
2540        pub fn value(&self) -> std::option::Option<i32> {
2541            match self {
2542                Self::Unspecified => std::option::Option::Some(0),
2543                Self::Creating => std::option::Option::Some(1),
2544                Self::Ready => std::option::Option::Some(2),
2545                Self::Deleting => std::option::Option::Some(3),
2546                Self::Error => std::option::Option::Some(4),
2547                Self::Updating => std::option::Option::Some(5),
2548                Self::UnknownValue(u) => u.0.value(),
2549            }
2550        }
2551
2552        /// Gets the enum value as a string.
2553        ///
2554        /// Returns `None` if the enum contains an unknown value deserialized from
2555        /// the integer representation of enums.
2556        pub fn name(&self) -> std::option::Option<&str> {
2557            match self {
2558                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2559                Self::Creating => std::option::Option::Some("CREATING"),
2560                Self::Ready => std::option::Option::Some("READY"),
2561                Self::Deleting => std::option::Option::Some("DELETING"),
2562                Self::Error => std::option::Option::Some("ERROR"),
2563                Self::Updating => std::option::Option::Some("UPDATING"),
2564                Self::UnknownValue(u) => u.0.name(),
2565            }
2566        }
2567    }
2568
2569    impl std::default::Default for State {
2570        fn default() -> Self {
2571            use std::convert::From;
2572            Self::from(0)
2573        }
2574    }
2575
2576    impl std::fmt::Display for State {
2577        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2578            wkt::internal::display_enum(f, self.name(), self.value())
2579        }
2580    }
2581
2582    impl std::convert::From<i32> for State {
2583        fn from(value: i32) -> Self {
2584            match value {
2585                0 => Self::Unspecified,
2586                1 => Self::Creating,
2587                2 => Self::Ready,
2588                3 => Self::Deleting,
2589                4 => Self::Error,
2590                5 => Self::Updating,
2591                _ => Self::UnknownValue(state::UnknownValue(
2592                    wkt::internal::UnknownEnumValue::Integer(value),
2593                )),
2594            }
2595        }
2596    }
2597
2598    impl std::convert::From<&str> for State {
2599        fn from(value: &str) -> Self {
2600            use std::string::ToString;
2601            match value {
2602                "STATE_UNSPECIFIED" => Self::Unspecified,
2603                "CREATING" => Self::Creating,
2604                "READY" => Self::Ready,
2605                "DELETING" => Self::Deleting,
2606                "ERROR" => Self::Error,
2607                "UPDATING" => Self::Updating,
2608                _ => Self::UnknownValue(state::UnknownValue(
2609                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2610                )),
2611            }
2612        }
2613    }
2614
2615    impl serde::ser::Serialize for State {
2616        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2617        where
2618            S: serde::Serializer,
2619        {
2620            match self {
2621                Self::Unspecified => serializer.serialize_i32(0),
2622                Self::Creating => serializer.serialize_i32(1),
2623                Self::Ready => serializer.serialize_i32(2),
2624                Self::Deleting => serializer.serialize_i32(3),
2625                Self::Error => serializer.serialize_i32(4),
2626                Self::Updating => serializer.serialize_i32(5),
2627                Self::UnknownValue(u) => u.0.serialize(serializer),
2628            }
2629        }
2630    }
2631
2632    impl<'de> serde::de::Deserialize<'de> for State {
2633        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2634        where
2635            D: serde::Deserializer<'de>,
2636        {
2637            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2638                ".google.cloud.netapp.v1.BackupPolicy.State",
2639            ))
2640        }
2641    }
2642}
2643
2644/// CreateBackupPolicyRequest creates a backupPolicy.
2645#[derive(Clone, Default, PartialEq)]
2646#[non_exhaustive]
2647pub struct CreateBackupPolicyRequest {
2648    /// Required. The location to create the backup policies of, in the format
2649    /// `projects/{project_id}/locations/{location}`
2650    pub parent: std::string::String,
2651
2652    /// Required. A backupPolicy resource
2653    pub backup_policy: std::option::Option<crate::model::BackupPolicy>,
2654
2655    /// Required. The ID to use for the backup policy.
2656    /// The ID must be unique within the specified location.
2657    /// Must contain only letters, numbers and hyphen, with the first
2658    /// character a letter, the last a letter or a
2659    /// number, and a 63 character maximum.
2660    pub backup_policy_id: std::string::String,
2661
2662    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2663}
2664
2665impl CreateBackupPolicyRequest {
2666    pub fn new() -> Self {
2667        std::default::Default::default()
2668    }
2669
2670    /// Sets the value of [parent][crate::model::CreateBackupPolicyRequest::parent].
2671    ///
2672    /// # Example
2673    /// ```ignore,no_run
2674    /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2675    /// let x = CreateBackupPolicyRequest::new().set_parent("example");
2676    /// ```
2677    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2678        self.parent = v.into();
2679        self
2680    }
2681
2682    /// Sets the value of [backup_policy][crate::model::CreateBackupPolicyRequest::backup_policy].
2683    ///
2684    /// # Example
2685    /// ```ignore,no_run
2686    /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2687    /// use google_cloud_netapp_v1::model::BackupPolicy;
2688    /// let x = CreateBackupPolicyRequest::new().set_backup_policy(BackupPolicy::default()/* use setters */);
2689    /// ```
2690    pub fn set_backup_policy<T>(mut self, v: T) -> Self
2691    where
2692        T: std::convert::Into<crate::model::BackupPolicy>,
2693    {
2694        self.backup_policy = std::option::Option::Some(v.into());
2695        self
2696    }
2697
2698    /// Sets or clears the value of [backup_policy][crate::model::CreateBackupPolicyRequest::backup_policy].
2699    ///
2700    /// # Example
2701    /// ```ignore,no_run
2702    /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2703    /// use google_cloud_netapp_v1::model::BackupPolicy;
2704    /// let x = CreateBackupPolicyRequest::new().set_or_clear_backup_policy(Some(BackupPolicy::default()/* use setters */));
2705    /// let x = CreateBackupPolicyRequest::new().set_or_clear_backup_policy(None::<BackupPolicy>);
2706    /// ```
2707    pub fn set_or_clear_backup_policy<T>(mut self, v: std::option::Option<T>) -> Self
2708    where
2709        T: std::convert::Into<crate::model::BackupPolicy>,
2710    {
2711        self.backup_policy = v.map(|x| x.into());
2712        self
2713    }
2714
2715    /// Sets the value of [backup_policy_id][crate::model::CreateBackupPolicyRequest::backup_policy_id].
2716    ///
2717    /// # Example
2718    /// ```ignore,no_run
2719    /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2720    /// let x = CreateBackupPolicyRequest::new().set_backup_policy_id("example");
2721    /// ```
2722    pub fn set_backup_policy_id<T: std::convert::Into<std::string::String>>(
2723        mut self,
2724        v: T,
2725    ) -> Self {
2726        self.backup_policy_id = v.into();
2727        self
2728    }
2729}
2730
2731impl wkt::message::Message for CreateBackupPolicyRequest {
2732    fn typename() -> &'static str {
2733        "type.googleapis.com/google.cloud.netapp.v1.CreateBackupPolicyRequest"
2734    }
2735}
2736
2737/// GetBackupPolicyRequest gets the state of a backupPolicy.
2738#[derive(Clone, Default, PartialEq)]
2739#[non_exhaustive]
2740pub struct GetBackupPolicyRequest {
2741    /// Required. The backupPolicy resource name, in the format
2742    /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`
2743    pub name: std::string::String,
2744
2745    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2746}
2747
2748impl GetBackupPolicyRequest {
2749    pub fn new() -> Self {
2750        std::default::Default::default()
2751    }
2752
2753    /// Sets the value of [name][crate::model::GetBackupPolicyRequest::name].
2754    ///
2755    /// # Example
2756    /// ```ignore,no_run
2757    /// # use google_cloud_netapp_v1::model::GetBackupPolicyRequest;
2758    /// let x = GetBackupPolicyRequest::new().set_name("example");
2759    /// ```
2760    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2761        self.name = v.into();
2762        self
2763    }
2764}
2765
2766impl wkt::message::Message for GetBackupPolicyRequest {
2767    fn typename() -> &'static str {
2768        "type.googleapis.com/google.cloud.netapp.v1.GetBackupPolicyRequest"
2769    }
2770}
2771
2772/// ListBackupPoliciesRequest for requesting multiple backup policies.
2773#[derive(Clone, Default, PartialEq)]
2774#[non_exhaustive]
2775pub struct ListBackupPoliciesRequest {
2776    /// Required. Parent value for ListBackupPoliciesRequest
2777    pub parent: std::string::String,
2778
2779    /// Requested page size. Server may return fewer items than requested.
2780    /// If unspecified, the server will pick an appropriate default.
2781    pub page_size: i32,
2782
2783    /// A token identifying a page of results the server should return.
2784    pub page_token: std::string::String,
2785
2786    /// Filtering results
2787    pub filter: std::string::String,
2788
2789    /// Hint for how to order the results
2790    pub order_by: std::string::String,
2791
2792    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2793}
2794
2795impl ListBackupPoliciesRequest {
2796    pub fn new() -> Self {
2797        std::default::Default::default()
2798    }
2799
2800    /// Sets the value of [parent][crate::model::ListBackupPoliciesRequest::parent].
2801    ///
2802    /// # Example
2803    /// ```ignore,no_run
2804    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2805    /// let x = ListBackupPoliciesRequest::new().set_parent("example");
2806    /// ```
2807    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2808        self.parent = v.into();
2809        self
2810    }
2811
2812    /// Sets the value of [page_size][crate::model::ListBackupPoliciesRequest::page_size].
2813    ///
2814    /// # Example
2815    /// ```ignore,no_run
2816    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2817    /// let x = ListBackupPoliciesRequest::new().set_page_size(42);
2818    /// ```
2819    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2820        self.page_size = v.into();
2821        self
2822    }
2823
2824    /// Sets the value of [page_token][crate::model::ListBackupPoliciesRequest::page_token].
2825    ///
2826    /// # Example
2827    /// ```ignore,no_run
2828    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2829    /// let x = ListBackupPoliciesRequest::new().set_page_token("example");
2830    /// ```
2831    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2832        self.page_token = v.into();
2833        self
2834    }
2835
2836    /// Sets the value of [filter][crate::model::ListBackupPoliciesRequest::filter].
2837    ///
2838    /// # Example
2839    /// ```ignore,no_run
2840    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2841    /// let x = ListBackupPoliciesRequest::new().set_filter("example");
2842    /// ```
2843    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2844        self.filter = v.into();
2845        self
2846    }
2847
2848    /// Sets the value of [order_by][crate::model::ListBackupPoliciesRequest::order_by].
2849    ///
2850    /// # Example
2851    /// ```ignore,no_run
2852    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2853    /// let x = ListBackupPoliciesRequest::new().set_order_by("example");
2854    /// ```
2855    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2856        self.order_by = v.into();
2857        self
2858    }
2859}
2860
2861impl wkt::message::Message for ListBackupPoliciesRequest {
2862    fn typename() -> &'static str {
2863        "type.googleapis.com/google.cloud.netapp.v1.ListBackupPoliciesRequest"
2864    }
2865}
2866
2867/// ListBackupPoliciesResponse contains all the backup policies requested.
2868#[derive(Clone, Default, PartialEq)]
2869#[non_exhaustive]
2870pub struct ListBackupPoliciesResponse {
2871    /// The list of backup policies.
2872    pub backup_policies: std::vec::Vec<crate::model::BackupPolicy>,
2873
2874    /// A token identifying a page of results the server should return.
2875    pub next_page_token: std::string::String,
2876
2877    /// Locations that could not be reached.
2878    pub unreachable: std::vec::Vec<std::string::String>,
2879
2880    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2881}
2882
2883impl ListBackupPoliciesResponse {
2884    pub fn new() -> Self {
2885        std::default::Default::default()
2886    }
2887
2888    /// Sets the value of [backup_policies][crate::model::ListBackupPoliciesResponse::backup_policies].
2889    ///
2890    /// # Example
2891    /// ```ignore,no_run
2892    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
2893    /// use google_cloud_netapp_v1::model::BackupPolicy;
2894    /// let x = ListBackupPoliciesResponse::new()
2895    ///     .set_backup_policies([
2896    ///         BackupPolicy::default()/* use setters */,
2897    ///         BackupPolicy::default()/* use (different) setters */,
2898    ///     ]);
2899    /// ```
2900    pub fn set_backup_policies<T, V>(mut self, v: T) -> Self
2901    where
2902        T: std::iter::IntoIterator<Item = V>,
2903        V: std::convert::Into<crate::model::BackupPolicy>,
2904    {
2905        use std::iter::Iterator;
2906        self.backup_policies = v.into_iter().map(|i| i.into()).collect();
2907        self
2908    }
2909
2910    /// Sets the value of [next_page_token][crate::model::ListBackupPoliciesResponse::next_page_token].
2911    ///
2912    /// # Example
2913    /// ```ignore,no_run
2914    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
2915    /// let x = ListBackupPoliciesResponse::new().set_next_page_token("example");
2916    /// ```
2917    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2918        self.next_page_token = v.into();
2919        self
2920    }
2921
2922    /// Sets the value of [unreachable][crate::model::ListBackupPoliciesResponse::unreachable].
2923    ///
2924    /// # Example
2925    /// ```ignore,no_run
2926    /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
2927    /// let x = ListBackupPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
2928    /// ```
2929    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2930    where
2931        T: std::iter::IntoIterator<Item = V>,
2932        V: std::convert::Into<std::string::String>,
2933    {
2934        use std::iter::Iterator;
2935        self.unreachable = v.into_iter().map(|i| i.into()).collect();
2936        self
2937    }
2938}
2939
2940impl wkt::message::Message for ListBackupPoliciesResponse {
2941    fn typename() -> &'static str {
2942        "type.googleapis.com/google.cloud.netapp.v1.ListBackupPoliciesResponse"
2943    }
2944}
2945
2946#[doc(hidden)]
2947impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupPoliciesResponse {
2948    type PageItem = crate::model::BackupPolicy;
2949
2950    fn items(self) -> std::vec::Vec<Self::PageItem> {
2951        self.backup_policies
2952    }
2953
2954    fn next_page_token(&self) -> std::string::String {
2955        use std::clone::Clone;
2956        self.next_page_token.clone()
2957    }
2958}
2959
2960/// UpdateBackupPolicyRequest for updating a backup policy.
2961#[derive(Clone, Default, PartialEq)]
2962#[non_exhaustive]
2963pub struct UpdateBackupPolicyRequest {
2964    /// Required. Field mask is used to specify the fields to be overwritten in the
2965    /// Backup Policy resource by the update.
2966    /// The fields specified in the update_mask are relative to the resource, not
2967    /// the full request. A field will be overwritten if it is in the mask. If the
2968    /// user does not provide a mask then all fields will be overwritten.
2969    pub update_mask: std::option::Option<wkt::FieldMask>,
2970
2971    /// Required. The backup policy being updated
2972    pub backup_policy: std::option::Option<crate::model::BackupPolicy>,
2973
2974    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2975}
2976
2977impl UpdateBackupPolicyRequest {
2978    pub fn new() -> Self {
2979        std::default::Default::default()
2980    }
2981
2982    /// Sets the value of [update_mask][crate::model::UpdateBackupPolicyRequest::update_mask].
2983    ///
2984    /// # Example
2985    /// ```ignore,no_run
2986    /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
2987    /// use wkt::FieldMask;
2988    /// let x = UpdateBackupPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2989    /// ```
2990    pub fn set_update_mask<T>(mut self, v: T) -> Self
2991    where
2992        T: std::convert::Into<wkt::FieldMask>,
2993    {
2994        self.update_mask = std::option::Option::Some(v.into());
2995        self
2996    }
2997
2998    /// Sets or clears the value of [update_mask][crate::model::UpdateBackupPolicyRequest::update_mask].
2999    ///
3000    /// # Example
3001    /// ```ignore,no_run
3002    /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3003    /// use wkt::FieldMask;
3004    /// let x = UpdateBackupPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3005    /// let x = UpdateBackupPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3006    /// ```
3007    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3008    where
3009        T: std::convert::Into<wkt::FieldMask>,
3010    {
3011        self.update_mask = v.map(|x| x.into());
3012        self
3013    }
3014
3015    /// Sets the value of [backup_policy][crate::model::UpdateBackupPolicyRequest::backup_policy].
3016    ///
3017    /// # Example
3018    /// ```ignore,no_run
3019    /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3020    /// use google_cloud_netapp_v1::model::BackupPolicy;
3021    /// let x = UpdateBackupPolicyRequest::new().set_backup_policy(BackupPolicy::default()/* use setters */);
3022    /// ```
3023    pub fn set_backup_policy<T>(mut self, v: T) -> Self
3024    where
3025        T: std::convert::Into<crate::model::BackupPolicy>,
3026    {
3027        self.backup_policy = std::option::Option::Some(v.into());
3028        self
3029    }
3030
3031    /// Sets or clears the value of [backup_policy][crate::model::UpdateBackupPolicyRequest::backup_policy].
3032    ///
3033    /// # Example
3034    /// ```ignore,no_run
3035    /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3036    /// use google_cloud_netapp_v1::model::BackupPolicy;
3037    /// let x = UpdateBackupPolicyRequest::new().set_or_clear_backup_policy(Some(BackupPolicy::default()/* use setters */));
3038    /// let x = UpdateBackupPolicyRequest::new().set_or_clear_backup_policy(None::<BackupPolicy>);
3039    /// ```
3040    pub fn set_or_clear_backup_policy<T>(mut self, v: std::option::Option<T>) -> Self
3041    where
3042        T: std::convert::Into<crate::model::BackupPolicy>,
3043    {
3044        self.backup_policy = v.map(|x| x.into());
3045        self
3046    }
3047}
3048
3049impl wkt::message::Message for UpdateBackupPolicyRequest {
3050    fn typename() -> &'static str {
3051        "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupPolicyRequest"
3052    }
3053}
3054
3055/// DeleteBackupPolicyRequest deletes a backup policy.
3056#[derive(Clone, Default, PartialEq)]
3057#[non_exhaustive]
3058pub struct DeleteBackupPolicyRequest {
3059    /// Required. The backup policy resource name, in the format
3060    /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`
3061    pub name: std::string::String,
3062
3063    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3064}
3065
3066impl DeleteBackupPolicyRequest {
3067    pub fn new() -> Self {
3068        std::default::Default::default()
3069    }
3070
3071    /// Sets the value of [name][crate::model::DeleteBackupPolicyRequest::name].
3072    ///
3073    /// # Example
3074    /// ```ignore,no_run
3075    /// # use google_cloud_netapp_v1::model::DeleteBackupPolicyRequest;
3076    /// let x = DeleteBackupPolicyRequest::new().set_name("example");
3077    /// ```
3078    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3079        self.name = v.into();
3080        self
3081    }
3082}
3083
3084impl wkt::message::Message for DeleteBackupPolicyRequest {
3085    fn typename() -> &'static str {
3086        "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupPolicyRequest"
3087    }
3088}
3089
3090/// A NetApp BackupVault.
3091#[derive(Clone, Default, PartialEq)]
3092#[non_exhaustive]
3093pub struct BackupVault {
3094    /// Identifier. The resource name of the backup vault.
3095    /// Format:
3096    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`.
3097    pub name: std::string::String,
3098
3099    /// Output only. The backup vault state.
3100    pub state: crate::model::backup_vault::State,
3101
3102    /// Output only. Create time of the backup vault.
3103    pub create_time: std::option::Option<wkt::Timestamp>,
3104
3105    /// Description of the backup vault.
3106    pub description: std::string::String,
3107
3108    /// Resource labels to represent user provided metadata.
3109    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3110
3111    /// Optional. Type of backup vault to be created.
3112    /// Default is IN_REGION.
3113    pub backup_vault_type: crate::model::backup_vault::BackupVaultType,
3114
3115    /// Output only. Region in which the backup vault is created.
3116    /// Format: `projects/{project_id}/locations/{location}`
3117    pub source_region: std::string::String,
3118
3119    /// Optional. Region where the backups are stored.
3120    /// Format: `projects/{project_id}/locations/{location}`
3121    pub backup_region: std::string::String,
3122
3123    /// Output only. Name of the Backup vault created in source region.
3124    /// Format:
3125    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
3126    pub source_backup_vault: std::string::String,
3127
3128    /// Output only. Name of the Backup vault created in backup region.
3129    /// Format:
3130    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
3131    pub destination_backup_vault: std::string::String,
3132
3133    /// Optional. Backup retention policy defining the retention of backups.
3134    pub backup_retention_policy:
3135        std::option::Option<crate::model::backup_vault::BackupRetentionPolicy>,
3136
3137    /// Optional. Specifies the Key Management System (KMS) configuration to be
3138    /// used for backup encryption. Format:
3139    /// `projects/{project}/locations/{location}/kmsConfigs/{kms_config}`
3140    pub kms_config: std::string::String,
3141
3142    /// Output only. Field indicating encryption state of CMEK backups.
3143    pub encryption_state: crate::model::backup_vault::EncryptionState,
3144
3145    /// Output only. The crypto key version used to encrypt the backup vault.
3146    /// Format:
3147    /// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}`
3148    pub backups_crypto_key_version: std::string::String,
3149
3150    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3151}
3152
3153impl BackupVault {
3154    pub fn new() -> Self {
3155        std::default::Default::default()
3156    }
3157
3158    /// Sets the value of [name][crate::model::BackupVault::name].
3159    ///
3160    /// # Example
3161    /// ```ignore,no_run
3162    /// # use google_cloud_netapp_v1::model::BackupVault;
3163    /// let x = BackupVault::new().set_name("example");
3164    /// ```
3165    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3166        self.name = v.into();
3167        self
3168    }
3169
3170    /// Sets the value of [state][crate::model::BackupVault::state].
3171    ///
3172    /// # Example
3173    /// ```ignore,no_run
3174    /// # use google_cloud_netapp_v1::model::BackupVault;
3175    /// use google_cloud_netapp_v1::model::backup_vault::State;
3176    /// let x0 = BackupVault::new().set_state(State::Creating);
3177    /// let x1 = BackupVault::new().set_state(State::Ready);
3178    /// let x2 = BackupVault::new().set_state(State::Deleting);
3179    /// ```
3180    pub fn set_state<T: std::convert::Into<crate::model::backup_vault::State>>(
3181        mut self,
3182        v: T,
3183    ) -> Self {
3184        self.state = v.into();
3185        self
3186    }
3187
3188    /// Sets the value of [create_time][crate::model::BackupVault::create_time].
3189    ///
3190    /// # Example
3191    /// ```ignore,no_run
3192    /// # use google_cloud_netapp_v1::model::BackupVault;
3193    /// use wkt::Timestamp;
3194    /// let x = BackupVault::new().set_create_time(Timestamp::default()/* use setters */);
3195    /// ```
3196    pub fn set_create_time<T>(mut self, v: T) -> Self
3197    where
3198        T: std::convert::Into<wkt::Timestamp>,
3199    {
3200        self.create_time = std::option::Option::Some(v.into());
3201        self
3202    }
3203
3204    /// Sets or clears the value of [create_time][crate::model::BackupVault::create_time].
3205    ///
3206    /// # Example
3207    /// ```ignore,no_run
3208    /// # use google_cloud_netapp_v1::model::BackupVault;
3209    /// use wkt::Timestamp;
3210    /// let x = BackupVault::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3211    /// let x = BackupVault::new().set_or_clear_create_time(None::<Timestamp>);
3212    /// ```
3213    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3214    where
3215        T: std::convert::Into<wkt::Timestamp>,
3216    {
3217        self.create_time = v.map(|x| x.into());
3218        self
3219    }
3220
3221    /// Sets the value of [description][crate::model::BackupVault::description].
3222    ///
3223    /// # Example
3224    /// ```ignore,no_run
3225    /// # use google_cloud_netapp_v1::model::BackupVault;
3226    /// let x = BackupVault::new().set_description("example");
3227    /// ```
3228    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3229        self.description = v.into();
3230        self
3231    }
3232
3233    /// Sets the value of [labels][crate::model::BackupVault::labels].
3234    ///
3235    /// # Example
3236    /// ```ignore,no_run
3237    /// # use google_cloud_netapp_v1::model::BackupVault;
3238    /// let x = BackupVault::new().set_labels([
3239    ///     ("key0", "abc"),
3240    ///     ("key1", "xyz"),
3241    /// ]);
3242    /// ```
3243    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3244    where
3245        T: std::iter::IntoIterator<Item = (K, V)>,
3246        K: std::convert::Into<std::string::String>,
3247        V: std::convert::Into<std::string::String>,
3248    {
3249        use std::iter::Iterator;
3250        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3251        self
3252    }
3253
3254    /// Sets the value of [backup_vault_type][crate::model::BackupVault::backup_vault_type].
3255    ///
3256    /// # Example
3257    /// ```ignore,no_run
3258    /// # use google_cloud_netapp_v1::model::BackupVault;
3259    /// use google_cloud_netapp_v1::model::backup_vault::BackupVaultType;
3260    /// let x0 = BackupVault::new().set_backup_vault_type(BackupVaultType::InRegion);
3261    /// let x1 = BackupVault::new().set_backup_vault_type(BackupVaultType::CrossRegion);
3262    /// ```
3263    pub fn set_backup_vault_type<
3264        T: std::convert::Into<crate::model::backup_vault::BackupVaultType>,
3265    >(
3266        mut self,
3267        v: T,
3268    ) -> Self {
3269        self.backup_vault_type = v.into();
3270        self
3271    }
3272
3273    /// Sets the value of [source_region][crate::model::BackupVault::source_region].
3274    ///
3275    /// # Example
3276    /// ```ignore,no_run
3277    /// # use google_cloud_netapp_v1::model::BackupVault;
3278    /// let x = BackupVault::new().set_source_region("example");
3279    /// ```
3280    pub fn set_source_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3281        self.source_region = v.into();
3282        self
3283    }
3284
3285    /// Sets the value of [backup_region][crate::model::BackupVault::backup_region].
3286    ///
3287    /// # Example
3288    /// ```ignore,no_run
3289    /// # use google_cloud_netapp_v1::model::BackupVault;
3290    /// let x = BackupVault::new().set_backup_region("example");
3291    /// ```
3292    pub fn set_backup_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3293        self.backup_region = v.into();
3294        self
3295    }
3296
3297    /// Sets the value of [source_backup_vault][crate::model::BackupVault::source_backup_vault].
3298    ///
3299    /// # Example
3300    /// ```ignore,no_run
3301    /// # use google_cloud_netapp_v1::model::BackupVault;
3302    /// let x = BackupVault::new().set_source_backup_vault("example");
3303    /// ```
3304    pub fn set_source_backup_vault<T: std::convert::Into<std::string::String>>(
3305        mut self,
3306        v: T,
3307    ) -> Self {
3308        self.source_backup_vault = v.into();
3309        self
3310    }
3311
3312    /// Sets the value of [destination_backup_vault][crate::model::BackupVault::destination_backup_vault].
3313    ///
3314    /// # Example
3315    /// ```ignore,no_run
3316    /// # use google_cloud_netapp_v1::model::BackupVault;
3317    /// let x = BackupVault::new().set_destination_backup_vault("example");
3318    /// ```
3319    pub fn set_destination_backup_vault<T: std::convert::Into<std::string::String>>(
3320        mut self,
3321        v: T,
3322    ) -> Self {
3323        self.destination_backup_vault = v.into();
3324        self
3325    }
3326
3327    /// Sets the value of [backup_retention_policy][crate::model::BackupVault::backup_retention_policy].
3328    ///
3329    /// # Example
3330    /// ```ignore,no_run
3331    /// # use google_cloud_netapp_v1::model::BackupVault;
3332    /// use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3333    /// let x = BackupVault::new().set_backup_retention_policy(BackupRetentionPolicy::default()/* use setters */);
3334    /// ```
3335    pub fn set_backup_retention_policy<T>(mut self, v: T) -> Self
3336    where
3337        T: std::convert::Into<crate::model::backup_vault::BackupRetentionPolicy>,
3338    {
3339        self.backup_retention_policy = std::option::Option::Some(v.into());
3340        self
3341    }
3342
3343    /// Sets or clears the value of [backup_retention_policy][crate::model::BackupVault::backup_retention_policy].
3344    ///
3345    /// # Example
3346    /// ```ignore,no_run
3347    /// # use google_cloud_netapp_v1::model::BackupVault;
3348    /// use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3349    /// let x = BackupVault::new().set_or_clear_backup_retention_policy(Some(BackupRetentionPolicy::default()/* use setters */));
3350    /// let x = BackupVault::new().set_or_clear_backup_retention_policy(None::<BackupRetentionPolicy>);
3351    /// ```
3352    pub fn set_or_clear_backup_retention_policy<T>(mut self, v: std::option::Option<T>) -> Self
3353    where
3354        T: std::convert::Into<crate::model::backup_vault::BackupRetentionPolicy>,
3355    {
3356        self.backup_retention_policy = v.map(|x| x.into());
3357        self
3358    }
3359
3360    /// Sets the value of [kms_config][crate::model::BackupVault::kms_config].
3361    ///
3362    /// # Example
3363    /// ```ignore,no_run
3364    /// # use google_cloud_netapp_v1::model::BackupVault;
3365    /// let x = BackupVault::new().set_kms_config("example");
3366    /// ```
3367    pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3368        self.kms_config = v.into();
3369        self
3370    }
3371
3372    /// Sets the value of [encryption_state][crate::model::BackupVault::encryption_state].
3373    ///
3374    /// # Example
3375    /// ```ignore,no_run
3376    /// # use google_cloud_netapp_v1::model::BackupVault;
3377    /// use google_cloud_netapp_v1::model::backup_vault::EncryptionState;
3378    /// let x0 = BackupVault::new().set_encryption_state(EncryptionState::Pending);
3379    /// let x1 = BackupVault::new().set_encryption_state(EncryptionState::Completed);
3380    /// let x2 = BackupVault::new().set_encryption_state(EncryptionState::InProgress);
3381    /// ```
3382    pub fn set_encryption_state<
3383        T: std::convert::Into<crate::model::backup_vault::EncryptionState>,
3384    >(
3385        mut self,
3386        v: T,
3387    ) -> Self {
3388        self.encryption_state = v.into();
3389        self
3390    }
3391
3392    /// Sets the value of [backups_crypto_key_version][crate::model::BackupVault::backups_crypto_key_version].
3393    ///
3394    /// # Example
3395    /// ```ignore,no_run
3396    /// # use google_cloud_netapp_v1::model::BackupVault;
3397    /// let x = BackupVault::new().set_backups_crypto_key_version("example");
3398    /// ```
3399    pub fn set_backups_crypto_key_version<T: std::convert::Into<std::string::String>>(
3400        mut self,
3401        v: T,
3402    ) -> Self {
3403        self.backups_crypto_key_version = v.into();
3404        self
3405    }
3406}
3407
3408impl wkt::message::Message for BackupVault {
3409    fn typename() -> &'static str {
3410        "type.googleapis.com/google.cloud.netapp.v1.BackupVault"
3411    }
3412}
3413
3414/// Defines additional types related to [BackupVault].
3415pub mod backup_vault {
3416    #[allow(unused_imports)]
3417    use super::*;
3418
3419    /// Retention policy for backups in the backup vault
3420    #[derive(Clone, Default, PartialEq)]
3421    #[non_exhaustive]
3422    pub struct BackupRetentionPolicy {
3423        /// Required. Minimum retention duration in days for backups in the backup
3424        /// vault.
3425        pub backup_minimum_enforced_retention_days: i32,
3426
3427        /// Optional. Indicates if the daily backups are immutable.
3428        /// At least one of daily_backup_immutable, weekly_backup_immutable,
3429        /// monthly_backup_immutable and manual_backup_immutable must be true.
3430        pub daily_backup_immutable: bool,
3431
3432        /// Optional. Indicates if the weekly backups are immutable.
3433        /// At least one of daily_backup_immutable, weekly_backup_immutable,
3434        /// monthly_backup_immutable and manual_backup_immutable must be true.
3435        pub weekly_backup_immutable: bool,
3436
3437        /// Optional. Indicates if the monthly backups are immutable.
3438        /// At least one of daily_backup_immutable, weekly_backup_immutable,
3439        /// monthly_backup_immutable and manual_backup_immutable must be true.
3440        pub monthly_backup_immutable: bool,
3441
3442        /// Optional. Indicates if the manual backups are immutable.
3443        /// At least one of daily_backup_immutable, weekly_backup_immutable,
3444        /// monthly_backup_immutable and manual_backup_immutable must be true.
3445        pub manual_backup_immutable: bool,
3446
3447        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3448    }
3449
3450    impl BackupRetentionPolicy {
3451        pub fn new() -> Self {
3452            std::default::Default::default()
3453        }
3454
3455        /// Sets the value of [backup_minimum_enforced_retention_days][crate::model::backup_vault::BackupRetentionPolicy::backup_minimum_enforced_retention_days].
3456        ///
3457        /// # Example
3458        /// ```ignore,no_run
3459        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3460        /// let x = BackupRetentionPolicy::new().set_backup_minimum_enforced_retention_days(42);
3461        /// ```
3462        pub fn set_backup_minimum_enforced_retention_days<T: std::convert::Into<i32>>(
3463            mut self,
3464            v: T,
3465        ) -> Self {
3466            self.backup_minimum_enforced_retention_days = v.into();
3467            self
3468        }
3469
3470        /// Sets the value of [daily_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::daily_backup_immutable].
3471        ///
3472        /// # Example
3473        /// ```ignore,no_run
3474        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3475        /// let x = BackupRetentionPolicy::new().set_daily_backup_immutable(true);
3476        /// ```
3477        pub fn set_daily_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3478            self.daily_backup_immutable = v.into();
3479            self
3480        }
3481
3482        /// Sets the value of [weekly_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::weekly_backup_immutable].
3483        ///
3484        /// # Example
3485        /// ```ignore,no_run
3486        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3487        /// let x = BackupRetentionPolicy::new().set_weekly_backup_immutable(true);
3488        /// ```
3489        pub fn set_weekly_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3490            self.weekly_backup_immutable = v.into();
3491            self
3492        }
3493
3494        /// Sets the value of [monthly_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::monthly_backup_immutable].
3495        ///
3496        /// # Example
3497        /// ```ignore,no_run
3498        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3499        /// let x = BackupRetentionPolicy::new().set_monthly_backup_immutable(true);
3500        /// ```
3501        pub fn set_monthly_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3502            self.monthly_backup_immutable = v.into();
3503            self
3504        }
3505
3506        /// Sets the value of [manual_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::manual_backup_immutable].
3507        ///
3508        /// # Example
3509        /// ```ignore,no_run
3510        /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3511        /// let x = BackupRetentionPolicy::new().set_manual_backup_immutable(true);
3512        /// ```
3513        pub fn set_manual_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3514            self.manual_backup_immutable = v.into();
3515            self
3516        }
3517    }
3518
3519    impl wkt::message::Message for BackupRetentionPolicy {
3520        fn typename() -> &'static str {
3521            "type.googleapis.com/google.cloud.netapp.v1.BackupVault.BackupRetentionPolicy"
3522        }
3523    }
3524
3525    /// The Backup Vault States
3526    ///
3527    /// # Working with unknown values
3528    ///
3529    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3530    /// additional enum variants at any time. Adding new variants is not considered
3531    /// a breaking change. Applications should write their code in anticipation of:
3532    ///
3533    /// - New values appearing in future releases of the client library, **and**
3534    /// - New values received dynamically, without application changes.
3535    ///
3536    /// Please consult the [Working with enums] section in the user guide for some
3537    /// guidelines.
3538    ///
3539    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3540    #[derive(Clone, Debug, PartialEq)]
3541    #[non_exhaustive]
3542    pub enum State {
3543        /// State not set.
3544        Unspecified,
3545        /// BackupVault is being created.
3546        Creating,
3547        /// BackupVault is available for use.
3548        Ready,
3549        /// BackupVault is being deleted.
3550        Deleting,
3551        /// BackupVault is not valid and cannot be used.
3552        Error,
3553        /// BackupVault is being updated.
3554        Updating,
3555        /// If set, the enum was initialized with an unknown value.
3556        ///
3557        /// Applications can examine the value using [State::value] or
3558        /// [State::name].
3559        UnknownValue(state::UnknownValue),
3560    }
3561
3562    #[doc(hidden)]
3563    pub mod state {
3564        #[allow(unused_imports)]
3565        use super::*;
3566        #[derive(Clone, Debug, PartialEq)]
3567        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3568    }
3569
3570    impl State {
3571        /// Gets the enum value.
3572        ///
3573        /// Returns `None` if the enum contains an unknown value deserialized from
3574        /// the string representation of enums.
3575        pub fn value(&self) -> std::option::Option<i32> {
3576            match self {
3577                Self::Unspecified => std::option::Option::Some(0),
3578                Self::Creating => std::option::Option::Some(1),
3579                Self::Ready => std::option::Option::Some(2),
3580                Self::Deleting => std::option::Option::Some(3),
3581                Self::Error => std::option::Option::Some(4),
3582                Self::Updating => std::option::Option::Some(5),
3583                Self::UnknownValue(u) => u.0.value(),
3584            }
3585        }
3586
3587        /// Gets the enum value as a string.
3588        ///
3589        /// Returns `None` if the enum contains an unknown value deserialized from
3590        /// the integer representation of enums.
3591        pub fn name(&self) -> std::option::Option<&str> {
3592            match self {
3593                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3594                Self::Creating => std::option::Option::Some("CREATING"),
3595                Self::Ready => std::option::Option::Some("READY"),
3596                Self::Deleting => std::option::Option::Some("DELETING"),
3597                Self::Error => std::option::Option::Some("ERROR"),
3598                Self::Updating => std::option::Option::Some("UPDATING"),
3599                Self::UnknownValue(u) => u.0.name(),
3600            }
3601        }
3602    }
3603
3604    impl std::default::Default for State {
3605        fn default() -> Self {
3606            use std::convert::From;
3607            Self::from(0)
3608        }
3609    }
3610
3611    impl std::fmt::Display for State {
3612        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3613            wkt::internal::display_enum(f, self.name(), self.value())
3614        }
3615    }
3616
3617    impl std::convert::From<i32> for State {
3618        fn from(value: i32) -> Self {
3619            match value {
3620                0 => Self::Unspecified,
3621                1 => Self::Creating,
3622                2 => Self::Ready,
3623                3 => Self::Deleting,
3624                4 => Self::Error,
3625                5 => Self::Updating,
3626                _ => Self::UnknownValue(state::UnknownValue(
3627                    wkt::internal::UnknownEnumValue::Integer(value),
3628                )),
3629            }
3630        }
3631    }
3632
3633    impl std::convert::From<&str> for State {
3634        fn from(value: &str) -> Self {
3635            use std::string::ToString;
3636            match value {
3637                "STATE_UNSPECIFIED" => Self::Unspecified,
3638                "CREATING" => Self::Creating,
3639                "READY" => Self::Ready,
3640                "DELETING" => Self::Deleting,
3641                "ERROR" => Self::Error,
3642                "UPDATING" => Self::Updating,
3643                _ => Self::UnknownValue(state::UnknownValue(
3644                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3645                )),
3646            }
3647        }
3648    }
3649
3650    impl serde::ser::Serialize for State {
3651        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3652        where
3653            S: serde::Serializer,
3654        {
3655            match self {
3656                Self::Unspecified => serializer.serialize_i32(0),
3657                Self::Creating => serializer.serialize_i32(1),
3658                Self::Ready => serializer.serialize_i32(2),
3659                Self::Deleting => serializer.serialize_i32(3),
3660                Self::Error => serializer.serialize_i32(4),
3661                Self::Updating => serializer.serialize_i32(5),
3662                Self::UnknownValue(u) => u.0.serialize(serializer),
3663            }
3664        }
3665    }
3666
3667    impl<'de> serde::de::Deserialize<'de> for State {
3668        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3669        where
3670            D: serde::Deserializer<'de>,
3671        {
3672            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3673                ".google.cloud.netapp.v1.BackupVault.State",
3674            ))
3675        }
3676    }
3677
3678    /// Backup Vault Type.
3679    ///
3680    /// # Working with unknown values
3681    ///
3682    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3683    /// additional enum variants at any time. Adding new variants is not considered
3684    /// a breaking change. Applications should write their code in anticipation of:
3685    ///
3686    /// - New values appearing in future releases of the client library, **and**
3687    /// - New values received dynamically, without application changes.
3688    ///
3689    /// Please consult the [Working with enums] section in the user guide for some
3690    /// guidelines.
3691    ///
3692    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3693    #[derive(Clone, Debug, PartialEq)]
3694    #[non_exhaustive]
3695    pub enum BackupVaultType {
3696        /// BackupVault type not set.
3697        Unspecified,
3698        /// BackupVault type is IN_REGION.
3699        InRegion,
3700        /// BackupVault type is CROSS_REGION.
3701        CrossRegion,
3702        /// If set, the enum was initialized with an unknown value.
3703        ///
3704        /// Applications can examine the value using [BackupVaultType::value] or
3705        /// [BackupVaultType::name].
3706        UnknownValue(backup_vault_type::UnknownValue),
3707    }
3708
3709    #[doc(hidden)]
3710    pub mod backup_vault_type {
3711        #[allow(unused_imports)]
3712        use super::*;
3713        #[derive(Clone, Debug, PartialEq)]
3714        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3715    }
3716
3717    impl BackupVaultType {
3718        /// Gets the enum value.
3719        ///
3720        /// Returns `None` if the enum contains an unknown value deserialized from
3721        /// the string representation of enums.
3722        pub fn value(&self) -> std::option::Option<i32> {
3723            match self {
3724                Self::Unspecified => std::option::Option::Some(0),
3725                Self::InRegion => std::option::Option::Some(1),
3726                Self::CrossRegion => std::option::Option::Some(2),
3727                Self::UnknownValue(u) => u.0.value(),
3728            }
3729        }
3730
3731        /// Gets the enum value as a string.
3732        ///
3733        /// Returns `None` if the enum contains an unknown value deserialized from
3734        /// the integer representation of enums.
3735        pub fn name(&self) -> std::option::Option<&str> {
3736            match self {
3737                Self::Unspecified => std::option::Option::Some("BACKUP_VAULT_TYPE_UNSPECIFIED"),
3738                Self::InRegion => std::option::Option::Some("IN_REGION"),
3739                Self::CrossRegion => std::option::Option::Some("CROSS_REGION"),
3740                Self::UnknownValue(u) => u.0.name(),
3741            }
3742        }
3743    }
3744
3745    impl std::default::Default for BackupVaultType {
3746        fn default() -> Self {
3747            use std::convert::From;
3748            Self::from(0)
3749        }
3750    }
3751
3752    impl std::fmt::Display for BackupVaultType {
3753        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3754            wkt::internal::display_enum(f, self.name(), self.value())
3755        }
3756    }
3757
3758    impl std::convert::From<i32> for BackupVaultType {
3759        fn from(value: i32) -> Self {
3760            match value {
3761                0 => Self::Unspecified,
3762                1 => Self::InRegion,
3763                2 => Self::CrossRegion,
3764                _ => Self::UnknownValue(backup_vault_type::UnknownValue(
3765                    wkt::internal::UnknownEnumValue::Integer(value),
3766                )),
3767            }
3768        }
3769    }
3770
3771    impl std::convert::From<&str> for BackupVaultType {
3772        fn from(value: &str) -> Self {
3773            use std::string::ToString;
3774            match value {
3775                "BACKUP_VAULT_TYPE_UNSPECIFIED" => Self::Unspecified,
3776                "IN_REGION" => Self::InRegion,
3777                "CROSS_REGION" => Self::CrossRegion,
3778                _ => Self::UnknownValue(backup_vault_type::UnknownValue(
3779                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3780                )),
3781            }
3782        }
3783    }
3784
3785    impl serde::ser::Serialize for BackupVaultType {
3786        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3787        where
3788            S: serde::Serializer,
3789        {
3790            match self {
3791                Self::Unspecified => serializer.serialize_i32(0),
3792                Self::InRegion => serializer.serialize_i32(1),
3793                Self::CrossRegion => serializer.serialize_i32(2),
3794                Self::UnknownValue(u) => u.0.serialize(serializer),
3795            }
3796        }
3797    }
3798
3799    impl<'de> serde::de::Deserialize<'de> for BackupVaultType {
3800        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3801        where
3802            D: serde::Deserializer<'de>,
3803        {
3804            deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupVaultType>::new(
3805                ".google.cloud.netapp.v1.BackupVault.BackupVaultType",
3806            ))
3807        }
3808    }
3809
3810    /// Encryption state of customer-managed encryption keys (CMEK) backups.
3811    ///
3812    /// # Working with unknown values
3813    ///
3814    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3815    /// additional enum variants at any time. Adding new variants is not considered
3816    /// a breaking change. Applications should write their code in anticipation of:
3817    ///
3818    /// - New values appearing in future releases of the client library, **and**
3819    /// - New values received dynamically, without application changes.
3820    ///
3821    /// Please consult the [Working with enums] section in the user guide for some
3822    /// guidelines.
3823    ///
3824    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3825    #[derive(Clone, Debug, PartialEq)]
3826    #[non_exhaustive]
3827    pub enum EncryptionState {
3828        /// Encryption state not set.
3829        Unspecified,
3830        /// Encryption state is pending.
3831        Pending,
3832        /// Encryption is complete.
3833        Completed,
3834        /// Encryption is in progress.
3835        InProgress,
3836        /// Encryption has failed.
3837        Failed,
3838        /// If set, the enum was initialized with an unknown value.
3839        ///
3840        /// Applications can examine the value using [EncryptionState::value] or
3841        /// [EncryptionState::name].
3842        UnknownValue(encryption_state::UnknownValue),
3843    }
3844
3845    #[doc(hidden)]
3846    pub mod encryption_state {
3847        #[allow(unused_imports)]
3848        use super::*;
3849        #[derive(Clone, Debug, PartialEq)]
3850        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3851    }
3852
3853    impl EncryptionState {
3854        /// Gets the enum value.
3855        ///
3856        /// Returns `None` if the enum contains an unknown value deserialized from
3857        /// the string representation of enums.
3858        pub fn value(&self) -> std::option::Option<i32> {
3859            match self {
3860                Self::Unspecified => std::option::Option::Some(0),
3861                Self::Pending => std::option::Option::Some(1),
3862                Self::Completed => std::option::Option::Some(2),
3863                Self::InProgress => std::option::Option::Some(3),
3864                Self::Failed => std::option::Option::Some(4),
3865                Self::UnknownValue(u) => u.0.value(),
3866            }
3867        }
3868
3869        /// Gets the enum value as a string.
3870        ///
3871        /// Returns `None` if the enum contains an unknown value deserialized from
3872        /// the integer representation of enums.
3873        pub fn name(&self) -> std::option::Option<&str> {
3874            match self {
3875                Self::Unspecified => std::option::Option::Some("ENCRYPTION_STATE_UNSPECIFIED"),
3876                Self::Pending => std::option::Option::Some("ENCRYPTION_STATE_PENDING"),
3877                Self::Completed => std::option::Option::Some("ENCRYPTION_STATE_COMPLETED"),
3878                Self::InProgress => std::option::Option::Some("ENCRYPTION_STATE_IN_PROGRESS"),
3879                Self::Failed => std::option::Option::Some("ENCRYPTION_STATE_FAILED"),
3880                Self::UnknownValue(u) => u.0.name(),
3881            }
3882        }
3883    }
3884
3885    impl std::default::Default for EncryptionState {
3886        fn default() -> Self {
3887            use std::convert::From;
3888            Self::from(0)
3889        }
3890    }
3891
3892    impl std::fmt::Display for EncryptionState {
3893        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3894            wkt::internal::display_enum(f, self.name(), self.value())
3895        }
3896    }
3897
3898    impl std::convert::From<i32> for EncryptionState {
3899        fn from(value: i32) -> Self {
3900            match value {
3901                0 => Self::Unspecified,
3902                1 => Self::Pending,
3903                2 => Self::Completed,
3904                3 => Self::InProgress,
3905                4 => Self::Failed,
3906                _ => Self::UnknownValue(encryption_state::UnknownValue(
3907                    wkt::internal::UnknownEnumValue::Integer(value),
3908                )),
3909            }
3910        }
3911    }
3912
3913    impl std::convert::From<&str> for EncryptionState {
3914        fn from(value: &str) -> Self {
3915            use std::string::ToString;
3916            match value {
3917                "ENCRYPTION_STATE_UNSPECIFIED" => Self::Unspecified,
3918                "ENCRYPTION_STATE_PENDING" => Self::Pending,
3919                "ENCRYPTION_STATE_COMPLETED" => Self::Completed,
3920                "ENCRYPTION_STATE_IN_PROGRESS" => Self::InProgress,
3921                "ENCRYPTION_STATE_FAILED" => Self::Failed,
3922                _ => Self::UnknownValue(encryption_state::UnknownValue(
3923                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3924                )),
3925            }
3926        }
3927    }
3928
3929    impl serde::ser::Serialize for EncryptionState {
3930        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3931        where
3932            S: serde::Serializer,
3933        {
3934            match self {
3935                Self::Unspecified => serializer.serialize_i32(0),
3936                Self::Pending => serializer.serialize_i32(1),
3937                Self::Completed => serializer.serialize_i32(2),
3938                Self::InProgress => serializer.serialize_i32(3),
3939                Self::Failed => serializer.serialize_i32(4),
3940                Self::UnknownValue(u) => u.0.serialize(serializer),
3941            }
3942        }
3943    }
3944
3945    impl<'de> serde::de::Deserialize<'de> for EncryptionState {
3946        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3947        where
3948            D: serde::Deserializer<'de>,
3949        {
3950            deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionState>::new(
3951                ".google.cloud.netapp.v1.BackupVault.EncryptionState",
3952            ))
3953        }
3954    }
3955}
3956
3957/// GetBackupVaultRequest gets the state of a backupVault.
3958#[derive(Clone, Default, PartialEq)]
3959#[non_exhaustive]
3960pub struct GetBackupVaultRequest {
3961    /// Required. The backupVault resource name, in the format
3962    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
3963    pub name: std::string::String,
3964
3965    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3966}
3967
3968impl GetBackupVaultRequest {
3969    pub fn new() -> Self {
3970        std::default::Default::default()
3971    }
3972
3973    /// Sets the value of [name][crate::model::GetBackupVaultRequest::name].
3974    ///
3975    /// # Example
3976    /// ```ignore,no_run
3977    /// # use google_cloud_netapp_v1::model::GetBackupVaultRequest;
3978    /// let x = GetBackupVaultRequest::new().set_name("example");
3979    /// ```
3980    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3981        self.name = v.into();
3982        self
3983    }
3984}
3985
3986impl wkt::message::Message for GetBackupVaultRequest {
3987    fn typename() -> &'static str {
3988        "type.googleapis.com/google.cloud.netapp.v1.GetBackupVaultRequest"
3989    }
3990}
3991
3992/// ListBackupVaultsRequest lists backupVaults.
3993#[derive(Clone, Default, PartialEq)]
3994#[non_exhaustive]
3995pub struct ListBackupVaultsRequest {
3996    /// Required. The location for which to retrieve backupVault information,
3997    /// in the format
3998    /// `projects/{project_id}/locations/{location}`.
3999    pub parent: std::string::String,
4000
4001    /// The maximum number of items to return.
4002    pub page_size: i32,
4003
4004    /// The next_page_token value to use if there are additional
4005    /// results to retrieve for this list request.
4006    pub page_token: std::string::String,
4007
4008    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
4009    pub order_by: std::string::String,
4010
4011    /// List filter.
4012    pub filter: std::string::String,
4013
4014    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4015}
4016
4017impl ListBackupVaultsRequest {
4018    pub fn new() -> Self {
4019        std::default::Default::default()
4020    }
4021
4022    /// Sets the value of [parent][crate::model::ListBackupVaultsRequest::parent].
4023    ///
4024    /// # Example
4025    /// ```ignore,no_run
4026    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4027    /// let x = ListBackupVaultsRequest::new().set_parent("example");
4028    /// ```
4029    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4030        self.parent = v.into();
4031        self
4032    }
4033
4034    /// Sets the value of [page_size][crate::model::ListBackupVaultsRequest::page_size].
4035    ///
4036    /// # Example
4037    /// ```ignore,no_run
4038    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4039    /// let x = ListBackupVaultsRequest::new().set_page_size(42);
4040    /// ```
4041    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4042        self.page_size = v.into();
4043        self
4044    }
4045
4046    /// Sets the value of [page_token][crate::model::ListBackupVaultsRequest::page_token].
4047    ///
4048    /// # Example
4049    /// ```ignore,no_run
4050    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4051    /// let x = ListBackupVaultsRequest::new().set_page_token("example");
4052    /// ```
4053    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4054        self.page_token = v.into();
4055        self
4056    }
4057
4058    /// Sets the value of [order_by][crate::model::ListBackupVaultsRequest::order_by].
4059    ///
4060    /// # Example
4061    /// ```ignore,no_run
4062    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4063    /// let x = ListBackupVaultsRequest::new().set_order_by("example");
4064    /// ```
4065    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4066        self.order_by = v.into();
4067        self
4068    }
4069
4070    /// Sets the value of [filter][crate::model::ListBackupVaultsRequest::filter].
4071    ///
4072    /// # Example
4073    /// ```ignore,no_run
4074    /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
4075    /// let x = ListBackupVaultsRequest::new().set_filter("example");
4076    /// ```
4077    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4078        self.filter = v.into();
4079        self
4080    }
4081}
4082
4083impl wkt::message::Message for ListBackupVaultsRequest {
4084    fn typename() -> &'static str {
4085        "type.googleapis.com/google.cloud.netapp.v1.ListBackupVaultsRequest"
4086    }
4087}
4088
4089/// ListBackupVaultsResponse is the result of ListBackupVaultsRequest.
4090#[derive(Clone, Default, PartialEq)]
4091#[non_exhaustive]
4092pub struct ListBackupVaultsResponse {
4093    /// A list of backupVaults in the project for the specified location.
4094    pub backup_vaults: std::vec::Vec<crate::model::BackupVault>,
4095
4096    /// The token you can use to retrieve the next page of results. Not returned
4097    /// if there are no more results in the list.
4098    pub next_page_token: std::string::String,
4099
4100    /// Locations that could not be reached.
4101    pub unreachable: std::vec::Vec<std::string::String>,
4102
4103    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4104}
4105
4106impl ListBackupVaultsResponse {
4107    pub fn new() -> Self {
4108        std::default::Default::default()
4109    }
4110
4111    /// Sets the value of [backup_vaults][crate::model::ListBackupVaultsResponse::backup_vaults].
4112    ///
4113    /// # Example
4114    /// ```ignore,no_run
4115    /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
4116    /// use google_cloud_netapp_v1::model::BackupVault;
4117    /// let x = ListBackupVaultsResponse::new()
4118    ///     .set_backup_vaults([
4119    ///         BackupVault::default()/* use setters */,
4120    ///         BackupVault::default()/* use (different) setters */,
4121    ///     ]);
4122    /// ```
4123    pub fn set_backup_vaults<T, V>(mut self, v: T) -> Self
4124    where
4125        T: std::iter::IntoIterator<Item = V>,
4126        V: std::convert::Into<crate::model::BackupVault>,
4127    {
4128        use std::iter::Iterator;
4129        self.backup_vaults = v.into_iter().map(|i| i.into()).collect();
4130        self
4131    }
4132
4133    /// Sets the value of [next_page_token][crate::model::ListBackupVaultsResponse::next_page_token].
4134    ///
4135    /// # Example
4136    /// ```ignore,no_run
4137    /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
4138    /// let x = ListBackupVaultsResponse::new().set_next_page_token("example");
4139    /// ```
4140    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4141        self.next_page_token = v.into();
4142        self
4143    }
4144
4145    /// Sets the value of [unreachable][crate::model::ListBackupVaultsResponse::unreachable].
4146    ///
4147    /// # Example
4148    /// ```ignore,no_run
4149    /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
4150    /// let x = ListBackupVaultsResponse::new().set_unreachable(["a", "b", "c"]);
4151    /// ```
4152    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4153    where
4154        T: std::iter::IntoIterator<Item = V>,
4155        V: std::convert::Into<std::string::String>,
4156    {
4157        use std::iter::Iterator;
4158        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4159        self
4160    }
4161}
4162
4163impl wkt::message::Message for ListBackupVaultsResponse {
4164    fn typename() -> &'static str {
4165        "type.googleapis.com/google.cloud.netapp.v1.ListBackupVaultsResponse"
4166    }
4167}
4168
4169#[doc(hidden)]
4170impl google_cloud_gax::paginator::internal::PageableResponse for ListBackupVaultsResponse {
4171    type PageItem = crate::model::BackupVault;
4172
4173    fn items(self) -> std::vec::Vec<Self::PageItem> {
4174        self.backup_vaults
4175    }
4176
4177    fn next_page_token(&self) -> std::string::String {
4178        use std::clone::Clone;
4179        self.next_page_token.clone()
4180    }
4181}
4182
4183/// CreateBackupVaultRequest creates a backup vault.
4184#[derive(Clone, Default, PartialEq)]
4185#[non_exhaustive]
4186pub struct CreateBackupVaultRequest {
4187    /// Required. The location to create the backup vaults, in the format
4188    /// `projects/{project_id}/locations/{location}`
4189    pub parent: std::string::String,
4190
4191    /// Required. The ID to use for the backupVault.
4192    /// The ID must be unique within the specified location.
4193    /// Must contain only letters, numbers and hyphen, with the first
4194    /// character a letter, the last a letter or a
4195    /// number, and a 63 character maximum.
4196    pub backup_vault_id: std::string::String,
4197
4198    /// Required. A backupVault resource
4199    pub backup_vault: std::option::Option<crate::model::BackupVault>,
4200
4201    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4202}
4203
4204impl CreateBackupVaultRequest {
4205    pub fn new() -> Self {
4206        std::default::Default::default()
4207    }
4208
4209    /// Sets the value of [parent][crate::model::CreateBackupVaultRequest::parent].
4210    ///
4211    /// # Example
4212    /// ```ignore,no_run
4213    /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4214    /// let x = CreateBackupVaultRequest::new().set_parent("example");
4215    /// ```
4216    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4217        self.parent = v.into();
4218        self
4219    }
4220
4221    /// Sets the value of [backup_vault_id][crate::model::CreateBackupVaultRequest::backup_vault_id].
4222    ///
4223    /// # Example
4224    /// ```ignore,no_run
4225    /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4226    /// let x = CreateBackupVaultRequest::new().set_backup_vault_id("example");
4227    /// ```
4228    pub fn set_backup_vault_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4229        self.backup_vault_id = v.into();
4230        self
4231    }
4232
4233    /// Sets the value of [backup_vault][crate::model::CreateBackupVaultRequest::backup_vault].
4234    ///
4235    /// # Example
4236    /// ```ignore,no_run
4237    /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4238    /// use google_cloud_netapp_v1::model::BackupVault;
4239    /// let x = CreateBackupVaultRequest::new().set_backup_vault(BackupVault::default()/* use setters */);
4240    /// ```
4241    pub fn set_backup_vault<T>(mut self, v: T) -> Self
4242    where
4243        T: std::convert::Into<crate::model::BackupVault>,
4244    {
4245        self.backup_vault = std::option::Option::Some(v.into());
4246        self
4247    }
4248
4249    /// Sets or clears the value of [backup_vault][crate::model::CreateBackupVaultRequest::backup_vault].
4250    ///
4251    /// # Example
4252    /// ```ignore,no_run
4253    /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4254    /// use google_cloud_netapp_v1::model::BackupVault;
4255    /// let x = CreateBackupVaultRequest::new().set_or_clear_backup_vault(Some(BackupVault::default()/* use setters */));
4256    /// let x = CreateBackupVaultRequest::new().set_or_clear_backup_vault(None::<BackupVault>);
4257    /// ```
4258    pub fn set_or_clear_backup_vault<T>(mut self, v: std::option::Option<T>) -> Self
4259    where
4260        T: std::convert::Into<crate::model::BackupVault>,
4261    {
4262        self.backup_vault = v.map(|x| x.into());
4263        self
4264    }
4265}
4266
4267impl wkt::message::Message for CreateBackupVaultRequest {
4268    fn typename() -> &'static str {
4269        "type.googleapis.com/google.cloud.netapp.v1.CreateBackupVaultRequest"
4270    }
4271}
4272
4273/// DeleteBackupVaultRequest deletes a backupVault.
4274#[derive(Clone, Default, PartialEq)]
4275#[non_exhaustive]
4276pub struct DeleteBackupVaultRequest {
4277    /// Required. The backupVault resource name, in the format
4278    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
4279    pub name: std::string::String,
4280
4281    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4282}
4283
4284impl DeleteBackupVaultRequest {
4285    pub fn new() -> Self {
4286        std::default::Default::default()
4287    }
4288
4289    /// Sets the value of [name][crate::model::DeleteBackupVaultRequest::name].
4290    ///
4291    /// # Example
4292    /// ```ignore,no_run
4293    /// # use google_cloud_netapp_v1::model::DeleteBackupVaultRequest;
4294    /// let x = DeleteBackupVaultRequest::new().set_name("example");
4295    /// ```
4296    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4297        self.name = v.into();
4298        self
4299    }
4300}
4301
4302impl wkt::message::Message for DeleteBackupVaultRequest {
4303    fn typename() -> &'static str {
4304        "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupVaultRequest"
4305    }
4306}
4307
4308/// UpdateBackupVaultRequest updates description and/or labels for a backupVault.
4309#[derive(Clone, Default, PartialEq)]
4310#[non_exhaustive]
4311pub struct UpdateBackupVaultRequest {
4312    /// Required. Field mask is used to specify the fields to be overwritten in the
4313    /// Backup resource to be updated.
4314    /// The fields specified in the update_mask are relative to the resource, not
4315    /// the full request. A field will be overwritten if it is in the mask. If the
4316    /// user does not provide a mask then all fields will be overwritten.
4317    pub update_mask: std::option::Option<wkt::FieldMask>,
4318
4319    /// Required. The backupVault being updated
4320    pub backup_vault: std::option::Option<crate::model::BackupVault>,
4321
4322    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4323}
4324
4325impl UpdateBackupVaultRequest {
4326    pub fn new() -> Self {
4327        std::default::Default::default()
4328    }
4329
4330    /// Sets the value of [update_mask][crate::model::UpdateBackupVaultRequest::update_mask].
4331    ///
4332    /// # Example
4333    /// ```ignore,no_run
4334    /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4335    /// use wkt::FieldMask;
4336    /// let x = UpdateBackupVaultRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4337    /// ```
4338    pub fn set_update_mask<T>(mut self, v: T) -> Self
4339    where
4340        T: std::convert::Into<wkt::FieldMask>,
4341    {
4342        self.update_mask = std::option::Option::Some(v.into());
4343        self
4344    }
4345
4346    /// Sets or clears the value of [update_mask][crate::model::UpdateBackupVaultRequest::update_mask].
4347    ///
4348    /// # Example
4349    /// ```ignore,no_run
4350    /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4351    /// use wkt::FieldMask;
4352    /// let x = UpdateBackupVaultRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4353    /// let x = UpdateBackupVaultRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4354    /// ```
4355    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4356    where
4357        T: std::convert::Into<wkt::FieldMask>,
4358    {
4359        self.update_mask = v.map(|x| x.into());
4360        self
4361    }
4362
4363    /// Sets the value of [backup_vault][crate::model::UpdateBackupVaultRequest::backup_vault].
4364    ///
4365    /// # Example
4366    /// ```ignore,no_run
4367    /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4368    /// use google_cloud_netapp_v1::model::BackupVault;
4369    /// let x = UpdateBackupVaultRequest::new().set_backup_vault(BackupVault::default()/* use setters */);
4370    /// ```
4371    pub fn set_backup_vault<T>(mut self, v: T) -> Self
4372    where
4373        T: std::convert::Into<crate::model::BackupVault>,
4374    {
4375        self.backup_vault = std::option::Option::Some(v.into());
4376        self
4377    }
4378
4379    /// Sets or clears the value of [backup_vault][crate::model::UpdateBackupVaultRequest::backup_vault].
4380    ///
4381    /// # Example
4382    /// ```ignore,no_run
4383    /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4384    /// use google_cloud_netapp_v1::model::BackupVault;
4385    /// let x = UpdateBackupVaultRequest::new().set_or_clear_backup_vault(Some(BackupVault::default()/* use setters */));
4386    /// let x = UpdateBackupVaultRequest::new().set_or_clear_backup_vault(None::<BackupVault>);
4387    /// ```
4388    pub fn set_or_clear_backup_vault<T>(mut self, v: std::option::Option<T>) -> Self
4389    where
4390        T: std::convert::Into<crate::model::BackupVault>,
4391    {
4392        self.backup_vault = v.map(|x| x.into());
4393        self
4394    }
4395}
4396
4397impl wkt::message::Message for UpdateBackupVaultRequest {
4398    fn typename() -> &'static str {
4399        "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupVaultRequest"
4400    }
4401}
4402
4403/// Represents the metadata of the long-running operation.
4404#[derive(Clone, Default, PartialEq)]
4405#[non_exhaustive]
4406pub struct OperationMetadata {
4407    /// Output only. The time the operation was created.
4408    pub create_time: std::option::Option<wkt::Timestamp>,
4409
4410    /// Output only. The time the operation finished running.
4411    pub end_time: std::option::Option<wkt::Timestamp>,
4412
4413    /// Output only. Server-defined resource path for the target of the operation.
4414    pub target: std::string::String,
4415
4416    /// Output only. Name of the verb executed by the operation.
4417    pub verb: std::string::String,
4418
4419    /// Output only. Human-readable status of the operation, if any.
4420    pub status_message: std::string::String,
4421
4422    /// Output only. Identifies whether the user has requested cancellation
4423    /// of the operation. Operations that have been canceled successfully
4424    /// have [Operation.error][] value with a
4425    /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
4426    /// `Code.CANCELLED`.
4427    ///
4428    /// [google.rpc.Status.code]: google_cloud_rpc::model::Status::code
4429    pub requested_cancellation: bool,
4430
4431    /// Output only. API version used to start the operation.
4432    pub api_version: std::string::String,
4433
4434    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4435}
4436
4437impl OperationMetadata {
4438    pub fn new() -> Self {
4439        std::default::Default::default()
4440    }
4441
4442    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
4443    ///
4444    /// # Example
4445    /// ```ignore,no_run
4446    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4447    /// use wkt::Timestamp;
4448    /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
4449    /// ```
4450    pub fn set_create_time<T>(mut self, v: T) -> Self
4451    where
4452        T: std::convert::Into<wkt::Timestamp>,
4453    {
4454        self.create_time = std::option::Option::Some(v.into());
4455        self
4456    }
4457
4458    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
4459    ///
4460    /// # Example
4461    /// ```ignore,no_run
4462    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4463    /// use wkt::Timestamp;
4464    /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4465    /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
4466    /// ```
4467    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4468    where
4469        T: std::convert::Into<wkt::Timestamp>,
4470    {
4471        self.create_time = v.map(|x| x.into());
4472        self
4473    }
4474
4475    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
4476    ///
4477    /// # Example
4478    /// ```ignore,no_run
4479    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4480    /// use wkt::Timestamp;
4481    /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
4482    /// ```
4483    pub fn set_end_time<T>(mut self, v: T) -> Self
4484    where
4485        T: std::convert::Into<wkt::Timestamp>,
4486    {
4487        self.end_time = std::option::Option::Some(v.into());
4488        self
4489    }
4490
4491    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
4492    ///
4493    /// # Example
4494    /// ```ignore,no_run
4495    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4496    /// use wkt::Timestamp;
4497    /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
4498    /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
4499    /// ```
4500    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4501    where
4502        T: std::convert::Into<wkt::Timestamp>,
4503    {
4504        self.end_time = v.map(|x| x.into());
4505        self
4506    }
4507
4508    /// Sets the value of [target][crate::model::OperationMetadata::target].
4509    ///
4510    /// # Example
4511    /// ```ignore,no_run
4512    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4513    /// let x = OperationMetadata::new().set_target("example");
4514    /// ```
4515    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4516        self.target = v.into();
4517        self
4518    }
4519
4520    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
4521    ///
4522    /// # Example
4523    /// ```ignore,no_run
4524    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4525    /// let x = OperationMetadata::new().set_verb("example");
4526    /// ```
4527    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4528        self.verb = v.into();
4529        self
4530    }
4531
4532    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
4533    ///
4534    /// # Example
4535    /// ```ignore,no_run
4536    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4537    /// let x = OperationMetadata::new().set_status_message("example");
4538    /// ```
4539    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4540        self.status_message = v.into();
4541        self
4542    }
4543
4544    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
4545    ///
4546    /// # Example
4547    /// ```ignore,no_run
4548    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4549    /// let x = OperationMetadata::new().set_requested_cancellation(true);
4550    /// ```
4551    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4552        self.requested_cancellation = v.into();
4553        self
4554    }
4555
4556    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
4557    ///
4558    /// # Example
4559    /// ```ignore,no_run
4560    /// # use google_cloud_netapp_v1::model::OperationMetadata;
4561    /// let x = OperationMetadata::new().set_api_version("example");
4562    /// ```
4563    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4564        self.api_version = v.into();
4565        self
4566    }
4567}
4568
4569impl wkt::message::Message for OperationMetadata {
4570    fn typename() -> &'static str {
4571        "type.googleapis.com/google.cloud.netapp.v1.OperationMetadata"
4572    }
4573}
4574
4575/// Metadata for a given
4576/// [google.cloud.location.Location][google.cloud.location.Location].
4577///
4578/// [google.cloud.location.Location]: google_cloud_location::model::Location
4579#[derive(Clone, Default, PartialEq)]
4580#[non_exhaustive]
4581pub struct LocationMetadata {
4582    /// Output only. Supported service levels in a location.
4583    pub supported_service_levels: std::vec::Vec<crate::model::ServiceLevel>,
4584
4585    /// Output only. Supported flex performance in a location.
4586    pub supported_flex_performance: std::vec::Vec<crate::model::FlexPerformance>,
4587
4588    /// Output only. Indicates if the location has VCP support.
4589    pub has_vcp: bool,
4590
4591    /// Output only. Indicates if the location has ONTAP Proxy support.
4592    pub has_ontap_proxy: bool,
4593
4594    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4595}
4596
4597impl LocationMetadata {
4598    pub fn new() -> Self {
4599        std::default::Default::default()
4600    }
4601
4602    /// Sets the value of [supported_service_levels][crate::model::LocationMetadata::supported_service_levels].
4603    ///
4604    /// # Example
4605    /// ```ignore,no_run
4606    /// # use google_cloud_netapp_v1::model::LocationMetadata;
4607    /// use google_cloud_netapp_v1::model::ServiceLevel;
4608    /// let x = LocationMetadata::new().set_supported_service_levels([
4609    ///     ServiceLevel::Premium,
4610    ///     ServiceLevel::Extreme,
4611    ///     ServiceLevel::Standard,
4612    /// ]);
4613    /// ```
4614    pub fn set_supported_service_levels<T, V>(mut self, v: T) -> Self
4615    where
4616        T: std::iter::IntoIterator<Item = V>,
4617        V: std::convert::Into<crate::model::ServiceLevel>,
4618    {
4619        use std::iter::Iterator;
4620        self.supported_service_levels = v.into_iter().map(|i| i.into()).collect();
4621        self
4622    }
4623
4624    /// Sets the value of [supported_flex_performance][crate::model::LocationMetadata::supported_flex_performance].
4625    ///
4626    /// # Example
4627    /// ```ignore,no_run
4628    /// # use google_cloud_netapp_v1::model::LocationMetadata;
4629    /// use google_cloud_netapp_v1::model::FlexPerformance;
4630    /// let x = LocationMetadata::new().set_supported_flex_performance([
4631    ///     FlexPerformance::Default,
4632    ///     FlexPerformance::Custom,
4633    /// ]);
4634    /// ```
4635    pub fn set_supported_flex_performance<T, V>(mut self, v: T) -> Self
4636    where
4637        T: std::iter::IntoIterator<Item = V>,
4638        V: std::convert::Into<crate::model::FlexPerformance>,
4639    {
4640        use std::iter::Iterator;
4641        self.supported_flex_performance = v.into_iter().map(|i| i.into()).collect();
4642        self
4643    }
4644
4645    /// Sets the value of [has_vcp][crate::model::LocationMetadata::has_vcp].
4646    ///
4647    /// # Example
4648    /// ```ignore,no_run
4649    /// # use google_cloud_netapp_v1::model::LocationMetadata;
4650    /// let x = LocationMetadata::new().set_has_vcp(true);
4651    /// ```
4652    pub fn set_has_vcp<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4653        self.has_vcp = v.into();
4654        self
4655    }
4656
4657    /// Sets the value of [has_ontap_proxy][crate::model::LocationMetadata::has_ontap_proxy].
4658    ///
4659    /// # Example
4660    /// ```ignore,no_run
4661    /// # use google_cloud_netapp_v1::model::LocationMetadata;
4662    /// let x = LocationMetadata::new().set_has_ontap_proxy(true);
4663    /// ```
4664    pub fn set_has_ontap_proxy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4665        self.has_ontap_proxy = v.into();
4666        self
4667    }
4668}
4669
4670impl wkt::message::Message for LocationMetadata {
4671    fn typename() -> &'static str {
4672        "type.googleapis.com/google.cloud.netapp.v1.LocationMetadata"
4673    }
4674}
4675
4676/// UserCommands contains the commands to be executed by the customer.
4677#[derive(Clone, Default, PartialEq)]
4678#[non_exhaustive]
4679pub struct UserCommands {
4680    /// Output only. List of commands to be executed by the customer.
4681    pub commands: std::vec::Vec<std::string::String>,
4682
4683    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4684}
4685
4686impl UserCommands {
4687    pub fn new() -> Self {
4688        std::default::Default::default()
4689    }
4690
4691    /// Sets the value of [commands][crate::model::UserCommands::commands].
4692    ///
4693    /// # Example
4694    /// ```ignore,no_run
4695    /// # use google_cloud_netapp_v1::model::UserCommands;
4696    /// let x = UserCommands::new().set_commands(["a", "b", "c"]);
4697    /// ```
4698    pub fn set_commands<T, V>(mut self, v: T) -> Self
4699    where
4700        T: std::iter::IntoIterator<Item = V>,
4701        V: std::convert::Into<std::string::String>,
4702    {
4703        use std::iter::Iterator;
4704        self.commands = v.into_iter().map(|i| i.into()).collect();
4705        self
4706    }
4707}
4708
4709impl wkt::message::Message for UserCommands {
4710    fn typename() -> &'static str {
4711        "type.googleapis.com/google.cloud.netapp.v1.UserCommands"
4712    }
4713}
4714
4715/// ListHostGroupsRequest for listing host groups.
4716#[derive(Clone, Default, PartialEq)]
4717#[non_exhaustive]
4718pub struct ListHostGroupsRequest {
4719    /// Required. Parent value for ListHostGroupsRequest
4720    pub parent: std::string::String,
4721
4722    /// Optional. Requested page size. Server may return fewer items than
4723    /// requested. If unspecified, the server will pick an appropriate default.
4724    pub page_size: i32,
4725
4726    /// Optional. A token identifying a page of results the server should return.
4727    pub page_token: std::string::String,
4728
4729    /// Optional. Filter to apply to the request.
4730    pub filter: std::string::String,
4731
4732    /// Optional. Hint for how to order the results
4733    pub order_by: std::string::String,
4734
4735    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4736}
4737
4738impl ListHostGroupsRequest {
4739    pub fn new() -> Self {
4740        std::default::Default::default()
4741    }
4742
4743    /// Sets the value of [parent][crate::model::ListHostGroupsRequest::parent].
4744    ///
4745    /// # Example
4746    /// ```ignore,no_run
4747    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4748    /// let x = ListHostGroupsRequest::new().set_parent("example");
4749    /// ```
4750    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4751        self.parent = v.into();
4752        self
4753    }
4754
4755    /// Sets the value of [page_size][crate::model::ListHostGroupsRequest::page_size].
4756    ///
4757    /// # Example
4758    /// ```ignore,no_run
4759    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4760    /// let x = ListHostGroupsRequest::new().set_page_size(42);
4761    /// ```
4762    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4763        self.page_size = v.into();
4764        self
4765    }
4766
4767    /// Sets the value of [page_token][crate::model::ListHostGroupsRequest::page_token].
4768    ///
4769    /// # Example
4770    /// ```ignore,no_run
4771    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4772    /// let x = ListHostGroupsRequest::new().set_page_token("example");
4773    /// ```
4774    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4775        self.page_token = v.into();
4776        self
4777    }
4778
4779    /// Sets the value of [filter][crate::model::ListHostGroupsRequest::filter].
4780    ///
4781    /// # Example
4782    /// ```ignore,no_run
4783    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4784    /// let x = ListHostGroupsRequest::new().set_filter("example");
4785    /// ```
4786    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4787        self.filter = v.into();
4788        self
4789    }
4790
4791    /// Sets the value of [order_by][crate::model::ListHostGroupsRequest::order_by].
4792    ///
4793    /// # Example
4794    /// ```ignore,no_run
4795    /// # use google_cloud_netapp_v1::model::ListHostGroupsRequest;
4796    /// let x = ListHostGroupsRequest::new().set_order_by("example");
4797    /// ```
4798    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4799        self.order_by = v.into();
4800        self
4801    }
4802}
4803
4804impl wkt::message::Message for ListHostGroupsRequest {
4805    fn typename() -> &'static str {
4806        "type.googleapis.com/google.cloud.netapp.v1.ListHostGroupsRequest"
4807    }
4808}
4809
4810/// ListHostGroupsResponse is the response to a ListHostGroupsRequest.
4811#[derive(Clone, Default, PartialEq)]
4812#[non_exhaustive]
4813pub struct ListHostGroupsResponse {
4814    /// The list of host groups.
4815    pub host_groups: std::vec::Vec<crate::model::HostGroup>,
4816
4817    /// A token identifying a page of results the server should return.
4818    pub next_page_token: std::string::String,
4819
4820    /// Locations that could not be reached.
4821    pub unreachable: std::vec::Vec<std::string::String>,
4822
4823    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4824}
4825
4826impl ListHostGroupsResponse {
4827    pub fn new() -> Self {
4828        std::default::Default::default()
4829    }
4830
4831    /// Sets the value of [host_groups][crate::model::ListHostGroupsResponse::host_groups].
4832    ///
4833    /// # Example
4834    /// ```ignore,no_run
4835    /// # use google_cloud_netapp_v1::model::ListHostGroupsResponse;
4836    /// use google_cloud_netapp_v1::model::HostGroup;
4837    /// let x = ListHostGroupsResponse::new()
4838    ///     .set_host_groups([
4839    ///         HostGroup::default()/* use setters */,
4840    ///         HostGroup::default()/* use (different) setters */,
4841    ///     ]);
4842    /// ```
4843    pub fn set_host_groups<T, V>(mut self, v: T) -> Self
4844    where
4845        T: std::iter::IntoIterator<Item = V>,
4846        V: std::convert::Into<crate::model::HostGroup>,
4847    {
4848        use std::iter::Iterator;
4849        self.host_groups = v.into_iter().map(|i| i.into()).collect();
4850        self
4851    }
4852
4853    /// Sets the value of [next_page_token][crate::model::ListHostGroupsResponse::next_page_token].
4854    ///
4855    /// # Example
4856    /// ```ignore,no_run
4857    /// # use google_cloud_netapp_v1::model::ListHostGroupsResponse;
4858    /// let x = ListHostGroupsResponse::new().set_next_page_token("example");
4859    /// ```
4860    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4861        self.next_page_token = v.into();
4862        self
4863    }
4864
4865    /// Sets the value of [unreachable][crate::model::ListHostGroupsResponse::unreachable].
4866    ///
4867    /// # Example
4868    /// ```ignore,no_run
4869    /// # use google_cloud_netapp_v1::model::ListHostGroupsResponse;
4870    /// let x = ListHostGroupsResponse::new().set_unreachable(["a", "b", "c"]);
4871    /// ```
4872    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4873    where
4874        T: std::iter::IntoIterator<Item = V>,
4875        V: std::convert::Into<std::string::String>,
4876    {
4877        use std::iter::Iterator;
4878        self.unreachable = v.into_iter().map(|i| i.into()).collect();
4879        self
4880    }
4881}
4882
4883impl wkt::message::Message for ListHostGroupsResponse {
4884    fn typename() -> &'static str {
4885        "type.googleapis.com/google.cloud.netapp.v1.ListHostGroupsResponse"
4886    }
4887}
4888
4889#[doc(hidden)]
4890impl google_cloud_gax::paginator::internal::PageableResponse for ListHostGroupsResponse {
4891    type PageItem = crate::model::HostGroup;
4892
4893    fn items(self) -> std::vec::Vec<Self::PageItem> {
4894        self.host_groups
4895    }
4896
4897    fn next_page_token(&self) -> std::string::String {
4898        use std::clone::Clone;
4899        self.next_page_token.clone()
4900    }
4901}
4902
4903/// GetHostGroupRequest for getting a host group.
4904#[derive(Clone, Default, PartialEq)]
4905#[non_exhaustive]
4906pub struct GetHostGroupRequest {
4907    /// Required. The resource name of the host group.
4908    /// Format:
4909    /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
4910    pub name: std::string::String,
4911
4912    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4913}
4914
4915impl GetHostGroupRequest {
4916    pub fn new() -> Self {
4917        std::default::Default::default()
4918    }
4919
4920    /// Sets the value of [name][crate::model::GetHostGroupRequest::name].
4921    ///
4922    /// # Example
4923    /// ```ignore,no_run
4924    /// # use google_cloud_netapp_v1::model::GetHostGroupRequest;
4925    /// let x = GetHostGroupRequest::new().set_name("example");
4926    /// ```
4927    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4928        self.name = v.into();
4929        self
4930    }
4931}
4932
4933impl wkt::message::Message for GetHostGroupRequest {
4934    fn typename() -> &'static str {
4935        "type.googleapis.com/google.cloud.netapp.v1.GetHostGroupRequest"
4936    }
4937}
4938
4939/// CreateHostGroupRequest for creating a host group.
4940#[derive(Clone, Default, PartialEq)]
4941#[non_exhaustive]
4942pub struct CreateHostGroupRequest {
4943    /// Required. Parent value for CreateHostGroupRequest
4944    pub parent: std::string::String,
4945
4946    /// Required. Fields of the host group to create.
4947    pub host_group: std::option::Option<crate::model::HostGroup>,
4948
4949    /// Required. ID of the host group to create. Must be unique within the parent
4950    /// resource. Must contain only letters, numbers, and hyphen, with
4951    /// the first character a letter or underscore, the last a letter or underscore
4952    /// or a number, and a 63 character maximum.
4953    pub host_group_id: std::string::String,
4954
4955    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4956}
4957
4958impl CreateHostGroupRequest {
4959    pub fn new() -> Self {
4960        std::default::Default::default()
4961    }
4962
4963    /// Sets the value of [parent][crate::model::CreateHostGroupRequest::parent].
4964    ///
4965    /// # Example
4966    /// ```ignore,no_run
4967    /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
4968    /// let x = CreateHostGroupRequest::new().set_parent("example");
4969    /// ```
4970    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4971        self.parent = v.into();
4972        self
4973    }
4974
4975    /// Sets the value of [host_group][crate::model::CreateHostGroupRequest::host_group].
4976    ///
4977    /// # Example
4978    /// ```ignore,no_run
4979    /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
4980    /// use google_cloud_netapp_v1::model::HostGroup;
4981    /// let x = CreateHostGroupRequest::new().set_host_group(HostGroup::default()/* use setters */);
4982    /// ```
4983    pub fn set_host_group<T>(mut self, v: T) -> Self
4984    where
4985        T: std::convert::Into<crate::model::HostGroup>,
4986    {
4987        self.host_group = std::option::Option::Some(v.into());
4988        self
4989    }
4990
4991    /// Sets or clears the value of [host_group][crate::model::CreateHostGroupRequest::host_group].
4992    ///
4993    /// # Example
4994    /// ```ignore,no_run
4995    /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
4996    /// use google_cloud_netapp_v1::model::HostGroup;
4997    /// let x = CreateHostGroupRequest::new().set_or_clear_host_group(Some(HostGroup::default()/* use setters */));
4998    /// let x = CreateHostGroupRequest::new().set_or_clear_host_group(None::<HostGroup>);
4999    /// ```
5000    pub fn set_or_clear_host_group<T>(mut self, v: std::option::Option<T>) -> Self
5001    where
5002        T: std::convert::Into<crate::model::HostGroup>,
5003    {
5004        self.host_group = v.map(|x| x.into());
5005        self
5006    }
5007
5008    /// Sets the value of [host_group_id][crate::model::CreateHostGroupRequest::host_group_id].
5009    ///
5010    /// # Example
5011    /// ```ignore,no_run
5012    /// # use google_cloud_netapp_v1::model::CreateHostGroupRequest;
5013    /// let x = CreateHostGroupRequest::new().set_host_group_id("example");
5014    /// ```
5015    pub fn set_host_group_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5016        self.host_group_id = v.into();
5017        self
5018    }
5019}
5020
5021impl wkt::message::Message for CreateHostGroupRequest {
5022    fn typename() -> &'static str {
5023        "type.googleapis.com/google.cloud.netapp.v1.CreateHostGroupRequest"
5024    }
5025}
5026
5027/// UpdateHostGroupRequest for updating a host group.
5028#[derive(Clone, Default, PartialEq)]
5029#[non_exhaustive]
5030pub struct UpdateHostGroupRequest {
5031    /// Required. The host group to update.
5032    /// The host group's `name` field is used to identify the host group.
5033    /// Format:
5034    /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5035    pub host_group: std::option::Option<crate::model::HostGroup>,
5036
5037    /// Optional. The list of fields to update.
5038    pub update_mask: std::option::Option<wkt::FieldMask>,
5039
5040    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5041}
5042
5043impl UpdateHostGroupRequest {
5044    pub fn new() -> Self {
5045        std::default::Default::default()
5046    }
5047
5048    /// Sets the value of [host_group][crate::model::UpdateHostGroupRequest::host_group].
5049    ///
5050    /// # Example
5051    /// ```ignore,no_run
5052    /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5053    /// use google_cloud_netapp_v1::model::HostGroup;
5054    /// let x = UpdateHostGroupRequest::new().set_host_group(HostGroup::default()/* use setters */);
5055    /// ```
5056    pub fn set_host_group<T>(mut self, v: T) -> Self
5057    where
5058        T: std::convert::Into<crate::model::HostGroup>,
5059    {
5060        self.host_group = std::option::Option::Some(v.into());
5061        self
5062    }
5063
5064    /// Sets or clears the value of [host_group][crate::model::UpdateHostGroupRequest::host_group].
5065    ///
5066    /// # Example
5067    /// ```ignore,no_run
5068    /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5069    /// use google_cloud_netapp_v1::model::HostGroup;
5070    /// let x = UpdateHostGroupRequest::new().set_or_clear_host_group(Some(HostGroup::default()/* use setters */));
5071    /// let x = UpdateHostGroupRequest::new().set_or_clear_host_group(None::<HostGroup>);
5072    /// ```
5073    pub fn set_or_clear_host_group<T>(mut self, v: std::option::Option<T>) -> Self
5074    where
5075        T: std::convert::Into<crate::model::HostGroup>,
5076    {
5077        self.host_group = v.map(|x| x.into());
5078        self
5079    }
5080
5081    /// Sets the value of [update_mask][crate::model::UpdateHostGroupRequest::update_mask].
5082    ///
5083    /// # Example
5084    /// ```ignore,no_run
5085    /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5086    /// use wkt::FieldMask;
5087    /// let x = UpdateHostGroupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5088    /// ```
5089    pub fn set_update_mask<T>(mut self, v: T) -> Self
5090    where
5091        T: std::convert::Into<wkt::FieldMask>,
5092    {
5093        self.update_mask = std::option::Option::Some(v.into());
5094        self
5095    }
5096
5097    /// Sets or clears the value of [update_mask][crate::model::UpdateHostGroupRequest::update_mask].
5098    ///
5099    /// # Example
5100    /// ```ignore,no_run
5101    /// # use google_cloud_netapp_v1::model::UpdateHostGroupRequest;
5102    /// use wkt::FieldMask;
5103    /// let x = UpdateHostGroupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5104    /// let x = UpdateHostGroupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5105    /// ```
5106    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5107    where
5108        T: std::convert::Into<wkt::FieldMask>,
5109    {
5110        self.update_mask = v.map(|x| x.into());
5111        self
5112    }
5113}
5114
5115impl wkt::message::Message for UpdateHostGroupRequest {
5116    fn typename() -> &'static str {
5117        "type.googleapis.com/google.cloud.netapp.v1.UpdateHostGroupRequest"
5118    }
5119}
5120
5121/// DeleteHostGroupRequest for deleting a single host group.
5122#[derive(Clone, Default, PartialEq)]
5123#[non_exhaustive]
5124pub struct DeleteHostGroupRequest {
5125    /// Required. The resource name of the host group.
5126    /// Format:
5127    /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5128    pub name: std::string::String,
5129
5130    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5131}
5132
5133impl DeleteHostGroupRequest {
5134    pub fn new() -> Self {
5135        std::default::Default::default()
5136    }
5137
5138    /// Sets the value of [name][crate::model::DeleteHostGroupRequest::name].
5139    ///
5140    /// # Example
5141    /// ```ignore,no_run
5142    /// # use google_cloud_netapp_v1::model::DeleteHostGroupRequest;
5143    /// let x = DeleteHostGroupRequest::new().set_name("example");
5144    /// ```
5145    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5146        self.name = v.into();
5147        self
5148    }
5149}
5150
5151impl wkt::message::Message for DeleteHostGroupRequest {
5152    fn typename() -> &'static str {
5153        "type.googleapis.com/google.cloud.netapp.v1.DeleteHostGroupRequest"
5154    }
5155}
5156
5157/// Host group is a collection of hosts that can be used for accessing a Block
5158/// Volume.
5159#[derive(Clone, Default, PartialEq)]
5160#[non_exhaustive]
5161pub struct HostGroup {
5162    /// Identifier. The resource name of the host group.
5163    /// Format:
5164    /// `projects/{project_number}/locations/{location_id}/hostGroups/{host_group_id}`.
5165    pub name: std::string::String,
5166
5167    /// Required. Type of the host group.
5168    pub r#type: crate::model::host_group::Type,
5169
5170    /// Output only. State of the host group.
5171    pub state: crate::model::host_group::State,
5172
5173    /// Output only. Create time of the host group.
5174    pub create_time: std::option::Option<wkt::Timestamp>,
5175
5176    /// Required. The list of hosts associated with the host group.
5177    pub hosts: std::vec::Vec<std::string::String>,
5178
5179    /// Required. The OS type of the host group. It indicates the type of operating
5180    /// system used by all of the hosts in the HostGroup. All hosts in a HostGroup
5181    /// must be of the same OS type. This can be set only when creating a
5182    /// HostGroup.
5183    pub os_type: crate::model::OsType,
5184
5185    /// Optional. Description of the host group.
5186    pub description: std::string::String,
5187
5188    /// Optional. Labels of the host group.
5189    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5190
5191    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5192}
5193
5194impl HostGroup {
5195    pub fn new() -> Self {
5196        std::default::Default::default()
5197    }
5198
5199    /// Sets the value of [name][crate::model::HostGroup::name].
5200    ///
5201    /// # Example
5202    /// ```ignore,no_run
5203    /// # use google_cloud_netapp_v1::model::HostGroup;
5204    /// let x = HostGroup::new().set_name("example");
5205    /// ```
5206    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5207        self.name = v.into();
5208        self
5209    }
5210
5211    /// Sets the value of [r#type][crate::model::HostGroup::type].
5212    ///
5213    /// # Example
5214    /// ```ignore,no_run
5215    /// # use google_cloud_netapp_v1::model::HostGroup;
5216    /// use google_cloud_netapp_v1::model::host_group::Type;
5217    /// let x0 = HostGroup::new().set_type(Type::IscsiInitiator);
5218    /// ```
5219    pub fn set_type<T: std::convert::Into<crate::model::host_group::Type>>(mut self, v: T) -> Self {
5220        self.r#type = v.into();
5221        self
5222    }
5223
5224    /// Sets the value of [state][crate::model::HostGroup::state].
5225    ///
5226    /// # Example
5227    /// ```ignore,no_run
5228    /// # use google_cloud_netapp_v1::model::HostGroup;
5229    /// use google_cloud_netapp_v1::model::host_group::State;
5230    /// let x0 = HostGroup::new().set_state(State::Creating);
5231    /// let x1 = HostGroup::new().set_state(State::Ready);
5232    /// let x2 = HostGroup::new().set_state(State::Updating);
5233    /// ```
5234    pub fn set_state<T: std::convert::Into<crate::model::host_group::State>>(
5235        mut self,
5236        v: T,
5237    ) -> Self {
5238        self.state = v.into();
5239        self
5240    }
5241
5242    /// Sets the value of [create_time][crate::model::HostGroup::create_time].
5243    ///
5244    /// # Example
5245    /// ```ignore,no_run
5246    /// # use google_cloud_netapp_v1::model::HostGroup;
5247    /// use wkt::Timestamp;
5248    /// let x = HostGroup::new().set_create_time(Timestamp::default()/* use setters */);
5249    /// ```
5250    pub fn set_create_time<T>(mut self, v: T) -> Self
5251    where
5252        T: std::convert::Into<wkt::Timestamp>,
5253    {
5254        self.create_time = std::option::Option::Some(v.into());
5255        self
5256    }
5257
5258    /// Sets or clears the value of [create_time][crate::model::HostGroup::create_time].
5259    ///
5260    /// # Example
5261    /// ```ignore,no_run
5262    /// # use google_cloud_netapp_v1::model::HostGroup;
5263    /// use wkt::Timestamp;
5264    /// let x = HostGroup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5265    /// let x = HostGroup::new().set_or_clear_create_time(None::<Timestamp>);
5266    /// ```
5267    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5268    where
5269        T: std::convert::Into<wkt::Timestamp>,
5270    {
5271        self.create_time = v.map(|x| x.into());
5272        self
5273    }
5274
5275    /// Sets the value of [hosts][crate::model::HostGroup::hosts].
5276    ///
5277    /// # Example
5278    /// ```ignore,no_run
5279    /// # use google_cloud_netapp_v1::model::HostGroup;
5280    /// let x = HostGroup::new().set_hosts(["a", "b", "c"]);
5281    /// ```
5282    pub fn set_hosts<T, V>(mut self, v: T) -> Self
5283    where
5284        T: std::iter::IntoIterator<Item = V>,
5285        V: std::convert::Into<std::string::String>,
5286    {
5287        use std::iter::Iterator;
5288        self.hosts = v.into_iter().map(|i| i.into()).collect();
5289        self
5290    }
5291
5292    /// Sets the value of [os_type][crate::model::HostGroup::os_type].
5293    ///
5294    /// # Example
5295    /// ```ignore,no_run
5296    /// # use google_cloud_netapp_v1::model::HostGroup;
5297    /// use google_cloud_netapp_v1::model::OsType;
5298    /// let x0 = HostGroup::new().set_os_type(OsType::Linux);
5299    /// let x1 = HostGroup::new().set_os_type(OsType::Windows);
5300    /// let x2 = HostGroup::new().set_os_type(OsType::Esxi);
5301    /// ```
5302    pub fn set_os_type<T: std::convert::Into<crate::model::OsType>>(mut self, v: T) -> Self {
5303        self.os_type = v.into();
5304        self
5305    }
5306
5307    /// Sets the value of [description][crate::model::HostGroup::description].
5308    ///
5309    /// # Example
5310    /// ```ignore,no_run
5311    /// # use google_cloud_netapp_v1::model::HostGroup;
5312    /// let x = HostGroup::new().set_description("example");
5313    /// ```
5314    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5315        self.description = v.into();
5316        self
5317    }
5318
5319    /// Sets the value of [labels][crate::model::HostGroup::labels].
5320    ///
5321    /// # Example
5322    /// ```ignore,no_run
5323    /// # use google_cloud_netapp_v1::model::HostGroup;
5324    /// let x = HostGroup::new().set_labels([
5325    ///     ("key0", "abc"),
5326    ///     ("key1", "xyz"),
5327    /// ]);
5328    /// ```
5329    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5330    where
5331        T: std::iter::IntoIterator<Item = (K, V)>,
5332        K: std::convert::Into<std::string::String>,
5333        V: std::convert::Into<std::string::String>,
5334    {
5335        use std::iter::Iterator;
5336        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5337        self
5338    }
5339}
5340
5341impl wkt::message::Message for HostGroup {
5342    fn typename() -> &'static str {
5343        "type.googleapis.com/google.cloud.netapp.v1.HostGroup"
5344    }
5345}
5346
5347/// Defines additional types related to [HostGroup].
5348pub mod host_group {
5349    #[allow(unused_imports)]
5350    use super::*;
5351
5352    /// Types of host group.
5353    ///
5354    /// # Working with unknown values
5355    ///
5356    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5357    /// additional enum variants at any time. Adding new variants is not considered
5358    /// a breaking change. Applications should write their code in anticipation of:
5359    ///
5360    /// - New values appearing in future releases of the client library, **and**
5361    /// - New values received dynamically, without application changes.
5362    ///
5363    /// Please consult the [Working with enums] section in the user guide for some
5364    /// guidelines.
5365    ///
5366    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5367    #[derive(Clone, Debug, PartialEq)]
5368    #[non_exhaustive]
5369    pub enum Type {
5370        /// Unspecified type for host group.
5371        Unspecified,
5372        /// iSCSI initiator host group.
5373        IscsiInitiator,
5374        /// If set, the enum was initialized with an unknown value.
5375        ///
5376        /// Applications can examine the value using [Type::value] or
5377        /// [Type::name].
5378        UnknownValue(r#type::UnknownValue),
5379    }
5380
5381    #[doc(hidden)]
5382    pub mod r#type {
5383        #[allow(unused_imports)]
5384        use super::*;
5385        #[derive(Clone, Debug, PartialEq)]
5386        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5387    }
5388
5389    impl Type {
5390        /// Gets the enum value.
5391        ///
5392        /// Returns `None` if the enum contains an unknown value deserialized from
5393        /// the string representation of enums.
5394        pub fn value(&self) -> std::option::Option<i32> {
5395            match self {
5396                Self::Unspecified => std::option::Option::Some(0),
5397                Self::IscsiInitiator => std::option::Option::Some(1),
5398                Self::UnknownValue(u) => u.0.value(),
5399            }
5400        }
5401
5402        /// Gets the enum value as a string.
5403        ///
5404        /// Returns `None` if the enum contains an unknown value deserialized from
5405        /// the integer representation of enums.
5406        pub fn name(&self) -> std::option::Option<&str> {
5407            match self {
5408                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
5409                Self::IscsiInitiator => std::option::Option::Some("ISCSI_INITIATOR"),
5410                Self::UnknownValue(u) => u.0.name(),
5411            }
5412        }
5413    }
5414
5415    impl std::default::Default for Type {
5416        fn default() -> Self {
5417            use std::convert::From;
5418            Self::from(0)
5419        }
5420    }
5421
5422    impl std::fmt::Display for Type {
5423        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5424            wkt::internal::display_enum(f, self.name(), self.value())
5425        }
5426    }
5427
5428    impl std::convert::From<i32> for Type {
5429        fn from(value: i32) -> Self {
5430            match value {
5431                0 => Self::Unspecified,
5432                1 => Self::IscsiInitiator,
5433                _ => Self::UnknownValue(r#type::UnknownValue(
5434                    wkt::internal::UnknownEnumValue::Integer(value),
5435                )),
5436            }
5437        }
5438    }
5439
5440    impl std::convert::From<&str> for Type {
5441        fn from(value: &str) -> Self {
5442            use std::string::ToString;
5443            match value {
5444                "TYPE_UNSPECIFIED" => Self::Unspecified,
5445                "ISCSI_INITIATOR" => Self::IscsiInitiator,
5446                _ => Self::UnknownValue(r#type::UnknownValue(
5447                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5448                )),
5449            }
5450        }
5451    }
5452
5453    impl serde::ser::Serialize for Type {
5454        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5455        where
5456            S: serde::Serializer,
5457        {
5458            match self {
5459                Self::Unspecified => serializer.serialize_i32(0),
5460                Self::IscsiInitiator => serializer.serialize_i32(1),
5461                Self::UnknownValue(u) => u.0.serialize(serializer),
5462            }
5463        }
5464    }
5465
5466    impl<'de> serde::de::Deserialize<'de> for Type {
5467        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5468        where
5469            D: serde::Deserializer<'de>,
5470        {
5471            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
5472                ".google.cloud.netapp.v1.HostGroup.Type",
5473            ))
5474        }
5475    }
5476
5477    /// Host group states.
5478    ///
5479    /// # Working with unknown values
5480    ///
5481    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5482    /// additional enum variants at any time. Adding new variants is not considered
5483    /// a breaking change. Applications should write their code in anticipation of:
5484    ///
5485    /// - New values appearing in future releases of the client library, **and**
5486    /// - New values received dynamically, without application changes.
5487    ///
5488    /// Please consult the [Working with enums] section in the user guide for some
5489    /// guidelines.
5490    ///
5491    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5492    #[derive(Clone, Debug, PartialEq)]
5493    #[non_exhaustive]
5494    pub enum State {
5495        /// Unspecified state for host group.
5496        Unspecified,
5497        /// Host group is creating.
5498        Creating,
5499        /// Host group is ready.
5500        Ready,
5501        /// Host group is updating.
5502        Updating,
5503        /// Host group is deleting.
5504        Deleting,
5505        /// Host group is disabled.
5506        Disabled,
5507        /// If set, the enum was initialized with an unknown value.
5508        ///
5509        /// Applications can examine the value using [State::value] or
5510        /// [State::name].
5511        UnknownValue(state::UnknownValue),
5512    }
5513
5514    #[doc(hidden)]
5515    pub mod state {
5516        #[allow(unused_imports)]
5517        use super::*;
5518        #[derive(Clone, Debug, PartialEq)]
5519        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5520    }
5521
5522    impl State {
5523        /// Gets the enum value.
5524        ///
5525        /// Returns `None` if the enum contains an unknown value deserialized from
5526        /// the string representation of enums.
5527        pub fn value(&self) -> std::option::Option<i32> {
5528            match self {
5529                Self::Unspecified => std::option::Option::Some(0),
5530                Self::Creating => std::option::Option::Some(1),
5531                Self::Ready => std::option::Option::Some(2),
5532                Self::Updating => std::option::Option::Some(3),
5533                Self::Deleting => std::option::Option::Some(4),
5534                Self::Disabled => std::option::Option::Some(5),
5535                Self::UnknownValue(u) => u.0.value(),
5536            }
5537        }
5538
5539        /// Gets the enum value as a string.
5540        ///
5541        /// Returns `None` if the enum contains an unknown value deserialized from
5542        /// the integer representation of enums.
5543        pub fn name(&self) -> std::option::Option<&str> {
5544            match self {
5545                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5546                Self::Creating => std::option::Option::Some("CREATING"),
5547                Self::Ready => std::option::Option::Some("READY"),
5548                Self::Updating => std::option::Option::Some("UPDATING"),
5549                Self::Deleting => std::option::Option::Some("DELETING"),
5550                Self::Disabled => std::option::Option::Some("DISABLED"),
5551                Self::UnknownValue(u) => u.0.name(),
5552            }
5553        }
5554    }
5555
5556    impl std::default::Default for State {
5557        fn default() -> Self {
5558            use std::convert::From;
5559            Self::from(0)
5560        }
5561    }
5562
5563    impl std::fmt::Display for State {
5564        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5565            wkt::internal::display_enum(f, self.name(), self.value())
5566        }
5567    }
5568
5569    impl std::convert::From<i32> for State {
5570        fn from(value: i32) -> Self {
5571            match value {
5572                0 => Self::Unspecified,
5573                1 => Self::Creating,
5574                2 => Self::Ready,
5575                3 => Self::Updating,
5576                4 => Self::Deleting,
5577                5 => Self::Disabled,
5578                _ => Self::UnknownValue(state::UnknownValue(
5579                    wkt::internal::UnknownEnumValue::Integer(value),
5580                )),
5581            }
5582        }
5583    }
5584
5585    impl std::convert::From<&str> for State {
5586        fn from(value: &str) -> Self {
5587            use std::string::ToString;
5588            match value {
5589                "STATE_UNSPECIFIED" => Self::Unspecified,
5590                "CREATING" => Self::Creating,
5591                "READY" => Self::Ready,
5592                "UPDATING" => Self::Updating,
5593                "DELETING" => Self::Deleting,
5594                "DISABLED" => Self::Disabled,
5595                _ => Self::UnknownValue(state::UnknownValue(
5596                    wkt::internal::UnknownEnumValue::String(value.to_string()),
5597                )),
5598            }
5599        }
5600    }
5601
5602    impl serde::ser::Serialize for State {
5603        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5604        where
5605            S: serde::Serializer,
5606        {
5607            match self {
5608                Self::Unspecified => serializer.serialize_i32(0),
5609                Self::Creating => serializer.serialize_i32(1),
5610                Self::Ready => serializer.serialize_i32(2),
5611                Self::Updating => serializer.serialize_i32(3),
5612                Self::Deleting => serializer.serialize_i32(4),
5613                Self::Disabled => serializer.serialize_i32(5),
5614                Self::UnknownValue(u) => u.0.serialize(serializer),
5615            }
5616        }
5617    }
5618
5619    impl<'de> serde::de::Deserialize<'de> for State {
5620        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5621        where
5622            D: serde::Deserializer<'de>,
5623        {
5624            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5625                ".google.cloud.netapp.v1.HostGroup.State",
5626            ))
5627        }
5628    }
5629}
5630
5631/// GetKmsConfigRequest gets a KMS Config.
5632#[derive(Clone, Default, PartialEq)]
5633#[non_exhaustive]
5634pub struct GetKmsConfigRequest {
5635    /// Required. Name of the KmsConfig
5636    pub name: std::string::String,
5637
5638    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5639}
5640
5641impl GetKmsConfigRequest {
5642    pub fn new() -> Self {
5643        std::default::Default::default()
5644    }
5645
5646    /// Sets the value of [name][crate::model::GetKmsConfigRequest::name].
5647    ///
5648    /// # Example
5649    /// ```ignore,no_run
5650    /// # use google_cloud_netapp_v1::model::GetKmsConfigRequest;
5651    /// let x = GetKmsConfigRequest::new().set_name("example");
5652    /// ```
5653    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5654        self.name = v.into();
5655        self
5656    }
5657}
5658
5659impl wkt::message::Message for GetKmsConfigRequest {
5660    fn typename() -> &'static str {
5661        "type.googleapis.com/google.cloud.netapp.v1.GetKmsConfigRequest"
5662    }
5663}
5664
5665/// ListKmsConfigsRequest lists KMS Configs.
5666#[derive(Clone, Default, PartialEq)]
5667#[non_exhaustive]
5668pub struct ListKmsConfigsRequest {
5669    /// Required. Parent value
5670    pub parent: std::string::String,
5671
5672    /// The maximum number of items to return.
5673    pub page_size: i32,
5674
5675    /// The next_page_token value to use if there are additional
5676    /// results to retrieve for this list request.
5677    pub page_token: std::string::String,
5678
5679    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
5680    pub order_by: std::string::String,
5681
5682    /// List filter.
5683    pub filter: std::string::String,
5684
5685    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5686}
5687
5688impl ListKmsConfigsRequest {
5689    pub fn new() -> Self {
5690        std::default::Default::default()
5691    }
5692
5693    /// Sets the value of [parent][crate::model::ListKmsConfigsRequest::parent].
5694    ///
5695    /// # Example
5696    /// ```ignore,no_run
5697    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5698    /// let x = ListKmsConfigsRequest::new().set_parent("example");
5699    /// ```
5700    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5701        self.parent = v.into();
5702        self
5703    }
5704
5705    /// Sets the value of [page_size][crate::model::ListKmsConfigsRequest::page_size].
5706    ///
5707    /// # Example
5708    /// ```ignore,no_run
5709    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5710    /// let x = ListKmsConfigsRequest::new().set_page_size(42);
5711    /// ```
5712    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5713        self.page_size = v.into();
5714        self
5715    }
5716
5717    /// Sets the value of [page_token][crate::model::ListKmsConfigsRequest::page_token].
5718    ///
5719    /// # Example
5720    /// ```ignore,no_run
5721    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5722    /// let x = ListKmsConfigsRequest::new().set_page_token("example");
5723    /// ```
5724    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5725        self.page_token = v.into();
5726        self
5727    }
5728
5729    /// Sets the value of [order_by][crate::model::ListKmsConfigsRequest::order_by].
5730    ///
5731    /// # Example
5732    /// ```ignore,no_run
5733    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5734    /// let x = ListKmsConfigsRequest::new().set_order_by("example");
5735    /// ```
5736    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5737        self.order_by = v.into();
5738        self
5739    }
5740
5741    /// Sets the value of [filter][crate::model::ListKmsConfigsRequest::filter].
5742    ///
5743    /// # Example
5744    /// ```ignore,no_run
5745    /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
5746    /// let x = ListKmsConfigsRequest::new().set_filter("example");
5747    /// ```
5748    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5749        self.filter = v.into();
5750        self
5751    }
5752}
5753
5754impl wkt::message::Message for ListKmsConfigsRequest {
5755    fn typename() -> &'static str {
5756        "type.googleapis.com/google.cloud.netapp.v1.ListKmsConfigsRequest"
5757    }
5758}
5759
5760/// ListKmsConfigsResponse is the response to a ListKmsConfigsRequest.
5761#[derive(Clone, Default, PartialEq)]
5762#[non_exhaustive]
5763pub struct ListKmsConfigsResponse {
5764    /// The list of KmsConfigs
5765    pub kms_configs: std::vec::Vec<crate::model::KmsConfig>,
5766
5767    /// A token identifying a page of results the server should return.
5768    pub next_page_token: std::string::String,
5769
5770    /// Locations that could not be reached.
5771    pub unreachable: std::vec::Vec<std::string::String>,
5772
5773    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5774}
5775
5776impl ListKmsConfigsResponse {
5777    pub fn new() -> Self {
5778        std::default::Default::default()
5779    }
5780
5781    /// Sets the value of [kms_configs][crate::model::ListKmsConfigsResponse::kms_configs].
5782    ///
5783    /// # Example
5784    /// ```ignore,no_run
5785    /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
5786    /// use google_cloud_netapp_v1::model::KmsConfig;
5787    /// let x = ListKmsConfigsResponse::new()
5788    ///     .set_kms_configs([
5789    ///         KmsConfig::default()/* use setters */,
5790    ///         KmsConfig::default()/* use (different) setters */,
5791    ///     ]);
5792    /// ```
5793    pub fn set_kms_configs<T, V>(mut self, v: T) -> Self
5794    where
5795        T: std::iter::IntoIterator<Item = V>,
5796        V: std::convert::Into<crate::model::KmsConfig>,
5797    {
5798        use std::iter::Iterator;
5799        self.kms_configs = v.into_iter().map(|i| i.into()).collect();
5800        self
5801    }
5802
5803    /// Sets the value of [next_page_token][crate::model::ListKmsConfigsResponse::next_page_token].
5804    ///
5805    /// # Example
5806    /// ```ignore,no_run
5807    /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
5808    /// let x = ListKmsConfigsResponse::new().set_next_page_token("example");
5809    /// ```
5810    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5811        self.next_page_token = v.into();
5812        self
5813    }
5814
5815    /// Sets the value of [unreachable][crate::model::ListKmsConfigsResponse::unreachable].
5816    ///
5817    /// # Example
5818    /// ```ignore,no_run
5819    /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
5820    /// let x = ListKmsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
5821    /// ```
5822    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5823    where
5824        T: std::iter::IntoIterator<Item = V>,
5825        V: std::convert::Into<std::string::String>,
5826    {
5827        use std::iter::Iterator;
5828        self.unreachable = v.into_iter().map(|i| i.into()).collect();
5829        self
5830    }
5831}
5832
5833impl wkt::message::Message for ListKmsConfigsResponse {
5834    fn typename() -> &'static str {
5835        "type.googleapis.com/google.cloud.netapp.v1.ListKmsConfigsResponse"
5836    }
5837}
5838
5839#[doc(hidden)]
5840impl google_cloud_gax::paginator::internal::PageableResponse for ListKmsConfigsResponse {
5841    type PageItem = crate::model::KmsConfig;
5842
5843    fn items(self) -> std::vec::Vec<Self::PageItem> {
5844        self.kms_configs
5845    }
5846
5847    fn next_page_token(&self) -> std::string::String {
5848        use std::clone::Clone;
5849        self.next_page_token.clone()
5850    }
5851}
5852
5853/// CreateKmsConfigRequest creates a KMS Config.
5854#[derive(Clone, Default, PartialEq)]
5855#[non_exhaustive]
5856pub struct CreateKmsConfigRequest {
5857    /// Required. Value for parent.
5858    pub parent: std::string::String,
5859
5860    /// Required. Id of the requesting KmsConfig. Must be unique within the parent
5861    /// resource. Must contain only letters, numbers and hyphen, with the first
5862    /// character a letter, the last a letter or a
5863    /// number, and a 63 character maximum.
5864    pub kms_config_id: std::string::String,
5865
5866    /// Required. The required parameters to create a new KmsConfig.
5867    pub kms_config: std::option::Option<crate::model::KmsConfig>,
5868
5869    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5870}
5871
5872impl CreateKmsConfigRequest {
5873    pub fn new() -> Self {
5874        std::default::Default::default()
5875    }
5876
5877    /// Sets the value of [parent][crate::model::CreateKmsConfigRequest::parent].
5878    ///
5879    /// # Example
5880    /// ```ignore,no_run
5881    /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
5882    /// let x = CreateKmsConfigRequest::new().set_parent("example");
5883    /// ```
5884    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5885        self.parent = v.into();
5886        self
5887    }
5888
5889    /// Sets the value of [kms_config_id][crate::model::CreateKmsConfigRequest::kms_config_id].
5890    ///
5891    /// # Example
5892    /// ```ignore,no_run
5893    /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
5894    /// let x = CreateKmsConfigRequest::new().set_kms_config_id("example");
5895    /// ```
5896    pub fn set_kms_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5897        self.kms_config_id = v.into();
5898        self
5899    }
5900
5901    /// Sets the value of [kms_config][crate::model::CreateKmsConfigRequest::kms_config].
5902    ///
5903    /// # Example
5904    /// ```ignore,no_run
5905    /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
5906    /// use google_cloud_netapp_v1::model::KmsConfig;
5907    /// let x = CreateKmsConfigRequest::new().set_kms_config(KmsConfig::default()/* use setters */);
5908    /// ```
5909    pub fn set_kms_config<T>(mut self, v: T) -> Self
5910    where
5911        T: std::convert::Into<crate::model::KmsConfig>,
5912    {
5913        self.kms_config = std::option::Option::Some(v.into());
5914        self
5915    }
5916
5917    /// Sets or clears the value of [kms_config][crate::model::CreateKmsConfigRequest::kms_config].
5918    ///
5919    /// # Example
5920    /// ```ignore,no_run
5921    /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
5922    /// use google_cloud_netapp_v1::model::KmsConfig;
5923    /// let x = CreateKmsConfigRequest::new().set_or_clear_kms_config(Some(KmsConfig::default()/* use setters */));
5924    /// let x = CreateKmsConfigRequest::new().set_or_clear_kms_config(None::<KmsConfig>);
5925    /// ```
5926    pub fn set_or_clear_kms_config<T>(mut self, v: std::option::Option<T>) -> Self
5927    where
5928        T: std::convert::Into<crate::model::KmsConfig>,
5929    {
5930        self.kms_config = v.map(|x| x.into());
5931        self
5932    }
5933}
5934
5935impl wkt::message::Message for CreateKmsConfigRequest {
5936    fn typename() -> &'static str {
5937        "type.googleapis.com/google.cloud.netapp.v1.CreateKmsConfigRequest"
5938    }
5939}
5940
5941/// UpdateKmsConfigRequest updates a KMS Config.
5942#[derive(Clone, Default, PartialEq)]
5943#[non_exhaustive]
5944pub struct UpdateKmsConfigRequest {
5945    /// Required. Field mask is used to specify the fields to be overwritten in the
5946    /// KmsConfig resource by the update.
5947    /// The fields specified in the update_mask are relative to the resource, not
5948    /// the full request. A field will be overwritten if it is in the mask. If the
5949    /// user does not provide a mask then all fields will be overwritten.
5950    pub update_mask: std::option::Option<wkt::FieldMask>,
5951
5952    /// Required. The KmsConfig being updated
5953    pub kms_config: std::option::Option<crate::model::KmsConfig>,
5954
5955    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5956}
5957
5958impl UpdateKmsConfigRequest {
5959    pub fn new() -> Self {
5960        std::default::Default::default()
5961    }
5962
5963    /// Sets the value of [update_mask][crate::model::UpdateKmsConfigRequest::update_mask].
5964    ///
5965    /// # Example
5966    /// ```ignore,no_run
5967    /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
5968    /// use wkt::FieldMask;
5969    /// let x = UpdateKmsConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5970    /// ```
5971    pub fn set_update_mask<T>(mut self, v: T) -> Self
5972    where
5973        T: std::convert::Into<wkt::FieldMask>,
5974    {
5975        self.update_mask = std::option::Option::Some(v.into());
5976        self
5977    }
5978
5979    /// Sets or clears the value of [update_mask][crate::model::UpdateKmsConfigRequest::update_mask].
5980    ///
5981    /// # Example
5982    /// ```ignore,no_run
5983    /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
5984    /// use wkt::FieldMask;
5985    /// let x = UpdateKmsConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5986    /// let x = UpdateKmsConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5987    /// ```
5988    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5989    where
5990        T: std::convert::Into<wkt::FieldMask>,
5991    {
5992        self.update_mask = v.map(|x| x.into());
5993        self
5994    }
5995
5996    /// Sets the value of [kms_config][crate::model::UpdateKmsConfigRequest::kms_config].
5997    ///
5998    /// # Example
5999    /// ```ignore,no_run
6000    /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
6001    /// use google_cloud_netapp_v1::model::KmsConfig;
6002    /// let x = UpdateKmsConfigRequest::new().set_kms_config(KmsConfig::default()/* use setters */);
6003    /// ```
6004    pub fn set_kms_config<T>(mut self, v: T) -> Self
6005    where
6006        T: std::convert::Into<crate::model::KmsConfig>,
6007    {
6008        self.kms_config = std::option::Option::Some(v.into());
6009        self
6010    }
6011
6012    /// Sets or clears the value of [kms_config][crate::model::UpdateKmsConfigRequest::kms_config].
6013    ///
6014    /// # Example
6015    /// ```ignore,no_run
6016    /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
6017    /// use google_cloud_netapp_v1::model::KmsConfig;
6018    /// let x = UpdateKmsConfigRequest::new().set_or_clear_kms_config(Some(KmsConfig::default()/* use setters */));
6019    /// let x = UpdateKmsConfigRequest::new().set_or_clear_kms_config(None::<KmsConfig>);
6020    /// ```
6021    pub fn set_or_clear_kms_config<T>(mut self, v: std::option::Option<T>) -> Self
6022    where
6023        T: std::convert::Into<crate::model::KmsConfig>,
6024    {
6025        self.kms_config = v.map(|x| x.into());
6026        self
6027    }
6028}
6029
6030impl wkt::message::Message for UpdateKmsConfigRequest {
6031    fn typename() -> &'static str {
6032        "type.googleapis.com/google.cloud.netapp.v1.UpdateKmsConfigRequest"
6033    }
6034}
6035
6036/// DeleteKmsConfigRequest deletes a KMS Config.
6037#[derive(Clone, Default, PartialEq)]
6038#[non_exhaustive]
6039pub struct DeleteKmsConfigRequest {
6040    /// Required. Name of the KmsConfig.
6041    pub name: std::string::String,
6042
6043    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6044}
6045
6046impl DeleteKmsConfigRequest {
6047    pub fn new() -> Self {
6048        std::default::Default::default()
6049    }
6050
6051    /// Sets the value of [name][crate::model::DeleteKmsConfigRequest::name].
6052    ///
6053    /// # Example
6054    /// ```ignore,no_run
6055    /// # use google_cloud_netapp_v1::model::DeleteKmsConfigRequest;
6056    /// let x = DeleteKmsConfigRequest::new().set_name("example");
6057    /// ```
6058    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6059        self.name = v.into();
6060        self
6061    }
6062}
6063
6064impl wkt::message::Message for DeleteKmsConfigRequest {
6065    fn typename() -> &'static str {
6066        "type.googleapis.com/google.cloud.netapp.v1.DeleteKmsConfigRequest"
6067    }
6068}
6069
6070/// EncryptVolumesRequest specifies the KMS config to encrypt existing volumes.
6071#[derive(Clone, Default, PartialEq)]
6072#[non_exhaustive]
6073pub struct EncryptVolumesRequest {
6074    /// Required. Name of the KmsConfig.
6075    pub name: std::string::String,
6076
6077    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6078}
6079
6080impl EncryptVolumesRequest {
6081    pub fn new() -> Self {
6082        std::default::Default::default()
6083    }
6084
6085    /// Sets the value of [name][crate::model::EncryptVolumesRequest::name].
6086    ///
6087    /// # Example
6088    /// ```ignore,no_run
6089    /// # use google_cloud_netapp_v1::model::EncryptVolumesRequest;
6090    /// let x = EncryptVolumesRequest::new().set_name("example");
6091    /// ```
6092    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6093        self.name = v.into();
6094        self
6095    }
6096}
6097
6098impl wkt::message::Message for EncryptVolumesRequest {
6099    fn typename() -> &'static str {
6100        "type.googleapis.com/google.cloud.netapp.v1.EncryptVolumesRequest"
6101    }
6102}
6103
6104/// VerifyKmsConfigRequest specifies the KMS config to be validated.
6105#[derive(Clone, Default, PartialEq)]
6106#[non_exhaustive]
6107pub struct VerifyKmsConfigRequest {
6108    /// Required. Name of the KMS Config to be verified.
6109    pub name: std::string::String,
6110
6111    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6112}
6113
6114impl VerifyKmsConfigRequest {
6115    pub fn new() -> Self {
6116        std::default::Default::default()
6117    }
6118
6119    /// Sets the value of [name][crate::model::VerifyKmsConfigRequest::name].
6120    ///
6121    /// # Example
6122    /// ```ignore,no_run
6123    /// # use google_cloud_netapp_v1::model::VerifyKmsConfigRequest;
6124    /// let x = VerifyKmsConfigRequest::new().set_name("example");
6125    /// ```
6126    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6127        self.name = v.into();
6128        self
6129    }
6130}
6131
6132impl wkt::message::Message for VerifyKmsConfigRequest {
6133    fn typename() -> &'static str {
6134        "type.googleapis.com/google.cloud.netapp.v1.VerifyKmsConfigRequest"
6135    }
6136}
6137
6138/// VerifyKmsConfigResponse contains the information if the config is correctly
6139/// and error message.
6140#[derive(Clone, Default, PartialEq)]
6141#[non_exhaustive]
6142pub struct VerifyKmsConfigResponse {
6143    /// Output only. If the customer key configured correctly to the encrypt
6144    /// volume.
6145    pub healthy: bool,
6146
6147    /// Output only. Error message if config is not healthy.
6148    pub health_error: std::string::String,
6149
6150    /// Output only. Instructions for the customers to provide the access to the
6151    /// encryption key.
6152    pub instructions: std::string::String,
6153
6154    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6155}
6156
6157impl VerifyKmsConfigResponse {
6158    pub fn new() -> Self {
6159        std::default::Default::default()
6160    }
6161
6162    /// Sets the value of [healthy][crate::model::VerifyKmsConfigResponse::healthy].
6163    ///
6164    /// # Example
6165    /// ```ignore,no_run
6166    /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
6167    /// let x = VerifyKmsConfigResponse::new().set_healthy(true);
6168    /// ```
6169    pub fn set_healthy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
6170        self.healthy = v.into();
6171        self
6172    }
6173
6174    /// Sets the value of [health_error][crate::model::VerifyKmsConfigResponse::health_error].
6175    ///
6176    /// # Example
6177    /// ```ignore,no_run
6178    /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
6179    /// let x = VerifyKmsConfigResponse::new().set_health_error("example");
6180    /// ```
6181    pub fn set_health_error<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6182        self.health_error = v.into();
6183        self
6184    }
6185
6186    /// Sets the value of [instructions][crate::model::VerifyKmsConfigResponse::instructions].
6187    ///
6188    /// # Example
6189    /// ```ignore,no_run
6190    /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
6191    /// let x = VerifyKmsConfigResponse::new().set_instructions("example");
6192    /// ```
6193    pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6194        self.instructions = v.into();
6195        self
6196    }
6197}
6198
6199impl wkt::message::Message for VerifyKmsConfigResponse {
6200    fn typename() -> &'static str {
6201        "type.googleapis.com/google.cloud.netapp.v1.VerifyKmsConfigResponse"
6202    }
6203}
6204
6205/// KmsConfig is the customer-managed encryption key(CMEK) configuration.
6206#[derive(Clone, Default, PartialEq)]
6207#[non_exhaustive]
6208pub struct KmsConfig {
6209    /// Identifier. Name of the KmsConfig.
6210    /// Format: `projects/{project}/locations/{location}/kmsConfigs/{kms_config}`
6211    pub name: std::string::String,
6212
6213    /// Required. Customer-managed crypto key resource full name. Format:
6214    /// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`
6215    pub crypto_key_name: std::string::String,
6216
6217    /// Output only. State of the KmsConfig.
6218    pub state: crate::model::kms_config::State,
6219
6220    /// Output only. State details of the KmsConfig.
6221    pub state_details: std::string::String,
6222
6223    /// Output only. Create time of the KmsConfig.
6224    pub create_time: std::option::Option<wkt::Timestamp>,
6225
6226    /// Description of the KmsConfig.
6227    pub description: std::string::String,
6228
6229    /// Labels as key value pairs
6230    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6231
6232    /// Output only. Instructions to provide the access to the customer provided
6233    /// encryption key.
6234    pub instructions: std::string::String,
6235
6236    /// Output only. The Service account which will have access to the customer
6237    /// provided encryption key.
6238    pub service_account: std::string::String,
6239
6240    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6241}
6242
6243impl KmsConfig {
6244    pub fn new() -> Self {
6245        std::default::Default::default()
6246    }
6247
6248    /// Sets the value of [name][crate::model::KmsConfig::name].
6249    ///
6250    /// # Example
6251    /// ```ignore,no_run
6252    /// # use google_cloud_netapp_v1::model::KmsConfig;
6253    /// let x = KmsConfig::new().set_name("example");
6254    /// ```
6255    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6256        self.name = v.into();
6257        self
6258    }
6259
6260    /// Sets the value of [crypto_key_name][crate::model::KmsConfig::crypto_key_name].
6261    ///
6262    /// # Example
6263    /// ```ignore,no_run
6264    /// # use google_cloud_netapp_v1::model::KmsConfig;
6265    /// let x = KmsConfig::new().set_crypto_key_name("example");
6266    /// ```
6267    pub fn set_crypto_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6268        self.crypto_key_name = v.into();
6269        self
6270    }
6271
6272    /// Sets the value of [state][crate::model::KmsConfig::state].
6273    ///
6274    /// # Example
6275    /// ```ignore,no_run
6276    /// # use google_cloud_netapp_v1::model::KmsConfig;
6277    /// use google_cloud_netapp_v1::model::kms_config::State;
6278    /// let x0 = KmsConfig::new().set_state(State::Ready);
6279    /// let x1 = KmsConfig::new().set_state(State::Creating);
6280    /// let x2 = KmsConfig::new().set_state(State::Deleting);
6281    /// ```
6282    pub fn set_state<T: std::convert::Into<crate::model::kms_config::State>>(
6283        mut self,
6284        v: T,
6285    ) -> Self {
6286        self.state = v.into();
6287        self
6288    }
6289
6290    /// Sets the value of [state_details][crate::model::KmsConfig::state_details].
6291    ///
6292    /// # Example
6293    /// ```ignore,no_run
6294    /// # use google_cloud_netapp_v1::model::KmsConfig;
6295    /// let x = KmsConfig::new().set_state_details("example");
6296    /// ```
6297    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6298        self.state_details = v.into();
6299        self
6300    }
6301
6302    /// Sets the value of [create_time][crate::model::KmsConfig::create_time].
6303    ///
6304    /// # Example
6305    /// ```ignore,no_run
6306    /// # use google_cloud_netapp_v1::model::KmsConfig;
6307    /// use wkt::Timestamp;
6308    /// let x = KmsConfig::new().set_create_time(Timestamp::default()/* use setters */);
6309    /// ```
6310    pub fn set_create_time<T>(mut self, v: T) -> Self
6311    where
6312        T: std::convert::Into<wkt::Timestamp>,
6313    {
6314        self.create_time = std::option::Option::Some(v.into());
6315        self
6316    }
6317
6318    /// Sets or clears the value of [create_time][crate::model::KmsConfig::create_time].
6319    ///
6320    /// # Example
6321    /// ```ignore,no_run
6322    /// # use google_cloud_netapp_v1::model::KmsConfig;
6323    /// use wkt::Timestamp;
6324    /// let x = KmsConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6325    /// let x = KmsConfig::new().set_or_clear_create_time(None::<Timestamp>);
6326    /// ```
6327    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6328    where
6329        T: std::convert::Into<wkt::Timestamp>,
6330    {
6331        self.create_time = v.map(|x| x.into());
6332        self
6333    }
6334
6335    /// Sets the value of [description][crate::model::KmsConfig::description].
6336    ///
6337    /// # Example
6338    /// ```ignore,no_run
6339    /// # use google_cloud_netapp_v1::model::KmsConfig;
6340    /// let x = KmsConfig::new().set_description("example");
6341    /// ```
6342    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6343        self.description = v.into();
6344        self
6345    }
6346
6347    /// Sets the value of [labels][crate::model::KmsConfig::labels].
6348    ///
6349    /// # Example
6350    /// ```ignore,no_run
6351    /// # use google_cloud_netapp_v1::model::KmsConfig;
6352    /// let x = KmsConfig::new().set_labels([
6353    ///     ("key0", "abc"),
6354    ///     ("key1", "xyz"),
6355    /// ]);
6356    /// ```
6357    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6358    where
6359        T: std::iter::IntoIterator<Item = (K, V)>,
6360        K: std::convert::Into<std::string::String>,
6361        V: std::convert::Into<std::string::String>,
6362    {
6363        use std::iter::Iterator;
6364        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6365        self
6366    }
6367
6368    /// Sets the value of [instructions][crate::model::KmsConfig::instructions].
6369    ///
6370    /// # Example
6371    /// ```ignore,no_run
6372    /// # use google_cloud_netapp_v1::model::KmsConfig;
6373    /// let x = KmsConfig::new().set_instructions("example");
6374    /// ```
6375    pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6376        self.instructions = v.into();
6377        self
6378    }
6379
6380    /// Sets the value of [service_account][crate::model::KmsConfig::service_account].
6381    ///
6382    /// # Example
6383    /// ```ignore,no_run
6384    /// # use google_cloud_netapp_v1::model::KmsConfig;
6385    /// let x = KmsConfig::new().set_service_account("example");
6386    /// ```
6387    pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6388        self.service_account = v.into();
6389        self
6390    }
6391}
6392
6393impl wkt::message::Message for KmsConfig {
6394    fn typename() -> &'static str {
6395        "type.googleapis.com/google.cloud.netapp.v1.KmsConfig"
6396    }
6397}
6398
6399/// Defines additional types related to [KmsConfig].
6400pub mod kms_config {
6401    #[allow(unused_imports)]
6402    use super::*;
6403
6404    /// The KmsConfig States
6405    ///
6406    /// # Working with unknown values
6407    ///
6408    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6409    /// additional enum variants at any time. Adding new variants is not considered
6410    /// a breaking change. Applications should write their code in anticipation of:
6411    ///
6412    /// - New values appearing in future releases of the client library, **and**
6413    /// - New values received dynamically, without application changes.
6414    ///
6415    /// Please consult the [Working with enums] section in the user guide for some
6416    /// guidelines.
6417    ///
6418    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6419    #[derive(Clone, Debug, PartialEq)]
6420    #[non_exhaustive]
6421    pub enum State {
6422        /// Unspecified KmsConfig State
6423        Unspecified,
6424        /// KmsConfig State is Ready
6425        Ready,
6426        /// KmsConfig State is Creating
6427        Creating,
6428        /// KmsConfig State is Deleting
6429        Deleting,
6430        /// KmsConfig State is Updating
6431        Updating,
6432        /// KmsConfig State is In Use.
6433        InUse,
6434        /// KmsConfig State is Error
6435        Error,
6436        /// KmsConfig State is Pending to verify crypto key access.
6437        KeyCheckPending,
6438        /// KmsConfig State is Not accessbile by the SDE service account to the
6439        /// crypto key.
6440        KeyNotReachable,
6441        /// KmsConfig State is Disabling.
6442        Disabling,
6443        /// KmsConfig State is Disabled.
6444        Disabled,
6445        /// KmsConfig State is Migrating.
6446        /// The existing volumes are migrating from SMEK to CMEK.
6447        Migrating,
6448        /// If set, the enum was initialized with an unknown value.
6449        ///
6450        /// Applications can examine the value using [State::value] or
6451        /// [State::name].
6452        UnknownValue(state::UnknownValue),
6453    }
6454
6455    #[doc(hidden)]
6456    pub mod state {
6457        #[allow(unused_imports)]
6458        use super::*;
6459        #[derive(Clone, Debug, PartialEq)]
6460        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6461    }
6462
6463    impl State {
6464        /// Gets the enum value.
6465        ///
6466        /// Returns `None` if the enum contains an unknown value deserialized from
6467        /// the string representation of enums.
6468        pub fn value(&self) -> std::option::Option<i32> {
6469            match self {
6470                Self::Unspecified => std::option::Option::Some(0),
6471                Self::Ready => std::option::Option::Some(1),
6472                Self::Creating => std::option::Option::Some(2),
6473                Self::Deleting => std::option::Option::Some(3),
6474                Self::Updating => std::option::Option::Some(4),
6475                Self::InUse => std::option::Option::Some(5),
6476                Self::Error => std::option::Option::Some(6),
6477                Self::KeyCheckPending => std::option::Option::Some(7),
6478                Self::KeyNotReachable => std::option::Option::Some(8),
6479                Self::Disabling => std::option::Option::Some(9),
6480                Self::Disabled => std::option::Option::Some(10),
6481                Self::Migrating => std::option::Option::Some(11),
6482                Self::UnknownValue(u) => u.0.value(),
6483            }
6484        }
6485
6486        /// Gets the enum value as a string.
6487        ///
6488        /// Returns `None` if the enum contains an unknown value deserialized from
6489        /// the integer representation of enums.
6490        pub fn name(&self) -> std::option::Option<&str> {
6491            match self {
6492                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6493                Self::Ready => std::option::Option::Some("READY"),
6494                Self::Creating => std::option::Option::Some("CREATING"),
6495                Self::Deleting => std::option::Option::Some("DELETING"),
6496                Self::Updating => std::option::Option::Some("UPDATING"),
6497                Self::InUse => std::option::Option::Some("IN_USE"),
6498                Self::Error => std::option::Option::Some("ERROR"),
6499                Self::KeyCheckPending => std::option::Option::Some("KEY_CHECK_PENDING"),
6500                Self::KeyNotReachable => std::option::Option::Some("KEY_NOT_REACHABLE"),
6501                Self::Disabling => std::option::Option::Some("DISABLING"),
6502                Self::Disabled => std::option::Option::Some("DISABLED"),
6503                Self::Migrating => std::option::Option::Some("MIGRATING"),
6504                Self::UnknownValue(u) => u.0.name(),
6505            }
6506        }
6507    }
6508
6509    impl std::default::Default for State {
6510        fn default() -> Self {
6511            use std::convert::From;
6512            Self::from(0)
6513        }
6514    }
6515
6516    impl std::fmt::Display for State {
6517        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6518            wkt::internal::display_enum(f, self.name(), self.value())
6519        }
6520    }
6521
6522    impl std::convert::From<i32> for State {
6523        fn from(value: i32) -> Self {
6524            match value {
6525                0 => Self::Unspecified,
6526                1 => Self::Ready,
6527                2 => Self::Creating,
6528                3 => Self::Deleting,
6529                4 => Self::Updating,
6530                5 => Self::InUse,
6531                6 => Self::Error,
6532                7 => Self::KeyCheckPending,
6533                8 => Self::KeyNotReachable,
6534                9 => Self::Disabling,
6535                10 => Self::Disabled,
6536                11 => Self::Migrating,
6537                _ => Self::UnknownValue(state::UnknownValue(
6538                    wkt::internal::UnknownEnumValue::Integer(value),
6539                )),
6540            }
6541        }
6542    }
6543
6544    impl std::convert::From<&str> for State {
6545        fn from(value: &str) -> Self {
6546            use std::string::ToString;
6547            match value {
6548                "STATE_UNSPECIFIED" => Self::Unspecified,
6549                "READY" => Self::Ready,
6550                "CREATING" => Self::Creating,
6551                "DELETING" => Self::Deleting,
6552                "UPDATING" => Self::Updating,
6553                "IN_USE" => Self::InUse,
6554                "ERROR" => Self::Error,
6555                "KEY_CHECK_PENDING" => Self::KeyCheckPending,
6556                "KEY_NOT_REACHABLE" => Self::KeyNotReachable,
6557                "DISABLING" => Self::Disabling,
6558                "DISABLED" => Self::Disabled,
6559                "MIGRATING" => Self::Migrating,
6560                _ => Self::UnknownValue(state::UnknownValue(
6561                    wkt::internal::UnknownEnumValue::String(value.to_string()),
6562                )),
6563            }
6564        }
6565    }
6566
6567    impl serde::ser::Serialize for State {
6568        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6569        where
6570            S: serde::Serializer,
6571        {
6572            match self {
6573                Self::Unspecified => serializer.serialize_i32(0),
6574                Self::Ready => serializer.serialize_i32(1),
6575                Self::Creating => serializer.serialize_i32(2),
6576                Self::Deleting => serializer.serialize_i32(3),
6577                Self::Updating => serializer.serialize_i32(4),
6578                Self::InUse => serializer.serialize_i32(5),
6579                Self::Error => serializer.serialize_i32(6),
6580                Self::KeyCheckPending => serializer.serialize_i32(7),
6581                Self::KeyNotReachable => serializer.serialize_i32(8),
6582                Self::Disabling => serializer.serialize_i32(9),
6583                Self::Disabled => serializer.serialize_i32(10),
6584                Self::Migrating => serializer.serialize_i32(11),
6585                Self::UnknownValue(u) => u.0.serialize(serializer),
6586            }
6587        }
6588    }
6589
6590    impl<'de> serde::de::Deserialize<'de> for State {
6591        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6592        where
6593            D: serde::Deserializer<'de>,
6594        {
6595            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6596                ".google.cloud.netapp.v1.KmsConfig.State",
6597            ))
6598        }
6599    }
6600}
6601
6602/// ListQuotaRulesRequest for listing quota rules.
6603#[derive(Clone, Default, PartialEq)]
6604#[non_exhaustive]
6605pub struct ListQuotaRulesRequest {
6606    /// Required. Parent value for ListQuotaRulesRequest
6607    pub parent: std::string::String,
6608
6609    /// Optional. Requested page size. Server may return fewer items than
6610    /// requested. If unspecified, the server will pick an appropriate default.
6611    pub page_size: i32,
6612
6613    /// Optional. A token identifying a page of results the server should return.
6614    pub page_token: std::string::String,
6615
6616    /// Optional. Filtering results
6617    pub filter: std::string::String,
6618
6619    /// Optional. Hint for how to order the results
6620    pub order_by: std::string::String,
6621
6622    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6623}
6624
6625impl ListQuotaRulesRequest {
6626    pub fn new() -> Self {
6627        std::default::Default::default()
6628    }
6629
6630    /// Sets the value of [parent][crate::model::ListQuotaRulesRequest::parent].
6631    ///
6632    /// # Example
6633    /// ```ignore,no_run
6634    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
6635    /// let x = ListQuotaRulesRequest::new().set_parent("example");
6636    /// ```
6637    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6638        self.parent = v.into();
6639        self
6640    }
6641
6642    /// Sets the value of [page_size][crate::model::ListQuotaRulesRequest::page_size].
6643    ///
6644    /// # Example
6645    /// ```ignore,no_run
6646    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
6647    /// let x = ListQuotaRulesRequest::new().set_page_size(42);
6648    /// ```
6649    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6650        self.page_size = v.into();
6651        self
6652    }
6653
6654    /// Sets the value of [page_token][crate::model::ListQuotaRulesRequest::page_token].
6655    ///
6656    /// # Example
6657    /// ```ignore,no_run
6658    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
6659    /// let x = ListQuotaRulesRequest::new().set_page_token("example");
6660    /// ```
6661    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6662        self.page_token = v.into();
6663        self
6664    }
6665
6666    /// Sets the value of [filter][crate::model::ListQuotaRulesRequest::filter].
6667    ///
6668    /// # Example
6669    /// ```ignore,no_run
6670    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
6671    /// let x = ListQuotaRulesRequest::new().set_filter("example");
6672    /// ```
6673    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6674        self.filter = v.into();
6675        self
6676    }
6677
6678    /// Sets the value of [order_by][crate::model::ListQuotaRulesRequest::order_by].
6679    ///
6680    /// # Example
6681    /// ```ignore,no_run
6682    /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
6683    /// let x = ListQuotaRulesRequest::new().set_order_by("example");
6684    /// ```
6685    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6686        self.order_by = v.into();
6687        self
6688    }
6689}
6690
6691impl wkt::message::Message for ListQuotaRulesRequest {
6692    fn typename() -> &'static str {
6693        "type.googleapis.com/google.cloud.netapp.v1.ListQuotaRulesRequest"
6694    }
6695}
6696
6697/// ListQuotaRulesResponse is the response to a ListQuotaRulesRequest.
6698#[derive(Clone, Default, PartialEq)]
6699#[non_exhaustive]
6700pub struct ListQuotaRulesResponse {
6701    /// List of quota rules
6702    pub quota_rules: std::vec::Vec<crate::model::QuotaRule>,
6703
6704    /// A token identifying a page of results the server should return.
6705    pub next_page_token: std::string::String,
6706
6707    /// Locations that could not be reached.
6708    pub unreachable: std::vec::Vec<std::string::String>,
6709
6710    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6711}
6712
6713impl ListQuotaRulesResponse {
6714    pub fn new() -> Self {
6715        std::default::Default::default()
6716    }
6717
6718    /// Sets the value of [quota_rules][crate::model::ListQuotaRulesResponse::quota_rules].
6719    ///
6720    /// # Example
6721    /// ```ignore,no_run
6722    /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
6723    /// use google_cloud_netapp_v1::model::QuotaRule;
6724    /// let x = ListQuotaRulesResponse::new()
6725    ///     .set_quota_rules([
6726    ///         QuotaRule::default()/* use setters */,
6727    ///         QuotaRule::default()/* use (different) setters */,
6728    ///     ]);
6729    /// ```
6730    pub fn set_quota_rules<T, V>(mut self, v: T) -> Self
6731    where
6732        T: std::iter::IntoIterator<Item = V>,
6733        V: std::convert::Into<crate::model::QuotaRule>,
6734    {
6735        use std::iter::Iterator;
6736        self.quota_rules = v.into_iter().map(|i| i.into()).collect();
6737        self
6738    }
6739
6740    /// Sets the value of [next_page_token][crate::model::ListQuotaRulesResponse::next_page_token].
6741    ///
6742    /// # Example
6743    /// ```ignore,no_run
6744    /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
6745    /// let x = ListQuotaRulesResponse::new().set_next_page_token("example");
6746    /// ```
6747    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6748        self.next_page_token = v.into();
6749        self
6750    }
6751
6752    /// Sets the value of [unreachable][crate::model::ListQuotaRulesResponse::unreachable].
6753    ///
6754    /// # Example
6755    /// ```ignore,no_run
6756    /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
6757    /// let x = ListQuotaRulesResponse::new().set_unreachable(["a", "b", "c"]);
6758    /// ```
6759    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
6760    where
6761        T: std::iter::IntoIterator<Item = V>,
6762        V: std::convert::Into<std::string::String>,
6763    {
6764        use std::iter::Iterator;
6765        self.unreachable = v.into_iter().map(|i| i.into()).collect();
6766        self
6767    }
6768}
6769
6770impl wkt::message::Message for ListQuotaRulesResponse {
6771    fn typename() -> &'static str {
6772        "type.googleapis.com/google.cloud.netapp.v1.ListQuotaRulesResponse"
6773    }
6774}
6775
6776#[doc(hidden)]
6777impl google_cloud_gax::paginator::internal::PageableResponse for ListQuotaRulesResponse {
6778    type PageItem = crate::model::QuotaRule;
6779
6780    fn items(self) -> std::vec::Vec<Self::PageItem> {
6781        self.quota_rules
6782    }
6783
6784    fn next_page_token(&self) -> std::string::String {
6785        use std::clone::Clone;
6786        self.next_page_token.clone()
6787    }
6788}
6789
6790/// GetQuotaRuleRequest for getting a quota rule.
6791#[derive(Clone, Default, PartialEq)]
6792#[non_exhaustive]
6793pub struct GetQuotaRuleRequest {
6794    /// Required. Name of the quota rule
6795    pub name: std::string::String,
6796
6797    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6798}
6799
6800impl GetQuotaRuleRequest {
6801    pub fn new() -> Self {
6802        std::default::Default::default()
6803    }
6804
6805    /// Sets the value of [name][crate::model::GetQuotaRuleRequest::name].
6806    ///
6807    /// # Example
6808    /// ```ignore,no_run
6809    /// # use google_cloud_netapp_v1::model::GetQuotaRuleRequest;
6810    /// let x = GetQuotaRuleRequest::new().set_name("example");
6811    /// ```
6812    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6813        self.name = v.into();
6814        self
6815    }
6816}
6817
6818impl wkt::message::Message for GetQuotaRuleRequest {
6819    fn typename() -> &'static str {
6820        "type.googleapis.com/google.cloud.netapp.v1.GetQuotaRuleRequest"
6821    }
6822}
6823
6824/// CreateQuotaRuleRequest for creating a quota rule.
6825#[derive(Clone, Default, PartialEq)]
6826#[non_exhaustive]
6827pub struct CreateQuotaRuleRequest {
6828    /// Required. Parent value for CreateQuotaRuleRequest
6829    pub parent: std::string::String,
6830
6831    /// Required. Fields of the to be created quota rule.
6832    pub quota_rule: std::option::Option<crate::model::QuotaRule>,
6833
6834    /// Required. ID of the quota rule to create. Must be unique within the parent
6835    /// resource. Must contain only letters, numbers, underscore and hyphen, with
6836    /// the first character a letter or underscore, the last a letter or underscore
6837    /// or a number, and a 63 character maximum.
6838    pub quota_rule_id: std::string::String,
6839
6840    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6841}
6842
6843impl CreateQuotaRuleRequest {
6844    pub fn new() -> Self {
6845        std::default::Default::default()
6846    }
6847
6848    /// Sets the value of [parent][crate::model::CreateQuotaRuleRequest::parent].
6849    ///
6850    /// # Example
6851    /// ```ignore,no_run
6852    /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
6853    /// let x = CreateQuotaRuleRequest::new().set_parent("example");
6854    /// ```
6855    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6856        self.parent = v.into();
6857        self
6858    }
6859
6860    /// Sets the value of [quota_rule][crate::model::CreateQuotaRuleRequest::quota_rule].
6861    ///
6862    /// # Example
6863    /// ```ignore,no_run
6864    /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
6865    /// use google_cloud_netapp_v1::model::QuotaRule;
6866    /// let x = CreateQuotaRuleRequest::new().set_quota_rule(QuotaRule::default()/* use setters */);
6867    /// ```
6868    pub fn set_quota_rule<T>(mut self, v: T) -> Self
6869    where
6870        T: std::convert::Into<crate::model::QuotaRule>,
6871    {
6872        self.quota_rule = std::option::Option::Some(v.into());
6873        self
6874    }
6875
6876    /// Sets or clears the value of [quota_rule][crate::model::CreateQuotaRuleRequest::quota_rule].
6877    ///
6878    /// # Example
6879    /// ```ignore,no_run
6880    /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
6881    /// use google_cloud_netapp_v1::model::QuotaRule;
6882    /// let x = CreateQuotaRuleRequest::new().set_or_clear_quota_rule(Some(QuotaRule::default()/* use setters */));
6883    /// let x = CreateQuotaRuleRequest::new().set_or_clear_quota_rule(None::<QuotaRule>);
6884    /// ```
6885    pub fn set_or_clear_quota_rule<T>(mut self, v: std::option::Option<T>) -> Self
6886    where
6887        T: std::convert::Into<crate::model::QuotaRule>,
6888    {
6889        self.quota_rule = v.map(|x| x.into());
6890        self
6891    }
6892
6893    /// Sets the value of [quota_rule_id][crate::model::CreateQuotaRuleRequest::quota_rule_id].
6894    ///
6895    /// # Example
6896    /// ```ignore,no_run
6897    /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
6898    /// let x = CreateQuotaRuleRequest::new().set_quota_rule_id("example");
6899    /// ```
6900    pub fn set_quota_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6901        self.quota_rule_id = v.into();
6902        self
6903    }
6904}
6905
6906impl wkt::message::Message for CreateQuotaRuleRequest {
6907    fn typename() -> &'static str {
6908        "type.googleapis.com/google.cloud.netapp.v1.CreateQuotaRuleRequest"
6909    }
6910}
6911
6912/// UpdateQuotaRuleRequest for updating a quota rule.
6913#[derive(Clone, Default, PartialEq)]
6914#[non_exhaustive]
6915pub struct UpdateQuotaRuleRequest {
6916    /// Optional. Field mask is used to specify the fields to be overwritten in the
6917    /// Quota Rule resource by the update.
6918    /// The fields specified in the update_mask are relative to the resource, not
6919    /// the full request. A field will be overwritten if it is in the mask. If the
6920    /// user does not provide a mask then all fields will be overwritten.
6921    pub update_mask: std::option::Option<wkt::FieldMask>,
6922
6923    /// Required. The quota rule being updated
6924    pub quota_rule: std::option::Option<crate::model::QuotaRule>,
6925
6926    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6927}
6928
6929impl UpdateQuotaRuleRequest {
6930    pub fn new() -> Self {
6931        std::default::Default::default()
6932    }
6933
6934    /// Sets the value of [update_mask][crate::model::UpdateQuotaRuleRequest::update_mask].
6935    ///
6936    /// # Example
6937    /// ```ignore,no_run
6938    /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
6939    /// use wkt::FieldMask;
6940    /// let x = UpdateQuotaRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
6941    /// ```
6942    pub fn set_update_mask<T>(mut self, v: T) -> Self
6943    where
6944        T: std::convert::Into<wkt::FieldMask>,
6945    {
6946        self.update_mask = std::option::Option::Some(v.into());
6947        self
6948    }
6949
6950    /// Sets or clears the value of [update_mask][crate::model::UpdateQuotaRuleRequest::update_mask].
6951    ///
6952    /// # Example
6953    /// ```ignore,no_run
6954    /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
6955    /// use wkt::FieldMask;
6956    /// let x = UpdateQuotaRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
6957    /// let x = UpdateQuotaRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
6958    /// ```
6959    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6960    where
6961        T: std::convert::Into<wkt::FieldMask>,
6962    {
6963        self.update_mask = v.map(|x| x.into());
6964        self
6965    }
6966
6967    /// Sets the value of [quota_rule][crate::model::UpdateQuotaRuleRequest::quota_rule].
6968    ///
6969    /// # Example
6970    /// ```ignore,no_run
6971    /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
6972    /// use google_cloud_netapp_v1::model::QuotaRule;
6973    /// let x = UpdateQuotaRuleRequest::new().set_quota_rule(QuotaRule::default()/* use setters */);
6974    /// ```
6975    pub fn set_quota_rule<T>(mut self, v: T) -> Self
6976    where
6977        T: std::convert::Into<crate::model::QuotaRule>,
6978    {
6979        self.quota_rule = std::option::Option::Some(v.into());
6980        self
6981    }
6982
6983    /// Sets or clears the value of [quota_rule][crate::model::UpdateQuotaRuleRequest::quota_rule].
6984    ///
6985    /// # Example
6986    /// ```ignore,no_run
6987    /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
6988    /// use google_cloud_netapp_v1::model::QuotaRule;
6989    /// let x = UpdateQuotaRuleRequest::new().set_or_clear_quota_rule(Some(QuotaRule::default()/* use setters */));
6990    /// let x = UpdateQuotaRuleRequest::new().set_or_clear_quota_rule(None::<QuotaRule>);
6991    /// ```
6992    pub fn set_or_clear_quota_rule<T>(mut self, v: std::option::Option<T>) -> Self
6993    where
6994        T: std::convert::Into<crate::model::QuotaRule>,
6995    {
6996        self.quota_rule = v.map(|x| x.into());
6997        self
6998    }
6999}
7000
7001impl wkt::message::Message for UpdateQuotaRuleRequest {
7002    fn typename() -> &'static str {
7003        "type.googleapis.com/google.cloud.netapp.v1.UpdateQuotaRuleRequest"
7004    }
7005}
7006
7007/// DeleteQuotaRuleRequest for deleting a single quota rule.
7008#[derive(Clone, Default, PartialEq)]
7009#[non_exhaustive]
7010pub struct DeleteQuotaRuleRequest {
7011    /// Required. Name of the quota rule.
7012    pub name: std::string::String,
7013
7014    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7015}
7016
7017impl DeleteQuotaRuleRequest {
7018    pub fn new() -> Self {
7019        std::default::Default::default()
7020    }
7021
7022    /// Sets the value of [name][crate::model::DeleteQuotaRuleRequest::name].
7023    ///
7024    /// # Example
7025    /// ```ignore,no_run
7026    /// # use google_cloud_netapp_v1::model::DeleteQuotaRuleRequest;
7027    /// let x = DeleteQuotaRuleRequest::new().set_name("example");
7028    /// ```
7029    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7030        self.name = v.into();
7031        self
7032    }
7033}
7034
7035impl wkt::message::Message for DeleteQuotaRuleRequest {
7036    fn typename() -> &'static str {
7037        "type.googleapis.com/google.cloud.netapp.v1.DeleteQuotaRuleRequest"
7038    }
7039}
7040
7041/// QuotaRule specifies the maximum disk space a user or group can use within a
7042/// volume. They can be used for creating default and individual quota rules.
7043#[derive(Clone, Default, PartialEq)]
7044#[non_exhaustive]
7045pub struct QuotaRule {
7046    /// Identifier. The resource name of the quota rule.
7047    /// Format:
7048    /// `projects/{project_number}/locations/{location_id}/volumes/volumes/{volume_id}/quotaRules/{quota_rule_id}`.
7049    pub name: std::string::String,
7050
7051    /// Optional. The quota rule applies to the specified user or group, identified
7052    /// by a Unix UID/GID, Windows SID, or null for default.
7053    pub target: std::string::String,
7054
7055    /// Required. The type of quota rule.
7056    pub r#type: crate::model::quota_rule::Type,
7057
7058    /// Required. The maximum allowed disk space in MiB.
7059    pub disk_limit_mib: i32,
7060
7061    /// Output only. State of the quota rule
7062    pub state: crate::model::quota_rule::State,
7063
7064    /// Output only. State details of the quota rule
7065    pub state_details: std::string::String,
7066
7067    /// Output only. Create time of the quota rule
7068    pub create_time: std::option::Option<wkt::Timestamp>,
7069
7070    /// Optional. Description of the quota rule
7071    pub description: std::string::String,
7072
7073    /// Optional. Labels of the quota rule
7074    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7075
7076    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7077}
7078
7079impl QuotaRule {
7080    pub fn new() -> Self {
7081        std::default::Default::default()
7082    }
7083
7084    /// Sets the value of [name][crate::model::QuotaRule::name].
7085    ///
7086    /// # Example
7087    /// ```ignore,no_run
7088    /// # use google_cloud_netapp_v1::model::QuotaRule;
7089    /// let x = QuotaRule::new().set_name("example");
7090    /// ```
7091    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7092        self.name = v.into();
7093        self
7094    }
7095
7096    /// Sets the value of [target][crate::model::QuotaRule::target].
7097    ///
7098    /// # Example
7099    /// ```ignore,no_run
7100    /// # use google_cloud_netapp_v1::model::QuotaRule;
7101    /// let x = QuotaRule::new().set_target("example");
7102    /// ```
7103    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7104        self.target = v.into();
7105        self
7106    }
7107
7108    /// Sets the value of [r#type][crate::model::QuotaRule::type].
7109    ///
7110    /// # Example
7111    /// ```ignore,no_run
7112    /// # use google_cloud_netapp_v1::model::QuotaRule;
7113    /// use google_cloud_netapp_v1::model::quota_rule::Type;
7114    /// let x0 = QuotaRule::new().set_type(Type::IndividualUserQuota);
7115    /// let x1 = QuotaRule::new().set_type(Type::IndividualGroupQuota);
7116    /// let x2 = QuotaRule::new().set_type(Type::DefaultUserQuota);
7117    /// ```
7118    pub fn set_type<T: std::convert::Into<crate::model::quota_rule::Type>>(mut self, v: T) -> Self {
7119        self.r#type = v.into();
7120        self
7121    }
7122
7123    /// Sets the value of [disk_limit_mib][crate::model::QuotaRule::disk_limit_mib].
7124    ///
7125    /// # Example
7126    /// ```ignore,no_run
7127    /// # use google_cloud_netapp_v1::model::QuotaRule;
7128    /// let x = QuotaRule::new().set_disk_limit_mib(42);
7129    /// ```
7130    pub fn set_disk_limit_mib<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7131        self.disk_limit_mib = v.into();
7132        self
7133    }
7134
7135    /// Sets the value of [state][crate::model::QuotaRule::state].
7136    ///
7137    /// # Example
7138    /// ```ignore,no_run
7139    /// # use google_cloud_netapp_v1::model::QuotaRule;
7140    /// use google_cloud_netapp_v1::model::quota_rule::State;
7141    /// let x0 = QuotaRule::new().set_state(State::Creating);
7142    /// let x1 = QuotaRule::new().set_state(State::Updating);
7143    /// let x2 = QuotaRule::new().set_state(State::Deleting);
7144    /// ```
7145    pub fn set_state<T: std::convert::Into<crate::model::quota_rule::State>>(
7146        mut self,
7147        v: T,
7148    ) -> Self {
7149        self.state = v.into();
7150        self
7151    }
7152
7153    /// Sets the value of [state_details][crate::model::QuotaRule::state_details].
7154    ///
7155    /// # Example
7156    /// ```ignore,no_run
7157    /// # use google_cloud_netapp_v1::model::QuotaRule;
7158    /// let x = QuotaRule::new().set_state_details("example");
7159    /// ```
7160    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7161        self.state_details = v.into();
7162        self
7163    }
7164
7165    /// Sets the value of [create_time][crate::model::QuotaRule::create_time].
7166    ///
7167    /// # Example
7168    /// ```ignore,no_run
7169    /// # use google_cloud_netapp_v1::model::QuotaRule;
7170    /// use wkt::Timestamp;
7171    /// let x = QuotaRule::new().set_create_time(Timestamp::default()/* use setters */);
7172    /// ```
7173    pub fn set_create_time<T>(mut self, v: T) -> Self
7174    where
7175        T: std::convert::Into<wkt::Timestamp>,
7176    {
7177        self.create_time = std::option::Option::Some(v.into());
7178        self
7179    }
7180
7181    /// Sets or clears the value of [create_time][crate::model::QuotaRule::create_time].
7182    ///
7183    /// # Example
7184    /// ```ignore,no_run
7185    /// # use google_cloud_netapp_v1::model::QuotaRule;
7186    /// use wkt::Timestamp;
7187    /// let x = QuotaRule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
7188    /// let x = QuotaRule::new().set_or_clear_create_time(None::<Timestamp>);
7189    /// ```
7190    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
7191    where
7192        T: std::convert::Into<wkt::Timestamp>,
7193    {
7194        self.create_time = v.map(|x| x.into());
7195        self
7196    }
7197
7198    /// Sets the value of [description][crate::model::QuotaRule::description].
7199    ///
7200    /// # Example
7201    /// ```ignore,no_run
7202    /// # use google_cloud_netapp_v1::model::QuotaRule;
7203    /// let x = QuotaRule::new().set_description("example");
7204    /// ```
7205    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7206        self.description = v.into();
7207        self
7208    }
7209
7210    /// Sets the value of [labels][crate::model::QuotaRule::labels].
7211    ///
7212    /// # Example
7213    /// ```ignore,no_run
7214    /// # use google_cloud_netapp_v1::model::QuotaRule;
7215    /// let x = QuotaRule::new().set_labels([
7216    ///     ("key0", "abc"),
7217    ///     ("key1", "xyz"),
7218    /// ]);
7219    /// ```
7220    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7221    where
7222        T: std::iter::IntoIterator<Item = (K, V)>,
7223        K: std::convert::Into<std::string::String>,
7224        V: std::convert::Into<std::string::String>,
7225    {
7226        use std::iter::Iterator;
7227        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7228        self
7229    }
7230}
7231
7232impl wkt::message::Message for QuotaRule {
7233    fn typename() -> &'static str {
7234        "type.googleapis.com/google.cloud.netapp.v1.QuotaRule"
7235    }
7236}
7237
7238/// Defines additional types related to [QuotaRule].
7239pub mod quota_rule {
7240    #[allow(unused_imports)]
7241    use super::*;
7242
7243    /// Types of Quota Rule
7244    ///
7245    /// # Working with unknown values
7246    ///
7247    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7248    /// additional enum variants at any time. Adding new variants is not considered
7249    /// a breaking change. Applications should write their code in anticipation of:
7250    ///
7251    /// - New values appearing in future releases of the client library, **and**
7252    /// - New values received dynamically, without application changes.
7253    ///
7254    /// Please consult the [Working with enums] section in the user guide for some
7255    /// guidelines.
7256    ///
7257    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7258    #[derive(Clone, Debug, PartialEq)]
7259    #[non_exhaustive]
7260    pub enum Type {
7261        /// Unspecified type for quota rule
7262        Unspecified,
7263        /// Individual user quota rule
7264        IndividualUserQuota,
7265        /// Individual group quota rule
7266        IndividualGroupQuota,
7267        /// Default user quota rule
7268        DefaultUserQuota,
7269        /// Default group quota rule
7270        DefaultGroupQuota,
7271        /// If set, the enum was initialized with an unknown value.
7272        ///
7273        /// Applications can examine the value using [Type::value] or
7274        /// [Type::name].
7275        UnknownValue(r#type::UnknownValue),
7276    }
7277
7278    #[doc(hidden)]
7279    pub mod r#type {
7280        #[allow(unused_imports)]
7281        use super::*;
7282        #[derive(Clone, Debug, PartialEq)]
7283        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7284    }
7285
7286    impl Type {
7287        /// Gets the enum value.
7288        ///
7289        /// Returns `None` if the enum contains an unknown value deserialized from
7290        /// the string representation of enums.
7291        pub fn value(&self) -> std::option::Option<i32> {
7292            match self {
7293                Self::Unspecified => std::option::Option::Some(0),
7294                Self::IndividualUserQuota => std::option::Option::Some(1),
7295                Self::IndividualGroupQuota => std::option::Option::Some(2),
7296                Self::DefaultUserQuota => std::option::Option::Some(3),
7297                Self::DefaultGroupQuota => std::option::Option::Some(4),
7298                Self::UnknownValue(u) => u.0.value(),
7299            }
7300        }
7301
7302        /// Gets the enum value as a string.
7303        ///
7304        /// Returns `None` if the enum contains an unknown value deserialized from
7305        /// the integer representation of enums.
7306        pub fn name(&self) -> std::option::Option<&str> {
7307            match self {
7308                Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
7309                Self::IndividualUserQuota => std::option::Option::Some("INDIVIDUAL_USER_QUOTA"),
7310                Self::IndividualGroupQuota => std::option::Option::Some("INDIVIDUAL_GROUP_QUOTA"),
7311                Self::DefaultUserQuota => std::option::Option::Some("DEFAULT_USER_QUOTA"),
7312                Self::DefaultGroupQuota => std::option::Option::Some("DEFAULT_GROUP_QUOTA"),
7313                Self::UnknownValue(u) => u.0.name(),
7314            }
7315        }
7316    }
7317
7318    impl std::default::Default for Type {
7319        fn default() -> Self {
7320            use std::convert::From;
7321            Self::from(0)
7322        }
7323    }
7324
7325    impl std::fmt::Display for Type {
7326        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7327            wkt::internal::display_enum(f, self.name(), self.value())
7328        }
7329    }
7330
7331    impl std::convert::From<i32> for Type {
7332        fn from(value: i32) -> Self {
7333            match value {
7334                0 => Self::Unspecified,
7335                1 => Self::IndividualUserQuota,
7336                2 => Self::IndividualGroupQuota,
7337                3 => Self::DefaultUserQuota,
7338                4 => Self::DefaultGroupQuota,
7339                _ => Self::UnknownValue(r#type::UnknownValue(
7340                    wkt::internal::UnknownEnumValue::Integer(value),
7341                )),
7342            }
7343        }
7344    }
7345
7346    impl std::convert::From<&str> for Type {
7347        fn from(value: &str) -> Self {
7348            use std::string::ToString;
7349            match value {
7350                "TYPE_UNSPECIFIED" => Self::Unspecified,
7351                "INDIVIDUAL_USER_QUOTA" => Self::IndividualUserQuota,
7352                "INDIVIDUAL_GROUP_QUOTA" => Self::IndividualGroupQuota,
7353                "DEFAULT_USER_QUOTA" => Self::DefaultUserQuota,
7354                "DEFAULT_GROUP_QUOTA" => Self::DefaultGroupQuota,
7355                _ => Self::UnknownValue(r#type::UnknownValue(
7356                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7357                )),
7358            }
7359        }
7360    }
7361
7362    impl serde::ser::Serialize for Type {
7363        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7364        where
7365            S: serde::Serializer,
7366        {
7367            match self {
7368                Self::Unspecified => serializer.serialize_i32(0),
7369                Self::IndividualUserQuota => serializer.serialize_i32(1),
7370                Self::IndividualGroupQuota => serializer.serialize_i32(2),
7371                Self::DefaultUserQuota => serializer.serialize_i32(3),
7372                Self::DefaultGroupQuota => serializer.serialize_i32(4),
7373                Self::UnknownValue(u) => u.0.serialize(serializer),
7374            }
7375        }
7376    }
7377
7378    impl<'de> serde::de::Deserialize<'de> for Type {
7379        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7380        where
7381            D: serde::Deserializer<'de>,
7382        {
7383            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
7384                ".google.cloud.netapp.v1.QuotaRule.Type",
7385            ))
7386        }
7387    }
7388
7389    /// Quota Rule states
7390    ///
7391    /// # Working with unknown values
7392    ///
7393    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7394    /// additional enum variants at any time. Adding new variants is not considered
7395    /// a breaking change. Applications should write their code in anticipation of:
7396    ///
7397    /// - New values appearing in future releases of the client library, **and**
7398    /// - New values received dynamically, without application changes.
7399    ///
7400    /// Please consult the [Working with enums] section in the user guide for some
7401    /// guidelines.
7402    ///
7403    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7404    #[derive(Clone, Debug, PartialEq)]
7405    #[non_exhaustive]
7406    pub enum State {
7407        /// Unspecified state for quota rule
7408        Unspecified,
7409        /// Quota rule is creating
7410        Creating,
7411        /// Quota rule is updating
7412        Updating,
7413        /// Quota rule is deleting
7414        Deleting,
7415        /// Quota rule is ready
7416        Ready,
7417        /// Quota rule is in error state.
7418        Error,
7419        /// If set, the enum was initialized with an unknown value.
7420        ///
7421        /// Applications can examine the value using [State::value] or
7422        /// [State::name].
7423        UnknownValue(state::UnknownValue),
7424    }
7425
7426    #[doc(hidden)]
7427    pub mod state {
7428        #[allow(unused_imports)]
7429        use super::*;
7430        #[derive(Clone, Debug, PartialEq)]
7431        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7432    }
7433
7434    impl State {
7435        /// Gets the enum value.
7436        ///
7437        /// Returns `None` if the enum contains an unknown value deserialized from
7438        /// the string representation of enums.
7439        pub fn value(&self) -> std::option::Option<i32> {
7440            match self {
7441                Self::Unspecified => std::option::Option::Some(0),
7442                Self::Creating => std::option::Option::Some(1),
7443                Self::Updating => std::option::Option::Some(2),
7444                Self::Deleting => std::option::Option::Some(3),
7445                Self::Ready => std::option::Option::Some(4),
7446                Self::Error => std::option::Option::Some(5),
7447                Self::UnknownValue(u) => u.0.value(),
7448            }
7449        }
7450
7451        /// Gets the enum value as a string.
7452        ///
7453        /// Returns `None` if the enum contains an unknown value deserialized from
7454        /// the integer representation of enums.
7455        pub fn name(&self) -> std::option::Option<&str> {
7456            match self {
7457                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7458                Self::Creating => std::option::Option::Some("CREATING"),
7459                Self::Updating => std::option::Option::Some("UPDATING"),
7460                Self::Deleting => std::option::Option::Some("DELETING"),
7461                Self::Ready => std::option::Option::Some("READY"),
7462                Self::Error => std::option::Option::Some("ERROR"),
7463                Self::UnknownValue(u) => u.0.name(),
7464            }
7465        }
7466    }
7467
7468    impl std::default::Default for State {
7469        fn default() -> Self {
7470            use std::convert::From;
7471            Self::from(0)
7472        }
7473    }
7474
7475    impl std::fmt::Display for State {
7476        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7477            wkt::internal::display_enum(f, self.name(), self.value())
7478        }
7479    }
7480
7481    impl std::convert::From<i32> for State {
7482        fn from(value: i32) -> Self {
7483            match value {
7484                0 => Self::Unspecified,
7485                1 => Self::Creating,
7486                2 => Self::Updating,
7487                3 => Self::Deleting,
7488                4 => Self::Ready,
7489                5 => Self::Error,
7490                _ => Self::UnknownValue(state::UnknownValue(
7491                    wkt::internal::UnknownEnumValue::Integer(value),
7492                )),
7493            }
7494        }
7495    }
7496
7497    impl std::convert::From<&str> for State {
7498        fn from(value: &str) -> Self {
7499            use std::string::ToString;
7500            match value {
7501                "STATE_UNSPECIFIED" => Self::Unspecified,
7502                "CREATING" => Self::Creating,
7503                "UPDATING" => Self::Updating,
7504                "DELETING" => Self::Deleting,
7505                "READY" => Self::Ready,
7506                "ERROR" => Self::Error,
7507                _ => Self::UnknownValue(state::UnknownValue(
7508                    wkt::internal::UnknownEnumValue::String(value.to_string()),
7509                )),
7510            }
7511        }
7512    }
7513
7514    impl serde::ser::Serialize for State {
7515        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7516        where
7517            S: serde::Serializer,
7518        {
7519            match self {
7520                Self::Unspecified => serializer.serialize_i32(0),
7521                Self::Creating => serializer.serialize_i32(1),
7522                Self::Updating => serializer.serialize_i32(2),
7523                Self::Deleting => serializer.serialize_i32(3),
7524                Self::Ready => serializer.serialize_i32(4),
7525                Self::Error => serializer.serialize_i32(5),
7526                Self::UnknownValue(u) => u.0.serialize(serializer),
7527            }
7528        }
7529    }
7530
7531    impl<'de> serde::de::Deserialize<'de> for State {
7532        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7533        where
7534            D: serde::Deserializer<'de>,
7535        {
7536            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7537                ".google.cloud.netapp.v1.QuotaRule.State",
7538            ))
7539        }
7540    }
7541}
7542
7543/// TransferStats reports all statistics related to replication transfer.
7544#[derive(Clone, Default, PartialEq)]
7545#[non_exhaustive]
7546pub struct TransferStats {
7547    /// Cumulative bytes transferred so far for the replication relationship.
7548    pub transfer_bytes: std::option::Option<i64>,
7549
7550    /// Cumulative time taken across all transfers for the replication
7551    /// relationship.
7552    pub total_transfer_duration: std::option::Option<wkt::Duration>,
7553
7554    /// Last transfer size in bytes.
7555    pub last_transfer_bytes: std::option::Option<i64>,
7556
7557    /// Time taken during last transfer.
7558    pub last_transfer_duration: std::option::Option<wkt::Duration>,
7559
7560    /// Lag duration indicates the duration by which Destination region volume
7561    /// content lags behind the primary region volume content.
7562    pub lag_duration: std::option::Option<wkt::Duration>,
7563
7564    /// Time when progress was updated last.
7565    pub update_time: std::option::Option<wkt::Timestamp>,
7566
7567    /// Time when last transfer completed.
7568    pub last_transfer_end_time: std::option::Option<wkt::Timestamp>,
7569
7570    /// A message describing the cause of the last transfer failure.
7571    pub last_transfer_error: std::option::Option<std::string::String>,
7572
7573    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7574}
7575
7576impl TransferStats {
7577    pub fn new() -> Self {
7578        std::default::Default::default()
7579    }
7580
7581    /// Sets the value of [transfer_bytes][crate::model::TransferStats::transfer_bytes].
7582    ///
7583    /// # Example
7584    /// ```ignore,no_run
7585    /// # use google_cloud_netapp_v1::model::TransferStats;
7586    /// let x = TransferStats::new().set_transfer_bytes(42);
7587    /// ```
7588    pub fn set_transfer_bytes<T>(mut self, v: T) -> Self
7589    where
7590        T: std::convert::Into<i64>,
7591    {
7592        self.transfer_bytes = std::option::Option::Some(v.into());
7593        self
7594    }
7595
7596    /// Sets or clears the value of [transfer_bytes][crate::model::TransferStats::transfer_bytes].
7597    ///
7598    /// # Example
7599    /// ```ignore,no_run
7600    /// # use google_cloud_netapp_v1::model::TransferStats;
7601    /// let x = TransferStats::new().set_or_clear_transfer_bytes(Some(42));
7602    /// let x = TransferStats::new().set_or_clear_transfer_bytes(None::<i32>);
7603    /// ```
7604    pub fn set_or_clear_transfer_bytes<T>(mut self, v: std::option::Option<T>) -> Self
7605    where
7606        T: std::convert::Into<i64>,
7607    {
7608        self.transfer_bytes = v.map(|x| x.into());
7609        self
7610    }
7611
7612    /// Sets the value of [total_transfer_duration][crate::model::TransferStats::total_transfer_duration].
7613    ///
7614    /// # Example
7615    /// ```ignore,no_run
7616    /// # use google_cloud_netapp_v1::model::TransferStats;
7617    /// use wkt::Duration;
7618    /// let x = TransferStats::new().set_total_transfer_duration(Duration::default()/* use setters */);
7619    /// ```
7620    pub fn set_total_transfer_duration<T>(mut self, v: T) -> Self
7621    where
7622        T: std::convert::Into<wkt::Duration>,
7623    {
7624        self.total_transfer_duration = std::option::Option::Some(v.into());
7625        self
7626    }
7627
7628    /// Sets or clears the value of [total_transfer_duration][crate::model::TransferStats::total_transfer_duration].
7629    ///
7630    /// # Example
7631    /// ```ignore,no_run
7632    /// # use google_cloud_netapp_v1::model::TransferStats;
7633    /// use wkt::Duration;
7634    /// let x = TransferStats::new().set_or_clear_total_transfer_duration(Some(Duration::default()/* use setters */));
7635    /// let x = TransferStats::new().set_or_clear_total_transfer_duration(None::<Duration>);
7636    /// ```
7637    pub fn set_or_clear_total_transfer_duration<T>(mut self, v: std::option::Option<T>) -> Self
7638    where
7639        T: std::convert::Into<wkt::Duration>,
7640    {
7641        self.total_transfer_duration = v.map(|x| x.into());
7642        self
7643    }
7644
7645    /// Sets the value of [last_transfer_bytes][crate::model::TransferStats::last_transfer_bytes].
7646    ///
7647    /// # Example
7648    /// ```ignore,no_run
7649    /// # use google_cloud_netapp_v1::model::TransferStats;
7650    /// let x = TransferStats::new().set_last_transfer_bytes(42);
7651    /// ```
7652    pub fn set_last_transfer_bytes<T>(mut self, v: T) -> Self
7653    where
7654        T: std::convert::Into<i64>,
7655    {
7656        self.last_transfer_bytes = std::option::Option::Some(v.into());
7657        self
7658    }
7659
7660    /// Sets or clears the value of [last_transfer_bytes][crate::model::TransferStats::last_transfer_bytes].
7661    ///
7662    /// # Example
7663    /// ```ignore,no_run
7664    /// # use google_cloud_netapp_v1::model::TransferStats;
7665    /// let x = TransferStats::new().set_or_clear_last_transfer_bytes(Some(42));
7666    /// let x = TransferStats::new().set_or_clear_last_transfer_bytes(None::<i32>);
7667    /// ```
7668    pub fn set_or_clear_last_transfer_bytes<T>(mut self, v: std::option::Option<T>) -> Self
7669    where
7670        T: std::convert::Into<i64>,
7671    {
7672        self.last_transfer_bytes = v.map(|x| x.into());
7673        self
7674    }
7675
7676    /// Sets the value of [last_transfer_duration][crate::model::TransferStats::last_transfer_duration].
7677    ///
7678    /// # Example
7679    /// ```ignore,no_run
7680    /// # use google_cloud_netapp_v1::model::TransferStats;
7681    /// use wkt::Duration;
7682    /// let x = TransferStats::new().set_last_transfer_duration(Duration::default()/* use setters */);
7683    /// ```
7684    pub fn set_last_transfer_duration<T>(mut self, v: T) -> Self
7685    where
7686        T: std::convert::Into<wkt::Duration>,
7687    {
7688        self.last_transfer_duration = std::option::Option::Some(v.into());
7689        self
7690    }
7691
7692    /// Sets or clears the value of [last_transfer_duration][crate::model::TransferStats::last_transfer_duration].
7693    ///
7694    /// # Example
7695    /// ```ignore,no_run
7696    /// # use google_cloud_netapp_v1::model::TransferStats;
7697    /// use wkt::Duration;
7698    /// let x = TransferStats::new().set_or_clear_last_transfer_duration(Some(Duration::default()/* use setters */));
7699    /// let x = TransferStats::new().set_or_clear_last_transfer_duration(None::<Duration>);
7700    /// ```
7701    pub fn set_or_clear_last_transfer_duration<T>(mut self, v: std::option::Option<T>) -> Self
7702    where
7703        T: std::convert::Into<wkt::Duration>,
7704    {
7705        self.last_transfer_duration = v.map(|x| x.into());
7706        self
7707    }
7708
7709    /// Sets the value of [lag_duration][crate::model::TransferStats::lag_duration].
7710    ///
7711    /// # Example
7712    /// ```ignore,no_run
7713    /// # use google_cloud_netapp_v1::model::TransferStats;
7714    /// use wkt::Duration;
7715    /// let x = TransferStats::new().set_lag_duration(Duration::default()/* use setters */);
7716    /// ```
7717    pub fn set_lag_duration<T>(mut self, v: T) -> Self
7718    where
7719        T: std::convert::Into<wkt::Duration>,
7720    {
7721        self.lag_duration = std::option::Option::Some(v.into());
7722        self
7723    }
7724
7725    /// Sets or clears the value of [lag_duration][crate::model::TransferStats::lag_duration].
7726    ///
7727    /// # Example
7728    /// ```ignore,no_run
7729    /// # use google_cloud_netapp_v1::model::TransferStats;
7730    /// use wkt::Duration;
7731    /// let x = TransferStats::new().set_or_clear_lag_duration(Some(Duration::default()/* use setters */));
7732    /// let x = TransferStats::new().set_or_clear_lag_duration(None::<Duration>);
7733    /// ```
7734    pub fn set_or_clear_lag_duration<T>(mut self, v: std::option::Option<T>) -> Self
7735    where
7736        T: std::convert::Into<wkt::Duration>,
7737    {
7738        self.lag_duration = v.map(|x| x.into());
7739        self
7740    }
7741
7742    /// Sets the value of [update_time][crate::model::TransferStats::update_time].
7743    ///
7744    /// # Example
7745    /// ```ignore,no_run
7746    /// # use google_cloud_netapp_v1::model::TransferStats;
7747    /// use wkt::Timestamp;
7748    /// let x = TransferStats::new().set_update_time(Timestamp::default()/* use setters */);
7749    /// ```
7750    pub fn set_update_time<T>(mut self, v: T) -> Self
7751    where
7752        T: std::convert::Into<wkt::Timestamp>,
7753    {
7754        self.update_time = std::option::Option::Some(v.into());
7755        self
7756    }
7757
7758    /// Sets or clears the value of [update_time][crate::model::TransferStats::update_time].
7759    ///
7760    /// # Example
7761    /// ```ignore,no_run
7762    /// # use google_cloud_netapp_v1::model::TransferStats;
7763    /// use wkt::Timestamp;
7764    /// let x = TransferStats::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
7765    /// let x = TransferStats::new().set_or_clear_update_time(None::<Timestamp>);
7766    /// ```
7767    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7768    where
7769        T: std::convert::Into<wkt::Timestamp>,
7770    {
7771        self.update_time = v.map(|x| x.into());
7772        self
7773    }
7774
7775    /// Sets the value of [last_transfer_end_time][crate::model::TransferStats::last_transfer_end_time].
7776    ///
7777    /// # Example
7778    /// ```ignore,no_run
7779    /// # use google_cloud_netapp_v1::model::TransferStats;
7780    /// use wkt::Timestamp;
7781    /// let x = TransferStats::new().set_last_transfer_end_time(Timestamp::default()/* use setters */);
7782    /// ```
7783    pub fn set_last_transfer_end_time<T>(mut self, v: T) -> Self
7784    where
7785        T: std::convert::Into<wkt::Timestamp>,
7786    {
7787        self.last_transfer_end_time = std::option::Option::Some(v.into());
7788        self
7789    }
7790
7791    /// Sets or clears the value of [last_transfer_end_time][crate::model::TransferStats::last_transfer_end_time].
7792    ///
7793    /// # Example
7794    /// ```ignore,no_run
7795    /// # use google_cloud_netapp_v1::model::TransferStats;
7796    /// use wkt::Timestamp;
7797    /// let x = TransferStats::new().set_or_clear_last_transfer_end_time(Some(Timestamp::default()/* use setters */));
7798    /// let x = TransferStats::new().set_or_clear_last_transfer_end_time(None::<Timestamp>);
7799    /// ```
7800    pub fn set_or_clear_last_transfer_end_time<T>(mut self, v: std::option::Option<T>) -> Self
7801    where
7802        T: std::convert::Into<wkt::Timestamp>,
7803    {
7804        self.last_transfer_end_time = v.map(|x| x.into());
7805        self
7806    }
7807
7808    /// Sets the value of [last_transfer_error][crate::model::TransferStats::last_transfer_error].
7809    ///
7810    /// # Example
7811    /// ```ignore,no_run
7812    /// # use google_cloud_netapp_v1::model::TransferStats;
7813    /// let x = TransferStats::new().set_last_transfer_error("example");
7814    /// ```
7815    pub fn set_last_transfer_error<T>(mut self, v: T) -> Self
7816    where
7817        T: std::convert::Into<std::string::String>,
7818    {
7819        self.last_transfer_error = std::option::Option::Some(v.into());
7820        self
7821    }
7822
7823    /// Sets or clears the value of [last_transfer_error][crate::model::TransferStats::last_transfer_error].
7824    ///
7825    /// # Example
7826    /// ```ignore,no_run
7827    /// # use google_cloud_netapp_v1::model::TransferStats;
7828    /// let x = TransferStats::new().set_or_clear_last_transfer_error(Some("example"));
7829    /// let x = TransferStats::new().set_or_clear_last_transfer_error(None::<String>);
7830    /// ```
7831    pub fn set_or_clear_last_transfer_error<T>(mut self, v: std::option::Option<T>) -> Self
7832    where
7833        T: std::convert::Into<std::string::String>,
7834    {
7835        self.last_transfer_error = v.map(|x| x.into());
7836        self
7837    }
7838}
7839
7840impl wkt::message::Message for TransferStats {
7841    fn typename() -> &'static str {
7842        "type.googleapis.com/google.cloud.netapp.v1.TransferStats"
7843    }
7844}
7845
7846/// Replication is a nested resource under Volume, that describes a
7847/// cross-region replication relationship between 2 volumes in different
7848/// regions.
7849#[derive(Clone, Default, PartialEq)]
7850#[non_exhaustive]
7851pub struct Replication {
7852    /// Identifier. The resource name of the Replication.
7853    /// Format:
7854    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}`.
7855    pub name: std::string::String,
7856
7857    /// Output only. State of the replication.
7858    pub state: crate::model::replication::State,
7859
7860    /// Output only. State details of the replication.
7861    pub state_details: std::string::String,
7862
7863    /// Output only. Indicates whether this points to source or destination.
7864    pub role: crate::model::replication::ReplicationRole,
7865
7866    /// Required. Indicates the schedule for replication.
7867    pub replication_schedule: crate::model::replication::ReplicationSchedule,
7868
7869    /// Output only. Indicates the state of mirroring.
7870    pub mirror_state: crate::model::replication::MirrorState,
7871
7872    /// Output only. Condition of the relationship. Can be one of the following:
7873    ///
7874    /// - true: The replication relationship is healthy. It has not missed the most
7875    ///   recent scheduled transfer.
7876    /// - false: The replication relationship is not healthy. It has missed the
7877    ///   most recent scheduled transfer.
7878    pub healthy: std::option::Option<bool>,
7879
7880    /// Output only. Replication create time.
7881    pub create_time: std::option::Option<wkt::Timestamp>,
7882
7883    /// Output only. Full name of destination volume resource.
7884    /// Example : "projects/{project}/locations/{location}/volumes/{volume_id}"
7885    pub destination_volume: std::string::String,
7886
7887    /// Output only. Replication transfer statistics.
7888    pub transfer_stats: std::option::Option<crate::model::TransferStats>,
7889
7890    /// Resource labels to represent user provided metadata.
7891    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
7892
7893    /// A description about this replication relationship.
7894    pub description: std::option::Option<std::string::String>,
7895
7896    /// Required. Input only. Destination volume parameters
7897    pub destination_volume_parameters:
7898        std::option::Option<crate::model::DestinationVolumeParameters>,
7899
7900    /// Output only. Full name of source volume resource.
7901    /// Example : "projects/{project}/locations/{location}/volumes/{volume_id}"
7902    pub source_volume: std::string::String,
7903
7904    /// Output only. Hybrid peering details.
7905    pub hybrid_peering_details: std::option::Option<crate::model::HybridPeeringDetails>,
7906
7907    /// Optional. Location of the user cluster.
7908    pub cluster_location: std::string::String,
7909
7910    /// Output only. Type of the hybrid replication.
7911    pub hybrid_replication_type: crate::model::replication::HybridReplicationType,
7912
7913    /// Output only. Copy pastable snapmirror commands to be executed on onprem
7914    /// cluster by the customer.
7915    pub hybrid_replication_user_commands: std::option::Option<crate::model::UserCommands>,
7916
7917    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7918}
7919
7920impl Replication {
7921    pub fn new() -> Self {
7922        std::default::Default::default()
7923    }
7924
7925    /// Sets the value of [name][crate::model::Replication::name].
7926    ///
7927    /// # Example
7928    /// ```ignore,no_run
7929    /// # use google_cloud_netapp_v1::model::Replication;
7930    /// let x = Replication::new().set_name("example");
7931    /// ```
7932    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7933        self.name = v.into();
7934        self
7935    }
7936
7937    /// Sets the value of [state][crate::model::Replication::state].
7938    ///
7939    /// # Example
7940    /// ```ignore,no_run
7941    /// # use google_cloud_netapp_v1::model::Replication;
7942    /// use google_cloud_netapp_v1::model::replication::State;
7943    /// let x0 = Replication::new().set_state(State::Creating);
7944    /// let x1 = Replication::new().set_state(State::Ready);
7945    /// let x2 = Replication::new().set_state(State::Updating);
7946    /// ```
7947    pub fn set_state<T: std::convert::Into<crate::model::replication::State>>(
7948        mut self,
7949        v: T,
7950    ) -> Self {
7951        self.state = v.into();
7952        self
7953    }
7954
7955    /// Sets the value of [state_details][crate::model::Replication::state_details].
7956    ///
7957    /// # Example
7958    /// ```ignore,no_run
7959    /// # use google_cloud_netapp_v1::model::Replication;
7960    /// let x = Replication::new().set_state_details("example");
7961    /// ```
7962    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7963        self.state_details = v.into();
7964        self
7965    }
7966
7967    /// Sets the value of [role][crate::model::Replication::role].
7968    ///
7969    /// # Example
7970    /// ```ignore,no_run
7971    /// # use google_cloud_netapp_v1::model::Replication;
7972    /// use google_cloud_netapp_v1::model::replication::ReplicationRole;
7973    /// let x0 = Replication::new().set_role(ReplicationRole::Source);
7974    /// let x1 = Replication::new().set_role(ReplicationRole::Destination);
7975    /// ```
7976    pub fn set_role<T: std::convert::Into<crate::model::replication::ReplicationRole>>(
7977        mut self,
7978        v: T,
7979    ) -> Self {
7980        self.role = v.into();
7981        self
7982    }
7983
7984    /// Sets the value of [replication_schedule][crate::model::Replication::replication_schedule].
7985    ///
7986    /// # Example
7987    /// ```ignore,no_run
7988    /// # use google_cloud_netapp_v1::model::Replication;
7989    /// use google_cloud_netapp_v1::model::replication::ReplicationSchedule;
7990    /// let x0 = Replication::new().set_replication_schedule(ReplicationSchedule::Every10Minutes);
7991    /// let x1 = Replication::new().set_replication_schedule(ReplicationSchedule::Hourly);
7992    /// let x2 = Replication::new().set_replication_schedule(ReplicationSchedule::Daily);
7993    /// ```
7994    pub fn set_replication_schedule<
7995        T: std::convert::Into<crate::model::replication::ReplicationSchedule>,
7996    >(
7997        mut self,
7998        v: T,
7999    ) -> Self {
8000        self.replication_schedule = v.into();
8001        self
8002    }
8003
8004    /// Sets the value of [mirror_state][crate::model::Replication::mirror_state].
8005    ///
8006    /// # Example
8007    /// ```ignore,no_run
8008    /// # use google_cloud_netapp_v1::model::Replication;
8009    /// use google_cloud_netapp_v1::model::replication::MirrorState;
8010    /// let x0 = Replication::new().set_mirror_state(MirrorState::Preparing);
8011    /// let x1 = Replication::new().set_mirror_state(MirrorState::Mirrored);
8012    /// let x2 = Replication::new().set_mirror_state(MirrorState::Stopped);
8013    /// ```
8014    pub fn set_mirror_state<T: std::convert::Into<crate::model::replication::MirrorState>>(
8015        mut self,
8016        v: T,
8017    ) -> Self {
8018        self.mirror_state = v.into();
8019        self
8020    }
8021
8022    /// Sets the value of [healthy][crate::model::Replication::healthy].
8023    ///
8024    /// # Example
8025    /// ```ignore,no_run
8026    /// # use google_cloud_netapp_v1::model::Replication;
8027    /// let x = Replication::new().set_healthy(true);
8028    /// ```
8029    pub fn set_healthy<T>(mut self, v: T) -> Self
8030    where
8031        T: std::convert::Into<bool>,
8032    {
8033        self.healthy = std::option::Option::Some(v.into());
8034        self
8035    }
8036
8037    /// Sets or clears the value of [healthy][crate::model::Replication::healthy].
8038    ///
8039    /// # Example
8040    /// ```ignore,no_run
8041    /// # use google_cloud_netapp_v1::model::Replication;
8042    /// let x = Replication::new().set_or_clear_healthy(Some(false));
8043    /// let x = Replication::new().set_or_clear_healthy(None::<bool>);
8044    /// ```
8045    pub fn set_or_clear_healthy<T>(mut self, v: std::option::Option<T>) -> Self
8046    where
8047        T: std::convert::Into<bool>,
8048    {
8049        self.healthy = v.map(|x| x.into());
8050        self
8051    }
8052
8053    /// Sets the value of [create_time][crate::model::Replication::create_time].
8054    ///
8055    /// # Example
8056    /// ```ignore,no_run
8057    /// # use google_cloud_netapp_v1::model::Replication;
8058    /// use wkt::Timestamp;
8059    /// let x = Replication::new().set_create_time(Timestamp::default()/* use setters */);
8060    /// ```
8061    pub fn set_create_time<T>(mut self, v: T) -> Self
8062    where
8063        T: std::convert::Into<wkt::Timestamp>,
8064    {
8065        self.create_time = std::option::Option::Some(v.into());
8066        self
8067    }
8068
8069    /// Sets or clears the value of [create_time][crate::model::Replication::create_time].
8070    ///
8071    /// # Example
8072    /// ```ignore,no_run
8073    /// # use google_cloud_netapp_v1::model::Replication;
8074    /// use wkt::Timestamp;
8075    /// let x = Replication::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
8076    /// let x = Replication::new().set_or_clear_create_time(None::<Timestamp>);
8077    /// ```
8078    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
8079    where
8080        T: std::convert::Into<wkt::Timestamp>,
8081    {
8082        self.create_time = v.map(|x| x.into());
8083        self
8084    }
8085
8086    /// Sets the value of [destination_volume][crate::model::Replication::destination_volume].
8087    ///
8088    /// # Example
8089    /// ```ignore,no_run
8090    /// # use google_cloud_netapp_v1::model::Replication;
8091    /// let x = Replication::new().set_destination_volume("example");
8092    /// ```
8093    pub fn set_destination_volume<T: std::convert::Into<std::string::String>>(
8094        mut self,
8095        v: T,
8096    ) -> Self {
8097        self.destination_volume = v.into();
8098        self
8099    }
8100
8101    /// Sets the value of [transfer_stats][crate::model::Replication::transfer_stats].
8102    ///
8103    /// # Example
8104    /// ```ignore,no_run
8105    /// # use google_cloud_netapp_v1::model::Replication;
8106    /// use google_cloud_netapp_v1::model::TransferStats;
8107    /// let x = Replication::new().set_transfer_stats(TransferStats::default()/* use setters */);
8108    /// ```
8109    pub fn set_transfer_stats<T>(mut self, v: T) -> Self
8110    where
8111        T: std::convert::Into<crate::model::TransferStats>,
8112    {
8113        self.transfer_stats = std::option::Option::Some(v.into());
8114        self
8115    }
8116
8117    /// Sets or clears the value of [transfer_stats][crate::model::Replication::transfer_stats].
8118    ///
8119    /// # Example
8120    /// ```ignore,no_run
8121    /// # use google_cloud_netapp_v1::model::Replication;
8122    /// use google_cloud_netapp_v1::model::TransferStats;
8123    /// let x = Replication::new().set_or_clear_transfer_stats(Some(TransferStats::default()/* use setters */));
8124    /// let x = Replication::new().set_or_clear_transfer_stats(None::<TransferStats>);
8125    /// ```
8126    pub fn set_or_clear_transfer_stats<T>(mut self, v: std::option::Option<T>) -> Self
8127    where
8128        T: std::convert::Into<crate::model::TransferStats>,
8129    {
8130        self.transfer_stats = v.map(|x| x.into());
8131        self
8132    }
8133
8134    /// Sets the value of [labels][crate::model::Replication::labels].
8135    ///
8136    /// # Example
8137    /// ```ignore,no_run
8138    /// # use google_cloud_netapp_v1::model::Replication;
8139    /// let x = Replication::new().set_labels([
8140    ///     ("key0", "abc"),
8141    ///     ("key1", "xyz"),
8142    /// ]);
8143    /// ```
8144    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
8145    where
8146        T: std::iter::IntoIterator<Item = (K, V)>,
8147        K: std::convert::Into<std::string::String>,
8148        V: std::convert::Into<std::string::String>,
8149    {
8150        use std::iter::Iterator;
8151        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
8152        self
8153    }
8154
8155    /// Sets the value of [description][crate::model::Replication::description].
8156    ///
8157    /// # Example
8158    /// ```ignore,no_run
8159    /// # use google_cloud_netapp_v1::model::Replication;
8160    /// let x = Replication::new().set_description("example");
8161    /// ```
8162    pub fn set_description<T>(mut self, v: T) -> Self
8163    where
8164        T: std::convert::Into<std::string::String>,
8165    {
8166        self.description = std::option::Option::Some(v.into());
8167        self
8168    }
8169
8170    /// Sets or clears the value of [description][crate::model::Replication::description].
8171    ///
8172    /// # Example
8173    /// ```ignore,no_run
8174    /// # use google_cloud_netapp_v1::model::Replication;
8175    /// let x = Replication::new().set_or_clear_description(Some("example"));
8176    /// let x = Replication::new().set_or_clear_description(None::<String>);
8177    /// ```
8178    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
8179    where
8180        T: std::convert::Into<std::string::String>,
8181    {
8182        self.description = v.map(|x| x.into());
8183        self
8184    }
8185
8186    /// Sets the value of [destination_volume_parameters][crate::model::Replication::destination_volume_parameters].
8187    ///
8188    /// # Example
8189    /// ```ignore,no_run
8190    /// # use google_cloud_netapp_v1::model::Replication;
8191    /// use google_cloud_netapp_v1::model::DestinationVolumeParameters;
8192    /// let x = Replication::new().set_destination_volume_parameters(DestinationVolumeParameters::default()/* use setters */);
8193    /// ```
8194    pub fn set_destination_volume_parameters<T>(mut self, v: T) -> Self
8195    where
8196        T: std::convert::Into<crate::model::DestinationVolumeParameters>,
8197    {
8198        self.destination_volume_parameters = std::option::Option::Some(v.into());
8199        self
8200    }
8201
8202    /// Sets or clears the value of [destination_volume_parameters][crate::model::Replication::destination_volume_parameters].
8203    ///
8204    /// # Example
8205    /// ```ignore,no_run
8206    /// # use google_cloud_netapp_v1::model::Replication;
8207    /// use google_cloud_netapp_v1::model::DestinationVolumeParameters;
8208    /// let x = Replication::new().set_or_clear_destination_volume_parameters(Some(DestinationVolumeParameters::default()/* use setters */));
8209    /// let x = Replication::new().set_or_clear_destination_volume_parameters(None::<DestinationVolumeParameters>);
8210    /// ```
8211    pub fn set_or_clear_destination_volume_parameters<T>(
8212        mut self,
8213        v: std::option::Option<T>,
8214    ) -> Self
8215    where
8216        T: std::convert::Into<crate::model::DestinationVolumeParameters>,
8217    {
8218        self.destination_volume_parameters = v.map(|x| x.into());
8219        self
8220    }
8221
8222    /// Sets the value of [source_volume][crate::model::Replication::source_volume].
8223    ///
8224    /// # Example
8225    /// ```ignore,no_run
8226    /// # use google_cloud_netapp_v1::model::Replication;
8227    /// let x = Replication::new().set_source_volume("example");
8228    /// ```
8229    pub fn set_source_volume<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8230        self.source_volume = v.into();
8231        self
8232    }
8233
8234    /// Sets the value of [hybrid_peering_details][crate::model::Replication::hybrid_peering_details].
8235    ///
8236    /// # Example
8237    /// ```ignore,no_run
8238    /// # use google_cloud_netapp_v1::model::Replication;
8239    /// use google_cloud_netapp_v1::model::HybridPeeringDetails;
8240    /// let x = Replication::new().set_hybrid_peering_details(HybridPeeringDetails::default()/* use setters */);
8241    /// ```
8242    pub fn set_hybrid_peering_details<T>(mut self, v: T) -> Self
8243    where
8244        T: std::convert::Into<crate::model::HybridPeeringDetails>,
8245    {
8246        self.hybrid_peering_details = std::option::Option::Some(v.into());
8247        self
8248    }
8249
8250    /// Sets or clears the value of [hybrid_peering_details][crate::model::Replication::hybrid_peering_details].
8251    ///
8252    /// # Example
8253    /// ```ignore,no_run
8254    /// # use google_cloud_netapp_v1::model::Replication;
8255    /// use google_cloud_netapp_v1::model::HybridPeeringDetails;
8256    /// let x = Replication::new().set_or_clear_hybrid_peering_details(Some(HybridPeeringDetails::default()/* use setters */));
8257    /// let x = Replication::new().set_or_clear_hybrid_peering_details(None::<HybridPeeringDetails>);
8258    /// ```
8259    pub fn set_or_clear_hybrid_peering_details<T>(mut self, v: std::option::Option<T>) -> Self
8260    where
8261        T: std::convert::Into<crate::model::HybridPeeringDetails>,
8262    {
8263        self.hybrid_peering_details = v.map(|x| x.into());
8264        self
8265    }
8266
8267    /// Sets the value of [cluster_location][crate::model::Replication::cluster_location].
8268    ///
8269    /// # Example
8270    /// ```ignore,no_run
8271    /// # use google_cloud_netapp_v1::model::Replication;
8272    /// let x = Replication::new().set_cluster_location("example");
8273    /// ```
8274    pub fn set_cluster_location<T: std::convert::Into<std::string::String>>(
8275        mut self,
8276        v: T,
8277    ) -> Self {
8278        self.cluster_location = v.into();
8279        self
8280    }
8281
8282    /// Sets the value of [hybrid_replication_type][crate::model::Replication::hybrid_replication_type].
8283    ///
8284    /// # Example
8285    /// ```ignore,no_run
8286    /// # use google_cloud_netapp_v1::model::Replication;
8287    /// use google_cloud_netapp_v1::model::replication::HybridReplicationType;
8288    /// let x0 = Replication::new().set_hybrid_replication_type(HybridReplicationType::Migration);
8289    /// let x1 = Replication::new().set_hybrid_replication_type(HybridReplicationType::ContinuousReplication);
8290    /// let x2 = Replication::new().set_hybrid_replication_type(HybridReplicationType::OnpremReplication);
8291    /// ```
8292    pub fn set_hybrid_replication_type<
8293        T: std::convert::Into<crate::model::replication::HybridReplicationType>,
8294    >(
8295        mut self,
8296        v: T,
8297    ) -> Self {
8298        self.hybrid_replication_type = v.into();
8299        self
8300    }
8301
8302    /// Sets the value of [hybrid_replication_user_commands][crate::model::Replication::hybrid_replication_user_commands].
8303    ///
8304    /// # Example
8305    /// ```ignore,no_run
8306    /// # use google_cloud_netapp_v1::model::Replication;
8307    /// use google_cloud_netapp_v1::model::UserCommands;
8308    /// let x = Replication::new().set_hybrid_replication_user_commands(UserCommands::default()/* use setters */);
8309    /// ```
8310    pub fn set_hybrid_replication_user_commands<T>(mut self, v: T) -> Self
8311    where
8312        T: std::convert::Into<crate::model::UserCommands>,
8313    {
8314        self.hybrid_replication_user_commands = std::option::Option::Some(v.into());
8315        self
8316    }
8317
8318    /// Sets or clears the value of [hybrid_replication_user_commands][crate::model::Replication::hybrid_replication_user_commands].
8319    ///
8320    /// # Example
8321    /// ```ignore,no_run
8322    /// # use google_cloud_netapp_v1::model::Replication;
8323    /// use google_cloud_netapp_v1::model::UserCommands;
8324    /// let x = Replication::new().set_or_clear_hybrid_replication_user_commands(Some(UserCommands::default()/* use setters */));
8325    /// let x = Replication::new().set_or_clear_hybrid_replication_user_commands(None::<UserCommands>);
8326    /// ```
8327    pub fn set_or_clear_hybrid_replication_user_commands<T>(
8328        mut self,
8329        v: std::option::Option<T>,
8330    ) -> Self
8331    where
8332        T: std::convert::Into<crate::model::UserCommands>,
8333    {
8334        self.hybrid_replication_user_commands = v.map(|x| x.into());
8335        self
8336    }
8337}
8338
8339impl wkt::message::Message for Replication {
8340    fn typename() -> &'static str {
8341        "type.googleapis.com/google.cloud.netapp.v1.Replication"
8342    }
8343}
8344
8345/// Defines additional types related to [Replication].
8346pub mod replication {
8347    #[allow(unused_imports)]
8348    use super::*;
8349
8350    /// The replication states
8351    /// New enum values may be added in future to indicate possible new states.
8352    ///
8353    /// # Working with unknown values
8354    ///
8355    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8356    /// additional enum variants at any time. Adding new variants is not considered
8357    /// a breaking change. Applications should write their code in anticipation of:
8358    ///
8359    /// - New values appearing in future releases of the client library, **and**
8360    /// - New values received dynamically, without application changes.
8361    ///
8362    /// Please consult the [Working with enums] section in the user guide for some
8363    /// guidelines.
8364    ///
8365    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8366    #[derive(Clone, Debug, PartialEq)]
8367    #[non_exhaustive]
8368    pub enum State {
8369        /// Unspecified replication State
8370        Unspecified,
8371        /// Replication is creating.
8372        Creating,
8373        /// Replication is ready.
8374        Ready,
8375        /// Replication is updating.
8376        Updating,
8377        /// Replication is deleting.
8378        Deleting,
8379        /// Replication is in error state.
8380        Error,
8381        /// Replication is waiting for cluster peering to be established.
8382        PendingClusterPeering,
8383        /// Replication is waiting for SVM peering to be established.
8384        PendingSvmPeering,
8385        /// Replication is waiting for Commands to be executed on Onprem ONTAP.
8386        PendingRemoteResync,
8387        /// Onprem ONTAP is destination and Replication can only be managed from
8388        /// Onprem.
8389        ExternallyManagedReplication,
8390        /// If set, the enum was initialized with an unknown value.
8391        ///
8392        /// Applications can examine the value using [State::value] or
8393        /// [State::name].
8394        UnknownValue(state::UnknownValue),
8395    }
8396
8397    #[doc(hidden)]
8398    pub mod state {
8399        #[allow(unused_imports)]
8400        use super::*;
8401        #[derive(Clone, Debug, PartialEq)]
8402        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8403    }
8404
8405    impl State {
8406        /// Gets the enum value.
8407        ///
8408        /// Returns `None` if the enum contains an unknown value deserialized from
8409        /// the string representation of enums.
8410        pub fn value(&self) -> std::option::Option<i32> {
8411            match self {
8412                Self::Unspecified => std::option::Option::Some(0),
8413                Self::Creating => std::option::Option::Some(1),
8414                Self::Ready => std::option::Option::Some(2),
8415                Self::Updating => std::option::Option::Some(3),
8416                Self::Deleting => std::option::Option::Some(5),
8417                Self::Error => std::option::Option::Some(6),
8418                Self::PendingClusterPeering => std::option::Option::Some(8),
8419                Self::PendingSvmPeering => std::option::Option::Some(9),
8420                Self::PendingRemoteResync => std::option::Option::Some(10),
8421                Self::ExternallyManagedReplication => std::option::Option::Some(11),
8422                Self::UnknownValue(u) => u.0.value(),
8423            }
8424        }
8425
8426        /// Gets the enum value as a string.
8427        ///
8428        /// Returns `None` if the enum contains an unknown value deserialized from
8429        /// the integer representation of enums.
8430        pub fn name(&self) -> std::option::Option<&str> {
8431            match self {
8432                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
8433                Self::Creating => std::option::Option::Some("CREATING"),
8434                Self::Ready => std::option::Option::Some("READY"),
8435                Self::Updating => std::option::Option::Some("UPDATING"),
8436                Self::Deleting => std::option::Option::Some("DELETING"),
8437                Self::Error => std::option::Option::Some("ERROR"),
8438                Self::PendingClusterPeering => std::option::Option::Some("PENDING_CLUSTER_PEERING"),
8439                Self::PendingSvmPeering => std::option::Option::Some("PENDING_SVM_PEERING"),
8440                Self::PendingRemoteResync => std::option::Option::Some("PENDING_REMOTE_RESYNC"),
8441                Self::ExternallyManagedReplication => {
8442                    std::option::Option::Some("EXTERNALLY_MANAGED_REPLICATION")
8443                }
8444                Self::UnknownValue(u) => u.0.name(),
8445            }
8446        }
8447    }
8448
8449    impl std::default::Default for State {
8450        fn default() -> Self {
8451            use std::convert::From;
8452            Self::from(0)
8453        }
8454    }
8455
8456    impl std::fmt::Display for State {
8457        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8458            wkt::internal::display_enum(f, self.name(), self.value())
8459        }
8460    }
8461
8462    impl std::convert::From<i32> for State {
8463        fn from(value: i32) -> Self {
8464            match value {
8465                0 => Self::Unspecified,
8466                1 => Self::Creating,
8467                2 => Self::Ready,
8468                3 => Self::Updating,
8469                5 => Self::Deleting,
8470                6 => Self::Error,
8471                8 => Self::PendingClusterPeering,
8472                9 => Self::PendingSvmPeering,
8473                10 => Self::PendingRemoteResync,
8474                11 => Self::ExternallyManagedReplication,
8475                _ => Self::UnknownValue(state::UnknownValue(
8476                    wkt::internal::UnknownEnumValue::Integer(value),
8477                )),
8478            }
8479        }
8480    }
8481
8482    impl std::convert::From<&str> for State {
8483        fn from(value: &str) -> Self {
8484            use std::string::ToString;
8485            match value {
8486                "STATE_UNSPECIFIED" => Self::Unspecified,
8487                "CREATING" => Self::Creating,
8488                "READY" => Self::Ready,
8489                "UPDATING" => Self::Updating,
8490                "DELETING" => Self::Deleting,
8491                "ERROR" => Self::Error,
8492                "PENDING_CLUSTER_PEERING" => Self::PendingClusterPeering,
8493                "PENDING_SVM_PEERING" => Self::PendingSvmPeering,
8494                "PENDING_REMOTE_RESYNC" => Self::PendingRemoteResync,
8495                "EXTERNALLY_MANAGED_REPLICATION" => Self::ExternallyManagedReplication,
8496                _ => Self::UnknownValue(state::UnknownValue(
8497                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8498                )),
8499            }
8500        }
8501    }
8502
8503    impl serde::ser::Serialize for State {
8504        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8505        where
8506            S: serde::Serializer,
8507        {
8508            match self {
8509                Self::Unspecified => serializer.serialize_i32(0),
8510                Self::Creating => serializer.serialize_i32(1),
8511                Self::Ready => serializer.serialize_i32(2),
8512                Self::Updating => serializer.serialize_i32(3),
8513                Self::Deleting => serializer.serialize_i32(5),
8514                Self::Error => serializer.serialize_i32(6),
8515                Self::PendingClusterPeering => serializer.serialize_i32(8),
8516                Self::PendingSvmPeering => serializer.serialize_i32(9),
8517                Self::PendingRemoteResync => serializer.serialize_i32(10),
8518                Self::ExternallyManagedReplication => serializer.serialize_i32(11),
8519                Self::UnknownValue(u) => u.0.serialize(serializer),
8520            }
8521        }
8522    }
8523
8524    impl<'de> serde::de::Deserialize<'de> for State {
8525        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8526        where
8527            D: serde::Deserializer<'de>,
8528        {
8529            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
8530                ".google.cloud.netapp.v1.Replication.State",
8531            ))
8532        }
8533    }
8534
8535    /// New enum values may be added in future to support different replication
8536    /// topology.
8537    ///
8538    /// # Working with unknown values
8539    ///
8540    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8541    /// additional enum variants at any time. Adding new variants is not considered
8542    /// a breaking change. Applications should write their code in anticipation of:
8543    ///
8544    /// - New values appearing in future releases of the client library, **and**
8545    /// - New values received dynamically, without application changes.
8546    ///
8547    /// Please consult the [Working with enums] section in the user guide for some
8548    /// guidelines.
8549    ///
8550    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8551    #[derive(Clone, Debug, PartialEq)]
8552    #[non_exhaustive]
8553    pub enum ReplicationRole {
8554        /// Unspecified replication role
8555        Unspecified,
8556        /// Indicates Source volume.
8557        Source,
8558        /// Indicates Destination volume.
8559        Destination,
8560        /// If set, the enum was initialized with an unknown value.
8561        ///
8562        /// Applications can examine the value using [ReplicationRole::value] or
8563        /// [ReplicationRole::name].
8564        UnknownValue(replication_role::UnknownValue),
8565    }
8566
8567    #[doc(hidden)]
8568    pub mod replication_role {
8569        #[allow(unused_imports)]
8570        use super::*;
8571        #[derive(Clone, Debug, PartialEq)]
8572        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8573    }
8574
8575    impl ReplicationRole {
8576        /// Gets the enum value.
8577        ///
8578        /// Returns `None` if the enum contains an unknown value deserialized from
8579        /// the string representation of enums.
8580        pub fn value(&self) -> std::option::Option<i32> {
8581            match self {
8582                Self::Unspecified => std::option::Option::Some(0),
8583                Self::Source => std::option::Option::Some(1),
8584                Self::Destination => std::option::Option::Some(2),
8585                Self::UnknownValue(u) => u.0.value(),
8586            }
8587        }
8588
8589        /// Gets the enum value as a string.
8590        ///
8591        /// Returns `None` if the enum contains an unknown value deserialized from
8592        /// the integer representation of enums.
8593        pub fn name(&self) -> std::option::Option<&str> {
8594            match self {
8595                Self::Unspecified => std::option::Option::Some("REPLICATION_ROLE_UNSPECIFIED"),
8596                Self::Source => std::option::Option::Some("SOURCE"),
8597                Self::Destination => std::option::Option::Some("DESTINATION"),
8598                Self::UnknownValue(u) => u.0.name(),
8599            }
8600        }
8601    }
8602
8603    impl std::default::Default for ReplicationRole {
8604        fn default() -> Self {
8605            use std::convert::From;
8606            Self::from(0)
8607        }
8608    }
8609
8610    impl std::fmt::Display for ReplicationRole {
8611        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8612            wkt::internal::display_enum(f, self.name(), self.value())
8613        }
8614    }
8615
8616    impl std::convert::From<i32> for ReplicationRole {
8617        fn from(value: i32) -> Self {
8618            match value {
8619                0 => Self::Unspecified,
8620                1 => Self::Source,
8621                2 => Self::Destination,
8622                _ => Self::UnknownValue(replication_role::UnknownValue(
8623                    wkt::internal::UnknownEnumValue::Integer(value),
8624                )),
8625            }
8626        }
8627    }
8628
8629    impl std::convert::From<&str> for ReplicationRole {
8630        fn from(value: &str) -> Self {
8631            use std::string::ToString;
8632            match value {
8633                "REPLICATION_ROLE_UNSPECIFIED" => Self::Unspecified,
8634                "SOURCE" => Self::Source,
8635                "DESTINATION" => Self::Destination,
8636                _ => Self::UnknownValue(replication_role::UnknownValue(
8637                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8638                )),
8639            }
8640        }
8641    }
8642
8643    impl serde::ser::Serialize for ReplicationRole {
8644        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8645        where
8646            S: serde::Serializer,
8647        {
8648            match self {
8649                Self::Unspecified => serializer.serialize_i32(0),
8650                Self::Source => serializer.serialize_i32(1),
8651                Self::Destination => serializer.serialize_i32(2),
8652                Self::UnknownValue(u) => u.0.serialize(serializer),
8653            }
8654        }
8655    }
8656
8657    impl<'de> serde::de::Deserialize<'de> for ReplicationRole {
8658        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8659        where
8660            D: serde::Deserializer<'de>,
8661        {
8662            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicationRole>::new(
8663                ".google.cloud.netapp.v1.Replication.ReplicationRole",
8664            ))
8665        }
8666    }
8667
8668    /// Schedule for Replication.
8669    /// New enum values may be added in future to support different frequency of
8670    /// replication.
8671    ///
8672    /// # Working with unknown values
8673    ///
8674    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8675    /// additional enum variants at any time. Adding new variants is not considered
8676    /// a breaking change. Applications should write their code in anticipation of:
8677    ///
8678    /// - New values appearing in future releases of the client library, **and**
8679    /// - New values received dynamically, without application changes.
8680    ///
8681    /// Please consult the [Working with enums] section in the user guide for some
8682    /// guidelines.
8683    ///
8684    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8685    #[derive(Clone, Debug, PartialEq)]
8686    #[non_exhaustive]
8687    pub enum ReplicationSchedule {
8688        /// Unspecified ReplicationSchedule
8689        Unspecified,
8690        /// Replication happens once every 10 minutes.
8691        Every10Minutes,
8692        /// Replication happens once every hour.
8693        Hourly,
8694        /// Replication happens once every day.
8695        Daily,
8696        /// If set, the enum was initialized with an unknown value.
8697        ///
8698        /// Applications can examine the value using [ReplicationSchedule::value] or
8699        /// [ReplicationSchedule::name].
8700        UnknownValue(replication_schedule::UnknownValue),
8701    }
8702
8703    #[doc(hidden)]
8704    pub mod replication_schedule {
8705        #[allow(unused_imports)]
8706        use super::*;
8707        #[derive(Clone, Debug, PartialEq)]
8708        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8709    }
8710
8711    impl ReplicationSchedule {
8712        /// Gets the enum value.
8713        ///
8714        /// Returns `None` if the enum contains an unknown value deserialized from
8715        /// the string representation of enums.
8716        pub fn value(&self) -> std::option::Option<i32> {
8717            match self {
8718                Self::Unspecified => std::option::Option::Some(0),
8719                Self::Every10Minutes => std::option::Option::Some(1),
8720                Self::Hourly => std::option::Option::Some(2),
8721                Self::Daily => std::option::Option::Some(3),
8722                Self::UnknownValue(u) => u.0.value(),
8723            }
8724        }
8725
8726        /// Gets the enum value as a string.
8727        ///
8728        /// Returns `None` if the enum contains an unknown value deserialized from
8729        /// the integer representation of enums.
8730        pub fn name(&self) -> std::option::Option<&str> {
8731            match self {
8732                Self::Unspecified => std::option::Option::Some("REPLICATION_SCHEDULE_UNSPECIFIED"),
8733                Self::Every10Minutes => std::option::Option::Some("EVERY_10_MINUTES"),
8734                Self::Hourly => std::option::Option::Some("HOURLY"),
8735                Self::Daily => std::option::Option::Some("DAILY"),
8736                Self::UnknownValue(u) => u.0.name(),
8737            }
8738        }
8739    }
8740
8741    impl std::default::Default for ReplicationSchedule {
8742        fn default() -> Self {
8743            use std::convert::From;
8744            Self::from(0)
8745        }
8746    }
8747
8748    impl std::fmt::Display for ReplicationSchedule {
8749        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8750            wkt::internal::display_enum(f, self.name(), self.value())
8751        }
8752    }
8753
8754    impl std::convert::From<i32> for ReplicationSchedule {
8755        fn from(value: i32) -> Self {
8756            match value {
8757                0 => Self::Unspecified,
8758                1 => Self::Every10Minutes,
8759                2 => Self::Hourly,
8760                3 => Self::Daily,
8761                _ => Self::UnknownValue(replication_schedule::UnknownValue(
8762                    wkt::internal::UnknownEnumValue::Integer(value),
8763                )),
8764            }
8765        }
8766    }
8767
8768    impl std::convert::From<&str> for ReplicationSchedule {
8769        fn from(value: &str) -> Self {
8770            use std::string::ToString;
8771            match value {
8772                "REPLICATION_SCHEDULE_UNSPECIFIED" => Self::Unspecified,
8773                "EVERY_10_MINUTES" => Self::Every10Minutes,
8774                "HOURLY" => Self::Hourly,
8775                "DAILY" => Self::Daily,
8776                _ => Self::UnknownValue(replication_schedule::UnknownValue(
8777                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8778                )),
8779            }
8780        }
8781    }
8782
8783    impl serde::ser::Serialize for ReplicationSchedule {
8784        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8785        where
8786            S: serde::Serializer,
8787        {
8788            match self {
8789                Self::Unspecified => serializer.serialize_i32(0),
8790                Self::Every10Minutes => serializer.serialize_i32(1),
8791                Self::Hourly => serializer.serialize_i32(2),
8792                Self::Daily => serializer.serialize_i32(3),
8793                Self::UnknownValue(u) => u.0.serialize(serializer),
8794            }
8795        }
8796    }
8797
8798    impl<'de> serde::de::Deserialize<'de> for ReplicationSchedule {
8799        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8800        where
8801            D: serde::Deserializer<'de>,
8802        {
8803            deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicationSchedule>::new(
8804                ".google.cloud.netapp.v1.Replication.ReplicationSchedule",
8805            ))
8806        }
8807    }
8808
8809    /// Mirroring states.
8810    /// No new value is expected to be added in future.
8811    ///
8812    /// # Working with unknown values
8813    ///
8814    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8815    /// additional enum variants at any time. Adding new variants is not considered
8816    /// a breaking change. Applications should write their code in anticipation of:
8817    ///
8818    /// - New values appearing in future releases of the client library, **and**
8819    /// - New values received dynamically, without application changes.
8820    ///
8821    /// Please consult the [Working with enums] section in the user guide for some
8822    /// guidelines.
8823    ///
8824    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8825    #[derive(Clone, Debug, PartialEq)]
8826    #[non_exhaustive]
8827    pub enum MirrorState {
8828        /// Unspecified MirrorState
8829        Unspecified,
8830        /// Destination volume is being prepared.
8831        Preparing,
8832        /// Destination volume has been initialized and is ready to receive
8833        /// replication transfers.
8834        Mirrored,
8835        /// Destination volume is not receiving replication transfers.
8836        Stopped,
8837        /// Incremental replication is in progress.
8838        Transferring,
8839        /// Baseline replication is in progress.
8840        BaselineTransferring,
8841        /// Replication is aborted.
8842        Aborted,
8843        /// Replication is being managed from Onprem ONTAP.
8844        ExternallyManaged,
8845        /// Peering is yet to be established.
8846        PendingPeering,
8847        /// If set, the enum was initialized with an unknown value.
8848        ///
8849        /// Applications can examine the value using [MirrorState::value] or
8850        /// [MirrorState::name].
8851        UnknownValue(mirror_state::UnknownValue),
8852    }
8853
8854    #[doc(hidden)]
8855    pub mod mirror_state {
8856        #[allow(unused_imports)]
8857        use super::*;
8858        #[derive(Clone, Debug, PartialEq)]
8859        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8860    }
8861
8862    impl MirrorState {
8863        /// Gets the enum value.
8864        ///
8865        /// Returns `None` if the enum contains an unknown value deserialized from
8866        /// the string representation of enums.
8867        pub fn value(&self) -> std::option::Option<i32> {
8868            match self {
8869                Self::Unspecified => std::option::Option::Some(0),
8870                Self::Preparing => std::option::Option::Some(1),
8871                Self::Mirrored => std::option::Option::Some(2),
8872                Self::Stopped => std::option::Option::Some(3),
8873                Self::Transferring => std::option::Option::Some(4),
8874                Self::BaselineTransferring => std::option::Option::Some(5),
8875                Self::Aborted => std::option::Option::Some(6),
8876                Self::ExternallyManaged => std::option::Option::Some(7),
8877                Self::PendingPeering => std::option::Option::Some(8),
8878                Self::UnknownValue(u) => u.0.value(),
8879            }
8880        }
8881
8882        /// Gets the enum value as a string.
8883        ///
8884        /// Returns `None` if the enum contains an unknown value deserialized from
8885        /// the integer representation of enums.
8886        pub fn name(&self) -> std::option::Option<&str> {
8887            match self {
8888                Self::Unspecified => std::option::Option::Some("MIRROR_STATE_UNSPECIFIED"),
8889                Self::Preparing => std::option::Option::Some("PREPARING"),
8890                Self::Mirrored => std::option::Option::Some("MIRRORED"),
8891                Self::Stopped => std::option::Option::Some("STOPPED"),
8892                Self::Transferring => std::option::Option::Some("TRANSFERRING"),
8893                Self::BaselineTransferring => std::option::Option::Some("BASELINE_TRANSFERRING"),
8894                Self::Aborted => std::option::Option::Some("ABORTED"),
8895                Self::ExternallyManaged => std::option::Option::Some("EXTERNALLY_MANAGED"),
8896                Self::PendingPeering => std::option::Option::Some("PENDING_PEERING"),
8897                Self::UnknownValue(u) => u.0.name(),
8898            }
8899        }
8900    }
8901
8902    impl std::default::Default for MirrorState {
8903        fn default() -> Self {
8904            use std::convert::From;
8905            Self::from(0)
8906        }
8907    }
8908
8909    impl std::fmt::Display for MirrorState {
8910        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8911            wkt::internal::display_enum(f, self.name(), self.value())
8912        }
8913    }
8914
8915    impl std::convert::From<i32> for MirrorState {
8916        fn from(value: i32) -> Self {
8917            match value {
8918                0 => Self::Unspecified,
8919                1 => Self::Preparing,
8920                2 => Self::Mirrored,
8921                3 => Self::Stopped,
8922                4 => Self::Transferring,
8923                5 => Self::BaselineTransferring,
8924                6 => Self::Aborted,
8925                7 => Self::ExternallyManaged,
8926                8 => Self::PendingPeering,
8927                _ => Self::UnknownValue(mirror_state::UnknownValue(
8928                    wkt::internal::UnknownEnumValue::Integer(value),
8929                )),
8930            }
8931        }
8932    }
8933
8934    impl std::convert::From<&str> for MirrorState {
8935        fn from(value: &str) -> Self {
8936            use std::string::ToString;
8937            match value {
8938                "MIRROR_STATE_UNSPECIFIED" => Self::Unspecified,
8939                "PREPARING" => Self::Preparing,
8940                "MIRRORED" => Self::Mirrored,
8941                "STOPPED" => Self::Stopped,
8942                "TRANSFERRING" => Self::Transferring,
8943                "BASELINE_TRANSFERRING" => Self::BaselineTransferring,
8944                "ABORTED" => Self::Aborted,
8945                "EXTERNALLY_MANAGED" => Self::ExternallyManaged,
8946                "PENDING_PEERING" => Self::PendingPeering,
8947                _ => Self::UnknownValue(mirror_state::UnknownValue(
8948                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8949                )),
8950            }
8951        }
8952    }
8953
8954    impl serde::ser::Serialize for MirrorState {
8955        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8956        where
8957            S: serde::Serializer,
8958        {
8959            match self {
8960                Self::Unspecified => serializer.serialize_i32(0),
8961                Self::Preparing => serializer.serialize_i32(1),
8962                Self::Mirrored => serializer.serialize_i32(2),
8963                Self::Stopped => serializer.serialize_i32(3),
8964                Self::Transferring => serializer.serialize_i32(4),
8965                Self::BaselineTransferring => serializer.serialize_i32(5),
8966                Self::Aborted => serializer.serialize_i32(6),
8967                Self::ExternallyManaged => serializer.serialize_i32(7),
8968                Self::PendingPeering => serializer.serialize_i32(8),
8969                Self::UnknownValue(u) => u.0.serialize(serializer),
8970            }
8971        }
8972    }
8973
8974    impl<'de> serde::de::Deserialize<'de> for MirrorState {
8975        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8976        where
8977            D: serde::Deserializer<'de>,
8978        {
8979            deserializer.deserialize_any(wkt::internal::EnumVisitor::<MirrorState>::new(
8980                ".google.cloud.netapp.v1.Replication.MirrorState",
8981            ))
8982        }
8983    }
8984
8985    /// Hybrid replication type.
8986    ///
8987    /// # Working with unknown values
8988    ///
8989    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8990    /// additional enum variants at any time. Adding new variants is not considered
8991    /// a breaking change. Applications should write their code in anticipation of:
8992    ///
8993    /// - New values appearing in future releases of the client library, **and**
8994    /// - New values received dynamically, without application changes.
8995    ///
8996    /// Please consult the [Working with enums] section in the user guide for some
8997    /// guidelines.
8998    ///
8999    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9000    #[derive(Clone, Debug, PartialEq)]
9001    #[non_exhaustive]
9002    pub enum HybridReplicationType {
9003        /// Unspecified hybrid replication type.
9004        Unspecified,
9005        /// Hybrid replication type for migration.
9006        Migration,
9007        /// Hybrid replication type for continuous replication.
9008        ContinuousReplication,
9009        /// New field for reversible OnPrem replication, to be used for data
9010        /// protection.
9011        OnpremReplication,
9012        /// Hybrid replication type for incremental Transfer in the reverse direction
9013        /// (GCNV is source and Onprem is destination)
9014        ReverseOnpremReplication,
9015        /// If set, the enum was initialized with an unknown value.
9016        ///
9017        /// Applications can examine the value using [HybridReplicationType::value] or
9018        /// [HybridReplicationType::name].
9019        UnknownValue(hybrid_replication_type::UnknownValue),
9020    }
9021
9022    #[doc(hidden)]
9023    pub mod hybrid_replication_type {
9024        #[allow(unused_imports)]
9025        use super::*;
9026        #[derive(Clone, Debug, PartialEq)]
9027        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9028    }
9029
9030    impl HybridReplicationType {
9031        /// Gets the enum value.
9032        ///
9033        /// Returns `None` if the enum contains an unknown value deserialized from
9034        /// the string representation of enums.
9035        pub fn value(&self) -> std::option::Option<i32> {
9036            match self {
9037                Self::Unspecified => std::option::Option::Some(0),
9038                Self::Migration => std::option::Option::Some(1),
9039                Self::ContinuousReplication => std::option::Option::Some(2),
9040                Self::OnpremReplication => std::option::Option::Some(3),
9041                Self::ReverseOnpremReplication => std::option::Option::Some(4),
9042                Self::UnknownValue(u) => u.0.value(),
9043            }
9044        }
9045
9046        /// Gets the enum value as a string.
9047        ///
9048        /// Returns `None` if the enum contains an unknown value deserialized from
9049        /// the integer representation of enums.
9050        pub fn name(&self) -> std::option::Option<&str> {
9051            match self {
9052                Self::Unspecified => {
9053                    std::option::Option::Some("HYBRID_REPLICATION_TYPE_UNSPECIFIED")
9054                }
9055                Self::Migration => std::option::Option::Some("MIGRATION"),
9056                Self::ContinuousReplication => std::option::Option::Some("CONTINUOUS_REPLICATION"),
9057                Self::OnpremReplication => std::option::Option::Some("ONPREM_REPLICATION"),
9058                Self::ReverseOnpremReplication => {
9059                    std::option::Option::Some("REVERSE_ONPREM_REPLICATION")
9060                }
9061                Self::UnknownValue(u) => u.0.name(),
9062            }
9063        }
9064    }
9065
9066    impl std::default::Default for HybridReplicationType {
9067        fn default() -> Self {
9068            use std::convert::From;
9069            Self::from(0)
9070        }
9071    }
9072
9073    impl std::fmt::Display for HybridReplicationType {
9074        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9075            wkt::internal::display_enum(f, self.name(), self.value())
9076        }
9077    }
9078
9079    impl std::convert::From<i32> for HybridReplicationType {
9080        fn from(value: i32) -> Self {
9081            match value {
9082                0 => Self::Unspecified,
9083                1 => Self::Migration,
9084                2 => Self::ContinuousReplication,
9085                3 => Self::OnpremReplication,
9086                4 => Self::ReverseOnpremReplication,
9087                _ => Self::UnknownValue(hybrid_replication_type::UnknownValue(
9088                    wkt::internal::UnknownEnumValue::Integer(value),
9089                )),
9090            }
9091        }
9092    }
9093
9094    impl std::convert::From<&str> for HybridReplicationType {
9095        fn from(value: &str) -> Self {
9096            use std::string::ToString;
9097            match value {
9098                "HYBRID_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
9099                "MIGRATION" => Self::Migration,
9100                "CONTINUOUS_REPLICATION" => Self::ContinuousReplication,
9101                "ONPREM_REPLICATION" => Self::OnpremReplication,
9102                "REVERSE_ONPREM_REPLICATION" => Self::ReverseOnpremReplication,
9103                _ => Self::UnknownValue(hybrid_replication_type::UnknownValue(
9104                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9105                )),
9106            }
9107        }
9108    }
9109
9110    impl serde::ser::Serialize for HybridReplicationType {
9111        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9112        where
9113            S: serde::Serializer,
9114        {
9115            match self {
9116                Self::Unspecified => serializer.serialize_i32(0),
9117                Self::Migration => serializer.serialize_i32(1),
9118                Self::ContinuousReplication => serializer.serialize_i32(2),
9119                Self::OnpremReplication => serializer.serialize_i32(3),
9120                Self::ReverseOnpremReplication => serializer.serialize_i32(4),
9121                Self::UnknownValue(u) => u.0.serialize(serializer),
9122            }
9123        }
9124    }
9125
9126    impl<'de> serde::de::Deserialize<'de> for HybridReplicationType {
9127        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9128        where
9129            D: serde::Deserializer<'de>,
9130        {
9131            deserializer.deserialize_any(wkt::internal::EnumVisitor::<HybridReplicationType>::new(
9132                ".google.cloud.netapp.v1.Replication.HybridReplicationType",
9133            ))
9134        }
9135    }
9136}
9137
9138/// HybridPeeringDetails contains details about the hybrid peering.
9139#[derive(Clone, Default, PartialEq)]
9140#[non_exhaustive]
9141pub struct HybridPeeringDetails {
9142    /// Output only. IP address of the subnet.
9143    pub subnet_ip: std::string::String,
9144
9145    /// Output only. Copy-paste-able commands to be used on user's ONTAP to accept
9146    /// peering requests.
9147    pub command: std::string::String,
9148
9149    /// Output only. Expiration time for the peering command to be executed on
9150    /// user's ONTAP.
9151    pub command_expiry_time: std::option::Option<wkt::Timestamp>,
9152
9153    /// Output only. Temporary passphrase generated to accept cluster peering
9154    /// command.
9155    pub passphrase: std::string::String,
9156
9157    /// Output only. Name of the user's local source volume to be peered with the
9158    /// destination volume.
9159    pub peer_volume_name: std::string::String,
9160
9161    /// Output only. Name of the user's local source cluster to be peered with the
9162    /// destination cluster.
9163    pub peer_cluster_name: std::string::String,
9164
9165    /// Output only. Name of the user's local source vserver svm to be peered with
9166    /// the destination vserver svm.
9167    pub peer_svm_name: std::string::String,
9168
9169    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9170}
9171
9172impl HybridPeeringDetails {
9173    pub fn new() -> Self {
9174        std::default::Default::default()
9175    }
9176
9177    /// Sets the value of [subnet_ip][crate::model::HybridPeeringDetails::subnet_ip].
9178    ///
9179    /// # Example
9180    /// ```ignore,no_run
9181    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9182    /// let x = HybridPeeringDetails::new().set_subnet_ip("example");
9183    /// ```
9184    pub fn set_subnet_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9185        self.subnet_ip = v.into();
9186        self
9187    }
9188
9189    /// Sets the value of [command][crate::model::HybridPeeringDetails::command].
9190    ///
9191    /// # Example
9192    /// ```ignore,no_run
9193    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9194    /// let x = HybridPeeringDetails::new().set_command("example");
9195    /// ```
9196    pub fn set_command<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9197        self.command = v.into();
9198        self
9199    }
9200
9201    /// Sets the value of [command_expiry_time][crate::model::HybridPeeringDetails::command_expiry_time].
9202    ///
9203    /// # Example
9204    /// ```ignore,no_run
9205    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9206    /// use wkt::Timestamp;
9207    /// let x = HybridPeeringDetails::new().set_command_expiry_time(Timestamp::default()/* use setters */);
9208    /// ```
9209    pub fn set_command_expiry_time<T>(mut self, v: T) -> Self
9210    where
9211        T: std::convert::Into<wkt::Timestamp>,
9212    {
9213        self.command_expiry_time = std::option::Option::Some(v.into());
9214        self
9215    }
9216
9217    /// Sets or clears the value of [command_expiry_time][crate::model::HybridPeeringDetails::command_expiry_time].
9218    ///
9219    /// # Example
9220    /// ```ignore,no_run
9221    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9222    /// use wkt::Timestamp;
9223    /// let x = HybridPeeringDetails::new().set_or_clear_command_expiry_time(Some(Timestamp::default()/* use setters */));
9224    /// let x = HybridPeeringDetails::new().set_or_clear_command_expiry_time(None::<Timestamp>);
9225    /// ```
9226    pub fn set_or_clear_command_expiry_time<T>(mut self, v: std::option::Option<T>) -> Self
9227    where
9228        T: std::convert::Into<wkt::Timestamp>,
9229    {
9230        self.command_expiry_time = v.map(|x| x.into());
9231        self
9232    }
9233
9234    /// Sets the value of [passphrase][crate::model::HybridPeeringDetails::passphrase].
9235    ///
9236    /// # Example
9237    /// ```ignore,no_run
9238    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9239    /// let x = HybridPeeringDetails::new().set_passphrase("example");
9240    /// ```
9241    pub fn set_passphrase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9242        self.passphrase = v.into();
9243        self
9244    }
9245
9246    /// Sets the value of [peer_volume_name][crate::model::HybridPeeringDetails::peer_volume_name].
9247    ///
9248    /// # Example
9249    /// ```ignore,no_run
9250    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9251    /// let x = HybridPeeringDetails::new().set_peer_volume_name("example");
9252    /// ```
9253    pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
9254        mut self,
9255        v: T,
9256    ) -> Self {
9257        self.peer_volume_name = v.into();
9258        self
9259    }
9260
9261    /// Sets the value of [peer_cluster_name][crate::model::HybridPeeringDetails::peer_cluster_name].
9262    ///
9263    /// # Example
9264    /// ```ignore,no_run
9265    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9266    /// let x = HybridPeeringDetails::new().set_peer_cluster_name("example");
9267    /// ```
9268    pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
9269        mut self,
9270        v: T,
9271    ) -> Self {
9272        self.peer_cluster_name = v.into();
9273        self
9274    }
9275
9276    /// Sets the value of [peer_svm_name][crate::model::HybridPeeringDetails::peer_svm_name].
9277    ///
9278    /// # Example
9279    /// ```ignore,no_run
9280    /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
9281    /// let x = HybridPeeringDetails::new().set_peer_svm_name("example");
9282    /// ```
9283    pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9284        self.peer_svm_name = v.into();
9285        self
9286    }
9287}
9288
9289impl wkt::message::Message for HybridPeeringDetails {
9290    fn typename() -> &'static str {
9291        "type.googleapis.com/google.cloud.netapp.v1.HybridPeeringDetails"
9292    }
9293}
9294
9295/// ListReplications lists replications.
9296#[derive(Clone, Default, PartialEq)]
9297#[non_exhaustive]
9298pub struct ListReplicationsRequest {
9299    /// Required. The volume for which to retrieve replication information,
9300    /// in the format
9301    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`.
9302    pub parent: std::string::String,
9303
9304    /// The maximum number of items to return.
9305    pub page_size: i32,
9306
9307    /// The next_page_token value to use if there are additional
9308    /// results to retrieve for this list request.
9309    pub page_token: std::string::String,
9310
9311    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
9312    pub order_by: std::string::String,
9313
9314    /// List filter.
9315    pub filter: std::string::String,
9316
9317    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9318}
9319
9320impl ListReplicationsRequest {
9321    pub fn new() -> Self {
9322        std::default::Default::default()
9323    }
9324
9325    /// Sets the value of [parent][crate::model::ListReplicationsRequest::parent].
9326    ///
9327    /// # Example
9328    /// ```ignore,no_run
9329    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9330    /// let x = ListReplicationsRequest::new().set_parent("example");
9331    /// ```
9332    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9333        self.parent = v.into();
9334        self
9335    }
9336
9337    /// Sets the value of [page_size][crate::model::ListReplicationsRequest::page_size].
9338    ///
9339    /// # Example
9340    /// ```ignore,no_run
9341    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9342    /// let x = ListReplicationsRequest::new().set_page_size(42);
9343    /// ```
9344    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9345        self.page_size = v.into();
9346        self
9347    }
9348
9349    /// Sets the value of [page_token][crate::model::ListReplicationsRequest::page_token].
9350    ///
9351    /// # Example
9352    /// ```ignore,no_run
9353    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9354    /// let x = ListReplicationsRequest::new().set_page_token("example");
9355    /// ```
9356    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9357        self.page_token = v.into();
9358        self
9359    }
9360
9361    /// Sets the value of [order_by][crate::model::ListReplicationsRequest::order_by].
9362    ///
9363    /// # Example
9364    /// ```ignore,no_run
9365    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9366    /// let x = ListReplicationsRequest::new().set_order_by("example");
9367    /// ```
9368    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9369        self.order_by = v.into();
9370        self
9371    }
9372
9373    /// Sets the value of [filter][crate::model::ListReplicationsRequest::filter].
9374    ///
9375    /// # Example
9376    /// ```ignore,no_run
9377    /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
9378    /// let x = ListReplicationsRequest::new().set_filter("example");
9379    /// ```
9380    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9381        self.filter = v.into();
9382        self
9383    }
9384}
9385
9386impl wkt::message::Message for ListReplicationsRequest {
9387    fn typename() -> &'static str {
9388        "type.googleapis.com/google.cloud.netapp.v1.ListReplicationsRequest"
9389    }
9390}
9391
9392/// ListReplicationsResponse is the result of ListReplicationsRequest.
9393#[derive(Clone, Default, PartialEq)]
9394#[non_exhaustive]
9395pub struct ListReplicationsResponse {
9396    /// A list of replications in the project for the specified volume.
9397    pub replications: std::vec::Vec<crate::model::Replication>,
9398
9399    /// The token you can use to retrieve the next page of results. Not returned
9400    /// if there are no more results in the list.
9401    pub next_page_token: std::string::String,
9402
9403    /// Locations that could not be reached.
9404    pub unreachable: std::vec::Vec<std::string::String>,
9405
9406    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9407}
9408
9409impl ListReplicationsResponse {
9410    pub fn new() -> Self {
9411        std::default::Default::default()
9412    }
9413
9414    /// Sets the value of [replications][crate::model::ListReplicationsResponse::replications].
9415    ///
9416    /// # Example
9417    /// ```ignore,no_run
9418    /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
9419    /// use google_cloud_netapp_v1::model::Replication;
9420    /// let x = ListReplicationsResponse::new()
9421    ///     .set_replications([
9422    ///         Replication::default()/* use setters */,
9423    ///         Replication::default()/* use (different) setters */,
9424    ///     ]);
9425    /// ```
9426    pub fn set_replications<T, V>(mut self, v: T) -> Self
9427    where
9428        T: std::iter::IntoIterator<Item = V>,
9429        V: std::convert::Into<crate::model::Replication>,
9430    {
9431        use std::iter::Iterator;
9432        self.replications = v.into_iter().map(|i| i.into()).collect();
9433        self
9434    }
9435
9436    /// Sets the value of [next_page_token][crate::model::ListReplicationsResponse::next_page_token].
9437    ///
9438    /// # Example
9439    /// ```ignore,no_run
9440    /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
9441    /// let x = ListReplicationsResponse::new().set_next_page_token("example");
9442    /// ```
9443    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9444        self.next_page_token = v.into();
9445        self
9446    }
9447
9448    /// Sets the value of [unreachable][crate::model::ListReplicationsResponse::unreachable].
9449    ///
9450    /// # Example
9451    /// ```ignore,no_run
9452    /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
9453    /// let x = ListReplicationsResponse::new().set_unreachable(["a", "b", "c"]);
9454    /// ```
9455    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9456    where
9457        T: std::iter::IntoIterator<Item = V>,
9458        V: std::convert::Into<std::string::String>,
9459    {
9460        use std::iter::Iterator;
9461        self.unreachable = v.into_iter().map(|i| i.into()).collect();
9462        self
9463    }
9464}
9465
9466impl wkt::message::Message for ListReplicationsResponse {
9467    fn typename() -> &'static str {
9468        "type.googleapis.com/google.cloud.netapp.v1.ListReplicationsResponse"
9469    }
9470}
9471
9472#[doc(hidden)]
9473impl google_cloud_gax::paginator::internal::PageableResponse for ListReplicationsResponse {
9474    type PageItem = crate::model::Replication;
9475
9476    fn items(self) -> std::vec::Vec<Self::PageItem> {
9477        self.replications
9478    }
9479
9480    fn next_page_token(&self) -> std::string::String {
9481        use std::clone::Clone;
9482        self.next_page_token.clone()
9483    }
9484}
9485
9486/// GetReplicationRequest gets the state of a replication.
9487#[derive(Clone, Default, PartialEq)]
9488#[non_exhaustive]
9489pub struct GetReplicationRequest {
9490    /// Required. The replication resource name, in the format
9491    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}`
9492    pub name: std::string::String,
9493
9494    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9495}
9496
9497impl GetReplicationRequest {
9498    pub fn new() -> Self {
9499        std::default::Default::default()
9500    }
9501
9502    /// Sets the value of [name][crate::model::GetReplicationRequest::name].
9503    ///
9504    /// # Example
9505    /// ```ignore,no_run
9506    /// # use google_cloud_netapp_v1::model::GetReplicationRequest;
9507    /// let x = GetReplicationRequest::new().set_name("example");
9508    /// ```
9509    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9510        self.name = v.into();
9511        self
9512    }
9513}
9514
9515impl wkt::message::Message for GetReplicationRequest {
9516    fn typename() -> &'static str {
9517        "type.googleapis.com/google.cloud.netapp.v1.GetReplicationRequest"
9518    }
9519}
9520
9521/// DestinationVolumeParameters specify input parameters used for creating
9522/// destination volume.
9523#[derive(Clone, Default, PartialEq)]
9524#[non_exhaustive]
9525pub struct DestinationVolumeParameters {
9526    /// Required. Existing destination StoragePool name.
9527    pub storage_pool: std::string::String,
9528
9529    /// Desired destination volume resource id. If not specified, source volume's
9530    /// resource id will be used.
9531    /// This value must start with a lowercase letter followed by up to 62
9532    /// lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
9533    pub volume_id: std::string::String,
9534
9535    /// Destination volume's share name. If not specified, source volume's share
9536    /// name will be used.
9537    pub share_name: std::string::String,
9538
9539    /// Description for the destination volume.
9540    pub description: std::option::Option<std::string::String>,
9541
9542    /// Optional. Tiering policy for the volume.
9543    pub tiering_policy: std::option::Option<crate::model::TieringPolicy>,
9544
9545    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9546}
9547
9548impl DestinationVolumeParameters {
9549    pub fn new() -> Self {
9550        std::default::Default::default()
9551    }
9552
9553    /// Sets the value of [storage_pool][crate::model::DestinationVolumeParameters::storage_pool].
9554    ///
9555    /// # Example
9556    /// ```ignore,no_run
9557    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
9558    /// let x = DestinationVolumeParameters::new().set_storage_pool("example");
9559    /// ```
9560    pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9561        self.storage_pool = v.into();
9562        self
9563    }
9564
9565    /// Sets the value of [volume_id][crate::model::DestinationVolumeParameters::volume_id].
9566    ///
9567    /// # Example
9568    /// ```ignore,no_run
9569    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
9570    /// let x = DestinationVolumeParameters::new().set_volume_id("example");
9571    /// ```
9572    pub fn set_volume_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9573        self.volume_id = v.into();
9574        self
9575    }
9576
9577    /// Sets the value of [share_name][crate::model::DestinationVolumeParameters::share_name].
9578    ///
9579    /// # Example
9580    /// ```ignore,no_run
9581    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
9582    /// let x = DestinationVolumeParameters::new().set_share_name("example");
9583    /// ```
9584    pub fn set_share_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9585        self.share_name = v.into();
9586        self
9587    }
9588
9589    /// Sets the value of [description][crate::model::DestinationVolumeParameters::description].
9590    ///
9591    /// # Example
9592    /// ```ignore,no_run
9593    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
9594    /// let x = DestinationVolumeParameters::new().set_description("example");
9595    /// ```
9596    pub fn set_description<T>(mut self, v: T) -> Self
9597    where
9598        T: std::convert::Into<std::string::String>,
9599    {
9600        self.description = std::option::Option::Some(v.into());
9601        self
9602    }
9603
9604    /// Sets or clears the value of [description][crate::model::DestinationVolumeParameters::description].
9605    ///
9606    /// # Example
9607    /// ```ignore,no_run
9608    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
9609    /// let x = DestinationVolumeParameters::new().set_or_clear_description(Some("example"));
9610    /// let x = DestinationVolumeParameters::new().set_or_clear_description(None::<String>);
9611    /// ```
9612    pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
9613    where
9614        T: std::convert::Into<std::string::String>,
9615    {
9616        self.description = v.map(|x| x.into());
9617        self
9618    }
9619
9620    /// Sets the value of [tiering_policy][crate::model::DestinationVolumeParameters::tiering_policy].
9621    ///
9622    /// # Example
9623    /// ```ignore,no_run
9624    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
9625    /// use google_cloud_netapp_v1::model::TieringPolicy;
9626    /// let x = DestinationVolumeParameters::new().set_tiering_policy(TieringPolicy::default()/* use setters */);
9627    /// ```
9628    pub fn set_tiering_policy<T>(mut self, v: T) -> Self
9629    where
9630        T: std::convert::Into<crate::model::TieringPolicy>,
9631    {
9632        self.tiering_policy = std::option::Option::Some(v.into());
9633        self
9634    }
9635
9636    /// Sets or clears the value of [tiering_policy][crate::model::DestinationVolumeParameters::tiering_policy].
9637    ///
9638    /// # Example
9639    /// ```ignore,no_run
9640    /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
9641    /// use google_cloud_netapp_v1::model::TieringPolicy;
9642    /// let x = DestinationVolumeParameters::new().set_or_clear_tiering_policy(Some(TieringPolicy::default()/* use setters */));
9643    /// let x = DestinationVolumeParameters::new().set_or_clear_tiering_policy(None::<TieringPolicy>);
9644    /// ```
9645    pub fn set_or_clear_tiering_policy<T>(mut self, v: std::option::Option<T>) -> Self
9646    where
9647        T: std::convert::Into<crate::model::TieringPolicy>,
9648    {
9649        self.tiering_policy = v.map(|x| x.into());
9650        self
9651    }
9652}
9653
9654impl wkt::message::Message for DestinationVolumeParameters {
9655    fn typename() -> &'static str {
9656        "type.googleapis.com/google.cloud.netapp.v1.DestinationVolumeParameters"
9657    }
9658}
9659
9660/// CreateReplicationRequest creates a replication.
9661#[derive(Clone, Default, PartialEq)]
9662#[non_exhaustive]
9663pub struct CreateReplicationRequest {
9664    /// Required. The NetApp volume to create the replications of, in the format
9665    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
9666    pub parent: std::string::String,
9667
9668    /// Required. A replication resource
9669    pub replication: std::option::Option<crate::model::Replication>,
9670
9671    /// Required. ID of the replication to create. Must be unique within the parent
9672    /// resource. Must contain only letters, numbers and hyphen, with the first
9673    /// character a letter, the last a letter or a
9674    /// number, and a 63 character maximum.
9675    pub replication_id: std::string::String,
9676
9677    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9678}
9679
9680impl CreateReplicationRequest {
9681    pub fn new() -> Self {
9682        std::default::Default::default()
9683    }
9684
9685    /// Sets the value of [parent][crate::model::CreateReplicationRequest::parent].
9686    ///
9687    /// # Example
9688    /// ```ignore,no_run
9689    /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
9690    /// let x = CreateReplicationRequest::new().set_parent("example");
9691    /// ```
9692    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9693        self.parent = v.into();
9694        self
9695    }
9696
9697    /// Sets the value of [replication][crate::model::CreateReplicationRequest::replication].
9698    ///
9699    /// # Example
9700    /// ```ignore,no_run
9701    /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
9702    /// use google_cloud_netapp_v1::model::Replication;
9703    /// let x = CreateReplicationRequest::new().set_replication(Replication::default()/* use setters */);
9704    /// ```
9705    pub fn set_replication<T>(mut self, v: T) -> Self
9706    where
9707        T: std::convert::Into<crate::model::Replication>,
9708    {
9709        self.replication = std::option::Option::Some(v.into());
9710        self
9711    }
9712
9713    /// Sets or clears the value of [replication][crate::model::CreateReplicationRequest::replication].
9714    ///
9715    /// # Example
9716    /// ```ignore,no_run
9717    /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
9718    /// use google_cloud_netapp_v1::model::Replication;
9719    /// let x = CreateReplicationRequest::new().set_or_clear_replication(Some(Replication::default()/* use setters */));
9720    /// let x = CreateReplicationRequest::new().set_or_clear_replication(None::<Replication>);
9721    /// ```
9722    pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
9723    where
9724        T: std::convert::Into<crate::model::Replication>,
9725    {
9726        self.replication = v.map(|x| x.into());
9727        self
9728    }
9729
9730    /// Sets the value of [replication_id][crate::model::CreateReplicationRequest::replication_id].
9731    ///
9732    /// # Example
9733    /// ```ignore,no_run
9734    /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
9735    /// let x = CreateReplicationRequest::new().set_replication_id("example");
9736    /// ```
9737    pub fn set_replication_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9738        self.replication_id = v.into();
9739        self
9740    }
9741}
9742
9743impl wkt::message::Message for CreateReplicationRequest {
9744    fn typename() -> &'static str {
9745        "type.googleapis.com/google.cloud.netapp.v1.CreateReplicationRequest"
9746    }
9747}
9748
9749/// DeleteReplicationRequest deletes a replication.
9750#[derive(Clone, Default, PartialEq)]
9751#[non_exhaustive]
9752pub struct DeleteReplicationRequest {
9753    /// Required. The replication resource name, in the format
9754    /// `projects/*/locations/*/volumes/*/replications/{replication_id}`
9755    pub name: std::string::String,
9756
9757    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9758}
9759
9760impl DeleteReplicationRequest {
9761    pub fn new() -> Self {
9762        std::default::Default::default()
9763    }
9764
9765    /// Sets the value of [name][crate::model::DeleteReplicationRequest::name].
9766    ///
9767    /// # Example
9768    /// ```ignore,no_run
9769    /// # use google_cloud_netapp_v1::model::DeleteReplicationRequest;
9770    /// let x = DeleteReplicationRequest::new().set_name("example");
9771    /// ```
9772    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9773        self.name = v.into();
9774        self
9775    }
9776}
9777
9778impl wkt::message::Message for DeleteReplicationRequest {
9779    fn typename() -> &'static str {
9780        "type.googleapis.com/google.cloud.netapp.v1.DeleteReplicationRequest"
9781    }
9782}
9783
9784/// UpdateReplicationRequest updates description and/or labels for a replication.
9785#[derive(Clone, Default, PartialEq)]
9786#[non_exhaustive]
9787pub struct UpdateReplicationRequest {
9788    /// Required. Mask of fields to update.  At least one path must be supplied in
9789    /// this field.
9790    pub update_mask: std::option::Option<wkt::FieldMask>,
9791
9792    /// Required. A replication resource
9793    pub replication: std::option::Option<crate::model::Replication>,
9794
9795    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9796}
9797
9798impl UpdateReplicationRequest {
9799    pub fn new() -> Self {
9800        std::default::Default::default()
9801    }
9802
9803    /// Sets the value of [update_mask][crate::model::UpdateReplicationRequest::update_mask].
9804    ///
9805    /// # Example
9806    /// ```ignore,no_run
9807    /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
9808    /// use wkt::FieldMask;
9809    /// let x = UpdateReplicationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
9810    /// ```
9811    pub fn set_update_mask<T>(mut self, v: T) -> Self
9812    where
9813        T: std::convert::Into<wkt::FieldMask>,
9814    {
9815        self.update_mask = std::option::Option::Some(v.into());
9816        self
9817    }
9818
9819    /// Sets or clears the value of [update_mask][crate::model::UpdateReplicationRequest::update_mask].
9820    ///
9821    /// # Example
9822    /// ```ignore,no_run
9823    /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
9824    /// use wkt::FieldMask;
9825    /// let x = UpdateReplicationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
9826    /// let x = UpdateReplicationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
9827    /// ```
9828    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9829    where
9830        T: std::convert::Into<wkt::FieldMask>,
9831    {
9832        self.update_mask = v.map(|x| x.into());
9833        self
9834    }
9835
9836    /// Sets the value of [replication][crate::model::UpdateReplicationRequest::replication].
9837    ///
9838    /// # Example
9839    /// ```ignore,no_run
9840    /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
9841    /// use google_cloud_netapp_v1::model::Replication;
9842    /// let x = UpdateReplicationRequest::new().set_replication(Replication::default()/* use setters */);
9843    /// ```
9844    pub fn set_replication<T>(mut self, v: T) -> Self
9845    where
9846        T: std::convert::Into<crate::model::Replication>,
9847    {
9848        self.replication = std::option::Option::Some(v.into());
9849        self
9850    }
9851
9852    /// Sets or clears the value of [replication][crate::model::UpdateReplicationRequest::replication].
9853    ///
9854    /// # Example
9855    /// ```ignore,no_run
9856    /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
9857    /// use google_cloud_netapp_v1::model::Replication;
9858    /// let x = UpdateReplicationRequest::new().set_or_clear_replication(Some(Replication::default()/* use setters */));
9859    /// let x = UpdateReplicationRequest::new().set_or_clear_replication(None::<Replication>);
9860    /// ```
9861    pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
9862    where
9863        T: std::convert::Into<crate::model::Replication>,
9864    {
9865        self.replication = v.map(|x| x.into());
9866        self
9867    }
9868}
9869
9870impl wkt::message::Message for UpdateReplicationRequest {
9871    fn typename() -> &'static str {
9872        "type.googleapis.com/google.cloud.netapp.v1.UpdateReplicationRequest"
9873    }
9874}
9875
9876/// StopReplicationRequest stops a replication until resumed.
9877#[derive(Clone, Default, PartialEq)]
9878#[non_exhaustive]
9879pub struct StopReplicationRequest {
9880    /// Required. The resource name of the replication, in the format of
9881    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
9882    pub name: std::string::String,
9883
9884    /// Indicates whether to stop replication forcefully while data transfer is in
9885    /// progress.
9886    /// Warning! if force is true, this will abort any current transfers
9887    /// and can lead to data loss due to partial transfer.
9888    /// If force is false, stop replication will fail while data transfer is in
9889    /// progress and you will need to retry later.
9890    pub force: bool,
9891
9892    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9893}
9894
9895impl StopReplicationRequest {
9896    pub fn new() -> Self {
9897        std::default::Default::default()
9898    }
9899
9900    /// Sets the value of [name][crate::model::StopReplicationRequest::name].
9901    ///
9902    /// # Example
9903    /// ```ignore,no_run
9904    /// # use google_cloud_netapp_v1::model::StopReplicationRequest;
9905    /// let x = StopReplicationRequest::new().set_name("example");
9906    /// ```
9907    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9908        self.name = v.into();
9909        self
9910    }
9911
9912    /// Sets the value of [force][crate::model::StopReplicationRequest::force].
9913    ///
9914    /// # Example
9915    /// ```ignore,no_run
9916    /// # use google_cloud_netapp_v1::model::StopReplicationRequest;
9917    /// let x = StopReplicationRequest::new().set_force(true);
9918    /// ```
9919    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
9920        self.force = v.into();
9921        self
9922    }
9923}
9924
9925impl wkt::message::Message for StopReplicationRequest {
9926    fn typename() -> &'static str {
9927        "type.googleapis.com/google.cloud.netapp.v1.StopReplicationRequest"
9928    }
9929}
9930
9931/// ResumeReplicationRequest resumes a stopped replication.
9932#[derive(Clone, Default, PartialEq)]
9933#[non_exhaustive]
9934pub struct ResumeReplicationRequest {
9935    /// Required. The resource name of the replication, in the format of
9936    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
9937    pub name: std::string::String,
9938
9939    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9940}
9941
9942impl ResumeReplicationRequest {
9943    pub fn new() -> Self {
9944        std::default::Default::default()
9945    }
9946
9947    /// Sets the value of [name][crate::model::ResumeReplicationRequest::name].
9948    ///
9949    /// # Example
9950    /// ```ignore,no_run
9951    /// # use google_cloud_netapp_v1::model::ResumeReplicationRequest;
9952    /// let x = ResumeReplicationRequest::new().set_name("example");
9953    /// ```
9954    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9955        self.name = v.into();
9956        self
9957    }
9958}
9959
9960impl wkt::message::Message for ResumeReplicationRequest {
9961    fn typename() -> &'static str {
9962        "type.googleapis.com/google.cloud.netapp.v1.ResumeReplicationRequest"
9963    }
9964}
9965
9966/// ReverseReplicationDirectionRequest reverses direction of replication. Source
9967/// becomes destination and destination becomes source.
9968#[derive(Clone, Default, PartialEq)]
9969#[non_exhaustive]
9970pub struct ReverseReplicationDirectionRequest {
9971    /// Required. The resource name of the replication, in the format of
9972    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
9973    pub name: std::string::String,
9974
9975    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9976}
9977
9978impl ReverseReplicationDirectionRequest {
9979    pub fn new() -> Self {
9980        std::default::Default::default()
9981    }
9982
9983    /// Sets the value of [name][crate::model::ReverseReplicationDirectionRequest::name].
9984    ///
9985    /// # Example
9986    /// ```ignore,no_run
9987    /// # use google_cloud_netapp_v1::model::ReverseReplicationDirectionRequest;
9988    /// let x = ReverseReplicationDirectionRequest::new().set_name("example");
9989    /// ```
9990    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9991        self.name = v.into();
9992        self
9993    }
9994}
9995
9996impl wkt::message::Message for ReverseReplicationDirectionRequest {
9997    fn typename() -> &'static str {
9998        "type.googleapis.com/google.cloud.netapp.v1.ReverseReplicationDirectionRequest"
9999    }
10000}
10001
10002/// EstablishPeeringRequest establishes cluster and svm peerings between the
10003/// source and the destination replications.
10004#[derive(Clone, Default, PartialEq)]
10005#[non_exhaustive]
10006pub struct EstablishPeeringRequest {
10007    /// Required. The resource name of the replication, in the format of
10008    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10009    pub name: std::string::String,
10010
10011    /// Required. Name of the user's local source cluster to be peered with the
10012    /// destination cluster.
10013    pub peer_cluster_name: std::string::String,
10014
10015    /// Required. Name of the user's local source vserver svm to be peered with the
10016    /// destination vserver svm.
10017    pub peer_svm_name: std::string::String,
10018
10019    /// Optional. List of IPv4 ip addresses to be used for peering.
10020    pub peer_ip_addresses: std::vec::Vec<std::string::String>,
10021
10022    /// Required. Name of the user's local source volume to be peered with the
10023    /// destination volume.
10024    pub peer_volume_name: std::string::String,
10025
10026    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10027}
10028
10029impl EstablishPeeringRequest {
10030    pub fn new() -> Self {
10031        std::default::Default::default()
10032    }
10033
10034    /// Sets the value of [name][crate::model::EstablishPeeringRequest::name].
10035    ///
10036    /// # Example
10037    /// ```ignore,no_run
10038    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10039    /// let x = EstablishPeeringRequest::new().set_name("example");
10040    /// ```
10041    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10042        self.name = v.into();
10043        self
10044    }
10045
10046    /// Sets the value of [peer_cluster_name][crate::model::EstablishPeeringRequest::peer_cluster_name].
10047    ///
10048    /// # Example
10049    /// ```ignore,no_run
10050    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10051    /// let x = EstablishPeeringRequest::new().set_peer_cluster_name("example");
10052    /// ```
10053    pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
10054        mut self,
10055        v: T,
10056    ) -> Self {
10057        self.peer_cluster_name = v.into();
10058        self
10059    }
10060
10061    /// Sets the value of [peer_svm_name][crate::model::EstablishPeeringRequest::peer_svm_name].
10062    ///
10063    /// # Example
10064    /// ```ignore,no_run
10065    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10066    /// let x = EstablishPeeringRequest::new().set_peer_svm_name("example");
10067    /// ```
10068    pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10069        self.peer_svm_name = v.into();
10070        self
10071    }
10072
10073    /// Sets the value of [peer_ip_addresses][crate::model::EstablishPeeringRequest::peer_ip_addresses].
10074    ///
10075    /// # Example
10076    /// ```ignore,no_run
10077    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10078    /// let x = EstablishPeeringRequest::new().set_peer_ip_addresses(["a", "b", "c"]);
10079    /// ```
10080    pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
10081    where
10082        T: std::iter::IntoIterator<Item = V>,
10083        V: std::convert::Into<std::string::String>,
10084    {
10085        use std::iter::Iterator;
10086        self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
10087        self
10088    }
10089
10090    /// Sets the value of [peer_volume_name][crate::model::EstablishPeeringRequest::peer_volume_name].
10091    ///
10092    /// # Example
10093    /// ```ignore,no_run
10094    /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
10095    /// let x = EstablishPeeringRequest::new().set_peer_volume_name("example");
10096    /// ```
10097    pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
10098        mut self,
10099        v: T,
10100    ) -> Self {
10101        self.peer_volume_name = v.into();
10102        self
10103    }
10104}
10105
10106impl wkt::message::Message for EstablishPeeringRequest {
10107    fn typename() -> &'static str {
10108        "type.googleapis.com/google.cloud.netapp.v1.EstablishPeeringRequest"
10109    }
10110}
10111
10112/// SyncReplicationRequest syncs the replication from source to destination.
10113#[derive(Clone, Default, PartialEq)]
10114#[non_exhaustive]
10115pub struct SyncReplicationRequest {
10116    /// Required. The resource name of the replication, in the format of
10117    /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
10118    pub name: std::string::String,
10119
10120    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10121}
10122
10123impl SyncReplicationRequest {
10124    pub fn new() -> Self {
10125        std::default::Default::default()
10126    }
10127
10128    /// Sets the value of [name][crate::model::SyncReplicationRequest::name].
10129    ///
10130    /// # Example
10131    /// ```ignore,no_run
10132    /// # use google_cloud_netapp_v1::model::SyncReplicationRequest;
10133    /// let x = SyncReplicationRequest::new().set_name("example");
10134    /// ```
10135    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10136        self.name = v.into();
10137        self
10138    }
10139}
10140
10141impl wkt::message::Message for SyncReplicationRequest {
10142    fn typename() -> &'static str {
10143        "type.googleapis.com/google.cloud.netapp.v1.SyncReplicationRequest"
10144    }
10145}
10146
10147/// ListSnapshotsRequest lists snapshots.
10148#[derive(Clone, Default, PartialEq)]
10149#[non_exhaustive]
10150pub struct ListSnapshotsRequest {
10151    /// Required. The volume for which to retrieve snapshot information,
10152    /// in the format
10153    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`.
10154    pub parent: std::string::String,
10155
10156    /// The maximum number of items to return.
10157    pub page_size: i32,
10158
10159    /// The next_page_token value to use if there are additional
10160    /// results to retrieve for this list request.
10161    pub page_token: std::string::String,
10162
10163    /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
10164    pub order_by: std::string::String,
10165
10166    /// List filter.
10167    pub filter: std::string::String,
10168
10169    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10170}
10171
10172impl ListSnapshotsRequest {
10173    pub fn new() -> Self {
10174        std::default::Default::default()
10175    }
10176
10177    /// Sets the value of [parent][crate::model::ListSnapshotsRequest::parent].
10178    ///
10179    /// # Example
10180    /// ```ignore,no_run
10181    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10182    /// let x = ListSnapshotsRequest::new().set_parent("example");
10183    /// ```
10184    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10185        self.parent = v.into();
10186        self
10187    }
10188
10189    /// Sets the value of [page_size][crate::model::ListSnapshotsRequest::page_size].
10190    ///
10191    /// # Example
10192    /// ```ignore,no_run
10193    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10194    /// let x = ListSnapshotsRequest::new().set_page_size(42);
10195    /// ```
10196    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10197        self.page_size = v.into();
10198        self
10199    }
10200
10201    /// Sets the value of [page_token][crate::model::ListSnapshotsRequest::page_token].
10202    ///
10203    /// # Example
10204    /// ```ignore,no_run
10205    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10206    /// let x = ListSnapshotsRequest::new().set_page_token("example");
10207    /// ```
10208    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10209        self.page_token = v.into();
10210        self
10211    }
10212
10213    /// Sets the value of [order_by][crate::model::ListSnapshotsRequest::order_by].
10214    ///
10215    /// # Example
10216    /// ```ignore,no_run
10217    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10218    /// let x = ListSnapshotsRequest::new().set_order_by("example");
10219    /// ```
10220    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10221        self.order_by = v.into();
10222        self
10223    }
10224
10225    /// Sets the value of [filter][crate::model::ListSnapshotsRequest::filter].
10226    ///
10227    /// # Example
10228    /// ```ignore,no_run
10229    /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
10230    /// let x = ListSnapshotsRequest::new().set_filter("example");
10231    /// ```
10232    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10233        self.filter = v.into();
10234        self
10235    }
10236}
10237
10238impl wkt::message::Message for ListSnapshotsRequest {
10239    fn typename() -> &'static str {
10240        "type.googleapis.com/google.cloud.netapp.v1.ListSnapshotsRequest"
10241    }
10242}
10243
10244/// ListSnapshotsResponse is the result of ListSnapshotsRequest.
10245#[derive(Clone, Default, PartialEq)]
10246#[non_exhaustive]
10247pub struct ListSnapshotsResponse {
10248    /// A list of snapshots in the project for the specified volume.
10249    pub snapshots: std::vec::Vec<crate::model::Snapshot>,
10250
10251    /// The token you can use to retrieve the next page of results. Not returned
10252    /// if there are no more results in the list.
10253    pub next_page_token: std::string::String,
10254
10255    /// Locations that could not be reached.
10256    pub unreachable: std::vec::Vec<std::string::String>,
10257
10258    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10259}
10260
10261impl ListSnapshotsResponse {
10262    pub fn new() -> Self {
10263        std::default::Default::default()
10264    }
10265
10266    /// Sets the value of [snapshots][crate::model::ListSnapshotsResponse::snapshots].
10267    ///
10268    /// # Example
10269    /// ```ignore,no_run
10270    /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
10271    /// use google_cloud_netapp_v1::model::Snapshot;
10272    /// let x = ListSnapshotsResponse::new()
10273    ///     .set_snapshots([
10274    ///         Snapshot::default()/* use setters */,
10275    ///         Snapshot::default()/* use (different) setters */,
10276    ///     ]);
10277    /// ```
10278    pub fn set_snapshots<T, V>(mut self, v: T) -> Self
10279    where
10280        T: std::iter::IntoIterator<Item = V>,
10281        V: std::convert::Into<crate::model::Snapshot>,
10282    {
10283        use std::iter::Iterator;
10284        self.snapshots = v.into_iter().map(|i| i.into()).collect();
10285        self
10286    }
10287
10288    /// Sets the value of [next_page_token][crate::model::ListSnapshotsResponse::next_page_token].
10289    ///
10290    /// # Example
10291    /// ```ignore,no_run
10292    /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
10293    /// let x = ListSnapshotsResponse::new().set_next_page_token("example");
10294    /// ```
10295    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10296        self.next_page_token = v.into();
10297        self
10298    }
10299
10300    /// Sets the value of [unreachable][crate::model::ListSnapshotsResponse::unreachable].
10301    ///
10302    /// # Example
10303    /// ```ignore,no_run
10304    /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
10305    /// let x = ListSnapshotsResponse::new().set_unreachable(["a", "b", "c"]);
10306    /// ```
10307    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
10308    where
10309        T: std::iter::IntoIterator<Item = V>,
10310        V: std::convert::Into<std::string::String>,
10311    {
10312        use std::iter::Iterator;
10313        self.unreachable = v.into_iter().map(|i| i.into()).collect();
10314        self
10315    }
10316}
10317
10318impl wkt::message::Message for ListSnapshotsResponse {
10319    fn typename() -> &'static str {
10320        "type.googleapis.com/google.cloud.netapp.v1.ListSnapshotsResponse"
10321    }
10322}
10323
10324#[doc(hidden)]
10325impl google_cloud_gax::paginator::internal::PageableResponse for ListSnapshotsResponse {
10326    type PageItem = crate::model::Snapshot;
10327
10328    fn items(self) -> std::vec::Vec<Self::PageItem> {
10329        self.snapshots
10330    }
10331
10332    fn next_page_token(&self) -> std::string::String {
10333        use std::clone::Clone;
10334        self.next_page_token.clone()
10335    }
10336}
10337
10338/// GetSnapshotRequest gets the state of a snapshot.
10339#[derive(Clone, Default, PartialEq)]
10340#[non_exhaustive]
10341pub struct GetSnapshotRequest {
10342    /// Required. The snapshot resource name, in the format
10343    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`
10344    pub name: std::string::String,
10345
10346    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10347}
10348
10349impl GetSnapshotRequest {
10350    pub fn new() -> Self {
10351        std::default::Default::default()
10352    }
10353
10354    /// Sets the value of [name][crate::model::GetSnapshotRequest::name].
10355    ///
10356    /// # Example
10357    /// ```ignore,no_run
10358    /// # use google_cloud_netapp_v1::model::GetSnapshotRequest;
10359    /// let x = GetSnapshotRequest::new().set_name("example");
10360    /// ```
10361    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10362        self.name = v.into();
10363        self
10364    }
10365}
10366
10367impl wkt::message::Message for GetSnapshotRequest {
10368    fn typename() -> &'static str {
10369        "type.googleapis.com/google.cloud.netapp.v1.GetSnapshotRequest"
10370    }
10371}
10372
10373/// CreateSnapshotRequest creates a snapshot.
10374#[derive(Clone, Default, PartialEq)]
10375#[non_exhaustive]
10376pub struct CreateSnapshotRequest {
10377    /// Required. The NetApp volume to create the snapshots of, in the format
10378    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
10379    pub parent: std::string::String,
10380
10381    /// Required. A snapshot resource
10382    pub snapshot: std::option::Option<crate::model::Snapshot>,
10383
10384    /// Required. ID of the snapshot to create. Must be unique within the parent
10385    /// resource. Must contain only letters, numbers and hyphen, with the first
10386    /// character a letter, the last a letter or a
10387    /// number, and a 63 character maximum.
10388    pub snapshot_id: std::string::String,
10389
10390    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10391}
10392
10393impl CreateSnapshotRequest {
10394    pub fn new() -> Self {
10395        std::default::Default::default()
10396    }
10397
10398    /// Sets the value of [parent][crate::model::CreateSnapshotRequest::parent].
10399    ///
10400    /// # Example
10401    /// ```ignore,no_run
10402    /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
10403    /// let x = CreateSnapshotRequest::new().set_parent("example");
10404    /// ```
10405    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10406        self.parent = v.into();
10407        self
10408    }
10409
10410    /// Sets the value of [snapshot][crate::model::CreateSnapshotRequest::snapshot].
10411    ///
10412    /// # Example
10413    /// ```ignore,no_run
10414    /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
10415    /// use google_cloud_netapp_v1::model::Snapshot;
10416    /// let x = CreateSnapshotRequest::new().set_snapshot(Snapshot::default()/* use setters */);
10417    /// ```
10418    pub fn set_snapshot<T>(mut self, v: T) -> Self
10419    where
10420        T: std::convert::Into<crate::model::Snapshot>,
10421    {
10422        self.snapshot = std::option::Option::Some(v.into());
10423        self
10424    }
10425
10426    /// Sets or clears the value of [snapshot][crate::model::CreateSnapshotRequest::snapshot].
10427    ///
10428    /// # Example
10429    /// ```ignore,no_run
10430    /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
10431    /// use google_cloud_netapp_v1::model::Snapshot;
10432    /// let x = CreateSnapshotRequest::new().set_or_clear_snapshot(Some(Snapshot::default()/* use setters */));
10433    /// let x = CreateSnapshotRequest::new().set_or_clear_snapshot(None::<Snapshot>);
10434    /// ```
10435    pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
10436    where
10437        T: std::convert::Into<crate::model::Snapshot>,
10438    {
10439        self.snapshot = v.map(|x| x.into());
10440        self
10441    }
10442
10443    /// Sets the value of [snapshot_id][crate::model::CreateSnapshotRequest::snapshot_id].
10444    ///
10445    /// # Example
10446    /// ```ignore,no_run
10447    /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
10448    /// let x = CreateSnapshotRequest::new().set_snapshot_id("example");
10449    /// ```
10450    pub fn set_snapshot_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10451        self.snapshot_id = v.into();
10452        self
10453    }
10454}
10455
10456impl wkt::message::Message for CreateSnapshotRequest {
10457    fn typename() -> &'static str {
10458        "type.googleapis.com/google.cloud.netapp.v1.CreateSnapshotRequest"
10459    }
10460}
10461
10462/// DeleteSnapshotRequest deletes a snapshot.
10463#[derive(Clone, Default, PartialEq)]
10464#[non_exhaustive]
10465pub struct DeleteSnapshotRequest {
10466    /// Required. The snapshot resource name, in the format
10467    /// `projects/*/locations/*/volumes/*/snapshots/{snapshot_id}`
10468    pub name: std::string::String,
10469
10470    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10471}
10472
10473impl DeleteSnapshotRequest {
10474    pub fn new() -> Self {
10475        std::default::Default::default()
10476    }
10477
10478    /// Sets the value of [name][crate::model::DeleteSnapshotRequest::name].
10479    ///
10480    /// # Example
10481    /// ```ignore,no_run
10482    /// # use google_cloud_netapp_v1::model::DeleteSnapshotRequest;
10483    /// let x = DeleteSnapshotRequest::new().set_name("example");
10484    /// ```
10485    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10486        self.name = v.into();
10487        self
10488    }
10489}
10490
10491impl wkt::message::Message for DeleteSnapshotRequest {
10492    fn typename() -> &'static str {
10493        "type.googleapis.com/google.cloud.netapp.v1.DeleteSnapshotRequest"
10494    }
10495}
10496
10497/// UpdateSnapshotRequest updates description and/or labels for a snapshot.
10498#[derive(Clone, Default, PartialEq)]
10499#[non_exhaustive]
10500pub struct UpdateSnapshotRequest {
10501    /// Required. Mask of fields to update.  At least one path must be supplied in
10502    /// this field.
10503    pub update_mask: std::option::Option<wkt::FieldMask>,
10504
10505    /// Required. A snapshot resource
10506    pub snapshot: std::option::Option<crate::model::Snapshot>,
10507
10508    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10509}
10510
10511impl UpdateSnapshotRequest {
10512    pub fn new() -> Self {
10513        std::default::Default::default()
10514    }
10515
10516    /// Sets the value of [update_mask][crate::model::UpdateSnapshotRequest::update_mask].
10517    ///
10518    /// # Example
10519    /// ```ignore,no_run
10520    /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
10521    /// use wkt::FieldMask;
10522    /// let x = UpdateSnapshotRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10523    /// ```
10524    pub fn set_update_mask<T>(mut self, v: T) -> Self
10525    where
10526        T: std::convert::Into<wkt::FieldMask>,
10527    {
10528        self.update_mask = std::option::Option::Some(v.into());
10529        self
10530    }
10531
10532    /// Sets or clears the value of [update_mask][crate::model::UpdateSnapshotRequest::update_mask].
10533    ///
10534    /// # Example
10535    /// ```ignore,no_run
10536    /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
10537    /// use wkt::FieldMask;
10538    /// let x = UpdateSnapshotRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10539    /// let x = UpdateSnapshotRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10540    /// ```
10541    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10542    where
10543        T: std::convert::Into<wkt::FieldMask>,
10544    {
10545        self.update_mask = v.map(|x| x.into());
10546        self
10547    }
10548
10549    /// Sets the value of [snapshot][crate::model::UpdateSnapshotRequest::snapshot].
10550    ///
10551    /// # Example
10552    /// ```ignore,no_run
10553    /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
10554    /// use google_cloud_netapp_v1::model::Snapshot;
10555    /// let x = UpdateSnapshotRequest::new().set_snapshot(Snapshot::default()/* use setters */);
10556    /// ```
10557    pub fn set_snapshot<T>(mut self, v: T) -> Self
10558    where
10559        T: std::convert::Into<crate::model::Snapshot>,
10560    {
10561        self.snapshot = std::option::Option::Some(v.into());
10562        self
10563    }
10564
10565    /// Sets or clears the value of [snapshot][crate::model::UpdateSnapshotRequest::snapshot].
10566    ///
10567    /// # Example
10568    /// ```ignore,no_run
10569    /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
10570    /// use google_cloud_netapp_v1::model::Snapshot;
10571    /// let x = UpdateSnapshotRequest::new().set_or_clear_snapshot(Some(Snapshot::default()/* use setters */));
10572    /// let x = UpdateSnapshotRequest::new().set_or_clear_snapshot(None::<Snapshot>);
10573    /// ```
10574    pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
10575    where
10576        T: std::convert::Into<crate::model::Snapshot>,
10577    {
10578        self.snapshot = v.map(|x| x.into());
10579        self
10580    }
10581}
10582
10583impl wkt::message::Message for UpdateSnapshotRequest {
10584    fn typename() -> &'static str {
10585        "type.googleapis.com/google.cloud.netapp.v1.UpdateSnapshotRequest"
10586    }
10587}
10588
10589/// Snapshot is a point-in-time version of a Volume's content.
10590#[derive(Clone, Default, PartialEq)]
10591#[non_exhaustive]
10592pub struct Snapshot {
10593    /// Identifier. The resource name of the snapshot.
10594    /// Format:
10595    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`.
10596    pub name: std::string::String,
10597
10598    /// Output only. The snapshot state.
10599    pub state: crate::model::snapshot::State,
10600
10601    /// Output only. State details of the storage pool
10602    pub state_details: std::string::String,
10603
10604    /// A description of the snapshot with 2048 characters or less.
10605    /// Requests with longer descriptions will be rejected.
10606    pub description: std::string::String,
10607
10608    /// Output only. Current storage usage for the snapshot in bytes.
10609    pub used_bytes: f64,
10610
10611    /// Output only. The time when the snapshot was created.
10612    pub create_time: std::option::Option<wkt::Timestamp>,
10613
10614    /// Resource labels to represent user provided metadata.
10615    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
10616
10617    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10618}
10619
10620impl Snapshot {
10621    pub fn new() -> Self {
10622        std::default::Default::default()
10623    }
10624
10625    /// Sets the value of [name][crate::model::Snapshot::name].
10626    ///
10627    /// # Example
10628    /// ```ignore,no_run
10629    /// # use google_cloud_netapp_v1::model::Snapshot;
10630    /// let x = Snapshot::new().set_name("example");
10631    /// ```
10632    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10633        self.name = v.into();
10634        self
10635    }
10636
10637    /// Sets the value of [state][crate::model::Snapshot::state].
10638    ///
10639    /// # Example
10640    /// ```ignore,no_run
10641    /// # use google_cloud_netapp_v1::model::Snapshot;
10642    /// use google_cloud_netapp_v1::model::snapshot::State;
10643    /// let x0 = Snapshot::new().set_state(State::Ready);
10644    /// let x1 = Snapshot::new().set_state(State::Creating);
10645    /// let x2 = Snapshot::new().set_state(State::Deleting);
10646    /// ```
10647    pub fn set_state<T: std::convert::Into<crate::model::snapshot::State>>(mut self, v: T) -> Self {
10648        self.state = v.into();
10649        self
10650    }
10651
10652    /// Sets the value of [state_details][crate::model::Snapshot::state_details].
10653    ///
10654    /// # Example
10655    /// ```ignore,no_run
10656    /// # use google_cloud_netapp_v1::model::Snapshot;
10657    /// let x = Snapshot::new().set_state_details("example");
10658    /// ```
10659    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10660        self.state_details = v.into();
10661        self
10662    }
10663
10664    /// Sets the value of [description][crate::model::Snapshot::description].
10665    ///
10666    /// # Example
10667    /// ```ignore,no_run
10668    /// # use google_cloud_netapp_v1::model::Snapshot;
10669    /// let x = Snapshot::new().set_description("example");
10670    /// ```
10671    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10672        self.description = v.into();
10673        self
10674    }
10675
10676    /// Sets the value of [used_bytes][crate::model::Snapshot::used_bytes].
10677    ///
10678    /// # Example
10679    /// ```ignore,no_run
10680    /// # use google_cloud_netapp_v1::model::Snapshot;
10681    /// let x = Snapshot::new().set_used_bytes(42.0);
10682    /// ```
10683    pub fn set_used_bytes<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
10684        self.used_bytes = v.into();
10685        self
10686    }
10687
10688    /// Sets the value of [create_time][crate::model::Snapshot::create_time].
10689    ///
10690    /// # Example
10691    /// ```ignore,no_run
10692    /// # use google_cloud_netapp_v1::model::Snapshot;
10693    /// use wkt::Timestamp;
10694    /// let x = Snapshot::new().set_create_time(Timestamp::default()/* use setters */);
10695    /// ```
10696    pub fn set_create_time<T>(mut self, v: T) -> Self
10697    where
10698        T: std::convert::Into<wkt::Timestamp>,
10699    {
10700        self.create_time = std::option::Option::Some(v.into());
10701        self
10702    }
10703
10704    /// Sets or clears the value of [create_time][crate::model::Snapshot::create_time].
10705    ///
10706    /// # Example
10707    /// ```ignore,no_run
10708    /// # use google_cloud_netapp_v1::model::Snapshot;
10709    /// use wkt::Timestamp;
10710    /// let x = Snapshot::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10711    /// let x = Snapshot::new().set_or_clear_create_time(None::<Timestamp>);
10712    /// ```
10713    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10714    where
10715        T: std::convert::Into<wkt::Timestamp>,
10716    {
10717        self.create_time = v.map(|x| x.into());
10718        self
10719    }
10720
10721    /// Sets the value of [labels][crate::model::Snapshot::labels].
10722    ///
10723    /// # Example
10724    /// ```ignore,no_run
10725    /// # use google_cloud_netapp_v1::model::Snapshot;
10726    /// let x = Snapshot::new().set_labels([
10727    ///     ("key0", "abc"),
10728    ///     ("key1", "xyz"),
10729    /// ]);
10730    /// ```
10731    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
10732    where
10733        T: std::iter::IntoIterator<Item = (K, V)>,
10734        K: std::convert::Into<std::string::String>,
10735        V: std::convert::Into<std::string::String>,
10736    {
10737        use std::iter::Iterator;
10738        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10739        self
10740    }
10741}
10742
10743impl wkt::message::Message for Snapshot {
10744    fn typename() -> &'static str {
10745        "type.googleapis.com/google.cloud.netapp.v1.Snapshot"
10746    }
10747}
10748
10749/// Defines additional types related to [Snapshot].
10750pub mod snapshot {
10751    #[allow(unused_imports)]
10752    use super::*;
10753
10754    /// The Snapshot States
10755    ///
10756    /// # Working with unknown values
10757    ///
10758    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10759    /// additional enum variants at any time. Adding new variants is not considered
10760    /// a breaking change. Applications should write their code in anticipation of:
10761    ///
10762    /// - New values appearing in future releases of the client library, **and**
10763    /// - New values received dynamically, without application changes.
10764    ///
10765    /// Please consult the [Working with enums] section in the user guide for some
10766    /// guidelines.
10767    ///
10768    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10769    #[derive(Clone, Debug, PartialEq)]
10770    #[non_exhaustive]
10771    pub enum State {
10772        /// Unspecified Snapshot State
10773        Unspecified,
10774        /// Snapshot State is Ready
10775        Ready,
10776        /// Snapshot State is Creating
10777        Creating,
10778        /// Snapshot State is Deleting
10779        Deleting,
10780        /// Snapshot State is Updating
10781        Updating,
10782        /// Snapshot State is Disabled
10783        Disabled,
10784        /// Snapshot State is Error
10785        Error,
10786        /// If set, the enum was initialized with an unknown value.
10787        ///
10788        /// Applications can examine the value using [State::value] or
10789        /// [State::name].
10790        UnknownValue(state::UnknownValue),
10791    }
10792
10793    #[doc(hidden)]
10794    pub mod state {
10795        #[allow(unused_imports)]
10796        use super::*;
10797        #[derive(Clone, Debug, PartialEq)]
10798        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10799    }
10800
10801    impl State {
10802        /// Gets the enum value.
10803        ///
10804        /// Returns `None` if the enum contains an unknown value deserialized from
10805        /// the string representation of enums.
10806        pub fn value(&self) -> std::option::Option<i32> {
10807            match self {
10808                Self::Unspecified => std::option::Option::Some(0),
10809                Self::Ready => std::option::Option::Some(1),
10810                Self::Creating => std::option::Option::Some(2),
10811                Self::Deleting => std::option::Option::Some(3),
10812                Self::Updating => std::option::Option::Some(4),
10813                Self::Disabled => std::option::Option::Some(5),
10814                Self::Error => std::option::Option::Some(6),
10815                Self::UnknownValue(u) => u.0.value(),
10816            }
10817        }
10818
10819        /// Gets the enum value as a string.
10820        ///
10821        /// Returns `None` if the enum contains an unknown value deserialized from
10822        /// the integer representation of enums.
10823        pub fn name(&self) -> std::option::Option<&str> {
10824            match self {
10825                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10826                Self::Ready => std::option::Option::Some("READY"),
10827                Self::Creating => std::option::Option::Some("CREATING"),
10828                Self::Deleting => std::option::Option::Some("DELETING"),
10829                Self::Updating => std::option::Option::Some("UPDATING"),
10830                Self::Disabled => std::option::Option::Some("DISABLED"),
10831                Self::Error => std::option::Option::Some("ERROR"),
10832                Self::UnknownValue(u) => u.0.name(),
10833            }
10834        }
10835    }
10836
10837    impl std::default::Default for State {
10838        fn default() -> Self {
10839            use std::convert::From;
10840            Self::from(0)
10841        }
10842    }
10843
10844    impl std::fmt::Display for State {
10845        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10846            wkt::internal::display_enum(f, self.name(), self.value())
10847        }
10848    }
10849
10850    impl std::convert::From<i32> for State {
10851        fn from(value: i32) -> Self {
10852            match value {
10853                0 => Self::Unspecified,
10854                1 => Self::Ready,
10855                2 => Self::Creating,
10856                3 => Self::Deleting,
10857                4 => Self::Updating,
10858                5 => Self::Disabled,
10859                6 => Self::Error,
10860                _ => Self::UnknownValue(state::UnknownValue(
10861                    wkt::internal::UnknownEnumValue::Integer(value),
10862                )),
10863            }
10864        }
10865    }
10866
10867    impl std::convert::From<&str> for State {
10868        fn from(value: &str) -> Self {
10869            use std::string::ToString;
10870            match value {
10871                "STATE_UNSPECIFIED" => Self::Unspecified,
10872                "READY" => Self::Ready,
10873                "CREATING" => Self::Creating,
10874                "DELETING" => Self::Deleting,
10875                "UPDATING" => Self::Updating,
10876                "DISABLED" => Self::Disabled,
10877                "ERROR" => Self::Error,
10878                _ => Self::UnknownValue(state::UnknownValue(
10879                    wkt::internal::UnknownEnumValue::String(value.to_string()),
10880                )),
10881            }
10882        }
10883    }
10884
10885    impl serde::ser::Serialize for State {
10886        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10887        where
10888            S: serde::Serializer,
10889        {
10890            match self {
10891                Self::Unspecified => serializer.serialize_i32(0),
10892                Self::Ready => serializer.serialize_i32(1),
10893                Self::Creating => serializer.serialize_i32(2),
10894                Self::Deleting => serializer.serialize_i32(3),
10895                Self::Updating => serializer.serialize_i32(4),
10896                Self::Disabled => serializer.serialize_i32(5),
10897                Self::Error => serializer.serialize_i32(6),
10898                Self::UnknownValue(u) => u.0.serialize(serializer),
10899            }
10900        }
10901    }
10902
10903    impl<'de> serde::de::Deserialize<'de> for State {
10904        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10905        where
10906            D: serde::Deserializer<'de>,
10907        {
10908            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
10909                ".google.cloud.netapp.v1.Snapshot.State",
10910            ))
10911        }
10912    }
10913}
10914
10915/// GetStoragePoolRequest gets a Storage Pool.
10916#[derive(Clone, Default, PartialEq)]
10917#[non_exhaustive]
10918pub struct GetStoragePoolRequest {
10919    /// Required. Name of the storage pool
10920    pub name: std::string::String,
10921
10922    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10923}
10924
10925impl GetStoragePoolRequest {
10926    pub fn new() -> Self {
10927        std::default::Default::default()
10928    }
10929
10930    /// Sets the value of [name][crate::model::GetStoragePoolRequest::name].
10931    ///
10932    /// # Example
10933    /// ```ignore,no_run
10934    /// # use google_cloud_netapp_v1::model::GetStoragePoolRequest;
10935    /// let x = GetStoragePoolRequest::new().set_name("example");
10936    /// ```
10937    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10938        self.name = v.into();
10939        self
10940    }
10941}
10942
10943impl wkt::message::Message for GetStoragePoolRequest {
10944    fn typename() -> &'static str {
10945        "type.googleapis.com/google.cloud.netapp.v1.GetStoragePoolRequest"
10946    }
10947}
10948
10949/// ListStoragePoolsRequest lists Storage Pools.
10950#[derive(Clone, Default, PartialEq)]
10951#[non_exhaustive]
10952pub struct ListStoragePoolsRequest {
10953    /// Required. Parent value
10954    pub parent: std::string::String,
10955
10956    /// Optional. The maximum number of items to return.
10957    pub page_size: i32,
10958
10959    /// Optional. The next_page_token value to use if there are additional
10960    /// results to retrieve for this list request.
10961    pub page_token: std::string::String,
10962
10963    /// Optional. Sort results. Supported values are "name", "name desc" or ""
10964    /// (unsorted).
10965    pub order_by: std::string::String,
10966
10967    /// Optional. List filter.
10968    pub filter: std::string::String,
10969
10970    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10971}
10972
10973impl ListStoragePoolsRequest {
10974    pub fn new() -> Self {
10975        std::default::Default::default()
10976    }
10977
10978    /// Sets the value of [parent][crate::model::ListStoragePoolsRequest::parent].
10979    ///
10980    /// # Example
10981    /// ```ignore,no_run
10982    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
10983    /// let x = ListStoragePoolsRequest::new().set_parent("example");
10984    /// ```
10985    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10986        self.parent = v.into();
10987        self
10988    }
10989
10990    /// Sets the value of [page_size][crate::model::ListStoragePoolsRequest::page_size].
10991    ///
10992    /// # Example
10993    /// ```ignore,no_run
10994    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
10995    /// let x = ListStoragePoolsRequest::new().set_page_size(42);
10996    /// ```
10997    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10998        self.page_size = v.into();
10999        self
11000    }
11001
11002    /// Sets the value of [page_token][crate::model::ListStoragePoolsRequest::page_token].
11003    ///
11004    /// # Example
11005    /// ```ignore,no_run
11006    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11007    /// let x = ListStoragePoolsRequest::new().set_page_token("example");
11008    /// ```
11009    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11010        self.page_token = v.into();
11011        self
11012    }
11013
11014    /// Sets the value of [order_by][crate::model::ListStoragePoolsRequest::order_by].
11015    ///
11016    /// # Example
11017    /// ```ignore,no_run
11018    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11019    /// let x = ListStoragePoolsRequest::new().set_order_by("example");
11020    /// ```
11021    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11022        self.order_by = v.into();
11023        self
11024    }
11025
11026    /// Sets the value of [filter][crate::model::ListStoragePoolsRequest::filter].
11027    ///
11028    /// # Example
11029    /// ```ignore,no_run
11030    /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
11031    /// let x = ListStoragePoolsRequest::new().set_filter("example");
11032    /// ```
11033    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11034        self.filter = v.into();
11035        self
11036    }
11037}
11038
11039impl wkt::message::Message for ListStoragePoolsRequest {
11040    fn typename() -> &'static str {
11041        "type.googleapis.com/google.cloud.netapp.v1.ListStoragePoolsRequest"
11042    }
11043}
11044
11045/// ListStoragePoolsResponse is the response to a ListStoragePoolsRequest.
11046#[derive(Clone, Default, PartialEq)]
11047#[non_exhaustive]
11048pub struct ListStoragePoolsResponse {
11049    /// The list of StoragePools
11050    pub storage_pools: std::vec::Vec<crate::model::StoragePool>,
11051
11052    /// A token identifying a page of results the server should return.
11053    pub next_page_token: std::string::String,
11054
11055    /// Locations that could not be reached.
11056    pub unreachable: std::vec::Vec<std::string::String>,
11057
11058    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11059}
11060
11061impl ListStoragePoolsResponse {
11062    pub fn new() -> Self {
11063        std::default::Default::default()
11064    }
11065
11066    /// Sets the value of [storage_pools][crate::model::ListStoragePoolsResponse::storage_pools].
11067    ///
11068    /// # Example
11069    /// ```ignore,no_run
11070    /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
11071    /// use google_cloud_netapp_v1::model::StoragePool;
11072    /// let x = ListStoragePoolsResponse::new()
11073    ///     .set_storage_pools([
11074    ///         StoragePool::default()/* use setters */,
11075    ///         StoragePool::default()/* use (different) setters */,
11076    ///     ]);
11077    /// ```
11078    pub fn set_storage_pools<T, V>(mut self, v: T) -> Self
11079    where
11080        T: std::iter::IntoIterator<Item = V>,
11081        V: std::convert::Into<crate::model::StoragePool>,
11082    {
11083        use std::iter::Iterator;
11084        self.storage_pools = v.into_iter().map(|i| i.into()).collect();
11085        self
11086    }
11087
11088    /// Sets the value of [next_page_token][crate::model::ListStoragePoolsResponse::next_page_token].
11089    ///
11090    /// # Example
11091    /// ```ignore,no_run
11092    /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
11093    /// let x = ListStoragePoolsResponse::new().set_next_page_token("example");
11094    /// ```
11095    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11096        self.next_page_token = v.into();
11097        self
11098    }
11099
11100    /// Sets the value of [unreachable][crate::model::ListStoragePoolsResponse::unreachable].
11101    ///
11102    /// # Example
11103    /// ```ignore,no_run
11104    /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
11105    /// let x = ListStoragePoolsResponse::new().set_unreachable(["a", "b", "c"]);
11106    /// ```
11107    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11108    where
11109        T: std::iter::IntoIterator<Item = V>,
11110        V: std::convert::Into<std::string::String>,
11111    {
11112        use std::iter::Iterator;
11113        self.unreachable = v.into_iter().map(|i| i.into()).collect();
11114        self
11115    }
11116}
11117
11118impl wkt::message::Message for ListStoragePoolsResponse {
11119    fn typename() -> &'static str {
11120        "type.googleapis.com/google.cloud.netapp.v1.ListStoragePoolsResponse"
11121    }
11122}
11123
11124#[doc(hidden)]
11125impl google_cloud_gax::paginator::internal::PageableResponse for ListStoragePoolsResponse {
11126    type PageItem = crate::model::StoragePool;
11127
11128    fn items(self) -> std::vec::Vec<Self::PageItem> {
11129        self.storage_pools
11130    }
11131
11132    fn next_page_token(&self) -> std::string::String {
11133        use std::clone::Clone;
11134        self.next_page_token.clone()
11135    }
11136}
11137
11138/// CreateStoragePoolRequest creates a Storage Pool.
11139#[derive(Clone, Default, PartialEq)]
11140#[non_exhaustive]
11141pub struct CreateStoragePoolRequest {
11142    /// Required. Value for parent.
11143    pub parent: std::string::String,
11144
11145    /// Required. Id of the requesting storage pool. Must be unique within the
11146    /// parent resource. Must contain only letters, numbers and hyphen, with the
11147    /// first character a letter, the last a letter or a number, and a 63 character
11148    /// maximum.
11149    pub storage_pool_id: std::string::String,
11150
11151    /// Required. The required parameters to create a new storage pool.
11152    pub storage_pool: std::option::Option<crate::model::StoragePool>,
11153
11154    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11155}
11156
11157impl CreateStoragePoolRequest {
11158    pub fn new() -> Self {
11159        std::default::Default::default()
11160    }
11161
11162    /// Sets the value of [parent][crate::model::CreateStoragePoolRequest::parent].
11163    ///
11164    /// # Example
11165    /// ```ignore,no_run
11166    /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11167    /// let x = CreateStoragePoolRequest::new().set_parent("example");
11168    /// ```
11169    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11170        self.parent = v.into();
11171        self
11172    }
11173
11174    /// Sets the value of [storage_pool_id][crate::model::CreateStoragePoolRequest::storage_pool_id].
11175    ///
11176    /// # Example
11177    /// ```ignore,no_run
11178    /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11179    /// let x = CreateStoragePoolRequest::new().set_storage_pool_id("example");
11180    /// ```
11181    pub fn set_storage_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11182        self.storage_pool_id = v.into();
11183        self
11184    }
11185
11186    /// Sets the value of [storage_pool][crate::model::CreateStoragePoolRequest::storage_pool].
11187    ///
11188    /// # Example
11189    /// ```ignore,no_run
11190    /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11191    /// use google_cloud_netapp_v1::model::StoragePool;
11192    /// let x = CreateStoragePoolRequest::new().set_storage_pool(StoragePool::default()/* use setters */);
11193    /// ```
11194    pub fn set_storage_pool<T>(mut self, v: T) -> Self
11195    where
11196        T: std::convert::Into<crate::model::StoragePool>,
11197    {
11198        self.storage_pool = std::option::Option::Some(v.into());
11199        self
11200    }
11201
11202    /// Sets or clears the value of [storage_pool][crate::model::CreateStoragePoolRequest::storage_pool].
11203    ///
11204    /// # Example
11205    /// ```ignore,no_run
11206    /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
11207    /// use google_cloud_netapp_v1::model::StoragePool;
11208    /// let x = CreateStoragePoolRequest::new().set_or_clear_storage_pool(Some(StoragePool::default()/* use setters */));
11209    /// let x = CreateStoragePoolRequest::new().set_or_clear_storage_pool(None::<StoragePool>);
11210    /// ```
11211    pub fn set_or_clear_storage_pool<T>(mut self, v: std::option::Option<T>) -> Self
11212    where
11213        T: std::convert::Into<crate::model::StoragePool>,
11214    {
11215        self.storage_pool = v.map(|x| x.into());
11216        self
11217    }
11218}
11219
11220impl wkt::message::Message for CreateStoragePoolRequest {
11221    fn typename() -> &'static str {
11222        "type.googleapis.com/google.cloud.netapp.v1.CreateStoragePoolRequest"
11223    }
11224}
11225
11226/// UpdateStoragePoolRequest updates a Storage Pool.
11227#[derive(Clone, Default, PartialEq)]
11228#[non_exhaustive]
11229pub struct UpdateStoragePoolRequest {
11230    /// Required. Field mask is used to specify the fields to be overwritten in the
11231    /// StoragePool resource by the update.
11232    /// The fields specified in the update_mask are relative to the resource, not
11233    /// the full request. A field will be overwritten if it is in the mask. If the
11234    /// user does not provide a mask then all fields will be overwritten.
11235    pub update_mask: std::option::Option<wkt::FieldMask>,
11236
11237    /// Required. The pool being updated
11238    pub storage_pool: std::option::Option<crate::model::StoragePool>,
11239
11240    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11241}
11242
11243impl UpdateStoragePoolRequest {
11244    pub fn new() -> Self {
11245        std::default::Default::default()
11246    }
11247
11248    /// Sets the value of [update_mask][crate::model::UpdateStoragePoolRequest::update_mask].
11249    ///
11250    /// # Example
11251    /// ```ignore,no_run
11252    /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
11253    /// use wkt::FieldMask;
11254    /// let x = UpdateStoragePoolRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11255    /// ```
11256    pub fn set_update_mask<T>(mut self, v: T) -> Self
11257    where
11258        T: std::convert::Into<wkt::FieldMask>,
11259    {
11260        self.update_mask = std::option::Option::Some(v.into());
11261        self
11262    }
11263
11264    /// Sets or clears the value of [update_mask][crate::model::UpdateStoragePoolRequest::update_mask].
11265    ///
11266    /// # Example
11267    /// ```ignore,no_run
11268    /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
11269    /// use wkt::FieldMask;
11270    /// let x = UpdateStoragePoolRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11271    /// let x = UpdateStoragePoolRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11272    /// ```
11273    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11274    where
11275        T: std::convert::Into<wkt::FieldMask>,
11276    {
11277        self.update_mask = v.map(|x| x.into());
11278        self
11279    }
11280
11281    /// Sets the value of [storage_pool][crate::model::UpdateStoragePoolRequest::storage_pool].
11282    ///
11283    /// # Example
11284    /// ```ignore,no_run
11285    /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
11286    /// use google_cloud_netapp_v1::model::StoragePool;
11287    /// let x = UpdateStoragePoolRequest::new().set_storage_pool(StoragePool::default()/* use setters */);
11288    /// ```
11289    pub fn set_storage_pool<T>(mut self, v: T) -> Self
11290    where
11291        T: std::convert::Into<crate::model::StoragePool>,
11292    {
11293        self.storage_pool = std::option::Option::Some(v.into());
11294        self
11295    }
11296
11297    /// Sets or clears the value of [storage_pool][crate::model::UpdateStoragePoolRequest::storage_pool].
11298    ///
11299    /// # Example
11300    /// ```ignore,no_run
11301    /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
11302    /// use google_cloud_netapp_v1::model::StoragePool;
11303    /// let x = UpdateStoragePoolRequest::new().set_or_clear_storage_pool(Some(StoragePool::default()/* use setters */));
11304    /// let x = UpdateStoragePoolRequest::new().set_or_clear_storage_pool(None::<StoragePool>);
11305    /// ```
11306    pub fn set_or_clear_storage_pool<T>(mut self, v: std::option::Option<T>) -> Self
11307    where
11308        T: std::convert::Into<crate::model::StoragePool>,
11309    {
11310        self.storage_pool = v.map(|x| x.into());
11311        self
11312    }
11313}
11314
11315impl wkt::message::Message for UpdateStoragePoolRequest {
11316    fn typename() -> &'static str {
11317        "type.googleapis.com/google.cloud.netapp.v1.UpdateStoragePoolRequest"
11318    }
11319}
11320
11321/// DeleteStoragePoolRequest deletes a Storage Pool.
11322#[derive(Clone, Default, PartialEq)]
11323#[non_exhaustive]
11324pub struct DeleteStoragePoolRequest {
11325    /// Required. Name of the storage pool
11326    pub name: std::string::String,
11327
11328    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11329}
11330
11331impl DeleteStoragePoolRequest {
11332    pub fn new() -> Self {
11333        std::default::Default::default()
11334    }
11335
11336    /// Sets the value of [name][crate::model::DeleteStoragePoolRequest::name].
11337    ///
11338    /// # Example
11339    /// ```ignore,no_run
11340    /// # use google_cloud_netapp_v1::model::DeleteStoragePoolRequest;
11341    /// let x = DeleteStoragePoolRequest::new().set_name("example");
11342    /// ```
11343    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11344        self.name = v.into();
11345        self
11346    }
11347}
11348
11349impl wkt::message::Message for DeleteStoragePoolRequest {
11350    fn typename() -> &'static str {
11351        "type.googleapis.com/google.cloud.netapp.v1.DeleteStoragePoolRequest"
11352    }
11353}
11354
11355/// SwitchActiveReplicaZoneRequest switch the active/replica zone for a regional
11356/// storagePool.
11357#[derive(Clone, Default, PartialEq)]
11358#[non_exhaustive]
11359pub struct SwitchActiveReplicaZoneRequest {
11360    /// Required. Name of the storage pool
11361    pub name: std::string::String,
11362
11363    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11364}
11365
11366impl SwitchActiveReplicaZoneRequest {
11367    pub fn new() -> Self {
11368        std::default::Default::default()
11369    }
11370
11371    /// Sets the value of [name][crate::model::SwitchActiveReplicaZoneRequest::name].
11372    ///
11373    /// # Example
11374    /// ```ignore,no_run
11375    /// # use google_cloud_netapp_v1::model::SwitchActiveReplicaZoneRequest;
11376    /// let x = SwitchActiveReplicaZoneRequest::new().set_name("example");
11377    /// ```
11378    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11379        self.name = v.into();
11380        self
11381    }
11382}
11383
11384impl wkt::message::Message for SwitchActiveReplicaZoneRequest {
11385    fn typename() -> &'static str {
11386        "type.googleapis.com/google.cloud.netapp.v1.SwitchActiveReplicaZoneRequest"
11387    }
11388}
11389
11390/// StoragePool is a container for volumes with a service level and capacity.
11391/// Volumes can be created in a pool of sufficient available capacity.
11392/// StoragePool capacity is what you are billed for.
11393#[derive(Clone, Default, PartialEq)]
11394#[non_exhaustive]
11395pub struct StoragePool {
11396    /// Identifier. Name of the storage pool
11397    pub name: std::string::String,
11398
11399    /// Required. Service level of the storage pool
11400    pub service_level: crate::model::ServiceLevel,
11401
11402    /// Required. Capacity in GIB of the pool
11403    pub capacity_gib: i64,
11404
11405    /// Output only. Allocated size of all volumes in GIB in the storage pool
11406    pub volume_capacity_gib: i64,
11407
11408    /// Output only. Volume count of the storage pool
11409    pub volume_count: i32,
11410
11411    /// Output only. State of the storage pool
11412    pub state: crate::model::storage_pool::State,
11413
11414    /// Output only. State details of the storage pool
11415    pub state_details: std::string::String,
11416
11417    /// Output only. Create time of the storage pool
11418    pub create_time: std::option::Option<wkt::Timestamp>,
11419
11420    /// Optional. Description of the storage pool
11421    pub description: std::string::String,
11422
11423    /// Optional. Labels as key value pairs
11424    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11425
11426    /// Required. VPC Network name.
11427    /// Format: projects/{project}/global/networks/{network}
11428    pub network: std::string::String,
11429
11430    /// Optional. Specifies the Active Directory to be used for creating a SMB
11431    /// volume.
11432    pub active_directory: std::string::String,
11433
11434    /// Optional. Specifies the KMS config to be used for volume encryption.
11435    pub kms_config: std::string::String,
11436
11437    /// Optional. Flag indicating if the pool is NFS LDAP enabled or not.
11438    pub ldap_enabled: bool,
11439
11440    /// Optional. This field is not implemented. The values provided in this field
11441    /// are ignored.
11442    pub psa_range: std::string::String,
11443
11444    /// Output only. Specifies the current pool encryption key source.
11445    pub encryption_type: crate::model::EncryptionType,
11446
11447    /// Deprecated. Used to allow SO pool to access AD or DNS server from other
11448    /// regions.
11449    #[deprecated]
11450    pub global_access_allowed: std::option::Option<bool>,
11451
11452    /// Optional. True if the storage pool supports Auto Tiering enabled volumes.
11453    /// Default is false. Auto-tiering can be enabled after storage pool creation
11454    /// but it can't be disabled once enabled.
11455    pub allow_auto_tiering: bool,
11456
11457    /// Optional. Specifies the replica zone for regional storagePool.
11458    pub replica_zone: std::string::String,
11459
11460    /// Optional. Specifies the active zone for regional storagePool.
11461    pub zone: std::string::String,
11462
11463    /// Output only. Reserved for future use
11464    pub satisfies_pzs: bool,
11465
11466    /// Output only. Reserved for future use
11467    pub satisfies_pzi: bool,
11468
11469    /// Optional. True if using Independent Scaling of capacity and performance
11470    /// (Hyperdisk) By default set to false
11471    pub custom_performance_enabled: bool,
11472
11473    /// Optional. Custom Performance Total Throughput of the pool (in MiBps)
11474    pub total_throughput_mibps: i64,
11475
11476    /// Optional. Custom Performance Total IOPS of the pool
11477    /// if not provided, it will be calculated based on the total_throughput_mibps
11478    pub total_iops: i64,
11479
11480    /// Optional. Total hot tier capacity for the Storage Pool. It is applicable
11481    /// only to Flex service level. It should be less than the minimum storage pool
11482    /// size and cannot be more than the current storage pool size. It cannot be
11483    /// decreased once set.
11484    pub hot_tier_size_gib: i64,
11485
11486    /// Optional. Flag indicating that the hot-tier threshold will be
11487    /// auto-increased by 10% of the hot-tier when it hits 100%. Default is true.
11488    /// The increment will kick in only if the new size after increment is
11489    /// still less than or equal to storage pool size.
11490    pub enable_hot_tier_auto_resize: std::option::Option<bool>,
11491
11492    /// Optional. QoS (Quality of Service) Type of the storage pool
11493    pub qos_type: crate::model::QosType,
11494
11495    /// Output only. Available throughput of the storage pool (in MiB/s).
11496    pub available_throughput_mibps: f64,
11497
11498    /// Output only. Total cold tier data rounded down to the nearest GiB used by
11499    /// the storage pool.
11500    pub cold_tier_size_used_gib: i64,
11501
11502    /// Output only. Total hot tier data rounded down to the nearest GiB used by
11503    /// the storage pool.
11504    pub hot_tier_size_used_gib: i64,
11505
11506    /// Optional. Type of the storage pool. This field is used to control whether
11507    /// the pool supports `FILE` based volumes only or `UNIFIED` (both `FILE` and
11508    /// `BLOCK`) volumes or `UNIFIED_LARGE_CAPACITY` (both `FILE` and `BLOCK`)
11509    /// volumes with large capacity. If not specified during creation, it defaults
11510    /// to `FILE`.
11511    pub r#type: std::option::Option<crate::model::StoragePoolType>,
11512
11513    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11514}
11515
11516impl StoragePool {
11517    pub fn new() -> Self {
11518        std::default::Default::default()
11519    }
11520
11521    /// Sets the value of [name][crate::model::StoragePool::name].
11522    ///
11523    /// # Example
11524    /// ```ignore,no_run
11525    /// # use google_cloud_netapp_v1::model::StoragePool;
11526    /// let x = StoragePool::new().set_name("example");
11527    /// ```
11528    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11529        self.name = v.into();
11530        self
11531    }
11532
11533    /// Sets the value of [service_level][crate::model::StoragePool::service_level].
11534    ///
11535    /// # Example
11536    /// ```ignore,no_run
11537    /// # use google_cloud_netapp_v1::model::StoragePool;
11538    /// use google_cloud_netapp_v1::model::ServiceLevel;
11539    /// let x0 = StoragePool::new().set_service_level(ServiceLevel::Premium);
11540    /// let x1 = StoragePool::new().set_service_level(ServiceLevel::Extreme);
11541    /// let x2 = StoragePool::new().set_service_level(ServiceLevel::Standard);
11542    /// ```
11543    pub fn set_service_level<T: std::convert::Into<crate::model::ServiceLevel>>(
11544        mut self,
11545        v: T,
11546    ) -> Self {
11547        self.service_level = v.into();
11548        self
11549    }
11550
11551    /// Sets the value of [capacity_gib][crate::model::StoragePool::capacity_gib].
11552    ///
11553    /// # Example
11554    /// ```ignore,no_run
11555    /// # use google_cloud_netapp_v1::model::StoragePool;
11556    /// let x = StoragePool::new().set_capacity_gib(42);
11557    /// ```
11558    pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11559        self.capacity_gib = v.into();
11560        self
11561    }
11562
11563    /// Sets the value of [volume_capacity_gib][crate::model::StoragePool::volume_capacity_gib].
11564    ///
11565    /// # Example
11566    /// ```ignore,no_run
11567    /// # use google_cloud_netapp_v1::model::StoragePool;
11568    /// let x = StoragePool::new().set_volume_capacity_gib(42);
11569    /// ```
11570    pub fn set_volume_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11571        self.volume_capacity_gib = v.into();
11572        self
11573    }
11574
11575    /// Sets the value of [volume_count][crate::model::StoragePool::volume_count].
11576    ///
11577    /// # Example
11578    /// ```ignore,no_run
11579    /// # use google_cloud_netapp_v1::model::StoragePool;
11580    /// let x = StoragePool::new().set_volume_count(42);
11581    /// ```
11582    pub fn set_volume_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11583        self.volume_count = v.into();
11584        self
11585    }
11586
11587    /// Sets the value of [state][crate::model::StoragePool::state].
11588    ///
11589    /// # Example
11590    /// ```ignore,no_run
11591    /// # use google_cloud_netapp_v1::model::StoragePool;
11592    /// use google_cloud_netapp_v1::model::storage_pool::State;
11593    /// let x0 = StoragePool::new().set_state(State::Ready);
11594    /// let x1 = StoragePool::new().set_state(State::Creating);
11595    /// let x2 = StoragePool::new().set_state(State::Deleting);
11596    /// ```
11597    pub fn set_state<T: std::convert::Into<crate::model::storage_pool::State>>(
11598        mut self,
11599        v: T,
11600    ) -> Self {
11601        self.state = v.into();
11602        self
11603    }
11604
11605    /// Sets the value of [state_details][crate::model::StoragePool::state_details].
11606    ///
11607    /// # Example
11608    /// ```ignore,no_run
11609    /// # use google_cloud_netapp_v1::model::StoragePool;
11610    /// let x = StoragePool::new().set_state_details("example");
11611    /// ```
11612    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11613        self.state_details = v.into();
11614        self
11615    }
11616
11617    /// Sets the value of [create_time][crate::model::StoragePool::create_time].
11618    ///
11619    /// # Example
11620    /// ```ignore,no_run
11621    /// # use google_cloud_netapp_v1::model::StoragePool;
11622    /// use wkt::Timestamp;
11623    /// let x = StoragePool::new().set_create_time(Timestamp::default()/* use setters */);
11624    /// ```
11625    pub fn set_create_time<T>(mut self, v: T) -> Self
11626    where
11627        T: std::convert::Into<wkt::Timestamp>,
11628    {
11629        self.create_time = std::option::Option::Some(v.into());
11630        self
11631    }
11632
11633    /// Sets or clears the value of [create_time][crate::model::StoragePool::create_time].
11634    ///
11635    /// # Example
11636    /// ```ignore,no_run
11637    /// # use google_cloud_netapp_v1::model::StoragePool;
11638    /// use wkt::Timestamp;
11639    /// let x = StoragePool::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11640    /// let x = StoragePool::new().set_or_clear_create_time(None::<Timestamp>);
11641    /// ```
11642    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11643    where
11644        T: std::convert::Into<wkt::Timestamp>,
11645    {
11646        self.create_time = v.map(|x| x.into());
11647        self
11648    }
11649
11650    /// Sets the value of [description][crate::model::StoragePool::description].
11651    ///
11652    /// # Example
11653    /// ```ignore,no_run
11654    /// # use google_cloud_netapp_v1::model::StoragePool;
11655    /// let x = StoragePool::new().set_description("example");
11656    /// ```
11657    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11658        self.description = v.into();
11659        self
11660    }
11661
11662    /// Sets the value of [labels][crate::model::StoragePool::labels].
11663    ///
11664    /// # Example
11665    /// ```ignore,no_run
11666    /// # use google_cloud_netapp_v1::model::StoragePool;
11667    /// let x = StoragePool::new().set_labels([
11668    ///     ("key0", "abc"),
11669    ///     ("key1", "xyz"),
11670    /// ]);
11671    /// ```
11672    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
11673    where
11674        T: std::iter::IntoIterator<Item = (K, V)>,
11675        K: std::convert::Into<std::string::String>,
11676        V: std::convert::Into<std::string::String>,
11677    {
11678        use std::iter::Iterator;
11679        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
11680        self
11681    }
11682
11683    /// Sets the value of [network][crate::model::StoragePool::network].
11684    ///
11685    /// # Example
11686    /// ```ignore,no_run
11687    /// # use google_cloud_netapp_v1::model::StoragePool;
11688    /// let x = StoragePool::new().set_network("example");
11689    /// ```
11690    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11691        self.network = v.into();
11692        self
11693    }
11694
11695    /// Sets the value of [active_directory][crate::model::StoragePool::active_directory].
11696    ///
11697    /// # Example
11698    /// ```ignore,no_run
11699    /// # use google_cloud_netapp_v1::model::StoragePool;
11700    /// let x = StoragePool::new().set_active_directory("example");
11701    /// ```
11702    pub fn set_active_directory<T: std::convert::Into<std::string::String>>(
11703        mut self,
11704        v: T,
11705    ) -> Self {
11706        self.active_directory = v.into();
11707        self
11708    }
11709
11710    /// Sets the value of [kms_config][crate::model::StoragePool::kms_config].
11711    ///
11712    /// # Example
11713    /// ```ignore,no_run
11714    /// # use google_cloud_netapp_v1::model::StoragePool;
11715    /// let x = StoragePool::new().set_kms_config("example");
11716    /// ```
11717    pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11718        self.kms_config = v.into();
11719        self
11720    }
11721
11722    /// Sets the value of [ldap_enabled][crate::model::StoragePool::ldap_enabled].
11723    ///
11724    /// # Example
11725    /// ```ignore,no_run
11726    /// # use google_cloud_netapp_v1::model::StoragePool;
11727    /// let x = StoragePool::new().set_ldap_enabled(true);
11728    /// ```
11729    pub fn set_ldap_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11730        self.ldap_enabled = v.into();
11731        self
11732    }
11733
11734    /// Sets the value of [psa_range][crate::model::StoragePool::psa_range].
11735    ///
11736    /// # Example
11737    /// ```ignore,no_run
11738    /// # use google_cloud_netapp_v1::model::StoragePool;
11739    /// let x = StoragePool::new().set_psa_range("example");
11740    /// ```
11741    pub fn set_psa_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11742        self.psa_range = v.into();
11743        self
11744    }
11745
11746    /// Sets the value of [encryption_type][crate::model::StoragePool::encryption_type].
11747    ///
11748    /// # Example
11749    /// ```ignore,no_run
11750    /// # use google_cloud_netapp_v1::model::StoragePool;
11751    /// use google_cloud_netapp_v1::model::EncryptionType;
11752    /// let x0 = StoragePool::new().set_encryption_type(EncryptionType::ServiceManaged);
11753    /// let x1 = StoragePool::new().set_encryption_type(EncryptionType::CloudKms);
11754    /// ```
11755    pub fn set_encryption_type<T: std::convert::Into<crate::model::EncryptionType>>(
11756        mut self,
11757        v: T,
11758    ) -> Self {
11759        self.encryption_type = v.into();
11760        self
11761    }
11762
11763    /// Sets the value of [global_access_allowed][crate::model::StoragePool::global_access_allowed].
11764    ///
11765    /// # Example
11766    /// ```ignore,no_run
11767    /// # use google_cloud_netapp_v1::model::StoragePool;
11768    /// let x = StoragePool::new().set_global_access_allowed(true);
11769    /// ```
11770    #[deprecated]
11771    pub fn set_global_access_allowed<T>(mut self, v: T) -> Self
11772    where
11773        T: std::convert::Into<bool>,
11774    {
11775        self.global_access_allowed = std::option::Option::Some(v.into());
11776        self
11777    }
11778
11779    /// Sets or clears the value of [global_access_allowed][crate::model::StoragePool::global_access_allowed].
11780    ///
11781    /// # Example
11782    /// ```ignore,no_run
11783    /// # use google_cloud_netapp_v1::model::StoragePool;
11784    /// let x = StoragePool::new().set_or_clear_global_access_allowed(Some(false));
11785    /// let x = StoragePool::new().set_or_clear_global_access_allowed(None::<bool>);
11786    /// ```
11787    #[deprecated]
11788    pub fn set_or_clear_global_access_allowed<T>(mut self, v: std::option::Option<T>) -> Self
11789    where
11790        T: std::convert::Into<bool>,
11791    {
11792        self.global_access_allowed = v.map(|x| x.into());
11793        self
11794    }
11795
11796    /// Sets the value of [allow_auto_tiering][crate::model::StoragePool::allow_auto_tiering].
11797    ///
11798    /// # Example
11799    /// ```ignore,no_run
11800    /// # use google_cloud_netapp_v1::model::StoragePool;
11801    /// let x = StoragePool::new().set_allow_auto_tiering(true);
11802    /// ```
11803    pub fn set_allow_auto_tiering<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11804        self.allow_auto_tiering = v.into();
11805        self
11806    }
11807
11808    /// Sets the value of [replica_zone][crate::model::StoragePool::replica_zone].
11809    ///
11810    /// # Example
11811    /// ```ignore,no_run
11812    /// # use google_cloud_netapp_v1::model::StoragePool;
11813    /// let x = StoragePool::new().set_replica_zone("example");
11814    /// ```
11815    pub fn set_replica_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11816        self.replica_zone = v.into();
11817        self
11818    }
11819
11820    /// Sets the value of [zone][crate::model::StoragePool::zone].
11821    ///
11822    /// # Example
11823    /// ```ignore,no_run
11824    /// # use google_cloud_netapp_v1::model::StoragePool;
11825    /// let x = StoragePool::new().set_zone("example");
11826    /// ```
11827    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11828        self.zone = v.into();
11829        self
11830    }
11831
11832    /// Sets the value of [satisfies_pzs][crate::model::StoragePool::satisfies_pzs].
11833    ///
11834    /// # Example
11835    /// ```ignore,no_run
11836    /// # use google_cloud_netapp_v1::model::StoragePool;
11837    /// let x = StoragePool::new().set_satisfies_pzs(true);
11838    /// ```
11839    pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11840        self.satisfies_pzs = v.into();
11841        self
11842    }
11843
11844    /// Sets the value of [satisfies_pzi][crate::model::StoragePool::satisfies_pzi].
11845    ///
11846    /// # Example
11847    /// ```ignore,no_run
11848    /// # use google_cloud_netapp_v1::model::StoragePool;
11849    /// let x = StoragePool::new().set_satisfies_pzi(true);
11850    /// ```
11851    pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11852        self.satisfies_pzi = v.into();
11853        self
11854    }
11855
11856    /// Sets the value of [custom_performance_enabled][crate::model::StoragePool::custom_performance_enabled].
11857    ///
11858    /// # Example
11859    /// ```ignore,no_run
11860    /// # use google_cloud_netapp_v1::model::StoragePool;
11861    /// let x = StoragePool::new().set_custom_performance_enabled(true);
11862    /// ```
11863    pub fn set_custom_performance_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11864        self.custom_performance_enabled = v.into();
11865        self
11866    }
11867
11868    /// Sets the value of [total_throughput_mibps][crate::model::StoragePool::total_throughput_mibps].
11869    ///
11870    /// # Example
11871    /// ```ignore,no_run
11872    /// # use google_cloud_netapp_v1::model::StoragePool;
11873    /// let x = StoragePool::new().set_total_throughput_mibps(42);
11874    /// ```
11875    pub fn set_total_throughput_mibps<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11876        self.total_throughput_mibps = v.into();
11877        self
11878    }
11879
11880    /// Sets the value of [total_iops][crate::model::StoragePool::total_iops].
11881    ///
11882    /// # Example
11883    /// ```ignore,no_run
11884    /// # use google_cloud_netapp_v1::model::StoragePool;
11885    /// let x = StoragePool::new().set_total_iops(42);
11886    /// ```
11887    pub fn set_total_iops<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11888        self.total_iops = v.into();
11889        self
11890    }
11891
11892    /// Sets the value of [hot_tier_size_gib][crate::model::StoragePool::hot_tier_size_gib].
11893    ///
11894    /// # Example
11895    /// ```ignore,no_run
11896    /// # use google_cloud_netapp_v1::model::StoragePool;
11897    /// let x = StoragePool::new().set_hot_tier_size_gib(42);
11898    /// ```
11899    pub fn set_hot_tier_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11900        self.hot_tier_size_gib = v.into();
11901        self
11902    }
11903
11904    /// Sets the value of [enable_hot_tier_auto_resize][crate::model::StoragePool::enable_hot_tier_auto_resize].
11905    ///
11906    /// # Example
11907    /// ```ignore,no_run
11908    /// # use google_cloud_netapp_v1::model::StoragePool;
11909    /// let x = StoragePool::new().set_enable_hot_tier_auto_resize(true);
11910    /// ```
11911    pub fn set_enable_hot_tier_auto_resize<T>(mut self, v: T) -> Self
11912    where
11913        T: std::convert::Into<bool>,
11914    {
11915        self.enable_hot_tier_auto_resize = std::option::Option::Some(v.into());
11916        self
11917    }
11918
11919    /// Sets or clears the value of [enable_hot_tier_auto_resize][crate::model::StoragePool::enable_hot_tier_auto_resize].
11920    ///
11921    /// # Example
11922    /// ```ignore,no_run
11923    /// # use google_cloud_netapp_v1::model::StoragePool;
11924    /// let x = StoragePool::new().set_or_clear_enable_hot_tier_auto_resize(Some(false));
11925    /// let x = StoragePool::new().set_or_clear_enable_hot_tier_auto_resize(None::<bool>);
11926    /// ```
11927    pub fn set_or_clear_enable_hot_tier_auto_resize<T>(mut self, v: std::option::Option<T>) -> Self
11928    where
11929        T: std::convert::Into<bool>,
11930    {
11931        self.enable_hot_tier_auto_resize = v.map(|x| x.into());
11932        self
11933    }
11934
11935    /// Sets the value of [qos_type][crate::model::StoragePool::qos_type].
11936    ///
11937    /// # Example
11938    /// ```ignore,no_run
11939    /// # use google_cloud_netapp_v1::model::StoragePool;
11940    /// use google_cloud_netapp_v1::model::QosType;
11941    /// let x0 = StoragePool::new().set_qos_type(QosType::Auto);
11942    /// let x1 = StoragePool::new().set_qos_type(QosType::Manual);
11943    /// ```
11944    pub fn set_qos_type<T: std::convert::Into<crate::model::QosType>>(mut self, v: T) -> Self {
11945        self.qos_type = v.into();
11946        self
11947    }
11948
11949    /// Sets the value of [available_throughput_mibps][crate::model::StoragePool::available_throughput_mibps].
11950    ///
11951    /// # Example
11952    /// ```ignore,no_run
11953    /// # use google_cloud_netapp_v1::model::StoragePool;
11954    /// let x = StoragePool::new().set_available_throughput_mibps(42.0);
11955    /// ```
11956    pub fn set_available_throughput_mibps<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
11957        self.available_throughput_mibps = v.into();
11958        self
11959    }
11960
11961    /// Sets the value of [cold_tier_size_used_gib][crate::model::StoragePool::cold_tier_size_used_gib].
11962    ///
11963    /// # Example
11964    /// ```ignore,no_run
11965    /// # use google_cloud_netapp_v1::model::StoragePool;
11966    /// let x = StoragePool::new().set_cold_tier_size_used_gib(42);
11967    /// ```
11968    pub fn set_cold_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11969        self.cold_tier_size_used_gib = v.into();
11970        self
11971    }
11972
11973    /// Sets the value of [hot_tier_size_used_gib][crate::model::StoragePool::hot_tier_size_used_gib].
11974    ///
11975    /// # Example
11976    /// ```ignore,no_run
11977    /// # use google_cloud_netapp_v1::model::StoragePool;
11978    /// let x = StoragePool::new().set_hot_tier_size_used_gib(42);
11979    /// ```
11980    pub fn set_hot_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11981        self.hot_tier_size_used_gib = v.into();
11982        self
11983    }
11984
11985    /// Sets the value of [r#type][crate::model::StoragePool::type].
11986    ///
11987    /// # Example
11988    /// ```ignore,no_run
11989    /// # use google_cloud_netapp_v1::model::StoragePool;
11990    /// use google_cloud_netapp_v1::model::StoragePoolType;
11991    /// let x0 = StoragePool::new().set_type(StoragePoolType::File);
11992    /// let x1 = StoragePool::new().set_type(StoragePoolType::Unified);
11993    /// let x2 = StoragePool::new().set_type(StoragePoolType::UnifiedLargeCapacity);
11994    /// ```
11995    pub fn set_type<T>(mut self, v: T) -> Self
11996    where
11997        T: std::convert::Into<crate::model::StoragePoolType>,
11998    {
11999        self.r#type = std::option::Option::Some(v.into());
12000        self
12001    }
12002
12003    /// Sets or clears the value of [r#type][crate::model::StoragePool::type].
12004    ///
12005    /// # Example
12006    /// ```ignore,no_run
12007    /// # use google_cloud_netapp_v1::model::StoragePool;
12008    /// use google_cloud_netapp_v1::model::StoragePoolType;
12009    /// let x0 = StoragePool::new().set_or_clear_type(Some(StoragePoolType::File));
12010    /// let x1 = StoragePool::new().set_or_clear_type(Some(StoragePoolType::Unified));
12011    /// let x2 = StoragePool::new().set_or_clear_type(Some(StoragePoolType::UnifiedLargeCapacity));
12012    /// let x_none = StoragePool::new().set_or_clear_type(None::<StoragePoolType>);
12013    /// ```
12014    pub fn set_or_clear_type<T>(mut self, v: std::option::Option<T>) -> Self
12015    where
12016        T: std::convert::Into<crate::model::StoragePoolType>,
12017    {
12018        self.r#type = v.map(|x| x.into());
12019        self
12020    }
12021}
12022
12023impl wkt::message::Message for StoragePool {
12024    fn typename() -> &'static str {
12025        "type.googleapis.com/google.cloud.netapp.v1.StoragePool"
12026    }
12027}
12028
12029/// Defines additional types related to [StoragePool].
12030pub mod storage_pool {
12031    #[allow(unused_imports)]
12032    use super::*;
12033
12034    /// The Storage Pool States
12035    ///
12036    /// # Working with unknown values
12037    ///
12038    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12039    /// additional enum variants at any time. Adding new variants is not considered
12040    /// a breaking change. Applications should write their code in anticipation of:
12041    ///
12042    /// - New values appearing in future releases of the client library, **and**
12043    /// - New values received dynamically, without application changes.
12044    ///
12045    /// Please consult the [Working with enums] section in the user guide for some
12046    /// guidelines.
12047    ///
12048    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12049    #[derive(Clone, Debug, PartialEq)]
12050    #[non_exhaustive]
12051    pub enum State {
12052        /// Unspecified Storage Pool State
12053        Unspecified,
12054        /// Storage Pool State is Ready
12055        Ready,
12056        /// Storage Pool State is Creating
12057        Creating,
12058        /// Storage Pool State is Deleting
12059        Deleting,
12060        /// Storage Pool State is Updating
12061        Updating,
12062        /// Storage Pool State is Restoring
12063        Restoring,
12064        /// Storage Pool State is Disabled
12065        Disabled,
12066        /// Storage Pool State is Error
12067        Error,
12068        /// If set, the enum was initialized with an unknown value.
12069        ///
12070        /// Applications can examine the value using [State::value] or
12071        /// [State::name].
12072        UnknownValue(state::UnknownValue),
12073    }
12074
12075    #[doc(hidden)]
12076    pub mod state {
12077        #[allow(unused_imports)]
12078        use super::*;
12079        #[derive(Clone, Debug, PartialEq)]
12080        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12081    }
12082
12083    impl State {
12084        /// Gets the enum value.
12085        ///
12086        /// Returns `None` if the enum contains an unknown value deserialized from
12087        /// the string representation of enums.
12088        pub fn value(&self) -> std::option::Option<i32> {
12089            match self {
12090                Self::Unspecified => std::option::Option::Some(0),
12091                Self::Ready => std::option::Option::Some(1),
12092                Self::Creating => std::option::Option::Some(2),
12093                Self::Deleting => std::option::Option::Some(3),
12094                Self::Updating => std::option::Option::Some(4),
12095                Self::Restoring => std::option::Option::Some(5),
12096                Self::Disabled => std::option::Option::Some(6),
12097                Self::Error => std::option::Option::Some(7),
12098                Self::UnknownValue(u) => u.0.value(),
12099            }
12100        }
12101
12102        /// Gets the enum value as a string.
12103        ///
12104        /// Returns `None` if the enum contains an unknown value deserialized from
12105        /// the integer representation of enums.
12106        pub fn name(&self) -> std::option::Option<&str> {
12107            match self {
12108                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12109                Self::Ready => std::option::Option::Some("READY"),
12110                Self::Creating => std::option::Option::Some("CREATING"),
12111                Self::Deleting => std::option::Option::Some("DELETING"),
12112                Self::Updating => std::option::Option::Some("UPDATING"),
12113                Self::Restoring => std::option::Option::Some("RESTORING"),
12114                Self::Disabled => std::option::Option::Some("DISABLED"),
12115                Self::Error => std::option::Option::Some("ERROR"),
12116                Self::UnknownValue(u) => u.0.name(),
12117            }
12118        }
12119    }
12120
12121    impl std::default::Default for State {
12122        fn default() -> Self {
12123            use std::convert::From;
12124            Self::from(0)
12125        }
12126    }
12127
12128    impl std::fmt::Display for State {
12129        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12130            wkt::internal::display_enum(f, self.name(), self.value())
12131        }
12132    }
12133
12134    impl std::convert::From<i32> for State {
12135        fn from(value: i32) -> Self {
12136            match value {
12137                0 => Self::Unspecified,
12138                1 => Self::Ready,
12139                2 => Self::Creating,
12140                3 => Self::Deleting,
12141                4 => Self::Updating,
12142                5 => Self::Restoring,
12143                6 => Self::Disabled,
12144                7 => Self::Error,
12145                _ => Self::UnknownValue(state::UnknownValue(
12146                    wkt::internal::UnknownEnumValue::Integer(value),
12147                )),
12148            }
12149        }
12150    }
12151
12152    impl std::convert::From<&str> for State {
12153        fn from(value: &str) -> Self {
12154            use std::string::ToString;
12155            match value {
12156                "STATE_UNSPECIFIED" => Self::Unspecified,
12157                "READY" => Self::Ready,
12158                "CREATING" => Self::Creating,
12159                "DELETING" => Self::Deleting,
12160                "UPDATING" => Self::Updating,
12161                "RESTORING" => Self::Restoring,
12162                "DISABLED" => Self::Disabled,
12163                "ERROR" => Self::Error,
12164                _ => Self::UnknownValue(state::UnknownValue(
12165                    wkt::internal::UnknownEnumValue::String(value.to_string()),
12166                )),
12167            }
12168        }
12169    }
12170
12171    impl serde::ser::Serialize for State {
12172        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12173        where
12174            S: serde::Serializer,
12175        {
12176            match self {
12177                Self::Unspecified => serializer.serialize_i32(0),
12178                Self::Ready => serializer.serialize_i32(1),
12179                Self::Creating => serializer.serialize_i32(2),
12180                Self::Deleting => serializer.serialize_i32(3),
12181                Self::Updating => serializer.serialize_i32(4),
12182                Self::Restoring => serializer.serialize_i32(5),
12183                Self::Disabled => serializer.serialize_i32(6),
12184                Self::Error => serializer.serialize_i32(7),
12185                Self::UnknownValue(u) => u.0.serialize(serializer),
12186            }
12187        }
12188    }
12189
12190    impl<'de> serde::de::Deserialize<'de> for State {
12191        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12192        where
12193            D: serde::Deserializer<'de>,
12194        {
12195            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12196                ".google.cloud.netapp.v1.StoragePool.State",
12197            ))
12198        }
12199    }
12200}
12201
12202/// ValidateDirectoryServiceRequest validates the directory service policy
12203/// attached to the storage pool.
12204#[derive(Clone, Default, PartialEq)]
12205#[non_exhaustive]
12206pub struct ValidateDirectoryServiceRequest {
12207    /// Required. Name of the storage pool
12208    pub name: std::string::String,
12209
12210    /// Type of directory service policy attached to the storage pool.
12211    pub directory_service_type: crate::model::DirectoryServiceType,
12212
12213    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12214}
12215
12216impl ValidateDirectoryServiceRequest {
12217    pub fn new() -> Self {
12218        std::default::Default::default()
12219    }
12220
12221    /// Sets the value of [name][crate::model::ValidateDirectoryServiceRequest::name].
12222    ///
12223    /// # Example
12224    /// ```ignore,no_run
12225    /// # use google_cloud_netapp_v1::model::ValidateDirectoryServiceRequest;
12226    /// let x = ValidateDirectoryServiceRequest::new().set_name("example");
12227    /// ```
12228    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12229        self.name = v.into();
12230        self
12231    }
12232
12233    /// Sets the value of [directory_service_type][crate::model::ValidateDirectoryServiceRequest::directory_service_type].
12234    ///
12235    /// # Example
12236    /// ```ignore,no_run
12237    /// # use google_cloud_netapp_v1::model::ValidateDirectoryServiceRequest;
12238    /// use google_cloud_netapp_v1::model::DirectoryServiceType;
12239    /// let x0 = ValidateDirectoryServiceRequest::new().set_directory_service_type(DirectoryServiceType::ActiveDirectory);
12240    /// ```
12241    pub fn set_directory_service_type<T: std::convert::Into<crate::model::DirectoryServiceType>>(
12242        mut self,
12243        v: T,
12244    ) -> Self {
12245        self.directory_service_type = v.into();
12246        self
12247    }
12248}
12249
12250impl wkt::message::Message for ValidateDirectoryServiceRequest {
12251    fn typename() -> &'static str {
12252        "type.googleapis.com/google.cloud.netapp.v1.ValidateDirectoryServiceRequest"
12253    }
12254}
12255
12256/// Message for requesting list of Volumes
12257#[derive(Clone, Default, PartialEq)]
12258#[non_exhaustive]
12259pub struct ListVolumesRequest {
12260    /// Required. Parent value for ListVolumesRequest
12261    pub parent: std::string::String,
12262
12263    /// Requested page size. Server may return fewer items than requested.
12264    /// If unspecified, the server will pick an appropriate default.
12265    pub page_size: i32,
12266
12267    /// A token identifying a page of results the server should return.
12268    pub page_token: std::string::String,
12269
12270    /// Filtering results
12271    pub filter: std::string::String,
12272
12273    /// Hint for how to order the results
12274    pub order_by: std::string::String,
12275
12276    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12277}
12278
12279impl ListVolumesRequest {
12280    pub fn new() -> Self {
12281        std::default::Default::default()
12282    }
12283
12284    /// Sets the value of [parent][crate::model::ListVolumesRequest::parent].
12285    ///
12286    /// # Example
12287    /// ```ignore,no_run
12288    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12289    /// let x = ListVolumesRequest::new().set_parent("example");
12290    /// ```
12291    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12292        self.parent = v.into();
12293        self
12294    }
12295
12296    /// Sets the value of [page_size][crate::model::ListVolumesRequest::page_size].
12297    ///
12298    /// # Example
12299    /// ```ignore,no_run
12300    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12301    /// let x = ListVolumesRequest::new().set_page_size(42);
12302    /// ```
12303    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
12304        self.page_size = v.into();
12305        self
12306    }
12307
12308    /// Sets the value of [page_token][crate::model::ListVolumesRequest::page_token].
12309    ///
12310    /// # Example
12311    /// ```ignore,no_run
12312    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12313    /// let x = ListVolumesRequest::new().set_page_token("example");
12314    /// ```
12315    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12316        self.page_token = v.into();
12317        self
12318    }
12319
12320    /// Sets the value of [filter][crate::model::ListVolumesRequest::filter].
12321    ///
12322    /// # Example
12323    /// ```ignore,no_run
12324    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12325    /// let x = ListVolumesRequest::new().set_filter("example");
12326    /// ```
12327    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12328        self.filter = v.into();
12329        self
12330    }
12331
12332    /// Sets the value of [order_by][crate::model::ListVolumesRequest::order_by].
12333    ///
12334    /// # Example
12335    /// ```ignore,no_run
12336    /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
12337    /// let x = ListVolumesRequest::new().set_order_by("example");
12338    /// ```
12339    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12340        self.order_by = v.into();
12341        self
12342    }
12343}
12344
12345impl wkt::message::Message for ListVolumesRequest {
12346    fn typename() -> &'static str {
12347        "type.googleapis.com/google.cloud.netapp.v1.ListVolumesRequest"
12348    }
12349}
12350
12351/// Message for response to listing Volumes
12352#[derive(Clone, Default, PartialEq)]
12353#[non_exhaustive]
12354pub struct ListVolumesResponse {
12355    /// The list of Volume
12356    pub volumes: std::vec::Vec<crate::model::Volume>,
12357
12358    /// A token identifying a page of results the server should return.
12359    pub next_page_token: std::string::String,
12360
12361    /// Locations that could not be reached.
12362    pub unreachable: std::vec::Vec<std::string::String>,
12363
12364    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12365}
12366
12367impl ListVolumesResponse {
12368    pub fn new() -> Self {
12369        std::default::Default::default()
12370    }
12371
12372    /// Sets the value of [volumes][crate::model::ListVolumesResponse::volumes].
12373    ///
12374    /// # Example
12375    /// ```ignore,no_run
12376    /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
12377    /// use google_cloud_netapp_v1::model::Volume;
12378    /// let x = ListVolumesResponse::new()
12379    ///     .set_volumes([
12380    ///         Volume::default()/* use setters */,
12381    ///         Volume::default()/* use (different) setters */,
12382    ///     ]);
12383    /// ```
12384    pub fn set_volumes<T, V>(mut self, v: T) -> Self
12385    where
12386        T: std::iter::IntoIterator<Item = V>,
12387        V: std::convert::Into<crate::model::Volume>,
12388    {
12389        use std::iter::Iterator;
12390        self.volumes = v.into_iter().map(|i| i.into()).collect();
12391        self
12392    }
12393
12394    /// Sets the value of [next_page_token][crate::model::ListVolumesResponse::next_page_token].
12395    ///
12396    /// # Example
12397    /// ```ignore,no_run
12398    /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
12399    /// let x = ListVolumesResponse::new().set_next_page_token("example");
12400    /// ```
12401    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12402        self.next_page_token = v.into();
12403        self
12404    }
12405
12406    /// Sets the value of [unreachable][crate::model::ListVolumesResponse::unreachable].
12407    ///
12408    /// # Example
12409    /// ```ignore,no_run
12410    /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
12411    /// let x = ListVolumesResponse::new().set_unreachable(["a", "b", "c"]);
12412    /// ```
12413    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
12414    where
12415        T: std::iter::IntoIterator<Item = V>,
12416        V: std::convert::Into<std::string::String>,
12417    {
12418        use std::iter::Iterator;
12419        self.unreachable = v.into_iter().map(|i| i.into()).collect();
12420        self
12421    }
12422}
12423
12424impl wkt::message::Message for ListVolumesResponse {
12425    fn typename() -> &'static str {
12426        "type.googleapis.com/google.cloud.netapp.v1.ListVolumesResponse"
12427    }
12428}
12429
12430#[doc(hidden)]
12431impl google_cloud_gax::paginator::internal::PageableResponse for ListVolumesResponse {
12432    type PageItem = crate::model::Volume;
12433
12434    fn items(self) -> std::vec::Vec<Self::PageItem> {
12435        self.volumes
12436    }
12437
12438    fn next_page_token(&self) -> std::string::String {
12439        use std::clone::Clone;
12440        self.next_page_token.clone()
12441    }
12442}
12443
12444/// Message for getting a Volume
12445#[derive(Clone, Default, PartialEq)]
12446#[non_exhaustive]
12447pub struct GetVolumeRequest {
12448    /// Required. Name of the volume
12449    pub name: std::string::String,
12450
12451    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12452}
12453
12454impl GetVolumeRequest {
12455    pub fn new() -> Self {
12456        std::default::Default::default()
12457    }
12458
12459    /// Sets the value of [name][crate::model::GetVolumeRequest::name].
12460    ///
12461    /// # Example
12462    /// ```ignore,no_run
12463    /// # use google_cloud_netapp_v1::model::GetVolumeRequest;
12464    /// let x = GetVolumeRequest::new().set_name("example");
12465    /// ```
12466    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12467        self.name = v.into();
12468        self
12469    }
12470}
12471
12472impl wkt::message::Message for GetVolumeRequest {
12473    fn typename() -> &'static str {
12474        "type.googleapis.com/google.cloud.netapp.v1.GetVolumeRequest"
12475    }
12476}
12477
12478/// Message for creating a Volume
12479#[derive(Clone, Default, PartialEq)]
12480#[non_exhaustive]
12481pub struct CreateVolumeRequest {
12482    /// Required. Value for parent.
12483    pub parent: std::string::String,
12484
12485    /// Required. Id of the requesting volume. Must be unique within the parent
12486    /// resource. Must contain only letters, numbers and hyphen, with the first
12487    /// character a letter, the last a letter or a number,
12488    /// and a 63 character maximum.
12489    pub volume_id: std::string::String,
12490
12491    /// Required. The volume being created.
12492    pub volume: std::option::Option<crate::model::Volume>,
12493
12494    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12495}
12496
12497impl CreateVolumeRequest {
12498    pub fn new() -> Self {
12499        std::default::Default::default()
12500    }
12501
12502    /// Sets the value of [parent][crate::model::CreateVolumeRequest::parent].
12503    ///
12504    /// # Example
12505    /// ```ignore,no_run
12506    /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
12507    /// let x = CreateVolumeRequest::new().set_parent("example");
12508    /// ```
12509    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12510        self.parent = v.into();
12511        self
12512    }
12513
12514    /// Sets the value of [volume_id][crate::model::CreateVolumeRequest::volume_id].
12515    ///
12516    /// # Example
12517    /// ```ignore,no_run
12518    /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
12519    /// let x = CreateVolumeRequest::new().set_volume_id("example");
12520    /// ```
12521    pub fn set_volume_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12522        self.volume_id = v.into();
12523        self
12524    }
12525
12526    /// Sets the value of [volume][crate::model::CreateVolumeRequest::volume].
12527    ///
12528    /// # Example
12529    /// ```ignore,no_run
12530    /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
12531    /// use google_cloud_netapp_v1::model::Volume;
12532    /// let x = CreateVolumeRequest::new().set_volume(Volume::default()/* use setters */);
12533    /// ```
12534    pub fn set_volume<T>(mut self, v: T) -> Self
12535    where
12536        T: std::convert::Into<crate::model::Volume>,
12537    {
12538        self.volume = std::option::Option::Some(v.into());
12539        self
12540    }
12541
12542    /// Sets or clears the value of [volume][crate::model::CreateVolumeRequest::volume].
12543    ///
12544    /// # Example
12545    /// ```ignore,no_run
12546    /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
12547    /// use google_cloud_netapp_v1::model::Volume;
12548    /// let x = CreateVolumeRequest::new().set_or_clear_volume(Some(Volume::default()/* use setters */));
12549    /// let x = CreateVolumeRequest::new().set_or_clear_volume(None::<Volume>);
12550    /// ```
12551    pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
12552    where
12553        T: std::convert::Into<crate::model::Volume>,
12554    {
12555        self.volume = v.map(|x| x.into());
12556        self
12557    }
12558}
12559
12560impl wkt::message::Message for CreateVolumeRequest {
12561    fn typename() -> &'static str {
12562        "type.googleapis.com/google.cloud.netapp.v1.CreateVolumeRequest"
12563    }
12564}
12565
12566/// Message for updating a Volume
12567#[derive(Clone, Default, PartialEq)]
12568#[non_exhaustive]
12569pub struct UpdateVolumeRequest {
12570    /// Required. Field mask is used to specify the fields to be overwritten in the
12571    /// Volume resource by the update.
12572    /// The fields specified in the update_mask are relative to the resource, not
12573    /// the full request. A field will be overwritten if it is in the mask. If the
12574    /// user does not provide a mask then all fields will be overwritten.
12575    pub update_mask: std::option::Option<wkt::FieldMask>,
12576
12577    /// Required. The volume being updated
12578    pub volume: std::option::Option<crate::model::Volume>,
12579
12580    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12581}
12582
12583impl UpdateVolumeRequest {
12584    pub fn new() -> Self {
12585        std::default::Default::default()
12586    }
12587
12588    /// Sets the value of [update_mask][crate::model::UpdateVolumeRequest::update_mask].
12589    ///
12590    /// # Example
12591    /// ```ignore,no_run
12592    /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
12593    /// use wkt::FieldMask;
12594    /// let x = UpdateVolumeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
12595    /// ```
12596    pub fn set_update_mask<T>(mut self, v: T) -> Self
12597    where
12598        T: std::convert::Into<wkt::FieldMask>,
12599    {
12600        self.update_mask = std::option::Option::Some(v.into());
12601        self
12602    }
12603
12604    /// Sets or clears the value of [update_mask][crate::model::UpdateVolumeRequest::update_mask].
12605    ///
12606    /// # Example
12607    /// ```ignore,no_run
12608    /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
12609    /// use wkt::FieldMask;
12610    /// let x = UpdateVolumeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
12611    /// let x = UpdateVolumeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
12612    /// ```
12613    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12614    where
12615        T: std::convert::Into<wkt::FieldMask>,
12616    {
12617        self.update_mask = v.map(|x| x.into());
12618        self
12619    }
12620
12621    /// Sets the value of [volume][crate::model::UpdateVolumeRequest::volume].
12622    ///
12623    /// # Example
12624    /// ```ignore,no_run
12625    /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
12626    /// use google_cloud_netapp_v1::model::Volume;
12627    /// let x = UpdateVolumeRequest::new().set_volume(Volume::default()/* use setters */);
12628    /// ```
12629    pub fn set_volume<T>(mut self, v: T) -> Self
12630    where
12631        T: std::convert::Into<crate::model::Volume>,
12632    {
12633        self.volume = std::option::Option::Some(v.into());
12634        self
12635    }
12636
12637    /// Sets or clears the value of [volume][crate::model::UpdateVolumeRequest::volume].
12638    ///
12639    /// # Example
12640    /// ```ignore,no_run
12641    /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
12642    /// use google_cloud_netapp_v1::model::Volume;
12643    /// let x = UpdateVolumeRequest::new().set_or_clear_volume(Some(Volume::default()/* use setters */));
12644    /// let x = UpdateVolumeRequest::new().set_or_clear_volume(None::<Volume>);
12645    /// ```
12646    pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
12647    where
12648        T: std::convert::Into<crate::model::Volume>,
12649    {
12650        self.volume = v.map(|x| x.into());
12651        self
12652    }
12653}
12654
12655impl wkt::message::Message for UpdateVolumeRequest {
12656    fn typename() -> &'static str {
12657        "type.googleapis.com/google.cloud.netapp.v1.UpdateVolumeRequest"
12658    }
12659}
12660
12661/// Message for deleting a Volume
12662#[derive(Clone, Default, PartialEq)]
12663#[non_exhaustive]
12664pub struct DeleteVolumeRequest {
12665    /// Required. Name of the volume
12666    pub name: std::string::String,
12667
12668    /// If this field is set as true, CCFE will not block the volume resource
12669    /// deletion even if it has any snapshots resource. (Otherwise, the request
12670    /// will only work if the volume has no snapshots.)
12671    pub force: bool,
12672
12673    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12674}
12675
12676impl DeleteVolumeRequest {
12677    pub fn new() -> Self {
12678        std::default::Default::default()
12679    }
12680
12681    /// Sets the value of [name][crate::model::DeleteVolumeRequest::name].
12682    ///
12683    /// # Example
12684    /// ```ignore,no_run
12685    /// # use google_cloud_netapp_v1::model::DeleteVolumeRequest;
12686    /// let x = DeleteVolumeRequest::new().set_name("example");
12687    /// ```
12688    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12689        self.name = v.into();
12690        self
12691    }
12692
12693    /// Sets the value of [force][crate::model::DeleteVolumeRequest::force].
12694    ///
12695    /// # Example
12696    /// ```ignore,no_run
12697    /// # use google_cloud_netapp_v1::model::DeleteVolumeRequest;
12698    /// let x = DeleteVolumeRequest::new().set_force(true);
12699    /// ```
12700    pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12701        self.force = v.into();
12702        self
12703    }
12704}
12705
12706impl wkt::message::Message for DeleteVolumeRequest {
12707    fn typename() -> &'static str {
12708        "type.googleapis.com/google.cloud.netapp.v1.DeleteVolumeRequest"
12709    }
12710}
12711
12712/// RevertVolumeRequest reverts the given volume to the specified snapshot.
12713#[derive(Clone, Default, PartialEq)]
12714#[non_exhaustive]
12715pub struct RevertVolumeRequest {
12716    /// Required. The resource name of the volume, in the format of
12717    /// projects/{project_id}/locations/{location}/volumes/{volume_id}.
12718    pub name: std::string::String,
12719
12720    /// Required. The snapshot resource ID, in the format 'my-snapshot', where the
12721    /// specified ID is the {snapshot_id} of the fully qualified name like
12722    /// projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}
12723    pub snapshot_id: std::string::String,
12724
12725    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12726}
12727
12728impl RevertVolumeRequest {
12729    pub fn new() -> Self {
12730        std::default::Default::default()
12731    }
12732
12733    /// Sets the value of [name][crate::model::RevertVolumeRequest::name].
12734    ///
12735    /// # Example
12736    /// ```ignore,no_run
12737    /// # use google_cloud_netapp_v1::model::RevertVolumeRequest;
12738    /// let x = RevertVolumeRequest::new().set_name("example");
12739    /// ```
12740    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12741        self.name = v.into();
12742        self
12743    }
12744
12745    /// Sets the value of [snapshot_id][crate::model::RevertVolumeRequest::snapshot_id].
12746    ///
12747    /// # Example
12748    /// ```ignore,no_run
12749    /// # use google_cloud_netapp_v1::model::RevertVolumeRequest;
12750    /// let x = RevertVolumeRequest::new().set_snapshot_id("example");
12751    /// ```
12752    pub fn set_snapshot_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12753        self.snapshot_id = v.into();
12754        self
12755    }
12756}
12757
12758impl wkt::message::Message for RevertVolumeRequest {
12759    fn typename() -> &'static str {
12760        "type.googleapis.com/google.cloud.netapp.v1.RevertVolumeRequest"
12761    }
12762}
12763
12764/// Volume provides a filesystem that you can mount.
12765#[derive(Clone, Default, PartialEq)]
12766#[non_exhaustive]
12767pub struct Volume {
12768    /// Identifier. Name of the volume
12769    pub name: std::string::String,
12770
12771    /// Output only. State of the volume
12772    pub state: crate::model::volume::State,
12773
12774    /// Output only. State details of the volume
12775    pub state_details: std::string::String,
12776
12777    /// Output only. Create time of the volume
12778    pub create_time: std::option::Option<wkt::Timestamp>,
12779
12780    /// Required. Share name of the volume
12781    pub share_name: std::string::String,
12782
12783    /// Output only. This field is not implemented. The values provided in this
12784    /// field are ignored.
12785    pub psa_range: std::string::String,
12786
12787    /// Required. StoragePool name of the volume
12788    pub storage_pool: std::string::String,
12789
12790    /// Output only. VPC Network name.
12791    /// Format: projects/{project}/global/networks/{network}
12792    pub network: std::string::String,
12793
12794    /// Output only. Service level of the volume
12795    pub service_level: crate::model::ServiceLevel,
12796
12797    /// Required. Capacity in GIB of the volume
12798    pub capacity_gib: i64,
12799
12800    /// Optional. Export policy of the volume
12801    pub export_policy: std::option::Option<crate::model::ExportPolicy>,
12802
12803    /// Required. Protocols required for the volume
12804    pub protocols: std::vec::Vec<crate::model::Protocols>,
12805
12806    /// Optional. SMB share settings for the volume.
12807    pub smb_settings: std::vec::Vec<crate::model::SMBSettings>,
12808
12809    /// Output only. Mount options of this volume
12810    pub mount_options: std::vec::Vec<crate::model::MountOption>,
12811
12812    /// Optional. Default unix style permission (e.g. 777) the mount point will be
12813    /// created with. Applicable for NFS protocol types only.
12814    pub unix_permissions: std::string::String,
12815
12816    /// Optional. Labels as key value pairs
12817    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
12818
12819    /// Optional. Description of the volume
12820    pub description: std::string::String,
12821
12822    /// Optional. SnapshotPolicy for a volume.
12823    pub snapshot_policy: std::option::Option<crate::model::SnapshotPolicy>,
12824
12825    /// Optional. Snap_reserve specifies percentage of volume storage reserved for
12826    /// snapshot storage. Default is 0 percent.
12827    pub snap_reserve: f64,
12828
12829    /// Optional. Snapshot_directory if enabled (true) the volume will contain a
12830    /// read-only .snapshot directory which provides access to each of the volume's
12831    /// snapshots.
12832    pub snapshot_directory: bool,
12833
12834    /// Output only. Used capacity in GIB of the volume. This is computed
12835    /// periodically and it does not represent the realtime usage.
12836    pub used_gib: i64,
12837
12838    /// Optional. Security Style of the Volume
12839    pub security_style: crate::model::SecurityStyle,
12840
12841    /// Optional. Flag indicating if the volume is a kerberos volume or not, export
12842    /// policy rules control kerberos security modes (krb5, krb5i, krb5p).
12843    pub kerberos_enabled: bool,
12844
12845    /// Output only. Flag indicating if the volume is NFS LDAP enabled or not.
12846    pub ldap_enabled: bool,
12847
12848    /// Output only. Specifies the ActiveDirectory name of a SMB volume.
12849    pub active_directory: std::string::String,
12850
12851    /// Optional. Specifies the source of the volume to be created from.
12852    pub restore_parameters: std::option::Option<crate::model::RestoreParameters>,
12853
12854    /// Output only. Specifies the KMS config to be used for volume encryption.
12855    pub kms_config: std::string::String,
12856
12857    /// Output only. Specified the current volume encryption key source.
12858    pub encryption_type: crate::model::EncryptionType,
12859
12860    /// Output only. Indicates whether the volume is part of a replication
12861    /// relationship.
12862    pub has_replication: bool,
12863
12864    /// BackupConfig of the volume.
12865    pub backup_config: std::option::Option<crate::model::BackupConfig>,
12866
12867    /// Optional. List of actions that are restricted on this volume.
12868    pub restricted_actions: std::vec::Vec<crate::model::RestrictedAction>,
12869
12870    /// Optional. Flag indicating if the volume will be a large capacity volume or
12871    /// a regular volume.
12872    pub large_capacity: bool,
12873
12874    /// Optional. Flag indicating if the volume will have an IP address per node
12875    /// for volumes supporting multiple IP endpoints. Only the volume with
12876    /// large_capacity will be allowed to have multiple endpoints.
12877    pub multiple_endpoints: bool,
12878
12879    /// Tiering policy for the volume.
12880    pub tiering_policy: std::option::Option<crate::model::TieringPolicy>,
12881
12882    /// Output only. Specifies the replica zone for regional volume.
12883    pub replica_zone: std::string::String,
12884
12885    /// Output only. Specifies the active zone for regional volume.
12886    pub zone: std::string::String,
12887
12888    /// Output only. Size of the volume cold tier data rounded down to the nearest
12889    /// GiB.
12890    pub cold_tier_size_gib: i64,
12891
12892    /// Optional. The Hybrid Replication parameters for the volume.
12893    pub hybrid_replication_parameters:
12894        std::option::Option<crate::model::HybridReplicationParameters>,
12895
12896    /// Optional. Throughput of the volume (in MiB/s)
12897    pub throughput_mibps: f64,
12898
12899    /// Optional. Cache parameters for the volume.
12900    pub cache_parameters: std::option::Option<crate::model::CacheParameters>,
12901
12902    /// Output only. Total hot tier data rounded down to the nearest GiB used by
12903    /// the Volume. This field is only used for flex Service Level
12904    pub hot_tier_size_used_gib: i64,
12905
12906    /// Optional. Block devices for the volume.
12907    /// Currently, only one block device is permitted per Volume.
12908    pub block_devices: std::vec::Vec<crate::model::BlockDevice>,
12909
12910    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12911}
12912
12913impl Volume {
12914    pub fn new() -> Self {
12915        std::default::Default::default()
12916    }
12917
12918    /// Sets the value of [name][crate::model::Volume::name].
12919    ///
12920    /// # Example
12921    /// ```ignore,no_run
12922    /// # use google_cloud_netapp_v1::model::Volume;
12923    /// let x = Volume::new().set_name("example");
12924    /// ```
12925    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12926        self.name = v.into();
12927        self
12928    }
12929
12930    /// Sets the value of [state][crate::model::Volume::state].
12931    ///
12932    /// # Example
12933    /// ```ignore,no_run
12934    /// # use google_cloud_netapp_v1::model::Volume;
12935    /// use google_cloud_netapp_v1::model::volume::State;
12936    /// let x0 = Volume::new().set_state(State::Ready);
12937    /// let x1 = Volume::new().set_state(State::Creating);
12938    /// let x2 = Volume::new().set_state(State::Deleting);
12939    /// ```
12940    pub fn set_state<T: std::convert::Into<crate::model::volume::State>>(mut self, v: T) -> Self {
12941        self.state = v.into();
12942        self
12943    }
12944
12945    /// Sets the value of [state_details][crate::model::Volume::state_details].
12946    ///
12947    /// # Example
12948    /// ```ignore,no_run
12949    /// # use google_cloud_netapp_v1::model::Volume;
12950    /// let x = Volume::new().set_state_details("example");
12951    /// ```
12952    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12953        self.state_details = v.into();
12954        self
12955    }
12956
12957    /// Sets the value of [create_time][crate::model::Volume::create_time].
12958    ///
12959    /// # Example
12960    /// ```ignore,no_run
12961    /// # use google_cloud_netapp_v1::model::Volume;
12962    /// use wkt::Timestamp;
12963    /// let x = Volume::new().set_create_time(Timestamp::default()/* use setters */);
12964    /// ```
12965    pub fn set_create_time<T>(mut self, v: T) -> Self
12966    where
12967        T: std::convert::Into<wkt::Timestamp>,
12968    {
12969        self.create_time = std::option::Option::Some(v.into());
12970        self
12971    }
12972
12973    /// Sets or clears the value of [create_time][crate::model::Volume::create_time].
12974    ///
12975    /// # Example
12976    /// ```ignore,no_run
12977    /// # use google_cloud_netapp_v1::model::Volume;
12978    /// use wkt::Timestamp;
12979    /// let x = Volume::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
12980    /// let x = Volume::new().set_or_clear_create_time(None::<Timestamp>);
12981    /// ```
12982    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
12983    where
12984        T: std::convert::Into<wkt::Timestamp>,
12985    {
12986        self.create_time = v.map(|x| x.into());
12987        self
12988    }
12989
12990    /// Sets the value of [share_name][crate::model::Volume::share_name].
12991    ///
12992    /// # Example
12993    /// ```ignore,no_run
12994    /// # use google_cloud_netapp_v1::model::Volume;
12995    /// let x = Volume::new().set_share_name("example");
12996    /// ```
12997    pub fn set_share_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12998        self.share_name = v.into();
12999        self
13000    }
13001
13002    /// Sets the value of [psa_range][crate::model::Volume::psa_range].
13003    ///
13004    /// # Example
13005    /// ```ignore,no_run
13006    /// # use google_cloud_netapp_v1::model::Volume;
13007    /// let x = Volume::new().set_psa_range("example");
13008    /// ```
13009    pub fn set_psa_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13010        self.psa_range = v.into();
13011        self
13012    }
13013
13014    /// Sets the value of [storage_pool][crate::model::Volume::storage_pool].
13015    ///
13016    /// # Example
13017    /// ```ignore,no_run
13018    /// # use google_cloud_netapp_v1::model::Volume;
13019    /// let x = Volume::new().set_storage_pool("example");
13020    /// ```
13021    pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13022        self.storage_pool = v.into();
13023        self
13024    }
13025
13026    /// Sets the value of [network][crate::model::Volume::network].
13027    ///
13028    /// # Example
13029    /// ```ignore,no_run
13030    /// # use google_cloud_netapp_v1::model::Volume;
13031    /// let x = Volume::new().set_network("example");
13032    /// ```
13033    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13034        self.network = v.into();
13035        self
13036    }
13037
13038    /// Sets the value of [service_level][crate::model::Volume::service_level].
13039    ///
13040    /// # Example
13041    /// ```ignore,no_run
13042    /// # use google_cloud_netapp_v1::model::Volume;
13043    /// use google_cloud_netapp_v1::model::ServiceLevel;
13044    /// let x0 = Volume::new().set_service_level(ServiceLevel::Premium);
13045    /// let x1 = Volume::new().set_service_level(ServiceLevel::Extreme);
13046    /// let x2 = Volume::new().set_service_level(ServiceLevel::Standard);
13047    /// ```
13048    pub fn set_service_level<T: std::convert::Into<crate::model::ServiceLevel>>(
13049        mut self,
13050        v: T,
13051    ) -> Self {
13052        self.service_level = v.into();
13053        self
13054    }
13055
13056    /// Sets the value of [capacity_gib][crate::model::Volume::capacity_gib].
13057    ///
13058    /// # Example
13059    /// ```ignore,no_run
13060    /// # use google_cloud_netapp_v1::model::Volume;
13061    /// let x = Volume::new().set_capacity_gib(42);
13062    /// ```
13063    pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13064        self.capacity_gib = v.into();
13065        self
13066    }
13067
13068    /// Sets the value of [export_policy][crate::model::Volume::export_policy].
13069    ///
13070    /// # Example
13071    /// ```ignore,no_run
13072    /// # use google_cloud_netapp_v1::model::Volume;
13073    /// use google_cloud_netapp_v1::model::ExportPolicy;
13074    /// let x = Volume::new().set_export_policy(ExportPolicy::default()/* use setters */);
13075    /// ```
13076    pub fn set_export_policy<T>(mut self, v: T) -> Self
13077    where
13078        T: std::convert::Into<crate::model::ExportPolicy>,
13079    {
13080        self.export_policy = std::option::Option::Some(v.into());
13081        self
13082    }
13083
13084    /// Sets or clears the value of [export_policy][crate::model::Volume::export_policy].
13085    ///
13086    /// # Example
13087    /// ```ignore,no_run
13088    /// # use google_cloud_netapp_v1::model::Volume;
13089    /// use google_cloud_netapp_v1::model::ExportPolicy;
13090    /// let x = Volume::new().set_or_clear_export_policy(Some(ExportPolicy::default()/* use setters */));
13091    /// let x = Volume::new().set_or_clear_export_policy(None::<ExportPolicy>);
13092    /// ```
13093    pub fn set_or_clear_export_policy<T>(mut self, v: std::option::Option<T>) -> Self
13094    where
13095        T: std::convert::Into<crate::model::ExportPolicy>,
13096    {
13097        self.export_policy = v.map(|x| x.into());
13098        self
13099    }
13100
13101    /// Sets the value of [protocols][crate::model::Volume::protocols].
13102    ///
13103    /// # Example
13104    /// ```ignore,no_run
13105    /// # use google_cloud_netapp_v1::model::Volume;
13106    /// use google_cloud_netapp_v1::model::Protocols;
13107    /// let x = Volume::new().set_protocols([
13108    ///     Protocols::Nfsv3,
13109    ///     Protocols::Nfsv4,
13110    ///     Protocols::Smb,
13111    /// ]);
13112    /// ```
13113    pub fn set_protocols<T, V>(mut self, v: T) -> Self
13114    where
13115        T: std::iter::IntoIterator<Item = V>,
13116        V: std::convert::Into<crate::model::Protocols>,
13117    {
13118        use std::iter::Iterator;
13119        self.protocols = v.into_iter().map(|i| i.into()).collect();
13120        self
13121    }
13122
13123    /// Sets the value of [smb_settings][crate::model::Volume::smb_settings].
13124    ///
13125    /// # Example
13126    /// ```ignore,no_run
13127    /// # use google_cloud_netapp_v1::model::Volume;
13128    /// use google_cloud_netapp_v1::model::SMBSettings;
13129    /// let x = Volume::new().set_smb_settings([
13130    ///     SMBSettings::EncryptData,
13131    ///     SMBSettings::Browsable,
13132    ///     SMBSettings::ChangeNotify,
13133    /// ]);
13134    /// ```
13135    pub fn set_smb_settings<T, V>(mut self, v: T) -> Self
13136    where
13137        T: std::iter::IntoIterator<Item = V>,
13138        V: std::convert::Into<crate::model::SMBSettings>,
13139    {
13140        use std::iter::Iterator;
13141        self.smb_settings = v.into_iter().map(|i| i.into()).collect();
13142        self
13143    }
13144
13145    /// Sets the value of [mount_options][crate::model::Volume::mount_options].
13146    ///
13147    /// # Example
13148    /// ```ignore,no_run
13149    /// # use google_cloud_netapp_v1::model::Volume;
13150    /// use google_cloud_netapp_v1::model::MountOption;
13151    /// let x = Volume::new()
13152    ///     .set_mount_options([
13153    ///         MountOption::default()/* use setters */,
13154    ///         MountOption::default()/* use (different) setters */,
13155    ///     ]);
13156    /// ```
13157    pub fn set_mount_options<T, V>(mut self, v: T) -> Self
13158    where
13159        T: std::iter::IntoIterator<Item = V>,
13160        V: std::convert::Into<crate::model::MountOption>,
13161    {
13162        use std::iter::Iterator;
13163        self.mount_options = v.into_iter().map(|i| i.into()).collect();
13164        self
13165    }
13166
13167    /// Sets the value of [unix_permissions][crate::model::Volume::unix_permissions].
13168    ///
13169    /// # Example
13170    /// ```ignore,no_run
13171    /// # use google_cloud_netapp_v1::model::Volume;
13172    /// let x = Volume::new().set_unix_permissions("example");
13173    /// ```
13174    pub fn set_unix_permissions<T: std::convert::Into<std::string::String>>(
13175        mut self,
13176        v: T,
13177    ) -> Self {
13178        self.unix_permissions = v.into();
13179        self
13180    }
13181
13182    /// Sets the value of [labels][crate::model::Volume::labels].
13183    ///
13184    /// # Example
13185    /// ```ignore,no_run
13186    /// # use google_cloud_netapp_v1::model::Volume;
13187    /// let x = Volume::new().set_labels([
13188    ///     ("key0", "abc"),
13189    ///     ("key1", "xyz"),
13190    /// ]);
13191    /// ```
13192    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
13193    where
13194        T: std::iter::IntoIterator<Item = (K, V)>,
13195        K: std::convert::Into<std::string::String>,
13196        V: std::convert::Into<std::string::String>,
13197    {
13198        use std::iter::Iterator;
13199        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
13200        self
13201    }
13202
13203    /// Sets the value of [description][crate::model::Volume::description].
13204    ///
13205    /// # Example
13206    /// ```ignore,no_run
13207    /// # use google_cloud_netapp_v1::model::Volume;
13208    /// let x = Volume::new().set_description("example");
13209    /// ```
13210    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13211        self.description = v.into();
13212        self
13213    }
13214
13215    /// Sets the value of [snapshot_policy][crate::model::Volume::snapshot_policy].
13216    ///
13217    /// # Example
13218    /// ```ignore,no_run
13219    /// # use google_cloud_netapp_v1::model::Volume;
13220    /// use google_cloud_netapp_v1::model::SnapshotPolicy;
13221    /// let x = Volume::new().set_snapshot_policy(SnapshotPolicy::default()/* use setters */);
13222    /// ```
13223    pub fn set_snapshot_policy<T>(mut self, v: T) -> Self
13224    where
13225        T: std::convert::Into<crate::model::SnapshotPolicy>,
13226    {
13227        self.snapshot_policy = std::option::Option::Some(v.into());
13228        self
13229    }
13230
13231    /// Sets or clears the value of [snapshot_policy][crate::model::Volume::snapshot_policy].
13232    ///
13233    /// # Example
13234    /// ```ignore,no_run
13235    /// # use google_cloud_netapp_v1::model::Volume;
13236    /// use google_cloud_netapp_v1::model::SnapshotPolicy;
13237    /// let x = Volume::new().set_or_clear_snapshot_policy(Some(SnapshotPolicy::default()/* use setters */));
13238    /// let x = Volume::new().set_or_clear_snapshot_policy(None::<SnapshotPolicy>);
13239    /// ```
13240    pub fn set_or_clear_snapshot_policy<T>(mut self, v: std::option::Option<T>) -> Self
13241    where
13242        T: std::convert::Into<crate::model::SnapshotPolicy>,
13243    {
13244        self.snapshot_policy = v.map(|x| x.into());
13245        self
13246    }
13247
13248    /// Sets the value of [snap_reserve][crate::model::Volume::snap_reserve].
13249    ///
13250    /// # Example
13251    /// ```ignore,no_run
13252    /// # use google_cloud_netapp_v1::model::Volume;
13253    /// let x = Volume::new().set_snap_reserve(42.0);
13254    /// ```
13255    pub fn set_snap_reserve<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
13256        self.snap_reserve = v.into();
13257        self
13258    }
13259
13260    /// Sets the value of [snapshot_directory][crate::model::Volume::snapshot_directory].
13261    ///
13262    /// # Example
13263    /// ```ignore,no_run
13264    /// # use google_cloud_netapp_v1::model::Volume;
13265    /// let x = Volume::new().set_snapshot_directory(true);
13266    /// ```
13267    pub fn set_snapshot_directory<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13268        self.snapshot_directory = v.into();
13269        self
13270    }
13271
13272    /// Sets the value of [used_gib][crate::model::Volume::used_gib].
13273    ///
13274    /// # Example
13275    /// ```ignore,no_run
13276    /// # use google_cloud_netapp_v1::model::Volume;
13277    /// let x = Volume::new().set_used_gib(42);
13278    /// ```
13279    pub fn set_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13280        self.used_gib = v.into();
13281        self
13282    }
13283
13284    /// Sets the value of [security_style][crate::model::Volume::security_style].
13285    ///
13286    /// # Example
13287    /// ```ignore,no_run
13288    /// # use google_cloud_netapp_v1::model::Volume;
13289    /// use google_cloud_netapp_v1::model::SecurityStyle;
13290    /// let x0 = Volume::new().set_security_style(SecurityStyle::Ntfs);
13291    /// let x1 = Volume::new().set_security_style(SecurityStyle::Unix);
13292    /// ```
13293    pub fn set_security_style<T: std::convert::Into<crate::model::SecurityStyle>>(
13294        mut self,
13295        v: T,
13296    ) -> Self {
13297        self.security_style = v.into();
13298        self
13299    }
13300
13301    /// Sets the value of [kerberos_enabled][crate::model::Volume::kerberos_enabled].
13302    ///
13303    /// # Example
13304    /// ```ignore,no_run
13305    /// # use google_cloud_netapp_v1::model::Volume;
13306    /// let x = Volume::new().set_kerberos_enabled(true);
13307    /// ```
13308    pub fn set_kerberos_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13309        self.kerberos_enabled = v.into();
13310        self
13311    }
13312
13313    /// Sets the value of [ldap_enabled][crate::model::Volume::ldap_enabled].
13314    ///
13315    /// # Example
13316    /// ```ignore,no_run
13317    /// # use google_cloud_netapp_v1::model::Volume;
13318    /// let x = Volume::new().set_ldap_enabled(true);
13319    /// ```
13320    pub fn set_ldap_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13321        self.ldap_enabled = v.into();
13322        self
13323    }
13324
13325    /// Sets the value of [active_directory][crate::model::Volume::active_directory].
13326    ///
13327    /// # Example
13328    /// ```ignore,no_run
13329    /// # use google_cloud_netapp_v1::model::Volume;
13330    /// let x = Volume::new().set_active_directory("example");
13331    /// ```
13332    pub fn set_active_directory<T: std::convert::Into<std::string::String>>(
13333        mut self,
13334        v: T,
13335    ) -> Self {
13336        self.active_directory = v.into();
13337        self
13338    }
13339
13340    /// Sets the value of [restore_parameters][crate::model::Volume::restore_parameters].
13341    ///
13342    /// # Example
13343    /// ```ignore,no_run
13344    /// # use google_cloud_netapp_v1::model::Volume;
13345    /// use google_cloud_netapp_v1::model::RestoreParameters;
13346    /// let x = Volume::new().set_restore_parameters(RestoreParameters::default()/* use setters */);
13347    /// ```
13348    pub fn set_restore_parameters<T>(mut self, v: T) -> Self
13349    where
13350        T: std::convert::Into<crate::model::RestoreParameters>,
13351    {
13352        self.restore_parameters = std::option::Option::Some(v.into());
13353        self
13354    }
13355
13356    /// Sets or clears the value of [restore_parameters][crate::model::Volume::restore_parameters].
13357    ///
13358    /// # Example
13359    /// ```ignore,no_run
13360    /// # use google_cloud_netapp_v1::model::Volume;
13361    /// use google_cloud_netapp_v1::model::RestoreParameters;
13362    /// let x = Volume::new().set_or_clear_restore_parameters(Some(RestoreParameters::default()/* use setters */));
13363    /// let x = Volume::new().set_or_clear_restore_parameters(None::<RestoreParameters>);
13364    /// ```
13365    pub fn set_or_clear_restore_parameters<T>(mut self, v: std::option::Option<T>) -> Self
13366    where
13367        T: std::convert::Into<crate::model::RestoreParameters>,
13368    {
13369        self.restore_parameters = v.map(|x| x.into());
13370        self
13371    }
13372
13373    /// Sets the value of [kms_config][crate::model::Volume::kms_config].
13374    ///
13375    /// # Example
13376    /// ```ignore,no_run
13377    /// # use google_cloud_netapp_v1::model::Volume;
13378    /// let x = Volume::new().set_kms_config("example");
13379    /// ```
13380    pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13381        self.kms_config = v.into();
13382        self
13383    }
13384
13385    /// Sets the value of [encryption_type][crate::model::Volume::encryption_type].
13386    ///
13387    /// # Example
13388    /// ```ignore,no_run
13389    /// # use google_cloud_netapp_v1::model::Volume;
13390    /// use google_cloud_netapp_v1::model::EncryptionType;
13391    /// let x0 = Volume::new().set_encryption_type(EncryptionType::ServiceManaged);
13392    /// let x1 = Volume::new().set_encryption_type(EncryptionType::CloudKms);
13393    /// ```
13394    pub fn set_encryption_type<T: std::convert::Into<crate::model::EncryptionType>>(
13395        mut self,
13396        v: T,
13397    ) -> Self {
13398        self.encryption_type = v.into();
13399        self
13400    }
13401
13402    /// Sets the value of [has_replication][crate::model::Volume::has_replication].
13403    ///
13404    /// # Example
13405    /// ```ignore,no_run
13406    /// # use google_cloud_netapp_v1::model::Volume;
13407    /// let x = Volume::new().set_has_replication(true);
13408    /// ```
13409    pub fn set_has_replication<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13410        self.has_replication = v.into();
13411        self
13412    }
13413
13414    /// Sets the value of [backup_config][crate::model::Volume::backup_config].
13415    ///
13416    /// # Example
13417    /// ```ignore,no_run
13418    /// # use google_cloud_netapp_v1::model::Volume;
13419    /// use google_cloud_netapp_v1::model::BackupConfig;
13420    /// let x = Volume::new().set_backup_config(BackupConfig::default()/* use setters */);
13421    /// ```
13422    pub fn set_backup_config<T>(mut self, v: T) -> Self
13423    where
13424        T: std::convert::Into<crate::model::BackupConfig>,
13425    {
13426        self.backup_config = std::option::Option::Some(v.into());
13427        self
13428    }
13429
13430    /// Sets or clears the value of [backup_config][crate::model::Volume::backup_config].
13431    ///
13432    /// # Example
13433    /// ```ignore,no_run
13434    /// # use google_cloud_netapp_v1::model::Volume;
13435    /// use google_cloud_netapp_v1::model::BackupConfig;
13436    /// let x = Volume::new().set_or_clear_backup_config(Some(BackupConfig::default()/* use setters */));
13437    /// let x = Volume::new().set_or_clear_backup_config(None::<BackupConfig>);
13438    /// ```
13439    pub fn set_or_clear_backup_config<T>(mut self, v: std::option::Option<T>) -> Self
13440    where
13441        T: std::convert::Into<crate::model::BackupConfig>,
13442    {
13443        self.backup_config = v.map(|x| x.into());
13444        self
13445    }
13446
13447    /// Sets the value of [restricted_actions][crate::model::Volume::restricted_actions].
13448    ///
13449    /// # Example
13450    /// ```ignore,no_run
13451    /// # use google_cloud_netapp_v1::model::Volume;
13452    /// use google_cloud_netapp_v1::model::RestrictedAction;
13453    /// let x = Volume::new().set_restricted_actions([
13454    ///     RestrictedAction::Delete,
13455    /// ]);
13456    /// ```
13457    pub fn set_restricted_actions<T, V>(mut self, v: T) -> Self
13458    where
13459        T: std::iter::IntoIterator<Item = V>,
13460        V: std::convert::Into<crate::model::RestrictedAction>,
13461    {
13462        use std::iter::Iterator;
13463        self.restricted_actions = v.into_iter().map(|i| i.into()).collect();
13464        self
13465    }
13466
13467    /// Sets the value of [large_capacity][crate::model::Volume::large_capacity].
13468    ///
13469    /// # Example
13470    /// ```ignore,no_run
13471    /// # use google_cloud_netapp_v1::model::Volume;
13472    /// let x = Volume::new().set_large_capacity(true);
13473    /// ```
13474    pub fn set_large_capacity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13475        self.large_capacity = v.into();
13476        self
13477    }
13478
13479    /// Sets the value of [multiple_endpoints][crate::model::Volume::multiple_endpoints].
13480    ///
13481    /// # Example
13482    /// ```ignore,no_run
13483    /// # use google_cloud_netapp_v1::model::Volume;
13484    /// let x = Volume::new().set_multiple_endpoints(true);
13485    /// ```
13486    pub fn set_multiple_endpoints<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
13487        self.multiple_endpoints = v.into();
13488        self
13489    }
13490
13491    /// Sets the value of [tiering_policy][crate::model::Volume::tiering_policy].
13492    ///
13493    /// # Example
13494    /// ```ignore,no_run
13495    /// # use google_cloud_netapp_v1::model::Volume;
13496    /// use google_cloud_netapp_v1::model::TieringPolicy;
13497    /// let x = Volume::new().set_tiering_policy(TieringPolicy::default()/* use setters */);
13498    /// ```
13499    pub fn set_tiering_policy<T>(mut self, v: T) -> Self
13500    where
13501        T: std::convert::Into<crate::model::TieringPolicy>,
13502    {
13503        self.tiering_policy = std::option::Option::Some(v.into());
13504        self
13505    }
13506
13507    /// Sets or clears the value of [tiering_policy][crate::model::Volume::tiering_policy].
13508    ///
13509    /// # Example
13510    /// ```ignore,no_run
13511    /// # use google_cloud_netapp_v1::model::Volume;
13512    /// use google_cloud_netapp_v1::model::TieringPolicy;
13513    /// let x = Volume::new().set_or_clear_tiering_policy(Some(TieringPolicy::default()/* use setters */));
13514    /// let x = Volume::new().set_or_clear_tiering_policy(None::<TieringPolicy>);
13515    /// ```
13516    pub fn set_or_clear_tiering_policy<T>(mut self, v: std::option::Option<T>) -> Self
13517    where
13518        T: std::convert::Into<crate::model::TieringPolicy>,
13519    {
13520        self.tiering_policy = v.map(|x| x.into());
13521        self
13522    }
13523
13524    /// Sets the value of [replica_zone][crate::model::Volume::replica_zone].
13525    ///
13526    /// # Example
13527    /// ```ignore,no_run
13528    /// # use google_cloud_netapp_v1::model::Volume;
13529    /// let x = Volume::new().set_replica_zone("example");
13530    /// ```
13531    pub fn set_replica_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13532        self.replica_zone = v.into();
13533        self
13534    }
13535
13536    /// Sets the value of [zone][crate::model::Volume::zone].
13537    ///
13538    /// # Example
13539    /// ```ignore,no_run
13540    /// # use google_cloud_netapp_v1::model::Volume;
13541    /// let x = Volume::new().set_zone("example");
13542    /// ```
13543    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
13544        self.zone = v.into();
13545        self
13546    }
13547
13548    /// Sets the value of [cold_tier_size_gib][crate::model::Volume::cold_tier_size_gib].
13549    ///
13550    /// # Example
13551    /// ```ignore,no_run
13552    /// # use google_cloud_netapp_v1::model::Volume;
13553    /// let x = Volume::new().set_cold_tier_size_gib(42);
13554    /// ```
13555    pub fn set_cold_tier_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13556        self.cold_tier_size_gib = v.into();
13557        self
13558    }
13559
13560    /// Sets the value of [hybrid_replication_parameters][crate::model::Volume::hybrid_replication_parameters].
13561    ///
13562    /// # Example
13563    /// ```ignore,no_run
13564    /// # use google_cloud_netapp_v1::model::Volume;
13565    /// use google_cloud_netapp_v1::model::HybridReplicationParameters;
13566    /// let x = Volume::new().set_hybrid_replication_parameters(HybridReplicationParameters::default()/* use setters */);
13567    /// ```
13568    pub fn set_hybrid_replication_parameters<T>(mut self, v: T) -> Self
13569    where
13570        T: std::convert::Into<crate::model::HybridReplicationParameters>,
13571    {
13572        self.hybrid_replication_parameters = std::option::Option::Some(v.into());
13573        self
13574    }
13575
13576    /// Sets or clears the value of [hybrid_replication_parameters][crate::model::Volume::hybrid_replication_parameters].
13577    ///
13578    /// # Example
13579    /// ```ignore,no_run
13580    /// # use google_cloud_netapp_v1::model::Volume;
13581    /// use google_cloud_netapp_v1::model::HybridReplicationParameters;
13582    /// let x = Volume::new().set_or_clear_hybrid_replication_parameters(Some(HybridReplicationParameters::default()/* use setters */));
13583    /// let x = Volume::new().set_or_clear_hybrid_replication_parameters(None::<HybridReplicationParameters>);
13584    /// ```
13585    pub fn set_or_clear_hybrid_replication_parameters<T>(
13586        mut self,
13587        v: std::option::Option<T>,
13588    ) -> Self
13589    where
13590        T: std::convert::Into<crate::model::HybridReplicationParameters>,
13591    {
13592        self.hybrid_replication_parameters = v.map(|x| x.into());
13593        self
13594    }
13595
13596    /// Sets the value of [throughput_mibps][crate::model::Volume::throughput_mibps].
13597    ///
13598    /// # Example
13599    /// ```ignore,no_run
13600    /// # use google_cloud_netapp_v1::model::Volume;
13601    /// let x = Volume::new().set_throughput_mibps(42.0);
13602    /// ```
13603    pub fn set_throughput_mibps<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
13604        self.throughput_mibps = v.into();
13605        self
13606    }
13607
13608    /// Sets the value of [cache_parameters][crate::model::Volume::cache_parameters].
13609    ///
13610    /// # Example
13611    /// ```ignore,no_run
13612    /// # use google_cloud_netapp_v1::model::Volume;
13613    /// use google_cloud_netapp_v1::model::CacheParameters;
13614    /// let x = Volume::new().set_cache_parameters(CacheParameters::default()/* use setters */);
13615    /// ```
13616    pub fn set_cache_parameters<T>(mut self, v: T) -> Self
13617    where
13618        T: std::convert::Into<crate::model::CacheParameters>,
13619    {
13620        self.cache_parameters = std::option::Option::Some(v.into());
13621        self
13622    }
13623
13624    /// Sets or clears the value of [cache_parameters][crate::model::Volume::cache_parameters].
13625    ///
13626    /// # Example
13627    /// ```ignore,no_run
13628    /// # use google_cloud_netapp_v1::model::Volume;
13629    /// use google_cloud_netapp_v1::model::CacheParameters;
13630    /// let x = Volume::new().set_or_clear_cache_parameters(Some(CacheParameters::default()/* use setters */));
13631    /// let x = Volume::new().set_or_clear_cache_parameters(None::<CacheParameters>);
13632    /// ```
13633    pub fn set_or_clear_cache_parameters<T>(mut self, v: std::option::Option<T>) -> Self
13634    where
13635        T: std::convert::Into<crate::model::CacheParameters>,
13636    {
13637        self.cache_parameters = v.map(|x| x.into());
13638        self
13639    }
13640
13641    /// Sets the value of [hot_tier_size_used_gib][crate::model::Volume::hot_tier_size_used_gib].
13642    ///
13643    /// # Example
13644    /// ```ignore,no_run
13645    /// # use google_cloud_netapp_v1::model::Volume;
13646    /// let x = Volume::new().set_hot_tier_size_used_gib(42);
13647    /// ```
13648    pub fn set_hot_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
13649        self.hot_tier_size_used_gib = v.into();
13650        self
13651    }
13652
13653    /// Sets the value of [block_devices][crate::model::Volume::block_devices].
13654    ///
13655    /// # Example
13656    /// ```ignore,no_run
13657    /// # use google_cloud_netapp_v1::model::Volume;
13658    /// use google_cloud_netapp_v1::model::BlockDevice;
13659    /// let x = Volume::new()
13660    ///     .set_block_devices([
13661    ///         BlockDevice::default()/* use setters */,
13662    ///         BlockDevice::default()/* use (different) setters */,
13663    ///     ]);
13664    /// ```
13665    pub fn set_block_devices<T, V>(mut self, v: T) -> Self
13666    where
13667        T: std::iter::IntoIterator<Item = V>,
13668        V: std::convert::Into<crate::model::BlockDevice>,
13669    {
13670        use std::iter::Iterator;
13671        self.block_devices = v.into_iter().map(|i| i.into()).collect();
13672        self
13673    }
13674}
13675
13676impl wkt::message::Message for Volume {
13677    fn typename() -> &'static str {
13678        "type.googleapis.com/google.cloud.netapp.v1.Volume"
13679    }
13680}
13681
13682/// Defines additional types related to [Volume].
13683pub mod volume {
13684    #[allow(unused_imports)]
13685    use super::*;
13686
13687    /// The volume states
13688    ///
13689    /// # Working with unknown values
13690    ///
13691    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13692    /// additional enum variants at any time. Adding new variants is not considered
13693    /// a breaking change. Applications should write their code in anticipation of:
13694    ///
13695    /// - New values appearing in future releases of the client library, **and**
13696    /// - New values received dynamically, without application changes.
13697    ///
13698    /// Please consult the [Working with enums] section in the user guide for some
13699    /// guidelines.
13700    ///
13701    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13702    #[derive(Clone, Debug, PartialEq)]
13703    #[non_exhaustive]
13704    pub enum State {
13705        /// Unspecified Volume State
13706        Unspecified,
13707        /// Volume State is Ready
13708        Ready,
13709        /// Volume State is Creating
13710        Creating,
13711        /// Volume State is Deleting
13712        Deleting,
13713        /// Volume State is Updating
13714        Updating,
13715        /// Volume State is Restoring
13716        Restoring,
13717        /// Volume State is Disabled
13718        Disabled,
13719        /// Volume State is Error
13720        Error,
13721        /// Volume State is Preparing. Note that this is different from CREATING
13722        /// where CREATING means the volume is being created, while PREPARING means
13723        /// the volume is created and now being prepared for the replication.
13724        Preparing,
13725        /// Volume State is Read Only
13726        ReadOnly,
13727        /// If set, the enum was initialized with an unknown value.
13728        ///
13729        /// Applications can examine the value using [State::value] or
13730        /// [State::name].
13731        UnknownValue(state::UnknownValue),
13732    }
13733
13734    #[doc(hidden)]
13735    pub mod state {
13736        #[allow(unused_imports)]
13737        use super::*;
13738        #[derive(Clone, Debug, PartialEq)]
13739        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13740    }
13741
13742    impl State {
13743        /// Gets the enum value.
13744        ///
13745        /// Returns `None` if the enum contains an unknown value deserialized from
13746        /// the string representation of enums.
13747        pub fn value(&self) -> std::option::Option<i32> {
13748            match self {
13749                Self::Unspecified => std::option::Option::Some(0),
13750                Self::Ready => std::option::Option::Some(1),
13751                Self::Creating => std::option::Option::Some(2),
13752                Self::Deleting => std::option::Option::Some(3),
13753                Self::Updating => std::option::Option::Some(4),
13754                Self::Restoring => std::option::Option::Some(5),
13755                Self::Disabled => std::option::Option::Some(6),
13756                Self::Error => std::option::Option::Some(7),
13757                Self::Preparing => std::option::Option::Some(8),
13758                Self::ReadOnly => std::option::Option::Some(9),
13759                Self::UnknownValue(u) => u.0.value(),
13760            }
13761        }
13762
13763        /// Gets the enum value as a string.
13764        ///
13765        /// Returns `None` if the enum contains an unknown value deserialized from
13766        /// the integer representation of enums.
13767        pub fn name(&self) -> std::option::Option<&str> {
13768            match self {
13769                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
13770                Self::Ready => std::option::Option::Some("READY"),
13771                Self::Creating => std::option::Option::Some("CREATING"),
13772                Self::Deleting => std::option::Option::Some("DELETING"),
13773                Self::Updating => std::option::Option::Some("UPDATING"),
13774                Self::Restoring => std::option::Option::Some("RESTORING"),
13775                Self::Disabled => std::option::Option::Some("DISABLED"),
13776                Self::Error => std::option::Option::Some("ERROR"),
13777                Self::Preparing => std::option::Option::Some("PREPARING"),
13778                Self::ReadOnly => std::option::Option::Some("READ_ONLY"),
13779                Self::UnknownValue(u) => u.0.name(),
13780            }
13781        }
13782    }
13783
13784    impl std::default::Default for State {
13785        fn default() -> Self {
13786            use std::convert::From;
13787            Self::from(0)
13788        }
13789    }
13790
13791    impl std::fmt::Display for State {
13792        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13793            wkt::internal::display_enum(f, self.name(), self.value())
13794        }
13795    }
13796
13797    impl std::convert::From<i32> for State {
13798        fn from(value: i32) -> Self {
13799            match value {
13800                0 => Self::Unspecified,
13801                1 => Self::Ready,
13802                2 => Self::Creating,
13803                3 => Self::Deleting,
13804                4 => Self::Updating,
13805                5 => Self::Restoring,
13806                6 => Self::Disabled,
13807                7 => Self::Error,
13808                8 => Self::Preparing,
13809                9 => Self::ReadOnly,
13810                _ => Self::UnknownValue(state::UnknownValue(
13811                    wkt::internal::UnknownEnumValue::Integer(value),
13812                )),
13813            }
13814        }
13815    }
13816
13817    impl std::convert::From<&str> for State {
13818        fn from(value: &str) -> Self {
13819            use std::string::ToString;
13820            match value {
13821                "STATE_UNSPECIFIED" => Self::Unspecified,
13822                "READY" => Self::Ready,
13823                "CREATING" => Self::Creating,
13824                "DELETING" => Self::Deleting,
13825                "UPDATING" => Self::Updating,
13826                "RESTORING" => Self::Restoring,
13827                "DISABLED" => Self::Disabled,
13828                "ERROR" => Self::Error,
13829                "PREPARING" => Self::Preparing,
13830                "READ_ONLY" => Self::ReadOnly,
13831                _ => Self::UnknownValue(state::UnknownValue(
13832                    wkt::internal::UnknownEnumValue::String(value.to_string()),
13833                )),
13834            }
13835        }
13836    }
13837
13838    impl serde::ser::Serialize for State {
13839        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13840        where
13841            S: serde::Serializer,
13842        {
13843            match self {
13844                Self::Unspecified => serializer.serialize_i32(0),
13845                Self::Ready => serializer.serialize_i32(1),
13846                Self::Creating => serializer.serialize_i32(2),
13847                Self::Deleting => serializer.serialize_i32(3),
13848                Self::Updating => serializer.serialize_i32(4),
13849                Self::Restoring => serializer.serialize_i32(5),
13850                Self::Disabled => serializer.serialize_i32(6),
13851                Self::Error => serializer.serialize_i32(7),
13852                Self::Preparing => serializer.serialize_i32(8),
13853                Self::ReadOnly => serializer.serialize_i32(9),
13854                Self::UnknownValue(u) => u.0.serialize(serializer),
13855            }
13856        }
13857    }
13858
13859    impl<'de> serde::de::Deserialize<'de> for State {
13860        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13861        where
13862            D: serde::Deserializer<'de>,
13863        {
13864            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
13865                ".google.cloud.netapp.v1.Volume.State",
13866            ))
13867        }
13868    }
13869}
13870
13871/// Defines the export policy for the volume.
13872#[derive(Clone, Default, PartialEq)]
13873#[non_exhaustive]
13874pub struct ExportPolicy {
13875    /// Required. List of export policy rules
13876    pub rules: std::vec::Vec<crate::model::SimpleExportPolicyRule>,
13877
13878    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13879}
13880
13881impl ExportPolicy {
13882    pub fn new() -> Self {
13883        std::default::Default::default()
13884    }
13885
13886    /// Sets the value of [rules][crate::model::ExportPolicy::rules].
13887    ///
13888    /// # Example
13889    /// ```ignore,no_run
13890    /// # use google_cloud_netapp_v1::model::ExportPolicy;
13891    /// use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
13892    /// let x = ExportPolicy::new()
13893    ///     .set_rules([
13894    ///         SimpleExportPolicyRule::default()/* use setters */,
13895    ///         SimpleExportPolicyRule::default()/* use (different) setters */,
13896    ///     ]);
13897    /// ```
13898    pub fn set_rules<T, V>(mut self, v: T) -> Self
13899    where
13900        T: std::iter::IntoIterator<Item = V>,
13901        V: std::convert::Into<crate::model::SimpleExportPolicyRule>,
13902    {
13903        use std::iter::Iterator;
13904        self.rules = v.into_iter().map(|i| i.into()).collect();
13905        self
13906    }
13907}
13908
13909impl wkt::message::Message for ExportPolicy {
13910    fn typename() -> &'static str {
13911        "type.googleapis.com/google.cloud.netapp.v1.ExportPolicy"
13912    }
13913}
13914
13915/// An export policy rule describing various export options.
13916#[derive(Clone, Default, PartialEq)]
13917#[non_exhaustive]
13918pub struct SimpleExportPolicyRule {
13919    /// Comma separated list of allowed clients IP addresses
13920    pub allowed_clients: std::option::Option<std::string::String>,
13921
13922    /// Whether Unix root access will be granted.
13923    pub has_root_access: std::option::Option<std::string::String>,
13924
13925    /// Access type (ReadWrite, ReadOnly, None)
13926    pub access_type: std::option::Option<crate::model::AccessType>,
13927
13928    /// NFS V3 protocol.
13929    pub nfsv3: std::option::Option<bool>,
13930
13931    /// NFS V4 protocol.
13932    pub nfsv4: std::option::Option<bool>,
13933
13934    /// If enabled (true) the rule defines a read only access for clients matching
13935    /// the 'allowedClients' specification. It enables nfs clients to mount using
13936    /// 'authentication' kerberos security mode.
13937    pub kerberos_5_read_only: std::option::Option<bool>,
13938
13939    /// If enabled (true) the rule defines read and write access for clients
13940    /// matching the 'allowedClients' specification. It enables nfs clients to
13941    /// mount using 'authentication' kerberos security mode. The
13942    /// 'kerberos5ReadOnly' value be ignored if this is enabled.
13943    pub kerberos_5_read_write: std::option::Option<bool>,
13944
13945    /// If enabled (true) the rule defines a read only access for clients matching
13946    /// the 'allowedClients' specification. It enables nfs clients to mount using
13947    /// 'integrity' kerberos security mode.
13948    pub kerberos_5i_read_only: std::option::Option<bool>,
13949
13950    /// If enabled (true) the rule defines read and write access for clients
13951    /// matching the 'allowedClients' specification. It enables nfs clients to
13952    /// mount using 'integrity' kerberos security mode. The 'kerberos5iReadOnly'
13953    /// value be ignored if this is enabled.
13954    pub kerberos_5i_read_write: std::option::Option<bool>,
13955
13956    /// If enabled (true) the rule defines a read only access for clients matching
13957    /// the 'allowedClients' specification. It enables nfs clients to mount using
13958    /// 'privacy' kerberos security mode.
13959    pub kerberos_5p_read_only: std::option::Option<bool>,
13960
13961    /// If enabled (true) the rule defines read and write access for clients
13962    /// matching the 'allowedClients' specification. It enables nfs clients to
13963    /// mount using 'privacy' kerberos security mode. The 'kerberos5pReadOnly'
13964    /// value be ignored if this is enabled.
13965    pub kerberos_5p_read_write: std::option::Option<bool>,
13966
13967    /// Optional. Defines how user identity squashing is applied for this export
13968    /// rule. This field is the preferred way to configure squashing behavior and
13969    /// takes precedence over `has_root_access` if both are provided.
13970    pub squash_mode: std::option::Option<crate::model::simple_export_policy_rule::SquashMode>,
13971
13972    /// Optional. An integer representing the anonymous user ID. Range is 0 to
13973    /// `4294967295`. Required when `squash_mode` is `ROOT_SQUASH` or `ALL_SQUASH`.
13974    pub anon_uid: std::option::Option<i64>,
13975
13976    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13977}
13978
13979impl SimpleExportPolicyRule {
13980    pub fn new() -> Self {
13981        std::default::Default::default()
13982    }
13983
13984    /// Sets the value of [allowed_clients][crate::model::SimpleExportPolicyRule::allowed_clients].
13985    ///
13986    /// # Example
13987    /// ```ignore,no_run
13988    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
13989    /// let x = SimpleExportPolicyRule::new().set_allowed_clients("example");
13990    /// ```
13991    pub fn set_allowed_clients<T>(mut self, v: T) -> Self
13992    where
13993        T: std::convert::Into<std::string::String>,
13994    {
13995        self.allowed_clients = std::option::Option::Some(v.into());
13996        self
13997    }
13998
13999    /// Sets or clears the value of [allowed_clients][crate::model::SimpleExportPolicyRule::allowed_clients].
14000    ///
14001    /// # Example
14002    /// ```ignore,no_run
14003    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14004    /// let x = SimpleExportPolicyRule::new().set_or_clear_allowed_clients(Some("example"));
14005    /// let x = SimpleExportPolicyRule::new().set_or_clear_allowed_clients(None::<String>);
14006    /// ```
14007    pub fn set_or_clear_allowed_clients<T>(mut self, v: std::option::Option<T>) -> Self
14008    where
14009        T: std::convert::Into<std::string::String>,
14010    {
14011        self.allowed_clients = v.map(|x| x.into());
14012        self
14013    }
14014
14015    /// Sets the value of [has_root_access][crate::model::SimpleExportPolicyRule::has_root_access].
14016    ///
14017    /// # Example
14018    /// ```ignore,no_run
14019    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14020    /// let x = SimpleExportPolicyRule::new().set_has_root_access("example");
14021    /// ```
14022    pub fn set_has_root_access<T>(mut self, v: T) -> Self
14023    where
14024        T: std::convert::Into<std::string::String>,
14025    {
14026        self.has_root_access = std::option::Option::Some(v.into());
14027        self
14028    }
14029
14030    /// Sets or clears the value of [has_root_access][crate::model::SimpleExportPolicyRule::has_root_access].
14031    ///
14032    /// # Example
14033    /// ```ignore,no_run
14034    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14035    /// let x = SimpleExportPolicyRule::new().set_or_clear_has_root_access(Some("example"));
14036    /// let x = SimpleExportPolicyRule::new().set_or_clear_has_root_access(None::<String>);
14037    /// ```
14038    pub fn set_or_clear_has_root_access<T>(mut self, v: std::option::Option<T>) -> Self
14039    where
14040        T: std::convert::Into<std::string::String>,
14041    {
14042        self.has_root_access = v.map(|x| x.into());
14043        self
14044    }
14045
14046    /// Sets the value of [access_type][crate::model::SimpleExportPolicyRule::access_type].
14047    ///
14048    /// # Example
14049    /// ```ignore,no_run
14050    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14051    /// use google_cloud_netapp_v1::model::AccessType;
14052    /// let x0 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadOnly);
14053    /// let x1 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadWrite);
14054    /// let x2 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadNone);
14055    /// ```
14056    pub fn set_access_type<T>(mut self, v: T) -> Self
14057    where
14058        T: std::convert::Into<crate::model::AccessType>,
14059    {
14060        self.access_type = std::option::Option::Some(v.into());
14061        self
14062    }
14063
14064    /// Sets or clears the value of [access_type][crate::model::SimpleExportPolicyRule::access_type].
14065    ///
14066    /// # Example
14067    /// ```ignore,no_run
14068    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14069    /// use google_cloud_netapp_v1::model::AccessType;
14070    /// let x0 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadOnly));
14071    /// let x1 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadWrite));
14072    /// let x2 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadNone));
14073    /// let x_none = SimpleExportPolicyRule::new().set_or_clear_access_type(None::<AccessType>);
14074    /// ```
14075    pub fn set_or_clear_access_type<T>(mut self, v: std::option::Option<T>) -> Self
14076    where
14077        T: std::convert::Into<crate::model::AccessType>,
14078    {
14079        self.access_type = v.map(|x| x.into());
14080        self
14081    }
14082
14083    /// Sets the value of [nfsv3][crate::model::SimpleExportPolicyRule::nfsv3].
14084    ///
14085    /// # Example
14086    /// ```ignore,no_run
14087    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14088    /// let x = SimpleExportPolicyRule::new().set_nfsv3(true);
14089    /// ```
14090    pub fn set_nfsv3<T>(mut self, v: T) -> Self
14091    where
14092        T: std::convert::Into<bool>,
14093    {
14094        self.nfsv3 = std::option::Option::Some(v.into());
14095        self
14096    }
14097
14098    /// Sets or clears the value of [nfsv3][crate::model::SimpleExportPolicyRule::nfsv3].
14099    ///
14100    /// # Example
14101    /// ```ignore,no_run
14102    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14103    /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv3(Some(false));
14104    /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv3(None::<bool>);
14105    /// ```
14106    pub fn set_or_clear_nfsv3<T>(mut self, v: std::option::Option<T>) -> Self
14107    where
14108        T: std::convert::Into<bool>,
14109    {
14110        self.nfsv3 = v.map(|x| x.into());
14111        self
14112    }
14113
14114    /// Sets the value of [nfsv4][crate::model::SimpleExportPolicyRule::nfsv4].
14115    ///
14116    /// # Example
14117    /// ```ignore,no_run
14118    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14119    /// let x = SimpleExportPolicyRule::new().set_nfsv4(true);
14120    /// ```
14121    pub fn set_nfsv4<T>(mut self, v: T) -> Self
14122    where
14123        T: std::convert::Into<bool>,
14124    {
14125        self.nfsv4 = std::option::Option::Some(v.into());
14126        self
14127    }
14128
14129    /// Sets or clears the value of [nfsv4][crate::model::SimpleExportPolicyRule::nfsv4].
14130    ///
14131    /// # Example
14132    /// ```ignore,no_run
14133    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14134    /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv4(Some(false));
14135    /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv4(None::<bool>);
14136    /// ```
14137    pub fn set_or_clear_nfsv4<T>(mut self, v: std::option::Option<T>) -> Self
14138    where
14139        T: std::convert::Into<bool>,
14140    {
14141        self.nfsv4 = v.map(|x| x.into());
14142        self
14143    }
14144
14145    /// Sets the value of [kerberos_5_read_only][crate::model::SimpleExportPolicyRule::kerberos_5_read_only].
14146    ///
14147    /// # Example
14148    /// ```ignore,no_run
14149    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14150    /// let x = SimpleExportPolicyRule::new().set_kerberos_5_read_only(true);
14151    /// ```
14152    pub fn set_kerberos_5_read_only<T>(mut self, v: T) -> Self
14153    where
14154        T: std::convert::Into<bool>,
14155    {
14156        self.kerberos_5_read_only = std::option::Option::Some(v.into());
14157        self
14158    }
14159
14160    /// Sets or clears the value of [kerberos_5_read_only][crate::model::SimpleExportPolicyRule::kerberos_5_read_only].
14161    ///
14162    /// # Example
14163    /// ```ignore,no_run
14164    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14165    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_only(Some(false));
14166    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_only(None::<bool>);
14167    /// ```
14168    pub fn set_or_clear_kerberos_5_read_only<T>(mut self, v: std::option::Option<T>) -> Self
14169    where
14170        T: std::convert::Into<bool>,
14171    {
14172        self.kerberos_5_read_only = v.map(|x| x.into());
14173        self
14174    }
14175
14176    /// Sets the value of [kerberos_5_read_write][crate::model::SimpleExportPolicyRule::kerberos_5_read_write].
14177    ///
14178    /// # Example
14179    /// ```ignore,no_run
14180    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14181    /// let x = SimpleExportPolicyRule::new().set_kerberos_5_read_write(true);
14182    /// ```
14183    pub fn set_kerberos_5_read_write<T>(mut self, v: T) -> Self
14184    where
14185        T: std::convert::Into<bool>,
14186    {
14187        self.kerberos_5_read_write = std::option::Option::Some(v.into());
14188        self
14189    }
14190
14191    /// Sets or clears the value of [kerberos_5_read_write][crate::model::SimpleExportPolicyRule::kerberos_5_read_write].
14192    ///
14193    /// # Example
14194    /// ```ignore,no_run
14195    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14196    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_write(Some(false));
14197    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_write(None::<bool>);
14198    /// ```
14199    pub fn set_or_clear_kerberos_5_read_write<T>(mut self, v: std::option::Option<T>) -> Self
14200    where
14201        T: std::convert::Into<bool>,
14202    {
14203        self.kerberos_5_read_write = v.map(|x| x.into());
14204        self
14205    }
14206
14207    /// Sets the value of [kerberos_5i_read_only][crate::model::SimpleExportPolicyRule::kerberos_5i_read_only].
14208    ///
14209    /// # Example
14210    /// ```ignore,no_run
14211    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14212    /// let x = SimpleExportPolicyRule::new().set_kerberos_5i_read_only(true);
14213    /// ```
14214    pub fn set_kerberos_5i_read_only<T>(mut self, v: T) -> Self
14215    where
14216        T: std::convert::Into<bool>,
14217    {
14218        self.kerberos_5i_read_only = std::option::Option::Some(v.into());
14219        self
14220    }
14221
14222    /// Sets or clears the value of [kerberos_5i_read_only][crate::model::SimpleExportPolicyRule::kerberos_5i_read_only].
14223    ///
14224    /// # Example
14225    /// ```ignore,no_run
14226    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14227    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_only(Some(false));
14228    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_only(None::<bool>);
14229    /// ```
14230    pub fn set_or_clear_kerberos_5i_read_only<T>(mut self, v: std::option::Option<T>) -> Self
14231    where
14232        T: std::convert::Into<bool>,
14233    {
14234        self.kerberos_5i_read_only = v.map(|x| x.into());
14235        self
14236    }
14237
14238    /// Sets the value of [kerberos_5i_read_write][crate::model::SimpleExportPolicyRule::kerberos_5i_read_write].
14239    ///
14240    /// # Example
14241    /// ```ignore,no_run
14242    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14243    /// let x = SimpleExportPolicyRule::new().set_kerberos_5i_read_write(true);
14244    /// ```
14245    pub fn set_kerberos_5i_read_write<T>(mut self, v: T) -> Self
14246    where
14247        T: std::convert::Into<bool>,
14248    {
14249        self.kerberos_5i_read_write = std::option::Option::Some(v.into());
14250        self
14251    }
14252
14253    /// Sets or clears the value of [kerberos_5i_read_write][crate::model::SimpleExportPolicyRule::kerberos_5i_read_write].
14254    ///
14255    /// # Example
14256    /// ```ignore,no_run
14257    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14258    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_write(Some(false));
14259    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_write(None::<bool>);
14260    /// ```
14261    pub fn set_or_clear_kerberos_5i_read_write<T>(mut self, v: std::option::Option<T>) -> Self
14262    where
14263        T: std::convert::Into<bool>,
14264    {
14265        self.kerberos_5i_read_write = v.map(|x| x.into());
14266        self
14267    }
14268
14269    /// Sets the value of [kerberos_5p_read_only][crate::model::SimpleExportPolicyRule::kerberos_5p_read_only].
14270    ///
14271    /// # Example
14272    /// ```ignore,no_run
14273    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14274    /// let x = SimpleExportPolicyRule::new().set_kerberos_5p_read_only(true);
14275    /// ```
14276    pub fn set_kerberos_5p_read_only<T>(mut self, v: T) -> Self
14277    where
14278        T: std::convert::Into<bool>,
14279    {
14280        self.kerberos_5p_read_only = std::option::Option::Some(v.into());
14281        self
14282    }
14283
14284    /// Sets or clears the value of [kerberos_5p_read_only][crate::model::SimpleExportPolicyRule::kerberos_5p_read_only].
14285    ///
14286    /// # Example
14287    /// ```ignore,no_run
14288    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14289    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_only(Some(false));
14290    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_only(None::<bool>);
14291    /// ```
14292    pub fn set_or_clear_kerberos_5p_read_only<T>(mut self, v: std::option::Option<T>) -> Self
14293    where
14294        T: std::convert::Into<bool>,
14295    {
14296        self.kerberos_5p_read_only = v.map(|x| x.into());
14297        self
14298    }
14299
14300    /// Sets the value of [kerberos_5p_read_write][crate::model::SimpleExportPolicyRule::kerberos_5p_read_write].
14301    ///
14302    /// # Example
14303    /// ```ignore,no_run
14304    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14305    /// let x = SimpleExportPolicyRule::new().set_kerberos_5p_read_write(true);
14306    /// ```
14307    pub fn set_kerberos_5p_read_write<T>(mut self, v: T) -> Self
14308    where
14309        T: std::convert::Into<bool>,
14310    {
14311        self.kerberos_5p_read_write = std::option::Option::Some(v.into());
14312        self
14313    }
14314
14315    /// Sets or clears the value of [kerberos_5p_read_write][crate::model::SimpleExportPolicyRule::kerberos_5p_read_write].
14316    ///
14317    /// # Example
14318    /// ```ignore,no_run
14319    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14320    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_write(Some(false));
14321    /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_write(None::<bool>);
14322    /// ```
14323    pub fn set_or_clear_kerberos_5p_read_write<T>(mut self, v: std::option::Option<T>) -> Self
14324    where
14325        T: std::convert::Into<bool>,
14326    {
14327        self.kerberos_5p_read_write = v.map(|x| x.into());
14328        self
14329    }
14330
14331    /// Sets the value of [squash_mode][crate::model::SimpleExportPolicyRule::squash_mode].
14332    ///
14333    /// # Example
14334    /// ```ignore,no_run
14335    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14336    /// use google_cloud_netapp_v1::model::simple_export_policy_rule::SquashMode;
14337    /// let x0 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::NoRootSquash);
14338    /// let x1 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::RootSquash);
14339    /// let x2 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::AllSquash);
14340    /// ```
14341    pub fn set_squash_mode<T>(mut self, v: T) -> Self
14342    where
14343        T: std::convert::Into<crate::model::simple_export_policy_rule::SquashMode>,
14344    {
14345        self.squash_mode = std::option::Option::Some(v.into());
14346        self
14347    }
14348
14349    /// Sets or clears the value of [squash_mode][crate::model::SimpleExportPolicyRule::squash_mode].
14350    ///
14351    /// # Example
14352    /// ```ignore,no_run
14353    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14354    /// use google_cloud_netapp_v1::model::simple_export_policy_rule::SquashMode;
14355    /// let x0 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::NoRootSquash));
14356    /// let x1 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::RootSquash));
14357    /// let x2 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::AllSquash));
14358    /// let x_none = SimpleExportPolicyRule::new().set_or_clear_squash_mode(None::<SquashMode>);
14359    /// ```
14360    pub fn set_or_clear_squash_mode<T>(mut self, v: std::option::Option<T>) -> Self
14361    where
14362        T: std::convert::Into<crate::model::simple_export_policy_rule::SquashMode>,
14363    {
14364        self.squash_mode = v.map(|x| x.into());
14365        self
14366    }
14367
14368    /// Sets the value of [anon_uid][crate::model::SimpleExportPolicyRule::anon_uid].
14369    ///
14370    /// # Example
14371    /// ```ignore,no_run
14372    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14373    /// let x = SimpleExportPolicyRule::new().set_anon_uid(42);
14374    /// ```
14375    pub fn set_anon_uid<T>(mut self, v: T) -> Self
14376    where
14377        T: std::convert::Into<i64>,
14378    {
14379        self.anon_uid = std::option::Option::Some(v.into());
14380        self
14381    }
14382
14383    /// Sets or clears the value of [anon_uid][crate::model::SimpleExportPolicyRule::anon_uid].
14384    ///
14385    /// # Example
14386    /// ```ignore,no_run
14387    /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
14388    /// let x = SimpleExportPolicyRule::new().set_or_clear_anon_uid(Some(42));
14389    /// let x = SimpleExportPolicyRule::new().set_or_clear_anon_uid(None::<i32>);
14390    /// ```
14391    pub fn set_or_clear_anon_uid<T>(mut self, v: std::option::Option<T>) -> Self
14392    where
14393        T: std::convert::Into<i64>,
14394    {
14395        self.anon_uid = v.map(|x| x.into());
14396        self
14397    }
14398}
14399
14400impl wkt::message::Message for SimpleExportPolicyRule {
14401    fn typename() -> &'static str {
14402        "type.googleapis.com/google.cloud.netapp.v1.SimpleExportPolicyRule"
14403    }
14404}
14405
14406/// Defines additional types related to [SimpleExportPolicyRule].
14407pub mod simple_export_policy_rule {
14408    #[allow(unused_imports)]
14409    use super::*;
14410
14411    /// `SquashMode` defines how remote user privileges are restricted when
14412    /// accessing an NFS export. It controls how user identities (like root) are
14413    /// mapped to anonymous users to limit access and enforce security.
14414    ///
14415    /// # Working with unknown values
14416    ///
14417    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14418    /// additional enum variants at any time. Adding new variants is not considered
14419    /// a breaking change. Applications should write their code in anticipation of:
14420    ///
14421    /// - New values appearing in future releases of the client library, **and**
14422    /// - New values received dynamically, without application changes.
14423    ///
14424    /// Please consult the [Working with enums] section in the user guide for some
14425    /// guidelines.
14426    ///
14427    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14428    #[derive(Clone, Debug, PartialEq)]
14429    #[non_exhaustive]
14430    pub enum SquashMode {
14431        /// Defaults to `NO_ROOT_SQUASH`.
14432        Unspecified,
14433        /// The root user (UID 0) retains full access. Other users are
14434        /// unaffected.
14435        NoRootSquash,
14436        /// The root user (UID 0) is squashed to anonymous user ID. Other users are
14437        /// unaffected.
14438        RootSquash,
14439        /// All users are squashed to anonymous user ID.
14440        AllSquash,
14441        /// If set, the enum was initialized with an unknown value.
14442        ///
14443        /// Applications can examine the value using [SquashMode::value] or
14444        /// [SquashMode::name].
14445        UnknownValue(squash_mode::UnknownValue),
14446    }
14447
14448    #[doc(hidden)]
14449    pub mod squash_mode {
14450        #[allow(unused_imports)]
14451        use super::*;
14452        #[derive(Clone, Debug, PartialEq)]
14453        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14454    }
14455
14456    impl SquashMode {
14457        /// Gets the enum value.
14458        ///
14459        /// Returns `None` if the enum contains an unknown value deserialized from
14460        /// the string representation of enums.
14461        pub fn value(&self) -> std::option::Option<i32> {
14462            match self {
14463                Self::Unspecified => std::option::Option::Some(0),
14464                Self::NoRootSquash => std::option::Option::Some(1),
14465                Self::RootSquash => std::option::Option::Some(2),
14466                Self::AllSquash => std::option::Option::Some(3),
14467                Self::UnknownValue(u) => u.0.value(),
14468            }
14469        }
14470
14471        /// Gets the enum value as a string.
14472        ///
14473        /// Returns `None` if the enum contains an unknown value deserialized from
14474        /// the integer representation of enums.
14475        pub fn name(&self) -> std::option::Option<&str> {
14476            match self {
14477                Self::Unspecified => std::option::Option::Some("SQUASH_MODE_UNSPECIFIED"),
14478                Self::NoRootSquash => std::option::Option::Some("NO_ROOT_SQUASH"),
14479                Self::RootSquash => std::option::Option::Some("ROOT_SQUASH"),
14480                Self::AllSquash => std::option::Option::Some("ALL_SQUASH"),
14481                Self::UnknownValue(u) => u.0.name(),
14482            }
14483        }
14484    }
14485
14486    impl std::default::Default for SquashMode {
14487        fn default() -> Self {
14488            use std::convert::From;
14489            Self::from(0)
14490        }
14491    }
14492
14493    impl std::fmt::Display for SquashMode {
14494        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14495            wkt::internal::display_enum(f, self.name(), self.value())
14496        }
14497    }
14498
14499    impl std::convert::From<i32> for SquashMode {
14500        fn from(value: i32) -> Self {
14501            match value {
14502                0 => Self::Unspecified,
14503                1 => Self::NoRootSquash,
14504                2 => Self::RootSquash,
14505                3 => Self::AllSquash,
14506                _ => Self::UnknownValue(squash_mode::UnknownValue(
14507                    wkt::internal::UnknownEnumValue::Integer(value),
14508                )),
14509            }
14510        }
14511    }
14512
14513    impl std::convert::From<&str> for SquashMode {
14514        fn from(value: &str) -> Self {
14515            use std::string::ToString;
14516            match value {
14517                "SQUASH_MODE_UNSPECIFIED" => Self::Unspecified,
14518                "NO_ROOT_SQUASH" => Self::NoRootSquash,
14519                "ROOT_SQUASH" => Self::RootSquash,
14520                "ALL_SQUASH" => Self::AllSquash,
14521                _ => Self::UnknownValue(squash_mode::UnknownValue(
14522                    wkt::internal::UnknownEnumValue::String(value.to_string()),
14523                )),
14524            }
14525        }
14526    }
14527
14528    impl serde::ser::Serialize for SquashMode {
14529        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14530        where
14531            S: serde::Serializer,
14532        {
14533            match self {
14534                Self::Unspecified => serializer.serialize_i32(0),
14535                Self::NoRootSquash => serializer.serialize_i32(1),
14536                Self::RootSquash => serializer.serialize_i32(2),
14537                Self::AllSquash => serializer.serialize_i32(3),
14538                Self::UnknownValue(u) => u.0.serialize(serializer),
14539            }
14540        }
14541    }
14542
14543    impl<'de> serde::de::Deserialize<'de> for SquashMode {
14544        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14545        where
14546            D: serde::Deserializer<'de>,
14547        {
14548            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SquashMode>::new(
14549                ".google.cloud.netapp.v1.SimpleExportPolicyRule.SquashMode",
14550            ))
14551        }
14552    }
14553}
14554
14555/// Snapshot Policy for a volume.
14556#[derive(Clone, Default, PartialEq)]
14557#[non_exhaustive]
14558pub struct SnapshotPolicy {
14559    /// If enabled, make snapshots automatically according to the schedules.
14560    /// Default is false.
14561    pub enabled: std::option::Option<bool>,
14562
14563    /// Hourly schedule policy.
14564    pub hourly_schedule: std::option::Option<crate::model::HourlySchedule>,
14565
14566    /// Daily schedule policy.
14567    pub daily_schedule: std::option::Option<crate::model::DailySchedule>,
14568
14569    /// Weekly schedule policy.
14570    pub weekly_schedule: std::option::Option<crate::model::WeeklySchedule>,
14571
14572    /// Monthly schedule policy.
14573    pub monthly_schedule: std::option::Option<crate::model::MonthlySchedule>,
14574
14575    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14576}
14577
14578impl SnapshotPolicy {
14579    pub fn new() -> Self {
14580        std::default::Default::default()
14581    }
14582
14583    /// Sets the value of [enabled][crate::model::SnapshotPolicy::enabled].
14584    ///
14585    /// # Example
14586    /// ```ignore,no_run
14587    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14588    /// let x = SnapshotPolicy::new().set_enabled(true);
14589    /// ```
14590    pub fn set_enabled<T>(mut self, v: T) -> Self
14591    where
14592        T: std::convert::Into<bool>,
14593    {
14594        self.enabled = std::option::Option::Some(v.into());
14595        self
14596    }
14597
14598    /// Sets or clears the value of [enabled][crate::model::SnapshotPolicy::enabled].
14599    ///
14600    /// # Example
14601    /// ```ignore,no_run
14602    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14603    /// let x = SnapshotPolicy::new().set_or_clear_enabled(Some(false));
14604    /// let x = SnapshotPolicy::new().set_or_clear_enabled(None::<bool>);
14605    /// ```
14606    pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
14607    where
14608        T: std::convert::Into<bool>,
14609    {
14610        self.enabled = v.map(|x| x.into());
14611        self
14612    }
14613
14614    /// Sets the value of [hourly_schedule][crate::model::SnapshotPolicy::hourly_schedule].
14615    ///
14616    /// # Example
14617    /// ```ignore,no_run
14618    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14619    /// use google_cloud_netapp_v1::model::HourlySchedule;
14620    /// let x = SnapshotPolicy::new().set_hourly_schedule(HourlySchedule::default()/* use setters */);
14621    /// ```
14622    pub fn set_hourly_schedule<T>(mut self, v: T) -> Self
14623    where
14624        T: std::convert::Into<crate::model::HourlySchedule>,
14625    {
14626        self.hourly_schedule = std::option::Option::Some(v.into());
14627        self
14628    }
14629
14630    /// Sets or clears the value of [hourly_schedule][crate::model::SnapshotPolicy::hourly_schedule].
14631    ///
14632    /// # Example
14633    /// ```ignore,no_run
14634    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14635    /// use google_cloud_netapp_v1::model::HourlySchedule;
14636    /// let x = SnapshotPolicy::new().set_or_clear_hourly_schedule(Some(HourlySchedule::default()/* use setters */));
14637    /// let x = SnapshotPolicy::new().set_or_clear_hourly_schedule(None::<HourlySchedule>);
14638    /// ```
14639    pub fn set_or_clear_hourly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
14640    where
14641        T: std::convert::Into<crate::model::HourlySchedule>,
14642    {
14643        self.hourly_schedule = v.map(|x| x.into());
14644        self
14645    }
14646
14647    /// Sets the value of [daily_schedule][crate::model::SnapshotPolicy::daily_schedule].
14648    ///
14649    /// # Example
14650    /// ```ignore,no_run
14651    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14652    /// use google_cloud_netapp_v1::model::DailySchedule;
14653    /// let x = SnapshotPolicy::new().set_daily_schedule(DailySchedule::default()/* use setters */);
14654    /// ```
14655    pub fn set_daily_schedule<T>(mut self, v: T) -> Self
14656    where
14657        T: std::convert::Into<crate::model::DailySchedule>,
14658    {
14659        self.daily_schedule = std::option::Option::Some(v.into());
14660        self
14661    }
14662
14663    /// Sets or clears the value of [daily_schedule][crate::model::SnapshotPolicy::daily_schedule].
14664    ///
14665    /// # Example
14666    /// ```ignore,no_run
14667    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14668    /// use google_cloud_netapp_v1::model::DailySchedule;
14669    /// let x = SnapshotPolicy::new().set_or_clear_daily_schedule(Some(DailySchedule::default()/* use setters */));
14670    /// let x = SnapshotPolicy::new().set_or_clear_daily_schedule(None::<DailySchedule>);
14671    /// ```
14672    pub fn set_or_clear_daily_schedule<T>(mut self, v: std::option::Option<T>) -> Self
14673    where
14674        T: std::convert::Into<crate::model::DailySchedule>,
14675    {
14676        self.daily_schedule = v.map(|x| x.into());
14677        self
14678    }
14679
14680    /// Sets the value of [weekly_schedule][crate::model::SnapshotPolicy::weekly_schedule].
14681    ///
14682    /// # Example
14683    /// ```ignore,no_run
14684    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14685    /// use google_cloud_netapp_v1::model::WeeklySchedule;
14686    /// let x = SnapshotPolicy::new().set_weekly_schedule(WeeklySchedule::default()/* use setters */);
14687    /// ```
14688    pub fn set_weekly_schedule<T>(mut self, v: T) -> Self
14689    where
14690        T: std::convert::Into<crate::model::WeeklySchedule>,
14691    {
14692        self.weekly_schedule = std::option::Option::Some(v.into());
14693        self
14694    }
14695
14696    /// Sets or clears the value of [weekly_schedule][crate::model::SnapshotPolicy::weekly_schedule].
14697    ///
14698    /// # Example
14699    /// ```ignore,no_run
14700    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14701    /// use google_cloud_netapp_v1::model::WeeklySchedule;
14702    /// let x = SnapshotPolicy::new().set_or_clear_weekly_schedule(Some(WeeklySchedule::default()/* use setters */));
14703    /// let x = SnapshotPolicy::new().set_or_clear_weekly_schedule(None::<WeeklySchedule>);
14704    /// ```
14705    pub fn set_or_clear_weekly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
14706    where
14707        T: std::convert::Into<crate::model::WeeklySchedule>,
14708    {
14709        self.weekly_schedule = v.map(|x| x.into());
14710        self
14711    }
14712
14713    /// Sets the value of [monthly_schedule][crate::model::SnapshotPolicy::monthly_schedule].
14714    ///
14715    /// # Example
14716    /// ```ignore,no_run
14717    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14718    /// use google_cloud_netapp_v1::model::MonthlySchedule;
14719    /// let x = SnapshotPolicy::new().set_monthly_schedule(MonthlySchedule::default()/* use setters */);
14720    /// ```
14721    pub fn set_monthly_schedule<T>(mut self, v: T) -> Self
14722    where
14723        T: std::convert::Into<crate::model::MonthlySchedule>,
14724    {
14725        self.monthly_schedule = std::option::Option::Some(v.into());
14726        self
14727    }
14728
14729    /// Sets or clears the value of [monthly_schedule][crate::model::SnapshotPolicy::monthly_schedule].
14730    ///
14731    /// # Example
14732    /// ```ignore,no_run
14733    /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
14734    /// use google_cloud_netapp_v1::model::MonthlySchedule;
14735    /// let x = SnapshotPolicy::new().set_or_clear_monthly_schedule(Some(MonthlySchedule::default()/* use setters */));
14736    /// let x = SnapshotPolicy::new().set_or_clear_monthly_schedule(None::<MonthlySchedule>);
14737    /// ```
14738    pub fn set_or_clear_monthly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
14739    where
14740        T: std::convert::Into<crate::model::MonthlySchedule>,
14741    {
14742        self.monthly_schedule = v.map(|x| x.into());
14743        self
14744    }
14745}
14746
14747impl wkt::message::Message for SnapshotPolicy {
14748    fn typename() -> &'static str {
14749        "type.googleapis.com/google.cloud.netapp.v1.SnapshotPolicy"
14750    }
14751}
14752
14753/// Make a snapshot every hour e.g. at 04:00, 05:00, 06:00.
14754#[derive(Clone, Default, PartialEq)]
14755#[non_exhaustive]
14756pub struct HourlySchedule {
14757    /// The maximum number of Snapshots to keep for the hourly schedule
14758    pub snapshots_to_keep: std::option::Option<f64>,
14759
14760    /// Set the minute of the hour to start the snapshot (0-59), defaults to the
14761    /// top of the hour (0).
14762    pub minute: std::option::Option<f64>,
14763
14764    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14765}
14766
14767impl HourlySchedule {
14768    pub fn new() -> Self {
14769        std::default::Default::default()
14770    }
14771
14772    /// Sets the value of [snapshots_to_keep][crate::model::HourlySchedule::snapshots_to_keep].
14773    ///
14774    /// # Example
14775    /// ```ignore,no_run
14776    /// # use google_cloud_netapp_v1::model::HourlySchedule;
14777    /// let x = HourlySchedule::new().set_snapshots_to_keep(42.0);
14778    /// ```
14779    pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
14780    where
14781        T: std::convert::Into<f64>,
14782    {
14783        self.snapshots_to_keep = std::option::Option::Some(v.into());
14784        self
14785    }
14786
14787    /// Sets or clears the value of [snapshots_to_keep][crate::model::HourlySchedule::snapshots_to_keep].
14788    ///
14789    /// # Example
14790    /// ```ignore,no_run
14791    /// # use google_cloud_netapp_v1::model::HourlySchedule;
14792    /// let x = HourlySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
14793    /// let x = HourlySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
14794    /// ```
14795    pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
14796    where
14797        T: std::convert::Into<f64>,
14798    {
14799        self.snapshots_to_keep = v.map(|x| x.into());
14800        self
14801    }
14802
14803    /// Sets the value of [minute][crate::model::HourlySchedule::minute].
14804    ///
14805    /// # Example
14806    /// ```ignore,no_run
14807    /// # use google_cloud_netapp_v1::model::HourlySchedule;
14808    /// let x = HourlySchedule::new().set_minute(42.0);
14809    /// ```
14810    pub fn set_minute<T>(mut self, v: T) -> Self
14811    where
14812        T: std::convert::Into<f64>,
14813    {
14814        self.minute = std::option::Option::Some(v.into());
14815        self
14816    }
14817
14818    /// Sets or clears the value of [minute][crate::model::HourlySchedule::minute].
14819    ///
14820    /// # Example
14821    /// ```ignore,no_run
14822    /// # use google_cloud_netapp_v1::model::HourlySchedule;
14823    /// let x = HourlySchedule::new().set_or_clear_minute(Some(42.0));
14824    /// let x = HourlySchedule::new().set_or_clear_minute(None::<f32>);
14825    /// ```
14826    pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
14827    where
14828        T: std::convert::Into<f64>,
14829    {
14830        self.minute = v.map(|x| x.into());
14831        self
14832    }
14833}
14834
14835impl wkt::message::Message for HourlySchedule {
14836    fn typename() -> &'static str {
14837        "type.googleapis.com/google.cloud.netapp.v1.HourlySchedule"
14838    }
14839}
14840
14841/// Make a snapshot every day e.g. at 04:00, 05:20, 23:50
14842#[derive(Clone, Default, PartialEq)]
14843#[non_exhaustive]
14844pub struct DailySchedule {
14845    /// The maximum number of Snapshots to keep for the hourly schedule
14846    pub snapshots_to_keep: std::option::Option<f64>,
14847
14848    /// Set the minute of the hour to start the snapshot (0-59), defaults to the
14849    /// top of the hour (0).
14850    pub minute: std::option::Option<f64>,
14851
14852    /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
14853    pub hour: std::option::Option<f64>,
14854
14855    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14856}
14857
14858impl DailySchedule {
14859    pub fn new() -> Self {
14860        std::default::Default::default()
14861    }
14862
14863    /// Sets the value of [snapshots_to_keep][crate::model::DailySchedule::snapshots_to_keep].
14864    ///
14865    /// # Example
14866    /// ```ignore,no_run
14867    /// # use google_cloud_netapp_v1::model::DailySchedule;
14868    /// let x = DailySchedule::new().set_snapshots_to_keep(42.0);
14869    /// ```
14870    pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
14871    where
14872        T: std::convert::Into<f64>,
14873    {
14874        self.snapshots_to_keep = std::option::Option::Some(v.into());
14875        self
14876    }
14877
14878    /// Sets or clears the value of [snapshots_to_keep][crate::model::DailySchedule::snapshots_to_keep].
14879    ///
14880    /// # Example
14881    /// ```ignore,no_run
14882    /// # use google_cloud_netapp_v1::model::DailySchedule;
14883    /// let x = DailySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
14884    /// let x = DailySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
14885    /// ```
14886    pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
14887    where
14888        T: std::convert::Into<f64>,
14889    {
14890        self.snapshots_to_keep = v.map(|x| x.into());
14891        self
14892    }
14893
14894    /// Sets the value of [minute][crate::model::DailySchedule::minute].
14895    ///
14896    /// # Example
14897    /// ```ignore,no_run
14898    /// # use google_cloud_netapp_v1::model::DailySchedule;
14899    /// let x = DailySchedule::new().set_minute(42.0);
14900    /// ```
14901    pub fn set_minute<T>(mut self, v: T) -> Self
14902    where
14903        T: std::convert::Into<f64>,
14904    {
14905        self.minute = std::option::Option::Some(v.into());
14906        self
14907    }
14908
14909    /// Sets or clears the value of [minute][crate::model::DailySchedule::minute].
14910    ///
14911    /// # Example
14912    /// ```ignore,no_run
14913    /// # use google_cloud_netapp_v1::model::DailySchedule;
14914    /// let x = DailySchedule::new().set_or_clear_minute(Some(42.0));
14915    /// let x = DailySchedule::new().set_or_clear_minute(None::<f32>);
14916    /// ```
14917    pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
14918    where
14919        T: std::convert::Into<f64>,
14920    {
14921        self.minute = v.map(|x| x.into());
14922        self
14923    }
14924
14925    /// Sets the value of [hour][crate::model::DailySchedule::hour].
14926    ///
14927    /// # Example
14928    /// ```ignore,no_run
14929    /// # use google_cloud_netapp_v1::model::DailySchedule;
14930    /// let x = DailySchedule::new().set_hour(42.0);
14931    /// ```
14932    pub fn set_hour<T>(mut self, v: T) -> Self
14933    where
14934        T: std::convert::Into<f64>,
14935    {
14936        self.hour = std::option::Option::Some(v.into());
14937        self
14938    }
14939
14940    /// Sets or clears the value of [hour][crate::model::DailySchedule::hour].
14941    ///
14942    /// # Example
14943    /// ```ignore,no_run
14944    /// # use google_cloud_netapp_v1::model::DailySchedule;
14945    /// let x = DailySchedule::new().set_or_clear_hour(Some(42.0));
14946    /// let x = DailySchedule::new().set_or_clear_hour(None::<f32>);
14947    /// ```
14948    pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
14949    where
14950        T: std::convert::Into<f64>,
14951    {
14952        self.hour = v.map(|x| x.into());
14953        self
14954    }
14955}
14956
14957impl wkt::message::Message for DailySchedule {
14958    fn typename() -> &'static str {
14959        "type.googleapis.com/google.cloud.netapp.v1.DailySchedule"
14960    }
14961}
14962
14963/// Make a snapshot every week e.g. at Monday 04:00, Wednesday 05:20, Sunday
14964/// 23:50
14965#[derive(Clone, Default, PartialEq)]
14966#[non_exhaustive]
14967pub struct WeeklySchedule {
14968    /// The maximum number of Snapshots to keep for the hourly schedule
14969    pub snapshots_to_keep: std::option::Option<f64>,
14970
14971    /// Set the minute of the hour to start the snapshot (0-59), defaults to the
14972    /// top of the hour (0).
14973    pub minute: std::option::Option<f64>,
14974
14975    /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
14976    pub hour: std::option::Option<f64>,
14977
14978    /// Set the day or days of the week to make a snapshot. Accepts a comma
14979    /// separated days of the week. Defaults to 'Sunday'.
14980    pub day: std::option::Option<std::string::String>,
14981
14982    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14983}
14984
14985impl WeeklySchedule {
14986    pub fn new() -> Self {
14987        std::default::Default::default()
14988    }
14989
14990    /// Sets the value of [snapshots_to_keep][crate::model::WeeklySchedule::snapshots_to_keep].
14991    ///
14992    /// # Example
14993    /// ```ignore,no_run
14994    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
14995    /// let x = WeeklySchedule::new().set_snapshots_to_keep(42.0);
14996    /// ```
14997    pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
14998    where
14999        T: std::convert::Into<f64>,
15000    {
15001        self.snapshots_to_keep = std::option::Option::Some(v.into());
15002        self
15003    }
15004
15005    /// Sets or clears the value of [snapshots_to_keep][crate::model::WeeklySchedule::snapshots_to_keep].
15006    ///
15007    /// # Example
15008    /// ```ignore,no_run
15009    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15010    /// let x = WeeklySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
15011    /// let x = WeeklySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
15012    /// ```
15013    pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
15014    where
15015        T: std::convert::Into<f64>,
15016    {
15017        self.snapshots_to_keep = v.map(|x| x.into());
15018        self
15019    }
15020
15021    /// Sets the value of [minute][crate::model::WeeklySchedule::minute].
15022    ///
15023    /// # Example
15024    /// ```ignore,no_run
15025    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15026    /// let x = WeeklySchedule::new().set_minute(42.0);
15027    /// ```
15028    pub fn set_minute<T>(mut self, v: T) -> Self
15029    where
15030        T: std::convert::Into<f64>,
15031    {
15032        self.minute = std::option::Option::Some(v.into());
15033        self
15034    }
15035
15036    /// Sets or clears the value of [minute][crate::model::WeeklySchedule::minute].
15037    ///
15038    /// # Example
15039    /// ```ignore,no_run
15040    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15041    /// let x = WeeklySchedule::new().set_or_clear_minute(Some(42.0));
15042    /// let x = WeeklySchedule::new().set_or_clear_minute(None::<f32>);
15043    /// ```
15044    pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
15045    where
15046        T: std::convert::Into<f64>,
15047    {
15048        self.minute = v.map(|x| x.into());
15049        self
15050    }
15051
15052    /// Sets the value of [hour][crate::model::WeeklySchedule::hour].
15053    ///
15054    /// # Example
15055    /// ```ignore,no_run
15056    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15057    /// let x = WeeklySchedule::new().set_hour(42.0);
15058    /// ```
15059    pub fn set_hour<T>(mut self, v: T) -> Self
15060    where
15061        T: std::convert::Into<f64>,
15062    {
15063        self.hour = std::option::Option::Some(v.into());
15064        self
15065    }
15066
15067    /// Sets or clears the value of [hour][crate::model::WeeklySchedule::hour].
15068    ///
15069    /// # Example
15070    /// ```ignore,no_run
15071    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15072    /// let x = WeeklySchedule::new().set_or_clear_hour(Some(42.0));
15073    /// let x = WeeklySchedule::new().set_or_clear_hour(None::<f32>);
15074    /// ```
15075    pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
15076    where
15077        T: std::convert::Into<f64>,
15078    {
15079        self.hour = v.map(|x| x.into());
15080        self
15081    }
15082
15083    /// Sets the value of [day][crate::model::WeeklySchedule::day].
15084    ///
15085    /// # Example
15086    /// ```ignore,no_run
15087    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15088    /// let x = WeeklySchedule::new().set_day("example");
15089    /// ```
15090    pub fn set_day<T>(mut self, v: T) -> Self
15091    where
15092        T: std::convert::Into<std::string::String>,
15093    {
15094        self.day = std::option::Option::Some(v.into());
15095        self
15096    }
15097
15098    /// Sets or clears the value of [day][crate::model::WeeklySchedule::day].
15099    ///
15100    /// # Example
15101    /// ```ignore,no_run
15102    /// # use google_cloud_netapp_v1::model::WeeklySchedule;
15103    /// let x = WeeklySchedule::new().set_or_clear_day(Some("example"));
15104    /// let x = WeeklySchedule::new().set_or_clear_day(None::<String>);
15105    /// ```
15106    pub fn set_or_clear_day<T>(mut self, v: std::option::Option<T>) -> Self
15107    where
15108        T: std::convert::Into<std::string::String>,
15109    {
15110        self.day = v.map(|x| x.into());
15111        self
15112    }
15113}
15114
15115impl wkt::message::Message for WeeklySchedule {
15116    fn typename() -> &'static str {
15117        "type.googleapis.com/google.cloud.netapp.v1.WeeklySchedule"
15118    }
15119}
15120
15121/// Make a snapshot once a month e.g. at 2nd 04:00, 7th 05:20, 24th 23:50
15122#[derive(Clone, Default, PartialEq)]
15123#[non_exhaustive]
15124pub struct MonthlySchedule {
15125    /// The maximum number of Snapshots to keep for the hourly schedule
15126    pub snapshots_to_keep: std::option::Option<f64>,
15127
15128    /// Set the minute of the hour to start the snapshot (0-59), defaults to the
15129    /// top of the hour (0).
15130    pub minute: std::option::Option<f64>,
15131
15132    /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
15133    pub hour: std::option::Option<f64>,
15134
15135    /// Set the day or days of the month to make a snapshot (1-31). Accepts a
15136    /// comma separated number of days. Defaults to '1'.
15137    pub days_of_month: std::option::Option<std::string::String>,
15138
15139    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15140}
15141
15142impl MonthlySchedule {
15143    pub fn new() -> Self {
15144        std::default::Default::default()
15145    }
15146
15147    /// Sets the value of [snapshots_to_keep][crate::model::MonthlySchedule::snapshots_to_keep].
15148    ///
15149    /// # Example
15150    /// ```ignore,no_run
15151    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15152    /// let x = MonthlySchedule::new().set_snapshots_to_keep(42.0);
15153    /// ```
15154    pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
15155    where
15156        T: std::convert::Into<f64>,
15157    {
15158        self.snapshots_to_keep = std::option::Option::Some(v.into());
15159        self
15160    }
15161
15162    /// Sets or clears the value of [snapshots_to_keep][crate::model::MonthlySchedule::snapshots_to_keep].
15163    ///
15164    /// # Example
15165    /// ```ignore,no_run
15166    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15167    /// let x = MonthlySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
15168    /// let x = MonthlySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
15169    /// ```
15170    pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
15171    where
15172        T: std::convert::Into<f64>,
15173    {
15174        self.snapshots_to_keep = v.map(|x| x.into());
15175        self
15176    }
15177
15178    /// Sets the value of [minute][crate::model::MonthlySchedule::minute].
15179    ///
15180    /// # Example
15181    /// ```ignore,no_run
15182    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15183    /// let x = MonthlySchedule::new().set_minute(42.0);
15184    /// ```
15185    pub fn set_minute<T>(mut self, v: T) -> Self
15186    where
15187        T: std::convert::Into<f64>,
15188    {
15189        self.minute = std::option::Option::Some(v.into());
15190        self
15191    }
15192
15193    /// Sets or clears the value of [minute][crate::model::MonthlySchedule::minute].
15194    ///
15195    /// # Example
15196    /// ```ignore,no_run
15197    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15198    /// let x = MonthlySchedule::new().set_or_clear_minute(Some(42.0));
15199    /// let x = MonthlySchedule::new().set_or_clear_minute(None::<f32>);
15200    /// ```
15201    pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
15202    where
15203        T: std::convert::Into<f64>,
15204    {
15205        self.minute = v.map(|x| x.into());
15206        self
15207    }
15208
15209    /// Sets the value of [hour][crate::model::MonthlySchedule::hour].
15210    ///
15211    /// # Example
15212    /// ```ignore,no_run
15213    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15214    /// let x = MonthlySchedule::new().set_hour(42.0);
15215    /// ```
15216    pub fn set_hour<T>(mut self, v: T) -> Self
15217    where
15218        T: std::convert::Into<f64>,
15219    {
15220        self.hour = std::option::Option::Some(v.into());
15221        self
15222    }
15223
15224    /// Sets or clears the value of [hour][crate::model::MonthlySchedule::hour].
15225    ///
15226    /// # Example
15227    /// ```ignore,no_run
15228    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15229    /// let x = MonthlySchedule::new().set_or_clear_hour(Some(42.0));
15230    /// let x = MonthlySchedule::new().set_or_clear_hour(None::<f32>);
15231    /// ```
15232    pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
15233    where
15234        T: std::convert::Into<f64>,
15235    {
15236        self.hour = v.map(|x| x.into());
15237        self
15238    }
15239
15240    /// Sets the value of [days_of_month][crate::model::MonthlySchedule::days_of_month].
15241    ///
15242    /// # Example
15243    /// ```ignore,no_run
15244    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15245    /// let x = MonthlySchedule::new().set_days_of_month("example");
15246    /// ```
15247    pub fn set_days_of_month<T>(mut self, v: T) -> Self
15248    where
15249        T: std::convert::Into<std::string::String>,
15250    {
15251        self.days_of_month = std::option::Option::Some(v.into());
15252        self
15253    }
15254
15255    /// Sets or clears the value of [days_of_month][crate::model::MonthlySchedule::days_of_month].
15256    ///
15257    /// # Example
15258    /// ```ignore,no_run
15259    /// # use google_cloud_netapp_v1::model::MonthlySchedule;
15260    /// let x = MonthlySchedule::new().set_or_clear_days_of_month(Some("example"));
15261    /// let x = MonthlySchedule::new().set_or_clear_days_of_month(None::<String>);
15262    /// ```
15263    pub fn set_or_clear_days_of_month<T>(mut self, v: std::option::Option<T>) -> Self
15264    where
15265        T: std::convert::Into<std::string::String>,
15266    {
15267        self.days_of_month = v.map(|x| x.into());
15268        self
15269    }
15270}
15271
15272impl wkt::message::Message for MonthlySchedule {
15273    fn typename() -> &'static str {
15274        "type.googleapis.com/google.cloud.netapp.v1.MonthlySchedule"
15275    }
15276}
15277
15278/// View only mount options for a volume.
15279#[derive(Clone, Default, PartialEq)]
15280#[non_exhaustive]
15281pub struct MountOption {
15282    /// Export string
15283    pub export: std::string::String,
15284
15285    /// Full export string
15286    pub export_full: std::string::String,
15287
15288    /// Protocol to mount with.
15289    pub protocol: crate::model::Protocols,
15290
15291    /// Instructions for mounting
15292    pub instructions: std::string::String,
15293
15294    /// Output only. IP Address.
15295    pub ip_address: std::string::String,
15296
15297    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15298}
15299
15300impl MountOption {
15301    pub fn new() -> Self {
15302        std::default::Default::default()
15303    }
15304
15305    /// Sets the value of [export][crate::model::MountOption::export].
15306    ///
15307    /// # Example
15308    /// ```ignore,no_run
15309    /// # use google_cloud_netapp_v1::model::MountOption;
15310    /// let x = MountOption::new().set_export("example");
15311    /// ```
15312    pub fn set_export<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15313        self.export = v.into();
15314        self
15315    }
15316
15317    /// Sets the value of [export_full][crate::model::MountOption::export_full].
15318    ///
15319    /// # Example
15320    /// ```ignore,no_run
15321    /// # use google_cloud_netapp_v1::model::MountOption;
15322    /// let x = MountOption::new().set_export_full("example");
15323    /// ```
15324    pub fn set_export_full<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15325        self.export_full = v.into();
15326        self
15327    }
15328
15329    /// Sets the value of [protocol][crate::model::MountOption::protocol].
15330    ///
15331    /// # Example
15332    /// ```ignore,no_run
15333    /// # use google_cloud_netapp_v1::model::MountOption;
15334    /// use google_cloud_netapp_v1::model::Protocols;
15335    /// let x0 = MountOption::new().set_protocol(Protocols::Nfsv3);
15336    /// let x1 = MountOption::new().set_protocol(Protocols::Nfsv4);
15337    /// let x2 = MountOption::new().set_protocol(Protocols::Smb);
15338    /// ```
15339    pub fn set_protocol<T: std::convert::Into<crate::model::Protocols>>(mut self, v: T) -> Self {
15340        self.protocol = v.into();
15341        self
15342    }
15343
15344    /// Sets the value of [instructions][crate::model::MountOption::instructions].
15345    ///
15346    /// # Example
15347    /// ```ignore,no_run
15348    /// # use google_cloud_netapp_v1::model::MountOption;
15349    /// let x = MountOption::new().set_instructions("example");
15350    /// ```
15351    pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15352        self.instructions = v.into();
15353        self
15354    }
15355
15356    /// Sets the value of [ip_address][crate::model::MountOption::ip_address].
15357    ///
15358    /// # Example
15359    /// ```ignore,no_run
15360    /// # use google_cloud_netapp_v1::model::MountOption;
15361    /// let x = MountOption::new().set_ip_address("example");
15362    /// ```
15363    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15364        self.ip_address = v.into();
15365        self
15366    }
15367}
15368
15369impl wkt::message::Message for MountOption {
15370    fn typename() -> &'static str {
15371        "type.googleapis.com/google.cloud.netapp.v1.MountOption"
15372    }
15373}
15374
15375/// The RestoreParameters if volume is created from a snapshot or backup.
15376#[derive(Clone, Default, PartialEq)]
15377#[non_exhaustive]
15378pub struct RestoreParameters {
15379    /// The source that the volume is created from.
15380    pub source: std::option::Option<crate::model::restore_parameters::Source>,
15381
15382    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15383}
15384
15385impl RestoreParameters {
15386    pub fn new() -> Self {
15387        std::default::Default::default()
15388    }
15389
15390    /// Sets the value of [source][crate::model::RestoreParameters::source].
15391    ///
15392    /// Note that all the setters affecting `source` are mutually
15393    /// exclusive.
15394    ///
15395    /// # Example
15396    /// ```ignore,no_run
15397    /// # use google_cloud_netapp_v1::model::RestoreParameters;
15398    /// use google_cloud_netapp_v1::model::restore_parameters::Source;
15399    /// let x = RestoreParameters::new().set_source(Some(Source::SourceSnapshot("example".to_string())));
15400    /// ```
15401    pub fn set_source<
15402        T: std::convert::Into<std::option::Option<crate::model::restore_parameters::Source>>,
15403    >(
15404        mut self,
15405        v: T,
15406    ) -> Self {
15407        self.source = v.into();
15408        self
15409    }
15410
15411    /// The value of [source][crate::model::RestoreParameters::source]
15412    /// if it holds a `SourceSnapshot`, `None` if the field is not set or
15413    /// holds a different branch.
15414    pub fn source_snapshot(&self) -> std::option::Option<&std::string::String> {
15415        #[allow(unreachable_patterns)]
15416        self.source.as_ref().and_then(|v| match v {
15417            crate::model::restore_parameters::Source::SourceSnapshot(v) => {
15418                std::option::Option::Some(v)
15419            }
15420            _ => std::option::Option::None,
15421        })
15422    }
15423
15424    /// Sets the value of [source][crate::model::RestoreParameters::source]
15425    /// to hold a `SourceSnapshot`.
15426    ///
15427    /// Note that all the setters affecting `source` are
15428    /// mutually exclusive.
15429    ///
15430    /// # Example
15431    /// ```ignore,no_run
15432    /// # use google_cloud_netapp_v1::model::RestoreParameters;
15433    /// let x = RestoreParameters::new().set_source_snapshot("example");
15434    /// assert!(x.source_snapshot().is_some());
15435    /// assert!(x.source_backup().is_none());
15436    /// ```
15437    pub fn set_source_snapshot<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15438        self.source = std::option::Option::Some(
15439            crate::model::restore_parameters::Source::SourceSnapshot(v.into()),
15440        );
15441        self
15442    }
15443
15444    /// The value of [source][crate::model::RestoreParameters::source]
15445    /// if it holds a `SourceBackup`, `None` if the field is not set or
15446    /// holds a different branch.
15447    pub fn source_backup(&self) -> std::option::Option<&std::string::String> {
15448        #[allow(unreachable_patterns)]
15449        self.source.as_ref().and_then(|v| match v {
15450            crate::model::restore_parameters::Source::SourceBackup(v) => {
15451                std::option::Option::Some(v)
15452            }
15453            _ => std::option::Option::None,
15454        })
15455    }
15456
15457    /// Sets the value of [source][crate::model::RestoreParameters::source]
15458    /// to hold a `SourceBackup`.
15459    ///
15460    /// Note that all the setters affecting `source` are
15461    /// mutually exclusive.
15462    ///
15463    /// # Example
15464    /// ```ignore,no_run
15465    /// # use google_cloud_netapp_v1::model::RestoreParameters;
15466    /// let x = RestoreParameters::new().set_source_backup("example");
15467    /// assert!(x.source_backup().is_some());
15468    /// assert!(x.source_snapshot().is_none());
15469    /// ```
15470    pub fn set_source_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15471        self.source = std::option::Option::Some(
15472            crate::model::restore_parameters::Source::SourceBackup(v.into()),
15473        );
15474        self
15475    }
15476}
15477
15478impl wkt::message::Message for RestoreParameters {
15479    fn typename() -> &'static str {
15480        "type.googleapis.com/google.cloud.netapp.v1.RestoreParameters"
15481    }
15482}
15483
15484/// Defines additional types related to [RestoreParameters].
15485pub mod restore_parameters {
15486    #[allow(unused_imports)]
15487    use super::*;
15488
15489    /// The source that the volume is created from.
15490    #[derive(Clone, Debug, PartialEq)]
15491    #[non_exhaustive]
15492    pub enum Source {
15493        /// Full name of the snapshot resource.
15494        /// Format:
15495        /// projects/{project}/locations/{location}/volumes/{volume}/snapshots/{snapshot}
15496        SourceSnapshot(std::string::String),
15497        /// Full name of the backup resource.
15498        /// Format:
15499        /// projects/{project}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}
15500        SourceBackup(std::string::String),
15501    }
15502}
15503
15504/// BackupConfig contains backup related config on a volume.
15505#[derive(Clone, Default, PartialEq)]
15506#[non_exhaustive]
15507pub struct BackupConfig {
15508    /// Optional. When specified, schedule backups will be created based on the
15509    /// policy configuration.
15510    pub backup_policies: std::vec::Vec<std::string::String>,
15511
15512    /// Optional. Name of backup vault.
15513    /// Format:
15514    /// projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}
15515    pub backup_vault: std::string::String,
15516
15517    /// Optional. When set to true, scheduled backup is enabled on the volume.
15518    /// This field should be nil when there's no backup policy attached.
15519    pub scheduled_backup_enabled: std::option::Option<bool>,
15520
15521    /// Output only. Total size of all backups in a chain in bytes = baseline
15522    /// backup size + sum(incremental backup size).
15523    pub backup_chain_bytes: std::option::Option<i64>,
15524
15525    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15526}
15527
15528impl BackupConfig {
15529    pub fn new() -> Self {
15530        std::default::Default::default()
15531    }
15532
15533    /// Sets the value of [backup_policies][crate::model::BackupConfig::backup_policies].
15534    ///
15535    /// # Example
15536    /// ```ignore,no_run
15537    /// # use google_cloud_netapp_v1::model::BackupConfig;
15538    /// let x = BackupConfig::new().set_backup_policies(["a", "b", "c"]);
15539    /// ```
15540    pub fn set_backup_policies<T, V>(mut self, v: T) -> Self
15541    where
15542        T: std::iter::IntoIterator<Item = V>,
15543        V: std::convert::Into<std::string::String>,
15544    {
15545        use std::iter::Iterator;
15546        self.backup_policies = v.into_iter().map(|i| i.into()).collect();
15547        self
15548    }
15549
15550    /// Sets the value of [backup_vault][crate::model::BackupConfig::backup_vault].
15551    ///
15552    /// # Example
15553    /// ```ignore,no_run
15554    /// # use google_cloud_netapp_v1::model::BackupConfig;
15555    /// let x = BackupConfig::new().set_backup_vault("example");
15556    /// ```
15557    pub fn set_backup_vault<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15558        self.backup_vault = v.into();
15559        self
15560    }
15561
15562    /// Sets the value of [scheduled_backup_enabled][crate::model::BackupConfig::scheduled_backup_enabled].
15563    ///
15564    /// # Example
15565    /// ```ignore,no_run
15566    /// # use google_cloud_netapp_v1::model::BackupConfig;
15567    /// let x = BackupConfig::new().set_scheduled_backup_enabled(true);
15568    /// ```
15569    pub fn set_scheduled_backup_enabled<T>(mut self, v: T) -> Self
15570    where
15571        T: std::convert::Into<bool>,
15572    {
15573        self.scheduled_backup_enabled = std::option::Option::Some(v.into());
15574        self
15575    }
15576
15577    /// Sets or clears the value of [scheduled_backup_enabled][crate::model::BackupConfig::scheduled_backup_enabled].
15578    ///
15579    /// # Example
15580    /// ```ignore,no_run
15581    /// # use google_cloud_netapp_v1::model::BackupConfig;
15582    /// let x = BackupConfig::new().set_or_clear_scheduled_backup_enabled(Some(false));
15583    /// let x = BackupConfig::new().set_or_clear_scheduled_backup_enabled(None::<bool>);
15584    /// ```
15585    pub fn set_or_clear_scheduled_backup_enabled<T>(mut self, v: std::option::Option<T>) -> Self
15586    where
15587        T: std::convert::Into<bool>,
15588    {
15589        self.scheduled_backup_enabled = v.map(|x| x.into());
15590        self
15591    }
15592
15593    /// Sets the value of [backup_chain_bytes][crate::model::BackupConfig::backup_chain_bytes].
15594    ///
15595    /// # Example
15596    /// ```ignore,no_run
15597    /// # use google_cloud_netapp_v1::model::BackupConfig;
15598    /// let x = BackupConfig::new().set_backup_chain_bytes(42);
15599    /// ```
15600    pub fn set_backup_chain_bytes<T>(mut self, v: T) -> Self
15601    where
15602        T: std::convert::Into<i64>,
15603    {
15604        self.backup_chain_bytes = std::option::Option::Some(v.into());
15605        self
15606    }
15607
15608    /// Sets or clears the value of [backup_chain_bytes][crate::model::BackupConfig::backup_chain_bytes].
15609    ///
15610    /// # Example
15611    /// ```ignore,no_run
15612    /// # use google_cloud_netapp_v1::model::BackupConfig;
15613    /// let x = BackupConfig::new().set_or_clear_backup_chain_bytes(Some(42));
15614    /// let x = BackupConfig::new().set_or_clear_backup_chain_bytes(None::<i32>);
15615    /// ```
15616    pub fn set_or_clear_backup_chain_bytes<T>(mut self, v: std::option::Option<T>) -> Self
15617    where
15618        T: std::convert::Into<i64>,
15619    {
15620        self.backup_chain_bytes = v.map(|x| x.into());
15621        self
15622    }
15623}
15624
15625impl wkt::message::Message for BackupConfig {
15626    fn typename() -> &'static str {
15627        "type.googleapis.com/google.cloud.netapp.v1.BackupConfig"
15628    }
15629}
15630
15631/// Defines tiering policy for the volume.
15632#[derive(Clone, Default, PartialEq)]
15633#[non_exhaustive]
15634pub struct TieringPolicy {
15635    /// Optional. Flag indicating if the volume has tiering policy enable/pause.
15636    /// Default is PAUSED.
15637    pub tier_action: std::option::Option<crate::model::tiering_policy::TierAction>,
15638
15639    /// Optional. Time in days to mark the volume's data block as cold and make it
15640    /// eligible for tiering, can be range from 2-183. Default is 31.
15641    pub cooling_threshold_days: std::option::Option<i32>,
15642
15643    /// Optional. Flag indicating that the hot tier bypass mode is enabled. Default
15644    /// is false. This is only applicable to Flex service level.
15645    pub hot_tier_bypass_mode_enabled: std::option::Option<bool>,
15646
15647    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15648}
15649
15650impl TieringPolicy {
15651    pub fn new() -> Self {
15652        std::default::Default::default()
15653    }
15654
15655    /// Sets the value of [tier_action][crate::model::TieringPolicy::tier_action].
15656    ///
15657    /// # Example
15658    /// ```ignore,no_run
15659    /// # use google_cloud_netapp_v1::model::TieringPolicy;
15660    /// use google_cloud_netapp_v1::model::tiering_policy::TierAction;
15661    /// let x0 = TieringPolicy::new().set_tier_action(TierAction::Enabled);
15662    /// let x1 = TieringPolicy::new().set_tier_action(TierAction::Paused);
15663    /// ```
15664    pub fn set_tier_action<T>(mut self, v: T) -> Self
15665    where
15666        T: std::convert::Into<crate::model::tiering_policy::TierAction>,
15667    {
15668        self.tier_action = std::option::Option::Some(v.into());
15669        self
15670    }
15671
15672    /// Sets or clears the value of [tier_action][crate::model::TieringPolicy::tier_action].
15673    ///
15674    /// # Example
15675    /// ```ignore,no_run
15676    /// # use google_cloud_netapp_v1::model::TieringPolicy;
15677    /// use google_cloud_netapp_v1::model::tiering_policy::TierAction;
15678    /// let x0 = TieringPolicy::new().set_or_clear_tier_action(Some(TierAction::Enabled));
15679    /// let x1 = TieringPolicy::new().set_or_clear_tier_action(Some(TierAction::Paused));
15680    /// let x_none = TieringPolicy::new().set_or_clear_tier_action(None::<TierAction>);
15681    /// ```
15682    pub fn set_or_clear_tier_action<T>(mut self, v: std::option::Option<T>) -> Self
15683    where
15684        T: std::convert::Into<crate::model::tiering_policy::TierAction>,
15685    {
15686        self.tier_action = v.map(|x| x.into());
15687        self
15688    }
15689
15690    /// Sets the value of [cooling_threshold_days][crate::model::TieringPolicy::cooling_threshold_days].
15691    ///
15692    /// # Example
15693    /// ```ignore,no_run
15694    /// # use google_cloud_netapp_v1::model::TieringPolicy;
15695    /// let x = TieringPolicy::new().set_cooling_threshold_days(42);
15696    /// ```
15697    pub fn set_cooling_threshold_days<T>(mut self, v: T) -> Self
15698    where
15699        T: std::convert::Into<i32>,
15700    {
15701        self.cooling_threshold_days = std::option::Option::Some(v.into());
15702        self
15703    }
15704
15705    /// Sets or clears the value of [cooling_threshold_days][crate::model::TieringPolicy::cooling_threshold_days].
15706    ///
15707    /// # Example
15708    /// ```ignore,no_run
15709    /// # use google_cloud_netapp_v1::model::TieringPolicy;
15710    /// let x = TieringPolicy::new().set_or_clear_cooling_threshold_days(Some(42));
15711    /// let x = TieringPolicy::new().set_or_clear_cooling_threshold_days(None::<i32>);
15712    /// ```
15713    pub fn set_or_clear_cooling_threshold_days<T>(mut self, v: std::option::Option<T>) -> Self
15714    where
15715        T: std::convert::Into<i32>,
15716    {
15717        self.cooling_threshold_days = v.map(|x| x.into());
15718        self
15719    }
15720
15721    /// Sets the value of [hot_tier_bypass_mode_enabled][crate::model::TieringPolicy::hot_tier_bypass_mode_enabled].
15722    ///
15723    /// # Example
15724    /// ```ignore,no_run
15725    /// # use google_cloud_netapp_v1::model::TieringPolicy;
15726    /// let x = TieringPolicy::new().set_hot_tier_bypass_mode_enabled(true);
15727    /// ```
15728    pub fn set_hot_tier_bypass_mode_enabled<T>(mut self, v: T) -> Self
15729    where
15730        T: std::convert::Into<bool>,
15731    {
15732        self.hot_tier_bypass_mode_enabled = std::option::Option::Some(v.into());
15733        self
15734    }
15735
15736    /// Sets or clears the value of [hot_tier_bypass_mode_enabled][crate::model::TieringPolicy::hot_tier_bypass_mode_enabled].
15737    ///
15738    /// # Example
15739    /// ```ignore,no_run
15740    /// # use google_cloud_netapp_v1::model::TieringPolicy;
15741    /// let x = TieringPolicy::new().set_or_clear_hot_tier_bypass_mode_enabled(Some(false));
15742    /// let x = TieringPolicy::new().set_or_clear_hot_tier_bypass_mode_enabled(None::<bool>);
15743    /// ```
15744    pub fn set_or_clear_hot_tier_bypass_mode_enabled<T>(mut self, v: std::option::Option<T>) -> Self
15745    where
15746        T: std::convert::Into<bool>,
15747    {
15748        self.hot_tier_bypass_mode_enabled = v.map(|x| x.into());
15749        self
15750    }
15751}
15752
15753impl wkt::message::Message for TieringPolicy {
15754    fn typename() -> &'static str {
15755        "type.googleapis.com/google.cloud.netapp.v1.TieringPolicy"
15756    }
15757}
15758
15759/// Defines additional types related to [TieringPolicy].
15760pub mod tiering_policy {
15761    #[allow(unused_imports)]
15762    use super::*;
15763
15764    /// Tier action for the volume.
15765    ///
15766    /// # Working with unknown values
15767    ///
15768    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15769    /// additional enum variants at any time. Adding new variants is not considered
15770    /// a breaking change. Applications should write their code in anticipation of:
15771    ///
15772    /// - New values appearing in future releases of the client library, **and**
15773    /// - New values received dynamically, without application changes.
15774    ///
15775    /// Please consult the [Working with enums] section in the user guide for some
15776    /// guidelines.
15777    ///
15778    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15779    #[derive(Clone, Debug, PartialEq)]
15780    #[non_exhaustive]
15781    pub enum TierAction {
15782        /// Unspecified.
15783        Unspecified,
15784        /// When tiering is enabled, new cold data will be tiered.
15785        Enabled,
15786        /// When paused, tiering won't be performed on new data. Existing data stays
15787        /// tiered until accessed.
15788        Paused,
15789        /// If set, the enum was initialized with an unknown value.
15790        ///
15791        /// Applications can examine the value using [TierAction::value] or
15792        /// [TierAction::name].
15793        UnknownValue(tier_action::UnknownValue),
15794    }
15795
15796    #[doc(hidden)]
15797    pub mod tier_action {
15798        #[allow(unused_imports)]
15799        use super::*;
15800        #[derive(Clone, Debug, PartialEq)]
15801        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15802    }
15803
15804    impl TierAction {
15805        /// Gets the enum value.
15806        ///
15807        /// Returns `None` if the enum contains an unknown value deserialized from
15808        /// the string representation of enums.
15809        pub fn value(&self) -> std::option::Option<i32> {
15810            match self {
15811                Self::Unspecified => std::option::Option::Some(0),
15812                Self::Enabled => std::option::Option::Some(1),
15813                Self::Paused => std::option::Option::Some(2),
15814                Self::UnknownValue(u) => u.0.value(),
15815            }
15816        }
15817
15818        /// Gets the enum value as a string.
15819        ///
15820        /// Returns `None` if the enum contains an unknown value deserialized from
15821        /// the integer representation of enums.
15822        pub fn name(&self) -> std::option::Option<&str> {
15823            match self {
15824                Self::Unspecified => std::option::Option::Some("TIER_ACTION_UNSPECIFIED"),
15825                Self::Enabled => std::option::Option::Some("ENABLED"),
15826                Self::Paused => std::option::Option::Some("PAUSED"),
15827                Self::UnknownValue(u) => u.0.name(),
15828            }
15829        }
15830    }
15831
15832    impl std::default::Default for TierAction {
15833        fn default() -> Self {
15834            use std::convert::From;
15835            Self::from(0)
15836        }
15837    }
15838
15839    impl std::fmt::Display for TierAction {
15840        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15841            wkt::internal::display_enum(f, self.name(), self.value())
15842        }
15843    }
15844
15845    impl std::convert::From<i32> for TierAction {
15846        fn from(value: i32) -> Self {
15847            match value {
15848                0 => Self::Unspecified,
15849                1 => Self::Enabled,
15850                2 => Self::Paused,
15851                _ => Self::UnknownValue(tier_action::UnknownValue(
15852                    wkt::internal::UnknownEnumValue::Integer(value),
15853                )),
15854            }
15855        }
15856    }
15857
15858    impl std::convert::From<&str> for TierAction {
15859        fn from(value: &str) -> Self {
15860            use std::string::ToString;
15861            match value {
15862                "TIER_ACTION_UNSPECIFIED" => Self::Unspecified,
15863                "ENABLED" => Self::Enabled,
15864                "PAUSED" => Self::Paused,
15865                _ => Self::UnknownValue(tier_action::UnknownValue(
15866                    wkt::internal::UnknownEnumValue::String(value.to_string()),
15867                )),
15868            }
15869        }
15870    }
15871
15872    impl serde::ser::Serialize for TierAction {
15873        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15874        where
15875            S: serde::Serializer,
15876        {
15877            match self {
15878                Self::Unspecified => serializer.serialize_i32(0),
15879                Self::Enabled => serializer.serialize_i32(1),
15880                Self::Paused => serializer.serialize_i32(2),
15881                Self::UnknownValue(u) => u.0.serialize(serializer),
15882            }
15883        }
15884    }
15885
15886    impl<'de> serde::de::Deserialize<'de> for TierAction {
15887        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15888        where
15889            D: serde::Deserializer<'de>,
15890        {
15891            deserializer.deserialize_any(wkt::internal::EnumVisitor::<TierAction>::new(
15892                ".google.cloud.netapp.v1.TieringPolicy.TierAction",
15893            ))
15894        }
15895    }
15896}
15897
15898/// The Hybrid Replication parameters for the volume.
15899#[derive(Clone, Default, PartialEq)]
15900#[non_exhaustive]
15901pub struct HybridReplicationParameters {
15902    /// Required. Desired name for the replication of this volume.
15903    pub replication: std::string::String,
15904
15905    /// Required. Name of the user's local source volume to be peered with the
15906    /// destination volume.
15907    pub peer_volume_name: std::string::String,
15908
15909    /// Required. Name of the user's local source cluster to be peered with the
15910    /// destination cluster.
15911    pub peer_cluster_name: std::string::String,
15912
15913    /// Required. Name of the user's local source vserver svm to be peered with the
15914    /// destination vserver svm.
15915    pub peer_svm_name: std::string::String,
15916
15917    /// Required. List of node ip addresses to be peered with.
15918    pub peer_ip_addresses: std::vec::Vec<std::string::String>,
15919
15920    /// Optional. Name of source cluster location associated with the Hybrid
15921    /// replication. This is a free-form field for the display purpose only.
15922    pub cluster_location: std::string::String,
15923
15924    /// Optional. Description of the replication.
15925    pub description: std::string::String,
15926
15927    /// Optional. Labels to be added to the replication as the key value pairs.
15928    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
15929
15930    /// Optional. Replication Schedule for the replication created.
15931    pub replication_schedule: crate::model::HybridReplicationSchedule,
15932
15933    /// Optional. Type of the hybrid replication.
15934    pub hybrid_replication_type:
15935        crate::model::hybrid_replication_parameters::VolumeHybridReplicationType,
15936
15937    /// Optional. Constituent volume count for large volume.
15938    pub large_volume_constituent_count: i32,
15939
15940    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
15941}
15942
15943impl HybridReplicationParameters {
15944    pub fn new() -> Self {
15945        std::default::Default::default()
15946    }
15947
15948    /// Sets the value of [replication][crate::model::HybridReplicationParameters::replication].
15949    ///
15950    /// # Example
15951    /// ```ignore,no_run
15952    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
15953    /// let x = HybridReplicationParameters::new().set_replication("example");
15954    /// ```
15955    pub fn set_replication<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15956        self.replication = v.into();
15957        self
15958    }
15959
15960    /// Sets the value of [peer_volume_name][crate::model::HybridReplicationParameters::peer_volume_name].
15961    ///
15962    /// # Example
15963    /// ```ignore,no_run
15964    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
15965    /// let x = HybridReplicationParameters::new().set_peer_volume_name("example");
15966    /// ```
15967    pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
15968        mut self,
15969        v: T,
15970    ) -> Self {
15971        self.peer_volume_name = v.into();
15972        self
15973    }
15974
15975    /// Sets the value of [peer_cluster_name][crate::model::HybridReplicationParameters::peer_cluster_name].
15976    ///
15977    /// # Example
15978    /// ```ignore,no_run
15979    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
15980    /// let x = HybridReplicationParameters::new().set_peer_cluster_name("example");
15981    /// ```
15982    pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
15983        mut self,
15984        v: T,
15985    ) -> Self {
15986        self.peer_cluster_name = v.into();
15987        self
15988    }
15989
15990    /// Sets the value of [peer_svm_name][crate::model::HybridReplicationParameters::peer_svm_name].
15991    ///
15992    /// # Example
15993    /// ```ignore,no_run
15994    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
15995    /// let x = HybridReplicationParameters::new().set_peer_svm_name("example");
15996    /// ```
15997    pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
15998        self.peer_svm_name = v.into();
15999        self
16000    }
16001
16002    /// Sets the value of [peer_ip_addresses][crate::model::HybridReplicationParameters::peer_ip_addresses].
16003    ///
16004    /// # Example
16005    /// ```ignore,no_run
16006    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16007    /// let x = HybridReplicationParameters::new().set_peer_ip_addresses(["a", "b", "c"]);
16008    /// ```
16009    pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
16010    where
16011        T: std::iter::IntoIterator<Item = V>,
16012        V: std::convert::Into<std::string::String>,
16013    {
16014        use std::iter::Iterator;
16015        self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
16016        self
16017    }
16018
16019    /// Sets the value of [cluster_location][crate::model::HybridReplicationParameters::cluster_location].
16020    ///
16021    /// # Example
16022    /// ```ignore,no_run
16023    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16024    /// let x = HybridReplicationParameters::new().set_cluster_location("example");
16025    /// ```
16026    pub fn set_cluster_location<T: std::convert::Into<std::string::String>>(
16027        mut self,
16028        v: T,
16029    ) -> Self {
16030        self.cluster_location = v.into();
16031        self
16032    }
16033
16034    /// Sets the value of [description][crate::model::HybridReplicationParameters::description].
16035    ///
16036    /// # Example
16037    /// ```ignore,no_run
16038    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16039    /// let x = HybridReplicationParameters::new().set_description("example");
16040    /// ```
16041    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16042        self.description = v.into();
16043        self
16044    }
16045
16046    /// Sets the value of [labels][crate::model::HybridReplicationParameters::labels].
16047    ///
16048    /// # Example
16049    /// ```ignore,no_run
16050    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16051    /// let x = HybridReplicationParameters::new().set_labels([
16052    ///     ("key0", "abc"),
16053    ///     ("key1", "xyz"),
16054    /// ]);
16055    /// ```
16056    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
16057    where
16058        T: std::iter::IntoIterator<Item = (K, V)>,
16059        K: std::convert::Into<std::string::String>,
16060        V: std::convert::Into<std::string::String>,
16061    {
16062        use std::iter::Iterator;
16063        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
16064        self
16065    }
16066
16067    /// Sets the value of [replication_schedule][crate::model::HybridReplicationParameters::replication_schedule].
16068    ///
16069    /// # Example
16070    /// ```ignore,no_run
16071    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16072    /// use google_cloud_netapp_v1::model::HybridReplicationSchedule;
16073    /// let x0 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Every10Minutes);
16074    /// let x1 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Hourly);
16075    /// let x2 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Daily);
16076    /// ```
16077    pub fn set_replication_schedule<
16078        T: std::convert::Into<crate::model::HybridReplicationSchedule>,
16079    >(
16080        mut self,
16081        v: T,
16082    ) -> Self {
16083        self.replication_schedule = v.into();
16084        self
16085    }
16086
16087    /// Sets the value of [hybrid_replication_type][crate::model::HybridReplicationParameters::hybrid_replication_type].
16088    ///
16089    /// # Example
16090    /// ```ignore,no_run
16091    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16092    /// use google_cloud_netapp_v1::model::hybrid_replication_parameters::VolumeHybridReplicationType;
16093    /// let x0 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::Migration);
16094    /// let x1 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::ContinuousReplication);
16095    /// let x2 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::OnpremReplication);
16096    /// ```
16097    pub fn set_hybrid_replication_type<
16098        T: std::convert::Into<
16099                crate::model::hybrid_replication_parameters::VolumeHybridReplicationType,
16100            >,
16101    >(
16102        mut self,
16103        v: T,
16104    ) -> Self {
16105        self.hybrid_replication_type = v.into();
16106        self
16107    }
16108
16109    /// Sets the value of [large_volume_constituent_count][crate::model::HybridReplicationParameters::large_volume_constituent_count].
16110    ///
16111    /// # Example
16112    /// ```ignore,no_run
16113    /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
16114    /// let x = HybridReplicationParameters::new().set_large_volume_constituent_count(42);
16115    /// ```
16116    pub fn set_large_volume_constituent_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
16117        self.large_volume_constituent_count = v.into();
16118        self
16119    }
16120}
16121
16122impl wkt::message::Message for HybridReplicationParameters {
16123    fn typename() -> &'static str {
16124        "type.googleapis.com/google.cloud.netapp.v1.HybridReplicationParameters"
16125    }
16126}
16127
16128/// Defines additional types related to [HybridReplicationParameters].
16129pub mod hybrid_replication_parameters {
16130    #[allow(unused_imports)]
16131    use super::*;
16132
16133    /// Type of the volume's hybrid replication.
16134    ///
16135    /// # Working with unknown values
16136    ///
16137    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16138    /// additional enum variants at any time. Adding new variants is not considered
16139    /// a breaking change. Applications should write their code in anticipation of:
16140    ///
16141    /// - New values appearing in future releases of the client library, **and**
16142    /// - New values received dynamically, without application changes.
16143    ///
16144    /// Please consult the [Working with enums] section in the user guide for some
16145    /// guidelines.
16146    ///
16147    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16148    #[derive(Clone, Debug, PartialEq)]
16149    #[non_exhaustive]
16150    pub enum VolumeHybridReplicationType {
16151        /// Unspecified hybrid replication type.
16152        Unspecified,
16153        /// Hybrid replication type for migration.
16154        Migration,
16155        /// Hybrid replication type for continuous replication.
16156        ContinuousReplication,
16157        /// New field for reversible OnPrem replication, to be used for data
16158        /// protection.
16159        OnpremReplication,
16160        /// New field for reversible OnPrem replication, to be used for data
16161        /// protection.
16162        ReverseOnpremReplication,
16163        /// If set, the enum was initialized with an unknown value.
16164        ///
16165        /// Applications can examine the value using [VolumeHybridReplicationType::value] or
16166        /// [VolumeHybridReplicationType::name].
16167        UnknownValue(volume_hybrid_replication_type::UnknownValue),
16168    }
16169
16170    #[doc(hidden)]
16171    pub mod volume_hybrid_replication_type {
16172        #[allow(unused_imports)]
16173        use super::*;
16174        #[derive(Clone, Debug, PartialEq)]
16175        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16176    }
16177
16178    impl VolumeHybridReplicationType {
16179        /// Gets the enum value.
16180        ///
16181        /// Returns `None` if the enum contains an unknown value deserialized from
16182        /// the string representation of enums.
16183        pub fn value(&self) -> std::option::Option<i32> {
16184            match self {
16185                Self::Unspecified => std::option::Option::Some(0),
16186                Self::Migration => std::option::Option::Some(1),
16187                Self::ContinuousReplication => std::option::Option::Some(2),
16188                Self::OnpremReplication => std::option::Option::Some(3),
16189                Self::ReverseOnpremReplication => std::option::Option::Some(4),
16190                Self::UnknownValue(u) => u.0.value(),
16191            }
16192        }
16193
16194        /// Gets the enum value as a string.
16195        ///
16196        /// Returns `None` if the enum contains an unknown value deserialized from
16197        /// the integer representation of enums.
16198        pub fn name(&self) -> std::option::Option<&str> {
16199            match self {
16200                Self::Unspecified => {
16201                    std::option::Option::Some("VOLUME_HYBRID_REPLICATION_TYPE_UNSPECIFIED")
16202                }
16203                Self::Migration => std::option::Option::Some("MIGRATION"),
16204                Self::ContinuousReplication => std::option::Option::Some("CONTINUOUS_REPLICATION"),
16205                Self::OnpremReplication => std::option::Option::Some("ONPREM_REPLICATION"),
16206                Self::ReverseOnpremReplication => {
16207                    std::option::Option::Some("REVERSE_ONPREM_REPLICATION")
16208                }
16209                Self::UnknownValue(u) => u.0.name(),
16210            }
16211        }
16212    }
16213
16214    impl std::default::Default for VolumeHybridReplicationType {
16215        fn default() -> Self {
16216            use std::convert::From;
16217            Self::from(0)
16218        }
16219    }
16220
16221    impl std::fmt::Display for VolumeHybridReplicationType {
16222        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16223            wkt::internal::display_enum(f, self.name(), self.value())
16224        }
16225    }
16226
16227    impl std::convert::From<i32> for VolumeHybridReplicationType {
16228        fn from(value: i32) -> Self {
16229            match value {
16230                0 => Self::Unspecified,
16231                1 => Self::Migration,
16232                2 => Self::ContinuousReplication,
16233                3 => Self::OnpremReplication,
16234                4 => Self::ReverseOnpremReplication,
16235                _ => Self::UnknownValue(volume_hybrid_replication_type::UnknownValue(
16236                    wkt::internal::UnknownEnumValue::Integer(value),
16237                )),
16238            }
16239        }
16240    }
16241
16242    impl std::convert::From<&str> for VolumeHybridReplicationType {
16243        fn from(value: &str) -> Self {
16244            use std::string::ToString;
16245            match value {
16246                "VOLUME_HYBRID_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
16247                "MIGRATION" => Self::Migration,
16248                "CONTINUOUS_REPLICATION" => Self::ContinuousReplication,
16249                "ONPREM_REPLICATION" => Self::OnpremReplication,
16250                "REVERSE_ONPREM_REPLICATION" => Self::ReverseOnpremReplication,
16251                _ => Self::UnknownValue(volume_hybrid_replication_type::UnknownValue(
16252                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16253                )),
16254            }
16255        }
16256    }
16257
16258    impl serde::ser::Serialize for VolumeHybridReplicationType {
16259        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16260        where
16261            S: serde::Serializer,
16262        {
16263            match self {
16264                Self::Unspecified => serializer.serialize_i32(0),
16265                Self::Migration => serializer.serialize_i32(1),
16266                Self::ContinuousReplication => serializer.serialize_i32(2),
16267                Self::OnpremReplication => serializer.serialize_i32(3),
16268                Self::ReverseOnpremReplication => serializer.serialize_i32(4),
16269                Self::UnknownValue(u) => u.0.serialize(serializer),
16270            }
16271        }
16272    }
16273
16274    impl<'de> serde::de::Deserialize<'de> for VolumeHybridReplicationType {
16275        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16276        where
16277            D: serde::Deserializer<'de>,
16278        {
16279            deserializer.deserialize_any(wkt::internal::EnumVisitor::<VolumeHybridReplicationType>::new(
16280                ".google.cloud.netapp.v1.HybridReplicationParameters.VolumeHybridReplicationType"))
16281        }
16282    }
16283}
16284
16285/// Cache Parameters for the volume.
16286#[derive(Clone, Default, PartialEq)]
16287#[non_exhaustive]
16288pub struct CacheParameters {
16289    /// Required. Name of the origin volume for the cache volume.
16290    pub peer_volume_name: std::string::String,
16291
16292    /// Required. Name of the origin volume's ONTAP cluster.
16293    pub peer_cluster_name: std::string::String,
16294
16295    /// Required. Name of the origin volume's SVM.
16296    pub peer_svm_name: std::string::String,
16297
16298    /// Required. List of IC LIF addresses of the origin volume's ONTAP cluster.
16299    pub peer_ip_addresses: std::vec::Vec<std::string::String>,
16300
16301    /// Optional. Indicates whether the cache volume has global file lock enabled.
16302    pub enable_global_file_lock: std::option::Option<bool>,
16303
16304    /// Optional. Configuration of the cache volume.
16305    pub cache_config: std::option::Option<crate::model::CacheConfig>,
16306
16307    /// Output only. State of the cache volume indicating the peering status.
16308    pub cache_state: crate::model::cache_parameters::CacheState,
16309
16310    /// Output only. Copy-paste-able commands to be used on user's ONTAP to accept
16311    /// peering requests.
16312    pub command: std::string::String,
16313
16314    /// Optional. Expiration time for the peering command to be executed on user's
16315    /// ONTAP.
16316    pub peering_command_expiry_time: std::option::Option<wkt::Timestamp>,
16317
16318    /// Output only. Temporary passphrase generated to accept cluster peering
16319    /// command.
16320    pub passphrase: std::string::String,
16321
16322    /// Output only. Detailed description of the current cache state.
16323    pub state_details: std::string::String,
16324
16325    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16326}
16327
16328impl CacheParameters {
16329    pub fn new() -> Self {
16330        std::default::Default::default()
16331    }
16332
16333    /// Sets the value of [peer_volume_name][crate::model::CacheParameters::peer_volume_name].
16334    ///
16335    /// # Example
16336    /// ```ignore,no_run
16337    /// # use google_cloud_netapp_v1::model::CacheParameters;
16338    /// let x = CacheParameters::new().set_peer_volume_name("example");
16339    /// ```
16340    pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
16341        mut self,
16342        v: T,
16343    ) -> Self {
16344        self.peer_volume_name = v.into();
16345        self
16346    }
16347
16348    /// Sets the value of [peer_cluster_name][crate::model::CacheParameters::peer_cluster_name].
16349    ///
16350    /// # Example
16351    /// ```ignore,no_run
16352    /// # use google_cloud_netapp_v1::model::CacheParameters;
16353    /// let x = CacheParameters::new().set_peer_cluster_name("example");
16354    /// ```
16355    pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
16356        mut self,
16357        v: T,
16358    ) -> Self {
16359        self.peer_cluster_name = v.into();
16360        self
16361    }
16362
16363    /// Sets the value of [peer_svm_name][crate::model::CacheParameters::peer_svm_name].
16364    ///
16365    /// # Example
16366    /// ```ignore,no_run
16367    /// # use google_cloud_netapp_v1::model::CacheParameters;
16368    /// let x = CacheParameters::new().set_peer_svm_name("example");
16369    /// ```
16370    pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16371        self.peer_svm_name = v.into();
16372        self
16373    }
16374
16375    /// Sets the value of [peer_ip_addresses][crate::model::CacheParameters::peer_ip_addresses].
16376    ///
16377    /// # Example
16378    /// ```ignore,no_run
16379    /// # use google_cloud_netapp_v1::model::CacheParameters;
16380    /// let x = CacheParameters::new().set_peer_ip_addresses(["a", "b", "c"]);
16381    /// ```
16382    pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
16383    where
16384        T: std::iter::IntoIterator<Item = V>,
16385        V: std::convert::Into<std::string::String>,
16386    {
16387        use std::iter::Iterator;
16388        self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
16389        self
16390    }
16391
16392    /// Sets the value of [enable_global_file_lock][crate::model::CacheParameters::enable_global_file_lock].
16393    ///
16394    /// # Example
16395    /// ```ignore,no_run
16396    /// # use google_cloud_netapp_v1::model::CacheParameters;
16397    /// let x = CacheParameters::new().set_enable_global_file_lock(true);
16398    /// ```
16399    pub fn set_enable_global_file_lock<T>(mut self, v: T) -> Self
16400    where
16401        T: std::convert::Into<bool>,
16402    {
16403        self.enable_global_file_lock = std::option::Option::Some(v.into());
16404        self
16405    }
16406
16407    /// Sets or clears the value of [enable_global_file_lock][crate::model::CacheParameters::enable_global_file_lock].
16408    ///
16409    /// # Example
16410    /// ```ignore,no_run
16411    /// # use google_cloud_netapp_v1::model::CacheParameters;
16412    /// let x = CacheParameters::new().set_or_clear_enable_global_file_lock(Some(false));
16413    /// let x = CacheParameters::new().set_or_clear_enable_global_file_lock(None::<bool>);
16414    /// ```
16415    pub fn set_or_clear_enable_global_file_lock<T>(mut self, v: std::option::Option<T>) -> Self
16416    where
16417        T: std::convert::Into<bool>,
16418    {
16419        self.enable_global_file_lock = v.map(|x| x.into());
16420        self
16421    }
16422
16423    /// Sets the value of [cache_config][crate::model::CacheParameters::cache_config].
16424    ///
16425    /// # Example
16426    /// ```ignore,no_run
16427    /// # use google_cloud_netapp_v1::model::CacheParameters;
16428    /// use google_cloud_netapp_v1::model::CacheConfig;
16429    /// let x = CacheParameters::new().set_cache_config(CacheConfig::default()/* use setters */);
16430    /// ```
16431    pub fn set_cache_config<T>(mut self, v: T) -> Self
16432    where
16433        T: std::convert::Into<crate::model::CacheConfig>,
16434    {
16435        self.cache_config = std::option::Option::Some(v.into());
16436        self
16437    }
16438
16439    /// Sets or clears the value of [cache_config][crate::model::CacheParameters::cache_config].
16440    ///
16441    /// # Example
16442    /// ```ignore,no_run
16443    /// # use google_cloud_netapp_v1::model::CacheParameters;
16444    /// use google_cloud_netapp_v1::model::CacheConfig;
16445    /// let x = CacheParameters::new().set_or_clear_cache_config(Some(CacheConfig::default()/* use setters */));
16446    /// let x = CacheParameters::new().set_or_clear_cache_config(None::<CacheConfig>);
16447    /// ```
16448    pub fn set_or_clear_cache_config<T>(mut self, v: std::option::Option<T>) -> Self
16449    where
16450        T: std::convert::Into<crate::model::CacheConfig>,
16451    {
16452        self.cache_config = v.map(|x| x.into());
16453        self
16454    }
16455
16456    /// Sets the value of [cache_state][crate::model::CacheParameters::cache_state].
16457    ///
16458    /// # Example
16459    /// ```ignore,no_run
16460    /// # use google_cloud_netapp_v1::model::CacheParameters;
16461    /// use google_cloud_netapp_v1::model::cache_parameters::CacheState;
16462    /// let x0 = CacheParameters::new().set_cache_state(CacheState::PendingClusterPeering);
16463    /// let x1 = CacheParameters::new().set_cache_state(CacheState::PendingSvmPeering);
16464    /// let x2 = CacheParameters::new().set_cache_state(CacheState::Peered);
16465    /// ```
16466    pub fn set_cache_state<T: std::convert::Into<crate::model::cache_parameters::CacheState>>(
16467        mut self,
16468        v: T,
16469    ) -> Self {
16470        self.cache_state = v.into();
16471        self
16472    }
16473
16474    /// Sets the value of [command][crate::model::CacheParameters::command].
16475    ///
16476    /// # Example
16477    /// ```ignore,no_run
16478    /// # use google_cloud_netapp_v1::model::CacheParameters;
16479    /// let x = CacheParameters::new().set_command("example");
16480    /// ```
16481    pub fn set_command<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16482        self.command = v.into();
16483        self
16484    }
16485
16486    /// Sets the value of [peering_command_expiry_time][crate::model::CacheParameters::peering_command_expiry_time].
16487    ///
16488    /// # Example
16489    /// ```ignore,no_run
16490    /// # use google_cloud_netapp_v1::model::CacheParameters;
16491    /// use wkt::Timestamp;
16492    /// let x = CacheParameters::new().set_peering_command_expiry_time(Timestamp::default()/* use setters */);
16493    /// ```
16494    pub fn set_peering_command_expiry_time<T>(mut self, v: T) -> Self
16495    where
16496        T: std::convert::Into<wkt::Timestamp>,
16497    {
16498        self.peering_command_expiry_time = std::option::Option::Some(v.into());
16499        self
16500    }
16501
16502    /// Sets or clears the value of [peering_command_expiry_time][crate::model::CacheParameters::peering_command_expiry_time].
16503    ///
16504    /// # Example
16505    /// ```ignore,no_run
16506    /// # use google_cloud_netapp_v1::model::CacheParameters;
16507    /// use wkt::Timestamp;
16508    /// let x = CacheParameters::new().set_or_clear_peering_command_expiry_time(Some(Timestamp::default()/* use setters */));
16509    /// let x = CacheParameters::new().set_or_clear_peering_command_expiry_time(None::<Timestamp>);
16510    /// ```
16511    pub fn set_or_clear_peering_command_expiry_time<T>(mut self, v: std::option::Option<T>) -> Self
16512    where
16513        T: std::convert::Into<wkt::Timestamp>,
16514    {
16515        self.peering_command_expiry_time = v.map(|x| x.into());
16516        self
16517    }
16518
16519    /// Sets the value of [passphrase][crate::model::CacheParameters::passphrase].
16520    ///
16521    /// # Example
16522    /// ```ignore,no_run
16523    /// # use google_cloud_netapp_v1::model::CacheParameters;
16524    /// let x = CacheParameters::new().set_passphrase("example");
16525    /// ```
16526    pub fn set_passphrase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16527        self.passphrase = v.into();
16528        self
16529    }
16530
16531    /// Sets the value of [state_details][crate::model::CacheParameters::state_details].
16532    ///
16533    /// # Example
16534    /// ```ignore,no_run
16535    /// # use google_cloud_netapp_v1::model::CacheParameters;
16536    /// let x = CacheParameters::new().set_state_details("example");
16537    /// ```
16538    pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
16539        self.state_details = v.into();
16540        self
16541    }
16542}
16543
16544impl wkt::message::Message for CacheParameters {
16545    fn typename() -> &'static str {
16546        "type.googleapis.com/google.cloud.netapp.v1.CacheParameters"
16547    }
16548}
16549
16550/// Defines additional types related to [CacheParameters].
16551pub mod cache_parameters {
16552    #[allow(unused_imports)]
16553    use super::*;
16554
16555    /// State of the cache volume indicating the peering status.
16556    ///
16557    /// # Working with unknown values
16558    ///
16559    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16560    /// additional enum variants at any time. Adding new variants is not considered
16561    /// a breaking change. Applications should write their code in anticipation of:
16562    ///
16563    /// - New values appearing in future releases of the client library, **and**
16564    /// - New values received dynamically, without application changes.
16565    ///
16566    /// Please consult the [Working with enums] section in the user guide for some
16567    /// guidelines.
16568    ///
16569    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16570    #[derive(Clone, Debug, PartialEq)]
16571    #[non_exhaustive]
16572    pub enum CacheState {
16573        /// Default unspecified state.
16574        Unspecified,
16575        /// State indicating waiting for cluster peering to be established.
16576        PendingClusterPeering,
16577        /// State indicating waiting for SVM peering to be established.
16578        PendingSvmPeering,
16579        /// State indicating successful establishment of peering with origin
16580        /// volumes's ONTAP cluster.
16581        Peered,
16582        /// Terminal state wherein peering with origin volume's ONTAP cluster
16583        /// has failed.
16584        Error,
16585        /// If set, the enum was initialized with an unknown value.
16586        ///
16587        /// Applications can examine the value using [CacheState::value] or
16588        /// [CacheState::name].
16589        UnknownValue(cache_state::UnknownValue),
16590    }
16591
16592    #[doc(hidden)]
16593    pub mod cache_state {
16594        #[allow(unused_imports)]
16595        use super::*;
16596        #[derive(Clone, Debug, PartialEq)]
16597        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16598    }
16599
16600    impl CacheState {
16601        /// Gets the enum value.
16602        ///
16603        /// Returns `None` if the enum contains an unknown value deserialized from
16604        /// the string representation of enums.
16605        pub fn value(&self) -> std::option::Option<i32> {
16606            match self {
16607                Self::Unspecified => std::option::Option::Some(0),
16608                Self::PendingClusterPeering => std::option::Option::Some(1),
16609                Self::PendingSvmPeering => std::option::Option::Some(2),
16610                Self::Peered => std::option::Option::Some(3),
16611                Self::Error => std::option::Option::Some(4),
16612                Self::UnknownValue(u) => u.0.value(),
16613            }
16614        }
16615
16616        /// Gets the enum value as a string.
16617        ///
16618        /// Returns `None` if the enum contains an unknown value deserialized from
16619        /// the integer representation of enums.
16620        pub fn name(&self) -> std::option::Option<&str> {
16621            match self {
16622                Self::Unspecified => std::option::Option::Some("CACHE_STATE_UNSPECIFIED"),
16623                Self::PendingClusterPeering => std::option::Option::Some("PENDING_CLUSTER_PEERING"),
16624                Self::PendingSvmPeering => std::option::Option::Some("PENDING_SVM_PEERING"),
16625                Self::Peered => std::option::Option::Some("PEERED"),
16626                Self::Error => std::option::Option::Some("ERROR"),
16627                Self::UnknownValue(u) => u.0.name(),
16628            }
16629        }
16630    }
16631
16632    impl std::default::Default for CacheState {
16633        fn default() -> Self {
16634            use std::convert::From;
16635            Self::from(0)
16636        }
16637    }
16638
16639    impl std::fmt::Display for CacheState {
16640        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16641            wkt::internal::display_enum(f, self.name(), self.value())
16642        }
16643    }
16644
16645    impl std::convert::From<i32> for CacheState {
16646        fn from(value: i32) -> Self {
16647            match value {
16648                0 => Self::Unspecified,
16649                1 => Self::PendingClusterPeering,
16650                2 => Self::PendingSvmPeering,
16651                3 => Self::Peered,
16652                4 => Self::Error,
16653                _ => Self::UnknownValue(cache_state::UnknownValue(
16654                    wkt::internal::UnknownEnumValue::Integer(value),
16655                )),
16656            }
16657        }
16658    }
16659
16660    impl std::convert::From<&str> for CacheState {
16661        fn from(value: &str) -> Self {
16662            use std::string::ToString;
16663            match value {
16664                "CACHE_STATE_UNSPECIFIED" => Self::Unspecified,
16665                "PENDING_CLUSTER_PEERING" => Self::PendingClusterPeering,
16666                "PENDING_SVM_PEERING" => Self::PendingSvmPeering,
16667                "PEERED" => Self::Peered,
16668                "ERROR" => Self::Error,
16669                _ => Self::UnknownValue(cache_state::UnknownValue(
16670                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16671                )),
16672            }
16673        }
16674    }
16675
16676    impl serde::ser::Serialize for CacheState {
16677        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16678        where
16679            S: serde::Serializer,
16680        {
16681            match self {
16682                Self::Unspecified => serializer.serialize_i32(0),
16683                Self::PendingClusterPeering => serializer.serialize_i32(1),
16684                Self::PendingSvmPeering => serializer.serialize_i32(2),
16685                Self::Peered => serializer.serialize_i32(3),
16686                Self::Error => serializer.serialize_i32(4),
16687                Self::UnknownValue(u) => u.0.serialize(serializer),
16688            }
16689        }
16690    }
16691
16692    impl<'de> serde::de::Deserialize<'de> for CacheState {
16693        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16694        where
16695            D: serde::Deserializer<'de>,
16696        {
16697            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CacheState>::new(
16698                ".google.cloud.netapp.v1.CacheParameters.CacheState",
16699            ))
16700        }
16701    }
16702}
16703
16704/// Configuration of the cache volume.
16705#[derive(Clone, Default, PartialEq)]
16706#[non_exhaustive]
16707pub struct CacheConfig {
16708    /// Optional. Pre-populate cache volume with data from the origin volume.
16709    pub cache_pre_populate: std::option::Option<crate::model::CachePrePopulate>,
16710
16711    /// Optional. Flag indicating whether writeback is enabled for the FlexCache
16712    /// volume.
16713    pub writeback_enabled: std::option::Option<bool>,
16714
16715    /// Optional. Flag indicating whether a CIFS change notification is enabled for
16716    /// the FlexCache volume.
16717    pub cifs_change_notify_enabled: std::option::Option<bool>,
16718
16719    /// Output only. State of the prepopulation job indicating how the
16720    /// prepopulation is progressing.
16721    pub cache_pre_populate_state: crate::model::cache_config::CachePrePopulateState,
16722
16723    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
16724}
16725
16726impl CacheConfig {
16727    pub fn new() -> Self {
16728        std::default::Default::default()
16729    }
16730
16731    /// Sets the value of [cache_pre_populate][crate::model::CacheConfig::cache_pre_populate].
16732    ///
16733    /// # Example
16734    /// ```ignore,no_run
16735    /// # use google_cloud_netapp_v1::model::CacheConfig;
16736    /// use google_cloud_netapp_v1::model::CachePrePopulate;
16737    /// let x = CacheConfig::new().set_cache_pre_populate(CachePrePopulate::default()/* use setters */);
16738    /// ```
16739    pub fn set_cache_pre_populate<T>(mut self, v: T) -> Self
16740    where
16741        T: std::convert::Into<crate::model::CachePrePopulate>,
16742    {
16743        self.cache_pre_populate = std::option::Option::Some(v.into());
16744        self
16745    }
16746
16747    /// Sets or clears the value of [cache_pre_populate][crate::model::CacheConfig::cache_pre_populate].
16748    ///
16749    /// # Example
16750    /// ```ignore,no_run
16751    /// # use google_cloud_netapp_v1::model::CacheConfig;
16752    /// use google_cloud_netapp_v1::model::CachePrePopulate;
16753    /// let x = CacheConfig::new().set_or_clear_cache_pre_populate(Some(CachePrePopulate::default()/* use setters */));
16754    /// let x = CacheConfig::new().set_or_clear_cache_pre_populate(None::<CachePrePopulate>);
16755    /// ```
16756    pub fn set_or_clear_cache_pre_populate<T>(mut self, v: std::option::Option<T>) -> Self
16757    where
16758        T: std::convert::Into<crate::model::CachePrePopulate>,
16759    {
16760        self.cache_pre_populate = v.map(|x| x.into());
16761        self
16762    }
16763
16764    /// Sets the value of [writeback_enabled][crate::model::CacheConfig::writeback_enabled].
16765    ///
16766    /// # Example
16767    /// ```ignore,no_run
16768    /// # use google_cloud_netapp_v1::model::CacheConfig;
16769    /// let x = CacheConfig::new().set_writeback_enabled(true);
16770    /// ```
16771    pub fn set_writeback_enabled<T>(mut self, v: T) -> Self
16772    where
16773        T: std::convert::Into<bool>,
16774    {
16775        self.writeback_enabled = std::option::Option::Some(v.into());
16776        self
16777    }
16778
16779    /// Sets or clears the value of [writeback_enabled][crate::model::CacheConfig::writeback_enabled].
16780    ///
16781    /// # Example
16782    /// ```ignore,no_run
16783    /// # use google_cloud_netapp_v1::model::CacheConfig;
16784    /// let x = CacheConfig::new().set_or_clear_writeback_enabled(Some(false));
16785    /// let x = CacheConfig::new().set_or_clear_writeback_enabled(None::<bool>);
16786    /// ```
16787    pub fn set_or_clear_writeback_enabled<T>(mut self, v: std::option::Option<T>) -> Self
16788    where
16789        T: std::convert::Into<bool>,
16790    {
16791        self.writeback_enabled = v.map(|x| x.into());
16792        self
16793    }
16794
16795    /// Sets the value of [cifs_change_notify_enabled][crate::model::CacheConfig::cifs_change_notify_enabled].
16796    ///
16797    /// # Example
16798    /// ```ignore,no_run
16799    /// # use google_cloud_netapp_v1::model::CacheConfig;
16800    /// let x = CacheConfig::new().set_cifs_change_notify_enabled(true);
16801    /// ```
16802    pub fn set_cifs_change_notify_enabled<T>(mut self, v: T) -> Self
16803    where
16804        T: std::convert::Into<bool>,
16805    {
16806        self.cifs_change_notify_enabled = std::option::Option::Some(v.into());
16807        self
16808    }
16809
16810    /// Sets or clears the value of [cifs_change_notify_enabled][crate::model::CacheConfig::cifs_change_notify_enabled].
16811    ///
16812    /// # Example
16813    /// ```ignore,no_run
16814    /// # use google_cloud_netapp_v1::model::CacheConfig;
16815    /// let x = CacheConfig::new().set_or_clear_cifs_change_notify_enabled(Some(false));
16816    /// let x = CacheConfig::new().set_or_clear_cifs_change_notify_enabled(None::<bool>);
16817    /// ```
16818    pub fn set_or_clear_cifs_change_notify_enabled<T>(mut self, v: std::option::Option<T>) -> Self
16819    where
16820        T: std::convert::Into<bool>,
16821    {
16822        self.cifs_change_notify_enabled = v.map(|x| x.into());
16823        self
16824    }
16825
16826    /// Sets the value of [cache_pre_populate_state][crate::model::CacheConfig::cache_pre_populate_state].
16827    ///
16828    /// # Example
16829    /// ```ignore,no_run
16830    /// # use google_cloud_netapp_v1::model::CacheConfig;
16831    /// use google_cloud_netapp_v1::model::cache_config::CachePrePopulateState;
16832    /// let x0 = CacheConfig::new().set_cache_pre_populate_state(CachePrePopulateState::NotNeeded);
16833    /// let x1 = CacheConfig::new().set_cache_pre_populate_state(CachePrePopulateState::InProgress);
16834    /// let x2 = CacheConfig::new().set_cache_pre_populate_state(CachePrePopulateState::Complete);
16835    /// ```
16836    pub fn set_cache_pre_populate_state<
16837        T: std::convert::Into<crate::model::cache_config::CachePrePopulateState>,
16838    >(
16839        mut self,
16840        v: T,
16841    ) -> Self {
16842        self.cache_pre_populate_state = v.into();
16843        self
16844    }
16845}
16846
16847impl wkt::message::Message for CacheConfig {
16848    fn typename() -> &'static str {
16849        "type.googleapis.com/google.cloud.netapp.v1.CacheConfig"
16850    }
16851}
16852
16853/// Defines additional types related to [CacheConfig].
16854pub mod cache_config {
16855    #[allow(unused_imports)]
16856    use super::*;
16857
16858    /// State of the prepopulation job indicating how the prepopulation is
16859    /// progressing.
16860    ///
16861    /// # Working with unknown values
16862    ///
16863    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16864    /// additional enum variants at any time. Adding new variants is not considered
16865    /// a breaking change. Applications should write their code in anticipation of:
16866    ///
16867    /// - New values appearing in future releases of the client library, **and**
16868    /// - New values received dynamically, without application changes.
16869    ///
16870    /// Please consult the [Working with enums] section in the user guide for some
16871    /// guidelines.
16872    ///
16873    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16874    #[derive(Clone, Debug, PartialEq)]
16875    #[non_exhaustive]
16876    pub enum CachePrePopulateState {
16877        /// Default unspecified state.
16878        Unspecified,
16879        /// State representing when the most recent create or update request did not
16880        /// require a prepopulation job.
16881        NotNeeded,
16882        /// State representing when the most recent update request requested a
16883        /// prepopulation job but it has not yet completed.
16884        InProgress,
16885        /// State representing when the most recent update request requested a
16886        /// prepopulation job and it has completed successfully.
16887        Complete,
16888        /// State representing when the most recent update request requested a
16889        /// prepopulation job but the prepopulate job failed.
16890        Error,
16891        /// If set, the enum was initialized with an unknown value.
16892        ///
16893        /// Applications can examine the value using [CachePrePopulateState::value] or
16894        /// [CachePrePopulateState::name].
16895        UnknownValue(cache_pre_populate_state::UnknownValue),
16896    }
16897
16898    #[doc(hidden)]
16899    pub mod cache_pre_populate_state {
16900        #[allow(unused_imports)]
16901        use super::*;
16902        #[derive(Clone, Debug, PartialEq)]
16903        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16904    }
16905
16906    impl CachePrePopulateState {
16907        /// Gets the enum value.
16908        ///
16909        /// Returns `None` if the enum contains an unknown value deserialized from
16910        /// the string representation of enums.
16911        pub fn value(&self) -> std::option::Option<i32> {
16912            match self {
16913                Self::Unspecified => std::option::Option::Some(0),
16914                Self::NotNeeded => std::option::Option::Some(1),
16915                Self::InProgress => std::option::Option::Some(2),
16916                Self::Complete => std::option::Option::Some(3),
16917                Self::Error => std::option::Option::Some(4),
16918                Self::UnknownValue(u) => u.0.value(),
16919            }
16920        }
16921
16922        /// Gets the enum value as a string.
16923        ///
16924        /// Returns `None` if the enum contains an unknown value deserialized from
16925        /// the integer representation of enums.
16926        pub fn name(&self) -> std::option::Option<&str> {
16927            match self {
16928                Self::Unspecified => {
16929                    std::option::Option::Some("CACHE_PRE_POPULATE_STATE_UNSPECIFIED")
16930                }
16931                Self::NotNeeded => std::option::Option::Some("NOT_NEEDED"),
16932                Self::InProgress => std::option::Option::Some("IN_PROGRESS"),
16933                Self::Complete => std::option::Option::Some("COMPLETE"),
16934                Self::Error => std::option::Option::Some("ERROR"),
16935                Self::UnknownValue(u) => u.0.name(),
16936            }
16937        }
16938    }
16939
16940    impl std::default::Default for CachePrePopulateState {
16941        fn default() -> Self {
16942            use std::convert::From;
16943            Self::from(0)
16944        }
16945    }
16946
16947    impl std::fmt::Display for CachePrePopulateState {
16948        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16949            wkt::internal::display_enum(f, self.name(), self.value())
16950        }
16951    }
16952
16953    impl std::convert::From<i32> for CachePrePopulateState {
16954        fn from(value: i32) -> Self {
16955            match value {
16956                0 => Self::Unspecified,
16957                1 => Self::NotNeeded,
16958                2 => Self::InProgress,
16959                3 => Self::Complete,
16960                4 => Self::Error,
16961                _ => Self::UnknownValue(cache_pre_populate_state::UnknownValue(
16962                    wkt::internal::UnknownEnumValue::Integer(value),
16963                )),
16964            }
16965        }
16966    }
16967
16968    impl std::convert::From<&str> for CachePrePopulateState {
16969        fn from(value: &str) -> Self {
16970            use std::string::ToString;
16971            match value {
16972                "CACHE_PRE_POPULATE_STATE_UNSPECIFIED" => Self::Unspecified,
16973                "NOT_NEEDED" => Self::NotNeeded,
16974                "IN_PROGRESS" => Self::InProgress,
16975                "COMPLETE" => Self::Complete,
16976                "ERROR" => Self::Error,
16977                _ => Self::UnknownValue(cache_pre_populate_state::UnknownValue(
16978                    wkt::internal::UnknownEnumValue::String(value.to_string()),
16979                )),
16980            }
16981        }
16982    }
16983
16984    impl serde::ser::Serialize for CachePrePopulateState {
16985        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16986        where
16987            S: serde::Serializer,
16988        {
16989            match self {
16990                Self::Unspecified => serializer.serialize_i32(0),
16991                Self::NotNeeded => serializer.serialize_i32(1),
16992                Self::InProgress => serializer.serialize_i32(2),
16993                Self::Complete => serializer.serialize_i32(3),
16994                Self::Error => serializer.serialize_i32(4),
16995                Self::UnknownValue(u) => u.0.serialize(serializer),
16996            }
16997        }
16998    }
16999
17000    impl<'de> serde::de::Deserialize<'de> for CachePrePopulateState {
17001        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17002        where
17003            D: serde::Deserializer<'de>,
17004        {
17005            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CachePrePopulateState>::new(
17006                ".google.cloud.netapp.v1.CacheConfig.CachePrePopulateState",
17007            ))
17008        }
17009    }
17010}
17011
17012/// Pre-populate cache volume with data from the origin volume.
17013#[derive(Clone, Default, PartialEq)]
17014#[non_exhaustive]
17015pub struct CachePrePopulate {
17016    /// Optional. List of directory-paths to be pre-populated for the FlexCache
17017    /// volume.
17018    pub path_list: std::vec::Vec<std::string::String>,
17019
17020    /// Optional. List of directory-paths to be excluded for pre-population for the
17021    /// FlexCache volume.
17022    pub exclude_path_list: std::vec::Vec<std::string::String>,
17023
17024    /// Optional. Flag indicating whether the directories listed with the
17025    /// `path_list` need to be recursively pre-populated.
17026    pub recursion: std::option::Option<bool>,
17027
17028    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17029}
17030
17031impl CachePrePopulate {
17032    pub fn new() -> Self {
17033        std::default::Default::default()
17034    }
17035
17036    /// Sets the value of [path_list][crate::model::CachePrePopulate::path_list].
17037    ///
17038    /// # Example
17039    /// ```ignore,no_run
17040    /// # use google_cloud_netapp_v1::model::CachePrePopulate;
17041    /// let x = CachePrePopulate::new().set_path_list(["a", "b", "c"]);
17042    /// ```
17043    pub fn set_path_list<T, V>(mut self, v: T) -> Self
17044    where
17045        T: std::iter::IntoIterator<Item = V>,
17046        V: std::convert::Into<std::string::String>,
17047    {
17048        use std::iter::Iterator;
17049        self.path_list = v.into_iter().map(|i| i.into()).collect();
17050        self
17051    }
17052
17053    /// Sets the value of [exclude_path_list][crate::model::CachePrePopulate::exclude_path_list].
17054    ///
17055    /// # Example
17056    /// ```ignore,no_run
17057    /// # use google_cloud_netapp_v1::model::CachePrePopulate;
17058    /// let x = CachePrePopulate::new().set_exclude_path_list(["a", "b", "c"]);
17059    /// ```
17060    pub fn set_exclude_path_list<T, V>(mut self, v: T) -> Self
17061    where
17062        T: std::iter::IntoIterator<Item = V>,
17063        V: std::convert::Into<std::string::String>,
17064    {
17065        use std::iter::Iterator;
17066        self.exclude_path_list = v.into_iter().map(|i| i.into()).collect();
17067        self
17068    }
17069
17070    /// Sets the value of [recursion][crate::model::CachePrePopulate::recursion].
17071    ///
17072    /// # Example
17073    /// ```ignore,no_run
17074    /// # use google_cloud_netapp_v1::model::CachePrePopulate;
17075    /// let x = CachePrePopulate::new().set_recursion(true);
17076    /// ```
17077    pub fn set_recursion<T>(mut self, v: T) -> Self
17078    where
17079        T: std::convert::Into<bool>,
17080    {
17081        self.recursion = std::option::Option::Some(v.into());
17082        self
17083    }
17084
17085    /// Sets or clears the value of [recursion][crate::model::CachePrePopulate::recursion].
17086    ///
17087    /// # Example
17088    /// ```ignore,no_run
17089    /// # use google_cloud_netapp_v1::model::CachePrePopulate;
17090    /// let x = CachePrePopulate::new().set_or_clear_recursion(Some(false));
17091    /// let x = CachePrePopulate::new().set_or_clear_recursion(None::<bool>);
17092    /// ```
17093    pub fn set_or_clear_recursion<T>(mut self, v: std::option::Option<T>) -> Self
17094    where
17095        T: std::convert::Into<bool>,
17096    {
17097        self.recursion = v.map(|x| x.into());
17098        self
17099    }
17100}
17101
17102impl wkt::message::Message for CachePrePopulate {
17103    fn typename() -> &'static str {
17104        "type.googleapis.com/google.cloud.netapp.v1.CachePrePopulate"
17105    }
17106}
17107
17108/// Block device represents the device(s) which are stored in the block volume.
17109#[derive(Clone, Default, PartialEq)]
17110#[non_exhaustive]
17111pub struct BlockDevice {
17112    /// Optional. User-defined name for the block device, unique within the volume.
17113    /// In case no user input is provided, name will be auto-generated in the
17114    /// backend. The name must meet the following requirements:
17115    ///
17116    /// * Be between 1 and 255 characters long.
17117    /// * Contain only uppercase or lowercase letters (A-Z, a-z), numbers (0-9),
17118    ///   and the following special characters: "-", "_", "}", "{", ".".
17119    /// * Spaces are not allowed.
17120    pub name: std::option::Option<std::string::String>,
17121
17122    /// Optional. A list of host groups that identify hosts that can mount the
17123    /// block volume. Format:
17124    /// `projects/{project_id}/locations/{location}/hostGroups/{host_group_id}`
17125    /// This field can be updated after the block device is created.
17126    pub host_groups: std::vec::Vec<std::string::String>,
17127
17128    /// Output only. Device identifier of the block volume. This represents
17129    /// `lun_serial_number` for iSCSI volumes.
17130    pub identifier: std::string::String,
17131
17132    /// Optional. The size of the block device in GiB.
17133    /// Any value provided for the `size_gib` field during volume creation is
17134    /// ignored. The block device's size is system-managed and will be set to match
17135    /// the parent Volume's `capacity_gib`.
17136    pub size_gib: std::option::Option<i64>,
17137
17138    /// Required. Immutable. The OS type of the volume.
17139    /// This field can't be changed after the block device is created.
17140    pub os_type: crate::model::OsType,
17141
17142    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17143}
17144
17145impl BlockDevice {
17146    pub fn new() -> Self {
17147        std::default::Default::default()
17148    }
17149
17150    /// Sets the value of [name][crate::model::BlockDevice::name].
17151    ///
17152    /// # Example
17153    /// ```ignore,no_run
17154    /// # use google_cloud_netapp_v1::model::BlockDevice;
17155    /// let x = BlockDevice::new().set_name("example");
17156    /// ```
17157    pub fn set_name<T>(mut self, v: T) -> Self
17158    where
17159        T: std::convert::Into<std::string::String>,
17160    {
17161        self.name = std::option::Option::Some(v.into());
17162        self
17163    }
17164
17165    /// Sets or clears the value of [name][crate::model::BlockDevice::name].
17166    ///
17167    /// # Example
17168    /// ```ignore,no_run
17169    /// # use google_cloud_netapp_v1::model::BlockDevice;
17170    /// let x = BlockDevice::new().set_or_clear_name(Some("example"));
17171    /// let x = BlockDevice::new().set_or_clear_name(None::<String>);
17172    /// ```
17173    pub fn set_or_clear_name<T>(mut self, v: std::option::Option<T>) -> Self
17174    where
17175        T: std::convert::Into<std::string::String>,
17176    {
17177        self.name = v.map(|x| x.into());
17178        self
17179    }
17180
17181    /// Sets the value of [host_groups][crate::model::BlockDevice::host_groups].
17182    ///
17183    /// # Example
17184    /// ```ignore,no_run
17185    /// # use google_cloud_netapp_v1::model::BlockDevice;
17186    /// let x = BlockDevice::new().set_host_groups(["a", "b", "c"]);
17187    /// ```
17188    pub fn set_host_groups<T, V>(mut self, v: T) -> Self
17189    where
17190        T: std::iter::IntoIterator<Item = V>,
17191        V: std::convert::Into<std::string::String>,
17192    {
17193        use std::iter::Iterator;
17194        self.host_groups = v.into_iter().map(|i| i.into()).collect();
17195        self
17196    }
17197
17198    /// Sets the value of [identifier][crate::model::BlockDevice::identifier].
17199    ///
17200    /// # Example
17201    /// ```ignore,no_run
17202    /// # use google_cloud_netapp_v1::model::BlockDevice;
17203    /// let x = BlockDevice::new().set_identifier("example");
17204    /// ```
17205    pub fn set_identifier<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17206        self.identifier = v.into();
17207        self
17208    }
17209
17210    /// Sets the value of [size_gib][crate::model::BlockDevice::size_gib].
17211    ///
17212    /// # Example
17213    /// ```ignore,no_run
17214    /// # use google_cloud_netapp_v1::model::BlockDevice;
17215    /// let x = BlockDevice::new().set_size_gib(42);
17216    /// ```
17217    pub fn set_size_gib<T>(mut self, v: T) -> Self
17218    where
17219        T: std::convert::Into<i64>,
17220    {
17221        self.size_gib = std::option::Option::Some(v.into());
17222        self
17223    }
17224
17225    /// Sets or clears the value of [size_gib][crate::model::BlockDevice::size_gib].
17226    ///
17227    /// # Example
17228    /// ```ignore,no_run
17229    /// # use google_cloud_netapp_v1::model::BlockDevice;
17230    /// let x = BlockDevice::new().set_or_clear_size_gib(Some(42));
17231    /// let x = BlockDevice::new().set_or_clear_size_gib(None::<i32>);
17232    /// ```
17233    pub fn set_or_clear_size_gib<T>(mut self, v: std::option::Option<T>) -> Self
17234    where
17235        T: std::convert::Into<i64>,
17236    {
17237        self.size_gib = v.map(|x| x.into());
17238        self
17239    }
17240
17241    /// Sets the value of [os_type][crate::model::BlockDevice::os_type].
17242    ///
17243    /// # Example
17244    /// ```ignore,no_run
17245    /// # use google_cloud_netapp_v1::model::BlockDevice;
17246    /// use google_cloud_netapp_v1::model::OsType;
17247    /// let x0 = BlockDevice::new().set_os_type(OsType::Linux);
17248    /// let x1 = BlockDevice::new().set_os_type(OsType::Windows);
17249    /// let x2 = BlockDevice::new().set_os_type(OsType::Esxi);
17250    /// ```
17251    pub fn set_os_type<T: std::convert::Into<crate::model::OsType>>(mut self, v: T) -> Self {
17252        self.os_type = v.into();
17253        self
17254    }
17255}
17256
17257impl wkt::message::Message for BlockDevice {
17258    fn typename() -> &'static str {
17259        "type.googleapis.com/google.cloud.netapp.v1.BlockDevice"
17260    }
17261}
17262
17263/// RestoreBackupFilesRequest restores files from a backup to a volume.
17264#[derive(Clone, Default, PartialEq)]
17265#[non_exhaustive]
17266pub struct RestoreBackupFilesRequest {
17267    /// Required. The volume resource name, in the format
17268    /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
17269    pub name: std::string::String,
17270
17271    /// Required. The backup resource name, in the format
17272    /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
17273    pub backup: std::string::String,
17274
17275    /// Required. List of files to be restored, specified by their absolute path in
17276    /// the source volume.
17277    pub file_list: std::vec::Vec<std::string::String>,
17278
17279    /// Optional. Absolute directory path in the destination volume. This is
17280    /// required if the `file_list` is provided.
17281    pub restore_destination_path: std::string::String,
17282
17283    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17284}
17285
17286impl RestoreBackupFilesRequest {
17287    pub fn new() -> Self {
17288        std::default::Default::default()
17289    }
17290
17291    /// Sets the value of [name][crate::model::RestoreBackupFilesRequest::name].
17292    ///
17293    /// # Example
17294    /// ```ignore,no_run
17295    /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
17296    /// let x = RestoreBackupFilesRequest::new().set_name("example");
17297    /// ```
17298    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17299        self.name = v.into();
17300        self
17301    }
17302
17303    /// Sets the value of [backup][crate::model::RestoreBackupFilesRequest::backup].
17304    ///
17305    /// # Example
17306    /// ```ignore,no_run
17307    /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
17308    /// let x = RestoreBackupFilesRequest::new().set_backup("example");
17309    /// ```
17310    pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17311        self.backup = v.into();
17312        self
17313    }
17314
17315    /// Sets the value of [file_list][crate::model::RestoreBackupFilesRequest::file_list].
17316    ///
17317    /// # Example
17318    /// ```ignore,no_run
17319    /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
17320    /// let x = RestoreBackupFilesRequest::new().set_file_list(["a", "b", "c"]);
17321    /// ```
17322    pub fn set_file_list<T, V>(mut self, v: T) -> Self
17323    where
17324        T: std::iter::IntoIterator<Item = V>,
17325        V: std::convert::Into<std::string::String>,
17326    {
17327        use std::iter::Iterator;
17328        self.file_list = v.into_iter().map(|i| i.into()).collect();
17329        self
17330    }
17331
17332    /// Sets the value of [restore_destination_path][crate::model::RestoreBackupFilesRequest::restore_destination_path].
17333    ///
17334    /// # Example
17335    /// ```ignore,no_run
17336    /// # use google_cloud_netapp_v1::model::RestoreBackupFilesRequest;
17337    /// let x = RestoreBackupFilesRequest::new().set_restore_destination_path("example");
17338    /// ```
17339    pub fn set_restore_destination_path<T: std::convert::Into<std::string::String>>(
17340        mut self,
17341        v: T,
17342    ) -> Self {
17343        self.restore_destination_path = v.into();
17344        self
17345    }
17346}
17347
17348impl wkt::message::Message for RestoreBackupFilesRequest {
17349    fn typename() -> &'static str {
17350        "type.googleapis.com/google.cloud.netapp.v1.RestoreBackupFilesRequest"
17351    }
17352}
17353
17354/// RestoreBackupFilesResponse is the result of RestoreBackupFilesRequest.
17355#[derive(Clone, Default, PartialEq)]
17356#[non_exhaustive]
17357pub struct RestoreBackupFilesResponse {
17358    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
17359}
17360
17361impl RestoreBackupFilesResponse {
17362    pub fn new() -> Self {
17363        std::default::Default::default()
17364    }
17365}
17366
17367impl wkt::message::Message for RestoreBackupFilesResponse {
17368    fn typename() -> &'static str {
17369        "type.googleapis.com/google.cloud.netapp.v1.RestoreBackupFilesResponse"
17370    }
17371}
17372
17373/// The service level of a storage pool and its volumes.
17374///
17375/// # Working with unknown values
17376///
17377/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17378/// additional enum variants at any time. Adding new variants is not considered
17379/// a breaking change. Applications should write their code in anticipation of:
17380///
17381/// - New values appearing in future releases of the client library, **and**
17382/// - New values received dynamically, without application changes.
17383///
17384/// Please consult the [Working with enums] section in the user guide for some
17385/// guidelines.
17386///
17387/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17388#[derive(Clone, Debug, PartialEq)]
17389#[non_exhaustive]
17390pub enum ServiceLevel {
17391    /// Unspecified service level.
17392    Unspecified,
17393    /// Premium service level.
17394    Premium,
17395    /// Extreme service level.
17396    Extreme,
17397    /// Standard service level.
17398    Standard,
17399    /// Flex service level.
17400    Flex,
17401    /// If set, the enum was initialized with an unknown value.
17402    ///
17403    /// Applications can examine the value using [ServiceLevel::value] or
17404    /// [ServiceLevel::name].
17405    UnknownValue(service_level::UnknownValue),
17406}
17407
17408#[doc(hidden)]
17409pub mod service_level {
17410    #[allow(unused_imports)]
17411    use super::*;
17412    #[derive(Clone, Debug, PartialEq)]
17413    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17414}
17415
17416impl ServiceLevel {
17417    /// Gets the enum value.
17418    ///
17419    /// Returns `None` if the enum contains an unknown value deserialized from
17420    /// the string representation of enums.
17421    pub fn value(&self) -> std::option::Option<i32> {
17422        match self {
17423            Self::Unspecified => std::option::Option::Some(0),
17424            Self::Premium => std::option::Option::Some(1),
17425            Self::Extreme => std::option::Option::Some(2),
17426            Self::Standard => std::option::Option::Some(3),
17427            Self::Flex => std::option::Option::Some(4),
17428            Self::UnknownValue(u) => u.0.value(),
17429        }
17430    }
17431
17432    /// Gets the enum value as a string.
17433    ///
17434    /// Returns `None` if the enum contains an unknown value deserialized from
17435    /// the integer representation of enums.
17436    pub fn name(&self) -> std::option::Option<&str> {
17437        match self {
17438            Self::Unspecified => std::option::Option::Some("SERVICE_LEVEL_UNSPECIFIED"),
17439            Self::Premium => std::option::Option::Some("PREMIUM"),
17440            Self::Extreme => std::option::Option::Some("EXTREME"),
17441            Self::Standard => std::option::Option::Some("STANDARD"),
17442            Self::Flex => std::option::Option::Some("FLEX"),
17443            Self::UnknownValue(u) => u.0.name(),
17444        }
17445    }
17446}
17447
17448impl std::default::Default for ServiceLevel {
17449    fn default() -> Self {
17450        use std::convert::From;
17451        Self::from(0)
17452    }
17453}
17454
17455impl std::fmt::Display for ServiceLevel {
17456    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17457        wkt::internal::display_enum(f, self.name(), self.value())
17458    }
17459}
17460
17461impl std::convert::From<i32> for ServiceLevel {
17462    fn from(value: i32) -> Self {
17463        match value {
17464            0 => Self::Unspecified,
17465            1 => Self::Premium,
17466            2 => Self::Extreme,
17467            3 => Self::Standard,
17468            4 => Self::Flex,
17469            _ => Self::UnknownValue(service_level::UnknownValue(
17470                wkt::internal::UnknownEnumValue::Integer(value),
17471            )),
17472        }
17473    }
17474}
17475
17476impl std::convert::From<&str> for ServiceLevel {
17477    fn from(value: &str) -> Self {
17478        use std::string::ToString;
17479        match value {
17480            "SERVICE_LEVEL_UNSPECIFIED" => Self::Unspecified,
17481            "PREMIUM" => Self::Premium,
17482            "EXTREME" => Self::Extreme,
17483            "STANDARD" => Self::Standard,
17484            "FLEX" => Self::Flex,
17485            _ => Self::UnknownValue(service_level::UnknownValue(
17486                wkt::internal::UnknownEnumValue::String(value.to_string()),
17487            )),
17488        }
17489    }
17490}
17491
17492impl serde::ser::Serialize for ServiceLevel {
17493    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17494    where
17495        S: serde::Serializer,
17496    {
17497        match self {
17498            Self::Unspecified => serializer.serialize_i32(0),
17499            Self::Premium => serializer.serialize_i32(1),
17500            Self::Extreme => serializer.serialize_i32(2),
17501            Self::Standard => serializer.serialize_i32(3),
17502            Self::Flex => serializer.serialize_i32(4),
17503            Self::UnknownValue(u) => u.0.serialize(serializer),
17504        }
17505    }
17506}
17507
17508impl<'de> serde::de::Deserialize<'de> for ServiceLevel {
17509    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17510    where
17511        D: serde::Deserializer<'de>,
17512    {
17513        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ServiceLevel>::new(
17514            ".google.cloud.netapp.v1.ServiceLevel",
17515        ))
17516    }
17517}
17518
17519/// Flex Storage Pool performance.
17520///
17521/// # Working with unknown values
17522///
17523/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17524/// additional enum variants at any time. Adding new variants is not considered
17525/// a breaking change. Applications should write their code in anticipation of:
17526///
17527/// - New values appearing in future releases of the client library, **and**
17528/// - New values received dynamically, without application changes.
17529///
17530/// Please consult the [Working with enums] section in the user guide for some
17531/// guidelines.
17532///
17533/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17534#[derive(Clone, Debug, PartialEq)]
17535#[non_exhaustive]
17536pub enum FlexPerformance {
17537    /// Unspecified flex performance.
17538    Unspecified,
17539    /// Flex Storage Pool with default performance.
17540    Default,
17541    /// Flex Storage Pool with custom performance.
17542    Custom,
17543    /// If set, the enum was initialized with an unknown value.
17544    ///
17545    /// Applications can examine the value using [FlexPerformance::value] or
17546    /// [FlexPerformance::name].
17547    UnknownValue(flex_performance::UnknownValue),
17548}
17549
17550#[doc(hidden)]
17551pub mod flex_performance {
17552    #[allow(unused_imports)]
17553    use super::*;
17554    #[derive(Clone, Debug, PartialEq)]
17555    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17556}
17557
17558impl FlexPerformance {
17559    /// Gets the enum value.
17560    ///
17561    /// Returns `None` if the enum contains an unknown value deserialized from
17562    /// the string representation of enums.
17563    pub fn value(&self) -> std::option::Option<i32> {
17564        match self {
17565            Self::Unspecified => std::option::Option::Some(0),
17566            Self::Default => std::option::Option::Some(1),
17567            Self::Custom => std::option::Option::Some(2),
17568            Self::UnknownValue(u) => u.0.value(),
17569        }
17570    }
17571
17572    /// Gets the enum value as a string.
17573    ///
17574    /// Returns `None` if the enum contains an unknown value deserialized from
17575    /// the integer representation of enums.
17576    pub fn name(&self) -> std::option::Option<&str> {
17577        match self {
17578            Self::Unspecified => std::option::Option::Some("FLEX_PERFORMANCE_UNSPECIFIED"),
17579            Self::Default => std::option::Option::Some("FLEX_PERFORMANCE_DEFAULT"),
17580            Self::Custom => std::option::Option::Some("FLEX_PERFORMANCE_CUSTOM"),
17581            Self::UnknownValue(u) => u.0.name(),
17582        }
17583    }
17584}
17585
17586impl std::default::Default for FlexPerformance {
17587    fn default() -> Self {
17588        use std::convert::From;
17589        Self::from(0)
17590    }
17591}
17592
17593impl std::fmt::Display for FlexPerformance {
17594    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17595        wkt::internal::display_enum(f, self.name(), self.value())
17596    }
17597}
17598
17599impl std::convert::From<i32> for FlexPerformance {
17600    fn from(value: i32) -> Self {
17601        match value {
17602            0 => Self::Unspecified,
17603            1 => Self::Default,
17604            2 => Self::Custom,
17605            _ => Self::UnknownValue(flex_performance::UnknownValue(
17606                wkt::internal::UnknownEnumValue::Integer(value),
17607            )),
17608        }
17609    }
17610}
17611
17612impl std::convert::From<&str> for FlexPerformance {
17613    fn from(value: &str) -> Self {
17614        use std::string::ToString;
17615        match value {
17616            "FLEX_PERFORMANCE_UNSPECIFIED" => Self::Unspecified,
17617            "FLEX_PERFORMANCE_DEFAULT" => Self::Default,
17618            "FLEX_PERFORMANCE_CUSTOM" => Self::Custom,
17619            _ => Self::UnknownValue(flex_performance::UnknownValue(
17620                wkt::internal::UnknownEnumValue::String(value.to_string()),
17621            )),
17622        }
17623    }
17624}
17625
17626impl serde::ser::Serialize for FlexPerformance {
17627    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17628    where
17629        S: serde::Serializer,
17630    {
17631        match self {
17632            Self::Unspecified => serializer.serialize_i32(0),
17633            Self::Default => serializer.serialize_i32(1),
17634            Self::Custom => serializer.serialize_i32(2),
17635            Self::UnknownValue(u) => u.0.serialize(serializer),
17636        }
17637    }
17638}
17639
17640impl<'de> serde::de::Deserialize<'de> for FlexPerformance {
17641    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17642    where
17643        D: serde::Deserializer<'de>,
17644    {
17645        deserializer.deserialize_any(wkt::internal::EnumVisitor::<FlexPerformance>::new(
17646            ".google.cloud.netapp.v1.FlexPerformance",
17647        ))
17648    }
17649}
17650
17651/// The volume encryption key source.
17652///
17653/// # Working with unknown values
17654///
17655/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17656/// additional enum variants at any time. Adding new variants is not considered
17657/// a breaking change. Applications should write their code in anticipation of:
17658///
17659/// - New values appearing in future releases of the client library, **and**
17660/// - New values received dynamically, without application changes.
17661///
17662/// Please consult the [Working with enums] section in the user guide for some
17663/// guidelines.
17664///
17665/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17666#[derive(Clone, Debug, PartialEq)]
17667#[non_exhaustive]
17668pub enum EncryptionType {
17669    /// The source of the encryption key is not specified.
17670    Unspecified,
17671    /// Google managed encryption key.
17672    ServiceManaged,
17673    /// Customer managed encryption key, which is stored in KMS.
17674    CloudKms,
17675    /// If set, the enum was initialized with an unknown value.
17676    ///
17677    /// Applications can examine the value using [EncryptionType::value] or
17678    /// [EncryptionType::name].
17679    UnknownValue(encryption_type::UnknownValue),
17680}
17681
17682#[doc(hidden)]
17683pub mod encryption_type {
17684    #[allow(unused_imports)]
17685    use super::*;
17686    #[derive(Clone, Debug, PartialEq)]
17687    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17688}
17689
17690impl EncryptionType {
17691    /// Gets the enum value.
17692    ///
17693    /// Returns `None` if the enum contains an unknown value deserialized from
17694    /// the string representation of enums.
17695    pub fn value(&self) -> std::option::Option<i32> {
17696        match self {
17697            Self::Unspecified => std::option::Option::Some(0),
17698            Self::ServiceManaged => std::option::Option::Some(1),
17699            Self::CloudKms => std::option::Option::Some(2),
17700            Self::UnknownValue(u) => u.0.value(),
17701        }
17702    }
17703
17704    /// Gets the enum value as a string.
17705    ///
17706    /// Returns `None` if the enum contains an unknown value deserialized from
17707    /// the integer representation of enums.
17708    pub fn name(&self) -> std::option::Option<&str> {
17709        match self {
17710            Self::Unspecified => std::option::Option::Some("ENCRYPTION_TYPE_UNSPECIFIED"),
17711            Self::ServiceManaged => std::option::Option::Some("SERVICE_MANAGED"),
17712            Self::CloudKms => std::option::Option::Some("CLOUD_KMS"),
17713            Self::UnknownValue(u) => u.0.name(),
17714        }
17715    }
17716}
17717
17718impl std::default::Default for EncryptionType {
17719    fn default() -> Self {
17720        use std::convert::From;
17721        Self::from(0)
17722    }
17723}
17724
17725impl std::fmt::Display for EncryptionType {
17726    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17727        wkt::internal::display_enum(f, self.name(), self.value())
17728    }
17729}
17730
17731impl std::convert::From<i32> for EncryptionType {
17732    fn from(value: i32) -> Self {
17733        match value {
17734            0 => Self::Unspecified,
17735            1 => Self::ServiceManaged,
17736            2 => Self::CloudKms,
17737            _ => Self::UnknownValue(encryption_type::UnknownValue(
17738                wkt::internal::UnknownEnumValue::Integer(value),
17739            )),
17740        }
17741    }
17742}
17743
17744impl std::convert::From<&str> for EncryptionType {
17745    fn from(value: &str) -> Self {
17746        use std::string::ToString;
17747        match value {
17748            "ENCRYPTION_TYPE_UNSPECIFIED" => Self::Unspecified,
17749            "SERVICE_MANAGED" => Self::ServiceManaged,
17750            "CLOUD_KMS" => Self::CloudKms,
17751            _ => Self::UnknownValue(encryption_type::UnknownValue(
17752                wkt::internal::UnknownEnumValue::String(value.to_string()),
17753            )),
17754        }
17755    }
17756}
17757
17758impl serde::ser::Serialize for EncryptionType {
17759    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17760    where
17761        S: serde::Serializer,
17762    {
17763        match self {
17764            Self::Unspecified => serializer.serialize_i32(0),
17765            Self::ServiceManaged => serializer.serialize_i32(1),
17766            Self::CloudKms => serializer.serialize_i32(2),
17767            Self::UnknownValue(u) => u.0.serialize(serializer),
17768        }
17769    }
17770}
17771
17772impl<'de> serde::de::Deserialize<'de> for EncryptionType {
17773    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17774    where
17775        D: serde::Deserializer<'de>,
17776    {
17777        deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionType>::new(
17778            ".google.cloud.netapp.v1.EncryptionType",
17779        ))
17780    }
17781}
17782
17783/// Type of directory service
17784///
17785/// # Working with unknown values
17786///
17787/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17788/// additional enum variants at any time. Adding new variants is not considered
17789/// a breaking change. Applications should write their code in anticipation of:
17790///
17791/// - New values appearing in future releases of the client library, **and**
17792/// - New values received dynamically, without application changes.
17793///
17794/// Please consult the [Working with enums] section in the user guide for some
17795/// guidelines.
17796///
17797/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17798#[derive(Clone, Debug, PartialEq)]
17799#[non_exhaustive]
17800pub enum DirectoryServiceType {
17801    /// Directory service type is not specified.
17802    Unspecified,
17803    /// Active directory policy attached to the storage pool.
17804    ActiveDirectory,
17805    /// If set, the enum was initialized with an unknown value.
17806    ///
17807    /// Applications can examine the value using [DirectoryServiceType::value] or
17808    /// [DirectoryServiceType::name].
17809    UnknownValue(directory_service_type::UnknownValue),
17810}
17811
17812#[doc(hidden)]
17813pub mod directory_service_type {
17814    #[allow(unused_imports)]
17815    use super::*;
17816    #[derive(Clone, Debug, PartialEq)]
17817    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17818}
17819
17820impl DirectoryServiceType {
17821    /// Gets the enum value.
17822    ///
17823    /// Returns `None` if the enum contains an unknown value deserialized from
17824    /// the string representation of enums.
17825    pub fn value(&self) -> std::option::Option<i32> {
17826        match self {
17827            Self::Unspecified => std::option::Option::Some(0),
17828            Self::ActiveDirectory => std::option::Option::Some(1),
17829            Self::UnknownValue(u) => u.0.value(),
17830        }
17831    }
17832
17833    /// Gets the enum value as a string.
17834    ///
17835    /// Returns `None` if the enum contains an unknown value deserialized from
17836    /// the integer representation of enums.
17837    pub fn name(&self) -> std::option::Option<&str> {
17838        match self {
17839            Self::Unspecified => std::option::Option::Some("DIRECTORY_SERVICE_TYPE_UNSPECIFIED"),
17840            Self::ActiveDirectory => std::option::Option::Some("ACTIVE_DIRECTORY"),
17841            Self::UnknownValue(u) => u.0.name(),
17842        }
17843    }
17844}
17845
17846impl std::default::Default for DirectoryServiceType {
17847    fn default() -> Self {
17848        use std::convert::From;
17849        Self::from(0)
17850    }
17851}
17852
17853impl std::fmt::Display for DirectoryServiceType {
17854    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17855        wkt::internal::display_enum(f, self.name(), self.value())
17856    }
17857}
17858
17859impl std::convert::From<i32> for DirectoryServiceType {
17860    fn from(value: i32) -> Self {
17861        match value {
17862            0 => Self::Unspecified,
17863            1 => Self::ActiveDirectory,
17864            _ => Self::UnknownValue(directory_service_type::UnknownValue(
17865                wkt::internal::UnknownEnumValue::Integer(value),
17866            )),
17867        }
17868    }
17869}
17870
17871impl std::convert::From<&str> for DirectoryServiceType {
17872    fn from(value: &str) -> Self {
17873        use std::string::ToString;
17874        match value {
17875            "DIRECTORY_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
17876            "ACTIVE_DIRECTORY" => Self::ActiveDirectory,
17877            _ => Self::UnknownValue(directory_service_type::UnknownValue(
17878                wkt::internal::UnknownEnumValue::String(value.to_string()),
17879            )),
17880        }
17881    }
17882}
17883
17884impl serde::ser::Serialize for DirectoryServiceType {
17885    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
17886    where
17887        S: serde::Serializer,
17888    {
17889        match self {
17890            Self::Unspecified => serializer.serialize_i32(0),
17891            Self::ActiveDirectory => serializer.serialize_i32(1),
17892            Self::UnknownValue(u) => u.0.serialize(serializer),
17893        }
17894    }
17895}
17896
17897impl<'de> serde::de::Deserialize<'de> for DirectoryServiceType {
17898    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
17899    where
17900        D: serde::Deserializer<'de>,
17901    {
17902        deserializer.deserialize_any(wkt::internal::EnumVisitor::<DirectoryServiceType>::new(
17903            ".google.cloud.netapp.v1.DirectoryServiceType",
17904        ))
17905    }
17906}
17907
17908/// Type of storage pool
17909///
17910/// # Working with unknown values
17911///
17912/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
17913/// additional enum variants at any time. Adding new variants is not considered
17914/// a breaking change. Applications should write their code in anticipation of:
17915///
17916/// - New values appearing in future releases of the client library, **and**
17917/// - New values received dynamically, without application changes.
17918///
17919/// Please consult the [Working with enums] section in the user guide for some
17920/// guidelines.
17921///
17922/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
17923#[derive(Clone, Debug, PartialEq)]
17924#[non_exhaustive]
17925pub enum StoragePoolType {
17926    /// Storage pool type is not specified.
17927    Unspecified,
17928    /// Storage pool type is file.
17929    File,
17930    /// Storage pool type is unified.
17931    Unified,
17932    /// Storage pool type is unified large capacity.
17933    UnifiedLargeCapacity,
17934    /// If set, the enum was initialized with an unknown value.
17935    ///
17936    /// Applications can examine the value using [StoragePoolType::value] or
17937    /// [StoragePoolType::name].
17938    UnknownValue(storage_pool_type::UnknownValue),
17939}
17940
17941#[doc(hidden)]
17942pub mod storage_pool_type {
17943    #[allow(unused_imports)]
17944    use super::*;
17945    #[derive(Clone, Debug, PartialEq)]
17946    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
17947}
17948
17949impl StoragePoolType {
17950    /// Gets the enum value.
17951    ///
17952    /// Returns `None` if the enum contains an unknown value deserialized from
17953    /// the string representation of enums.
17954    pub fn value(&self) -> std::option::Option<i32> {
17955        match self {
17956            Self::Unspecified => std::option::Option::Some(0),
17957            Self::File => std::option::Option::Some(1),
17958            Self::Unified => std::option::Option::Some(2),
17959            Self::UnifiedLargeCapacity => std::option::Option::Some(3),
17960            Self::UnknownValue(u) => u.0.value(),
17961        }
17962    }
17963
17964    /// Gets the enum value as a string.
17965    ///
17966    /// Returns `None` if the enum contains an unknown value deserialized from
17967    /// the integer representation of enums.
17968    pub fn name(&self) -> std::option::Option<&str> {
17969        match self {
17970            Self::Unspecified => std::option::Option::Some("STORAGE_POOL_TYPE_UNSPECIFIED"),
17971            Self::File => std::option::Option::Some("FILE"),
17972            Self::Unified => std::option::Option::Some("UNIFIED"),
17973            Self::UnifiedLargeCapacity => std::option::Option::Some("UNIFIED_LARGE_CAPACITY"),
17974            Self::UnknownValue(u) => u.0.name(),
17975        }
17976    }
17977}
17978
17979impl std::default::Default for StoragePoolType {
17980    fn default() -> Self {
17981        use std::convert::From;
17982        Self::from(0)
17983    }
17984}
17985
17986impl std::fmt::Display for StoragePoolType {
17987    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
17988        wkt::internal::display_enum(f, self.name(), self.value())
17989    }
17990}
17991
17992impl std::convert::From<i32> for StoragePoolType {
17993    fn from(value: i32) -> Self {
17994        match value {
17995            0 => Self::Unspecified,
17996            1 => Self::File,
17997            2 => Self::Unified,
17998            3 => Self::UnifiedLargeCapacity,
17999            _ => Self::UnknownValue(storage_pool_type::UnknownValue(
18000                wkt::internal::UnknownEnumValue::Integer(value),
18001            )),
18002        }
18003    }
18004}
18005
18006impl std::convert::From<&str> for StoragePoolType {
18007    fn from(value: &str) -> Self {
18008        use std::string::ToString;
18009        match value {
18010            "STORAGE_POOL_TYPE_UNSPECIFIED" => Self::Unspecified,
18011            "FILE" => Self::File,
18012            "UNIFIED" => Self::Unified,
18013            "UNIFIED_LARGE_CAPACITY" => Self::UnifiedLargeCapacity,
18014            _ => Self::UnknownValue(storage_pool_type::UnknownValue(
18015                wkt::internal::UnknownEnumValue::String(value.to_string()),
18016            )),
18017        }
18018    }
18019}
18020
18021impl serde::ser::Serialize for StoragePoolType {
18022    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18023    where
18024        S: serde::Serializer,
18025    {
18026        match self {
18027            Self::Unspecified => serializer.serialize_i32(0),
18028            Self::File => serializer.serialize_i32(1),
18029            Self::Unified => serializer.serialize_i32(2),
18030            Self::UnifiedLargeCapacity => serializer.serialize_i32(3),
18031            Self::UnknownValue(u) => u.0.serialize(serializer),
18032        }
18033    }
18034}
18035
18036impl<'de> serde::de::Deserialize<'de> for StoragePoolType {
18037    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18038    where
18039        D: serde::Deserializer<'de>,
18040    {
18041        deserializer.deserialize_any(wkt::internal::EnumVisitor::<StoragePoolType>::new(
18042            ".google.cloud.netapp.v1.StoragePoolType",
18043        ))
18044    }
18045}
18046
18047/// Schedule for Hybrid Replication.
18048/// New enum values may be added in future to support different frequency of
18049/// replication.
18050///
18051/// # Working with unknown values
18052///
18053/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18054/// additional enum variants at any time. Adding new variants is not considered
18055/// a breaking change. Applications should write their code in anticipation of:
18056///
18057/// - New values appearing in future releases of the client library, **and**
18058/// - New values received dynamically, without application changes.
18059///
18060/// Please consult the [Working with enums] section in the user guide for some
18061/// guidelines.
18062///
18063/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18064#[derive(Clone, Debug, PartialEq)]
18065#[non_exhaustive]
18066pub enum HybridReplicationSchedule {
18067    /// Unspecified HybridReplicationSchedule
18068    Unspecified,
18069    /// Replication happens once every 10 minutes.
18070    Every10Minutes,
18071    /// Replication happens once every hour.
18072    Hourly,
18073    /// Replication happens once every day.
18074    Daily,
18075    /// If set, the enum was initialized with an unknown value.
18076    ///
18077    /// Applications can examine the value using [HybridReplicationSchedule::value] or
18078    /// [HybridReplicationSchedule::name].
18079    UnknownValue(hybrid_replication_schedule::UnknownValue),
18080}
18081
18082#[doc(hidden)]
18083pub mod hybrid_replication_schedule {
18084    #[allow(unused_imports)]
18085    use super::*;
18086    #[derive(Clone, Debug, PartialEq)]
18087    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18088}
18089
18090impl HybridReplicationSchedule {
18091    /// Gets the enum value.
18092    ///
18093    /// Returns `None` if the enum contains an unknown value deserialized from
18094    /// the string representation of enums.
18095    pub fn value(&self) -> std::option::Option<i32> {
18096        match self {
18097            Self::Unspecified => std::option::Option::Some(0),
18098            Self::Every10Minutes => std::option::Option::Some(1),
18099            Self::Hourly => std::option::Option::Some(2),
18100            Self::Daily => std::option::Option::Some(3),
18101            Self::UnknownValue(u) => u.0.value(),
18102        }
18103    }
18104
18105    /// Gets the enum value as a string.
18106    ///
18107    /// Returns `None` if the enum contains an unknown value deserialized from
18108    /// the integer representation of enums.
18109    pub fn name(&self) -> std::option::Option<&str> {
18110        match self {
18111            Self::Unspecified => {
18112                std::option::Option::Some("HYBRID_REPLICATION_SCHEDULE_UNSPECIFIED")
18113            }
18114            Self::Every10Minutes => std::option::Option::Some("EVERY_10_MINUTES"),
18115            Self::Hourly => std::option::Option::Some("HOURLY"),
18116            Self::Daily => std::option::Option::Some("DAILY"),
18117            Self::UnknownValue(u) => u.0.name(),
18118        }
18119    }
18120}
18121
18122impl std::default::Default for HybridReplicationSchedule {
18123    fn default() -> Self {
18124        use std::convert::From;
18125        Self::from(0)
18126    }
18127}
18128
18129impl std::fmt::Display for HybridReplicationSchedule {
18130    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18131        wkt::internal::display_enum(f, self.name(), self.value())
18132    }
18133}
18134
18135impl std::convert::From<i32> for HybridReplicationSchedule {
18136    fn from(value: i32) -> Self {
18137        match value {
18138            0 => Self::Unspecified,
18139            1 => Self::Every10Minutes,
18140            2 => Self::Hourly,
18141            3 => Self::Daily,
18142            _ => Self::UnknownValue(hybrid_replication_schedule::UnknownValue(
18143                wkt::internal::UnknownEnumValue::Integer(value),
18144            )),
18145        }
18146    }
18147}
18148
18149impl std::convert::From<&str> for HybridReplicationSchedule {
18150    fn from(value: &str) -> Self {
18151        use std::string::ToString;
18152        match value {
18153            "HYBRID_REPLICATION_SCHEDULE_UNSPECIFIED" => Self::Unspecified,
18154            "EVERY_10_MINUTES" => Self::Every10Minutes,
18155            "HOURLY" => Self::Hourly,
18156            "DAILY" => Self::Daily,
18157            _ => Self::UnknownValue(hybrid_replication_schedule::UnknownValue(
18158                wkt::internal::UnknownEnumValue::String(value.to_string()),
18159            )),
18160        }
18161    }
18162}
18163
18164impl serde::ser::Serialize for HybridReplicationSchedule {
18165    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18166    where
18167        S: serde::Serializer,
18168    {
18169        match self {
18170            Self::Unspecified => serializer.serialize_i32(0),
18171            Self::Every10Minutes => serializer.serialize_i32(1),
18172            Self::Hourly => serializer.serialize_i32(2),
18173            Self::Daily => serializer.serialize_i32(3),
18174            Self::UnknownValue(u) => u.0.serialize(serializer),
18175        }
18176    }
18177}
18178
18179impl<'de> serde::de::Deserialize<'de> for HybridReplicationSchedule {
18180    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18181    where
18182        D: serde::Deserializer<'de>,
18183    {
18184        deserializer.deserialize_any(
18185            wkt::internal::EnumVisitor::<HybridReplicationSchedule>::new(
18186                ".google.cloud.netapp.v1.HybridReplicationSchedule",
18187            ),
18188        )
18189    }
18190}
18191
18192/// QoS (Quality of Service) Types of the storage pool
18193///
18194/// # Working with unknown values
18195///
18196/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18197/// additional enum variants at any time. Adding new variants is not considered
18198/// a breaking change. Applications should write their code in anticipation of:
18199///
18200/// - New values appearing in future releases of the client library, **and**
18201/// - New values received dynamically, without application changes.
18202///
18203/// Please consult the [Working with enums] section in the user guide for some
18204/// guidelines.
18205///
18206/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18207#[derive(Clone, Debug, PartialEq)]
18208#[non_exhaustive]
18209pub enum QosType {
18210    /// Unspecified QoS Type
18211    Unspecified,
18212    /// QoS Type is Auto
18213    Auto,
18214    /// QoS Type is Manual
18215    Manual,
18216    /// If set, the enum was initialized with an unknown value.
18217    ///
18218    /// Applications can examine the value using [QosType::value] or
18219    /// [QosType::name].
18220    UnknownValue(qos_type::UnknownValue),
18221}
18222
18223#[doc(hidden)]
18224pub mod qos_type {
18225    #[allow(unused_imports)]
18226    use super::*;
18227    #[derive(Clone, Debug, PartialEq)]
18228    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18229}
18230
18231impl QosType {
18232    /// Gets the enum value.
18233    ///
18234    /// Returns `None` if the enum contains an unknown value deserialized from
18235    /// the string representation of enums.
18236    pub fn value(&self) -> std::option::Option<i32> {
18237        match self {
18238            Self::Unspecified => std::option::Option::Some(0),
18239            Self::Auto => std::option::Option::Some(1),
18240            Self::Manual => std::option::Option::Some(2),
18241            Self::UnknownValue(u) => u.0.value(),
18242        }
18243    }
18244
18245    /// Gets the enum value as a string.
18246    ///
18247    /// Returns `None` if the enum contains an unknown value deserialized from
18248    /// the integer representation of enums.
18249    pub fn name(&self) -> std::option::Option<&str> {
18250        match self {
18251            Self::Unspecified => std::option::Option::Some("QOS_TYPE_UNSPECIFIED"),
18252            Self::Auto => std::option::Option::Some("AUTO"),
18253            Self::Manual => std::option::Option::Some("MANUAL"),
18254            Self::UnknownValue(u) => u.0.name(),
18255        }
18256    }
18257}
18258
18259impl std::default::Default for QosType {
18260    fn default() -> Self {
18261        use std::convert::From;
18262        Self::from(0)
18263    }
18264}
18265
18266impl std::fmt::Display for QosType {
18267    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18268        wkt::internal::display_enum(f, self.name(), self.value())
18269    }
18270}
18271
18272impl std::convert::From<i32> for QosType {
18273    fn from(value: i32) -> Self {
18274        match value {
18275            0 => Self::Unspecified,
18276            1 => Self::Auto,
18277            2 => Self::Manual,
18278            _ => Self::UnknownValue(qos_type::UnknownValue(
18279                wkt::internal::UnknownEnumValue::Integer(value),
18280            )),
18281        }
18282    }
18283}
18284
18285impl std::convert::From<&str> for QosType {
18286    fn from(value: &str) -> Self {
18287        use std::string::ToString;
18288        match value {
18289            "QOS_TYPE_UNSPECIFIED" => Self::Unspecified,
18290            "AUTO" => Self::Auto,
18291            "MANUAL" => Self::Manual,
18292            _ => Self::UnknownValue(qos_type::UnknownValue(
18293                wkt::internal::UnknownEnumValue::String(value.to_string()),
18294            )),
18295        }
18296    }
18297}
18298
18299impl serde::ser::Serialize for QosType {
18300    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18301    where
18302        S: serde::Serializer,
18303    {
18304        match self {
18305            Self::Unspecified => serializer.serialize_i32(0),
18306            Self::Auto => serializer.serialize_i32(1),
18307            Self::Manual => serializer.serialize_i32(2),
18308            Self::UnknownValue(u) => u.0.serialize(serializer),
18309        }
18310    }
18311}
18312
18313impl<'de> serde::de::Deserialize<'de> for QosType {
18314    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18315    where
18316        D: serde::Deserializer<'de>,
18317    {
18318        deserializer.deserialize_any(wkt::internal::EnumVisitor::<QosType>::new(
18319            ".google.cloud.netapp.v1.QosType",
18320        ))
18321    }
18322}
18323
18324/// OS types for the host group
18325///
18326/// # Working with unknown values
18327///
18328/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18329/// additional enum variants at any time. Adding new variants is not considered
18330/// a breaking change. Applications should write their code in anticipation of:
18331///
18332/// - New values appearing in future releases of the client library, **and**
18333/// - New values received dynamically, without application changes.
18334///
18335/// Please consult the [Working with enums] section in the user guide for some
18336/// guidelines.
18337///
18338/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18339#[derive(Clone, Debug, PartialEq)]
18340#[non_exhaustive]
18341pub enum OsType {
18342    /// Unspecified OS Type
18343    Unspecified,
18344    /// OS Type is Linux
18345    Linux,
18346    /// OS Type is Windows
18347    Windows,
18348    /// OS Type is VMware ESXi
18349    Esxi,
18350    /// If set, the enum was initialized with an unknown value.
18351    ///
18352    /// Applications can examine the value using [OsType::value] or
18353    /// [OsType::name].
18354    UnknownValue(os_type::UnknownValue),
18355}
18356
18357#[doc(hidden)]
18358pub mod os_type {
18359    #[allow(unused_imports)]
18360    use super::*;
18361    #[derive(Clone, Debug, PartialEq)]
18362    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18363}
18364
18365impl OsType {
18366    /// Gets the enum value.
18367    ///
18368    /// Returns `None` if the enum contains an unknown value deserialized from
18369    /// the string representation of enums.
18370    pub fn value(&self) -> std::option::Option<i32> {
18371        match self {
18372            Self::Unspecified => std::option::Option::Some(0),
18373            Self::Linux => std::option::Option::Some(1),
18374            Self::Windows => std::option::Option::Some(2),
18375            Self::Esxi => std::option::Option::Some(3),
18376            Self::UnknownValue(u) => u.0.value(),
18377        }
18378    }
18379
18380    /// Gets the enum value as a string.
18381    ///
18382    /// Returns `None` if the enum contains an unknown value deserialized from
18383    /// the integer representation of enums.
18384    pub fn name(&self) -> std::option::Option<&str> {
18385        match self {
18386            Self::Unspecified => std::option::Option::Some("OS_TYPE_UNSPECIFIED"),
18387            Self::Linux => std::option::Option::Some("LINUX"),
18388            Self::Windows => std::option::Option::Some("WINDOWS"),
18389            Self::Esxi => std::option::Option::Some("ESXI"),
18390            Self::UnknownValue(u) => u.0.name(),
18391        }
18392    }
18393}
18394
18395impl std::default::Default for OsType {
18396    fn default() -> Self {
18397        use std::convert::From;
18398        Self::from(0)
18399    }
18400}
18401
18402impl std::fmt::Display for OsType {
18403    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18404        wkt::internal::display_enum(f, self.name(), self.value())
18405    }
18406}
18407
18408impl std::convert::From<i32> for OsType {
18409    fn from(value: i32) -> Self {
18410        match value {
18411            0 => Self::Unspecified,
18412            1 => Self::Linux,
18413            2 => Self::Windows,
18414            3 => Self::Esxi,
18415            _ => Self::UnknownValue(os_type::UnknownValue(
18416                wkt::internal::UnknownEnumValue::Integer(value),
18417            )),
18418        }
18419    }
18420}
18421
18422impl std::convert::From<&str> for OsType {
18423    fn from(value: &str) -> Self {
18424        use std::string::ToString;
18425        match value {
18426            "OS_TYPE_UNSPECIFIED" => Self::Unspecified,
18427            "LINUX" => Self::Linux,
18428            "WINDOWS" => Self::Windows,
18429            "ESXI" => Self::Esxi,
18430            _ => Self::UnknownValue(os_type::UnknownValue(
18431                wkt::internal::UnknownEnumValue::String(value.to_string()),
18432            )),
18433        }
18434    }
18435}
18436
18437impl serde::ser::Serialize for OsType {
18438    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18439    where
18440        S: serde::Serializer,
18441    {
18442        match self {
18443            Self::Unspecified => serializer.serialize_i32(0),
18444            Self::Linux => serializer.serialize_i32(1),
18445            Self::Windows => serializer.serialize_i32(2),
18446            Self::Esxi => serializer.serialize_i32(3),
18447            Self::UnknownValue(u) => u.0.serialize(serializer),
18448        }
18449    }
18450}
18451
18452impl<'de> serde::de::Deserialize<'de> for OsType {
18453    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18454    where
18455        D: serde::Deserializer<'de>,
18456    {
18457        deserializer.deserialize_any(wkt::internal::EnumVisitor::<OsType>::new(
18458            ".google.cloud.netapp.v1.OsType",
18459        ))
18460    }
18461}
18462
18463/// Protocols is an enum of all the supported network protocols for a volume.
18464///
18465/// # Working with unknown values
18466///
18467/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18468/// additional enum variants at any time. Adding new variants is not considered
18469/// a breaking change. Applications should write their code in anticipation of:
18470///
18471/// - New values appearing in future releases of the client library, **and**
18472/// - New values received dynamically, without application changes.
18473///
18474/// Please consult the [Working with enums] section in the user guide for some
18475/// guidelines.
18476///
18477/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18478#[derive(Clone, Debug, PartialEq)]
18479#[non_exhaustive]
18480pub enum Protocols {
18481    /// Unspecified protocol
18482    Unspecified,
18483    /// NFS V3 protocol
18484    Nfsv3,
18485    /// NFS V4 protocol
18486    Nfsv4,
18487    /// SMB protocol
18488    Smb,
18489    /// ISCSI protocol
18490    Iscsi,
18491    /// If set, the enum was initialized with an unknown value.
18492    ///
18493    /// Applications can examine the value using [Protocols::value] or
18494    /// [Protocols::name].
18495    UnknownValue(protocols::UnknownValue),
18496}
18497
18498#[doc(hidden)]
18499pub mod protocols {
18500    #[allow(unused_imports)]
18501    use super::*;
18502    #[derive(Clone, Debug, PartialEq)]
18503    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18504}
18505
18506impl Protocols {
18507    /// Gets the enum value.
18508    ///
18509    /// Returns `None` if the enum contains an unknown value deserialized from
18510    /// the string representation of enums.
18511    pub fn value(&self) -> std::option::Option<i32> {
18512        match self {
18513            Self::Unspecified => std::option::Option::Some(0),
18514            Self::Nfsv3 => std::option::Option::Some(1),
18515            Self::Nfsv4 => std::option::Option::Some(2),
18516            Self::Smb => std::option::Option::Some(3),
18517            Self::Iscsi => std::option::Option::Some(4),
18518            Self::UnknownValue(u) => u.0.value(),
18519        }
18520    }
18521
18522    /// Gets the enum value as a string.
18523    ///
18524    /// Returns `None` if the enum contains an unknown value deserialized from
18525    /// the integer representation of enums.
18526    pub fn name(&self) -> std::option::Option<&str> {
18527        match self {
18528            Self::Unspecified => std::option::Option::Some("PROTOCOLS_UNSPECIFIED"),
18529            Self::Nfsv3 => std::option::Option::Some("NFSV3"),
18530            Self::Nfsv4 => std::option::Option::Some("NFSV4"),
18531            Self::Smb => std::option::Option::Some("SMB"),
18532            Self::Iscsi => std::option::Option::Some("ISCSI"),
18533            Self::UnknownValue(u) => u.0.name(),
18534        }
18535    }
18536}
18537
18538impl std::default::Default for Protocols {
18539    fn default() -> Self {
18540        use std::convert::From;
18541        Self::from(0)
18542    }
18543}
18544
18545impl std::fmt::Display for Protocols {
18546    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18547        wkt::internal::display_enum(f, self.name(), self.value())
18548    }
18549}
18550
18551impl std::convert::From<i32> for Protocols {
18552    fn from(value: i32) -> Self {
18553        match value {
18554            0 => Self::Unspecified,
18555            1 => Self::Nfsv3,
18556            2 => Self::Nfsv4,
18557            3 => Self::Smb,
18558            4 => Self::Iscsi,
18559            _ => Self::UnknownValue(protocols::UnknownValue(
18560                wkt::internal::UnknownEnumValue::Integer(value),
18561            )),
18562        }
18563    }
18564}
18565
18566impl std::convert::From<&str> for Protocols {
18567    fn from(value: &str) -> Self {
18568        use std::string::ToString;
18569        match value {
18570            "PROTOCOLS_UNSPECIFIED" => Self::Unspecified,
18571            "NFSV3" => Self::Nfsv3,
18572            "NFSV4" => Self::Nfsv4,
18573            "SMB" => Self::Smb,
18574            "ISCSI" => Self::Iscsi,
18575            _ => Self::UnknownValue(protocols::UnknownValue(
18576                wkt::internal::UnknownEnumValue::String(value.to_string()),
18577            )),
18578        }
18579    }
18580}
18581
18582impl serde::ser::Serialize for Protocols {
18583    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18584    where
18585        S: serde::Serializer,
18586    {
18587        match self {
18588            Self::Unspecified => serializer.serialize_i32(0),
18589            Self::Nfsv3 => serializer.serialize_i32(1),
18590            Self::Nfsv4 => serializer.serialize_i32(2),
18591            Self::Smb => serializer.serialize_i32(3),
18592            Self::Iscsi => serializer.serialize_i32(4),
18593            Self::UnknownValue(u) => u.0.serialize(serializer),
18594        }
18595    }
18596}
18597
18598impl<'de> serde::de::Deserialize<'de> for Protocols {
18599    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18600    where
18601        D: serde::Deserializer<'de>,
18602    {
18603        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocols>::new(
18604            ".google.cloud.netapp.v1.Protocols",
18605        ))
18606    }
18607}
18608
18609/// AccessType is an enum of all the supported access types for a volume.
18610///
18611/// # Working with unknown values
18612///
18613/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18614/// additional enum variants at any time. Adding new variants is not considered
18615/// a breaking change. Applications should write their code in anticipation of:
18616///
18617/// - New values appearing in future releases of the client library, **and**
18618/// - New values received dynamically, without application changes.
18619///
18620/// Please consult the [Working with enums] section in the user guide for some
18621/// guidelines.
18622///
18623/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18624#[derive(Clone, Debug, PartialEq)]
18625#[non_exhaustive]
18626pub enum AccessType {
18627    /// Unspecified Access Type
18628    Unspecified,
18629    /// Read Only
18630    ReadOnly,
18631    /// Read Write
18632    ReadWrite,
18633    /// None
18634    ReadNone,
18635    /// If set, the enum was initialized with an unknown value.
18636    ///
18637    /// Applications can examine the value using [AccessType::value] or
18638    /// [AccessType::name].
18639    UnknownValue(access_type::UnknownValue),
18640}
18641
18642#[doc(hidden)]
18643pub mod access_type {
18644    #[allow(unused_imports)]
18645    use super::*;
18646    #[derive(Clone, Debug, PartialEq)]
18647    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18648}
18649
18650impl AccessType {
18651    /// Gets the enum value.
18652    ///
18653    /// Returns `None` if the enum contains an unknown value deserialized from
18654    /// the string representation of enums.
18655    pub fn value(&self) -> std::option::Option<i32> {
18656        match self {
18657            Self::Unspecified => std::option::Option::Some(0),
18658            Self::ReadOnly => std::option::Option::Some(1),
18659            Self::ReadWrite => std::option::Option::Some(2),
18660            Self::ReadNone => std::option::Option::Some(3),
18661            Self::UnknownValue(u) => u.0.value(),
18662        }
18663    }
18664
18665    /// Gets the enum value as a string.
18666    ///
18667    /// Returns `None` if the enum contains an unknown value deserialized from
18668    /// the integer representation of enums.
18669    pub fn name(&self) -> std::option::Option<&str> {
18670        match self {
18671            Self::Unspecified => std::option::Option::Some("ACCESS_TYPE_UNSPECIFIED"),
18672            Self::ReadOnly => std::option::Option::Some("READ_ONLY"),
18673            Self::ReadWrite => std::option::Option::Some("READ_WRITE"),
18674            Self::ReadNone => std::option::Option::Some("READ_NONE"),
18675            Self::UnknownValue(u) => u.0.name(),
18676        }
18677    }
18678}
18679
18680impl std::default::Default for AccessType {
18681    fn default() -> Self {
18682        use std::convert::From;
18683        Self::from(0)
18684    }
18685}
18686
18687impl std::fmt::Display for AccessType {
18688    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18689        wkt::internal::display_enum(f, self.name(), self.value())
18690    }
18691}
18692
18693impl std::convert::From<i32> for AccessType {
18694    fn from(value: i32) -> Self {
18695        match value {
18696            0 => Self::Unspecified,
18697            1 => Self::ReadOnly,
18698            2 => Self::ReadWrite,
18699            3 => Self::ReadNone,
18700            _ => Self::UnknownValue(access_type::UnknownValue(
18701                wkt::internal::UnknownEnumValue::Integer(value),
18702            )),
18703        }
18704    }
18705}
18706
18707impl std::convert::From<&str> for AccessType {
18708    fn from(value: &str) -> Self {
18709        use std::string::ToString;
18710        match value {
18711            "ACCESS_TYPE_UNSPECIFIED" => Self::Unspecified,
18712            "READ_ONLY" => Self::ReadOnly,
18713            "READ_WRITE" => Self::ReadWrite,
18714            "READ_NONE" => Self::ReadNone,
18715            _ => Self::UnknownValue(access_type::UnknownValue(
18716                wkt::internal::UnknownEnumValue::String(value.to_string()),
18717            )),
18718        }
18719    }
18720}
18721
18722impl serde::ser::Serialize for AccessType {
18723    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18724    where
18725        S: serde::Serializer,
18726    {
18727        match self {
18728            Self::Unspecified => serializer.serialize_i32(0),
18729            Self::ReadOnly => serializer.serialize_i32(1),
18730            Self::ReadWrite => serializer.serialize_i32(2),
18731            Self::ReadNone => serializer.serialize_i32(3),
18732            Self::UnknownValue(u) => u.0.serialize(serializer),
18733        }
18734    }
18735}
18736
18737impl<'de> serde::de::Deserialize<'de> for AccessType {
18738    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18739    where
18740        D: serde::Deserializer<'de>,
18741    {
18742        deserializer.deserialize_any(wkt::internal::EnumVisitor::<AccessType>::new(
18743            ".google.cloud.netapp.v1.AccessType",
18744        ))
18745    }
18746}
18747
18748/// SMBSettings
18749/// Modifies the behaviour of a SMB volume.
18750///
18751/// # Working with unknown values
18752///
18753/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18754/// additional enum variants at any time. Adding new variants is not considered
18755/// a breaking change. Applications should write their code in anticipation of:
18756///
18757/// - New values appearing in future releases of the client library, **and**
18758/// - New values received dynamically, without application changes.
18759///
18760/// Please consult the [Working with enums] section in the user guide for some
18761/// guidelines.
18762///
18763/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18764#[derive(Clone, Debug, PartialEq)]
18765#[non_exhaustive]
18766pub enum SMBSettings {
18767    /// Unspecified default option
18768    Unspecified,
18769    /// SMB setting encrypt data
18770    EncryptData,
18771    /// SMB setting browsable
18772    Browsable,
18773    /// SMB setting notify change
18774    ChangeNotify,
18775    /// SMB setting not to notify change
18776    NonBrowsable,
18777    /// SMB setting oplocks
18778    Oplocks,
18779    /// SMB setting to show snapshots
18780    ShowSnapshot,
18781    /// SMB setting to show previous versions
18782    ShowPreviousVersions,
18783    /// SMB setting to access volume based on enumerartion
18784    AccessBasedEnumeration,
18785    /// Continuously available enumeration
18786    ContinuouslyAvailable,
18787    /// If set, the enum was initialized with an unknown value.
18788    ///
18789    /// Applications can examine the value using [SMBSettings::value] or
18790    /// [SMBSettings::name].
18791    UnknownValue(smb_settings::UnknownValue),
18792}
18793
18794#[doc(hidden)]
18795pub mod smb_settings {
18796    #[allow(unused_imports)]
18797    use super::*;
18798    #[derive(Clone, Debug, PartialEq)]
18799    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18800}
18801
18802impl SMBSettings {
18803    /// Gets the enum value.
18804    ///
18805    /// Returns `None` if the enum contains an unknown value deserialized from
18806    /// the string representation of enums.
18807    pub fn value(&self) -> std::option::Option<i32> {
18808        match self {
18809            Self::Unspecified => std::option::Option::Some(0),
18810            Self::EncryptData => std::option::Option::Some(1),
18811            Self::Browsable => std::option::Option::Some(2),
18812            Self::ChangeNotify => std::option::Option::Some(3),
18813            Self::NonBrowsable => std::option::Option::Some(4),
18814            Self::Oplocks => std::option::Option::Some(5),
18815            Self::ShowSnapshot => std::option::Option::Some(6),
18816            Self::ShowPreviousVersions => std::option::Option::Some(7),
18817            Self::AccessBasedEnumeration => std::option::Option::Some(8),
18818            Self::ContinuouslyAvailable => std::option::Option::Some(9),
18819            Self::UnknownValue(u) => u.0.value(),
18820        }
18821    }
18822
18823    /// Gets the enum value as a string.
18824    ///
18825    /// Returns `None` if the enum contains an unknown value deserialized from
18826    /// the integer representation of enums.
18827    pub fn name(&self) -> std::option::Option<&str> {
18828        match self {
18829            Self::Unspecified => std::option::Option::Some("SMB_SETTINGS_UNSPECIFIED"),
18830            Self::EncryptData => std::option::Option::Some("ENCRYPT_DATA"),
18831            Self::Browsable => std::option::Option::Some("BROWSABLE"),
18832            Self::ChangeNotify => std::option::Option::Some("CHANGE_NOTIFY"),
18833            Self::NonBrowsable => std::option::Option::Some("NON_BROWSABLE"),
18834            Self::Oplocks => std::option::Option::Some("OPLOCKS"),
18835            Self::ShowSnapshot => std::option::Option::Some("SHOW_SNAPSHOT"),
18836            Self::ShowPreviousVersions => std::option::Option::Some("SHOW_PREVIOUS_VERSIONS"),
18837            Self::AccessBasedEnumeration => std::option::Option::Some("ACCESS_BASED_ENUMERATION"),
18838            Self::ContinuouslyAvailable => std::option::Option::Some("CONTINUOUSLY_AVAILABLE"),
18839            Self::UnknownValue(u) => u.0.name(),
18840        }
18841    }
18842}
18843
18844impl std::default::Default for SMBSettings {
18845    fn default() -> Self {
18846        use std::convert::From;
18847        Self::from(0)
18848    }
18849}
18850
18851impl std::fmt::Display for SMBSettings {
18852    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
18853        wkt::internal::display_enum(f, self.name(), self.value())
18854    }
18855}
18856
18857impl std::convert::From<i32> for SMBSettings {
18858    fn from(value: i32) -> Self {
18859        match value {
18860            0 => Self::Unspecified,
18861            1 => Self::EncryptData,
18862            2 => Self::Browsable,
18863            3 => Self::ChangeNotify,
18864            4 => Self::NonBrowsable,
18865            5 => Self::Oplocks,
18866            6 => Self::ShowSnapshot,
18867            7 => Self::ShowPreviousVersions,
18868            8 => Self::AccessBasedEnumeration,
18869            9 => Self::ContinuouslyAvailable,
18870            _ => Self::UnknownValue(smb_settings::UnknownValue(
18871                wkt::internal::UnknownEnumValue::Integer(value),
18872            )),
18873        }
18874    }
18875}
18876
18877impl std::convert::From<&str> for SMBSettings {
18878    fn from(value: &str) -> Self {
18879        use std::string::ToString;
18880        match value {
18881            "SMB_SETTINGS_UNSPECIFIED" => Self::Unspecified,
18882            "ENCRYPT_DATA" => Self::EncryptData,
18883            "BROWSABLE" => Self::Browsable,
18884            "CHANGE_NOTIFY" => Self::ChangeNotify,
18885            "NON_BROWSABLE" => Self::NonBrowsable,
18886            "OPLOCKS" => Self::Oplocks,
18887            "SHOW_SNAPSHOT" => Self::ShowSnapshot,
18888            "SHOW_PREVIOUS_VERSIONS" => Self::ShowPreviousVersions,
18889            "ACCESS_BASED_ENUMERATION" => Self::AccessBasedEnumeration,
18890            "CONTINUOUSLY_AVAILABLE" => Self::ContinuouslyAvailable,
18891            _ => Self::UnknownValue(smb_settings::UnknownValue(
18892                wkt::internal::UnknownEnumValue::String(value.to_string()),
18893            )),
18894        }
18895    }
18896}
18897
18898impl serde::ser::Serialize for SMBSettings {
18899    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
18900    where
18901        S: serde::Serializer,
18902    {
18903        match self {
18904            Self::Unspecified => serializer.serialize_i32(0),
18905            Self::EncryptData => serializer.serialize_i32(1),
18906            Self::Browsable => serializer.serialize_i32(2),
18907            Self::ChangeNotify => serializer.serialize_i32(3),
18908            Self::NonBrowsable => serializer.serialize_i32(4),
18909            Self::Oplocks => serializer.serialize_i32(5),
18910            Self::ShowSnapshot => serializer.serialize_i32(6),
18911            Self::ShowPreviousVersions => serializer.serialize_i32(7),
18912            Self::AccessBasedEnumeration => serializer.serialize_i32(8),
18913            Self::ContinuouslyAvailable => serializer.serialize_i32(9),
18914            Self::UnknownValue(u) => u.0.serialize(serializer),
18915        }
18916    }
18917}
18918
18919impl<'de> serde::de::Deserialize<'de> for SMBSettings {
18920    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
18921    where
18922        D: serde::Deserializer<'de>,
18923    {
18924        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SMBSettings>::new(
18925            ".google.cloud.netapp.v1.SMBSettings",
18926        ))
18927    }
18928}
18929
18930/// The security style of the volume, can be either UNIX or NTFS.
18931///
18932/// # Working with unknown values
18933///
18934/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
18935/// additional enum variants at any time. Adding new variants is not considered
18936/// a breaking change. Applications should write their code in anticipation of:
18937///
18938/// - New values appearing in future releases of the client library, **and**
18939/// - New values received dynamically, without application changes.
18940///
18941/// Please consult the [Working with enums] section in the user guide for some
18942/// guidelines.
18943///
18944/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
18945#[derive(Clone, Debug, PartialEq)]
18946#[non_exhaustive]
18947pub enum SecurityStyle {
18948    /// SecurityStyle is unspecified
18949    Unspecified,
18950    /// SecurityStyle uses NTFS
18951    Ntfs,
18952    /// SecurityStyle uses UNIX
18953    Unix,
18954    /// If set, the enum was initialized with an unknown value.
18955    ///
18956    /// Applications can examine the value using [SecurityStyle::value] or
18957    /// [SecurityStyle::name].
18958    UnknownValue(security_style::UnknownValue),
18959}
18960
18961#[doc(hidden)]
18962pub mod security_style {
18963    #[allow(unused_imports)]
18964    use super::*;
18965    #[derive(Clone, Debug, PartialEq)]
18966    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
18967}
18968
18969impl SecurityStyle {
18970    /// Gets the enum value.
18971    ///
18972    /// Returns `None` if the enum contains an unknown value deserialized from
18973    /// the string representation of enums.
18974    pub fn value(&self) -> std::option::Option<i32> {
18975        match self {
18976            Self::Unspecified => std::option::Option::Some(0),
18977            Self::Ntfs => std::option::Option::Some(1),
18978            Self::Unix => std::option::Option::Some(2),
18979            Self::UnknownValue(u) => u.0.value(),
18980        }
18981    }
18982
18983    /// Gets the enum value as a string.
18984    ///
18985    /// Returns `None` if the enum contains an unknown value deserialized from
18986    /// the integer representation of enums.
18987    pub fn name(&self) -> std::option::Option<&str> {
18988        match self {
18989            Self::Unspecified => std::option::Option::Some("SECURITY_STYLE_UNSPECIFIED"),
18990            Self::Ntfs => std::option::Option::Some("NTFS"),
18991            Self::Unix => std::option::Option::Some("UNIX"),
18992            Self::UnknownValue(u) => u.0.name(),
18993        }
18994    }
18995}
18996
18997impl std::default::Default for SecurityStyle {
18998    fn default() -> Self {
18999        use std::convert::From;
19000        Self::from(0)
19001    }
19002}
19003
19004impl std::fmt::Display for SecurityStyle {
19005    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19006        wkt::internal::display_enum(f, self.name(), self.value())
19007    }
19008}
19009
19010impl std::convert::From<i32> for SecurityStyle {
19011    fn from(value: i32) -> Self {
19012        match value {
19013            0 => Self::Unspecified,
19014            1 => Self::Ntfs,
19015            2 => Self::Unix,
19016            _ => Self::UnknownValue(security_style::UnknownValue(
19017                wkt::internal::UnknownEnumValue::Integer(value),
19018            )),
19019        }
19020    }
19021}
19022
19023impl std::convert::From<&str> for SecurityStyle {
19024    fn from(value: &str) -> Self {
19025        use std::string::ToString;
19026        match value {
19027            "SECURITY_STYLE_UNSPECIFIED" => Self::Unspecified,
19028            "NTFS" => Self::Ntfs,
19029            "UNIX" => Self::Unix,
19030            _ => Self::UnknownValue(security_style::UnknownValue(
19031                wkt::internal::UnknownEnumValue::String(value.to_string()),
19032            )),
19033        }
19034    }
19035}
19036
19037impl serde::ser::Serialize for SecurityStyle {
19038    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19039    where
19040        S: serde::Serializer,
19041    {
19042        match self {
19043            Self::Unspecified => serializer.serialize_i32(0),
19044            Self::Ntfs => serializer.serialize_i32(1),
19045            Self::Unix => serializer.serialize_i32(2),
19046            Self::UnknownValue(u) => u.0.serialize(serializer),
19047        }
19048    }
19049}
19050
19051impl<'de> serde::de::Deserialize<'de> for SecurityStyle {
19052    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19053    where
19054        D: serde::Deserializer<'de>,
19055    {
19056        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SecurityStyle>::new(
19057            ".google.cloud.netapp.v1.SecurityStyle",
19058        ))
19059    }
19060}
19061
19062/// Actions to be restricted for a volume.
19063///
19064/// # Working with unknown values
19065///
19066/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
19067/// additional enum variants at any time. Adding new variants is not considered
19068/// a breaking change. Applications should write their code in anticipation of:
19069///
19070/// - New values appearing in future releases of the client library, **and**
19071/// - New values received dynamically, without application changes.
19072///
19073/// Please consult the [Working with enums] section in the user guide for some
19074/// guidelines.
19075///
19076/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
19077#[derive(Clone, Debug, PartialEq)]
19078#[non_exhaustive]
19079pub enum RestrictedAction {
19080    /// Unspecified restricted action
19081    Unspecified,
19082    /// Prevent volume from being deleted when mounted.
19083    Delete,
19084    /// If set, the enum was initialized with an unknown value.
19085    ///
19086    /// Applications can examine the value using [RestrictedAction::value] or
19087    /// [RestrictedAction::name].
19088    UnknownValue(restricted_action::UnknownValue),
19089}
19090
19091#[doc(hidden)]
19092pub mod restricted_action {
19093    #[allow(unused_imports)]
19094    use super::*;
19095    #[derive(Clone, Debug, PartialEq)]
19096    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
19097}
19098
19099impl RestrictedAction {
19100    /// Gets the enum value.
19101    ///
19102    /// Returns `None` if the enum contains an unknown value deserialized from
19103    /// the string representation of enums.
19104    pub fn value(&self) -> std::option::Option<i32> {
19105        match self {
19106            Self::Unspecified => std::option::Option::Some(0),
19107            Self::Delete => std::option::Option::Some(1),
19108            Self::UnknownValue(u) => u.0.value(),
19109        }
19110    }
19111
19112    /// Gets the enum value as a string.
19113    ///
19114    /// Returns `None` if the enum contains an unknown value deserialized from
19115    /// the integer representation of enums.
19116    pub fn name(&self) -> std::option::Option<&str> {
19117        match self {
19118            Self::Unspecified => std::option::Option::Some("RESTRICTED_ACTION_UNSPECIFIED"),
19119            Self::Delete => std::option::Option::Some("DELETE"),
19120            Self::UnknownValue(u) => u.0.name(),
19121        }
19122    }
19123}
19124
19125impl std::default::Default for RestrictedAction {
19126    fn default() -> Self {
19127        use std::convert::From;
19128        Self::from(0)
19129    }
19130}
19131
19132impl std::fmt::Display for RestrictedAction {
19133    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
19134        wkt::internal::display_enum(f, self.name(), self.value())
19135    }
19136}
19137
19138impl std::convert::From<i32> for RestrictedAction {
19139    fn from(value: i32) -> Self {
19140        match value {
19141            0 => Self::Unspecified,
19142            1 => Self::Delete,
19143            _ => Self::UnknownValue(restricted_action::UnknownValue(
19144                wkt::internal::UnknownEnumValue::Integer(value),
19145            )),
19146        }
19147    }
19148}
19149
19150impl std::convert::From<&str> for RestrictedAction {
19151    fn from(value: &str) -> Self {
19152        use std::string::ToString;
19153        match value {
19154            "RESTRICTED_ACTION_UNSPECIFIED" => Self::Unspecified,
19155            "DELETE" => Self::Delete,
19156            _ => Self::UnknownValue(restricted_action::UnknownValue(
19157                wkt::internal::UnknownEnumValue::String(value.to_string()),
19158            )),
19159        }
19160    }
19161}
19162
19163impl serde::ser::Serialize for RestrictedAction {
19164    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
19165    where
19166        S: serde::Serializer,
19167    {
19168        match self {
19169            Self::Unspecified => serializer.serialize_i32(0),
19170            Self::Delete => serializer.serialize_i32(1),
19171            Self::UnknownValue(u) => u.0.serialize(serializer),
19172        }
19173    }
19174}
19175
19176impl<'de> serde::de::Deserialize<'de> for RestrictedAction {
19177    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
19178    where
19179        D: serde::Deserializer<'de>,
19180    {
19181        deserializer.deserialize_any(wkt::internal::EnumVisitor::<RestrictedAction>::new(
19182            ".google.cloud.netapp.v1.RestrictedAction",
19183        ))
19184    }
19185}