google_cloud_netapp_v1/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate location;
26extern crate longrunning;
27extern crate lro;
28extern crate reqwest;
29extern crate serde;
30extern crate serde_json;
31extern crate serde_with;
32extern crate std;
33extern crate tracing;
34extern crate wkt;
35
36mod debug;
37mod deserialize;
38mod serialize;
39
40/// ListActiveDirectoriesRequest for requesting multiple active directories.
41#[derive(Clone, Default, PartialEq)]
42#[non_exhaustive]
43pub struct ListActiveDirectoriesRequest {
44 /// Required. Parent value for ListActiveDirectoriesRequest
45 pub parent: std::string::String,
46
47 /// Requested page size. Server may return fewer items than requested.
48 /// If unspecified, the server will pick an appropriate default.
49 pub page_size: i32,
50
51 /// A token identifying a page of results the server should return.
52 pub page_token: std::string::String,
53
54 /// Filtering results
55 pub filter: std::string::String,
56
57 /// Hint for how to order the results
58 pub order_by: std::string::String,
59
60 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
61}
62
63impl ListActiveDirectoriesRequest {
64 pub fn new() -> Self {
65 std::default::Default::default()
66 }
67
68 /// Sets the value of [parent][crate::model::ListActiveDirectoriesRequest::parent].
69 ///
70 /// # Example
71 /// ```ignore,no_run
72 /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
73 /// let x = ListActiveDirectoriesRequest::new().set_parent("example");
74 /// ```
75 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
76 self.parent = v.into();
77 self
78 }
79
80 /// Sets the value of [page_size][crate::model::ListActiveDirectoriesRequest::page_size].
81 ///
82 /// # Example
83 /// ```ignore,no_run
84 /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
85 /// let x = ListActiveDirectoriesRequest::new().set_page_size(42);
86 /// ```
87 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
88 self.page_size = v.into();
89 self
90 }
91
92 /// Sets the value of [page_token][crate::model::ListActiveDirectoriesRequest::page_token].
93 ///
94 /// # Example
95 /// ```ignore,no_run
96 /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
97 /// let x = ListActiveDirectoriesRequest::new().set_page_token("example");
98 /// ```
99 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
100 self.page_token = v.into();
101 self
102 }
103
104 /// Sets the value of [filter][crate::model::ListActiveDirectoriesRequest::filter].
105 ///
106 /// # Example
107 /// ```ignore,no_run
108 /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
109 /// let x = ListActiveDirectoriesRequest::new().set_filter("example");
110 /// ```
111 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
112 self.filter = v.into();
113 self
114 }
115
116 /// Sets the value of [order_by][crate::model::ListActiveDirectoriesRequest::order_by].
117 ///
118 /// # Example
119 /// ```ignore,no_run
120 /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesRequest;
121 /// let x = ListActiveDirectoriesRequest::new().set_order_by("example");
122 /// ```
123 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
124 self.order_by = v.into();
125 self
126 }
127}
128
129impl wkt::message::Message for ListActiveDirectoriesRequest {
130 fn typename() -> &'static str {
131 "type.googleapis.com/google.cloud.netapp.v1.ListActiveDirectoriesRequest"
132 }
133}
134
135/// ListActiveDirectoriesResponse contains all the active directories requested.
136#[derive(Clone, Default, PartialEq)]
137#[non_exhaustive]
138pub struct ListActiveDirectoriesResponse {
139 /// The list of active directories.
140 pub active_directories: std::vec::Vec<crate::model::ActiveDirectory>,
141
142 /// A token identifying a page of results the server should return.
143 pub next_page_token: std::string::String,
144
145 /// Locations that could not be reached.
146 pub unreachable: std::vec::Vec<std::string::String>,
147
148 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
149}
150
151impl ListActiveDirectoriesResponse {
152 pub fn new() -> Self {
153 std::default::Default::default()
154 }
155
156 /// Sets the value of [active_directories][crate::model::ListActiveDirectoriesResponse::active_directories].
157 ///
158 /// # Example
159 /// ```ignore,no_run
160 /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesResponse;
161 /// use google_cloud_netapp_v1::model::ActiveDirectory;
162 /// let x = ListActiveDirectoriesResponse::new()
163 /// .set_active_directories([
164 /// ActiveDirectory::default()/* use setters */,
165 /// ActiveDirectory::default()/* use (different) setters */,
166 /// ]);
167 /// ```
168 pub fn set_active_directories<T, V>(mut self, v: T) -> Self
169 where
170 T: std::iter::IntoIterator<Item = V>,
171 V: std::convert::Into<crate::model::ActiveDirectory>,
172 {
173 use std::iter::Iterator;
174 self.active_directories = v.into_iter().map(|i| i.into()).collect();
175 self
176 }
177
178 /// Sets the value of [next_page_token][crate::model::ListActiveDirectoriesResponse::next_page_token].
179 ///
180 /// # Example
181 /// ```ignore,no_run
182 /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesResponse;
183 /// let x = ListActiveDirectoriesResponse::new().set_next_page_token("example");
184 /// ```
185 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
186 self.next_page_token = v.into();
187 self
188 }
189
190 /// Sets the value of [unreachable][crate::model::ListActiveDirectoriesResponse::unreachable].
191 ///
192 /// # Example
193 /// ```ignore,no_run
194 /// # use google_cloud_netapp_v1::model::ListActiveDirectoriesResponse;
195 /// let x = ListActiveDirectoriesResponse::new().set_unreachable(["a", "b", "c"]);
196 /// ```
197 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
198 where
199 T: std::iter::IntoIterator<Item = V>,
200 V: std::convert::Into<std::string::String>,
201 {
202 use std::iter::Iterator;
203 self.unreachable = v.into_iter().map(|i| i.into()).collect();
204 self
205 }
206}
207
208impl wkt::message::Message for ListActiveDirectoriesResponse {
209 fn typename() -> &'static str {
210 "type.googleapis.com/google.cloud.netapp.v1.ListActiveDirectoriesResponse"
211 }
212}
213
214#[doc(hidden)]
215impl gax::paginator::internal::PageableResponse for ListActiveDirectoriesResponse {
216 type PageItem = crate::model::ActiveDirectory;
217
218 fn items(self) -> std::vec::Vec<Self::PageItem> {
219 self.active_directories
220 }
221
222 fn next_page_token(&self) -> std::string::String {
223 use std::clone::Clone;
224 self.next_page_token.clone()
225 }
226}
227
228/// GetActiveDirectory for getting a single active directory.
229#[derive(Clone, Default, PartialEq)]
230#[non_exhaustive]
231pub struct GetActiveDirectoryRequest {
232 /// Required. Name of the active directory.
233 pub name: std::string::String,
234
235 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
236}
237
238impl GetActiveDirectoryRequest {
239 pub fn new() -> Self {
240 std::default::Default::default()
241 }
242
243 /// Sets the value of [name][crate::model::GetActiveDirectoryRequest::name].
244 ///
245 /// # Example
246 /// ```ignore,no_run
247 /// # use google_cloud_netapp_v1::model::GetActiveDirectoryRequest;
248 /// let x = GetActiveDirectoryRequest::new().set_name("example");
249 /// ```
250 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
251 self.name = v.into();
252 self
253 }
254}
255
256impl wkt::message::Message for GetActiveDirectoryRequest {
257 fn typename() -> &'static str {
258 "type.googleapis.com/google.cloud.netapp.v1.GetActiveDirectoryRequest"
259 }
260}
261
262/// CreateActiveDirectoryRequest for creating an active directory.
263#[derive(Clone, Default, PartialEq)]
264#[non_exhaustive]
265pub struct CreateActiveDirectoryRequest {
266 /// Required. Value for parent.
267 pub parent: std::string::String,
268
269 /// Required. Fields of the to be created active directory.
270 pub active_directory: std::option::Option<crate::model::ActiveDirectory>,
271
272 /// Required. ID of the active directory to create. Must be unique within the
273 /// parent resource. Must contain only letters, numbers and hyphen, with the
274 /// first character a letter , the last a letter or a number, and a 63
275 /// character maximum.
276 pub active_directory_id: std::string::String,
277
278 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
279}
280
281impl CreateActiveDirectoryRequest {
282 pub fn new() -> Self {
283 std::default::Default::default()
284 }
285
286 /// Sets the value of [parent][crate::model::CreateActiveDirectoryRequest::parent].
287 ///
288 /// # Example
289 /// ```ignore,no_run
290 /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
291 /// let x = CreateActiveDirectoryRequest::new().set_parent("example");
292 /// ```
293 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
294 self.parent = v.into();
295 self
296 }
297
298 /// Sets the value of [active_directory][crate::model::CreateActiveDirectoryRequest::active_directory].
299 ///
300 /// # Example
301 /// ```ignore,no_run
302 /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
303 /// use google_cloud_netapp_v1::model::ActiveDirectory;
304 /// let x = CreateActiveDirectoryRequest::new().set_active_directory(ActiveDirectory::default()/* use setters */);
305 /// ```
306 pub fn set_active_directory<T>(mut self, v: T) -> Self
307 where
308 T: std::convert::Into<crate::model::ActiveDirectory>,
309 {
310 self.active_directory = std::option::Option::Some(v.into());
311 self
312 }
313
314 /// Sets or clears the value of [active_directory][crate::model::CreateActiveDirectoryRequest::active_directory].
315 ///
316 /// # Example
317 /// ```ignore,no_run
318 /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
319 /// use google_cloud_netapp_v1::model::ActiveDirectory;
320 /// let x = CreateActiveDirectoryRequest::new().set_or_clear_active_directory(Some(ActiveDirectory::default()/* use setters */));
321 /// let x = CreateActiveDirectoryRequest::new().set_or_clear_active_directory(None::<ActiveDirectory>);
322 /// ```
323 pub fn set_or_clear_active_directory<T>(mut self, v: std::option::Option<T>) -> Self
324 where
325 T: std::convert::Into<crate::model::ActiveDirectory>,
326 {
327 self.active_directory = v.map(|x| x.into());
328 self
329 }
330
331 /// Sets the value of [active_directory_id][crate::model::CreateActiveDirectoryRequest::active_directory_id].
332 ///
333 /// # Example
334 /// ```ignore,no_run
335 /// # use google_cloud_netapp_v1::model::CreateActiveDirectoryRequest;
336 /// let x = CreateActiveDirectoryRequest::new().set_active_directory_id("example");
337 /// ```
338 pub fn set_active_directory_id<T: std::convert::Into<std::string::String>>(
339 mut self,
340 v: T,
341 ) -> Self {
342 self.active_directory_id = v.into();
343 self
344 }
345}
346
347impl wkt::message::Message for CreateActiveDirectoryRequest {
348 fn typename() -> &'static str {
349 "type.googleapis.com/google.cloud.netapp.v1.CreateActiveDirectoryRequest"
350 }
351}
352
353/// UpdateActiveDirectoryRequest for updating an active directory.
354#[derive(Clone, Default, PartialEq)]
355#[non_exhaustive]
356pub struct UpdateActiveDirectoryRequest {
357 /// Required. Field mask is used to specify the fields to be overwritten in the
358 /// Active Directory resource by the update.
359 /// The fields specified in the update_mask are relative to the resource, not
360 /// the full request. A field will be overwritten if it is in the mask. If the
361 /// user does not provide a mask then all fields will be overwritten.
362 pub update_mask: std::option::Option<wkt::FieldMask>,
363
364 /// Required. The volume being updated
365 pub active_directory: std::option::Option<crate::model::ActiveDirectory>,
366
367 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
368}
369
370impl UpdateActiveDirectoryRequest {
371 pub fn new() -> Self {
372 std::default::Default::default()
373 }
374
375 /// Sets the value of [update_mask][crate::model::UpdateActiveDirectoryRequest::update_mask].
376 ///
377 /// # Example
378 /// ```ignore,no_run
379 /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
380 /// use wkt::FieldMask;
381 /// let x = UpdateActiveDirectoryRequest::new().set_update_mask(FieldMask::default()/* use setters */);
382 /// ```
383 pub fn set_update_mask<T>(mut self, v: T) -> Self
384 where
385 T: std::convert::Into<wkt::FieldMask>,
386 {
387 self.update_mask = std::option::Option::Some(v.into());
388 self
389 }
390
391 /// Sets or clears the value of [update_mask][crate::model::UpdateActiveDirectoryRequest::update_mask].
392 ///
393 /// # Example
394 /// ```ignore,no_run
395 /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
396 /// use wkt::FieldMask;
397 /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
398 /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_update_mask(None::<FieldMask>);
399 /// ```
400 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
401 where
402 T: std::convert::Into<wkt::FieldMask>,
403 {
404 self.update_mask = v.map(|x| x.into());
405 self
406 }
407
408 /// Sets the value of [active_directory][crate::model::UpdateActiveDirectoryRequest::active_directory].
409 ///
410 /// # Example
411 /// ```ignore,no_run
412 /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
413 /// use google_cloud_netapp_v1::model::ActiveDirectory;
414 /// let x = UpdateActiveDirectoryRequest::new().set_active_directory(ActiveDirectory::default()/* use setters */);
415 /// ```
416 pub fn set_active_directory<T>(mut self, v: T) -> Self
417 where
418 T: std::convert::Into<crate::model::ActiveDirectory>,
419 {
420 self.active_directory = std::option::Option::Some(v.into());
421 self
422 }
423
424 /// Sets or clears the value of [active_directory][crate::model::UpdateActiveDirectoryRequest::active_directory].
425 ///
426 /// # Example
427 /// ```ignore,no_run
428 /// # use google_cloud_netapp_v1::model::UpdateActiveDirectoryRequest;
429 /// use google_cloud_netapp_v1::model::ActiveDirectory;
430 /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_active_directory(Some(ActiveDirectory::default()/* use setters */));
431 /// let x = UpdateActiveDirectoryRequest::new().set_or_clear_active_directory(None::<ActiveDirectory>);
432 /// ```
433 pub fn set_or_clear_active_directory<T>(mut self, v: std::option::Option<T>) -> Self
434 where
435 T: std::convert::Into<crate::model::ActiveDirectory>,
436 {
437 self.active_directory = v.map(|x| x.into());
438 self
439 }
440}
441
442impl wkt::message::Message for UpdateActiveDirectoryRequest {
443 fn typename() -> &'static str {
444 "type.googleapis.com/google.cloud.netapp.v1.UpdateActiveDirectoryRequest"
445 }
446}
447
448/// DeleteActiveDirectoryRequest for deleting a single active directory.
449#[derive(Clone, Default, PartialEq)]
450#[non_exhaustive]
451pub struct DeleteActiveDirectoryRequest {
452 /// Required. Name of the active directory.
453 pub name: std::string::String,
454
455 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
456}
457
458impl DeleteActiveDirectoryRequest {
459 pub fn new() -> Self {
460 std::default::Default::default()
461 }
462
463 /// Sets the value of [name][crate::model::DeleteActiveDirectoryRequest::name].
464 ///
465 /// # Example
466 /// ```ignore,no_run
467 /// # use google_cloud_netapp_v1::model::DeleteActiveDirectoryRequest;
468 /// let x = DeleteActiveDirectoryRequest::new().set_name("example");
469 /// ```
470 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
471 self.name = v.into();
472 self
473 }
474}
475
476impl wkt::message::Message for DeleteActiveDirectoryRequest {
477 fn typename() -> &'static str {
478 "type.googleapis.com/google.cloud.netapp.v1.DeleteActiveDirectoryRequest"
479 }
480}
481
482/// ActiveDirectory is the public representation of the active directory config.
483#[derive(Clone, Default, PartialEq)]
484#[non_exhaustive]
485pub struct ActiveDirectory {
486 /// Identifier. The resource name of the active directory.
487 /// Format:
488 /// `projects/{project_number}/locations/{location_id}/activeDirectories/{active_directory_id}`.
489 pub name: std::string::String,
490
491 /// Output only. Create time of the active directory.
492 pub create_time: std::option::Option<wkt::Timestamp>,
493
494 /// Output only. The state of the AD.
495 pub state: crate::model::active_directory::State,
496
497 /// Required. Name of the Active Directory domain
498 pub domain: std::string::String,
499
500 /// The Active Directory site the service will limit Domain Controller
501 /// discovery too.
502 pub site: std::string::String,
503
504 /// Required. Comma separated list of DNS server IP addresses for the Active
505 /// Directory domain.
506 pub dns: std::string::String,
507
508 /// Required. NetBIOSPrefix is used as a prefix for SMB server name.
509 pub net_bios_prefix: std::string::String,
510
511 /// The Organizational Unit (OU) within the Windows Active Directory the user
512 /// belongs to.
513 pub organizational_unit: std::string::String,
514
515 /// If enabled, AES encryption will be enabled for SMB communication.
516 pub aes_encryption: bool,
517
518 /// Required. Username of the Active Directory domain administrator.
519 pub username: std::string::String,
520
521 /// Required. Password of the Active Directory domain administrator.
522 pub password: std::string::String,
523
524 /// Optional. Users to be added to the Built-in Backup Operator active
525 /// directory group.
526 pub backup_operators: std::vec::Vec<std::string::String>,
527
528 /// Optional. Users to be added to the Built-in Admininstrators group.
529 pub administrators: std::vec::Vec<std::string::String>,
530
531 /// Optional. Domain users to be given the SeSecurityPrivilege.
532 pub security_operators: std::vec::Vec<std::string::String>,
533
534 /// Name of the active directory machine. This optional parameter is used only
535 /// while creating kerberos volume
536 pub kdc_hostname: std::string::String,
537
538 /// KDC server IP address for the active directory machine.
539 pub kdc_ip: std::string::String,
540
541 /// If enabled, will allow access to local users and LDAP users. If access is
542 /// needed for only LDAP users, it has to be disabled.
543 pub nfs_users_with_ldap: bool,
544
545 /// Description of the active directory.
546 pub description: std::string::String,
547
548 /// Specifies whether or not the LDAP traffic needs to be signed.
549 pub ldap_signing: bool,
550
551 /// If enabled, traffic between the SMB server to Domain Controller (DC) will
552 /// be encrypted.
553 pub encrypt_dc_connections: bool,
554
555 /// Labels for the active directory.
556 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
557
558 /// Output only. The state details of the Active Directory.
559 pub state_details: std::string::String,
560
561 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
562}
563
564impl ActiveDirectory {
565 pub fn new() -> Self {
566 std::default::Default::default()
567 }
568
569 /// Sets the value of [name][crate::model::ActiveDirectory::name].
570 ///
571 /// # Example
572 /// ```ignore,no_run
573 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
574 /// let x = ActiveDirectory::new().set_name("example");
575 /// ```
576 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
577 self.name = v.into();
578 self
579 }
580
581 /// Sets the value of [create_time][crate::model::ActiveDirectory::create_time].
582 ///
583 /// # Example
584 /// ```ignore,no_run
585 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
586 /// use wkt::Timestamp;
587 /// let x = ActiveDirectory::new().set_create_time(Timestamp::default()/* use setters */);
588 /// ```
589 pub fn set_create_time<T>(mut self, v: T) -> Self
590 where
591 T: std::convert::Into<wkt::Timestamp>,
592 {
593 self.create_time = std::option::Option::Some(v.into());
594 self
595 }
596
597 /// Sets or clears the value of [create_time][crate::model::ActiveDirectory::create_time].
598 ///
599 /// # Example
600 /// ```ignore,no_run
601 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
602 /// use wkt::Timestamp;
603 /// let x = ActiveDirectory::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
604 /// let x = ActiveDirectory::new().set_or_clear_create_time(None::<Timestamp>);
605 /// ```
606 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
607 where
608 T: std::convert::Into<wkt::Timestamp>,
609 {
610 self.create_time = v.map(|x| x.into());
611 self
612 }
613
614 /// Sets the value of [state][crate::model::ActiveDirectory::state].
615 ///
616 /// # Example
617 /// ```ignore,no_run
618 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
619 /// use google_cloud_netapp_v1::model::active_directory::State;
620 /// let x0 = ActiveDirectory::new().set_state(State::Creating);
621 /// let x1 = ActiveDirectory::new().set_state(State::Ready);
622 /// let x2 = ActiveDirectory::new().set_state(State::Updating);
623 /// ```
624 pub fn set_state<T: std::convert::Into<crate::model::active_directory::State>>(
625 mut self,
626 v: T,
627 ) -> Self {
628 self.state = v.into();
629 self
630 }
631
632 /// Sets the value of [domain][crate::model::ActiveDirectory::domain].
633 ///
634 /// # Example
635 /// ```ignore,no_run
636 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
637 /// let x = ActiveDirectory::new().set_domain("example");
638 /// ```
639 pub fn set_domain<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
640 self.domain = v.into();
641 self
642 }
643
644 /// Sets the value of [site][crate::model::ActiveDirectory::site].
645 ///
646 /// # Example
647 /// ```ignore,no_run
648 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
649 /// let x = ActiveDirectory::new().set_site("example");
650 /// ```
651 pub fn set_site<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
652 self.site = v.into();
653 self
654 }
655
656 /// Sets the value of [dns][crate::model::ActiveDirectory::dns].
657 ///
658 /// # Example
659 /// ```ignore,no_run
660 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
661 /// let x = ActiveDirectory::new().set_dns("example");
662 /// ```
663 pub fn set_dns<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
664 self.dns = v.into();
665 self
666 }
667
668 /// Sets the value of [net_bios_prefix][crate::model::ActiveDirectory::net_bios_prefix].
669 ///
670 /// # Example
671 /// ```ignore,no_run
672 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
673 /// let x = ActiveDirectory::new().set_net_bios_prefix("example");
674 /// ```
675 pub fn set_net_bios_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
676 self.net_bios_prefix = v.into();
677 self
678 }
679
680 /// Sets the value of [organizational_unit][crate::model::ActiveDirectory::organizational_unit].
681 ///
682 /// # Example
683 /// ```ignore,no_run
684 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
685 /// let x = ActiveDirectory::new().set_organizational_unit("example");
686 /// ```
687 pub fn set_organizational_unit<T: std::convert::Into<std::string::String>>(
688 mut self,
689 v: T,
690 ) -> Self {
691 self.organizational_unit = v.into();
692 self
693 }
694
695 /// Sets the value of [aes_encryption][crate::model::ActiveDirectory::aes_encryption].
696 ///
697 /// # Example
698 /// ```ignore,no_run
699 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
700 /// let x = ActiveDirectory::new().set_aes_encryption(true);
701 /// ```
702 pub fn set_aes_encryption<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
703 self.aes_encryption = v.into();
704 self
705 }
706
707 /// Sets the value of [username][crate::model::ActiveDirectory::username].
708 ///
709 /// # Example
710 /// ```ignore,no_run
711 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
712 /// let x = ActiveDirectory::new().set_username("example");
713 /// ```
714 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
715 self.username = v.into();
716 self
717 }
718
719 /// Sets the value of [password][crate::model::ActiveDirectory::password].
720 ///
721 /// # Example
722 /// ```ignore,no_run
723 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
724 /// let x = ActiveDirectory::new().set_password("example");
725 /// ```
726 pub fn set_password<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
727 self.password = v.into();
728 self
729 }
730
731 /// Sets the value of [backup_operators][crate::model::ActiveDirectory::backup_operators].
732 ///
733 /// # Example
734 /// ```ignore,no_run
735 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
736 /// let x = ActiveDirectory::new().set_backup_operators(["a", "b", "c"]);
737 /// ```
738 pub fn set_backup_operators<T, V>(mut self, v: T) -> Self
739 where
740 T: std::iter::IntoIterator<Item = V>,
741 V: std::convert::Into<std::string::String>,
742 {
743 use std::iter::Iterator;
744 self.backup_operators = v.into_iter().map(|i| i.into()).collect();
745 self
746 }
747
748 /// Sets the value of [administrators][crate::model::ActiveDirectory::administrators].
749 ///
750 /// # Example
751 /// ```ignore,no_run
752 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
753 /// let x = ActiveDirectory::new().set_administrators(["a", "b", "c"]);
754 /// ```
755 pub fn set_administrators<T, V>(mut self, v: T) -> Self
756 where
757 T: std::iter::IntoIterator<Item = V>,
758 V: std::convert::Into<std::string::String>,
759 {
760 use std::iter::Iterator;
761 self.administrators = v.into_iter().map(|i| i.into()).collect();
762 self
763 }
764
765 /// Sets the value of [security_operators][crate::model::ActiveDirectory::security_operators].
766 ///
767 /// # Example
768 /// ```ignore,no_run
769 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
770 /// let x = ActiveDirectory::new().set_security_operators(["a", "b", "c"]);
771 /// ```
772 pub fn set_security_operators<T, V>(mut self, v: T) -> Self
773 where
774 T: std::iter::IntoIterator<Item = V>,
775 V: std::convert::Into<std::string::String>,
776 {
777 use std::iter::Iterator;
778 self.security_operators = v.into_iter().map(|i| i.into()).collect();
779 self
780 }
781
782 /// Sets the value of [kdc_hostname][crate::model::ActiveDirectory::kdc_hostname].
783 ///
784 /// # Example
785 /// ```ignore,no_run
786 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
787 /// let x = ActiveDirectory::new().set_kdc_hostname("example");
788 /// ```
789 pub fn set_kdc_hostname<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
790 self.kdc_hostname = v.into();
791 self
792 }
793
794 /// Sets the value of [kdc_ip][crate::model::ActiveDirectory::kdc_ip].
795 ///
796 /// # Example
797 /// ```ignore,no_run
798 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
799 /// let x = ActiveDirectory::new().set_kdc_ip("example");
800 /// ```
801 pub fn set_kdc_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
802 self.kdc_ip = v.into();
803 self
804 }
805
806 /// Sets the value of [nfs_users_with_ldap][crate::model::ActiveDirectory::nfs_users_with_ldap].
807 ///
808 /// # Example
809 /// ```ignore,no_run
810 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
811 /// let x = ActiveDirectory::new().set_nfs_users_with_ldap(true);
812 /// ```
813 pub fn set_nfs_users_with_ldap<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
814 self.nfs_users_with_ldap = v.into();
815 self
816 }
817
818 /// Sets the value of [description][crate::model::ActiveDirectory::description].
819 ///
820 /// # Example
821 /// ```ignore,no_run
822 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
823 /// let x = ActiveDirectory::new().set_description("example");
824 /// ```
825 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
826 self.description = v.into();
827 self
828 }
829
830 /// Sets the value of [ldap_signing][crate::model::ActiveDirectory::ldap_signing].
831 ///
832 /// # Example
833 /// ```ignore,no_run
834 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
835 /// let x = ActiveDirectory::new().set_ldap_signing(true);
836 /// ```
837 pub fn set_ldap_signing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
838 self.ldap_signing = v.into();
839 self
840 }
841
842 /// Sets the value of [encrypt_dc_connections][crate::model::ActiveDirectory::encrypt_dc_connections].
843 ///
844 /// # Example
845 /// ```ignore,no_run
846 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
847 /// let x = ActiveDirectory::new().set_encrypt_dc_connections(true);
848 /// ```
849 pub fn set_encrypt_dc_connections<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
850 self.encrypt_dc_connections = v.into();
851 self
852 }
853
854 /// Sets the value of [labels][crate::model::ActiveDirectory::labels].
855 ///
856 /// # Example
857 /// ```ignore,no_run
858 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
859 /// let x = ActiveDirectory::new().set_labels([
860 /// ("key0", "abc"),
861 /// ("key1", "xyz"),
862 /// ]);
863 /// ```
864 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
865 where
866 T: std::iter::IntoIterator<Item = (K, V)>,
867 K: std::convert::Into<std::string::String>,
868 V: std::convert::Into<std::string::String>,
869 {
870 use std::iter::Iterator;
871 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
872 self
873 }
874
875 /// Sets the value of [state_details][crate::model::ActiveDirectory::state_details].
876 ///
877 /// # Example
878 /// ```ignore,no_run
879 /// # use google_cloud_netapp_v1::model::ActiveDirectory;
880 /// let x = ActiveDirectory::new().set_state_details("example");
881 /// ```
882 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
883 self.state_details = v.into();
884 self
885 }
886}
887
888impl wkt::message::Message for ActiveDirectory {
889 fn typename() -> &'static str {
890 "type.googleapis.com/google.cloud.netapp.v1.ActiveDirectory"
891 }
892}
893
894/// Defines additional types related to [ActiveDirectory].
895pub mod active_directory {
896 #[allow(unused_imports)]
897 use super::*;
898
899 /// The Active Directory States
900 ///
901 /// # Working with unknown values
902 ///
903 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
904 /// additional enum variants at any time. Adding new variants is not considered
905 /// a breaking change. Applications should write their code in anticipation of:
906 ///
907 /// - New values appearing in future releases of the client library, **and**
908 /// - New values received dynamically, without application changes.
909 ///
910 /// Please consult the [Working with enums] section in the user guide for some
911 /// guidelines.
912 ///
913 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
914 #[derive(Clone, Debug, PartialEq)]
915 #[non_exhaustive]
916 pub enum State {
917 /// Unspecified Active Directory State
918 Unspecified,
919 /// Active Directory State is Creating
920 Creating,
921 /// Active Directory State is Ready
922 Ready,
923 /// Active Directory State is Updating
924 Updating,
925 /// Active Directory State is In use
926 InUse,
927 /// Active Directory State is Deleting
928 Deleting,
929 /// Active Directory State is Error
930 Error,
931 /// Active Directory State is Diagnosing.
932 Diagnosing,
933 /// If set, the enum was initialized with an unknown value.
934 ///
935 /// Applications can examine the value using [State::value] or
936 /// [State::name].
937 UnknownValue(state::UnknownValue),
938 }
939
940 #[doc(hidden)]
941 pub mod state {
942 #[allow(unused_imports)]
943 use super::*;
944 #[derive(Clone, Debug, PartialEq)]
945 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
946 }
947
948 impl State {
949 /// Gets the enum value.
950 ///
951 /// Returns `None` if the enum contains an unknown value deserialized from
952 /// the string representation of enums.
953 pub fn value(&self) -> std::option::Option<i32> {
954 match self {
955 Self::Unspecified => std::option::Option::Some(0),
956 Self::Creating => std::option::Option::Some(1),
957 Self::Ready => std::option::Option::Some(2),
958 Self::Updating => std::option::Option::Some(3),
959 Self::InUse => std::option::Option::Some(4),
960 Self::Deleting => std::option::Option::Some(5),
961 Self::Error => std::option::Option::Some(6),
962 Self::Diagnosing => std::option::Option::Some(7),
963 Self::UnknownValue(u) => u.0.value(),
964 }
965 }
966
967 /// Gets the enum value as a string.
968 ///
969 /// Returns `None` if the enum contains an unknown value deserialized from
970 /// the integer representation of enums.
971 pub fn name(&self) -> std::option::Option<&str> {
972 match self {
973 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
974 Self::Creating => std::option::Option::Some("CREATING"),
975 Self::Ready => std::option::Option::Some("READY"),
976 Self::Updating => std::option::Option::Some("UPDATING"),
977 Self::InUse => std::option::Option::Some("IN_USE"),
978 Self::Deleting => std::option::Option::Some("DELETING"),
979 Self::Error => std::option::Option::Some("ERROR"),
980 Self::Diagnosing => std::option::Option::Some("DIAGNOSING"),
981 Self::UnknownValue(u) => u.0.name(),
982 }
983 }
984 }
985
986 impl std::default::Default for State {
987 fn default() -> Self {
988 use std::convert::From;
989 Self::from(0)
990 }
991 }
992
993 impl std::fmt::Display for State {
994 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
995 wkt::internal::display_enum(f, self.name(), self.value())
996 }
997 }
998
999 impl std::convert::From<i32> for State {
1000 fn from(value: i32) -> Self {
1001 match value {
1002 0 => Self::Unspecified,
1003 1 => Self::Creating,
1004 2 => Self::Ready,
1005 3 => Self::Updating,
1006 4 => Self::InUse,
1007 5 => Self::Deleting,
1008 6 => Self::Error,
1009 7 => Self::Diagnosing,
1010 _ => Self::UnknownValue(state::UnknownValue(
1011 wkt::internal::UnknownEnumValue::Integer(value),
1012 )),
1013 }
1014 }
1015 }
1016
1017 impl std::convert::From<&str> for State {
1018 fn from(value: &str) -> Self {
1019 use std::string::ToString;
1020 match value {
1021 "STATE_UNSPECIFIED" => Self::Unspecified,
1022 "CREATING" => Self::Creating,
1023 "READY" => Self::Ready,
1024 "UPDATING" => Self::Updating,
1025 "IN_USE" => Self::InUse,
1026 "DELETING" => Self::Deleting,
1027 "ERROR" => Self::Error,
1028 "DIAGNOSING" => Self::Diagnosing,
1029 _ => Self::UnknownValue(state::UnknownValue(
1030 wkt::internal::UnknownEnumValue::String(value.to_string()),
1031 )),
1032 }
1033 }
1034 }
1035
1036 impl serde::ser::Serialize for State {
1037 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1038 where
1039 S: serde::Serializer,
1040 {
1041 match self {
1042 Self::Unspecified => serializer.serialize_i32(0),
1043 Self::Creating => serializer.serialize_i32(1),
1044 Self::Ready => serializer.serialize_i32(2),
1045 Self::Updating => serializer.serialize_i32(3),
1046 Self::InUse => serializer.serialize_i32(4),
1047 Self::Deleting => serializer.serialize_i32(5),
1048 Self::Error => serializer.serialize_i32(6),
1049 Self::Diagnosing => serializer.serialize_i32(7),
1050 Self::UnknownValue(u) => u.0.serialize(serializer),
1051 }
1052 }
1053 }
1054
1055 impl<'de> serde::de::Deserialize<'de> for State {
1056 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1057 where
1058 D: serde::Deserializer<'de>,
1059 {
1060 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1061 ".google.cloud.netapp.v1.ActiveDirectory.State",
1062 ))
1063 }
1064 }
1065}
1066
1067/// A NetApp Backup.
1068#[derive(Clone, Default, PartialEq)]
1069#[non_exhaustive]
1070pub struct Backup {
1071 /// Identifier. The resource name of the backup.
1072 /// Format:
1073 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`.
1074 pub name: std::string::String,
1075
1076 /// Output only. The backup state.
1077 pub state: crate::model::backup::State,
1078
1079 /// A description of the backup with 2048 characters or less.
1080 /// Requests with longer descriptions will be rejected.
1081 pub description: std::string::String,
1082
1083 /// Output only. Size of the file system when the backup was created. When
1084 /// creating a new volume from the backup, the volume capacity will have to be
1085 /// at least as big.
1086 pub volume_usage_bytes: i64,
1087
1088 /// Output only. Type of backup, manually created or created by a backup
1089 /// policy.
1090 pub backup_type: crate::model::backup::Type,
1091
1092 /// Volume full name of this backup belongs to.
1093 /// Format:
1094 /// `projects/{projects_id}/locations/{location}/volumes/{volume_id}`
1095 pub source_volume: std::string::String,
1096
1097 /// If specified, backup will be created from the given snapshot.
1098 /// If not specified, there will be a new snapshot taken to initiate the backup
1099 /// creation. Format:
1100 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`
1101 pub source_snapshot: std::option::Option<std::string::String>,
1102
1103 /// Output only. The time when the backup was created.
1104 pub create_time: std::option::Option<wkt::Timestamp>,
1105
1106 /// Resource labels to represent user provided metadata.
1107 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1108
1109 /// Output only. Total size of all backups in a chain in bytes = baseline
1110 /// backup size + sum(incremental backup size)
1111 pub chain_storage_bytes: i64,
1112
1113 /// Output only. Reserved for future use
1114 pub satisfies_pzs: bool,
1115
1116 /// Output only. Reserved for future use
1117 pub satisfies_pzi: bool,
1118
1119 /// Output only. Region of the volume from which the backup was created.
1120 /// Format: `projects/{project_id}/locations/{location}`
1121 pub volume_region: std::string::String,
1122
1123 /// Output only. Region in which backup is stored.
1124 /// Format: `projects/{project_id}/locations/{location}`
1125 pub backup_region: std::string::String,
1126
1127 /// Output only. The time until which the backup is not deletable.
1128 pub enforced_retention_end_time: std::option::Option<wkt::Timestamp>,
1129
1130 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1131}
1132
1133impl Backup {
1134 pub fn new() -> Self {
1135 std::default::Default::default()
1136 }
1137
1138 /// Sets the value of [name][crate::model::Backup::name].
1139 ///
1140 /// # Example
1141 /// ```ignore,no_run
1142 /// # use google_cloud_netapp_v1::model::Backup;
1143 /// let x = Backup::new().set_name("example");
1144 /// ```
1145 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1146 self.name = v.into();
1147 self
1148 }
1149
1150 /// Sets the value of [state][crate::model::Backup::state].
1151 ///
1152 /// # Example
1153 /// ```ignore,no_run
1154 /// # use google_cloud_netapp_v1::model::Backup;
1155 /// use google_cloud_netapp_v1::model::backup::State;
1156 /// let x0 = Backup::new().set_state(State::Creating);
1157 /// let x1 = Backup::new().set_state(State::Uploading);
1158 /// let x2 = Backup::new().set_state(State::Ready);
1159 /// ```
1160 pub fn set_state<T: std::convert::Into<crate::model::backup::State>>(mut self, v: T) -> Self {
1161 self.state = v.into();
1162 self
1163 }
1164
1165 /// Sets the value of [description][crate::model::Backup::description].
1166 ///
1167 /// # Example
1168 /// ```ignore,no_run
1169 /// # use google_cloud_netapp_v1::model::Backup;
1170 /// let x = Backup::new().set_description("example");
1171 /// ```
1172 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1173 self.description = v.into();
1174 self
1175 }
1176
1177 /// Sets the value of [volume_usage_bytes][crate::model::Backup::volume_usage_bytes].
1178 ///
1179 /// # Example
1180 /// ```ignore,no_run
1181 /// # use google_cloud_netapp_v1::model::Backup;
1182 /// let x = Backup::new().set_volume_usage_bytes(42);
1183 /// ```
1184 pub fn set_volume_usage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1185 self.volume_usage_bytes = v.into();
1186 self
1187 }
1188
1189 /// Sets the value of [backup_type][crate::model::Backup::backup_type].
1190 ///
1191 /// # Example
1192 /// ```ignore,no_run
1193 /// # use google_cloud_netapp_v1::model::Backup;
1194 /// use google_cloud_netapp_v1::model::backup::Type;
1195 /// let x0 = Backup::new().set_backup_type(Type::Manual);
1196 /// let x1 = Backup::new().set_backup_type(Type::Scheduled);
1197 /// ```
1198 pub fn set_backup_type<T: std::convert::Into<crate::model::backup::Type>>(
1199 mut self,
1200 v: T,
1201 ) -> Self {
1202 self.backup_type = v.into();
1203 self
1204 }
1205
1206 /// Sets the value of [source_volume][crate::model::Backup::source_volume].
1207 ///
1208 /// # Example
1209 /// ```ignore,no_run
1210 /// # use google_cloud_netapp_v1::model::Backup;
1211 /// let x = Backup::new().set_source_volume("example");
1212 /// ```
1213 pub fn set_source_volume<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1214 self.source_volume = v.into();
1215 self
1216 }
1217
1218 /// Sets the value of [source_snapshot][crate::model::Backup::source_snapshot].
1219 ///
1220 /// # Example
1221 /// ```ignore,no_run
1222 /// # use google_cloud_netapp_v1::model::Backup;
1223 /// let x = Backup::new().set_source_snapshot("example");
1224 /// ```
1225 pub fn set_source_snapshot<T>(mut self, v: T) -> Self
1226 where
1227 T: std::convert::Into<std::string::String>,
1228 {
1229 self.source_snapshot = std::option::Option::Some(v.into());
1230 self
1231 }
1232
1233 /// Sets or clears the value of [source_snapshot][crate::model::Backup::source_snapshot].
1234 ///
1235 /// # Example
1236 /// ```ignore,no_run
1237 /// # use google_cloud_netapp_v1::model::Backup;
1238 /// let x = Backup::new().set_or_clear_source_snapshot(Some("example"));
1239 /// let x = Backup::new().set_or_clear_source_snapshot(None::<String>);
1240 /// ```
1241 pub fn set_or_clear_source_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
1242 where
1243 T: std::convert::Into<std::string::String>,
1244 {
1245 self.source_snapshot = v.map(|x| x.into());
1246 self
1247 }
1248
1249 /// Sets the value of [create_time][crate::model::Backup::create_time].
1250 ///
1251 /// # Example
1252 /// ```ignore,no_run
1253 /// # use google_cloud_netapp_v1::model::Backup;
1254 /// use wkt::Timestamp;
1255 /// let x = Backup::new().set_create_time(Timestamp::default()/* use setters */);
1256 /// ```
1257 pub fn set_create_time<T>(mut self, v: T) -> Self
1258 where
1259 T: std::convert::Into<wkt::Timestamp>,
1260 {
1261 self.create_time = std::option::Option::Some(v.into());
1262 self
1263 }
1264
1265 /// Sets or clears the value of [create_time][crate::model::Backup::create_time].
1266 ///
1267 /// # Example
1268 /// ```ignore,no_run
1269 /// # use google_cloud_netapp_v1::model::Backup;
1270 /// use wkt::Timestamp;
1271 /// let x = Backup::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1272 /// let x = Backup::new().set_or_clear_create_time(None::<Timestamp>);
1273 /// ```
1274 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1275 where
1276 T: std::convert::Into<wkt::Timestamp>,
1277 {
1278 self.create_time = v.map(|x| x.into());
1279 self
1280 }
1281
1282 /// Sets the value of [labels][crate::model::Backup::labels].
1283 ///
1284 /// # Example
1285 /// ```ignore,no_run
1286 /// # use google_cloud_netapp_v1::model::Backup;
1287 /// let x = Backup::new().set_labels([
1288 /// ("key0", "abc"),
1289 /// ("key1", "xyz"),
1290 /// ]);
1291 /// ```
1292 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
1293 where
1294 T: std::iter::IntoIterator<Item = (K, V)>,
1295 K: std::convert::Into<std::string::String>,
1296 V: std::convert::Into<std::string::String>,
1297 {
1298 use std::iter::Iterator;
1299 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
1300 self
1301 }
1302
1303 /// Sets the value of [chain_storage_bytes][crate::model::Backup::chain_storage_bytes].
1304 ///
1305 /// # Example
1306 /// ```ignore,no_run
1307 /// # use google_cloud_netapp_v1::model::Backup;
1308 /// let x = Backup::new().set_chain_storage_bytes(42);
1309 /// ```
1310 pub fn set_chain_storage_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1311 self.chain_storage_bytes = v.into();
1312 self
1313 }
1314
1315 /// Sets the value of [satisfies_pzs][crate::model::Backup::satisfies_pzs].
1316 ///
1317 /// # Example
1318 /// ```ignore,no_run
1319 /// # use google_cloud_netapp_v1::model::Backup;
1320 /// let x = Backup::new().set_satisfies_pzs(true);
1321 /// ```
1322 pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1323 self.satisfies_pzs = v.into();
1324 self
1325 }
1326
1327 /// Sets the value of [satisfies_pzi][crate::model::Backup::satisfies_pzi].
1328 ///
1329 /// # Example
1330 /// ```ignore,no_run
1331 /// # use google_cloud_netapp_v1::model::Backup;
1332 /// let x = Backup::new().set_satisfies_pzi(true);
1333 /// ```
1334 pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1335 self.satisfies_pzi = v.into();
1336 self
1337 }
1338
1339 /// Sets the value of [volume_region][crate::model::Backup::volume_region].
1340 ///
1341 /// # Example
1342 /// ```ignore,no_run
1343 /// # use google_cloud_netapp_v1::model::Backup;
1344 /// let x = Backup::new().set_volume_region("example");
1345 /// ```
1346 pub fn set_volume_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1347 self.volume_region = v.into();
1348 self
1349 }
1350
1351 /// Sets the value of [backup_region][crate::model::Backup::backup_region].
1352 ///
1353 /// # Example
1354 /// ```ignore,no_run
1355 /// # use google_cloud_netapp_v1::model::Backup;
1356 /// let x = Backup::new().set_backup_region("example");
1357 /// ```
1358 pub fn set_backup_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1359 self.backup_region = v.into();
1360 self
1361 }
1362
1363 /// Sets the value of [enforced_retention_end_time][crate::model::Backup::enforced_retention_end_time].
1364 ///
1365 /// # Example
1366 /// ```ignore,no_run
1367 /// # use google_cloud_netapp_v1::model::Backup;
1368 /// use wkt::Timestamp;
1369 /// let x = Backup::new().set_enforced_retention_end_time(Timestamp::default()/* use setters */);
1370 /// ```
1371 pub fn set_enforced_retention_end_time<T>(mut self, v: T) -> Self
1372 where
1373 T: std::convert::Into<wkt::Timestamp>,
1374 {
1375 self.enforced_retention_end_time = std::option::Option::Some(v.into());
1376 self
1377 }
1378
1379 /// Sets or clears the value of [enforced_retention_end_time][crate::model::Backup::enforced_retention_end_time].
1380 ///
1381 /// # Example
1382 /// ```ignore,no_run
1383 /// # use google_cloud_netapp_v1::model::Backup;
1384 /// use wkt::Timestamp;
1385 /// let x = Backup::new().set_or_clear_enforced_retention_end_time(Some(Timestamp::default()/* use setters */));
1386 /// let x = Backup::new().set_or_clear_enforced_retention_end_time(None::<Timestamp>);
1387 /// ```
1388 pub fn set_or_clear_enforced_retention_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1389 where
1390 T: std::convert::Into<wkt::Timestamp>,
1391 {
1392 self.enforced_retention_end_time = v.map(|x| x.into());
1393 self
1394 }
1395}
1396
1397impl wkt::message::Message for Backup {
1398 fn typename() -> &'static str {
1399 "type.googleapis.com/google.cloud.netapp.v1.Backup"
1400 }
1401}
1402
1403/// Defines additional types related to [Backup].
1404pub mod backup {
1405 #[allow(unused_imports)]
1406 use super::*;
1407
1408 /// The Backup States
1409 ///
1410 /// # Working with unknown values
1411 ///
1412 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1413 /// additional enum variants at any time. Adding new variants is not considered
1414 /// a breaking change. Applications should write their code in anticipation of:
1415 ///
1416 /// - New values appearing in future releases of the client library, **and**
1417 /// - New values received dynamically, without application changes.
1418 ///
1419 /// Please consult the [Working with enums] section in the user guide for some
1420 /// guidelines.
1421 ///
1422 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1423 #[derive(Clone, Debug, PartialEq)]
1424 #[non_exhaustive]
1425 pub enum State {
1426 /// State not set.
1427 Unspecified,
1428 /// Backup is being created. While in this state, the snapshot for the backup
1429 /// point-in-time may not have been created yet, and so the point-in-time may
1430 /// not have been fixed.
1431 Creating,
1432 /// Backup is being uploaded. While in this state, none of the writes to the
1433 /// volume will be included in the backup.
1434 Uploading,
1435 /// Backup is available for use.
1436 Ready,
1437 /// Backup is being deleted.
1438 Deleting,
1439 /// Backup is not valid and cannot be used for creating new volumes or
1440 /// restoring existing volumes.
1441 Error,
1442 /// Backup is being updated.
1443 Updating,
1444 /// If set, the enum was initialized with an unknown value.
1445 ///
1446 /// Applications can examine the value using [State::value] or
1447 /// [State::name].
1448 UnknownValue(state::UnknownValue),
1449 }
1450
1451 #[doc(hidden)]
1452 pub mod state {
1453 #[allow(unused_imports)]
1454 use super::*;
1455 #[derive(Clone, Debug, PartialEq)]
1456 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1457 }
1458
1459 impl State {
1460 /// Gets the enum value.
1461 ///
1462 /// Returns `None` if the enum contains an unknown value deserialized from
1463 /// the string representation of enums.
1464 pub fn value(&self) -> std::option::Option<i32> {
1465 match self {
1466 Self::Unspecified => std::option::Option::Some(0),
1467 Self::Creating => std::option::Option::Some(1),
1468 Self::Uploading => std::option::Option::Some(2),
1469 Self::Ready => std::option::Option::Some(3),
1470 Self::Deleting => std::option::Option::Some(4),
1471 Self::Error => std::option::Option::Some(5),
1472 Self::Updating => std::option::Option::Some(6),
1473 Self::UnknownValue(u) => u.0.value(),
1474 }
1475 }
1476
1477 /// Gets the enum value as a string.
1478 ///
1479 /// Returns `None` if the enum contains an unknown value deserialized from
1480 /// the integer representation of enums.
1481 pub fn name(&self) -> std::option::Option<&str> {
1482 match self {
1483 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1484 Self::Creating => std::option::Option::Some("CREATING"),
1485 Self::Uploading => std::option::Option::Some("UPLOADING"),
1486 Self::Ready => std::option::Option::Some("READY"),
1487 Self::Deleting => std::option::Option::Some("DELETING"),
1488 Self::Error => std::option::Option::Some("ERROR"),
1489 Self::Updating => std::option::Option::Some("UPDATING"),
1490 Self::UnknownValue(u) => u.0.name(),
1491 }
1492 }
1493 }
1494
1495 impl std::default::Default for State {
1496 fn default() -> Self {
1497 use std::convert::From;
1498 Self::from(0)
1499 }
1500 }
1501
1502 impl std::fmt::Display for State {
1503 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1504 wkt::internal::display_enum(f, self.name(), self.value())
1505 }
1506 }
1507
1508 impl std::convert::From<i32> for State {
1509 fn from(value: i32) -> Self {
1510 match value {
1511 0 => Self::Unspecified,
1512 1 => Self::Creating,
1513 2 => Self::Uploading,
1514 3 => Self::Ready,
1515 4 => Self::Deleting,
1516 5 => Self::Error,
1517 6 => Self::Updating,
1518 _ => Self::UnknownValue(state::UnknownValue(
1519 wkt::internal::UnknownEnumValue::Integer(value),
1520 )),
1521 }
1522 }
1523 }
1524
1525 impl std::convert::From<&str> for State {
1526 fn from(value: &str) -> Self {
1527 use std::string::ToString;
1528 match value {
1529 "STATE_UNSPECIFIED" => Self::Unspecified,
1530 "CREATING" => Self::Creating,
1531 "UPLOADING" => Self::Uploading,
1532 "READY" => Self::Ready,
1533 "DELETING" => Self::Deleting,
1534 "ERROR" => Self::Error,
1535 "UPDATING" => Self::Updating,
1536 _ => Self::UnknownValue(state::UnknownValue(
1537 wkt::internal::UnknownEnumValue::String(value.to_string()),
1538 )),
1539 }
1540 }
1541 }
1542
1543 impl serde::ser::Serialize for State {
1544 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1545 where
1546 S: serde::Serializer,
1547 {
1548 match self {
1549 Self::Unspecified => serializer.serialize_i32(0),
1550 Self::Creating => serializer.serialize_i32(1),
1551 Self::Uploading => serializer.serialize_i32(2),
1552 Self::Ready => serializer.serialize_i32(3),
1553 Self::Deleting => serializer.serialize_i32(4),
1554 Self::Error => serializer.serialize_i32(5),
1555 Self::Updating => serializer.serialize_i32(6),
1556 Self::UnknownValue(u) => u.0.serialize(serializer),
1557 }
1558 }
1559 }
1560
1561 impl<'de> serde::de::Deserialize<'de> for State {
1562 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1563 where
1564 D: serde::Deserializer<'de>,
1565 {
1566 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1567 ".google.cloud.netapp.v1.Backup.State",
1568 ))
1569 }
1570 }
1571
1572 /// Backup types.
1573 ///
1574 /// # Working with unknown values
1575 ///
1576 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1577 /// additional enum variants at any time. Adding new variants is not considered
1578 /// a breaking change. Applications should write their code in anticipation of:
1579 ///
1580 /// - New values appearing in future releases of the client library, **and**
1581 /// - New values received dynamically, without application changes.
1582 ///
1583 /// Please consult the [Working with enums] section in the user guide for some
1584 /// guidelines.
1585 ///
1586 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1587 #[derive(Clone, Debug, PartialEq)]
1588 #[non_exhaustive]
1589 pub enum Type {
1590 /// Unspecified backup type.
1591 Unspecified,
1592 /// Manual backup type.
1593 Manual,
1594 /// Scheduled backup type.
1595 Scheduled,
1596 /// If set, the enum was initialized with an unknown value.
1597 ///
1598 /// Applications can examine the value using [Type::value] or
1599 /// [Type::name].
1600 UnknownValue(r#type::UnknownValue),
1601 }
1602
1603 #[doc(hidden)]
1604 pub mod r#type {
1605 #[allow(unused_imports)]
1606 use super::*;
1607 #[derive(Clone, Debug, PartialEq)]
1608 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1609 }
1610
1611 impl Type {
1612 /// Gets the enum value.
1613 ///
1614 /// Returns `None` if the enum contains an unknown value deserialized from
1615 /// the string representation of enums.
1616 pub fn value(&self) -> std::option::Option<i32> {
1617 match self {
1618 Self::Unspecified => std::option::Option::Some(0),
1619 Self::Manual => std::option::Option::Some(1),
1620 Self::Scheduled => std::option::Option::Some(2),
1621 Self::UnknownValue(u) => u.0.value(),
1622 }
1623 }
1624
1625 /// Gets the enum value as a string.
1626 ///
1627 /// Returns `None` if the enum contains an unknown value deserialized from
1628 /// the integer representation of enums.
1629 pub fn name(&self) -> std::option::Option<&str> {
1630 match self {
1631 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
1632 Self::Manual => std::option::Option::Some("MANUAL"),
1633 Self::Scheduled => std::option::Option::Some("SCHEDULED"),
1634 Self::UnknownValue(u) => u.0.name(),
1635 }
1636 }
1637 }
1638
1639 impl std::default::Default for Type {
1640 fn default() -> Self {
1641 use std::convert::From;
1642 Self::from(0)
1643 }
1644 }
1645
1646 impl std::fmt::Display for Type {
1647 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1648 wkt::internal::display_enum(f, self.name(), self.value())
1649 }
1650 }
1651
1652 impl std::convert::From<i32> for Type {
1653 fn from(value: i32) -> Self {
1654 match value {
1655 0 => Self::Unspecified,
1656 1 => Self::Manual,
1657 2 => Self::Scheduled,
1658 _ => Self::UnknownValue(r#type::UnknownValue(
1659 wkt::internal::UnknownEnumValue::Integer(value),
1660 )),
1661 }
1662 }
1663 }
1664
1665 impl std::convert::From<&str> for Type {
1666 fn from(value: &str) -> Self {
1667 use std::string::ToString;
1668 match value {
1669 "TYPE_UNSPECIFIED" => Self::Unspecified,
1670 "MANUAL" => Self::Manual,
1671 "SCHEDULED" => Self::Scheduled,
1672 _ => Self::UnknownValue(r#type::UnknownValue(
1673 wkt::internal::UnknownEnumValue::String(value.to_string()),
1674 )),
1675 }
1676 }
1677 }
1678
1679 impl serde::ser::Serialize for Type {
1680 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1681 where
1682 S: serde::Serializer,
1683 {
1684 match self {
1685 Self::Unspecified => serializer.serialize_i32(0),
1686 Self::Manual => serializer.serialize_i32(1),
1687 Self::Scheduled => serializer.serialize_i32(2),
1688 Self::UnknownValue(u) => u.0.serialize(serializer),
1689 }
1690 }
1691 }
1692
1693 impl<'de> serde::de::Deserialize<'de> for Type {
1694 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1695 where
1696 D: serde::Deserializer<'de>,
1697 {
1698 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
1699 ".google.cloud.netapp.v1.Backup.Type",
1700 ))
1701 }
1702 }
1703}
1704
1705/// ListBackupsRequest lists backups.
1706#[derive(Clone, Default, PartialEq)]
1707#[non_exhaustive]
1708pub struct ListBackupsRequest {
1709 /// Required. The backupVault for which to retrieve backup information,
1710 /// in the format
1711 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`.
1712 /// To retrieve backup information for all locations, use "-" for the
1713 /// `{location}` value.
1714 /// To retrieve backup information for all backupVaults, use "-" for the
1715 /// `{backup_vault_id}` value.
1716 /// To retrieve backup information for a volume, use "-" for the
1717 /// `{backup_vault_id}` value and specify volume full name with the filter.
1718 pub parent: std::string::String,
1719
1720 /// The maximum number of items to return. The service may return fewer
1721 /// than this value. The maximum value
1722 /// is 1000; values above 1000 will be coerced to 1000.
1723 pub page_size: i32,
1724
1725 /// The next_page_token value to use if there are additional
1726 /// results to retrieve for this list request.
1727 pub page_token: std::string::String,
1728
1729 /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
1730 pub order_by: std::string::String,
1731
1732 /// The standard list filter.
1733 /// If specified, backups will be returned based on the attribute name that
1734 /// matches the filter expression. If empty, then no backups are filtered out.
1735 /// See <https://google.aip.dev/160>
1736 pub filter: std::string::String,
1737
1738 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1739}
1740
1741impl ListBackupsRequest {
1742 pub fn new() -> Self {
1743 std::default::Default::default()
1744 }
1745
1746 /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
1747 ///
1748 /// # Example
1749 /// ```ignore,no_run
1750 /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1751 /// let x = ListBackupsRequest::new().set_parent("example");
1752 /// ```
1753 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1754 self.parent = v.into();
1755 self
1756 }
1757
1758 /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
1759 ///
1760 /// # Example
1761 /// ```ignore,no_run
1762 /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1763 /// let x = ListBackupsRequest::new().set_page_size(42);
1764 /// ```
1765 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1766 self.page_size = v.into();
1767 self
1768 }
1769
1770 /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
1771 ///
1772 /// # Example
1773 /// ```ignore,no_run
1774 /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1775 /// let x = ListBackupsRequest::new().set_page_token("example");
1776 /// ```
1777 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1778 self.page_token = v.into();
1779 self
1780 }
1781
1782 /// Sets the value of [order_by][crate::model::ListBackupsRequest::order_by].
1783 ///
1784 /// # Example
1785 /// ```ignore,no_run
1786 /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1787 /// let x = ListBackupsRequest::new().set_order_by("example");
1788 /// ```
1789 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1790 self.order_by = v.into();
1791 self
1792 }
1793
1794 /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
1795 ///
1796 /// # Example
1797 /// ```ignore,no_run
1798 /// # use google_cloud_netapp_v1::model::ListBackupsRequest;
1799 /// let x = ListBackupsRequest::new().set_filter("example");
1800 /// ```
1801 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1802 self.filter = v.into();
1803 self
1804 }
1805}
1806
1807impl wkt::message::Message for ListBackupsRequest {
1808 fn typename() -> &'static str {
1809 "type.googleapis.com/google.cloud.netapp.v1.ListBackupsRequest"
1810 }
1811}
1812
1813/// ListBackupsResponse is the result of ListBackupsRequest.
1814#[derive(Clone, Default, PartialEq)]
1815#[non_exhaustive]
1816pub struct ListBackupsResponse {
1817 /// A list of backups in the project.
1818 pub backups: std::vec::Vec<crate::model::Backup>,
1819
1820 /// The token you can use to retrieve the next page of results. Not returned
1821 /// if there are no more results in the list.
1822 pub next_page_token: std::string::String,
1823
1824 /// Locations that could not be reached.
1825 pub unreachable: std::vec::Vec<std::string::String>,
1826
1827 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1828}
1829
1830impl ListBackupsResponse {
1831 pub fn new() -> Self {
1832 std::default::Default::default()
1833 }
1834
1835 /// Sets the value of [backups][crate::model::ListBackupsResponse::backups].
1836 ///
1837 /// # Example
1838 /// ```ignore,no_run
1839 /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1840 /// use google_cloud_netapp_v1::model::Backup;
1841 /// let x = ListBackupsResponse::new()
1842 /// .set_backups([
1843 /// Backup::default()/* use setters */,
1844 /// Backup::default()/* use (different) setters */,
1845 /// ]);
1846 /// ```
1847 pub fn set_backups<T, V>(mut self, v: T) -> Self
1848 where
1849 T: std::iter::IntoIterator<Item = V>,
1850 V: std::convert::Into<crate::model::Backup>,
1851 {
1852 use std::iter::Iterator;
1853 self.backups = v.into_iter().map(|i| i.into()).collect();
1854 self
1855 }
1856
1857 /// Sets the value of [next_page_token][crate::model::ListBackupsResponse::next_page_token].
1858 ///
1859 /// # Example
1860 /// ```ignore,no_run
1861 /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1862 /// let x = ListBackupsResponse::new().set_next_page_token("example");
1863 /// ```
1864 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1865 self.next_page_token = v.into();
1866 self
1867 }
1868
1869 /// Sets the value of [unreachable][crate::model::ListBackupsResponse::unreachable].
1870 ///
1871 /// # Example
1872 /// ```ignore,no_run
1873 /// # use google_cloud_netapp_v1::model::ListBackupsResponse;
1874 /// let x = ListBackupsResponse::new().set_unreachable(["a", "b", "c"]);
1875 /// ```
1876 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
1877 where
1878 T: std::iter::IntoIterator<Item = V>,
1879 V: std::convert::Into<std::string::String>,
1880 {
1881 use std::iter::Iterator;
1882 self.unreachable = v.into_iter().map(|i| i.into()).collect();
1883 self
1884 }
1885}
1886
1887impl wkt::message::Message for ListBackupsResponse {
1888 fn typename() -> &'static str {
1889 "type.googleapis.com/google.cloud.netapp.v1.ListBackupsResponse"
1890 }
1891}
1892
1893#[doc(hidden)]
1894impl gax::paginator::internal::PageableResponse for ListBackupsResponse {
1895 type PageItem = crate::model::Backup;
1896
1897 fn items(self) -> std::vec::Vec<Self::PageItem> {
1898 self.backups
1899 }
1900
1901 fn next_page_token(&self) -> std::string::String {
1902 use std::clone::Clone;
1903 self.next_page_token.clone()
1904 }
1905}
1906
1907/// GetBackupRequest gets the state of a backup.
1908#[derive(Clone, Default, PartialEq)]
1909#[non_exhaustive]
1910pub struct GetBackupRequest {
1911 /// Required. The backup resource name, in the format
1912 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
1913 pub name: std::string::String,
1914
1915 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1916}
1917
1918impl GetBackupRequest {
1919 pub fn new() -> Self {
1920 std::default::Default::default()
1921 }
1922
1923 /// Sets the value of [name][crate::model::GetBackupRequest::name].
1924 ///
1925 /// # Example
1926 /// ```ignore,no_run
1927 /// # use google_cloud_netapp_v1::model::GetBackupRequest;
1928 /// let x = GetBackupRequest::new().set_name("example");
1929 /// ```
1930 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1931 self.name = v.into();
1932 self
1933 }
1934}
1935
1936impl wkt::message::Message for GetBackupRequest {
1937 fn typename() -> &'static str {
1938 "type.googleapis.com/google.cloud.netapp.v1.GetBackupRequest"
1939 }
1940}
1941
1942/// CreateBackupRequest creates a backup.
1943#[derive(Clone, Default, PartialEq)]
1944#[non_exhaustive]
1945pub struct CreateBackupRequest {
1946 /// Required. The NetApp backupVault to create the backups of, in the format
1947 /// `projects/*/locations/*/backupVaults/{backup_vault_id}`
1948 pub parent: std::string::String,
1949
1950 /// Required. The ID to use for the backup.
1951 /// The ID must be unique within the specified backupVault.
1952 /// Must contain only letters, numbers and hyphen, with the first
1953 /// character a letter, the last a letter or a
1954 /// number, and a 63 character maximum.
1955 pub backup_id: std::string::String,
1956
1957 /// Required. A backup resource
1958 pub backup: std::option::Option<crate::model::Backup>,
1959
1960 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1961}
1962
1963impl CreateBackupRequest {
1964 pub fn new() -> Self {
1965 std::default::Default::default()
1966 }
1967
1968 /// Sets the value of [parent][crate::model::CreateBackupRequest::parent].
1969 ///
1970 /// # Example
1971 /// ```ignore,no_run
1972 /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
1973 /// let x = CreateBackupRequest::new().set_parent("example");
1974 /// ```
1975 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1976 self.parent = v.into();
1977 self
1978 }
1979
1980 /// Sets the value of [backup_id][crate::model::CreateBackupRequest::backup_id].
1981 ///
1982 /// # Example
1983 /// ```ignore,no_run
1984 /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
1985 /// let x = CreateBackupRequest::new().set_backup_id("example");
1986 /// ```
1987 pub fn set_backup_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1988 self.backup_id = v.into();
1989 self
1990 }
1991
1992 /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
1993 ///
1994 /// # Example
1995 /// ```ignore,no_run
1996 /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
1997 /// use google_cloud_netapp_v1::model::Backup;
1998 /// let x = CreateBackupRequest::new().set_backup(Backup::default()/* use setters */);
1999 /// ```
2000 pub fn set_backup<T>(mut self, v: T) -> Self
2001 where
2002 T: std::convert::Into<crate::model::Backup>,
2003 {
2004 self.backup = std::option::Option::Some(v.into());
2005 self
2006 }
2007
2008 /// Sets or clears the value of [backup][crate::model::CreateBackupRequest::backup].
2009 ///
2010 /// # Example
2011 /// ```ignore,no_run
2012 /// # use google_cloud_netapp_v1::model::CreateBackupRequest;
2013 /// use google_cloud_netapp_v1::model::Backup;
2014 /// let x = CreateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
2015 /// let x = CreateBackupRequest::new().set_or_clear_backup(None::<Backup>);
2016 /// ```
2017 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
2018 where
2019 T: std::convert::Into<crate::model::Backup>,
2020 {
2021 self.backup = v.map(|x| x.into());
2022 self
2023 }
2024}
2025
2026impl wkt::message::Message for CreateBackupRequest {
2027 fn typename() -> &'static str {
2028 "type.googleapis.com/google.cloud.netapp.v1.CreateBackupRequest"
2029 }
2030}
2031
2032/// DeleteBackupRequest deletes a backup.
2033#[derive(Clone, Default, PartialEq)]
2034#[non_exhaustive]
2035pub struct DeleteBackupRequest {
2036 /// Required. The backup resource name, in the format
2037 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}`
2038 pub name: std::string::String,
2039
2040 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2041}
2042
2043impl DeleteBackupRequest {
2044 pub fn new() -> Self {
2045 std::default::Default::default()
2046 }
2047
2048 /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
2049 ///
2050 /// # Example
2051 /// ```ignore,no_run
2052 /// # use google_cloud_netapp_v1::model::DeleteBackupRequest;
2053 /// let x = DeleteBackupRequest::new().set_name("example");
2054 /// ```
2055 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2056 self.name = v.into();
2057 self
2058 }
2059}
2060
2061impl wkt::message::Message for DeleteBackupRequest {
2062 fn typename() -> &'static str {
2063 "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupRequest"
2064 }
2065}
2066
2067/// UpdateBackupRequest updates description and/or labels for a backup.
2068#[derive(Clone, Default, PartialEq)]
2069#[non_exhaustive]
2070pub struct UpdateBackupRequest {
2071 /// Required. Field mask is used to specify the fields to be overwritten in the
2072 /// Backup resource to be updated.
2073 /// The fields specified in the update_mask are relative to the resource, not
2074 /// the full request. A field will be overwritten if it is in the mask. If the
2075 /// user does not provide a mask then all fields will be overwritten.
2076 pub update_mask: std::option::Option<wkt::FieldMask>,
2077
2078 /// Required. The backup being updated
2079 pub backup: std::option::Option<crate::model::Backup>,
2080
2081 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2082}
2083
2084impl UpdateBackupRequest {
2085 pub fn new() -> Self {
2086 std::default::Default::default()
2087 }
2088
2089 /// Sets the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
2090 ///
2091 /// # Example
2092 /// ```ignore,no_run
2093 /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2094 /// use wkt::FieldMask;
2095 /// let x = UpdateBackupRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2096 /// ```
2097 pub fn set_update_mask<T>(mut self, v: T) -> Self
2098 where
2099 T: std::convert::Into<wkt::FieldMask>,
2100 {
2101 self.update_mask = std::option::Option::Some(v.into());
2102 self
2103 }
2104
2105 /// Sets or clears the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
2106 ///
2107 /// # Example
2108 /// ```ignore,no_run
2109 /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2110 /// use wkt::FieldMask;
2111 /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2112 /// let x = UpdateBackupRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2113 /// ```
2114 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2115 where
2116 T: std::convert::Into<wkt::FieldMask>,
2117 {
2118 self.update_mask = v.map(|x| x.into());
2119 self
2120 }
2121
2122 /// Sets the value of [backup][crate::model::UpdateBackupRequest::backup].
2123 ///
2124 /// # Example
2125 /// ```ignore,no_run
2126 /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2127 /// use google_cloud_netapp_v1::model::Backup;
2128 /// let x = UpdateBackupRequest::new().set_backup(Backup::default()/* use setters */);
2129 /// ```
2130 pub fn set_backup<T>(mut self, v: T) -> Self
2131 where
2132 T: std::convert::Into<crate::model::Backup>,
2133 {
2134 self.backup = std::option::Option::Some(v.into());
2135 self
2136 }
2137
2138 /// Sets or clears the value of [backup][crate::model::UpdateBackupRequest::backup].
2139 ///
2140 /// # Example
2141 /// ```ignore,no_run
2142 /// # use google_cloud_netapp_v1::model::UpdateBackupRequest;
2143 /// use google_cloud_netapp_v1::model::Backup;
2144 /// let x = UpdateBackupRequest::new().set_or_clear_backup(Some(Backup::default()/* use setters */));
2145 /// let x = UpdateBackupRequest::new().set_or_clear_backup(None::<Backup>);
2146 /// ```
2147 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
2148 where
2149 T: std::convert::Into<crate::model::Backup>,
2150 {
2151 self.backup = v.map(|x| x.into());
2152 self
2153 }
2154}
2155
2156impl wkt::message::Message for UpdateBackupRequest {
2157 fn typename() -> &'static str {
2158 "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupRequest"
2159 }
2160}
2161
2162/// Backup Policy.
2163#[derive(Clone, Default, PartialEq)]
2164#[non_exhaustive]
2165pub struct BackupPolicy {
2166 /// Identifier. The resource name of the backup policy.
2167 /// Format:
2168 /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`.
2169 pub name: std::string::String,
2170
2171 /// Number of daily backups to keep. Note that the minimum daily backup limit
2172 /// is 2.
2173 pub daily_backup_limit: std::option::Option<i32>,
2174
2175 /// Number of weekly backups to keep. Note that the sum of daily, weekly and
2176 /// monthly backups should be greater than 1.
2177 pub weekly_backup_limit: std::option::Option<i32>,
2178
2179 /// Number of monthly backups to keep. Note that the sum of daily, weekly and
2180 /// monthly backups should be greater than 1.
2181 pub monthly_backup_limit: std::option::Option<i32>,
2182
2183 /// Description of the backup policy.
2184 pub description: std::option::Option<std::string::String>,
2185
2186 /// If enabled, make backups automatically according to the schedules.
2187 /// This will be applied to all volumes that have this policy attached and
2188 /// enforced on volume level. If not specified, default is true.
2189 pub enabled: std::option::Option<bool>,
2190
2191 /// Output only. The total number of volumes assigned by this backup policy.
2192 pub assigned_volume_count: std::option::Option<i32>,
2193
2194 /// Output only. The time when the backup policy was created.
2195 pub create_time: std::option::Option<wkt::Timestamp>,
2196
2197 /// Resource labels to represent user provided metadata.
2198 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
2199
2200 /// Output only. The backup policy state.
2201 pub state: crate::model::backup_policy::State,
2202
2203 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2204}
2205
2206impl BackupPolicy {
2207 pub fn new() -> Self {
2208 std::default::Default::default()
2209 }
2210
2211 /// Sets the value of [name][crate::model::BackupPolicy::name].
2212 ///
2213 /// # Example
2214 /// ```ignore,no_run
2215 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2216 /// let x = BackupPolicy::new().set_name("example");
2217 /// ```
2218 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2219 self.name = v.into();
2220 self
2221 }
2222
2223 /// Sets the value of [daily_backup_limit][crate::model::BackupPolicy::daily_backup_limit].
2224 ///
2225 /// # Example
2226 /// ```ignore,no_run
2227 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2228 /// let x = BackupPolicy::new().set_daily_backup_limit(42);
2229 /// ```
2230 pub fn set_daily_backup_limit<T>(mut self, v: T) -> Self
2231 where
2232 T: std::convert::Into<i32>,
2233 {
2234 self.daily_backup_limit = std::option::Option::Some(v.into());
2235 self
2236 }
2237
2238 /// Sets or clears the value of [daily_backup_limit][crate::model::BackupPolicy::daily_backup_limit].
2239 ///
2240 /// # Example
2241 /// ```ignore,no_run
2242 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2243 /// let x = BackupPolicy::new().set_or_clear_daily_backup_limit(Some(42));
2244 /// let x = BackupPolicy::new().set_or_clear_daily_backup_limit(None::<i32>);
2245 /// ```
2246 pub fn set_or_clear_daily_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2247 where
2248 T: std::convert::Into<i32>,
2249 {
2250 self.daily_backup_limit = v.map(|x| x.into());
2251 self
2252 }
2253
2254 /// Sets the value of [weekly_backup_limit][crate::model::BackupPolicy::weekly_backup_limit].
2255 ///
2256 /// # Example
2257 /// ```ignore,no_run
2258 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2259 /// let x = BackupPolicy::new().set_weekly_backup_limit(42);
2260 /// ```
2261 pub fn set_weekly_backup_limit<T>(mut self, v: T) -> Self
2262 where
2263 T: std::convert::Into<i32>,
2264 {
2265 self.weekly_backup_limit = std::option::Option::Some(v.into());
2266 self
2267 }
2268
2269 /// Sets or clears the value of [weekly_backup_limit][crate::model::BackupPolicy::weekly_backup_limit].
2270 ///
2271 /// # Example
2272 /// ```ignore,no_run
2273 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2274 /// let x = BackupPolicy::new().set_or_clear_weekly_backup_limit(Some(42));
2275 /// let x = BackupPolicy::new().set_or_clear_weekly_backup_limit(None::<i32>);
2276 /// ```
2277 pub fn set_or_clear_weekly_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2278 where
2279 T: std::convert::Into<i32>,
2280 {
2281 self.weekly_backup_limit = v.map(|x| x.into());
2282 self
2283 }
2284
2285 /// Sets the value of [monthly_backup_limit][crate::model::BackupPolicy::monthly_backup_limit].
2286 ///
2287 /// # Example
2288 /// ```ignore,no_run
2289 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2290 /// let x = BackupPolicy::new().set_monthly_backup_limit(42);
2291 /// ```
2292 pub fn set_monthly_backup_limit<T>(mut self, v: T) -> Self
2293 where
2294 T: std::convert::Into<i32>,
2295 {
2296 self.monthly_backup_limit = std::option::Option::Some(v.into());
2297 self
2298 }
2299
2300 /// Sets or clears the value of [monthly_backup_limit][crate::model::BackupPolicy::monthly_backup_limit].
2301 ///
2302 /// # Example
2303 /// ```ignore,no_run
2304 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2305 /// let x = BackupPolicy::new().set_or_clear_monthly_backup_limit(Some(42));
2306 /// let x = BackupPolicy::new().set_or_clear_monthly_backup_limit(None::<i32>);
2307 /// ```
2308 pub fn set_or_clear_monthly_backup_limit<T>(mut self, v: std::option::Option<T>) -> Self
2309 where
2310 T: std::convert::Into<i32>,
2311 {
2312 self.monthly_backup_limit = v.map(|x| x.into());
2313 self
2314 }
2315
2316 /// Sets the value of [description][crate::model::BackupPolicy::description].
2317 ///
2318 /// # Example
2319 /// ```ignore,no_run
2320 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2321 /// let x = BackupPolicy::new().set_description("example");
2322 /// ```
2323 pub fn set_description<T>(mut self, v: T) -> Self
2324 where
2325 T: std::convert::Into<std::string::String>,
2326 {
2327 self.description = std::option::Option::Some(v.into());
2328 self
2329 }
2330
2331 /// Sets or clears the value of [description][crate::model::BackupPolicy::description].
2332 ///
2333 /// # Example
2334 /// ```ignore,no_run
2335 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2336 /// let x = BackupPolicy::new().set_or_clear_description(Some("example"));
2337 /// let x = BackupPolicy::new().set_or_clear_description(None::<String>);
2338 /// ```
2339 pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
2340 where
2341 T: std::convert::Into<std::string::String>,
2342 {
2343 self.description = v.map(|x| x.into());
2344 self
2345 }
2346
2347 /// Sets the value of [enabled][crate::model::BackupPolicy::enabled].
2348 ///
2349 /// # Example
2350 /// ```ignore,no_run
2351 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2352 /// let x = BackupPolicy::new().set_enabled(true);
2353 /// ```
2354 pub fn set_enabled<T>(mut self, v: T) -> Self
2355 where
2356 T: std::convert::Into<bool>,
2357 {
2358 self.enabled = std::option::Option::Some(v.into());
2359 self
2360 }
2361
2362 /// Sets or clears the value of [enabled][crate::model::BackupPolicy::enabled].
2363 ///
2364 /// # Example
2365 /// ```ignore,no_run
2366 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2367 /// let x = BackupPolicy::new().set_or_clear_enabled(Some(false));
2368 /// let x = BackupPolicy::new().set_or_clear_enabled(None::<bool>);
2369 /// ```
2370 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
2371 where
2372 T: std::convert::Into<bool>,
2373 {
2374 self.enabled = v.map(|x| x.into());
2375 self
2376 }
2377
2378 /// Sets the value of [assigned_volume_count][crate::model::BackupPolicy::assigned_volume_count].
2379 ///
2380 /// # Example
2381 /// ```ignore,no_run
2382 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2383 /// let x = BackupPolicy::new().set_assigned_volume_count(42);
2384 /// ```
2385 pub fn set_assigned_volume_count<T>(mut self, v: T) -> Self
2386 where
2387 T: std::convert::Into<i32>,
2388 {
2389 self.assigned_volume_count = std::option::Option::Some(v.into());
2390 self
2391 }
2392
2393 /// Sets or clears the value of [assigned_volume_count][crate::model::BackupPolicy::assigned_volume_count].
2394 ///
2395 /// # Example
2396 /// ```ignore,no_run
2397 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2398 /// let x = BackupPolicy::new().set_or_clear_assigned_volume_count(Some(42));
2399 /// let x = BackupPolicy::new().set_or_clear_assigned_volume_count(None::<i32>);
2400 /// ```
2401 pub fn set_or_clear_assigned_volume_count<T>(mut self, v: std::option::Option<T>) -> Self
2402 where
2403 T: std::convert::Into<i32>,
2404 {
2405 self.assigned_volume_count = v.map(|x| x.into());
2406 self
2407 }
2408
2409 /// Sets the value of [create_time][crate::model::BackupPolicy::create_time].
2410 ///
2411 /// # Example
2412 /// ```ignore,no_run
2413 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2414 /// use wkt::Timestamp;
2415 /// let x = BackupPolicy::new().set_create_time(Timestamp::default()/* use setters */);
2416 /// ```
2417 pub fn set_create_time<T>(mut self, v: T) -> Self
2418 where
2419 T: std::convert::Into<wkt::Timestamp>,
2420 {
2421 self.create_time = std::option::Option::Some(v.into());
2422 self
2423 }
2424
2425 /// Sets or clears the value of [create_time][crate::model::BackupPolicy::create_time].
2426 ///
2427 /// # Example
2428 /// ```ignore,no_run
2429 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2430 /// use wkt::Timestamp;
2431 /// let x = BackupPolicy::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2432 /// let x = BackupPolicy::new().set_or_clear_create_time(None::<Timestamp>);
2433 /// ```
2434 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2435 where
2436 T: std::convert::Into<wkt::Timestamp>,
2437 {
2438 self.create_time = v.map(|x| x.into());
2439 self
2440 }
2441
2442 /// Sets the value of [labels][crate::model::BackupPolicy::labels].
2443 ///
2444 /// # Example
2445 /// ```ignore,no_run
2446 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2447 /// let x = BackupPolicy::new().set_labels([
2448 /// ("key0", "abc"),
2449 /// ("key1", "xyz"),
2450 /// ]);
2451 /// ```
2452 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2453 where
2454 T: std::iter::IntoIterator<Item = (K, V)>,
2455 K: std::convert::Into<std::string::String>,
2456 V: std::convert::Into<std::string::String>,
2457 {
2458 use std::iter::Iterator;
2459 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2460 self
2461 }
2462
2463 /// Sets the value of [state][crate::model::BackupPolicy::state].
2464 ///
2465 /// # Example
2466 /// ```ignore,no_run
2467 /// # use google_cloud_netapp_v1::model::BackupPolicy;
2468 /// use google_cloud_netapp_v1::model::backup_policy::State;
2469 /// let x0 = BackupPolicy::new().set_state(State::Creating);
2470 /// let x1 = BackupPolicy::new().set_state(State::Ready);
2471 /// let x2 = BackupPolicy::new().set_state(State::Deleting);
2472 /// ```
2473 pub fn set_state<T: std::convert::Into<crate::model::backup_policy::State>>(
2474 mut self,
2475 v: T,
2476 ) -> Self {
2477 self.state = v.into();
2478 self
2479 }
2480}
2481
2482impl wkt::message::Message for BackupPolicy {
2483 fn typename() -> &'static str {
2484 "type.googleapis.com/google.cloud.netapp.v1.BackupPolicy"
2485 }
2486}
2487
2488/// Defines additional types related to [BackupPolicy].
2489pub mod backup_policy {
2490 #[allow(unused_imports)]
2491 use super::*;
2492
2493 ///
2494 /// # Working with unknown values
2495 ///
2496 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2497 /// additional enum variants at any time. Adding new variants is not considered
2498 /// a breaking change. Applications should write their code in anticipation of:
2499 ///
2500 /// - New values appearing in future releases of the client library, **and**
2501 /// - New values received dynamically, without application changes.
2502 ///
2503 /// Please consult the [Working with enums] section in the user guide for some
2504 /// guidelines.
2505 ///
2506 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2507 #[derive(Clone, Debug, PartialEq)]
2508 #[non_exhaustive]
2509 pub enum State {
2510 /// State not set.
2511 Unspecified,
2512 /// BackupPolicy is being created.
2513 Creating,
2514 /// BackupPolicy is available for use.
2515 Ready,
2516 /// BackupPolicy is being deleted.
2517 Deleting,
2518 /// BackupPolicy is not valid and cannot be used.
2519 Error,
2520 /// BackupPolicy is being updated.
2521 Updating,
2522 /// If set, the enum was initialized with an unknown value.
2523 ///
2524 /// Applications can examine the value using [State::value] or
2525 /// [State::name].
2526 UnknownValue(state::UnknownValue),
2527 }
2528
2529 #[doc(hidden)]
2530 pub mod state {
2531 #[allow(unused_imports)]
2532 use super::*;
2533 #[derive(Clone, Debug, PartialEq)]
2534 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2535 }
2536
2537 impl State {
2538 /// Gets the enum value.
2539 ///
2540 /// Returns `None` if the enum contains an unknown value deserialized from
2541 /// the string representation of enums.
2542 pub fn value(&self) -> std::option::Option<i32> {
2543 match self {
2544 Self::Unspecified => std::option::Option::Some(0),
2545 Self::Creating => std::option::Option::Some(1),
2546 Self::Ready => std::option::Option::Some(2),
2547 Self::Deleting => std::option::Option::Some(3),
2548 Self::Error => std::option::Option::Some(4),
2549 Self::Updating => std::option::Option::Some(5),
2550 Self::UnknownValue(u) => u.0.value(),
2551 }
2552 }
2553
2554 /// Gets the enum value as a string.
2555 ///
2556 /// Returns `None` if the enum contains an unknown value deserialized from
2557 /// the integer representation of enums.
2558 pub fn name(&self) -> std::option::Option<&str> {
2559 match self {
2560 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2561 Self::Creating => std::option::Option::Some("CREATING"),
2562 Self::Ready => std::option::Option::Some("READY"),
2563 Self::Deleting => std::option::Option::Some("DELETING"),
2564 Self::Error => std::option::Option::Some("ERROR"),
2565 Self::Updating => std::option::Option::Some("UPDATING"),
2566 Self::UnknownValue(u) => u.0.name(),
2567 }
2568 }
2569 }
2570
2571 impl std::default::Default for State {
2572 fn default() -> Self {
2573 use std::convert::From;
2574 Self::from(0)
2575 }
2576 }
2577
2578 impl std::fmt::Display for State {
2579 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2580 wkt::internal::display_enum(f, self.name(), self.value())
2581 }
2582 }
2583
2584 impl std::convert::From<i32> for State {
2585 fn from(value: i32) -> Self {
2586 match value {
2587 0 => Self::Unspecified,
2588 1 => Self::Creating,
2589 2 => Self::Ready,
2590 3 => Self::Deleting,
2591 4 => Self::Error,
2592 5 => Self::Updating,
2593 _ => Self::UnknownValue(state::UnknownValue(
2594 wkt::internal::UnknownEnumValue::Integer(value),
2595 )),
2596 }
2597 }
2598 }
2599
2600 impl std::convert::From<&str> for State {
2601 fn from(value: &str) -> Self {
2602 use std::string::ToString;
2603 match value {
2604 "STATE_UNSPECIFIED" => Self::Unspecified,
2605 "CREATING" => Self::Creating,
2606 "READY" => Self::Ready,
2607 "DELETING" => Self::Deleting,
2608 "ERROR" => Self::Error,
2609 "UPDATING" => Self::Updating,
2610 _ => Self::UnknownValue(state::UnknownValue(
2611 wkt::internal::UnknownEnumValue::String(value.to_string()),
2612 )),
2613 }
2614 }
2615 }
2616
2617 impl serde::ser::Serialize for State {
2618 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2619 where
2620 S: serde::Serializer,
2621 {
2622 match self {
2623 Self::Unspecified => serializer.serialize_i32(0),
2624 Self::Creating => serializer.serialize_i32(1),
2625 Self::Ready => serializer.serialize_i32(2),
2626 Self::Deleting => serializer.serialize_i32(3),
2627 Self::Error => serializer.serialize_i32(4),
2628 Self::Updating => serializer.serialize_i32(5),
2629 Self::UnknownValue(u) => u.0.serialize(serializer),
2630 }
2631 }
2632 }
2633
2634 impl<'de> serde::de::Deserialize<'de> for State {
2635 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2636 where
2637 D: serde::Deserializer<'de>,
2638 {
2639 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2640 ".google.cloud.netapp.v1.BackupPolicy.State",
2641 ))
2642 }
2643 }
2644}
2645
2646/// CreateBackupPolicyRequest creates a backupPolicy.
2647#[derive(Clone, Default, PartialEq)]
2648#[non_exhaustive]
2649pub struct CreateBackupPolicyRequest {
2650 /// Required. The location to create the backup policies of, in the format
2651 /// `projects/{project_id}/locations/{location}`
2652 pub parent: std::string::String,
2653
2654 /// Required. A backupPolicy resource
2655 pub backup_policy: std::option::Option<crate::model::BackupPolicy>,
2656
2657 /// Required. The ID to use for the backup policy.
2658 /// The ID must be unique within the specified location.
2659 /// Must contain only letters, numbers and hyphen, with the first
2660 /// character a letter, the last a letter or a
2661 /// number, and a 63 character maximum.
2662 pub backup_policy_id: std::string::String,
2663
2664 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2665}
2666
2667impl CreateBackupPolicyRequest {
2668 pub fn new() -> Self {
2669 std::default::Default::default()
2670 }
2671
2672 /// Sets the value of [parent][crate::model::CreateBackupPolicyRequest::parent].
2673 ///
2674 /// # Example
2675 /// ```ignore,no_run
2676 /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2677 /// let x = CreateBackupPolicyRequest::new().set_parent("example");
2678 /// ```
2679 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2680 self.parent = v.into();
2681 self
2682 }
2683
2684 /// Sets the value of [backup_policy][crate::model::CreateBackupPolicyRequest::backup_policy].
2685 ///
2686 /// # Example
2687 /// ```ignore,no_run
2688 /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2689 /// use google_cloud_netapp_v1::model::BackupPolicy;
2690 /// let x = CreateBackupPolicyRequest::new().set_backup_policy(BackupPolicy::default()/* use setters */);
2691 /// ```
2692 pub fn set_backup_policy<T>(mut self, v: T) -> Self
2693 where
2694 T: std::convert::Into<crate::model::BackupPolicy>,
2695 {
2696 self.backup_policy = std::option::Option::Some(v.into());
2697 self
2698 }
2699
2700 /// Sets or clears the value of [backup_policy][crate::model::CreateBackupPolicyRequest::backup_policy].
2701 ///
2702 /// # Example
2703 /// ```ignore,no_run
2704 /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2705 /// use google_cloud_netapp_v1::model::BackupPolicy;
2706 /// let x = CreateBackupPolicyRequest::new().set_or_clear_backup_policy(Some(BackupPolicy::default()/* use setters */));
2707 /// let x = CreateBackupPolicyRequest::new().set_or_clear_backup_policy(None::<BackupPolicy>);
2708 /// ```
2709 pub fn set_or_clear_backup_policy<T>(mut self, v: std::option::Option<T>) -> Self
2710 where
2711 T: std::convert::Into<crate::model::BackupPolicy>,
2712 {
2713 self.backup_policy = v.map(|x| x.into());
2714 self
2715 }
2716
2717 /// Sets the value of [backup_policy_id][crate::model::CreateBackupPolicyRequest::backup_policy_id].
2718 ///
2719 /// # Example
2720 /// ```ignore,no_run
2721 /// # use google_cloud_netapp_v1::model::CreateBackupPolicyRequest;
2722 /// let x = CreateBackupPolicyRequest::new().set_backup_policy_id("example");
2723 /// ```
2724 pub fn set_backup_policy_id<T: std::convert::Into<std::string::String>>(
2725 mut self,
2726 v: T,
2727 ) -> Self {
2728 self.backup_policy_id = v.into();
2729 self
2730 }
2731}
2732
2733impl wkt::message::Message for CreateBackupPolicyRequest {
2734 fn typename() -> &'static str {
2735 "type.googleapis.com/google.cloud.netapp.v1.CreateBackupPolicyRequest"
2736 }
2737}
2738
2739/// GetBackupPolicyRequest gets the state of a backupPolicy.
2740#[derive(Clone, Default, PartialEq)]
2741#[non_exhaustive]
2742pub struct GetBackupPolicyRequest {
2743 /// Required. The backupPolicy resource name, in the format
2744 /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`
2745 pub name: std::string::String,
2746
2747 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2748}
2749
2750impl GetBackupPolicyRequest {
2751 pub fn new() -> Self {
2752 std::default::Default::default()
2753 }
2754
2755 /// Sets the value of [name][crate::model::GetBackupPolicyRequest::name].
2756 ///
2757 /// # Example
2758 /// ```ignore,no_run
2759 /// # use google_cloud_netapp_v1::model::GetBackupPolicyRequest;
2760 /// let x = GetBackupPolicyRequest::new().set_name("example");
2761 /// ```
2762 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2763 self.name = v.into();
2764 self
2765 }
2766}
2767
2768impl wkt::message::Message for GetBackupPolicyRequest {
2769 fn typename() -> &'static str {
2770 "type.googleapis.com/google.cloud.netapp.v1.GetBackupPolicyRequest"
2771 }
2772}
2773
2774/// ListBackupPoliciesRequest for requesting multiple backup policies.
2775#[derive(Clone, Default, PartialEq)]
2776#[non_exhaustive]
2777pub struct ListBackupPoliciesRequest {
2778 /// Required. Parent value for ListBackupPoliciesRequest
2779 pub parent: std::string::String,
2780
2781 /// Requested page size. Server may return fewer items than requested.
2782 /// If unspecified, the server will pick an appropriate default.
2783 pub page_size: i32,
2784
2785 /// A token identifying a page of results the server should return.
2786 pub page_token: std::string::String,
2787
2788 /// Filtering results
2789 pub filter: std::string::String,
2790
2791 /// Hint for how to order the results
2792 pub order_by: std::string::String,
2793
2794 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2795}
2796
2797impl ListBackupPoliciesRequest {
2798 pub fn new() -> Self {
2799 std::default::Default::default()
2800 }
2801
2802 /// Sets the value of [parent][crate::model::ListBackupPoliciesRequest::parent].
2803 ///
2804 /// # Example
2805 /// ```ignore,no_run
2806 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2807 /// let x = ListBackupPoliciesRequest::new().set_parent("example");
2808 /// ```
2809 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2810 self.parent = v.into();
2811 self
2812 }
2813
2814 /// Sets the value of [page_size][crate::model::ListBackupPoliciesRequest::page_size].
2815 ///
2816 /// # Example
2817 /// ```ignore,no_run
2818 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2819 /// let x = ListBackupPoliciesRequest::new().set_page_size(42);
2820 /// ```
2821 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2822 self.page_size = v.into();
2823 self
2824 }
2825
2826 /// Sets the value of [page_token][crate::model::ListBackupPoliciesRequest::page_token].
2827 ///
2828 /// # Example
2829 /// ```ignore,no_run
2830 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2831 /// let x = ListBackupPoliciesRequest::new().set_page_token("example");
2832 /// ```
2833 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2834 self.page_token = v.into();
2835 self
2836 }
2837
2838 /// Sets the value of [filter][crate::model::ListBackupPoliciesRequest::filter].
2839 ///
2840 /// # Example
2841 /// ```ignore,no_run
2842 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2843 /// let x = ListBackupPoliciesRequest::new().set_filter("example");
2844 /// ```
2845 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2846 self.filter = v.into();
2847 self
2848 }
2849
2850 /// Sets the value of [order_by][crate::model::ListBackupPoliciesRequest::order_by].
2851 ///
2852 /// # Example
2853 /// ```ignore,no_run
2854 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesRequest;
2855 /// let x = ListBackupPoliciesRequest::new().set_order_by("example");
2856 /// ```
2857 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2858 self.order_by = v.into();
2859 self
2860 }
2861}
2862
2863impl wkt::message::Message for ListBackupPoliciesRequest {
2864 fn typename() -> &'static str {
2865 "type.googleapis.com/google.cloud.netapp.v1.ListBackupPoliciesRequest"
2866 }
2867}
2868
2869/// ListBackupPoliciesResponse contains all the backup policies requested.
2870#[derive(Clone, Default, PartialEq)]
2871#[non_exhaustive]
2872pub struct ListBackupPoliciesResponse {
2873 /// The list of backup policies.
2874 pub backup_policies: std::vec::Vec<crate::model::BackupPolicy>,
2875
2876 /// A token identifying a page of results the server should return.
2877 pub next_page_token: std::string::String,
2878
2879 /// Locations that could not be reached.
2880 pub unreachable: std::vec::Vec<std::string::String>,
2881
2882 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2883}
2884
2885impl ListBackupPoliciesResponse {
2886 pub fn new() -> Self {
2887 std::default::Default::default()
2888 }
2889
2890 /// Sets the value of [backup_policies][crate::model::ListBackupPoliciesResponse::backup_policies].
2891 ///
2892 /// # Example
2893 /// ```ignore,no_run
2894 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
2895 /// use google_cloud_netapp_v1::model::BackupPolicy;
2896 /// let x = ListBackupPoliciesResponse::new()
2897 /// .set_backup_policies([
2898 /// BackupPolicy::default()/* use setters */,
2899 /// BackupPolicy::default()/* use (different) setters */,
2900 /// ]);
2901 /// ```
2902 pub fn set_backup_policies<T, V>(mut self, v: T) -> Self
2903 where
2904 T: std::iter::IntoIterator<Item = V>,
2905 V: std::convert::Into<crate::model::BackupPolicy>,
2906 {
2907 use std::iter::Iterator;
2908 self.backup_policies = v.into_iter().map(|i| i.into()).collect();
2909 self
2910 }
2911
2912 /// Sets the value of [next_page_token][crate::model::ListBackupPoliciesResponse::next_page_token].
2913 ///
2914 /// # Example
2915 /// ```ignore,no_run
2916 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
2917 /// let x = ListBackupPoliciesResponse::new().set_next_page_token("example");
2918 /// ```
2919 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2920 self.next_page_token = v.into();
2921 self
2922 }
2923
2924 /// Sets the value of [unreachable][crate::model::ListBackupPoliciesResponse::unreachable].
2925 ///
2926 /// # Example
2927 /// ```ignore,no_run
2928 /// # use google_cloud_netapp_v1::model::ListBackupPoliciesResponse;
2929 /// let x = ListBackupPoliciesResponse::new().set_unreachable(["a", "b", "c"]);
2930 /// ```
2931 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
2932 where
2933 T: std::iter::IntoIterator<Item = V>,
2934 V: std::convert::Into<std::string::String>,
2935 {
2936 use std::iter::Iterator;
2937 self.unreachable = v.into_iter().map(|i| i.into()).collect();
2938 self
2939 }
2940}
2941
2942impl wkt::message::Message for ListBackupPoliciesResponse {
2943 fn typename() -> &'static str {
2944 "type.googleapis.com/google.cloud.netapp.v1.ListBackupPoliciesResponse"
2945 }
2946}
2947
2948#[doc(hidden)]
2949impl gax::paginator::internal::PageableResponse for ListBackupPoliciesResponse {
2950 type PageItem = crate::model::BackupPolicy;
2951
2952 fn items(self) -> std::vec::Vec<Self::PageItem> {
2953 self.backup_policies
2954 }
2955
2956 fn next_page_token(&self) -> std::string::String {
2957 use std::clone::Clone;
2958 self.next_page_token.clone()
2959 }
2960}
2961
2962/// UpdateBackupPolicyRequest for updating a backup policy.
2963#[derive(Clone, Default, PartialEq)]
2964#[non_exhaustive]
2965pub struct UpdateBackupPolicyRequest {
2966 /// Required. Field mask is used to specify the fields to be overwritten in the
2967 /// Backup Policy resource by the update.
2968 /// The fields specified in the update_mask are relative to the resource, not
2969 /// the full request. A field will be overwritten if it is in the mask. If the
2970 /// user does not provide a mask then all fields will be overwritten.
2971 pub update_mask: std::option::Option<wkt::FieldMask>,
2972
2973 /// Required. The backup policy being updated
2974 pub backup_policy: std::option::Option<crate::model::BackupPolicy>,
2975
2976 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2977}
2978
2979impl UpdateBackupPolicyRequest {
2980 pub fn new() -> Self {
2981 std::default::Default::default()
2982 }
2983
2984 /// Sets the value of [update_mask][crate::model::UpdateBackupPolicyRequest::update_mask].
2985 ///
2986 /// # Example
2987 /// ```ignore,no_run
2988 /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
2989 /// use wkt::FieldMask;
2990 /// let x = UpdateBackupPolicyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2991 /// ```
2992 pub fn set_update_mask<T>(mut self, v: T) -> Self
2993 where
2994 T: std::convert::Into<wkt::FieldMask>,
2995 {
2996 self.update_mask = std::option::Option::Some(v.into());
2997 self
2998 }
2999
3000 /// Sets or clears the value of [update_mask][crate::model::UpdateBackupPolicyRequest::update_mask].
3001 ///
3002 /// # Example
3003 /// ```ignore,no_run
3004 /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3005 /// use wkt::FieldMask;
3006 /// let x = UpdateBackupPolicyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3007 /// let x = UpdateBackupPolicyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3008 /// ```
3009 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3010 where
3011 T: std::convert::Into<wkt::FieldMask>,
3012 {
3013 self.update_mask = v.map(|x| x.into());
3014 self
3015 }
3016
3017 /// Sets the value of [backup_policy][crate::model::UpdateBackupPolicyRequest::backup_policy].
3018 ///
3019 /// # Example
3020 /// ```ignore,no_run
3021 /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3022 /// use google_cloud_netapp_v1::model::BackupPolicy;
3023 /// let x = UpdateBackupPolicyRequest::new().set_backup_policy(BackupPolicy::default()/* use setters */);
3024 /// ```
3025 pub fn set_backup_policy<T>(mut self, v: T) -> Self
3026 where
3027 T: std::convert::Into<crate::model::BackupPolicy>,
3028 {
3029 self.backup_policy = std::option::Option::Some(v.into());
3030 self
3031 }
3032
3033 /// Sets or clears the value of [backup_policy][crate::model::UpdateBackupPolicyRequest::backup_policy].
3034 ///
3035 /// # Example
3036 /// ```ignore,no_run
3037 /// # use google_cloud_netapp_v1::model::UpdateBackupPolicyRequest;
3038 /// use google_cloud_netapp_v1::model::BackupPolicy;
3039 /// let x = UpdateBackupPolicyRequest::new().set_or_clear_backup_policy(Some(BackupPolicy::default()/* use setters */));
3040 /// let x = UpdateBackupPolicyRequest::new().set_or_clear_backup_policy(None::<BackupPolicy>);
3041 /// ```
3042 pub fn set_or_clear_backup_policy<T>(mut self, v: std::option::Option<T>) -> Self
3043 where
3044 T: std::convert::Into<crate::model::BackupPolicy>,
3045 {
3046 self.backup_policy = v.map(|x| x.into());
3047 self
3048 }
3049}
3050
3051impl wkt::message::Message for UpdateBackupPolicyRequest {
3052 fn typename() -> &'static str {
3053 "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupPolicyRequest"
3054 }
3055}
3056
3057/// DeleteBackupPolicyRequest deletes a backup policy.
3058#[derive(Clone, Default, PartialEq)]
3059#[non_exhaustive]
3060pub struct DeleteBackupPolicyRequest {
3061 /// Required. The backup policy resource name, in the format
3062 /// `projects/{project_id}/locations/{location}/backupPolicies/{backup_policy_id}`
3063 pub name: std::string::String,
3064
3065 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3066}
3067
3068impl DeleteBackupPolicyRequest {
3069 pub fn new() -> Self {
3070 std::default::Default::default()
3071 }
3072
3073 /// Sets the value of [name][crate::model::DeleteBackupPolicyRequest::name].
3074 ///
3075 /// # Example
3076 /// ```ignore,no_run
3077 /// # use google_cloud_netapp_v1::model::DeleteBackupPolicyRequest;
3078 /// let x = DeleteBackupPolicyRequest::new().set_name("example");
3079 /// ```
3080 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3081 self.name = v.into();
3082 self
3083 }
3084}
3085
3086impl wkt::message::Message for DeleteBackupPolicyRequest {
3087 fn typename() -> &'static str {
3088 "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupPolicyRequest"
3089 }
3090}
3091
3092/// A NetApp BackupVault.
3093#[derive(Clone, Default, PartialEq)]
3094#[non_exhaustive]
3095pub struct BackupVault {
3096 /// Identifier. The resource name of the backup vault.
3097 /// Format:
3098 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`.
3099 pub name: std::string::String,
3100
3101 /// Output only. The backup vault state.
3102 pub state: crate::model::backup_vault::State,
3103
3104 /// Output only. Create time of the backup vault.
3105 pub create_time: std::option::Option<wkt::Timestamp>,
3106
3107 /// Description of the backup vault.
3108 pub description: std::string::String,
3109
3110 /// Resource labels to represent user provided metadata.
3111 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
3112
3113 /// Optional. Type of backup vault to be created.
3114 /// Default is IN_REGION.
3115 pub backup_vault_type: crate::model::backup_vault::BackupVaultType,
3116
3117 /// Output only. Region in which the backup vault is created.
3118 /// Format: `projects/{project_id}/locations/{location}`
3119 pub source_region: std::string::String,
3120
3121 /// Optional. Region where the backups are stored.
3122 /// Format: `projects/{project_id}/locations/{location}`
3123 pub backup_region: std::string::String,
3124
3125 /// Output only. Name of the Backup vault created in source region.
3126 /// Format:
3127 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
3128 pub source_backup_vault: std::string::String,
3129
3130 /// Output only. Name of the Backup vault created in backup region.
3131 /// Format:
3132 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
3133 pub destination_backup_vault: std::string::String,
3134
3135 /// Optional. Backup retention policy defining the retenton of backups.
3136 pub backup_retention_policy:
3137 std::option::Option<crate::model::backup_vault::BackupRetentionPolicy>,
3138
3139 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3140}
3141
3142impl BackupVault {
3143 pub fn new() -> Self {
3144 std::default::Default::default()
3145 }
3146
3147 /// Sets the value of [name][crate::model::BackupVault::name].
3148 ///
3149 /// # Example
3150 /// ```ignore,no_run
3151 /// # use google_cloud_netapp_v1::model::BackupVault;
3152 /// let x = BackupVault::new().set_name("example");
3153 /// ```
3154 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3155 self.name = v.into();
3156 self
3157 }
3158
3159 /// Sets the value of [state][crate::model::BackupVault::state].
3160 ///
3161 /// # Example
3162 /// ```ignore,no_run
3163 /// # use google_cloud_netapp_v1::model::BackupVault;
3164 /// use google_cloud_netapp_v1::model::backup_vault::State;
3165 /// let x0 = BackupVault::new().set_state(State::Creating);
3166 /// let x1 = BackupVault::new().set_state(State::Ready);
3167 /// let x2 = BackupVault::new().set_state(State::Deleting);
3168 /// ```
3169 pub fn set_state<T: std::convert::Into<crate::model::backup_vault::State>>(
3170 mut self,
3171 v: T,
3172 ) -> Self {
3173 self.state = v.into();
3174 self
3175 }
3176
3177 /// Sets the value of [create_time][crate::model::BackupVault::create_time].
3178 ///
3179 /// # Example
3180 /// ```ignore,no_run
3181 /// # use google_cloud_netapp_v1::model::BackupVault;
3182 /// use wkt::Timestamp;
3183 /// let x = BackupVault::new().set_create_time(Timestamp::default()/* use setters */);
3184 /// ```
3185 pub fn set_create_time<T>(mut self, v: T) -> Self
3186 where
3187 T: std::convert::Into<wkt::Timestamp>,
3188 {
3189 self.create_time = std::option::Option::Some(v.into());
3190 self
3191 }
3192
3193 /// Sets or clears the value of [create_time][crate::model::BackupVault::create_time].
3194 ///
3195 /// # Example
3196 /// ```ignore,no_run
3197 /// # use google_cloud_netapp_v1::model::BackupVault;
3198 /// use wkt::Timestamp;
3199 /// let x = BackupVault::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3200 /// let x = BackupVault::new().set_or_clear_create_time(None::<Timestamp>);
3201 /// ```
3202 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3203 where
3204 T: std::convert::Into<wkt::Timestamp>,
3205 {
3206 self.create_time = v.map(|x| x.into());
3207 self
3208 }
3209
3210 /// Sets the value of [description][crate::model::BackupVault::description].
3211 ///
3212 /// # Example
3213 /// ```ignore,no_run
3214 /// # use google_cloud_netapp_v1::model::BackupVault;
3215 /// let x = BackupVault::new().set_description("example");
3216 /// ```
3217 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3218 self.description = v.into();
3219 self
3220 }
3221
3222 /// Sets the value of [labels][crate::model::BackupVault::labels].
3223 ///
3224 /// # Example
3225 /// ```ignore,no_run
3226 /// # use google_cloud_netapp_v1::model::BackupVault;
3227 /// let x = BackupVault::new().set_labels([
3228 /// ("key0", "abc"),
3229 /// ("key1", "xyz"),
3230 /// ]);
3231 /// ```
3232 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
3233 where
3234 T: std::iter::IntoIterator<Item = (K, V)>,
3235 K: std::convert::Into<std::string::String>,
3236 V: std::convert::Into<std::string::String>,
3237 {
3238 use std::iter::Iterator;
3239 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3240 self
3241 }
3242
3243 /// Sets the value of [backup_vault_type][crate::model::BackupVault::backup_vault_type].
3244 ///
3245 /// # Example
3246 /// ```ignore,no_run
3247 /// # use google_cloud_netapp_v1::model::BackupVault;
3248 /// use google_cloud_netapp_v1::model::backup_vault::BackupVaultType;
3249 /// let x0 = BackupVault::new().set_backup_vault_type(BackupVaultType::InRegion);
3250 /// let x1 = BackupVault::new().set_backup_vault_type(BackupVaultType::CrossRegion);
3251 /// ```
3252 pub fn set_backup_vault_type<
3253 T: std::convert::Into<crate::model::backup_vault::BackupVaultType>,
3254 >(
3255 mut self,
3256 v: T,
3257 ) -> Self {
3258 self.backup_vault_type = v.into();
3259 self
3260 }
3261
3262 /// Sets the value of [source_region][crate::model::BackupVault::source_region].
3263 ///
3264 /// # Example
3265 /// ```ignore,no_run
3266 /// # use google_cloud_netapp_v1::model::BackupVault;
3267 /// let x = BackupVault::new().set_source_region("example");
3268 /// ```
3269 pub fn set_source_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3270 self.source_region = v.into();
3271 self
3272 }
3273
3274 /// Sets the value of [backup_region][crate::model::BackupVault::backup_region].
3275 ///
3276 /// # Example
3277 /// ```ignore,no_run
3278 /// # use google_cloud_netapp_v1::model::BackupVault;
3279 /// let x = BackupVault::new().set_backup_region("example");
3280 /// ```
3281 pub fn set_backup_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3282 self.backup_region = v.into();
3283 self
3284 }
3285
3286 /// Sets the value of [source_backup_vault][crate::model::BackupVault::source_backup_vault].
3287 ///
3288 /// # Example
3289 /// ```ignore,no_run
3290 /// # use google_cloud_netapp_v1::model::BackupVault;
3291 /// let x = BackupVault::new().set_source_backup_vault("example");
3292 /// ```
3293 pub fn set_source_backup_vault<T: std::convert::Into<std::string::String>>(
3294 mut self,
3295 v: T,
3296 ) -> Self {
3297 self.source_backup_vault = v.into();
3298 self
3299 }
3300
3301 /// Sets the value of [destination_backup_vault][crate::model::BackupVault::destination_backup_vault].
3302 ///
3303 /// # Example
3304 /// ```ignore,no_run
3305 /// # use google_cloud_netapp_v1::model::BackupVault;
3306 /// let x = BackupVault::new().set_destination_backup_vault("example");
3307 /// ```
3308 pub fn set_destination_backup_vault<T: std::convert::Into<std::string::String>>(
3309 mut self,
3310 v: T,
3311 ) -> Self {
3312 self.destination_backup_vault = v.into();
3313 self
3314 }
3315
3316 /// Sets the value of [backup_retention_policy][crate::model::BackupVault::backup_retention_policy].
3317 ///
3318 /// # Example
3319 /// ```ignore,no_run
3320 /// # use google_cloud_netapp_v1::model::BackupVault;
3321 /// use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3322 /// let x = BackupVault::new().set_backup_retention_policy(BackupRetentionPolicy::default()/* use setters */);
3323 /// ```
3324 pub fn set_backup_retention_policy<T>(mut self, v: T) -> Self
3325 where
3326 T: std::convert::Into<crate::model::backup_vault::BackupRetentionPolicy>,
3327 {
3328 self.backup_retention_policy = std::option::Option::Some(v.into());
3329 self
3330 }
3331
3332 /// Sets or clears the value of [backup_retention_policy][crate::model::BackupVault::backup_retention_policy].
3333 ///
3334 /// # Example
3335 /// ```ignore,no_run
3336 /// # use google_cloud_netapp_v1::model::BackupVault;
3337 /// use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3338 /// let x = BackupVault::new().set_or_clear_backup_retention_policy(Some(BackupRetentionPolicy::default()/* use setters */));
3339 /// let x = BackupVault::new().set_or_clear_backup_retention_policy(None::<BackupRetentionPolicy>);
3340 /// ```
3341 pub fn set_or_clear_backup_retention_policy<T>(mut self, v: std::option::Option<T>) -> Self
3342 where
3343 T: std::convert::Into<crate::model::backup_vault::BackupRetentionPolicy>,
3344 {
3345 self.backup_retention_policy = v.map(|x| x.into());
3346 self
3347 }
3348}
3349
3350impl wkt::message::Message for BackupVault {
3351 fn typename() -> &'static str {
3352 "type.googleapis.com/google.cloud.netapp.v1.BackupVault"
3353 }
3354}
3355
3356/// Defines additional types related to [BackupVault].
3357pub mod backup_vault {
3358 #[allow(unused_imports)]
3359 use super::*;
3360
3361 /// Retention policy for backups in the backup vault
3362 #[derive(Clone, Default, PartialEq)]
3363 #[non_exhaustive]
3364 pub struct BackupRetentionPolicy {
3365 /// Required. Minimum retention duration in days for backups in the backup
3366 /// vault.
3367 pub backup_minimum_enforced_retention_days: i32,
3368
3369 /// Optional. Indicates if the daily backups are immutable.
3370 /// At least one of daily_backup_immutable, weekly_backup_immutable,
3371 /// monthly_backup_immutable and manual_backup_immutable must be true.
3372 pub daily_backup_immutable: bool,
3373
3374 /// Optional. Indicates if the weekly backups are immutable.
3375 /// At least one of daily_backup_immutable, weekly_backup_immutable,
3376 /// monthly_backup_immutable and manual_backup_immutable must be true.
3377 pub weekly_backup_immutable: bool,
3378
3379 /// Optional. Indicates if the monthly backups are immutable.
3380 /// At least one of daily_backup_immutable, weekly_backup_immutable,
3381 /// monthly_backup_immutable and manual_backup_immutable must be true.
3382 pub monthly_backup_immutable: bool,
3383
3384 /// Optional. Indicates if the manual backups are immutable.
3385 /// At least one of daily_backup_immutable, weekly_backup_immutable,
3386 /// monthly_backup_immutable and manual_backup_immutable must be true.
3387 pub manual_backup_immutable: bool,
3388
3389 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3390 }
3391
3392 impl BackupRetentionPolicy {
3393 pub fn new() -> Self {
3394 std::default::Default::default()
3395 }
3396
3397 /// Sets the value of [backup_minimum_enforced_retention_days][crate::model::backup_vault::BackupRetentionPolicy::backup_minimum_enforced_retention_days].
3398 ///
3399 /// # Example
3400 /// ```ignore,no_run
3401 /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3402 /// let x = BackupRetentionPolicy::new().set_backup_minimum_enforced_retention_days(42);
3403 /// ```
3404 pub fn set_backup_minimum_enforced_retention_days<T: std::convert::Into<i32>>(
3405 mut self,
3406 v: T,
3407 ) -> Self {
3408 self.backup_minimum_enforced_retention_days = v.into();
3409 self
3410 }
3411
3412 /// Sets the value of [daily_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::daily_backup_immutable].
3413 ///
3414 /// # Example
3415 /// ```ignore,no_run
3416 /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3417 /// let x = BackupRetentionPolicy::new().set_daily_backup_immutable(true);
3418 /// ```
3419 pub fn set_daily_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3420 self.daily_backup_immutable = v.into();
3421 self
3422 }
3423
3424 /// Sets the value of [weekly_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::weekly_backup_immutable].
3425 ///
3426 /// # Example
3427 /// ```ignore,no_run
3428 /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3429 /// let x = BackupRetentionPolicy::new().set_weekly_backup_immutable(true);
3430 /// ```
3431 pub fn set_weekly_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3432 self.weekly_backup_immutable = v.into();
3433 self
3434 }
3435
3436 /// Sets the value of [monthly_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::monthly_backup_immutable].
3437 ///
3438 /// # Example
3439 /// ```ignore,no_run
3440 /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3441 /// let x = BackupRetentionPolicy::new().set_monthly_backup_immutable(true);
3442 /// ```
3443 pub fn set_monthly_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3444 self.monthly_backup_immutable = v.into();
3445 self
3446 }
3447
3448 /// Sets the value of [manual_backup_immutable][crate::model::backup_vault::BackupRetentionPolicy::manual_backup_immutable].
3449 ///
3450 /// # Example
3451 /// ```ignore,no_run
3452 /// # use google_cloud_netapp_v1::model::backup_vault::BackupRetentionPolicy;
3453 /// let x = BackupRetentionPolicy::new().set_manual_backup_immutable(true);
3454 /// ```
3455 pub fn set_manual_backup_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3456 self.manual_backup_immutable = v.into();
3457 self
3458 }
3459 }
3460
3461 impl wkt::message::Message for BackupRetentionPolicy {
3462 fn typename() -> &'static str {
3463 "type.googleapis.com/google.cloud.netapp.v1.BackupVault.BackupRetentionPolicy"
3464 }
3465 }
3466
3467 /// The Backup Vault States
3468 ///
3469 /// # Working with unknown values
3470 ///
3471 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3472 /// additional enum variants at any time. Adding new variants is not considered
3473 /// a breaking change. Applications should write their code in anticipation of:
3474 ///
3475 /// - New values appearing in future releases of the client library, **and**
3476 /// - New values received dynamically, without application changes.
3477 ///
3478 /// Please consult the [Working with enums] section in the user guide for some
3479 /// guidelines.
3480 ///
3481 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3482 #[derive(Clone, Debug, PartialEq)]
3483 #[non_exhaustive]
3484 pub enum State {
3485 /// State not set.
3486 Unspecified,
3487 /// BackupVault is being created.
3488 Creating,
3489 /// BackupVault is available for use.
3490 Ready,
3491 /// BackupVault is being deleted.
3492 Deleting,
3493 /// BackupVault is not valid and cannot be used.
3494 Error,
3495 /// BackupVault is being updated.
3496 Updating,
3497 /// If set, the enum was initialized with an unknown value.
3498 ///
3499 /// Applications can examine the value using [State::value] or
3500 /// [State::name].
3501 UnknownValue(state::UnknownValue),
3502 }
3503
3504 #[doc(hidden)]
3505 pub mod state {
3506 #[allow(unused_imports)]
3507 use super::*;
3508 #[derive(Clone, Debug, PartialEq)]
3509 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3510 }
3511
3512 impl State {
3513 /// Gets the enum value.
3514 ///
3515 /// Returns `None` if the enum contains an unknown value deserialized from
3516 /// the string representation of enums.
3517 pub fn value(&self) -> std::option::Option<i32> {
3518 match self {
3519 Self::Unspecified => std::option::Option::Some(0),
3520 Self::Creating => std::option::Option::Some(1),
3521 Self::Ready => std::option::Option::Some(2),
3522 Self::Deleting => std::option::Option::Some(3),
3523 Self::Error => std::option::Option::Some(4),
3524 Self::Updating => std::option::Option::Some(5),
3525 Self::UnknownValue(u) => u.0.value(),
3526 }
3527 }
3528
3529 /// Gets the enum value as a string.
3530 ///
3531 /// Returns `None` if the enum contains an unknown value deserialized from
3532 /// the integer representation of enums.
3533 pub fn name(&self) -> std::option::Option<&str> {
3534 match self {
3535 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
3536 Self::Creating => std::option::Option::Some("CREATING"),
3537 Self::Ready => std::option::Option::Some("READY"),
3538 Self::Deleting => std::option::Option::Some("DELETING"),
3539 Self::Error => std::option::Option::Some("ERROR"),
3540 Self::Updating => std::option::Option::Some("UPDATING"),
3541 Self::UnknownValue(u) => u.0.name(),
3542 }
3543 }
3544 }
3545
3546 impl std::default::Default for State {
3547 fn default() -> Self {
3548 use std::convert::From;
3549 Self::from(0)
3550 }
3551 }
3552
3553 impl std::fmt::Display for State {
3554 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3555 wkt::internal::display_enum(f, self.name(), self.value())
3556 }
3557 }
3558
3559 impl std::convert::From<i32> for State {
3560 fn from(value: i32) -> Self {
3561 match value {
3562 0 => Self::Unspecified,
3563 1 => Self::Creating,
3564 2 => Self::Ready,
3565 3 => Self::Deleting,
3566 4 => Self::Error,
3567 5 => Self::Updating,
3568 _ => Self::UnknownValue(state::UnknownValue(
3569 wkt::internal::UnknownEnumValue::Integer(value),
3570 )),
3571 }
3572 }
3573 }
3574
3575 impl std::convert::From<&str> for State {
3576 fn from(value: &str) -> Self {
3577 use std::string::ToString;
3578 match value {
3579 "STATE_UNSPECIFIED" => Self::Unspecified,
3580 "CREATING" => Self::Creating,
3581 "READY" => Self::Ready,
3582 "DELETING" => Self::Deleting,
3583 "ERROR" => Self::Error,
3584 "UPDATING" => Self::Updating,
3585 _ => Self::UnknownValue(state::UnknownValue(
3586 wkt::internal::UnknownEnumValue::String(value.to_string()),
3587 )),
3588 }
3589 }
3590 }
3591
3592 impl serde::ser::Serialize for State {
3593 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3594 where
3595 S: serde::Serializer,
3596 {
3597 match self {
3598 Self::Unspecified => serializer.serialize_i32(0),
3599 Self::Creating => serializer.serialize_i32(1),
3600 Self::Ready => serializer.serialize_i32(2),
3601 Self::Deleting => serializer.serialize_i32(3),
3602 Self::Error => serializer.serialize_i32(4),
3603 Self::Updating => serializer.serialize_i32(5),
3604 Self::UnknownValue(u) => u.0.serialize(serializer),
3605 }
3606 }
3607 }
3608
3609 impl<'de> serde::de::Deserialize<'de> for State {
3610 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3611 where
3612 D: serde::Deserializer<'de>,
3613 {
3614 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
3615 ".google.cloud.netapp.v1.BackupVault.State",
3616 ))
3617 }
3618 }
3619
3620 /// Backup Vault Type.
3621 ///
3622 /// # Working with unknown values
3623 ///
3624 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3625 /// additional enum variants at any time. Adding new variants is not considered
3626 /// a breaking change. Applications should write their code in anticipation of:
3627 ///
3628 /// - New values appearing in future releases of the client library, **and**
3629 /// - New values received dynamically, without application changes.
3630 ///
3631 /// Please consult the [Working with enums] section in the user guide for some
3632 /// guidelines.
3633 ///
3634 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3635 #[derive(Clone, Debug, PartialEq)]
3636 #[non_exhaustive]
3637 pub enum BackupVaultType {
3638 /// BackupVault type not set.
3639 Unspecified,
3640 /// BackupVault type is IN_REGION.
3641 InRegion,
3642 /// BackupVault type is CROSS_REGION.
3643 CrossRegion,
3644 /// If set, the enum was initialized with an unknown value.
3645 ///
3646 /// Applications can examine the value using [BackupVaultType::value] or
3647 /// [BackupVaultType::name].
3648 UnknownValue(backup_vault_type::UnknownValue),
3649 }
3650
3651 #[doc(hidden)]
3652 pub mod backup_vault_type {
3653 #[allow(unused_imports)]
3654 use super::*;
3655 #[derive(Clone, Debug, PartialEq)]
3656 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3657 }
3658
3659 impl BackupVaultType {
3660 /// Gets the enum value.
3661 ///
3662 /// Returns `None` if the enum contains an unknown value deserialized from
3663 /// the string representation of enums.
3664 pub fn value(&self) -> std::option::Option<i32> {
3665 match self {
3666 Self::Unspecified => std::option::Option::Some(0),
3667 Self::InRegion => std::option::Option::Some(1),
3668 Self::CrossRegion => std::option::Option::Some(2),
3669 Self::UnknownValue(u) => u.0.value(),
3670 }
3671 }
3672
3673 /// Gets the enum value as a string.
3674 ///
3675 /// Returns `None` if the enum contains an unknown value deserialized from
3676 /// the integer representation of enums.
3677 pub fn name(&self) -> std::option::Option<&str> {
3678 match self {
3679 Self::Unspecified => std::option::Option::Some("BACKUP_VAULT_TYPE_UNSPECIFIED"),
3680 Self::InRegion => std::option::Option::Some("IN_REGION"),
3681 Self::CrossRegion => std::option::Option::Some("CROSS_REGION"),
3682 Self::UnknownValue(u) => u.0.name(),
3683 }
3684 }
3685 }
3686
3687 impl std::default::Default for BackupVaultType {
3688 fn default() -> Self {
3689 use std::convert::From;
3690 Self::from(0)
3691 }
3692 }
3693
3694 impl std::fmt::Display for BackupVaultType {
3695 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3696 wkt::internal::display_enum(f, self.name(), self.value())
3697 }
3698 }
3699
3700 impl std::convert::From<i32> for BackupVaultType {
3701 fn from(value: i32) -> Self {
3702 match value {
3703 0 => Self::Unspecified,
3704 1 => Self::InRegion,
3705 2 => Self::CrossRegion,
3706 _ => Self::UnknownValue(backup_vault_type::UnknownValue(
3707 wkt::internal::UnknownEnumValue::Integer(value),
3708 )),
3709 }
3710 }
3711 }
3712
3713 impl std::convert::From<&str> for BackupVaultType {
3714 fn from(value: &str) -> Self {
3715 use std::string::ToString;
3716 match value {
3717 "BACKUP_VAULT_TYPE_UNSPECIFIED" => Self::Unspecified,
3718 "IN_REGION" => Self::InRegion,
3719 "CROSS_REGION" => Self::CrossRegion,
3720 _ => Self::UnknownValue(backup_vault_type::UnknownValue(
3721 wkt::internal::UnknownEnumValue::String(value.to_string()),
3722 )),
3723 }
3724 }
3725 }
3726
3727 impl serde::ser::Serialize for BackupVaultType {
3728 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3729 where
3730 S: serde::Serializer,
3731 {
3732 match self {
3733 Self::Unspecified => serializer.serialize_i32(0),
3734 Self::InRegion => serializer.serialize_i32(1),
3735 Self::CrossRegion => serializer.serialize_i32(2),
3736 Self::UnknownValue(u) => u.0.serialize(serializer),
3737 }
3738 }
3739 }
3740
3741 impl<'de> serde::de::Deserialize<'de> for BackupVaultType {
3742 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3743 where
3744 D: serde::Deserializer<'de>,
3745 {
3746 deserializer.deserialize_any(wkt::internal::EnumVisitor::<BackupVaultType>::new(
3747 ".google.cloud.netapp.v1.BackupVault.BackupVaultType",
3748 ))
3749 }
3750 }
3751}
3752
3753/// GetBackupVaultRequest gets the state of a backupVault.
3754#[derive(Clone, Default, PartialEq)]
3755#[non_exhaustive]
3756pub struct GetBackupVaultRequest {
3757 /// Required. The backupVault resource name, in the format
3758 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
3759 pub name: std::string::String,
3760
3761 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3762}
3763
3764impl GetBackupVaultRequest {
3765 pub fn new() -> Self {
3766 std::default::Default::default()
3767 }
3768
3769 /// Sets the value of [name][crate::model::GetBackupVaultRequest::name].
3770 ///
3771 /// # Example
3772 /// ```ignore,no_run
3773 /// # use google_cloud_netapp_v1::model::GetBackupVaultRequest;
3774 /// let x = GetBackupVaultRequest::new().set_name("example");
3775 /// ```
3776 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3777 self.name = v.into();
3778 self
3779 }
3780}
3781
3782impl wkt::message::Message for GetBackupVaultRequest {
3783 fn typename() -> &'static str {
3784 "type.googleapis.com/google.cloud.netapp.v1.GetBackupVaultRequest"
3785 }
3786}
3787
3788/// ListBackupVaultsRequest lists backupVaults.
3789#[derive(Clone, Default, PartialEq)]
3790#[non_exhaustive]
3791pub struct ListBackupVaultsRequest {
3792 /// Required. The location for which to retrieve backupVault information,
3793 /// in the format
3794 /// `projects/{project_id}/locations/{location}`.
3795 pub parent: std::string::String,
3796
3797 /// The maximum number of items to return.
3798 pub page_size: i32,
3799
3800 /// The next_page_token value to use if there are additional
3801 /// results to retrieve for this list request.
3802 pub page_token: std::string::String,
3803
3804 /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
3805 pub order_by: std::string::String,
3806
3807 /// List filter.
3808 pub filter: std::string::String,
3809
3810 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3811}
3812
3813impl ListBackupVaultsRequest {
3814 pub fn new() -> Self {
3815 std::default::Default::default()
3816 }
3817
3818 /// Sets the value of [parent][crate::model::ListBackupVaultsRequest::parent].
3819 ///
3820 /// # Example
3821 /// ```ignore,no_run
3822 /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
3823 /// let x = ListBackupVaultsRequest::new().set_parent("example");
3824 /// ```
3825 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3826 self.parent = v.into();
3827 self
3828 }
3829
3830 /// Sets the value of [page_size][crate::model::ListBackupVaultsRequest::page_size].
3831 ///
3832 /// # Example
3833 /// ```ignore,no_run
3834 /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
3835 /// let x = ListBackupVaultsRequest::new().set_page_size(42);
3836 /// ```
3837 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3838 self.page_size = v.into();
3839 self
3840 }
3841
3842 /// Sets the value of [page_token][crate::model::ListBackupVaultsRequest::page_token].
3843 ///
3844 /// # Example
3845 /// ```ignore,no_run
3846 /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
3847 /// let x = ListBackupVaultsRequest::new().set_page_token("example");
3848 /// ```
3849 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3850 self.page_token = v.into();
3851 self
3852 }
3853
3854 /// Sets the value of [order_by][crate::model::ListBackupVaultsRequest::order_by].
3855 ///
3856 /// # Example
3857 /// ```ignore,no_run
3858 /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
3859 /// let x = ListBackupVaultsRequest::new().set_order_by("example");
3860 /// ```
3861 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3862 self.order_by = v.into();
3863 self
3864 }
3865
3866 /// Sets the value of [filter][crate::model::ListBackupVaultsRequest::filter].
3867 ///
3868 /// # Example
3869 /// ```ignore,no_run
3870 /// # use google_cloud_netapp_v1::model::ListBackupVaultsRequest;
3871 /// let x = ListBackupVaultsRequest::new().set_filter("example");
3872 /// ```
3873 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3874 self.filter = v.into();
3875 self
3876 }
3877}
3878
3879impl wkt::message::Message for ListBackupVaultsRequest {
3880 fn typename() -> &'static str {
3881 "type.googleapis.com/google.cloud.netapp.v1.ListBackupVaultsRequest"
3882 }
3883}
3884
3885/// ListBackupVaultsResponse is the result of ListBackupVaultsRequest.
3886#[derive(Clone, Default, PartialEq)]
3887#[non_exhaustive]
3888pub struct ListBackupVaultsResponse {
3889 /// A list of backupVaults in the project for the specified location.
3890 pub backup_vaults: std::vec::Vec<crate::model::BackupVault>,
3891
3892 /// The token you can use to retrieve the next page of results. Not returned
3893 /// if there are no more results in the list.
3894 pub next_page_token: std::string::String,
3895
3896 /// Locations that could not be reached.
3897 pub unreachable: std::vec::Vec<std::string::String>,
3898
3899 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3900}
3901
3902impl ListBackupVaultsResponse {
3903 pub fn new() -> Self {
3904 std::default::Default::default()
3905 }
3906
3907 /// Sets the value of [backup_vaults][crate::model::ListBackupVaultsResponse::backup_vaults].
3908 ///
3909 /// # Example
3910 /// ```ignore,no_run
3911 /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
3912 /// use google_cloud_netapp_v1::model::BackupVault;
3913 /// let x = ListBackupVaultsResponse::new()
3914 /// .set_backup_vaults([
3915 /// BackupVault::default()/* use setters */,
3916 /// BackupVault::default()/* use (different) setters */,
3917 /// ]);
3918 /// ```
3919 pub fn set_backup_vaults<T, V>(mut self, v: T) -> Self
3920 where
3921 T: std::iter::IntoIterator<Item = V>,
3922 V: std::convert::Into<crate::model::BackupVault>,
3923 {
3924 use std::iter::Iterator;
3925 self.backup_vaults = v.into_iter().map(|i| i.into()).collect();
3926 self
3927 }
3928
3929 /// Sets the value of [next_page_token][crate::model::ListBackupVaultsResponse::next_page_token].
3930 ///
3931 /// # Example
3932 /// ```ignore,no_run
3933 /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
3934 /// let x = ListBackupVaultsResponse::new().set_next_page_token("example");
3935 /// ```
3936 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3937 self.next_page_token = v.into();
3938 self
3939 }
3940
3941 /// Sets the value of [unreachable][crate::model::ListBackupVaultsResponse::unreachable].
3942 ///
3943 /// # Example
3944 /// ```ignore,no_run
3945 /// # use google_cloud_netapp_v1::model::ListBackupVaultsResponse;
3946 /// let x = ListBackupVaultsResponse::new().set_unreachable(["a", "b", "c"]);
3947 /// ```
3948 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
3949 where
3950 T: std::iter::IntoIterator<Item = V>,
3951 V: std::convert::Into<std::string::String>,
3952 {
3953 use std::iter::Iterator;
3954 self.unreachable = v.into_iter().map(|i| i.into()).collect();
3955 self
3956 }
3957}
3958
3959impl wkt::message::Message for ListBackupVaultsResponse {
3960 fn typename() -> &'static str {
3961 "type.googleapis.com/google.cloud.netapp.v1.ListBackupVaultsResponse"
3962 }
3963}
3964
3965#[doc(hidden)]
3966impl gax::paginator::internal::PageableResponse for ListBackupVaultsResponse {
3967 type PageItem = crate::model::BackupVault;
3968
3969 fn items(self) -> std::vec::Vec<Self::PageItem> {
3970 self.backup_vaults
3971 }
3972
3973 fn next_page_token(&self) -> std::string::String {
3974 use std::clone::Clone;
3975 self.next_page_token.clone()
3976 }
3977}
3978
3979/// CreateBackupVaultRequest creates a backup vault.
3980#[derive(Clone, Default, PartialEq)]
3981#[non_exhaustive]
3982pub struct CreateBackupVaultRequest {
3983 /// Required. The location to create the backup vaults, in the format
3984 /// `projects/{project_id}/locations/{location}`
3985 pub parent: std::string::String,
3986
3987 /// Required. The ID to use for the backupVault.
3988 /// The ID must be unique within the specified location.
3989 /// Must contain only letters, numbers and hyphen, with the first
3990 /// character a letter, the last a letter or a
3991 /// number, and a 63 character maximum.
3992 pub backup_vault_id: std::string::String,
3993
3994 /// Required. A backupVault resource
3995 pub backup_vault: std::option::Option<crate::model::BackupVault>,
3996
3997 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3998}
3999
4000impl CreateBackupVaultRequest {
4001 pub fn new() -> Self {
4002 std::default::Default::default()
4003 }
4004
4005 /// Sets the value of [parent][crate::model::CreateBackupVaultRequest::parent].
4006 ///
4007 /// # Example
4008 /// ```ignore,no_run
4009 /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4010 /// let x = CreateBackupVaultRequest::new().set_parent("example");
4011 /// ```
4012 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4013 self.parent = v.into();
4014 self
4015 }
4016
4017 /// Sets the value of [backup_vault_id][crate::model::CreateBackupVaultRequest::backup_vault_id].
4018 ///
4019 /// # Example
4020 /// ```ignore,no_run
4021 /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4022 /// let x = CreateBackupVaultRequest::new().set_backup_vault_id("example");
4023 /// ```
4024 pub fn set_backup_vault_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4025 self.backup_vault_id = v.into();
4026 self
4027 }
4028
4029 /// Sets the value of [backup_vault][crate::model::CreateBackupVaultRequest::backup_vault].
4030 ///
4031 /// # Example
4032 /// ```ignore,no_run
4033 /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4034 /// use google_cloud_netapp_v1::model::BackupVault;
4035 /// let x = CreateBackupVaultRequest::new().set_backup_vault(BackupVault::default()/* use setters */);
4036 /// ```
4037 pub fn set_backup_vault<T>(mut self, v: T) -> Self
4038 where
4039 T: std::convert::Into<crate::model::BackupVault>,
4040 {
4041 self.backup_vault = std::option::Option::Some(v.into());
4042 self
4043 }
4044
4045 /// Sets or clears the value of [backup_vault][crate::model::CreateBackupVaultRequest::backup_vault].
4046 ///
4047 /// # Example
4048 /// ```ignore,no_run
4049 /// # use google_cloud_netapp_v1::model::CreateBackupVaultRequest;
4050 /// use google_cloud_netapp_v1::model::BackupVault;
4051 /// let x = CreateBackupVaultRequest::new().set_or_clear_backup_vault(Some(BackupVault::default()/* use setters */));
4052 /// let x = CreateBackupVaultRequest::new().set_or_clear_backup_vault(None::<BackupVault>);
4053 /// ```
4054 pub fn set_or_clear_backup_vault<T>(mut self, v: std::option::Option<T>) -> Self
4055 where
4056 T: std::convert::Into<crate::model::BackupVault>,
4057 {
4058 self.backup_vault = v.map(|x| x.into());
4059 self
4060 }
4061}
4062
4063impl wkt::message::Message for CreateBackupVaultRequest {
4064 fn typename() -> &'static str {
4065 "type.googleapis.com/google.cloud.netapp.v1.CreateBackupVaultRequest"
4066 }
4067}
4068
4069/// DeleteBackupVaultRequest deletes a backupVault.
4070#[derive(Clone, Default, PartialEq)]
4071#[non_exhaustive]
4072pub struct DeleteBackupVaultRequest {
4073 /// Required. The backupVault resource name, in the format
4074 /// `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`
4075 pub name: std::string::String,
4076
4077 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4078}
4079
4080impl DeleteBackupVaultRequest {
4081 pub fn new() -> Self {
4082 std::default::Default::default()
4083 }
4084
4085 /// Sets the value of [name][crate::model::DeleteBackupVaultRequest::name].
4086 ///
4087 /// # Example
4088 /// ```ignore,no_run
4089 /// # use google_cloud_netapp_v1::model::DeleteBackupVaultRequest;
4090 /// let x = DeleteBackupVaultRequest::new().set_name("example");
4091 /// ```
4092 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4093 self.name = v.into();
4094 self
4095 }
4096}
4097
4098impl wkt::message::Message for DeleteBackupVaultRequest {
4099 fn typename() -> &'static str {
4100 "type.googleapis.com/google.cloud.netapp.v1.DeleteBackupVaultRequest"
4101 }
4102}
4103
4104/// UpdateBackupVaultRequest updates description and/or labels for a backupVault.
4105#[derive(Clone, Default, PartialEq)]
4106#[non_exhaustive]
4107pub struct UpdateBackupVaultRequest {
4108 /// Required. Field mask is used to specify the fields to be overwritten in the
4109 /// Backup resource to be updated.
4110 /// The fields specified in the update_mask are relative to the resource, not
4111 /// the full request. A field will be overwritten if it is in the mask. If the
4112 /// user does not provide a mask then all fields will be overwritten.
4113 pub update_mask: std::option::Option<wkt::FieldMask>,
4114
4115 /// Required. The backupVault being updated
4116 pub backup_vault: std::option::Option<crate::model::BackupVault>,
4117
4118 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4119}
4120
4121impl UpdateBackupVaultRequest {
4122 pub fn new() -> Self {
4123 std::default::Default::default()
4124 }
4125
4126 /// Sets the value of [update_mask][crate::model::UpdateBackupVaultRequest::update_mask].
4127 ///
4128 /// # Example
4129 /// ```ignore,no_run
4130 /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4131 /// use wkt::FieldMask;
4132 /// let x = UpdateBackupVaultRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4133 /// ```
4134 pub fn set_update_mask<T>(mut self, v: T) -> Self
4135 where
4136 T: std::convert::Into<wkt::FieldMask>,
4137 {
4138 self.update_mask = std::option::Option::Some(v.into());
4139 self
4140 }
4141
4142 /// Sets or clears the value of [update_mask][crate::model::UpdateBackupVaultRequest::update_mask].
4143 ///
4144 /// # Example
4145 /// ```ignore,no_run
4146 /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4147 /// use wkt::FieldMask;
4148 /// let x = UpdateBackupVaultRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4149 /// let x = UpdateBackupVaultRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4150 /// ```
4151 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4152 where
4153 T: std::convert::Into<wkt::FieldMask>,
4154 {
4155 self.update_mask = v.map(|x| x.into());
4156 self
4157 }
4158
4159 /// Sets the value of [backup_vault][crate::model::UpdateBackupVaultRequest::backup_vault].
4160 ///
4161 /// # Example
4162 /// ```ignore,no_run
4163 /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4164 /// use google_cloud_netapp_v1::model::BackupVault;
4165 /// let x = UpdateBackupVaultRequest::new().set_backup_vault(BackupVault::default()/* use setters */);
4166 /// ```
4167 pub fn set_backup_vault<T>(mut self, v: T) -> Self
4168 where
4169 T: std::convert::Into<crate::model::BackupVault>,
4170 {
4171 self.backup_vault = std::option::Option::Some(v.into());
4172 self
4173 }
4174
4175 /// Sets or clears the value of [backup_vault][crate::model::UpdateBackupVaultRequest::backup_vault].
4176 ///
4177 /// # Example
4178 /// ```ignore,no_run
4179 /// # use google_cloud_netapp_v1::model::UpdateBackupVaultRequest;
4180 /// use google_cloud_netapp_v1::model::BackupVault;
4181 /// let x = UpdateBackupVaultRequest::new().set_or_clear_backup_vault(Some(BackupVault::default()/* use setters */));
4182 /// let x = UpdateBackupVaultRequest::new().set_or_clear_backup_vault(None::<BackupVault>);
4183 /// ```
4184 pub fn set_or_clear_backup_vault<T>(mut self, v: std::option::Option<T>) -> Self
4185 where
4186 T: std::convert::Into<crate::model::BackupVault>,
4187 {
4188 self.backup_vault = v.map(|x| x.into());
4189 self
4190 }
4191}
4192
4193impl wkt::message::Message for UpdateBackupVaultRequest {
4194 fn typename() -> &'static str {
4195 "type.googleapis.com/google.cloud.netapp.v1.UpdateBackupVaultRequest"
4196 }
4197}
4198
4199/// Represents the metadata of the long-running operation.
4200#[derive(Clone, Default, PartialEq)]
4201#[non_exhaustive]
4202pub struct OperationMetadata {
4203 /// Output only. The time the operation was created.
4204 pub create_time: std::option::Option<wkt::Timestamp>,
4205
4206 /// Output only. The time the operation finished running.
4207 pub end_time: std::option::Option<wkt::Timestamp>,
4208
4209 /// Output only. Server-defined resource path for the target of the operation.
4210 pub target: std::string::String,
4211
4212 /// Output only. Name of the verb executed by the operation.
4213 pub verb: std::string::String,
4214
4215 /// Output only. Human-readable status of the operation, if any.
4216 pub status_message: std::string::String,
4217
4218 /// Output only. Identifies whether the user has requested cancellation
4219 /// of the operation. Operations that have been canceled successfully
4220 /// have [Operation.error][] value with a
4221 /// [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
4222 /// `Code.CANCELLED`.
4223 ///
4224 /// [google.rpc.Status.code]: rpc::model::Status::code
4225 pub requested_cancellation: bool,
4226
4227 /// Output only. API version used to start the operation.
4228 pub api_version: std::string::String,
4229
4230 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4231}
4232
4233impl OperationMetadata {
4234 pub fn new() -> Self {
4235 std::default::Default::default()
4236 }
4237
4238 /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
4239 ///
4240 /// # Example
4241 /// ```ignore,no_run
4242 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4243 /// use wkt::Timestamp;
4244 /// let x = OperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
4245 /// ```
4246 pub fn set_create_time<T>(mut self, v: T) -> Self
4247 where
4248 T: std::convert::Into<wkt::Timestamp>,
4249 {
4250 self.create_time = std::option::Option::Some(v.into());
4251 self
4252 }
4253
4254 /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
4255 ///
4256 /// # Example
4257 /// ```ignore,no_run
4258 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4259 /// use wkt::Timestamp;
4260 /// let x = OperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4261 /// let x = OperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
4262 /// ```
4263 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4264 where
4265 T: std::convert::Into<wkt::Timestamp>,
4266 {
4267 self.create_time = v.map(|x| x.into());
4268 self
4269 }
4270
4271 /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
4272 ///
4273 /// # Example
4274 /// ```ignore,no_run
4275 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4276 /// use wkt::Timestamp;
4277 /// let x = OperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
4278 /// ```
4279 pub fn set_end_time<T>(mut self, v: T) -> Self
4280 where
4281 T: std::convert::Into<wkt::Timestamp>,
4282 {
4283 self.end_time = std::option::Option::Some(v.into());
4284 self
4285 }
4286
4287 /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
4288 ///
4289 /// # Example
4290 /// ```ignore,no_run
4291 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4292 /// use wkt::Timestamp;
4293 /// let x = OperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
4294 /// let x = OperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
4295 /// ```
4296 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
4297 where
4298 T: std::convert::Into<wkt::Timestamp>,
4299 {
4300 self.end_time = v.map(|x| x.into());
4301 self
4302 }
4303
4304 /// Sets the value of [target][crate::model::OperationMetadata::target].
4305 ///
4306 /// # Example
4307 /// ```ignore,no_run
4308 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4309 /// let x = OperationMetadata::new().set_target("example");
4310 /// ```
4311 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4312 self.target = v.into();
4313 self
4314 }
4315
4316 /// Sets the value of [verb][crate::model::OperationMetadata::verb].
4317 ///
4318 /// # Example
4319 /// ```ignore,no_run
4320 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4321 /// let x = OperationMetadata::new().set_verb("example");
4322 /// ```
4323 pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4324 self.verb = v.into();
4325 self
4326 }
4327
4328 /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
4329 ///
4330 /// # Example
4331 /// ```ignore,no_run
4332 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4333 /// let x = OperationMetadata::new().set_status_message("example");
4334 /// ```
4335 pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4336 self.status_message = v.into();
4337 self
4338 }
4339
4340 /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
4341 ///
4342 /// # Example
4343 /// ```ignore,no_run
4344 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4345 /// let x = OperationMetadata::new().set_requested_cancellation(true);
4346 /// ```
4347 pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4348 self.requested_cancellation = v.into();
4349 self
4350 }
4351
4352 /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
4353 ///
4354 /// # Example
4355 /// ```ignore,no_run
4356 /// # use google_cloud_netapp_v1::model::OperationMetadata;
4357 /// let x = OperationMetadata::new().set_api_version("example");
4358 /// ```
4359 pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4360 self.api_version = v.into();
4361 self
4362 }
4363}
4364
4365impl wkt::message::Message for OperationMetadata {
4366 fn typename() -> &'static str {
4367 "type.googleapis.com/google.cloud.netapp.v1.OperationMetadata"
4368 }
4369}
4370
4371/// Metadata for a given
4372/// [google.cloud.location.Location][google.cloud.location.Location].
4373///
4374/// [google.cloud.location.Location]: location::model::Location
4375#[derive(Clone, Default, PartialEq)]
4376#[non_exhaustive]
4377pub struct LocationMetadata {
4378 /// Output only. Supported service levels in a location.
4379 pub supported_service_levels: std::vec::Vec<crate::model::ServiceLevel>,
4380
4381 /// Output only. Supported flex performance in a location.
4382 pub supported_flex_performance: std::vec::Vec<crate::model::FlexPerformance>,
4383
4384 /// Output only. Indicates if the location has VCP support.
4385 pub has_vcp: bool,
4386
4387 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4388}
4389
4390impl LocationMetadata {
4391 pub fn new() -> Self {
4392 std::default::Default::default()
4393 }
4394
4395 /// Sets the value of [supported_service_levels][crate::model::LocationMetadata::supported_service_levels].
4396 ///
4397 /// # Example
4398 /// ```ignore,no_run
4399 /// # use google_cloud_netapp_v1::model::LocationMetadata;
4400 /// use google_cloud_netapp_v1::model::ServiceLevel;
4401 /// let x = LocationMetadata::new().set_supported_service_levels([
4402 /// ServiceLevel::Premium,
4403 /// ServiceLevel::Extreme,
4404 /// ServiceLevel::Standard,
4405 /// ]);
4406 /// ```
4407 pub fn set_supported_service_levels<T, V>(mut self, v: T) -> Self
4408 where
4409 T: std::iter::IntoIterator<Item = V>,
4410 V: std::convert::Into<crate::model::ServiceLevel>,
4411 {
4412 use std::iter::Iterator;
4413 self.supported_service_levels = v.into_iter().map(|i| i.into()).collect();
4414 self
4415 }
4416
4417 /// Sets the value of [supported_flex_performance][crate::model::LocationMetadata::supported_flex_performance].
4418 ///
4419 /// # Example
4420 /// ```ignore,no_run
4421 /// # use google_cloud_netapp_v1::model::LocationMetadata;
4422 /// use google_cloud_netapp_v1::model::FlexPerformance;
4423 /// let x = LocationMetadata::new().set_supported_flex_performance([
4424 /// FlexPerformance::Default,
4425 /// FlexPerformance::Custom,
4426 /// ]);
4427 /// ```
4428 pub fn set_supported_flex_performance<T, V>(mut self, v: T) -> Self
4429 where
4430 T: std::iter::IntoIterator<Item = V>,
4431 V: std::convert::Into<crate::model::FlexPerformance>,
4432 {
4433 use std::iter::Iterator;
4434 self.supported_flex_performance = v.into_iter().map(|i| i.into()).collect();
4435 self
4436 }
4437
4438 /// Sets the value of [has_vcp][crate::model::LocationMetadata::has_vcp].
4439 ///
4440 /// # Example
4441 /// ```ignore,no_run
4442 /// # use google_cloud_netapp_v1::model::LocationMetadata;
4443 /// let x = LocationMetadata::new().set_has_vcp(true);
4444 /// ```
4445 pub fn set_has_vcp<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4446 self.has_vcp = v.into();
4447 self
4448 }
4449}
4450
4451impl wkt::message::Message for LocationMetadata {
4452 fn typename() -> &'static str {
4453 "type.googleapis.com/google.cloud.netapp.v1.LocationMetadata"
4454 }
4455}
4456
4457/// UserCommands contains the commands to be executed by the customer.
4458#[derive(Clone, Default, PartialEq)]
4459#[non_exhaustive]
4460pub struct UserCommands {
4461 /// Output only. List of commands to be executed by the customer.
4462 pub commands: std::vec::Vec<std::string::String>,
4463
4464 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4465}
4466
4467impl UserCommands {
4468 pub fn new() -> Self {
4469 std::default::Default::default()
4470 }
4471
4472 /// Sets the value of [commands][crate::model::UserCommands::commands].
4473 ///
4474 /// # Example
4475 /// ```ignore,no_run
4476 /// # use google_cloud_netapp_v1::model::UserCommands;
4477 /// let x = UserCommands::new().set_commands(["a", "b", "c"]);
4478 /// ```
4479 pub fn set_commands<T, V>(mut self, v: T) -> Self
4480 where
4481 T: std::iter::IntoIterator<Item = V>,
4482 V: std::convert::Into<std::string::String>,
4483 {
4484 use std::iter::Iterator;
4485 self.commands = v.into_iter().map(|i| i.into()).collect();
4486 self
4487 }
4488}
4489
4490impl wkt::message::Message for UserCommands {
4491 fn typename() -> &'static str {
4492 "type.googleapis.com/google.cloud.netapp.v1.UserCommands"
4493 }
4494}
4495
4496/// GetKmsConfigRequest gets a KMS Config.
4497#[derive(Clone, Default, PartialEq)]
4498#[non_exhaustive]
4499pub struct GetKmsConfigRequest {
4500 /// Required. Name of the KmsConfig
4501 pub name: std::string::String,
4502
4503 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4504}
4505
4506impl GetKmsConfigRequest {
4507 pub fn new() -> Self {
4508 std::default::Default::default()
4509 }
4510
4511 /// Sets the value of [name][crate::model::GetKmsConfigRequest::name].
4512 ///
4513 /// # Example
4514 /// ```ignore,no_run
4515 /// # use google_cloud_netapp_v1::model::GetKmsConfigRequest;
4516 /// let x = GetKmsConfigRequest::new().set_name("example");
4517 /// ```
4518 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4519 self.name = v.into();
4520 self
4521 }
4522}
4523
4524impl wkt::message::Message for GetKmsConfigRequest {
4525 fn typename() -> &'static str {
4526 "type.googleapis.com/google.cloud.netapp.v1.GetKmsConfigRequest"
4527 }
4528}
4529
4530/// ListKmsConfigsRequest lists KMS Configs.
4531#[derive(Clone, Default, PartialEq)]
4532#[non_exhaustive]
4533pub struct ListKmsConfigsRequest {
4534 /// Required. Parent value
4535 pub parent: std::string::String,
4536
4537 /// The maximum number of items to return.
4538 pub page_size: i32,
4539
4540 /// The next_page_token value to use if there are additional
4541 /// results to retrieve for this list request.
4542 pub page_token: std::string::String,
4543
4544 /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
4545 pub order_by: std::string::String,
4546
4547 /// List filter.
4548 pub filter: std::string::String,
4549
4550 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4551}
4552
4553impl ListKmsConfigsRequest {
4554 pub fn new() -> Self {
4555 std::default::Default::default()
4556 }
4557
4558 /// Sets the value of [parent][crate::model::ListKmsConfigsRequest::parent].
4559 ///
4560 /// # Example
4561 /// ```ignore,no_run
4562 /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
4563 /// let x = ListKmsConfigsRequest::new().set_parent("example");
4564 /// ```
4565 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4566 self.parent = v.into();
4567 self
4568 }
4569
4570 /// Sets the value of [page_size][crate::model::ListKmsConfigsRequest::page_size].
4571 ///
4572 /// # Example
4573 /// ```ignore,no_run
4574 /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
4575 /// let x = ListKmsConfigsRequest::new().set_page_size(42);
4576 /// ```
4577 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4578 self.page_size = v.into();
4579 self
4580 }
4581
4582 /// Sets the value of [page_token][crate::model::ListKmsConfigsRequest::page_token].
4583 ///
4584 /// # Example
4585 /// ```ignore,no_run
4586 /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
4587 /// let x = ListKmsConfigsRequest::new().set_page_token("example");
4588 /// ```
4589 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4590 self.page_token = v.into();
4591 self
4592 }
4593
4594 /// Sets the value of [order_by][crate::model::ListKmsConfigsRequest::order_by].
4595 ///
4596 /// # Example
4597 /// ```ignore,no_run
4598 /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
4599 /// let x = ListKmsConfigsRequest::new().set_order_by("example");
4600 /// ```
4601 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4602 self.order_by = v.into();
4603 self
4604 }
4605
4606 /// Sets the value of [filter][crate::model::ListKmsConfigsRequest::filter].
4607 ///
4608 /// # Example
4609 /// ```ignore,no_run
4610 /// # use google_cloud_netapp_v1::model::ListKmsConfigsRequest;
4611 /// let x = ListKmsConfigsRequest::new().set_filter("example");
4612 /// ```
4613 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4614 self.filter = v.into();
4615 self
4616 }
4617}
4618
4619impl wkt::message::Message for ListKmsConfigsRequest {
4620 fn typename() -> &'static str {
4621 "type.googleapis.com/google.cloud.netapp.v1.ListKmsConfigsRequest"
4622 }
4623}
4624
4625/// ListKmsConfigsResponse is the response to a ListKmsConfigsRequest.
4626#[derive(Clone, Default, PartialEq)]
4627#[non_exhaustive]
4628pub struct ListKmsConfigsResponse {
4629 /// The list of KmsConfigs
4630 pub kms_configs: std::vec::Vec<crate::model::KmsConfig>,
4631
4632 /// A token identifying a page of results the server should return.
4633 pub next_page_token: std::string::String,
4634
4635 /// Locations that could not be reached.
4636 pub unreachable: std::vec::Vec<std::string::String>,
4637
4638 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4639}
4640
4641impl ListKmsConfigsResponse {
4642 pub fn new() -> Self {
4643 std::default::Default::default()
4644 }
4645
4646 /// Sets the value of [kms_configs][crate::model::ListKmsConfigsResponse::kms_configs].
4647 ///
4648 /// # Example
4649 /// ```ignore,no_run
4650 /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
4651 /// use google_cloud_netapp_v1::model::KmsConfig;
4652 /// let x = ListKmsConfigsResponse::new()
4653 /// .set_kms_configs([
4654 /// KmsConfig::default()/* use setters */,
4655 /// KmsConfig::default()/* use (different) setters */,
4656 /// ]);
4657 /// ```
4658 pub fn set_kms_configs<T, V>(mut self, v: T) -> Self
4659 where
4660 T: std::iter::IntoIterator<Item = V>,
4661 V: std::convert::Into<crate::model::KmsConfig>,
4662 {
4663 use std::iter::Iterator;
4664 self.kms_configs = v.into_iter().map(|i| i.into()).collect();
4665 self
4666 }
4667
4668 /// Sets the value of [next_page_token][crate::model::ListKmsConfigsResponse::next_page_token].
4669 ///
4670 /// # Example
4671 /// ```ignore,no_run
4672 /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
4673 /// let x = ListKmsConfigsResponse::new().set_next_page_token("example");
4674 /// ```
4675 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4676 self.next_page_token = v.into();
4677 self
4678 }
4679
4680 /// Sets the value of [unreachable][crate::model::ListKmsConfigsResponse::unreachable].
4681 ///
4682 /// # Example
4683 /// ```ignore,no_run
4684 /// # use google_cloud_netapp_v1::model::ListKmsConfigsResponse;
4685 /// let x = ListKmsConfigsResponse::new().set_unreachable(["a", "b", "c"]);
4686 /// ```
4687 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
4688 where
4689 T: std::iter::IntoIterator<Item = V>,
4690 V: std::convert::Into<std::string::String>,
4691 {
4692 use std::iter::Iterator;
4693 self.unreachable = v.into_iter().map(|i| i.into()).collect();
4694 self
4695 }
4696}
4697
4698impl wkt::message::Message for ListKmsConfigsResponse {
4699 fn typename() -> &'static str {
4700 "type.googleapis.com/google.cloud.netapp.v1.ListKmsConfigsResponse"
4701 }
4702}
4703
4704#[doc(hidden)]
4705impl gax::paginator::internal::PageableResponse for ListKmsConfigsResponse {
4706 type PageItem = crate::model::KmsConfig;
4707
4708 fn items(self) -> std::vec::Vec<Self::PageItem> {
4709 self.kms_configs
4710 }
4711
4712 fn next_page_token(&self) -> std::string::String {
4713 use std::clone::Clone;
4714 self.next_page_token.clone()
4715 }
4716}
4717
4718/// CreateKmsConfigRequest creates a KMS Config.
4719#[derive(Clone, Default, PartialEq)]
4720#[non_exhaustive]
4721pub struct CreateKmsConfigRequest {
4722 /// Required. Value for parent.
4723 pub parent: std::string::String,
4724
4725 /// Required. Id of the requesting KmsConfig. Must be unique within the parent
4726 /// resource. Must contain only letters, numbers and hyphen, with the first
4727 /// character a letter, the last a letter or a
4728 /// number, and a 63 character maximum.
4729 pub kms_config_id: std::string::String,
4730
4731 /// Required. The required parameters to create a new KmsConfig.
4732 pub kms_config: std::option::Option<crate::model::KmsConfig>,
4733
4734 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4735}
4736
4737impl CreateKmsConfigRequest {
4738 pub fn new() -> Self {
4739 std::default::Default::default()
4740 }
4741
4742 /// Sets the value of [parent][crate::model::CreateKmsConfigRequest::parent].
4743 ///
4744 /// # Example
4745 /// ```ignore,no_run
4746 /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
4747 /// let x = CreateKmsConfigRequest::new().set_parent("example");
4748 /// ```
4749 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4750 self.parent = v.into();
4751 self
4752 }
4753
4754 /// Sets the value of [kms_config_id][crate::model::CreateKmsConfigRequest::kms_config_id].
4755 ///
4756 /// # Example
4757 /// ```ignore,no_run
4758 /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
4759 /// let x = CreateKmsConfigRequest::new().set_kms_config_id("example");
4760 /// ```
4761 pub fn set_kms_config_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4762 self.kms_config_id = v.into();
4763 self
4764 }
4765
4766 /// Sets the value of [kms_config][crate::model::CreateKmsConfigRequest::kms_config].
4767 ///
4768 /// # Example
4769 /// ```ignore,no_run
4770 /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
4771 /// use google_cloud_netapp_v1::model::KmsConfig;
4772 /// let x = CreateKmsConfigRequest::new().set_kms_config(KmsConfig::default()/* use setters */);
4773 /// ```
4774 pub fn set_kms_config<T>(mut self, v: T) -> Self
4775 where
4776 T: std::convert::Into<crate::model::KmsConfig>,
4777 {
4778 self.kms_config = std::option::Option::Some(v.into());
4779 self
4780 }
4781
4782 /// Sets or clears the value of [kms_config][crate::model::CreateKmsConfigRequest::kms_config].
4783 ///
4784 /// # Example
4785 /// ```ignore,no_run
4786 /// # use google_cloud_netapp_v1::model::CreateKmsConfigRequest;
4787 /// use google_cloud_netapp_v1::model::KmsConfig;
4788 /// let x = CreateKmsConfigRequest::new().set_or_clear_kms_config(Some(KmsConfig::default()/* use setters */));
4789 /// let x = CreateKmsConfigRequest::new().set_or_clear_kms_config(None::<KmsConfig>);
4790 /// ```
4791 pub fn set_or_clear_kms_config<T>(mut self, v: std::option::Option<T>) -> Self
4792 where
4793 T: std::convert::Into<crate::model::KmsConfig>,
4794 {
4795 self.kms_config = v.map(|x| x.into());
4796 self
4797 }
4798}
4799
4800impl wkt::message::Message for CreateKmsConfigRequest {
4801 fn typename() -> &'static str {
4802 "type.googleapis.com/google.cloud.netapp.v1.CreateKmsConfigRequest"
4803 }
4804}
4805
4806/// UpdateKmsConfigRequest updates a KMS Config.
4807#[derive(Clone, Default, PartialEq)]
4808#[non_exhaustive]
4809pub struct UpdateKmsConfigRequest {
4810 /// Required. Field mask is used to specify the fields to be overwritten in the
4811 /// KmsConfig resource by the update.
4812 /// The fields specified in the update_mask are relative to the resource, not
4813 /// the full request. A field will be overwritten if it is in the mask. If the
4814 /// user does not provide a mask then all fields will be overwritten.
4815 pub update_mask: std::option::Option<wkt::FieldMask>,
4816
4817 /// Required. The KmsConfig being updated
4818 pub kms_config: std::option::Option<crate::model::KmsConfig>,
4819
4820 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4821}
4822
4823impl UpdateKmsConfigRequest {
4824 pub fn new() -> Self {
4825 std::default::Default::default()
4826 }
4827
4828 /// Sets the value of [update_mask][crate::model::UpdateKmsConfigRequest::update_mask].
4829 ///
4830 /// # Example
4831 /// ```ignore,no_run
4832 /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
4833 /// use wkt::FieldMask;
4834 /// let x = UpdateKmsConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4835 /// ```
4836 pub fn set_update_mask<T>(mut self, v: T) -> Self
4837 where
4838 T: std::convert::Into<wkt::FieldMask>,
4839 {
4840 self.update_mask = std::option::Option::Some(v.into());
4841 self
4842 }
4843
4844 /// Sets or clears the value of [update_mask][crate::model::UpdateKmsConfigRequest::update_mask].
4845 ///
4846 /// # Example
4847 /// ```ignore,no_run
4848 /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
4849 /// use wkt::FieldMask;
4850 /// let x = UpdateKmsConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4851 /// let x = UpdateKmsConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4852 /// ```
4853 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4854 where
4855 T: std::convert::Into<wkt::FieldMask>,
4856 {
4857 self.update_mask = v.map(|x| x.into());
4858 self
4859 }
4860
4861 /// Sets the value of [kms_config][crate::model::UpdateKmsConfigRequest::kms_config].
4862 ///
4863 /// # Example
4864 /// ```ignore,no_run
4865 /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
4866 /// use google_cloud_netapp_v1::model::KmsConfig;
4867 /// let x = UpdateKmsConfigRequest::new().set_kms_config(KmsConfig::default()/* use setters */);
4868 /// ```
4869 pub fn set_kms_config<T>(mut self, v: T) -> Self
4870 where
4871 T: std::convert::Into<crate::model::KmsConfig>,
4872 {
4873 self.kms_config = std::option::Option::Some(v.into());
4874 self
4875 }
4876
4877 /// Sets or clears the value of [kms_config][crate::model::UpdateKmsConfigRequest::kms_config].
4878 ///
4879 /// # Example
4880 /// ```ignore,no_run
4881 /// # use google_cloud_netapp_v1::model::UpdateKmsConfigRequest;
4882 /// use google_cloud_netapp_v1::model::KmsConfig;
4883 /// let x = UpdateKmsConfigRequest::new().set_or_clear_kms_config(Some(KmsConfig::default()/* use setters */));
4884 /// let x = UpdateKmsConfigRequest::new().set_or_clear_kms_config(None::<KmsConfig>);
4885 /// ```
4886 pub fn set_or_clear_kms_config<T>(mut self, v: std::option::Option<T>) -> Self
4887 where
4888 T: std::convert::Into<crate::model::KmsConfig>,
4889 {
4890 self.kms_config = v.map(|x| x.into());
4891 self
4892 }
4893}
4894
4895impl wkt::message::Message for UpdateKmsConfigRequest {
4896 fn typename() -> &'static str {
4897 "type.googleapis.com/google.cloud.netapp.v1.UpdateKmsConfigRequest"
4898 }
4899}
4900
4901/// DeleteKmsConfigRequest deletes a KMS Config.
4902#[derive(Clone, Default, PartialEq)]
4903#[non_exhaustive]
4904pub struct DeleteKmsConfigRequest {
4905 /// Required. Name of the KmsConfig.
4906 pub name: std::string::String,
4907
4908 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4909}
4910
4911impl DeleteKmsConfigRequest {
4912 pub fn new() -> Self {
4913 std::default::Default::default()
4914 }
4915
4916 /// Sets the value of [name][crate::model::DeleteKmsConfigRequest::name].
4917 ///
4918 /// # Example
4919 /// ```ignore,no_run
4920 /// # use google_cloud_netapp_v1::model::DeleteKmsConfigRequest;
4921 /// let x = DeleteKmsConfigRequest::new().set_name("example");
4922 /// ```
4923 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4924 self.name = v.into();
4925 self
4926 }
4927}
4928
4929impl wkt::message::Message for DeleteKmsConfigRequest {
4930 fn typename() -> &'static str {
4931 "type.googleapis.com/google.cloud.netapp.v1.DeleteKmsConfigRequest"
4932 }
4933}
4934
4935/// EncryptVolumesRequest specifies the KMS config to encrypt existing volumes.
4936#[derive(Clone, Default, PartialEq)]
4937#[non_exhaustive]
4938pub struct EncryptVolumesRequest {
4939 /// Required. Name of the KmsConfig.
4940 pub name: std::string::String,
4941
4942 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4943}
4944
4945impl EncryptVolumesRequest {
4946 pub fn new() -> Self {
4947 std::default::Default::default()
4948 }
4949
4950 /// Sets the value of [name][crate::model::EncryptVolumesRequest::name].
4951 ///
4952 /// # Example
4953 /// ```ignore,no_run
4954 /// # use google_cloud_netapp_v1::model::EncryptVolumesRequest;
4955 /// let x = EncryptVolumesRequest::new().set_name("example");
4956 /// ```
4957 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4958 self.name = v.into();
4959 self
4960 }
4961}
4962
4963impl wkt::message::Message for EncryptVolumesRequest {
4964 fn typename() -> &'static str {
4965 "type.googleapis.com/google.cloud.netapp.v1.EncryptVolumesRequest"
4966 }
4967}
4968
4969/// VerifyKmsConfigRequest specifies the KMS config to be validated.
4970#[derive(Clone, Default, PartialEq)]
4971#[non_exhaustive]
4972pub struct VerifyKmsConfigRequest {
4973 /// Required. Name of the KMS Config to be verified.
4974 pub name: std::string::String,
4975
4976 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4977}
4978
4979impl VerifyKmsConfigRequest {
4980 pub fn new() -> Self {
4981 std::default::Default::default()
4982 }
4983
4984 /// Sets the value of [name][crate::model::VerifyKmsConfigRequest::name].
4985 ///
4986 /// # Example
4987 /// ```ignore,no_run
4988 /// # use google_cloud_netapp_v1::model::VerifyKmsConfigRequest;
4989 /// let x = VerifyKmsConfigRequest::new().set_name("example");
4990 /// ```
4991 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4992 self.name = v.into();
4993 self
4994 }
4995}
4996
4997impl wkt::message::Message for VerifyKmsConfigRequest {
4998 fn typename() -> &'static str {
4999 "type.googleapis.com/google.cloud.netapp.v1.VerifyKmsConfigRequest"
5000 }
5001}
5002
5003/// VerifyKmsConfigResponse contains the information if the config is correctly
5004/// and error message.
5005#[derive(Clone, Default, PartialEq)]
5006#[non_exhaustive]
5007pub struct VerifyKmsConfigResponse {
5008 /// Output only. If the customer key configured correctly to the encrypt
5009 /// volume.
5010 pub healthy: bool,
5011
5012 /// Output only. Error message if config is not healthy.
5013 pub health_error: std::string::String,
5014
5015 /// Output only. Instructions for the customers to provide the access to the
5016 /// encryption key.
5017 pub instructions: std::string::String,
5018
5019 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5020}
5021
5022impl VerifyKmsConfigResponse {
5023 pub fn new() -> Self {
5024 std::default::Default::default()
5025 }
5026
5027 /// Sets the value of [healthy][crate::model::VerifyKmsConfigResponse::healthy].
5028 ///
5029 /// # Example
5030 /// ```ignore,no_run
5031 /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
5032 /// let x = VerifyKmsConfigResponse::new().set_healthy(true);
5033 /// ```
5034 pub fn set_healthy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5035 self.healthy = v.into();
5036 self
5037 }
5038
5039 /// Sets the value of [health_error][crate::model::VerifyKmsConfigResponse::health_error].
5040 ///
5041 /// # Example
5042 /// ```ignore,no_run
5043 /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
5044 /// let x = VerifyKmsConfigResponse::new().set_health_error("example");
5045 /// ```
5046 pub fn set_health_error<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5047 self.health_error = v.into();
5048 self
5049 }
5050
5051 /// Sets the value of [instructions][crate::model::VerifyKmsConfigResponse::instructions].
5052 ///
5053 /// # Example
5054 /// ```ignore,no_run
5055 /// # use google_cloud_netapp_v1::model::VerifyKmsConfigResponse;
5056 /// let x = VerifyKmsConfigResponse::new().set_instructions("example");
5057 /// ```
5058 pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5059 self.instructions = v.into();
5060 self
5061 }
5062}
5063
5064impl wkt::message::Message for VerifyKmsConfigResponse {
5065 fn typename() -> &'static str {
5066 "type.googleapis.com/google.cloud.netapp.v1.VerifyKmsConfigResponse"
5067 }
5068}
5069
5070/// KmsConfig is the customer managed encryption key(CMEK) configuration.
5071#[derive(Clone, Default, PartialEq)]
5072#[non_exhaustive]
5073pub struct KmsConfig {
5074 /// Identifier. Name of the KmsConfig.
5075 pub name: std::string::String,
5076
5077 /// Required. Customer managed crypto key resource full name. Format:
5078 /// projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{key}.
5079 pub crypto_key_name: std::string::String,
5080
5081 /// Output only. State of the KmsConfig.
5082 pub state: crate::model::kms_config::State,
5083
5084 /// Output only. State details of the KmsConfig.
5085 pub state_details: std::string::String,
5086
5087 /// Output only. Create time of the KmsConfig.
5088 pub create_time: std::option::Option<wkt::Timestamp>,
5089
5090 /// Description of the KmsConfig.
5091 pub description: std::string::String,
5092
5093 /// Labels as key value pairs
5094 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5095
5096 /// Output only. Instructions to provide the access to the customer provided
5097 /// encryption key.
5098 pub instructions: std::string::String,
5099
5100 /// Output only. The Service account which will have access to the customer
5101 /// provided encryption key.
5102 pub service_account: std::string::String,
5103
5104 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5105}
5106
5107impl KmsConfig {
5108 pub fn new() -> Self {
5109 std::default::Default::default()
5110 }
5111
5112 /// Sets the value of [name][crate::model::KmsConfig::name].
5113 ///
5114 /// # Example
5115 /// ```ignore,no_run
5116 /// # use google_cloud_netapp_v1::model::KmsConfig;
5117 /// let x = KmsConfig::new().set_name("example");
5118 /// ```
5119 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5120 self.name = v.into();
5121 self
5122 }
5123
5124 /// Sets the value of [crypto_key_name][crate::model::KmsConfig::crypto_key_name].
5125 ///
5126 /// # Example
5127 /// ```ignore,no_run
5128 /// # use google_cloud_netapp_v1::model::KmsConfig;
5129 /// let x = KmsConfig::new().set_crypto_key_name("example");
5130 /// ```
5131 pub fn set_crypto_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5132 self.crypto_key_name = v.into();
5133 self
5134 }
5135
5136 /// Sets the value of [state][crate::model::KmsConfig::state].
5137 ///
5138 /// # Example
5139 /// ```ignore,no_run
5140 /// # use google_cloud_netapp_v1::model::KmsConfig;
5141 /// use google_cloud_netapp_v1::model::kms_config::State;
5142 /// let x0 = KmsConfig::new().set_state(State::Ready);
5143 /// let x1 = KmsConfig::new().set_state(State::Creating);
5144 /// let x2 = KmsConfig::new().set_state(State::Deleting);
5145 /// ```
5146 pub fn set_state<T: std::convert::Into<crate::model::kms_config::State>>(
5147 mut self,
5148 v: T,
5149 ) -> Self {
5150 self.state = v.into();
5151 self
5152 }
5153
5154 /// Sets the value of [state_details][crate::model::KmsConfig::state_details].
5155 ///
5156 /// # Example
5157 /// ```ignore,no_run
5158 /// # use google_cloud_netapp_v1::model::KmsConfig;
5159 /// let x = KmsConfig::new().set_state_details("example");
5160 /// ```
5161 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5162 self.state_details = v.into();
5163 self
5164 }
5165
5166 /// Sets the value of [create_time][crate::model::KmsConfig::create_time].
5167 ///
5168 /// # Example
5169 /// ```ignore,no_run
5170 /// # use google_cloud_netapp_v1::model::KmsConfig;
5171 /// use wkt::Timestamp;
5172 /// let x = KmsConfig::new().set_create_time(Timestamp::default()/* use setters */);
5173 /// ```
5174 pub fn set_create_time<T>(mut self, v: T) -> Self
5175 where
5176 T: std::convert::Into<wkt::Timestamp>,
5177 {
5178 self.create_time = std::option::Option::Some(v.into());
5179 self
5180 }
5181
5182 /// Sets or clears the value of [create_time][crate::model::KmsConfig::create_time].
5183 ///
5184 /// # Example
5185 /// ```ignore,no_run
5186 /// # use google_cloud_netapp_v1::model::KmsConfig;
5187 /// use wkt::Timestamp;
5188 /// let x = KmsConfig::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5189 /// let x = KmsConfig::new().set_or_clear_create_time(None::<Timestamp>);
5190 /// ```
5191 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5192 where
5193 T: std::convert::Into<wkt::Timestamp>,
5194 {
5195 self.create_time = v.map(|x| x.into());
5196 self
5197 }
5198
5199 /// Sets the value of [description][crate::model::KmsConfig::description].
5200 ///
5201 /// # Example
5202 /// ```ignore,no_run
5203 /// # use google_cloud_netapp_v1::model::KmsConfig;
5204 /// let x = KmsConfig::new().set_description("example");
5205 /// ```
5206 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5207 self.description = v.into();
5208 self
5209 }
5210
5211 /// Sets the value of [labels][crate::model::KmsConfig::labels].
5212 ///
5213 /// # Example
5214 /// ```ignore,no_run
5215 /// # use google_cloud_netapp_v1::model::KmsConfig;
5216 /// let x = KmsConfig::new().set_labels([
5217 /// ("key0", "abc"),
5218 /// ("key1", "xyz"),
5219 /// ]);
5220 /// ```
5221 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
5222 where
5223 T: std::iter::IntoIterator<Item = (K, V)>,
5224 K: std::convert::Into<std::string::String>,
5225 V: std::convert::Into<std::string::String>,
5226 {
5227 use std::iter::Iterator;
5228 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5229 self
5230 }
5231
5232 /// Sets the value of [instructions][crate::model::KmsConfig::instructions].
5233 ///
5234 /// # Example
5235 /// ```ignore,no_run
5236 /// # use google_cloud_netapp_v1::model::KmsConfig;
5237 /// let x = KmsConfig::new().set_instructions("example");
5238 /// ```
5239 pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5240 self.instructions = v.into();
5241 self
5242 }
5243
5244 /// Sets the value of [service_account][crate::model::KmsConfig::service_account].
5245 ///
5246 /// # Example
5247 /// ```ignore,no_run
5248 /// # use google_cloud_netapp_v1::model::KmsConfig;
5249 /// let x = KmsConfig::new().set_service_account("example");
5250 /// ```
5251 pub fn set_service_account<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5252 self.service_account = v.into();
5253 self
5254 }
5255}
5256
5257impl wkt::message::Message for KmsConfig {
5258 fn typename() -> &'static str {
5259 "type.googleapis.com/google.cloud.netapp.v1.KmsConfig"
5260 }
5261}
5262
5263/// Defines additional types related to [KmsConfig].
5264pub mod kms_config {
5265 #[allow(unused_imports)]
5266 use super::*;
5267
5268 /// The KmsConfig States
5269 ///
5270 /// # Working with unknown values
5271 ///
5272 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5273 /// additional enum variants at any time. Adding new variants is not considered
5274 /// a breaking change. Applications should write their code in anticipation of:
5275 ///
5276 /// - New values appearing in future releases of the client library, **and**
5277 /// - New values received dynamically, without application changes.
5278 ///
5279 /// Please consult the [Working with enums] section in the user guide for some
5280 /// guidelines.
5281 ///
5282 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5283 #[derive(Clone, Debug, PartialEq)]
5284 #[non_exhaustive]
5285 pub enum State {
5286 /// Unspecified KmsConfig State
5287 Unspecified,
5288 /// KmsConfig State is Ready
5289 Ready,
5290 /// KmsConfig State is Creating
5291 Creating,
5292 /// KmsConfig State is Deleting
5293 Deleting,
5294 /// KmsConfig State is Updating
5295 Updating,
5296 /// KmsConfig State is In Use.
5297 InUse,
5298 /// KmsConfig State is Error
5299 Error,
5300 /// KmsConfig State is Pending to verify crypto key access.
5301 KeyCheckPending,
5302 /// KmsConfig State is Not accessbile by the SDE service account to the
5303 /// crypto key.
5304 KeyNotReachable,
5305 /// KmsConfig State is Disabling.
5306 Disabling,
5307 /// KmsConfig State is Disabled.
5308 Disabled,
5309 /// KmsConfig State is Migrating.
5310 /// The existing volumes are migrating from SMEK to CMEK.
5311 Migrating,
5312 /// If set, the enum was initialized with an unknown value.
5313 ///
5314 /// Applications can examine the value using [State::value] or
5315 /// [State::name].
5316 UnknownValue(state::UnknownValue),
5317 }
5318
5319 #[doc(hidden)]
5320 pub mod state {
5321 #[allow(unused_imports)]
5322 use super::*;
5323 #[derive(Clone, Debug, PartialEq)]
5324 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5325 }
5326
5327 impl State {
5328 /// Gets the enum value.
5329 ///
5330 /// Returns `None` if the enum contains an unknown value deserialized from
5331 /// the string representation of enums.
5332 pub fn value(&self) -> std::option::Option<i32> {
5333 match self {
5334 Self::Unspecified => std::option::Option::Some(0),
5335 Self::Ready => std::option::Option::Some(1),
5336 Self::Creating => std::option::Option::Some(2),
5337 Self::Deleting => std::option::Option::Some(3),
5338 Self::Updating => std::option::Option::Some(4),
5339 Self::InUse => std::option::Option::Some(5),
5340 Self::Error => std::option::Option::Some(6),
5341 Self::KeyCheckPending => std::option::Option::Some(7),
5342 Self::KeyNotReachable => std::option::Option::Some(8),
5343 Self::Disabling => std::option::Option::Some(9),
5344 Self::Disabled => std::option::Option::Some(10),
5345 Self::Migrating => std::option::Option::Some(11),
5346 Self::UnknownValue(u) => u.0.value(),
5347 }
5348 }
5349
5350 /// Gets the enum value as a string.
5351 ///
5352 /// Returns `None` if the enum contains an unknown value deserialized from
5353 /// the integer representation of enums.
5354 pub fn name(&self) -> std::option::Option<&str> {
5355 match self {
5356 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
5357 Self::Ready => std::option::Option::Some("READY"),
5358 Self::Creating => std::option::Option::Some("CREATING"),
5359 Self::Deleting => std::option::Option::Some("DELETING"),
5360 Self::Updating => std::option::Option::Some("UPDATING"),
5361 Self::InUse => std::option::Option::Some("IN_USE"),
5362 Self::Error => std::option::Option::Some("ERROR"),
5363 Self::KeyCheckPending => std::option::Option::Some("KEY_CHECK_PENDING"),
5364 Self::KeyNotReachable => std::option::Option::Some("KEY_NOT_REACHABLE"),
5365 Self::Disabling => std::option::Option::Some("DISABLING"),
5366 Self::Disabled => std::option::Option::Some("DISABLED"),
5367 Self::Migrating => std::option::Option::Some("MIGRATING"),
5368 Self::UnknownValue(u) => u.0.name(),
5369 }
5370 }
5371 }
5372
5373 impl std::default::Default for State {
5374 fn default() -> Self {
5375 use std::convert::From;
5376 Self::from(0)
5377 }
5378 }
5379
5380 impl std::fmt::Display for State {
5381 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5382 wkt::internal::display_enum(f, self.name(), self.value())
5383 }
5384 }
5385
5386 impl std::convert::From<i32> for State {
5387 fn from(value: i32) -> Self {
5388 match value {
5389 0 => Self::Unspecified,
5390 1 => Self::Ready,
5391 2 => Self::Creating,
5392 3 => Self::Deleting,
5393 4 => Self::Updating,
5394 5 => Self::InUse,
5395 6 => Self::Error,
5396 7 => Self::KeyCheckPending,
5397 8 => Self::KeyNotReachable,
5398 9 => Self::Disabling,
5399 10 => Self::Disabled,
5400 11 => Self::Migrating,
5401 _ => Self::UnknownValue(state::UnknownValue(
5402 wkt::internal::UnknownEnumValue::Integer(value),
5403 )),
5404 }
5405 }
5406 }
5407
5408 impl std::convert::From<&str> for State {
5409 fn from(value: &str) -> Self {
5410 use std::string::ToString;
5411 match value {
5412 "STATE_UNSPECIFIED" => Self::Unspecified,
5413 "READY" => Self::Ready,
5414 "CREATING" => Self::Creating,
5415 "DELETING" => Self::Deleting,
5416 "UPDATING" => Self::Updating,
5417 "IN_USE" => Self::InUse,
5418 "ERROR" => Self::Error,
5419 "KEY_CHECK_PENDING" => Self::KeyCheckPending,
5420 "KEY_NOT_REACHABLE" => Self::KeyNotReachable,
5421 "DISABLING" => Self::Disabling,
5422 "DISABLED" => Self::Disabled,
5423 "MIGRATING" => Self::Migrating,
5424 _ => Self::UnknownValue(state::UnknownValue(
5425 wkt::internal::UnknownEnumValue::String(value.to_string()),
5426 )),
5427 }
5428 }
5429 }
5430
5431 impl serde::ser::Serialize for State {
5432 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5433 where
5434 S: serde::Serializer,
5435 {
5436 match self {
5437 Self::Unspecified => serializer.serialize_i32(0),
5438 Self::Ready => serializer.serialize_i32(1),
5439 Self::Creating => serializer.serialize_i32(2),
5440 Self::Deleting => serializer.serialize_i32(3),
5441 Self::Updating => serializer.serialize_i32(4),
5442 Self::InUse => serializer.serialize_i32(5),
5443 Self::Error => serializer.serialize_i32(6),
5444 Self::KeyCheckPending => serializer.serialize_i32(7),
5445 Self::KeyNotReachable => serializer.serialize_i32(8),
5446 Self::Disabling => serializer.serialize_i32(9),
5447 Self::Disabled => serializer.serialize_i32(10),
5448 Self::Migrating => serializer.serialize_i32(11),
5449 Self::UnknownValue(u) => u.0.serialize(serializer),
5450 }
5451 }
5452 }
5453
5454 impl<'de> serde::de::Deserialize<'de> for State {
5455 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5456 where
5457 D: serde::Deserializer<'de>,
5458 {
5459 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
5460 ".google.cloud.netapp.v1.KmsConfig.State",
5461 ))
5462 }
5463 }
5464}
5465
5466/// ListQuotaRulesRequest for listing quota rules.
5467#[derive(Clone, Default, PartialEq)]
5468#[non_exhaustive]
5469pub struct ListQuotaRulesRequest {
5470 /// Required. Parent value for ListQuotaRulesRequest
5471 pub parent: std::string::String,
5472
5473 /// Optional. Requested page size. Server may return fewer items than
5474 /// requested. If unspecified, the server will pick an appropriate default.
5475 pub page_size: i32,
5476
5477 /// Optional. A token identifying a page of results the server should return.
5478 pub page_token: std::string::String,
5479
5480 /// Optional. Filtering results
5481 pub filter: std::string::String,
5482
5483 /// Optional. Hint for how to order the results
5484 pub order_by: std::string::String,
5485
5486 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5487}
5488
5489impl ListQuotaRulesRequest {
5490 pub fn new() -> Self {
5491 std::default::Default::default()
5492 }
5493
5494 /// Sets the value of [parent][crate::model::ListQuotaRulesRequest::parent].
5495 ///
5496 /// # Example
5497 /// ```ignore,no_run
5498 /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
5499 /// let x = ListQuotaRulesRequest::new().set_parent("example");
5500 /// ```
5501 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5502 self.parent = v.into();
5503 self
5504 }
5505
5506 /// Sets the value of [page_size][crate::model::ListQuotaRulesRequest::page_size].
5507 ///
5508 /// # Example
5509 /// ```ignore,no_run
5510 /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
5511 /// let x = ListQuotaRulesRequest::new().set_page_size(42);
5512 /// ```
5513 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5514 self.page_size = v.into();
5515 self
5516 }
5517
5518 /// Sets the value of [page_token][crate::model::ListQuotaRulesRequest::page_token].
5519 ///
5520 /// # Example
5521 /// ```ignore,no_run
5522 /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
5523 /// let x = ListQuotaRulesRequest::new().set_page_token("example");
5524 /// ```
5525 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5526 self.page_token = v.into();
5527 self
5528 }
5529
5530 /// Sets the value of [filter][crate::model::ListQuotaRulesRequest::filter].
5531 ///
5532 /// # Example
5533 /// ```ignore,no_run
5534 /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
5535 /// let x = ListQuotaRulesRequest::new().set_filter("example");
5536 /// ```
5537 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5538 self.filter = v.into();
5539 self
5540 }
5541
5542 /// Sets the value of [order_by][crate::model::ListQuotaRulesRequest::order_by].
5543 ///
5544 /// # Example
5545 /// ```ignore,no_run
5546 /// # use google_cloud_netapp_v1::model::ListQuotaRulesRequest;
5547 /// let x = ListQuotaRulesRequest::new().set_order_by("example");
5548 /// ```
5549 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5550 self.order_by = v.into();
5551 self
5552 }
5553}
5554
5555impl wkt::message::Message for ListQuotaRulesRequest {
5556 fn typename() -> &'static str {
5557 "type.googleapis.com/google.cloud.netapp.v1.ListQuotaRulesRequest"
5558 }
5559}
5560
5561/// ListQuotaRulesResponse is the response to a ListQuotaRulesRequest.
5562#[derive(Clone, Default, PartialEq)]
5563#[non_exhaustive]
5564pub struct ListQuotaRulesResponse {
5565 /// List of quota rules
5566 pub quota_rules: std::vec::Vec<crate::model::QuotaRule>,
5567
5568 /// A token identifying a page of results the server should return.
5569 pub next_page_token: std::string::String,
5570
5571 /// Locations that could not be reached.
5572 pub unreachable: std::vec::Vec<std::string::String>,
5573
5574 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5575}
5576
5577impl ListQuotaRulesResponse {
5578 pub fn new() -> Self {
5579 std::default::Default::default()
5580 }
5581
5582 /// Sets the value of [quota_rules][crate::model::ListQuotaRulesResponse::quota_rules].
5583 ///
5584 /// # Example
5585 /// ```ignore,no_run
5586 /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
5587 /// use google_cloud_netapp_v1::model::QuotaRule;
5588 /// let x = ListQuotaRulesResponse::new()
5589 /// .set_quota_rules([
5590 /// QuotaRule::default()/* use setters */,
5591 /// QuotaRule::default()/* use (different) setters */,
5592 /// ]);
5593 /// ```
5594 pub fn set_quota_rules<T, V>(mut self, v: T) -> Self
5595 where
5596 T: std::iter::IntoIterator<Item = V>,
5597 V: std::convert::Into<crate::model::QuotaRule>,
5598 {
5599 use std::iter::Iterator;
5600 self.quota_rules = v.into_iter().map(|i| i.into()).collect();
5601 self
5602 }
5603
5604 /// Sets the value of [next_page_token][crate::model::ListQuotaRulesResponse::next_page_token].
5605 ///
5606 /// # Example
5607 /// ```ignore,no_run
5608 /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
5609 /// let x = ListQuotaRulesResponse::new().set_next_page_token("example");
5610 /// ```
5611 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5612 self.next_page_token = v.into();
5613 self
5614 }
5615
5616 /// Sets the value of [unreachable][crate::model::ListQuotaRulesResponse::unreachable].
5617 ///
5618 /// # Example
5619 /// ```ignore,no_run
5620 /// # use google_cloud_netapp_v1::model::ListQuotaRulesResponse;
5621 /// let x = ListQuotaRulesResponse::new().set_unreachable(["a", "b", "c"]);
5622 /// ```
5623 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
5624 where
5625 T: std::iter::IntoIterator<Item = V>,
5626 V: std::convert::Into<std::string::String>,
5627 {
5628 use std::iter::Iterator;
5629 self.unreachable = v.into_iter().map(|i| i.into()).collect();
5630 self
5631 }
5632}
5633
5634impl wkt::message::Message for ListQuotaRulesResponse {
5635 fn typename() -> &'static str {
5636 "type.googleapis.com/google.cloud.netapp.v1.ListQuotaRulesResponse"
5637 }
5638}
5639
5640#[doc(hidden)]
5641impl gax::paginator::internal::PageableResponse for ListQuotaRulesResponse {
5642 type PageItem = crate::model::QuotaRule;
5643
5644 fn items(self) -> std::vec::Vec<Self::PageItem> {
5645 self.quota_rules
5646 }
5647
5648 fn next_page_token(&self) -> std::string::String {
5649 use std::clone::Clone;
5650 self.next_page_token.clone()
5651 }
5652}
5653
5654/// GetQuotaRuleRequest for getting a quota rule.
5655#[derive(Clone, Default, PartialEq)]
5656#[non_exhaustive]
5657pub struct GetQuotaRuleRequest {
5658 /// Required. Name of the quota rule
5659 pub name: std::string::String,
5660
5661 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5662}
5663
5664impl GetQuotaRuleRequest {
5665 pub fn new() -> Self {
5666 std::default::Default::default()
5667 }
5668
5669 /// Sets the value of [name][crate::model::GetQuotaRuleRequest::name].
5670 ///
5671 /// # Example
5672 /// ```ignore,no_run
5673 /// # use google_cloud_netapp_v1::model::GetQuotaRuleRequest;
5674 /// let x = GetQuotaRuleRequest::new().set_name("example");
5675 /// ```
5676 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5677 self.name = v.into();
5678 self
5679 }
5680}
5681
5682impl wkt::message::Message for GetQuotaRuleRequest {
5683 fn typename() -> &'static str {
5684 "type.googleapis.com/google.cloud.netapp.v1.GetQuotaRuleRequest"
5685 }
5686}
5687
5688/// CreateQuotaRuleRequest for creating a quota rule.
5689#[derive(Clone, Default, PartialEq)]
5690#[non_exhaustive]
5691pub struct CreateQuotaRuleRequest {
5692 /// Required. Parent value for CreateQuotaRuleRequest
5693 pub parent: std::string::String,
5694
5695 /// Required. Fields of the to be created quota rule.
5696 pub quota_rule: std::option::Option<crate::model::QuotaRule>,
5697
5698 /// Required. ID of the quota rule to create. Must be unique within the parent
5699 /// resource. Must contain only letters, numbers, underscore and hyphen, with
5700 /// the first character a letter or underscore, the last a letter or underscore
5701 /// or a number, and a 63 character maximum.
5702 pub quota_rule_id: std::string::String,
5703
5704 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5705}
5706
5707impl CreateQuotaRuleRequest {
5708 pub fn new() -> Self {
5709 std::default::Default::default()
5710 }
5711
5712 /// Sets the value of [parent][crate::model::CreateQuotaRuleRequest::parent].
5713 ///
5714 /// # Example
5715 /// ```ignore,no_run
5716 /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
5717 /// let x = CreateQuotaRuleRequest::new().set_parent("example");
5718 /// ```
5719 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5720 self.parent = v.into();
5721 self
5722 }
5723
5724 /// Sets the value of [quota_rule][crate::model::CreateQuotaRuleRequest::quota_rule].
5725 ///
5726 /// # Example
5727 /// ```ignore,no_run
5728 /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
5729 /// use google_cloud_netapp_v1::model::QuotaRule;
5730 /// let x = CreateQuotaRuleRequest::new().set_quota_rule(QuotaRule::default()/* use setters */);
5731 /// ```
5732 pub fn set_quota_rule<T>(mut self, v: T) -> Self
5733 where
5734 T: std::convert::Into<crate::model::QuotaRule>,
5735 {
5736 self.quota_rule = std::option::Option::Some(v.into());
5737 self
5738 }
5739
5740 /// Sets or clears the value of [quota_rule][crate::model::CreateQuotaRuleRequest::quota_rule].
5741 ///
5742 /// # Example
5743 /// ```ignore,no_run
5744 /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
5745 /// use google_cloud_netapp_v1::model::QuotaRule;
5746 /// let x = CreateQuotaRuleRequest::new().set_or_clear_quota_rule(Some(QuotaRule::default()/* use setters */));
5747 /// let x = CreateQuotaRuleRequest::new().set_or_clear_quota_rule(None::<QuotaRule>);
5748 /// ```
5749 pub fn set_or_clear_quota_rule<T>(mut self, v: std::option::Option<T>) -> Self
5750 where
5751 T: std::convert::Into<crate::model::QuotaRule>,
5752 {
5753 self.quota_rule = v.map(|x| x.into());
5754 self
5755 }
5756
5757 /// Sets the value of [quota_rule_id][crate::model::CreateQuotaRuleRequest::quota_rule_id].
5758 ///
5759 /// # Example
5760 /// ```ignore,no_run
5761 /// # use google_cloud_netapp_v1::model::CreateQuotaRuleRequest;
5762 /// let x = CreateQuotaRuleRequest::new().set_quota_rule_id("example");
5763 /// ```
5764 pub fn set_quota_rule_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5765 self.quota_rule_id = v.into();
5766 self
5767 }
5768}
5769
5770impl wkt::message::Message for CreateQuotaRuleRequest {
5771 fn typename() -> &'static str {
5772 "type.googleapis.com/google.cloud.netapp.v1.CreateQuotaRuleRequest"
5773 }
5774}
5775
5776/// UpdateQuotaRuleRequest for updating a quota rule.
5777#[derive(Clone, Default, PartialEq)]
5778#[non_exhaustive]
5779pub struct UpdateQuotaRuleRequest {
5780 /// Optional. Field mask is used to specify the fields to be overwritten in the
5781 /// Quota Rule resource by the update.
5782 /// The fields specified in the update_mask are relative to the resource, not
5783 /// the full request. A field will be overwritten if it is in the mask. If the
5784 /// user does not provide a mask then all fields will be overwritten.
5785 pub update_mask: std::option::Option<wkt::FieldMask>,
5786
5787 /// Required. The quota rule being updated
5788 pub quota_rule: std::option::Option<crate::model::QuotaRule>,
5789
5790 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5791}
5792
5793impl UpdateQuotaRuleRequest {
5794 pub fn new() -> Self {
5795 std::default::Default::default()
5796 }
5797
5798 /// Sets the value of [update_mask][crate::model::UpdateQuotaRuleRequest::update_mask].
5799 ///
5800 /// # Example
5801 /// ```ignore,no_run
5802 /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
5803 /// use wkt::FieldMask;
5804 /// let x = UpdateQuotaRuleRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5805 /// ```
5806 pub fn set_update_mask<T>(mut self, v: T) -> Self
5807 where
5808 T: std::convert::Into<wkt::FieldMask>,
5809 {
5810 self.update_mask = std::option::Option::Some(v.into());
5811 self
5812 }
5813
5814 /// Sets or clears the value of [update_mask][crate::model::UpdateQuotaRuleRequest::update_mask].
5815 ///
5816 /// # Example
5817 /// ```ignore,no_run
5818 /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
5819 /// use wkt::FieldMask;
5820 /// let x = UpdateQuotaRuleRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5821 /// let x = UpdateQuotaRuleRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5822 /// ```
5823 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5824 where
5825 T: std::convert::Into<wkt::FieldMask>,
5826 {
5827 self.update_mask = v.map(|x| x.into());
5828 self
5829 }
5830
5831 /// Sets the value of [quota_rule][crate::model::UpdateQuotaRuleRequest::quota_rule].
5832 ///
5833 /// # Example
5834 /// ```ignore,no_run
5835 /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
5836 /// use google_cloud_netapp_v1::model::QuotaRule;
5837 /// let x = UpdateQuotaRuleRequest::new().set_quota_rule(QuotaRule::default()/* use setters */);
5838 /// ```
5839 pub fn set_quota_rule<T>(mut self, v: T) -> Self
5840 where
5841 T: std::convert::Into<crate::model::QuotaRule>,
5842 {
5843 self.quota_rule = std::option::Option::Some(v.into());
5844 self
5845 }
5846
5847 /// Sets or clears the value of [quota_rule][crate::model::UpdateQuotaRuleRequest::quota_rule].
5848 ///
5849 /// # Example
5850 /// ```ignore,no_run
5851 /// # use google_cloud_netapp_v1::model::UpdateQuotaRuleRequest;
5852 /// use google_cloud_netapp_v1::model::QuotaRule;
5853 /// let x = UpdateQuotaRuleRequest::new().set_or_clear_quota_rule(Some(QuotaRule::default()/* use setters */));
5854 /// let x = UpdateQuotaRuleRequest::new().set_or_clear_quota_rule(None::<QuotaRule>);
5855 /// ```
5856 pub fn set_or_clear_quota_rule<T>(mut self, v: std::option::Option<T>) -> Self
5857 where
5858 T: std::convert::Into<crate::model::QuotaRule>,
5859 {
5860 self.quota_rule = v.map(|x| x.into());
5861 self
5862 }
5863}
5864
5865impl wkt::message::Message for UpdateQuotaRuleRequest {
5866 fn typename() -> &'static str {
5867 "type.googleapis.com/google.cloud.netapp.v1.UpdateQuotaRuleRequest"
5868 }
5869}
5870
5871/// DeleteQuotaRuleRequest for deleting a single quota rule.
5872#[derive(Clone, Default, PartialEq)]
5873#[non_exhaustive]
5874pub struct DeleteQuotaRuleRequest {
5875 /// Required. Name of the quota rule.
5876 pub name: std::string::String,
5877
5878 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5879}
5880
5881impl DeleteQuotaRuleRequest {
5882 pub fn new() -> Self {
5883 std::default::Default::default()
5884 }
5885
5886 /// Sets the value of [name][crate::model::DeleteQuotaRuleRequest::name].
5887 ///
5888 /// # Example
5889 /// ```ignore,no_run
5890 /// # use google_cloud_netapp_v1::model::DeleteQuotaRuleRequest;
5891 /// let x = DeleteQuotaRuleRequest::new().set_name("example");
5892 /// ```
5893 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5894 self.name = v.into();
5895 self
5896 }
5897}
5898
5899impl wkt::message::Message for DeleteQuotaRuleRequest {
5900 fn typename() -> &'static str {
5901 "type.googleapis.com/google.cloud.netapp.v1.DeleteQuotaRuleRequest"
5902 }
5903}
5904
5905/// QuotaRule specifies the maximum disk space a user or group can use within a
5906/// volume. They can be used for creating default and individual quota rules.
5907#[derive(Clone, Default, PartialEq)]
5908#[non_exhaustive]
5909pub struct QuotaRule {
5910 /// Identifier. The resource name of the quota rule.
5911 /// Format:
5912 /// `projects/{project_number}/locations/{location_id}/volumes/volumes/{volume_id}/quotaRules/{quota_rule_id}`.
5913 pub name: std::string::String,
5914
5915 /// Optional. The quota rule applies to the specified user or group, identified
5916 /// by a Unix UID/GID, Windows SID, or null for default.
5917 pub target: std::string::String,
5918
5919 /// Required. The type of quota rule.
5920 pub r#type: crate::model::quota_rule::Type,
5921
5922 /// Required. The maximum allowed disk space in MiB.
5923 pub disk_limit_mib: i32,
5924
5925 /// Output only. State of the quota rule
5926 pub state: crate::model::quota_rule::State,
5927
5928 /// Output only. State details of the quota rule
5929 pub state_details: std::string::String,
5930
5931 /// Output only. Create time of the quota rule
5932 pub create_time: std::option::Option<wkt::Timestamp>,
5933
5934 /// Optional. Description of the quota rule
5935 pub description: std::string::String,
5936
5937 /// Optional. Labels of the quota rule
5938 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
5939
5940 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5941}
5942
5943impl QuotaRule {
5944 pub fn new() -> Self {
5945 std::default::Default::default()
5946 }
5947
5948 /// Sets the value of [name][crate::model::QuotaRule::name].
5949 ///
5950 /// # Example
5951 /// ```ignore,no_run
5952 /// # use google_cloud_netapp_v1::model::QuotaRule;
5953 /// let x = QuotaRule::new().set_name("example");
5954 /// ```
5955 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5956 self.name = v.into();
5957 self
5958 }
5959
5960 /// Sets the value of [target][crate::model::QuotaRule::target].
5961 ///
5962 /// # Example
5963 /// ```ignore,no_run
5964 /// # use google_cloud_netapp_v1::model::QuotaRule;
5965 /// let x = QuotaRule::new().set_target("example");
5966 /// ```
5967 pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5968 self.target = v.into();
5969 self
5970 }
5971
5972 /// Sets the value of [r#type][crate::model::QuotaRule::type].
5973 ///
5974 /// # Example
5975 /// ```ignore,no_run
5976 /// # use google_cloud_netapp_v1::model::QuotaRule;
5977 /// use google_cloud_netapp_v1::model::quota_rule::Type;
5978 /// let x0 = QuotaRule::new().set_type(Type::IndividualUserQuota);
5979 /// let x1 = QuotaRule::new().set_type(Type::IndividualGroupQuota);
5980 /// let x2 = QuotaRule::new().set_type(Type::DefaultUserQuota);
5981 /// ```
5982 pub fn set_type<T: std::convert::Into<crate::model::quota_rule::Type>>(mut self, v: T) -> Self {
5983 self.r#type = v.into();
5984 self
5985 }
5986
5987 /// Sets the value of [disk_limit_mib][crate::model::QuotaRule::disk_limit_mib].
5988 ///
5989 /// # Example
5990 /// ```ignore,no_run
5991 /// # use google_cloud_netapp_v1::model::QuotaRule;
5992 /// let x = QuotaRule::new().set_disk_limit_mib(42);
5993 /// ```
5994 pub fn set_disk_limit_mib<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5995 self.disk_limit_mib = v.into();
5996 self
5997 }
5998
5999 /// Sets the value of [state][crate::model::QuotaRule::state].
6000 ///
6001 /// # Example
6002 /// ```ignore,no_run
6003 /// # use google_cloud_netapp_v1::model::QuotaRule;
6004 /// use google_cloud_netapp_v1::model::quota_rule::State;
6005 /// let x0 = QuotaRule::new().set_state(State::Creating);
6006 /// let x1 = QuotaRule::new().set_state(State::Updating);
6007 /// let x2 = QuotaRule::new().set_state(State::Deleting);
6008 /// ```
6009 pub fn set_state<T: std::convert::Into<crate::model::quota_rule::State>>(
6010 mut self,
6011 v: T,
6012 ) -> Self {
6013 self.state = v.into();
6014 self
6015 }
6016
6017 /// Sets the value of [state_details][crate::model::QuotaRule::state_details].
6018 ///
6019 /// # Example
6020 /// ```ignore,no_run
6021 /// # use google_cloud_netapp_v1::model::QuotaRule;
6022 /// let x = QuotaRule::new().set_state_details("example");
6023 /// ```
6024 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6025 self.state_details = v.into();
6026 self
6027 }
6028
6029 /// Sets the value of [create_time][crate::model::QuotaRule::create_time].
6030 ///
6031 /// # Example
6032 /// ```ignore,no_run
6033 /// # use google_cloud_netapp_v1::model::QuotaRule;
6034 /// use wkt::Timestamp;
6035 /// let x = QuotaRule::new().set_create_time(Timestamp::default()/* use setters */);
6036 /// ```
6037 pub fn set_create_time<T>(mut self, v: T) -> Self
6038 where
6039 T: std::convert::Into<wkt::Timestamp>,
6040 {
6041 self.create_time = std::option::Option::Some(v.into());
6042 self
6043 }
6044
6045 /// Sets or clears the value of [create_time][crate::model::QuotaRule::create_time].
6046 ///
6047 /// # Example
6048 /// ```ignore,no_run
6049 /// # use google_cloud_netapp_v1::model::QuotaRule;
6050 /// use wkt::Timestamp;
6051 /// let x = QuotaRule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6052 /// let x = QuotaRule::new().set_or_clear_create_time(None::<Timestamp>);
6053 /// ```
6054 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6055 where
6056 T: std::convert::Into<wkt::Timestamp>,
6057 {
6058 self.create_time = v.map(|x| x.into());
6059 self
6060 }
6061
6062 /// Sets the value of [description][crate::model::QuotaRule::description].
6063 ///
6064 /// # Example
6065 /// ```ignore,no_run
6066 /// # use google_cloud_netapp_v1::model::QuotaRule;
6067 /// let x = QuotaRule::new().set_description("example");
6068 /// ```
6069 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6070 self.description = v.into();
6071 self
6072 }
6073
6074 /// Sets the value of [labels][crate::model::QuotaRule::labels].
6075 ///
6076 /// # Example
6077 /// ```ignore,no_run
6078 /// # use google_cloud_netapp_v1::model::QuotaRule;
6079 /// let x = QuotaRule::new().set_labels([
6080 /// ("key0", "abc"),
6081 /// ("key1", "xyz"),
6082 /// ]);
6083 /// ```
6084 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6085 where
6086 T: std::iter::IntoIterator<Item = (K, V)>,
6087 K: std::convert::Into<std::string::String>,
6088 V: std::convert::Into<std::string::String>,
6089 {
6090 use std::iter::Iterator;
6091 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6092 self
6093 }
6094}
6095
6096impl wkt::message::Message for QuotaRule {
6097 fn typename() -> &'static str {
6098 "type.googleapis.com/google.cloud.netapp.v1.QuotaRule"
6099 }
6100}
6101
6102/// Defines additional types related to [QuotaRule].
6103pub mod quota_rule {
6104 #[allow(unused_imports)]
6105 use super::*;
6106
6107 /// Types of Quota Rule
6108 ///
6109 /// # Working with unknown values
6110 ///
6111 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6112 /// additional enum variants at any time. Adding new variants is not considered
6113 /// a breaking change. Applications should write their code in anticipation of:
6114 ///
6115 /// - New values appearing in future releases of the client library, **and**
6116 /// - New values received dynamically, without application changes.
6117 ///
6118 /// Please consult the [Working with enums] section in the user guide for some
6119 /// guidelines.
6120 ///
6121 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6122 #[derive(Clone, Debug, PartialEq)]
6123 #[non_exhaustive]
6124 pub enum Type {
6125 /// Unspecified type for quota rule
6126 Unspecified,
6127 /// Individual user quota rule
6128 IndividualUserQuota,
6129 /// Individual group quota rule
6130 IndividualGroupQuota,
6131 /// Default user quota rule
6132 DefaultUserQuota,
6133 /// Default group quota rule
6134 DefaultGroupQuota,
6135 /// If set, the enum was initialized with an unknown value.
6136 ///
6137 /// Applications can examine the value using [Type::value] or
6138 /// [Type::name].
6139 UnknownValue(r#type::UnknownValue),
6140 }
6141
6142 #[doc(hidden)]
6143 pub mod r#type {
6144 #[allow(unused_imports)]
6145 use super::*;
6146 #[derive(Clone, Debug, PartialEq)]
6147 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6148 }
6149
6150 impl Type {
6151 /// Gets the enum value.
6152 ///
6153 /// Returns `None` if the enum contains an unknown value deserialized from
6154 /// the string representation of enums.
6155 pub fn value(&self) -> std::option::Option<i32> {
6156 match self {
6157 Self::Unspecified => std::option::Option::Some(0),
6158 Self::IndividualUserQuota => std::option::Option::Some(1),
6159 Self::IndividualGroupQuota => std::option::Option::Some(2),
6160 Self::DefaultUserQuota => std::option::Option::Some(3),
6161 Self::DefaultGroupQuota => std::option::Option::Some(4),
6162 Self::UnknownValue(u) => u.0.value(),
6163 }
6164 }
6165
6166 /// Gets the enum value as a string.
6167 ///
6168 /// Returns `None` if the enum contains an unknown value deserialized from
6169 /// the integer representation of enums.
6170 pub fn name(&self) -> std::option::Option<&str> {
6171 match self {
6172 Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
6173 Self::IndividualUserQuota => std::option::Option::Some("INDIVIDUAL_USER_QUOTA"),
6174 Self::IndividualGroupQuota => std::option::Option::Some("INDIVIDUAL_GROUP_QUOTA"),
6175 Self::DefaultUserQuota => std::option::Option::Some("DEFAULT_USER_QUOTA"),
6176 Self::DefaultGroupQuota => std::option::Option::Some("DEFAULT_GROUP_QUOTA"),
6177 Self::UnknownValue(u) => u.0.name(),
6178 }
6179 }
6180 }
6181
6182 impl std::default::Default for Type {
6183 fn default() -> Self {
6184 use std::convert::From;
6185 Self::from(0)
6186 }
6187 }
6188
6189 impl std::fmt::Display for Type {
6190 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6191 wkt::internal::display_enum(f, self.name(), self.value())
6192 }
6193 }
6194
6195 impl std::convert::From<i32> for Type {
6196 fn from(value: i32) -> Self {
6197 match value {
6198 0 => Self::Unspecified,
6199 1 => Self::IndividualUserQuota,
6200 2 => Self::IndividualGroupQuota,
6201 3 => Self::DefaultUserQuota,
6202 4 => Self::DefaultGroupQuota,
6203 _ => Self::UnknownValue(r#type::UnknownValue(
6204 wkt::internal::UnknownEnumValue::Integer(value),
6205 )),
6206 }
6207 }
6208 }
6209
6210 impl std::convert::From<&str> for Type {
6211 fn from(value: &str) -> Self {
6212 use std::string::ToString;
6213 match value {
6214 "TYPE_UNSPECIFIED" => Self::Unspecified,
6215 "INDIVIDUAL_USER_QUOTA" => Self::IndividualUserQuota,
6216 "INDIVIDUAL_GROUP_QUOTA" => Self::IndividualGroupQuota,
6217 "DEFAULT_USER_QUOTA" => Self::DefaultUserQuota,
6218 "DEFAULT_GROUP_QUOTA" => Self::DefaultGroupQuota,
6219 _ => Self::UnknownValue(r#type::UnknownValue(
6220 wkt::internal::UnknownEnumValue::String(value.to_string()),
6221 )),
6222 }
6223 }
6224 }
6225
6226 impl serde::ser::Serialize for Type {
6227 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6228 where
6229 S: serde::Serializer,
6230 {
6231 match self {
6232 Self::Unspecified => serializer.serialize_i32(0),
6233 Self::IndividualUserQuota => serializer.serialize_i32(1),
6234 Self::IndividualGroupQuota => serializer.serialize_i32(2),
6235 Self::DefaultUserQuota => serializer.serialize_i32(3),
6236 Self::DefaultGroupQuota => serializer.serialize_i32(4),
6237 Self::UnknownValue(u) => u.0.serialize(serializer),
6238 }
6239 }
6240 }
6241
6242 impl<'de> serde::de::Deserialize<'de> for Type {
6243 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6244 where
6245 D: serde::Deserializer<'de>,
6246 {
6247 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
6248 ".google.cloud.netapp.v1.QuotaRule.Type",
6249 ))
6250 }
6251 }
6252
6253 /// Quota Rule states
6254 ///
6255 /// # Working with unknown values
6256 ///
6257 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6258 /// additional enum variants at any time. Adding new variants is not considered
6259 /// a breaking change. Applications should write their code in anticipation of:
6260 ///
6261 /// - New values appearing in future releases of the client library, **and**
6262 /// - New values received dynamically, without application changes.
6263 ///
6264 /// Please consult the [Working with enums] section in the user guide for some
6265 /// guidelines.
6266 ///
6267 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6268 #[derive(Clone, Debug, PartialEq)]
6269 #[non_exhaustive]
6270 pub enum State {
6271 /// Unspecified state for quota rule
6272 Unspecified,
6273 /// Quota rule is creating
6274 Creating,
6275 /// Quota rule is updating
6276 Updating,
6277 /// Quota rule is deleting
6278 Deleting,
6279 /// Quota rule is ready
6280 Ready,
6281 /// Quota rule is in error state.
6282 Error,
6283 /// If set, the enum was initialized with an unknown value.
6284 ///
6285 /// Applications can examine the value using [State::value] or
6286 /// [State::name].
6287 UnknownValue(state::UnknownValue),
6288 }
6289
6290 #[doc(hidden)]
6291 pub mod state {
6292 #[allow(unused_imports)]
6293 use super::*;
6294 #[derive(Clone, Debug, PartialEq)]
6295 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6296 }
6297
6298 impl State {
6299 /// Gets the enum value.
6300 ///
6301 /// Returns `None` if the enum contains an unknown value deserialized from
6302 /// the string representation of enums.
6303 pub fn value(&self) -> std::option::Option<i32> {
6304 match self {
6305 Self::Unspecified => std::option::Option::Some(0),
6306 Self::Creating => std::option::Option::Some(1),
6307 Self::Updating => std::option::Option::Some(2),
6308 Self::Deleting => std::option::Option::Some(3),
6309 Self::Ready => std::option::Option::Some(4),
6310 Self::Error => std::option::Option::Some(5),
6311 Self::UnknownValue(u) => u.0.value(),
6312 }
6313 }
6314
6315 /// Gets the enum value as a string.
6316 ///
6317 /// Returns `None` if the enum contains an unknown value deserialized from
6318 /// the integer representation of enums.
6319 pub fn name(&self) -> std::option::Option<&str> {
6320 match self {
6321 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
6322 Self::Creating => std::option::Option::Some("CREATING"),
6323 Self::Updating => std::option::Option::Some("UPDATING"),
6324 Self::Deleting => std::option::Option::Some("DELETING"),
6325 Self::Ready => std::option::Option::Some("READY"),
6326 Self::Error => std::option::Option::Some("ERROR"),
6327 Self::UnknownValue(u) => u.0.name(),
6328 }
6329 }
6330 }
6331
6332 impl std::default::Default for State {
6333 fn default() -> Self {
6334 use std::convert::From;
6335 Self::from(0)
6336 }
6337 }
6338
6339 impl std::fmt::Display for State {
6340 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6341 wkt::internal::display_enum(f, self.name(), self.value())
6342 }
6343 }
6344
6345 impl std::convert::From<i32> for State {
6346 fn from(value: i32) -> Self {
6347 match value {
6348 0 => Self::Unspecified,
6349 1 => Self::Creating,
6350 2 => Self::Updating,
6351 3 => Self::Deleting,
6352 4 => Self::Ready,
6353 5 => Self::Error,
6354 _ => Self::UnknownValue(state::UnknownValue(
6355 wkt::internal::UnknownEnumValue::Integer(value),
6356 )),
6357 }
6358 }
6359 }
6360
6361 impl std::convert::From<&str> for State {
6362 fn from(value: &str) -> Self {
6363 use std::string::ToString;
6364 match value {
6365 "STATE_UNSPECIFIED" => Self::Unspecified,
6366 "CREATING" => Self::Creating,
6367 "UPDATING" => Self::Updating,
6368 "DELETING" => Self::Deleting,
6369 "READY" => Self::Ready,
6370 "ERROR" => Self::Error,
6371 _ => Self::UnknownValue(state::UnknownValue(
6372 wkt::internal::UnknownEnumValue::String(value.to_string()),
6373 )),
6374 }
6375 }
6376 }
6377
6378 impl serde::ser::Serialize for State {
6379 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6380 where
6381 S: serde::Serializer,
6382 {
6383 match self {
6384 Self::Unspecified => serializer.serialize_i32(0),
6385 Self::Creating => serializer.serialize_i32(1),
6386 Self::Updating => serializer.serialize_i32(2),
6387 Self::Deleting => serializer.serialize_i32(3),
6388 Self::Ready => serializer.serialize_i32(4),
6389 Self::Error => serializer.serialize_i32(5),
6390 Self::UnknownValue(u) => u.0.serialize(serializer),
6391 }
6392 }
6393 }
6394
6395 impl<'de> serde::de::Deserialize<'de> for State {
6396 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6397 where
6398 D: serde::Deserializer<'de>,
6399 {
6400 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
6401 ".google.cloud.netapp.v1.QuotaRule.State",
6402 ))
6403 }
6404 }
6405}
6406
6407/// TransferStats reports all statistics related to replication transfer.
6408#[derive(Clone, Default, PartialEq)]
6409#[non_exhaustive]
6410pub struct TransferStats {
6411 /// Cumulative bytes transferred so far for the replication relationship.
6412 pub transfer_bytes: std::option::Option<i64>,
6413
6414 /// Cumulative time taken across all transfers for the replication
6415 /// relationship.
6416 pub total_transfer_duration: std::option::Option<wkt::Duration>,
6417
6418 /// Last transfer size in bytes.
6419 pub last_transfer_bytes: std::option::Option<i64>,
6420
6421 /// Time taken during last transfer.
6422 pub last_transfer_duration: std::option::Option<wkt::Duration>,
6423
6424 /// Lag duration indicates the duration by which Destination region volume
6425 /// content lags behind the primary region volume content.
6426 pub lag_duration: std::option::Option<wkt::Duration>,
6427
6428 /// Time when progress was updated last.
6429 pub update_time: std::option::Option<wkt::Timestamp>,
6430
6431 /// Time when last transfer completed.
6432 pub last_transfer_end_time: std::option::Option<wkt::Timestamp>,
6433
6434 /// A message describing the cause of the last transfer failure.
6435 pub last_transfer_error: std::option::Option<std::string::String>,
6436
6437 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6438}
6439
6440impl TransferStats {
6441 pub fn new() -> Self {
6442 std::default::Default::default()
6443 }
6444
6445 /// Sets the value of [transfer_bytes][crate::model::TransferStats::transfer_bytes].
6446 ///
6447 /// # Example
6448 /// ```ignore,no_run
6449 /// # use google_cloud_netapp_v1::model::TransferStats;
6450 /// let x = TransferStats::new().set_transfer_bytes(42);
6451 /// ```
6452 pub fn set_transfer_bytes<T>(mut self, v: T) -> Self
6453 where
6454 T: std::convert::Into<i64>,
6455 {
6456 self.transfer_bytes = std::option::Option::Some(v.into());
6457 self
6458 }
6459
6460 /// Sets or clears the value of [transfer_bytes][crate::model::TransferStats::transfer_bytes].
6461 ///
6462 /// # Example
6463 /// ```ignore,no_run
6464 /// # use google_cloud_netapp_v1::model::TransferStats;
6465 /// let x = TransferStats::new().set_or_clear_transfer_bytes(Some(42));
6466 /// let x = TransferStats::new().set_or_clear_transfer_bytes(None::<i32>);
6467 /// ```
6468 pub fn set_or_clear_transfer_bytes<T>(mut self, v: std::option::Option<T>) -> Self
6469 where
6470 T: std::convert::Into<i64>,
6471 {
6472 self.transfer_bytes = v.map(|x| x.into());
6473 self
6474 }
6475
6476 /// Sets the value of [total_transfer_duration][crate::model::TransferStats::total_transfer_duration].
6477 ///
6478 /// # Example
6479 /// ```ignore,no_run
6480 /// # use google_cloud_netapp_v1::model::TransferStats;
6481 /// use wkt::Duration;
6482 /// let x = TransferStats::new().set_total_transfer_duration(Duration::default()/* use setters */);
6483 /// ```
6484 pub fn set_total_transfer_duration<T>(mut self, v: T) -> Self
6485 where
6486 T: std::convert::Into<wkt::Duration>,
6487 {
6488 self.total_transfer_duration = std::option::Option::Some(v.into());
6489 self
6490 }
6491
6492 /// Sets or clears the value of [total_transfer_duration][crate::model::TransferStats::total_transfer_duration].
6493 ///
6494 /// # Example
6495 /// ```ignore,no_run
6496 /// # use google_cloud_netapp_v1::model::TransferStats;
6497 /// use wkt::Duration;
6498 /// let x = TransferStats::new().set_or_clear_total_transfer_duration(Some(Duration::default()/* use setters */));
6499 /// let x = TransferStats::new().set_or_clear_total_transfer_duration(None::<Duration>);
6500 /// ```
6501 pub fn set_or_clear_total_transfer_duration<T>(mut self, v: std::option::Option<T>) -> Self
6502 where
6503 T: std::convert::Into<wkt::Duration>,
6504 {
6505 self.total_transfer_duration = v.map(|x| x.into());
6506 self
6507 }
6508
6509 /// Sets the value of [last_transfer_bytes][crate::model::TransferStats::last_transfer_bytes].
6510 ///
6511 /// # Example
6512 /// ```ignore,no_run
6513 /// # use google_cloud_netapp_v1::model::TransferStats;
6514 /// let x = TransferStats::new().set_last_transfer_bytes(42);
6515 /// ```
6516 pub fn set_last_transfer_bytes<T>(mut self, v: T) -> Self
6517 where
6518 T: std::convert::Into<i64>,
6519 {
6520 self.last_transfer_bytes = std::option::Option::Some(v.into());
6521 self
6522 }
6523
6524 /// Sets or clears the value of [last_transfer_bytes][crate::model::TransferStats::last_transfer_bytes].
6525 ///
6526 /// # Example
6527 /// ```ignore,no_run
6528 /// # use google_cloud_netapp_v1::model::TransferStats;
6529 /// let x = TransferStats::new().set_or_clear_last_transfer_bytes(Some(42));
6530 /// let x = TransferStats::new().set_or_clear_last_transfer_bytes(None::<i32>);
6531 /// ```
6532 pub fn set_or_clear_last_transfer_bytes<T>(mut self, v: std::option::Option<T>) -> Self
6533 where
6534 T: std::convert::Into<i64>,
6535 {
6536 self.last_transfer_bytes = v.map(|x| x.into());
6537 self
6538 }
6539
6540 /// Sets the value of [last_transfer_duration][crate::model::TransferStats::last_transfer_duration].
6541 ///
6542 /// # Example
6543 /// ```ignore,no_run
6544 /// # use google_cloud_netapp_v1::model::TransferStats;
6545 /// use wkt::Duration;
6546 /// let x = TransferStats::new().set_last_transfer_duration(Duration::default()/* use setters */);
6547 /// ```
6548 pub fn set_last_transfer_duration<T>(mut self, v: T) -> Self
6549 where
6550 T: std::convert::Into<wkt::Duration>,
6551 {
6552 self.last_transfer_duration = std::option::Option::Some(v.into());
6553 self
6554 }
6555
6556 /// Sets or clears the value of [last_transfer_duration][crate::model::TransferStats::last_transfer_duration].
6557 ///
6558 /// # Example
6559 /// ```ignore,no_run
6560 /// # use google_cloud_netapp_v1::model::TransferStats;
6561 /// use wkt::Duration;
6562 /// let x = TransferStats::new().set_or_clear_last_transfer_duration(Some(Duration::default()/* use setters */));
6563 /// let x = TransferStats::new().set_or_clear_last_transfer_duration(None::<Duration>);
6564 /// ```
6565 pub fn set_or_clear_last_transfer_duration<T>(mut self, v: std::option::Option<T>) -> Self
6566 where
6567 T: std::convert::Into<wkt::Duration>,
6568 {
6569 self.last_transfer_duration = v.map(|x| x.into());
6570 self
6571 }
6572
6573 /// Sets the value of [lag_duration][crate::model::TransferStats::lag_duration].
6574 ///
6575 /// # Example
6576 /// ```ignore,no_run
6577 /// # use google_cloud_netapp_v1::model::TransferStats;
6578 /// use wkt::Duration;
6579 /// let x = TransferStats::new().set_lag_duration(Duration::default()/* use setters */);
6580 /// ```
6581 pub fn set_lag_duration<T>(mut self, v: T) -> Self
6582 where
6583 T: std::convert::Into<wkt::Duration>,
6584 {
6585 self.lag_duration = std::option::Option::Some(v.into());
6586 self
6587 }
6588
6589 /// Sets or clears the value of [lag_duration][crate::model::TransferStats::lag_duration].
6590 ///
6591 /// # Example
6592 /// ```ignore,no_run
6593 /// # use google_cloud_netapp_v1::model::TransferStats;
6594 /// use wkt::Duration;
6595 /// let x = TransferStats::new().set_or_clear_lag_duration(Some(Duration::default()/* use setters */));
6596 /// let x = TransferStats::new().set_or_clear_lag_duration(None::<Duration>);
6597 /// ```
6598 pub fn set_or_clear_lag_duration<T>(mut self, v: std::option::Option<T>) -> Self
6599 where
6600 T: std::convert::Into<wkt::Duration>,
6601 {
6602 self.lag_duration = v.map(|x| x.into());
6603 self
6604 }
6605
6606 /// Sets the value of [update_time][crate::model::TransferStats::update_time].
6607 ///
6608 /// # Example
6609 /// ```ignore,no_run
6610 /// # use google_cloud_netapp_v1::model::TransferStats;
6611 /// use wkt::Timestamp;
6612 /// let x = TransferStats::new().set_update_time(Timestamp::default()/* use setters */);
6613 /// ```
6614 pub fn set_update_time<T>(mut self, v: T) -> Self
6615 where
6616 T: std::convert::Into<wkt::Timestamp>,
6617 {
6618 self.update_time = std::option::Option::Some(v.into());
6619 self
6620 }
6621
6622 /// Sets or clears the value of [update_time][crate::model::TransferStats::update_time].
6623 ///
6624 /// # Example
6625 /// ```ignore,no_run
6626 /// # use google_cloud_netapp_v1::model::TransferStats;
6627 /// use wkt::Timestamp;
6628 /// let x = TransferStats::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
6629 /// let x = TransferStats::new().set_or_clear_update_time(None::<Timestamp>);
6630 /// ```
6631 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
6632 where
6633 T: std::convert::Into<wkt::Timestamp>,
6634 {
6635 self.update_time = v.map(|x| x.into());
6636 self
6637 }
6638
6639 /// Sets the value of [last_transfer_end_time][crate::model::TransferStats::last_transfer_end_time].
6640 ///
6641 /// # Example
6642 /// ```ignore,no_run
6643 /// # use google_cloud_netapp_v1::model::TransferStats;
6644 /// use wkt::Timestamp;
6645 /// let x = TransferStats::new().set_last_transfer_end_time(Timestamp::default()/* use setters */);
6646 /// ```
6647 pub fn set_last_transfer_end_time<T>(mut self, v: T) -> Self
6648 where
6649 T: std::convert::Into<wkt::Timestamp>,
6650 {
6651 self.last_transfer_end_time = std::option::Option::Some(v.into());
6652 self
6653 }
6654
6655 /// Sets or clears the value of [last_transfer_end_time][crate::model::TransferStats::last_transfer_end_time].
6656 ///
6657 /// # Example
6658 /// ```ignore,no_run
6659 /// # use google_cloud_netapp_v1::model::TransferStats;
6660 /// use wkt::Timestamp;
6661 /// let x = TransferStats::new().set_or_clear_last_transfer_end_time(Some(Timestamp::default()/* use setters */));
6662 /// let x = TransferStats::new().set_or_clear_last_transfer_end_time(None::<Timestamp>);
6663 /// ```
6664 pub fn set_or_clear_last_transfer_end_time<T>(mut self, v: std::option::Option<T>) -> Self
6665 where
6666 T: std::convert::Into<wkt::Timestamp>,
6667 {
6668 self.last_transfer_end_time = v.map(|x| x.into());
6669 self
6670 }
6671
6672 /// Sets the value of [last_transfer_error][crate::model::TransferStats::last_transfer_error].
6673 ///
6674 /// # Example
6675 /// ```ignore,no_run
6676 /// # use google_cloud_netapp_v1::model::TransferStats;
6677 /// let x = TransferStats::new().set_last_transfer_error("example");
6678 /// ```
6679 pub fn set_last_transfer_error<T>(mut self, v: T) -> Self
6680 where
6681 T: std::convert::Into<std::string::String>,
6682 {
6683 self.last_transfer_error = std::option::Option::Some(v.into());
6684 self
6685 }
6686
6687 /// Sets or clears the value of [last_transfer_error][crate::model::TransferStats::last_transfer_error].
6688 ///
6689 /// # Example
6690 /// ```ignore,no_run
6691 /// # use google_cloud_netapp_v1::model::TransferStats;
6692 /// let x = TransferStats::new().set_or_clear_last_transfer_error(Some("example"));
6693 /// let x = TransferStats::new().set_or_clear_last_transfer_error(None::<String>);
6694 /// ```
6695 pub fn set_or_clear_last_transfer_error<T>(mut self, v: std::option::Option<T>) -> Self
6696 where
6697 T: std::convert::Into<std::string::String>,
6698 {
6699 self.last_transfer_error = v.map(|x| x.into());
6700 self
6701 }
6702}
6703
6704impl wkt::message::Message for TransferStats {
6705 fn typename() -> &'static str {
6706 "type.googleapis.com/google.cloud.netapp.v1.TransferStats"
6707 }
6708}
6709
6710/// Replication is a nested resource under Volume, that describes a
6711/// cross-region replication relationship between 2 volumes in different
6712/// regions.
6713#[derive(Clone, Default, PartialEq)]
6714#[non_exhaustive]
6715pub struct Replication {
6716 /// Identifier. The resource name of the Replication.
6717 /// Format:
6718 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}`.
6719 pub name: std::string::String,
6720
6721 /// Output only. State of the replication.
6722 pub state: crate::model::replication::State,
6723
6724 /// Output only. State details of the replication.
6725 pub state_details: std::string::String,
6726
6727 /// Output only. Indicates whether this points to source or destination.
6728 pub role: crate::model::replication::ReplicationRole,
6729
6730 /// Required. Indicates the schedule for replication.
6731 pub replication_schedule: crate::model::replication::ReplicationSchedule,
6732
6733 /// Output only. Indicates the state of mirroring.
6734 pub mirror_state: crate::model::replication::MirrorState,
6735
6736 /// Output only. Condition of the relationship. Can be one of the following:
6737 ///
6738 /// - true: The replication relationship is healthy. It has not missed the most
6739 /// recent scheduled transfer.
6740 /// - false: The replication relationship is not healthy. It has missed the
6741 /// most recent scheduled transfer.
6742 pub healthy: std::option::Option<bool>,
6743
6744 /// Output only. Replication create time.
6745 pub create_time: std::option::Option<wkt::Timestamp>,
6746
6747 /// Output only. Full name of destination volume resource.
6748 /// Example : "projects/{project}/locations/{location}/volumes/{volume_id}"
6749 pub destination_volume: std::string::String,
6750
6751 /// Output only. Replication transfer statistics.
6752 pub transfer_stats: std::option::Option<crate::model::TransferStats>,
6753
6754 /// Resource labels to represent user provided metadata.
6755 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
6756
6757 /// A description about this replication relationship.
6758 pub description: std::option::Option<std::string::String>,
6759
6760 /// Required. Input only. Destination volume parameters
6761 pub destination_volume_parameters:
6762 std::option::Option<crate::model::DestinationVolumeParameters>,
6763
6764 /// Output only. Full name of source volume resource.
6765 /// Example : "projects/{project}/locations/{location}/volumes/{volume_id}"
6766 pub source_volume: std::string::String,
6767
6768 /// Output only. Hybrid peering details.
6769 pub hybrid_peering_details: std::option::Option<crate::model::HybridPeeringDetails>,
6770
6771 /// Optional. Location of the user cluster.
6772 pub cluster_location: std::string::String,
6773
6774 /// Output only. Type of the hybrid replication.
6775 pub hybrid_replication_type: crate::model::replication::HybridReplicationType,
6776
6777 /// Output only. Copy pastable snapmirror commands to be executed on onprem
6778 /// cluster by the customer.
6779 pub hybrid_replication_user_commands: std::option::Option<crate::model::UserCommands>,
6780
6781 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6782}
6783
6784impl Replication {
6785 pub fn new() -> Self {
6786 std::default::Default::default()
6787 }
6788
6789 /// Sets the value of [name][crate::model::Replication::name].
6790 ///
6791 /// # Example
6792 /// ```ignore,no_run
6793 /// # use google_cloud_netapp_v1::model::Replication;
6794 /// let x = Replication::new().set_name("example");
6795 /// ```
6796 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6797 self.name = v.into();
6798 self
6799 }
6800
6801 /// Sets the value of [state][crate::model::Replication::state].
6802 ///
6803 /// # Example
6804 /// ```ignore,no_run
6805 /// # use google_cloud_netapp_v1::model::Replication;
6806 /// use google_cloud_netapp_v1::model::replication::State;
6807 /// let x0 = Replication::new().set_state(State::Creating);
6808 /// let x1 = Replication::new().set_state(State::Ready);
6809 /// let x2 = Replication::new().set_state(State::Updating);
6810 /// ```
6811 pub fn set_state<T: std::convert::Into<crate::model::replication::State>>(
6812 mut self,
6813 v: T,
6814 ) -> Self {
6815 self.state = v.into();
6816 self
6817 }
6818
6819 /// Sets the value of [state_details][crate::model::Replication::state_details].
6820 ///
6821 /// # Example
6822 /// ```ignore,no_run
6823 /// # use google_cloud_netapp_v1::model::Replication;
6824 /// let x = Replication::new().set_state_details("example");
6825 /// ```
6826 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6827 self.state_details = v.into();
6828 self
6829 }
6830
6831 /// Sets the value of [role][crate::model::Replication::role].
6832 ///
6833 /// # Example
6834 /// ```ignore,no_run
6835 /// # use google_cloud_netapp_v1::model::Replication;
6836 /// use google_cloud_netapp_v1::model::replication::ReplicationRole;
6837 /// let x0 = Replication::new().set_role(ReplicationRole::Source);
6838 /// let x1 = Replication::new().set_role(ReplicationRole::Destination);
6839 /// ```
6840 pub fn set_role<T: std::convert::Into<crate::model::replication::ReplicationRole>>(
6841 mut self,
6842 v: T,
6843 ) -> Self {
6844 self.role = v.into();
6845 self
6846 }
6847
6848 /// Sets the value of [replication_schedule][crate::model::Replication::replication_schedule].
6849 ///
6850 /// # Example
6851 /// ```ignore,no_run
6852 /// # use google_cloud_netapp_v1::model::Replication;
6853 /// use google_cloud_netapp_v1::model::replication::ReplicationSchedule;
6854 /// let x0 = Replication::new().set_replication_schedule(ReplicationSchedule::Every10Minutes);
6855 /// let x1 = Replication::new().set_replication_schedule(ReplicationSchedule::Hourly);
6856 /// let x2 = Replication::new().set_replication_schedule(ReplicationSchedule::Daily);
6857 /// ```
6858 pub fn set_replication_schedule<
6859 T: std::convert::Into<crate::model::replication::ReplicationSchedule>,
6860 >(
6861 mut self,
6862 v: T,
6863 ) -> Self {
6864 self.replication_schedule = v.into();
6865 self
6866 }
6867
6868 /// Sets the value of [mirror_state][crate::model::Replication::mirror_state].
6869 ///
6870 /// # Example
6871 /// ```ignore,no_run
6872 /// # use google_cloud_netapp_v1::model::Replication;
6873 /// use google_cloud_netapp_v1::model::replication::MirrorState;
6874 /// let x0 = Replication::new().set_mirror_state(MirrorState::Preparing);
6875 /// let x1 = Replication::new().set_mirror_state(MirrorState::Mirrored);
6876 /// let x2 = Replication::new().set_mirror_state(MirrorState::Stopped);
6877 /// ```
6878 pub fn set_mirror_state<T: std::convert::Into<crate::model::replication::MirrorState>>(
6879 mut self,
6880 v: T,
6881 ) -> Self {
6882 self.mirror_state = v.into();
6883 self
6884 }
6885
6886 /// Sets the value of [healthy][crate::model::Replication::healthy].
6887 ///
6888 /// # Example
6889 /// ```ignore,no_run
6890 /// # use google_cloud_netapp_v1::model::Replication;
6891 /// let x = Replication::new().set_healthy(true);
6892 /// ```
6893 pub fn set_healthy<T>(mut self, v: T) -> Self
6894 where
6895 T: std::convert::Into<bool>,
6896 {
6897 self.healthy = std::option::Option::Some(v.into());
6898 self
6899 }
6900
6901 /// Sets or clears the value of [healthy][crate::model::Replication::healthy].
6902 ///
6903 /// # Example
6904 /// ```ignore,no_run
6905 /// # use google_cloud_netapp_v1::model::Replication;
6906 /// let x = Replication::new().set_or_clear_healthy(Some(false));
6907 /// let x = Replication::new().set_or_clear_healthy(None::<bool>);
6908 /// ```
6909 pub fn set_or_clear_healthy<T>(mut self, v: std::option::Option<T>) -> Self
6910 where
6911 T: std::convert::Into<bool>,
6912 {
6913 self.healthy = v.map(|x| x.into());
6914 self
6915 }
6916
6917 /// Sets the value of [create_time][crate::model::Replication::create_time].
6918 ///
6919 /// # Example
6920 /// ```ignore,no_run
6921 /// # use google_cloud_netapp_v1::model::Replication;
6922 /// use wkt::Timestamp;
6923 /// let x = Replication::new().set_create_time(Timestamp::default()/* use setters */);
6924 /// ```
6925 pub fn set_create_time<T>(mut self, v: T) -> Self
6926 where
6927 T: std::convert::Into<wkt::Timestamp>,
6928 {
6929 self.create_time = std::option::Option::Some(v.into());
6930 self
6931 }
6932
6933 /// Sets or clears the value of [create_time][crate::model::Replication::create_time].
6934 ///
6935 /// # Example
6936 /// ```ignore,no_run
6937 /// # use google_cloud_netapp_v1::model::Replication;
6938 /// use wkt::Timestamp;
6939 /// let x = Replication::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
6940 /// let x = Replication::new().set_or_clear_create_time(None::<Timestamp>);
6941 /// ```
6942 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
6943 where
6944 T: std::convert::Into<wkt::Timestamp>,
6945 {
6946 self.create_time = v.map(|x| x.into());
6947 self
6948 }
6949
6950 /// Sets the value of [destination_volume][crate::model::Replication::destination_volume].
6951 ///
6952 /// # Example
6953 /// ```ignore,no_run
6954 /// # use google_cloud_netapp_v1::model::Replication;
6955 /// let x = Replication::new().set_destination_volume("example");
6956 /// ```
6957 pub fn set_destination_volume<T: std::convert::Into<std::string::String>>(
6958 mut self,
6959 v: T,
6960 ) -> Self {
6961 self.destination_volume = v.into();
6962 self
6963 }
6964
6965 /// Sets the value of [transfer_stats][crate::model::Replication::transfer_stats].
6966 ///
6967 /// # Example
6968 /// ```ignore,no_run
6969 /// # use google_cloud_netapp_v1::model::Replication;
6970 /// use google_cloud_netapp_v1::model::TransferStats;
6971 /// let x = Replication::new().set_transfer_stats(TransferStats::default()/* use setters */);
6972 /// ```
6973 pub fn set_transfer_stats<T>(mut self, v: T) -> Self
6974 where
6975 T: std::convert::Into<crate::model::TransferStats>,
6976 {
6977 self.transfer_stats = std::option::Option::Some(v.into());
6978 self
6979 }
6980
6981 /// Sets or clears the value of [transfer_stats][crate::model::Replication::transfer_stats].
6982 ///
6983 /// # Example
6984 /// ```ignore,no_run
6985 /// # use google_cloud_netapp_v1::model::Replication;
6986 /// use google_cloud_netapp_v1::model::TransferStats;
6987 /// let x = Replication::new().set_or_clear_transfer_stats(Some(TransferStats::default()/* use setters */));
6988 /// let x = Replication::new().set_or_clear_transfer_stats(None::<TransferStats>);
6989 /// ```
6990 pub fn set_or_clear_transfer_stats<T>(mut self, v: std::option::Option<T>) -> Self
6991 where
6992 T: std::convert::Into<crate::model::TransferStats>,
6993 {
6994 self.transfer_stats = v.map(|x| x.into());
6995 self
6996 }
6997
6998 /// Sets the value of [labels][crate::model::Replication::labels].
6999 ///
7000 /// # Example
7001 /// ```ignore,no_run
7002 /// # use google_cloud_netapp_v1::model::Replication;
7003 /// let x = Replication::new().set_labels([
7004 /// ("key0", "abc"),
7005 /// ("key1", "xyz"),
7006 /// ]);
7007 /// ```
7008 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7009 where
7010 T: std::iter::IntoIterator<Item = (K, V)>,
7011 K: std::convert::Into<std::string::String>,
7012 V: std::convert::Into<std::string::String>,
7013 {
7014 use std::iter::Iterator;
7015 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7016 self
7017 }
7018
7019 /// Sets the value of [description][crate::model::Replication::description].
7020 ///
7021 /// # Example
7022 /// ```ignore,no_run
7023 /// # use google_cloud_netapp_v1::model::Replication;
7024 /// let x = Replication::new().set_description("example");
7025 /// ```
7026 pub fn set_description<T>(mut self, v: T) -> Self
7027 where
7028 T: std::convert::Into<std::string::String>,
7029 {
7030 self.description = std::option::Option::Some(v.into());
7031 self
7032 }
7033
7034 /// Sets or clears the value of [description][crate::model::Replication::description].
7035 ///
7036 /// # Example
7037 /// ```ignore,no_run
7038 /// # use google_cloud_netapp_v1::model::Replication;
7039 /// let x = Replication::new().set_or_clear_description(Some("example"));
7040 /// let x = Replication::new().set_or_clear_description(None::<String>);
7041 /// ```
7042 pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
7043 where
7044 T: std::convert::Into<std::string::String>,
7045 {
7046 self.description = v.map(|x| x.into());
7047 self
7048 }
7049
7050 /// Sets the value of [destination_volume_parameters][crate::model::Replication::destination_volume_parameters].
7051 ///
7052 /// # Example
7053 /// ```ignore,no_run
7054 /// # use google_cloud_netapp_v1::model::Replication;
7055 /// use google_cloud_netapp_v1::model::DestinationVolumeParameters;
7056 /// let x = Replication::new().set_destination_volume_parameters(DestinationVolumeParameters::default()/* use setters */);
7057 /// ```
7058 pub fn set_destination_volume_parameters<T>(mut self, v: T) -> Self
7059 where
7060 T: std::convert::Into<crate::model::DestinationVolumeParameters>,
7061 {
7062 self.destination_volume_parameters = std::option::Option::Some(v.into());
7063 self
7064 }
7065
7066 /// Sets or clears the value of [destination_volume_parameters][crate::model::Replication::destination_volume_parameters].
7067 ///
7068 /// # Example
7069 /// ```ignore,no_run
7070 /// # use google_cloud_netapp_v1::model::Replication;
7071 /// use google_cloud_netapp_v1::model::DestinationVolumeParameters;
7072 /// let x = Replication::new().set_or_clear_destination_volume_parameters(Some(DestinationVolumeParameters::default()/* use setters */));
7073 /// let x = Replication::new().set_or_clear_destination_volume_parameters(None::<DestinationVolumeParameters>);
7074 /// ```
7075 pub fn set_or_clear_destination_volume_parameters<T>(
7076 mut self,
7077 v: std::option::Option<T>,
7078 ) -> Self
7079 where
7080 T: std::convert::Into<crate::model::DestinationVolumeParameters>,
7081 {
7082 self.destination_volume_parameters = v.map(|x| x.into());
7083 self
7084 }
7085
7086 /// Sets the value of [source_volume][crate::model::Replication::source_volume].
7087 ///
7088 /// # Example
7089 /// ```ignore,no_run
7090 /// # use google_cloud_netapp_v1::model::Replication;
7091 /// let x = Replication::new().set_source_volume("example");
7092 /// ```
7093 pub fn set_source_volume<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7094 self.source_volume = v.into();
7095 self
7096 }
7097
7098 /// Sets the value of [hybrid_peering_details][crate::model::Replication::hybrid_peering_details].
7099 ///
7100 /// # Example
7101 /// ```ignore,no_run
7102 /// # use google_cloud_netapp_v1::model::Replication;
7103 /// use google_cloud_netapp_v1::model::HybridPeeringDetails;
7104 /// let x = Replication::new().set_hybrid_peering_details(HybridPeeringDetails::default()/* use setters */);
7105 /// ```
7106 pub fn set_hybrid_peering_details<T>(mut self, v: T) -> Self
7107 where
7108 T: std::convert::Into<crate::model::HybridPeeringDetails>,
7109 {
7110 self.hybrid_peering_details = std::option::Option::Some(v.into());
7111 self
7112 }
7113
7114 /// Sets or clears the value of [hybrid_peering_details][crate::model::Replication::hybrid_peering_details].
7115 ///
7116 /// # Example
7117 /// ```ignore,no_run
7118 /// # use google_cloud_netapp_v1::model::Replication;
7119 /// use google_cloud_netapp_v1::model::HybridPeeringDetails;
7120 /// let x = Replication::new().set_or_clear_hybrid_peering_details(Some(HybridPeeringDetails::default()/* use setters */));
7121 /// let x = Replication::new().set_or_clear_hybrid_peering_details(None::<HybridPeeringDetails>);
7122 /// ```
7123 pub fn set_or_clear_hybrid_peering_details<T>(mut self, v: std::option::Option<T>) -> Self
7124 where
7125 T: std::convert::Into<crate::model::HybridPeeringDetails>,
7126 {
7127 self.hybrid_peering_details = v.map(|x| x.into());
7128 self
7129 }
7130
7131 /// Sets the value of [cluster_location][crate::model::Replication::cluster_location].
7132 ///
7133 /// # Example
7134 /// ```ignore,no_run
7135 /// # use google_cloud_netapp_v1::model::Replication;
7136 /// let x = Replication::new().set_cluster_location("example");
7137 /// ```
7138 pub fn set_cluster_location<T: std::convert::Into<std::string::String>>(
7139 mut self,
7140 v: T,
7141 ) -> Self {
7142 self.cluster_location = v.into();
7143 self
7144 }
7145
7146 /// Sets the value of [hybrid_replication_type][crate::model::Replication::hybrid_replication_type].
7147 ///
7148 /// # Example
7149 /// ```ignore,no_run
7150 /// # use google_cloud_netapp_v1::model::Replication;
7151 /// use google_cloud_netapp_v1::model::replication::HybridReplicationType;
7152 /// let x0 = Replication::new().set_hybrid_replication_type(HybridReplicationType::Migration);
7153 /// let x1 = Replication::new().set_hybrid_replication_type(HybridReplicationType::ContinuousReplication);
7154 /// let x2 = Replication::new().set_hybrid_replication_type(HybridReplicationType::OnpremReplication);
7155 /// ```
7156 pub fn set_hybrid_replication_type<
7157 T: std::convert::Into<crate::model::replication::HybridReplicationType>,
7158 >(
7159 mut self,
7160 v: T,
7161 ) -> Self {
7162 self.hybrid_replication_type = v.into();
7163 self
7164 }
7165
7166 /// Sets the value of [hybrid_replication_user_commands][crate::model::Replication::hybrid_replication_user_commands].
7167 ///
7168 /// # Example
7169 /// ```ignore,no_run
7170 /// # use google_cloud_netapp_v1::model::Replication;
7171 /// use google_cloud_netapp_v1::model::UserCommands;
7172 /// let x = Replication::new().set_hybrid_replication_user_commands(UserCommands::default()/* use setters */);
7173 /// ```
7174 pub fn set_hybrid_replication_user_commands<T>(mut self, v: T) -> Self
7175 where
7176 T: std::convert::Into<crate::model::UserCommands>,
7177 {
7178 self.hybrid_replication_user_commands = std::option::Option::Some(v.into());
7179 self
7180 }
7181
7182 /// Sets or clears the value of [hybrid_replication_user_commands][crate::model::Replication::hybrid_replication_user_commands].
7183 ///
7184 /// # Example
7185 /// ```ignore,no_run
7186 /// # use google_cloud_netapp_v1::model::Replication;
7187 /// use google_cloud_netapp_v1::model::UserCommands;
7188 /// let x = Replication::new().set_or_clear_hybrid_replication_user_commands(Some(UserCommands::default()/* use setters */));
7189 /// let x = Replication::new().set_or_clear_hybrid_replication_user_commands(None::<UserCommands>);
7190 /// ```
7191 pub fn set_or_clear_hybrid_replication_user_commands<T>(
7192 mut self,
7193 v: std::option::Option<T>,
7194 ) -> Self
7195 where
7196 T: std::convert::Into<crate::model::UserCommands>,
7197 {
7198 self.hybrid_replication_user_commands = v.map(|x| x.into());
7199 self
7200 }
7201}
7202
7203impl wkt::message::Message for Replication {
7204 fn typename() -> &'static str {
7205 "type.googleapis.com/google.cloud.netapp.v1.Replication"
7206 }
7207}
7208
7209/// Defines additional types related to [Replication].
7210pub mod replication {
7211 #[allow(unused_imports)]
7212 use super::*;
7213
7214 /// The replication states
7215 /// New enum values may be added in future to indicate possible new states.
7216 ///
7217 /// # Working with unknown values
7218 ///
7219 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7220 /// additional enum variants at any time. Adding new variants is not considered
7221 /// a breaking change. Applications should write their code in anticipation of:
7222 ///
7223 /// - New values appearing in future releases of the client library, **and**
7224 /// - New values received dynamically, without application changes.
7225 ///
7226 /// Please consult the [Working with enums] section in the user guide for some
7227 /// guidelines.
7228 ///
7229 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7230 #[derive(Clone, Debug, PartialEq)]
7231 #[non_exhaustive]
7232 pub enum State {
7233 /// Unspecified replication State
7234 Unspecified,
7235 /// Replication is creating.
7236 Creating,
7237 /// Replication is ready.
7238 Ready,
7239 /// Replication is updating.
7240 Updating,
7241 /// Replication is deleting.
7242 Deleting,
7243 /// Replication is in error state.
7244 Error,
7245 /// Replication is waiting for cluster peering to be established.
7246 PendingClusterPeering,
7247 /// Replication is waiting for SVM peering to be established.
7248 PendingSvmPeering,
7249 /// Replication is waiting for Commands to be executed on Onprem ONTAP.
7250 PendingRemoteResync,
7251 /// Onprem ONTAP is destination and Replication can only be managed from
7252 /// Onprem.
7253 ExternallyManagedReplication,
7254 /// If set, the enum was initialized with an unknown value.
7255 ///
7256 /// Applications can examine the value using [State::value] or
7257 /// [State::name].
7258 UnknownValue(state::UnknownValue),
7259 }
7260
7261 #[doc(hidden)]
7262 pub mod state {
7263 #[allow(unused_imports)]
7264 use super::*;
7265 #[derive(Clone, Debug, PartialEq)]
7266 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7267 }
7268
7269 impl State {
7270 /// Gets the enum value.
7271 ///
7272 /// Returns `None` if the enum contains an unknown value deserialized from
7273 /// the string representation of enums.
7274 pub fn value(&self) -> std::option::Option<i32> {
7275 match self {
7276 Self::Unspecified => std::option::Option::Some(0),
7277 Self::Creating => std::option::Option::Some(1),
7278 Self::Ready => std::option::Option::Some(2),
7279 Self::Updating => std::option::Option::Some(3),
7280 Self::Deleting => std::option::Option::Some(5),
7281 Self::Error => std::option::Option::Some(6),
7282 Self::PendingClusterPeering => std::option::Option::Some(8),
7283 Self::PendingSvmPeering => std::option::Option::Some(9),
7284 Self::PendingRemoteResync => std::option::Option::Some(10),
7285 Self::ExternallyManagedReplication => std::option::Option::Some(11),
7286 Self::UnknownValue(u) => u.0.value(),
7287 }
7288 }
7289
7290 /// Gets the enum value as a string.
7291 ///
7292 /// Returns `None` if the enum contains an unknown value deserialized from
7293 /// the integer representation of enums.
7294 pub fn name(&self) -> std::option::Option<&str> {
7295 match self {
7296 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
7297 Self::Creating => std::option::Option::Some("CREATING"),
7298 Self::Ready => std::option::Option::Some("READY"),
7299 Self::Updating => std::option::Option::Some("UPDATING"),
7300 Self::Deleting => std::option::Option::Some("DELETING"),
7301 Self::Error => std::option::Option::Some("ERROR"),
7302 Self::PendingClusterPeering => std::option::Option::Some("PENDING_CLUSTER_PEERING"),
7303 Self::PendingSvmPeering => std::option::Option::Some("PENDING_SVM_PEERING"),
7304 Self::PendingRemoteResync => std::option::Option::Some("PENDING_REMOTE_RESYNC"),
7305 Self::ExternallyManagedReplication => {
7306 std::option::Option::Some("EXTERNALLY_MANAGED_REPLICATION")
7307 }
7308 Self::UnknownValue(u) => u.0.name(),
7309 }
7310 }
7311 }
7312
7313 impl std::default::Default for State {
7314 fn default() -> Self {
7315 use std::convert::From;
7316 Self::from(0)
7317 }
7318 }
7319
7320 impl std::fmt::Display for State {
7321 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7322 wkt::internal::display_enum(f, self.name(), self.value())
7323 }
7324 }
7325
7326 impl std::convert::From<i32> for State {
7327 fn from(value: i32) -> Self {
7328 match value {
7329 0 => Self::Unspecified,
7330 1 => Self::Creating,
7331 2 => Self::Ready,
7332 3 => Self::Updating,
7333 5 => Self::Deleting,
7334 6 => Self::Error,
7335 8 => Self::PendingClusterPeering,
7336 9 => Self::PendingSvmPeering,
7337 10 => Self::PendingRemoteResync,
7338 11 => Self::ExternallyManagedReplication,
7339 _ => Self::UnknownValue(state::UnknownValue(
7340 wkt::internal::UnknownEnumValue::Integer(value),
7341 )),
7342 }
7343 }
7344 }
7345
7346 impl std::convert::From<&str> for State {
7347 fn from(value: &str) -> Self {
7348 use std::string::ToString;
7349 match value {
7350 "STATE_UNSPECIFIED" => Self::Unspecified,
7351 "CREATING" => Self::Creating,
7352 "READY" => Self::Ready,
7353 "UPDATING" => Self::Updating,
7354 "DELETING" => Self::Deleting,
7355 "ERROR" => Self::Error,
7356 "PENDING_CLUSTER_PEERING" => Self::PendingClusterPeering,
7357 "PENDING_SVM_PEERING" => Self::PendingSvmPeering,
7358 "PENDING_REMOTE_RESYNC" => Self::PendingRemoteResync,
7359 "EXTERNALLY_MANAGED_REPLICATION" => Self::ExternallyManagedReplication,
7360 _ => Self::UnknownValue(state::UnknownValue(
7361 wkt::internal::UnknownEnumValue::String(value.to_string()),
7362 )),
7363 }
7364 }
7365 }
7366
7367 impl serde::ser::Serialize for State {
7368 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7369 where
7370 S: serde::Serializer,
7371 {
7372 match self {
7373 Self::Unspecified => serializer.serialize_i32(0),
7374 Self::Creating => serializer.serialize_i32(1),
7375 Self::Ready => serializer.serialize_i32(2),
7376 Self::Updating => serializer.serialize_i32(3),
7377 Self::Deleting => serializer.serialize_i32(5),
7378 Self::Error => serializer.serialize_i32(6),
7379 Self::PendingClusterPeering => serializer.serialize_i32(8),
7380 Self::PendingSvmPeering => serializer.serialize_i32(9),
7381 Self::PendingRemoteResync => serializer.serialize_i32(10),
7382 Self::ExternallyManagedReplication => serializer.serialize_i32(11),
7383 Self::UnknownValue(u) => u.0.serialize(serializer),
7384 }
7385 }
7386 }
7387
7388 impl<'de> serde::de::Deserialize<'de> for State {
7389 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7390 where
7391 D: serde::Deserializer<'de>,
7392 {
7393 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
7394 ".google.cloud.netapp.v1.Replication.State",
7395 ))
7396 }
7397 }
7398
7399 /// New enum values may be added in future to support different replication
7400 /// topology.
7401 ///
7402 /// # Working with unknown values
7403 ///
7404 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7405 /// additional enum variants at any time. Adding new variants is not considered
7406 /// a breaking change. Applications should write their code in anticipation of:
7407 ///
7408 /// - New values appearing in future releases of the client library, **and**
7409 /// - New values received dynamically, without application changes.
7410 ///
7411 /// Please consult the [Working with enums] section in the user guide for some
7412 /// guidelines.
7413 ///
7414 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7415 #[derive(Clone, Debug, PartialEq)]
7416 #[non_exhaustive]
7417 pub enum ReplicationRole {
7418 /// Unspecified replication role
7419 Unspecified,
7420 /// Indicates Source volume.
7421 Source,
7422 /// Indicates Destination volume.
7423 Destination,
7424 /// If set, the enum was initialized with an unknown value.
7425 ///
7426 /// Applications can examine the value using [ReplicationRole::value] or
7427 /// [ReplicationRole::name].
7428 UnknownValue(replication_role::UnknownValue),
7429 }
7430
7431 #[doc(hidden)]
7432 pub mod replication_role {
7433 #[allow(unused_imports)]
7434 use super::*;
7435 #[derive(Clone, Debug, PartialEq)]
7436 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7437 }
7438
7439 impl ReplicationRole {
7440 /// Gets the enum value.
7441 ///
7442 /// Returns `None` if the enum contains an unknown value deserialized from
7443 /// the string representation of enums.
7444 pub fn value(&self) -> std::option::Option<i32> {
7445 match self {
7446 Self::Unspecified => std::option::Option::Some(0),
7447 Self::Source => std::option::Option::Some(1),
7448 Self::Destination => std::option::Option::Some(2),
7449 Self::UnknownValue(u) => u.0.value(),
7450 }
7451 }
7452
7453 /// Gets the enum value as a string.
7454 ///
7455 /// Returns `None` if the enum contains an unknown value deserialized from
7456 /// the integer representation of enums.
7457 pub fn name(&self) -> std::option::Option<&str> {
7458 match self {
7459 Self::Unspecified => std::option::Option::Some("REPLICATION_ROLE_UNSPECIFIED"),
7460 Self::Source => std::option::Option::Some("SOURCE"),
7461 Self::Destination => std::option::Option::Some("DESTINATION"),
7462 Self::UnknownValue(u) => u.0.name(),
7463 }
7464 }
7465 }
7466
7467 impl std::default::Default for ReplicationRole {
7468 fn default() -> Self {
7469 use std::convert::From;
7470 Self::from(0)
7471 }
7472 }
7473
7474 impl std::fmt::Display for ReplicationRole {
7475 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7476 wkt::internal::display_enum(f, self.name(), self.value())
7477 }
7478 }
7479
7480 impl std::convert::From<i32> for ReplicationRole {
7481 fn from(value: i32) -> Self {
7482 match value {
7483 0 => Self::Unspecified,
7484 1 => Self::Source,
7485 2 => Self::Destination,
7486 _ => Self::UnknownValue(replication_role::UnknownValue(
7487 wkt::internal::UnknownEnumValue::Integer(value),
7488 )),
7489 }
7490 }
7491 }
7492
7493 impl std::convert::From<&str> for ReplicationRole {
7494 fn from(value: &str) -> Self {
7495 use std::string::ToString;
7496 match value {
7497 "REPLICATION_ROLE_UNSPECIFIED" => Self::Unspecified,
7498 "SOURCE" => Self::Source,
7499 "DESTINATION" => Self::Destination,
7500 _ => Self::UnknownValue(replication_role::UnknownValue(
7501 wkt::internal::UnknownEnumValue::String(value.to_string()),
7502 )),
7503 }
7504 }
7505 }
7506
7507 impl serde::ser::Serialize for ReplicationRole {
7508 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7509 where
7510 S: serde::Serializer,
7511 {
7512 match self {
7513 Self::Unspecified => serializer.serialize_i32(0),
7514 Self::Source => serializer.serialize_i32(1),
7515 Self::Destination => serializer.serialize_i32(2),
7516 Self::UnknownValue(u) => u.0.serialize(serializer),
7517 }
7518 }
7519 }
7520
7521 impl<'de> serde::de::Deserialize<'de> for ReplicationRole {
7522 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7523 where
7524 D: serde::Deserializer<'de>,
7525 {
7526 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicationRole>::new(
7527 ".google.cloud.netapp.v1.Replication.ReplicationRole",
7528 ))
7529 }
7530 }
7531
7532 /// Schedule for Replication.
7533 /// New enum values may be added in future to support different frequency of
7534 /// replication.
7535 ///
7536 /// # Working with unknown values
7537 ///
7538 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7539 /// additional enum variants at any time. Adding new variants is not considered
7540 /// a breaking change. Applications should write their code in anticipation of:
7541 ///
7542 /// - New values appearing in future releases of the client library, **and**
7543 /// - New values received dynamically, without application changes.
7544 ///
7545 /// Please consult the [Working with enums] section in the user guide for some
7546 /// guidelines.
7547 ///
7548 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7549 #[derive(Clone, Debug, PartialEq)]
7550 #[non_exhaustive]
7551 pub enum ReplicationSchedule {
7552 /// Unspecified ReplicationSchedule
7553 Unspecified,
7554 /// Replication happens once every 10 minutes.
7555 Every10Minutes,
7556 /// Replication happens once every hour.
7557 Hourly,
7558 /// Replication happens once every day.
7559 Daily,
7560 /// If set, the enum was initialized with an unknown value.
7561 ///
7562 /// Applications can examine the value using [ReplicationSchedule::value] or
7563 /// [ReplicationSchedule::name].
7564 UnknownValue(replication_schedule::UnknownValue),
7565 }
7566
7567 #[doc(hidden)]
7568 pub mod replication_schedule {
7569 #[allow(unused_imports)]
7570 use super::*;
7571 #[derive(Clone, Debug, PartialEq)]
7572 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7573 }
7574
7575 impl ReplicationSchedule {
7576 /// Gets the enum value.
7577 ///
7578 /// Returns `None` if the enum contains an unknown value deserialized from
7579 /// the string representation of enums.
7580 pub fn value(&self) -> std::option::Option<i32> {
7581 match self {
7582 Self::Unspecified => std::option::Option::Some(0),
7583 Self::Every10Minutes => std::option::Option::Some(1),
7584 Self::Hourly => std::option::Option::Some(2),
7585 Self::Daily => std::option::Option::Some(3),
7586 Self::UnknownValue(u) => u.0.value(),
7587 }
7588 }
7589
7590 /// Gets the enum value as a string.
7591 ///
7592 /// Returns `None` if the enum contains an unknown value deserialized from
7593 /// the integer representation of enums.
7594 pub fn name(&self) -> std::option::Option<&str> {
7595 match self {
7596 Self::Unspecified => std::option::Option::Some("REPLICATION_SCHEDULE_UNSPECIFIED"),
7597 Self::Every10Minutes => std::option::Option::Some("EVERY_10_MINUTES"),
7598 Self::Hourly => std::option::Option::Some("HOURLY"),
7599 Self::Daily => std::option::Option::Some("DAILY"),
7600 Self::UnknownValue(u) => u.0.name(),
7601 }
7602 }
7603 }
7604
7605 impl std::default::Default for ReplicationSchedule {
7606 fn default() -> Self {
7607 use std::convert::From;
7608 Self::from(0)
7609 }
7610 }
7611
7612 impl std::fmt::Display for ReplicationSchedule {
7613 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7614 wkt::internal::display_enum(f, self.name(), self.value())
7615 }
7616 }
7617
7618 impl std::convert::From<i32> for ReplicationSchedule {
7619 fn from(value: i32) -> Self {
7620 match value {
7621 0 => Self::Unspecified,
7622 1 => Self::Every10Minutes,
7623 2 => Self::Hourly,
7624 3 => Self::Daily,
7625 _ => Self::UnknownValue(replication_schedule::UnknownValue(
7626 wkt::internal::UnknownEnumValue::Integer(value),
7627 )),
7628 }
7629 }
7630 }
7631
7632 impl std::convert::From<&str> for ReplicationSchedule {
7633 fn from(value: &str) -> Self {
7634 use std::string::ToString;
7635 match value {
7636 "REPLICATION_SCHEDULE_UNSPECIFIED" => Self::Unspecified,
7637 "EVERY_10_MINUTES" => Self::Every10Minutes,
7638 "HOURLY" => Self::Hourly,
7639 "DAILY" => Self::Daily,
7640 _ => Self::UnknownValue(replication_schedule::UnknownValue(
7641 wkt::internal::UnknownEnumValue::String(value.to_string()),
7642 )),
7643 }
7644 }
7645 }
7646
7647 impl serde::ser::Serialize for ReplicationSchedule {
7648 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7649 where
7650 S: serde::Serializer,
7651 {
7652 match self {
7653 Self::Unspecified => serializer.serialize_i32(0),
7654 Self::Every10Minutes => serializer.serialize_i32(1),
7655 Self::Hourly => serializer.serialize_i32(2),
7656 Self::Daily => serializer.serialize_i32(3),
7657 Self::UnknownValue(u) => u.0.serialize(serializer),
7658 }
7659 }
7660 }
7661
7662 impl<'de> serde::de::Deserialize<'de> for ReplicationSchedule {
7663 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7664 where
7665 D: serde::Deserializer<'de>,
7666 {
7667 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReplicationSchedule>::new(
7668 ".google.cloud.netapp.v1.Replication.ReplicationSchedule",
7669 ))
7670 }
7671 }
7672
7673 /// Mirroring states.
7674 /// No new value is expected to be added in future.
7675 ///
7676 /// # Working with unknown values
7677 ///
7678 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7679 /// additional enum variants at any time. Adding new variants is not considered
7680 /// a breaking change. Applications should write their code in anticipation of:
7681 ///
7682 /// - New values appearing in future releases of the client library, **and**
7683 /// - New values received dynamically, without application changes.
7684 ///
7685 /// Please consult the [Working with enums] section in the user guide for some
7686 /// guidelines.
7687 ///
7688 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7689 #[derive(Clone, Debug, PartialEq)]
7690 #[non_exhaustive]
7691 pub enum MirrorState {
7692 /// Unspecified MirrorState
7693 Unspecified,
7694 /// Destination volume is being prepared.
7695 Preparing,
7696 /// Destination volume has been initialized and is ready to receive
7697 /// replication transfers.
7698 Mirrored,
7699 /// Destination volume is not receiving replication transfers.
7700 Stopped,
7701 /// Incremental replication is in progress.
7702 Transferring,
7703 /// Baseline replication is in progress.
7704 BaselineTransferring,
7705 /// Replication is aborted.
7706 Aborted,
7707 /// Replication is being managed from Onprem ONTAP.
7708 ExternallyManaged,
7709 /// Peering is yet to be established.
7710 PendingPeering,
7711 /// If set, the enum was initialized with an unknown value.
7712 ///
7713 /// Applications can examine the value using [MirrorState::value] or
7714 /// [MirrorState::name].
7715 UnknownValue(mirror_state::UnknownValue),
7716 }
7717
7718 #[doc(hidden)]
7719 pub mod mirror_state {
7720 #[allow(unused_imports)]
7721 use super::*;
7722 #[derive(Clone, Debug, PartialEq)]
7723 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7724 }
7725
7726 impl MirrorState {
7727 /// Gets the enum value.
7728 ///
7729 /// Returns `None` if the enum contains an unknown value deserialized from
7730 /// the string representation of enums.
7731 pub fn value(&self) -> std::option::Option<i32> {
7732 match self {
7733 Self::Unspecified => std::option::Option::Some(0),
7734 Self::Preparing => std::option::Option::Some(1),
7735 Self::Mirrored => std::option::Option::Some(2),
7736 Self::Stopped => std::option::Option::Some(3),
7737 Self::Transferring => std::option::Option::Some(4),
7738 Self::BaselineTransferring => std::option::Option::Some(5),
7739 Self::Aborted => std::option::Option::Some(6),
7740 Self::ExternallyManaged => std::option::Option::Some(7),
7741 Self::PendingPeering => std::option::Option::Some(8),
7742 Self::UnknownValue(u) => u.0.value(),
7743 }
7744 }
7745
7746 /// Gets the enum value as a string.
7747 ///
7748 /// Returns `None` if the enum contains an unknown value deserialized from
7749 /// the integer representation of enums.
7750 pub fn name(&self) -> std::option::Option<&str> {
7751 match self {
7752 Self::Unspecified => std::option::Option::Some("MIRROR_STATE_UNSPECIFIED"),
7753 Self::Preparing => std::option::Option::Some("PREPARING"),
7754 Self::Mirrored => std::option::Option::Some("MIRRORED"),
7755 Self::Stopped => std::option::Option::Some("STOPPED"),
7756 Self::Transferring => std::option::Option::Some("TRANSFERRING"),
7757 Self::BaselineTransferring => std::option::Option::Some("BASELINE_TRANSFERRING"),
7758 Self::Aborted => std::option::Option::Some("ABORTED"),
7759 Self::ExternallyManaged => std::option::Option::Some("EXTERNALLY_MANAGED"),
7760 Self::PendingPeering => std::option::Option::Some("PENDING_PEERING"),
7761 Self::UnknownValue(u) => u.0.name(),
7762 }
7763 }
7764 }
7765
7766 impl std::default::Default for MirrorState {
7767 fn default() -> Self {
7768 use std::convert::From;
7769 Self::from(0)
7770 }
7771 }
7772
7773 impl std::fmt::Display for MirrorState {
7774 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7775 wkt::internal::display_enum(f, self.name(), self.value())
7776 }
7777 }
7778
7779 impl std::convert::From<i32> for MirrorState {
7780 fn from(value: i32) -> Self {
7781 match value {
7782 0 => Self::Unspecified,
7783 1 => Self::Preparing,
7784 2 => Self::Mirrored,
7785 3 => Self::Stopped,
7786 4 => Self::Transferring,
7787 5 => Self::BaselineTransferring,
7788 6 => Self::Aborted,
7789 7 => Self::ExternallyManaged,
7790 8 => Self::PendingPeering,
7791 _ => Self::UnknownValue(mirror_state::UnknownValue(
7792 wkt::internal::UnknownEnumValue::Integer(value),
7793 )),
7794 }
7795 }
7796 }
7797
7798 impl std::convert::From<&str> for MirrorState {
7799 fn from(value: &str) -> Self {
7800 use std::string::ToString;
7801 match value {
7802 "MIRROR_STATE_UNSPECIFIED" => Self::Unspecified,
7803 "PREPARING" => Self::Preparing,
7804 "MIRRORED" => Self::Mirrored,
7805 "STOPPED" => Self::Stopped,
7806 "TRANSFERRING" => Self::Transferring,
7807 "BASELINE_TRANSFERRING" => Self::BaselineTransferring,
7808 "ABORTED" => Self::Aborted,
7809 "EXTERNALLY_MANAGED" => Self::ExternallyManaged,
7810 "PENDING_PEERING" => Self::PendingPeering,
7811 _ => Self::UnknownValue(mirror_state::UnknownValue(
7812 wkt::internal::UnknownEnumValue::String(value.to_string()),
7813 )),
7814 }
7815 }
7816 }
7817
7818 impl serde::ser::Serialize for MirrorState {
7819 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7820 where
7821 S: serde::Serializer,
7822 {
7823 match self {
7824 Self::Unspecified => serializer.serialize_i32(0),
7825 Self::Preparing => serializer.serialize_i32(1),
7826 Self::Mirrored => serializer.serialize_i32(2),
7827 Self::Stopped => serializer.serialize_i32(3),
7828 Self::Transferring => serializer.serialize_i32(4),
7829 Self::BaselineTransferring => serializer.serialize_i32(5),
7830 Self::Aborted => serializer.serialize_i32(6),
7831 Self::ExternallyManaged => serializer.serialize_i32(7),
7832 Self::PendingPeering => serializer.serialize_i32(8),
7833 Self::UnknownValue(u) => u.0.serialize(serializer),
7834 }
7835 }
7836 }
7837
7838 impl<'de> serde::de::Deserialize<'de> for MirrorState {
7839 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7840 where
7841 D: serde::Deserializer<'de>,
7842 {
7843 deserializer.deserialize_any(wkt::internal::EnumVisitor::<MirrorState>::new(
7844 ".google.cloud.netapp.v1.Replication.MirrorState",
7845 ))
7846 }
7847 }
7848
7849 /// Hybrid replication type.
7850 ///
7851 /// # Working with unknown values
7852 ///
7853 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
7854 /// additional enum variants at any time. Adding new variants is not considered
7855 /// a breaking change. Applications should write their code in anticipation of:
7856 ///
7857 /// - New values appearing in future releases of the client library, **and**
7858 /// - New values received dynamically, without application changes.
7859 ///
7860 /// Please consult the [Working with enums] section in the user guide for some
7861 /// guidelines.
7862 ///
7863 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
7864 #[derive(Clone, Debug, PartialEq)]
7865 #[non_exhaustive]
7866 pub enum HybridReplicationType {
7867 /// Unspecified hybrid replication type.
7868 Unspecified,
7869 /// Hybrid replication type for migration.
7870 Migration,
7871 /// Hybrid replication type for continuous replication.
7872 ContinuousReplication,
7873 /// New field for reversible OnPrem replication, to be used for data
7874 /// protection.
7875 OnpremReplication,
7876 /// Hybrid replication type for incremental Transfer in the reverse direction
7877 /// (GCNV is source and Onprem is destination)
7878 ReverseOnpremReplication,
7879 /// If set, the enum was initialized with an unknown value.
7880 ///
7881 /// Applications can examine the value using [HybridReplicationType::value] or
7882 /// [HybridReplicationType::name].
7883 UnknownValue(hybrid_replication_type::UnknownValue),
7884 }
7885
7886 #[doc(hidden)]
7887 pub mod hybrid_replication_type {
7888 #[allow(unused_imports)]
7889 use super::*;
7890 #[derive(Clone, Debug, PartialEq)]
7891 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
7892 }
7893
7894 impl HybridReplicationType {
7895 /// Gets the enum value.
7896 ///
7897 /// Returns `None` if the enum contains an unknown value deserialized from
7898 /// the string representation of enums.
7899 pub fn value(&self) -> std::option::Option<i32> {
7900 match self {
7901 Self::Unspecified => std::option::Option::Some(0),
7902 Self::Migration => std::option::Option::Some(1),
7903 Self::ContinuousReplication => std::option::Option::Some(2),
7904 Self::OnpremReplication => std::option::Option::Some(3),
7905 Self::ReverseOnpremReplication => std::option::Option::Some(4),
7906 Self::UnknownValue(u) => u.0.value(),
7907 }
7908 }
7909
7910 /// Gets the enum value as a string.
7911 ///
7912 /// Returns `None` if the enum contains an unknown value deserialized from
7913 /// the integer representation of enums.
7914 pub fn name(&self) -> std::option::Option<&str> {
7915 match self {
7916 Self::Unspecified => {
7917 std::option::Option::Some("HYBRID_REPLICATION_TYPE_UNSPECIFIED")
7918 }
7919 Self::Migration => std::option::Option::Some("MIGRATION"),
7920 Self::ContinuousReplication => std::option::Option::Some("CONTINUOUS_REPLICATION"),
7921 Self::OnpremReplication => std::option::Option::Some("ONPREM_REPLICATION"),
7922 Self::ReverseOnpremReplication => {
7923 std::option::Option::Some("REVERSE_ONPREM_REPLICATION")
7924 }
7925 Self::UnknownValue(u) => u.0.name(),
7926 }
7927 }
7928 }
7929
7930 impl std::default::Default for HybridReplicationType {
7931 fn default() -> Self {
7932 use std::convert::From;
7933 Self::from(0)
7934 }
7935 }
7936
7937 impl std::fmt::Display for HybridReplicationType {
7938 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
7939 wkt::internal::display_enum(f, self.name(), self.value())
7940 }
7941 }
7942
7943 impl std::convert::From<i32> for HybridReplicationType {
7944 fn from(value: i32) -> Self {
7945 match value {
7946 0 => Self::Unspecified,
7947 1 => Self::Migration,
7948 2 => Self::ContinuousReplication,
7949 3 => Self::OnpremReplication,
7950 4 => Self::ReverseOnpremReplication,
7951 _ => Self::UnknownValue(hybrid_replication_type::UnknownValue(
7952 wkt::internal::UnknownEnumValue::Integer(value),
7953 )),
7954 }
7955 }
7956 }
7957
7958 impl std::convert::From<&str> for HybridReplicationType {
7959 fn from(value: &str) -> Self {
7960 use std::string::ToString;
7961 match value {
7962 "HYBRID_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
7963 "MIGRATION" => Self::Migration,
7964 "CONTINUOUS_REPLICATION" => Self::ContinuousReplication,
7965 "ONPREM_REPLICATION" => Self::OnpremReplication,
7966 "REVERSE_ONPREM_REPLICATION" => Self::ReverseOnpremReplication,
7967 _ => Self::UnknownValue(hybrid_replication_type::UnknownValue(
7968 wkt::internal::UnknownEnumValue::String(value.to_string()),
7969 )),
7970 }
7971 }
7972 }
7973
7974 impl serde::ser::Serialize for HybridReplicationType {
7975 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7976 where
7977 S: serde::Serializer,
7978 {
7979 match self {
7980 Self::Unspecified => serializer.serialize_i32(0),
7981 Self::Migration => serializer.serialize_i32(1),
7982 Self::ContinuousReplication => serializer.serialize_i32(2),
7983 Self::OnpremReplication => serializer.serialize_i32(3),
7984 Self::ReverseOnpremReplication => serializer.serialize_i32(4),
7985 Self::UnknownValue(u) => u.0.serialize(serializer),
7986 }
7987 }
7988 }
7989
7990 impl<'de> serde::de::Deserialize<'de> for HybridReplicationType {
7991 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7992 where
7993 D: serde::Deserializer<'de>,
7994 {
7995 deserializer.deserialize_any(wkt::internal::EnumVisitor::<HybridReplicationType>::new(
7996 ".google.cloud.netapp.v1.Replication.HybridReplicationType",
7997 ))
7998 }
7999 }
8000}
8001
8002/// HybridPeeringDetails contains details about the hybrid peering.
8003#[derive(Clone, Default, PartialEq)]
8004#[non_exhaustive]
8005pub struct HybridPeeringDetails {
8006 /// Output only. IP address of the subnet.
8007 pub subnet_ip: std::string::String,
8008
8009 /// Output only. Copy-paste-able commands to be used on user's ONTAP to accept
8010 /// peering requests.
8011 pub command: std::string::String,
8012
8013 /// Output only. Expiration time for the peering command to be executed on
8014 /// user's ONTAP.
8015 pub command_expiry_time: std::option::Option<wkt::Timestamp>,
8016
8017 /// Output only. Temporary passphrase generated to accept cluster peering
8018 /// command.
8019 pub passphrase: std::string::String,
8020
8021 /// Output only. Name of the user's local source volume to be peered with the
8022 /// destination volume.
8023 pub peer_volume_name: std::string::String,
8024
8025 /// Output only. Name of the user's local source cluster to be peered with the
8026 /// destination cluster.
8027 pub peer_cluster_name: std::string::String,
8028
8029 /// Output only. Name of the user's local source vserver svm to be peered with
8030 /// the destination vserver svm.
8031 pub peer_svm_name: std::string::String,
8032
8033 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8034}
8035
8036impl HybridPeeringDetails {
8037 pub fn new() -> Self {
8038 std::default::Default::default()
8039 }
8040
8041 /// Sets the value of [subnet_ip][crate::model::HybridPeeringDetails::subnet_ip].
8042 ///
8043 /// # Example
8044 /// ```ignore,no_run
8045 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
8046 /// let x = HybridPeeringDetails::new().set_subnet_ip("example");
8047 /// ```
8048 pub fn set_subnet_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8049 self.subnet_ip = v.into();
8050 self
8051 }
8052
8053 /// Sets the value of [command][crate::model::HybridPeeringDetails::command].
8054 ///
8055 /// # Example
8056 /// ```ignore,no_run
8057 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
8058 /// let x = HybridPeeringDetails::new().set_command("example");
8059 /// ```
8060 pub fn set_command<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8061 self.command = v.into();
8062 self
8063 }
8064
8065 /// Sets the value of [command_expiry_time][crate::model::HybridPeeringDetails::command_expiry_time].
8066 ///
8067 /// # Example
8068 /// ```ignore,no_run
8069 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
8070 /// use wkt::Timestamp;
8071 /// let x = HybridPeeringDetails::new().set_command_expiry_time(Timestamp::default()/* use setters */);
8072 /// ```
8073 pub fn set_command_expiry_time<T>(mut self, v: T) -> Self
8074 where
8075 T: std::convert::Into<wkt::Timestamp>,
8076 {
8077 self.command_expiry_time = std::option::Option::Some(v.into());
8078 self
8079 }
8080
8081 /// Sets or clears the value of [command_expiry_time][crate::model::HybridPeeringDetails::command_expiry_time].
8082 ///
8083 /// # Example
8084 /// ```ignore,no_run
8085 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
8086 /// use wkt::Timestamp;
8087 /// let x = HybridPeeringDetails::new().set_or_clear_command_expiry_time(Some(Timestamp::default()/* use setters */));
8088 /// let x = HybridPeeringDetails::new().set_or_clear_command_expiry_time(None::<Timestamp>);
8089 /// ```
8090 pub fn set_or_clear_command_expiry_time<T>(mut self, v: std::option::Option<T>) -> Self
8091 where
8092 T: std::convert::Into<wkt::Timestamp>,
8093 {
8094 self.command_expiry_time = v.map(|x| x.into());
8095 self
8096 }
8097
8098 /// Sets the value of [passphrase][crate::model::HybridPeeringDetails::passphrase].
8099 ///
8100 /// # Example
8101 /// ```ignore,no_run
8102 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
8103 /// let x = HybridPeeringDetails::new().set_passphrase("example");
8104 /// ```
8105 pub fn set_passphrase<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8106 self.passphrase = v.into();
8107 self
8108 }
8109
8110 /// Sets the value of [peer_volume_name][crate::model::HybridPeeringDetails::peer_volume_name].
8111 ///
8112 /// # Example
8113 /// ```ignore,no_run
8114 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
8115 /// let x = HybridPeeringDetails::new().set_peer_volume_name("example");
8116 /// ```
8117 pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
8118 mut self,
8119 v: T,
8120 ) -> Self {
8121 self.peer_volume_name = v.into();
8122 self
8123 }
8124
8125 /// Sets the value of [peer_cluster_name][crate::model::HybridPeeringDetails::peer_cluster_name].
8126 ///
8127 /// # Example
8128 /// ```ignore,no_run
8129 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
8130 /// let x = HybridPeeringDetails::new().set_peer_cluster_name("example");
8131 /// ```
8132 pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
8133 mut self,
8134 v: T,
8135 ) -> Self {
8136 self.peer_cluster_name = v.into();
8137 self
8138 }
8139
8140 /// Sets the value of [peer_svm_name][crate::model::HybridPeeringDetails::peer_svm_name].
8141 ///
8142 /// # Example
8143 /// ```ignore,no_run
8144 /// # use google_cloud_netapp_v1::model::HybridPeeringDetails;
8145 /// let x = HybridPeeringDetails::new().set_peer_svm_name("example");
8146 /// ```
8147 pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8148 self.peer_svm_name = v.into();
8149 self
8150 }
8151}
8152
8153impl wkt::message::Message for HybridPeeringDetails {
8154 fn typename() -> &'static str {
8155 "type.googleapis.com/google.cloud.netapp.v1.HybridPeeringDetails"
8156 }
8157}
8158
8159/// ListReplications lists replications.
8160#[derive(Clone, Default, PartialEq)]
8161#[non_exhaustive]
8162pub struct ListReplicationsRequest {
8163 /// Required. The volume for which to retrieve replication information,
8164 /// in the format
8165 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`.
8166 pub parent: std::string::String,
8167
8168 /// The maximum number of items to return.
8169 pub page_size: i32,
8170
8171 /// The next_page_token value to use if there are additional
8172 /// results to retrieve for this list request.
8173 pub page_token: std::string::String,
8174
8175 /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
8176 pub order_by: std::string::String,
8177
8178 /// List filter.
8179 pub filter: std::string::String,
8180
8181 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8182}
8183
8184impl ListReplicationsRequest {
8185 pub fn new() -> Self {
8186 std::default::Default::default()
8187 }
8188
8189 /// Sets the value of [parent][crate::model::ListReplicationsRequest::parent].
8190 ///
8191 /// # Example
8192 /// ```ignore,no_run
8193 /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
8194 /// let x = ListReplicationsRequest::new().set_parent("example");
8195 /// ```
8196 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8197 self.parent = v.into();
8198 self
8199 }
8200
8201 /// Sets the value of [page_size][crate::model::ListReplicationsRequest::page_size].
8202 ///
8203 /// # Example
8204 /// ```ignore,no_run
8205 /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
8206 /// let x = ListReplicationsRequest::new().set_page_size(42);
8207 /// ```
8208 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
8209 self.page_size = v.into();
8210 self
8211 }
8212
8213 /// Sets the value of [page_token][crate::model::ListReplicationsRequest::page_token].
8214 ///
8215 /// # Example
8216 /// ```ignore,no_run
8217 /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
8218 /// let x = ListReplicationsRequest::new().set_page_token("example");
8219 /// ```
8220 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8221 self.page_token = v.into();
8222 self
8223 }
8224
8225 /// Sets the value of [order_by][crate::model::ListReplicationsRequest::order_by].
8226 ///
8227 /// # Example
8228 /// ```ignore,no_run
8229 /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
8230 /// let x = ListReplicationsRequest::new().set_order_by("example");
8231 /// ```
8232 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8233 self.order_by = v.into();
8234 self
8235 }
8236
8237 /// Sets the value of [filter][crate::model::ListReplicationsRequest::filter].
8238 ///
8239 /// # Example
8240 /// ```ignore,no_run
8241 /// # use google_cloud_netapp_v1::model::ListReplicationsRequest;
8242 /// let x = ListReplicationsRequest::new().set_filter("example");
8243 /// ```
8244 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8245 self.filter = v.into();
8246 self
8247 }
8248}
8249
8250impl wkt::message::Message for ListReplicationsRequest {
8251 fn typename() -> &'static str {
8252 "type.googleapis.com/google.cloud.netapp.v1.ListReplicationsRequest"
8253 }
8254}
8255
8256/// ListReplicationsResponse is the result of ListReplicationsRequest.
8257#[derive(Clone, Default, PartialEq)]
8258#[non_exhaustive]
8259pub struct ListReplicationsResponse {
8260 /// A list of replications in the project for the specified volume.
8261 pub replications: std::vec::Vec<crate::model::Replication>,
8262
8263 /// The token you can use to retrieve the next page of results. Not returned
8264 /// if there are no more results in the list.
8265 pub next_page_token: std::string::String,
8266
8267 /// Locations that could not be reached.
8268 pub unreachable: std::vec::Vec<std::string::String>,
8269
8270 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8271}
8272
8273impl ListReplicationsResponse {
8274 pub fn new() -> Self {
8275 std::default::Default::default()
8276 }
8277
8278 /// Sets the value of [replications][crate::model::ListReplicationsResponse::replications].
8279 ///
8280 /// # Example
8281 /// ```ignore,no_run
8282 /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
8283 /// use google_cloud_netapp_v1::model::Replication;
8284 /// let x = ListReplicationsResponse::new()
8285 /// .set_replications([
8286 /// Replication::default()/* use setters */,
8287 /// Replication::default()/* use (different) setters */,
8288 /// ]);
8289 /// ```
8290 pub fn set_replications<T, V>(mut self, v: T) -> Self
8291 where
8292 T: std::iter::IntoIterator<Item = V>,
8293 V: std::convert::Into<crate::model::Replication>,
8294 {
8295 use std::iter::Iterator;
8296 self.replications = v.into_iter().map(|i| i.into()).collect();
8297 self
8298 }
8299
8300 /// Sets the value of [next_page_token][crate::model::ListReplicationsResponse::next_page_token].
8301 ///
8302 /// # Example
8303 /// ```ignore,no_run
8304 /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
8305 /// let x = ListReplicationsResponse::new().set_next_page_token("example");
8306 /// ```
8307 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8308 self.next_page_token = v.into();
8309 self
8310 }
8311
8312 /// Sets the value of [unreachable][crate::model::ListReplicationsResponse::unreachable].
8313 ///
8314 /// # Example
8315 /// ```ignore,no_run
8316 /// # use google_cloud_netapp_v1::model::ListReplicationsResponse;
8317 /// let x = ListReplicationsResponse::new().set_unreachable(["a", "b", "c"]);
8318 /// ```
8319 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
8320 where
8321 T: std::iter::IntoIterator<Item = V>,
8322 V: std::convert::Into<std::string::String>,
8323 {
8324 use std::iter::Iterator;
8325 self.unreachable = v.into_iter().map(|i| i.into()).collect();
8326 self
8327 }
8328}
8329
8330impl wkt::message::Message for ListReplicationsResponse {
8331 fn typename() -> &'static str {
8332 "type.googleapis.com/google.cloud.netapp.v1.ListReplicationsResponse"
8333 }
8334}
8335
8336#[doc(hidden)]
8337impl gax::paginator::internal::PageableResponse for ListReplicationsResponse {
8338 type PageItem = crate::model::Replication;
8339
8340 fn items(self) -> std::vec::Vec<Self::PageItem> {
8341 self.replications
8342 }
8343
8344 fn next_page_token(&self) -> std::string::String {
8345 use std::clone::Clone;
8346 self.next_page_token.clone()
8347 }
8348}
8349
8350/// GetReplicationRequest gets the state of a replication.
8351#[derive(Clone, Default, PartialEq)]
8352#[non_exhaustive]
8353pub struct GetReplicationRequest {
8354 /// Required. The replication resource name, in the format
8355 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}`
8356 pub name: std::string::String,
8357
8358 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8359}
8360
8361impl GetReplicationRequest {
8362 pub fn new() -> Self {
8363 std::default::Default::default()
8364 }
8365
8366 /// Sets the value of [name][crate::model::GetReplicationRequest::name].
8367 ///
8368 /// # Example
8369 /// ```ignore,no_run
8370 /// # use google_cloud_netapp_v1::model::GetReplicationRequest;
8371 /// let x = GetReplicationRequest::new().set_name("example");
8372 /// ```
8373 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8374 self.name = v.into();
8375 self
8376 }
8377}
8378
8379impl wkt::message::Message for GetReplicationRequest {
8380 fn typename() -> &'static str {
8381 "type.googleapis.com/google.cloud.netapp.v1.GetReplicationRequest"
8382 }
8383}
8384
8385/// DestinationVolumeParameters specify input parameters used for creating
8386/// destination volume.
8387#[derive(Clone, Default, PartialEq)]
8388#[non_exhaustive]
8389pub struct DestinationVolumeParameters {
8390 /// Required. Existing destination StoragePool name.
8391 pub storage_pool: std::string::String,
8392
8393 /// Desired destination volume resource id. If not specified, source volume's
8394 /// resource id will be used.
8395 /// This value must start with a lowercase letter followed by up to 62
8396 /// lowercase letters, numbers, or hyphens, and cannot end with a hyphen.
8397 pub volume_id: std::string::String,
8398
8399 /// Destination volume's share name. If not specified, source volume's share
8400 /// name will be used.
8401 pub share_name: std::string::String,
8402
8403 /// Description for the destination volume.
8404 pub description: std::option::Option<std::string::String>,
8405
8406 /// Optional. Tiering policy for the volume.
8407 pub tiering_policy: std::option::Option<crate::model::TieringPolicy>,
8408
8409 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8410}
8411
8412impl DestinationVolumeParameters {
8413 pub fn new() -> Self {
8414 std::default::Default::default()
8415 }
8416
8417 /// Sets the value of [storage_pool][crate::model::DestinationVolumeParameters::storage_pool].
8418 ///
8419 /// # Example
8420 /// ```ignore,no_run
8421 /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
8422 /// let x = DestinationVolumeParameters::new().set_storage_pool("example");
8423 /// ```
8424 pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8425 self.storage_pool = v.into();
8426 self
8427 }
8428
8429 /// Sets the value of [volume_id][crate::model::DestinationVolumeParameters::volume_id].
8430 ///
8431 /// # Example
8432 /// ```ignore,no_run
8433 /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
8434 /// let x = DestinationVolumeParameters::new().set_volume_id("example");
8435 /// ```
8436 pub fn set_volume_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8437 self.volume_id = v.into();
8438 self
8439 }
8440
8441 /// Sets the value of [share_name][crate::model::DestinationVolumeParameters::share_name].
8442 ///
8443 /// # Example
8444 /// ```ignore,no_run
8445 /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
8446 /// let x = DestinationVolumeParameters::new().set_share_name("example");
8447 /// ```
8448 pub fn set_share_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8449 self.share_name = v.into();
8450 self
8451 }
8452
8453 /// Sets the value of [description][crate::model::DestinationVolumeParameters::description].
8454 ///
8455 /// # Example
8456 /// ```ignore,no_run
8457 /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
8458 /// let x = DestinationVolumeParameters::new().set_description("example");
8459 /// ```
8460 pub fn set_description<T>(mut self, v: T) -> Self
8461 where
8462 T: std::convert::Into<std::string::String>,
8463 {
8464 self.description = std::option::Option::Some(v.into());
8465 self
8466 }
8467
8468 /// Sets or clears the value of [description][crate::model::DestinationVolumeParameters::description].
8469 ///
8470 /// # Example
8471 /// ```ignore,no_run
8472 /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
8473 /// let x = DestinationVolumeParameters::new().set_or_clear_description(Some("example"));
8474 /// let x = DestinationVolumeParameters::new().set_or_clear_description(None::<String>);
8475 /// ```
8476 pub fn set_or_clear_description<T>(mut self, v: std::option::Option<T>) -> Self
8477 where
8478 T: std::convert::Into<std::string::String>,
8479 {
8480 self.description = v.map(|x| x.into());
8481 self
8482 }
8483
8484 /// Sets the value of [tiering_policy][crate::model::DestinationVolumeParameters::tiering_policy].
8485 ///
8486 /// # Example
8487 /// ```ignore,no_run
8488 /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
8489 /// use google_cloud_netapp_v1::model::TieringPolicy;
8490 /// let x = DestinationVolumeParameters::new().set_tiering_policy(TieringPolicy::default()/* use setters */);
8491 /// ```
8492 pub fn set_tiering_policy<T>(mut self, v: T) -> Self
8493 where
8494 T: std::convert::Into<crate::model::TieringPolicy>,
8495 {
8496 self.tiering_policy = std::option::Option::Some(v.into());
8497 self
8498 }
8499
8500 /// Sets or clears the value of [tiering_policy][crate::model::DestinationVolumeParameters::tiering_policy].
8501 ///
8502 /// # Example
8503 /// ```ignore,no_run
8504 /// # use google_cloud_netapp_v1::model::DestinationVolumeParameters;
8505 /// use google_cloud_netapp_v1::model::TieringPolicy;
8506 /// let x = DestinationVolumeParameters::new().set_or_clear_tiering_policy(Some(TieringPolicy::default()/* use setters */));
8507 /// let x = DestinationVolumeParameters::new().set_or_clear_tiering_policy(None::<TieringPolicy>);
8508 /// ```
8509 pub fn set_or_clear_tiering_policy<T>(mut self, v: std::option::Option<T>) -> Self
8510 where
8511 T: std::convert::Into<crate::model::TieringPolicy>,
8512 {
8513 self.tiering_policy = v.map(|x| x.into());
8514 self
8515 }
8516}
8517
8518impl wkt::message::Message for DestinationVolumeParameters {
8519 fn typename() -> &'static str {
8520 "type.googleapis.com/google.cloud.netapp.v1.DestinationVolumeParameters"
8521 }
8522}
8523
8524/// CreateReplicationRequest creates a replication.
8525#[derive(Clone, Default, PartialEq)]
8526#[non_exhaustive]
8527pub struct CreateReplicationRequest {
8528 /// Required. The NetApp volume to create the replications of, in the format
8529 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
8530 pub parent: std::string::String,
8531
8532 /// Required. A replication resource
8533 pub replication: std::option::Option<crate::model::Replication>,
8534
8535 /// Required. ID of the replication to create. Must be unique within the parent
8536 /// resource. Must contain only letters, numbers and hyphen, with the first
8537 /// character a letter, the last a letter or a
8538 /// number, and a 63 character maximum.
8539 pub replication_id: std::string::String,
8540
8541 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8542}
8543
8544impl CreateReplicationRequest {
8545 pub fn new() -> Self {
8546 std::default::Default::default()
8547 }
8548
8549 /// Sets the value of [parent][crate::model::CreateReplicationRequest::parent].
8550 ///
8551 /// # Example
8552 /// ```ignore,no_run
8553 /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
8554 /// let x = CreateReplicationRequest::new().set_parent("example");
8555 /// ```
8556 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8557 self.parent = v.into();
8558 self
8559 }
8560
8561 /// Sets the value of [replication][crate::model::CreateReplicationRequest::replication].
8562 ///
8563 /// # Example
8564 /// ```ignore,no_run
8565 /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
8566 /// use google_cloud_netapp_v1::model::Replication;
8567 /// let x = CreateReplicationRequest::new().set_replication(Replication::default()/* use setters */);
8568 /// ```
8569 pub fn set_replication<T>(mut self, v: T) -> Self
8570 where
8571 T: std::convert::Into<crate::model::Replication>,
8572 {
8573 self.replication = std::option::Option::Some(v.into());
8574 self
8575 }
8576
8577 /// Sets or clears the value of [replication][crate::model::CreateReplicationRequest::replication].
8578 ///
8579 /// # Example
8580 /// ```ignore,no_run
8581 /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
8582 /// use google_cloud_netapp_v1::model::Replication;
8583 /// let x = CreateReplicationRequest::new().set_or_clear_replication(Some(Replication::default()/* use setters */));
8584 /// let x = CreateReplicationRequest::new().set_or_clear_replication(None::<Replication>);
8585 /// ```
8586 pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
8587 where
8588 T: std::convert::Into<crate::model::Replication>,
8589 {
8590 self.replication = v.map(|x| x.into());
8591 self
8592 }
8593
8594 /// Sets the value of [replication_id][crate::model::CreateReplicationRequest::replication_id].
8595 ///
8596 /// # Example
8597 /// ```ignore,no_run
8598 /// # use google_cloud_netapp_v1::model::CreateReplicationRequest;
8599 /// let x = CreateReplicationRequest::new().set_replication_id("example");
8600 /// ```
8601 pub fn set_replication_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8602 self.replication_id = v.into();
8603 self
8604 }
8605}
8606
8607impl wkt::message::Message for CreateReplicationRequest {
8608 fn typename() -> &'static str {
8609 "type.googleapis.com/google.cloud.netapp.v1.CreateReplicationRequest"
8610 }
8611}
8612
8613/// DeleteReplicationRequest deletes a replication.
8614#[derive(Clone, Default, PartialEq)]
8615#[non_exhaustive]
8616pub struct DeleteReplicationRequest {
8617 /// Required. The replication resource name, in the format
8618 /// `projects/*/locations/*/volumes/*/replications/{replication_id}`
8619 pub name: std::string::String,
8620
8621 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8622}
8623
8624impl DeleteReplicationRequest {
8625 pub fn new() -> Self {
8626 std::default::Default::default()
8627 }
8628
8629 /// Sets the value of [name][crate::model::DeleteReplicationRequest::name].
8630 ///
8631 /// # Example
8632 /// ```ignore,no_run
8633 /// # use google_cloud_netapp_v1::model::DeleteReplicationRequest;
8634 /// let x = DeleteReplicationRequest::new().set_name("example");
8635 /// ```
8636 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8637 self.name = v.into();
8638 self
8639 }
8640}
8641
8642impl wkt::message::Message for DeleteReplicationRequest {
8643 fn typename() -> &'static str {
8644 "type.googleapis.com/google.cloud.netapp.v1.DeleteReplicationRequest"
8645 }
8646}
8647
8648/// UpdateReplicationRequest updates description and/or labels for a replication.
8649#[derive(Clone, Default, PartialEq)]
8650#[non_exhaustive]
8651pub struct UpdateReplicationRequest {
8652 /// Required. Mask of fields to update. At least one path must be supplied in
8653 /// this field.
8654 pub update_mask: std::option::Option<wkt::FieldMask>,
8655
8656 /// Required. A replication resource
8657 pub replication: std::option::Option<crate::model::Replication>,
8658
8659 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8660}
8661
8662impl UpdateReplicationRequest {
8663 pub fn new() -> Self {
8664 std::default::Default::default()
8665 }
8666
8667 /// Sets the value of [update_mask][crate::model::UpdateReplicationRequest::update_mask].
8668 ///
8669 /// # Example
8670 /// ```ignore,no_run
8671 /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
8672 /// use wkt::FieldMask;
8673 /// let x = UpdateReplicationRequest::new().set_update_mask(FieldMask::default()/* use setters */);
8674 /// ```
8675 pub fn set_update_mask<T>(mut self, v: T) -> Self
8676 where
8677 T: std::convert::Into<wkt::FieldMask>,
8678 {
8679 self.update_mask = std::option::Option::Some(v.into());
8680 self
8681 }
8682
8683 /// Sets or clears the value of [update_mask][crate::model::UpdateReplicationRequest::update_mask].
8684 ///
8685 /// # Example
8686 /// ```ignore,no_run
8687 /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
8688 /// use wkt::FieldMask;
8689 /// let x = UpdateReplicationRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
8690 /// let x = UpdateReplicationRequest::new().set_or_clear_update_mask(None::<FieldMask>);
8691 /// ```
8692 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8693 where
8694 T: std::convert::Into<wkt::FieldMask>,
8695 {
8696 self.update_mask = v.map(|x| x.into());
8697 self
8698 }
8699
8700 /// Sets the value of [replication][crate::model::UpdateReplicationRequest::replication].
8701 ///
8702 /// # Example
8703 /// ```ignore,no_run
8704 /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
8705 /// use google_cloud_netapp_v1::model::Replication;
8706 /// let x = UpdateReplicationRequest::new().set_replication(Replication::default()/* use setters */);
8707 /// ```
8708 pub fn set_replication<T>(mut self, v: T) -> Self
8709 where
8710 T: std::convert::Into<crate::model::Replication>,
8711 {
8712 self.replication = std::option::Option::Some(v.into());
8713 self
8714 }
8715
8716 /// Sets or clears the value of [replication][crate::model::UpdateReplicationRequest::replication].
8717 ///
8718 /// # Example
8719 /// ```ignore,no_run
8720 /// # use google_cloud_netapp_v1::model::UpdateReplicationRequest;
8721 /// use google_cloud_netapp_v1::model::Replication;
8722 /// let x = UpdateReplicationRequest::new().set_or_clear_replication(Some(Replication::default()/* use setters */));
8723 /// let x = UpdateReplicationRequest::new().set_or_clear_replication(None::<Replication>);
8724 /// ```
8725 pub fn set_or_clear_replication<T>(mut self, v: std::option::Option<T>) -> Self
8726 where
8727 T: std::convert::Into<crate::model::Replication>,
8728 {
8729 self.replication = v.map(|x| x.into());
8730 self
8731 }
8732}
8733
8734impl wkt::message::Message for UpdateReplicationRequest {
8735 fn typename() -> &'static str {
8736 "type.googleapis.com/google.cloud.netapp.v1.UpdateReplicationRequest"
8737 }
8738}
8739
8740/// StopReplicationRequest stops a replication until resumed.
8741#[derive(Clone, Default, PartialEq)]
8742#[non_exhaustive]
8743pub struct StopReplicationRequest {
8744 /// Required. The resource name of the replication, in the format of
8745 /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
8746 pub name: std::string::String,
8747
8748 /// Indicates whether to stop replication forcefully while data transfer is in
8749 /// progress.
8750 /// Warning! if force is true, this will abort any current transfers
8751 /// and can lead to data loss due to partial transfer.
8752 /// If force is false, stop replication will fail while data transfer is in
8753 /// progress and you will need to retry later.
8754 pub force: bool,
8755
8756 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8757}
8758
8759impl StopReplicationRequest {
8760 pub fn new() -> Self {
8761 std::default::Default::default()
8762 }
8763
8764 /// Sets the value of [name][crate::model::StopReplicationRequest::name].
8765 ///
8766 /// # Example
8767 /// ```ignore,no_run
8768 /// # use google_cloud_netapp_v1::model::StopReplicationRequest;
8769 /// let x = StopReplicationRequest::new().set_name("example");
8770 /// ```
8771 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8772 self.name = v.into();
8773 self
8774 }
8775
8776 /// Sets the value of [force][crate::model::StopReplicationRequest::force].
8777 ///
8778 /// # Example
8779 /// ```ignore,no_run
8780 /// # use google_cloud_netapp_v1::model::StopReplicationRequest;
8781 /// let x = StopReplicationRequest::new().set_force(true);
8782 /// ```
8783 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
8784 self.force = v.into();
8785 self
8786 }
8787}
8788
8789impl wkt::message::Message for StopReplicationRequest {
8790 fn typename() -> &'static str {
8791 "type.googleapis.com/google.cloud.netapp.v1.StopReplicationRequest"
8792 }
8793}
8794
8795/// ResumeReplicationRequest resumes a stopped replication.
8796#[derive(Clone, Default, PartialEq)]
8797#[non_exhaustive]
8798pub struct ResumeReplicationRequest {
8799 /// Required. The resource name of the replication, in the format of
8800 /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
8801 pub name: std::string::String,
8802
8803 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8804}
8805
8806impl ResumeReplicationRequest {
8807 pub fn new() -> Self {
8808 std::default::Default::default()
8809 }
8810
8811 /// Sets the value of [name][crate::model::ResumeReplicationRequest::name].
8812 ///
8813 /// # Example
8814 /// ```ignore,no_run
8815 /// # use google_cloud_netapp_v1::model::ResumeReplicationRequest;
8816 /// let x = ResumeReplicationRequest::new().set_name("example");
8817 /// ```
8818 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8819 self.name = v.into();
8820 self
8821 }
8822}
8823
8824impl wkt::message::Message for ResumeReplicationRequest {
8825 fn typename() -> &'static str {
8826 "type.googleapis.com/google.cloud.netapp.v1.ResumeReplicationRequest"
8827 }
8828}
8829
8830/// ReverseReplicationDirectionRequest reverses direction of replication. Source
8831/// becomes destination and destination becomes source.
8832#[derive(Clone, Default, PartialEq)]
8833#[non_exhaustive]
8834pub struct ReverseReplicationDirectionRequest {
8835 /// Required. The resource name of the replication, in the format of
8836 /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
8837 pub name: std::string::String,
8838
8839 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8840}
8841
8842impl ReverseReplicationDirectionRequest {
8843 pub fn new() -> Self {
8844 std::default::Default::default()
8845 }
8846
8847 /// Sets the value of [name][crate::model::ReverseReplicationDirectionRequest::name].
8848 ///
8849 /// # Example
8850 /// ```ignore,no_run
8851 /// # use google_cloud_netapp_v1::model::ReverseReplicationDirectionRequest;
8852 /// let x = ReverseReplicationDirectionRequest::new().set_name("example");
8853 /// ```
8854 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8855 self.name = v.into();
8856 self
8857 }
8858}
8859
8860impl wkt::message::Message for ReverseReplicationDirectionRequest {
8861 fn typename() -> &'static str {
8862 "type.googleapis.com/google.cloud.netapp.v1.ReverseReplicationDirectionRequest"
8863 }
8864}
8865
8866/// EstablishPeeringRequest establishes cluster and svm peerings between the
8867/// source and the destination replications.
8868#[derive(Clone, Default, PartialEq)]
8869#[non_exhaustive]
8870pub struct EstablishPeeringRequest {
8871 /// Required. The resource name of the replication, in the format of
8872 /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
8873 pub name: std::string::String,
8874
8875 /// Required. Name of the user's local source cluster to be peered with the
8876 /// destination cluster.
8877 pub peer_cluster_name: std::string::String,
8878
8879 /// Required. Name of the user's local source vserver svm to be peered with the
8880 /// destination vserver svm.
8881 pub peer_svm_name: std::string::String,
8882
8883 /// Optional. List of IPv4 ip addresses to be used for peering.
8884 pub peer_ip_addresses: std::vec::Vec<std::string::String>,
8885
8886 /// Required. Name of the user's local source volume to be peered with the
8887 /// destination volume.
8888 pub peer_volume_name: std::string::String,
8889
8890 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8891}
8892
8893impl EstablishPeeringRequest {
8894 pub fn new() -> Self {
8895 std::default::Default::default()
8896 }
8897
8898 /// Sets the value of [name][crate::model::EstablishPeeringRequest::name].
8899 ///
8900 /// # Example
8901 /// ```ignore,no_run
8902 /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
8903 /// let x = EstablishPeeringRequest::new().set_name("example");
8904 /// ```
8905 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8906 self.name = v.into();
8907 self
8908 }
8909
8910 /// Sets the value of [peer_cluster_name][crate::model::EstablishPeeringRequest::peer_cluster_name].
8911 ///
8912 /// # Example
8913 /// ```ignore,no_run
8914 /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
8915 /// let x = EstablishPeeringRequest::new().set_peer_cluster_name("example");
8916 /// ```
8917 pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
8918 mut self,
8919 v: T,
8920 ) -> Self {
8921 self.peer_cluster_name = v.into();
8922 self
8923 }
8924
8925 /// Sets the value of [peer_svm_name][crate::model::EstablishPeeringRequest::peer_svm_name].
8926 ///
8927 /// # Example
8928 /// ```ignore,no_run
8929 /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
8930 /// let x = EstablishPeeringRequest::new().set_peer_svm_name("example");
8931 /// ```
8932 pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8933 self.peer_svm_name = v.into();
8934 self
8935 }
8936
8937 /// Sets the value of [peer_ip_addresses][crate::model::EstablishPeeringRequest::peer_ip_addresses].
8938 ///
8939 /// # Example
8940 /// ```ignore,no_run
8941 /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
8942 /// let x = EstablishPeeringRequest::new().set_peer_ip_addresses(["a", "b", "c"]);
8943 /// ```
8944 pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
8945 where
8946 T: std::iter::IntoIterator<Item = V>,
8947 V: std::convert::Into<std::string::String>,
8948 {
8949 use std::iter::Iterator;
8950 self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
8951 self
8952 }
8953
8954 /// Sets the value of [peer_volume_name][crate::model::EstablishPeeringRequest::peer_volume_name].
8955 ///
8956 /// # Example
8957 /// ```ignore,no_run
8958 /// # use google_cloud_netapp_v1::model::EstablishPeeringRequest;
8959 /// let x = EstablishPeeringRequest::new().set_peer_volume_name("example");
8960 /// ```
8961 pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
8962 mut self,
8963 v: T,
8964 ) -> Self {
8965 self.peer_volume_name = v.into();
8966 self
8967 }
8968}
8969
8970impl wkt::message::Message for EstablishPeeringRequest {
8971 fn typename() -> &'static str {
8972 "type.googleapis.com/google.cloud.netapp.v1.EstablishPeeringRequest"
8973 }
8974}
8975
8976/// SyncReplicationRequest syncs the replication from source to destination.
8977#[derive(Clone, Default, PartialEq)]
8978#[non_exhaustive]
8979pub struct SyncReplicationRequest {
8980 /// Required. The resource name of the replication, in the format of
8981 /// projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{replication_id}.
8982 pub name: std::string::String,
8983
8984 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8985}
8986
8987impl SyncReplicationRequest {
8988 pub fn new() -> Self {
8989 std::default::Default::default()
8990 }
8991
8992 /// Sets the value of [name][crate::model::SyncReplicationRequest::name].
8993 ///
8994 /// # Example
8995 /// ```ignore,no_run
8996 /// # use google_cloud_netapp_v1::model::SyncReplicationRequest;
8997 /// let x = SyncReplicationRequest::new().set_name("example");
8998 /// ```
8999 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9000 self.name = v.into();
9001 self
9002 }
9003}
9004
9005impl wkt::message::Message for SyncReplicationRequest {
9006 fn typename() -> &'static str {
9007 "type.googleapis.com/google.cloud.netapp.v1.SyncReplicationRequest"
9008 }
9009}
9010
9011/// ListSnapshotsRequest lists snapshots.
9012#[derive(Clone, Default, PartialEq)]
9013#[non_exhaustive]
9014pub struct ListSnapshotsRequest {
9015 /// Required. The volume for which to retrieve snapshot information,
9016 /// in the format
9017 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`.
9018 pub parent: std::string::String,
9019
9020 /// The maximum number of items to return.
9021 pub page_size: i32,
9022
9023 /// The next_page_token value to use if there are additional
9024 /// results to retrieve for this list request.
9025 pub page_token: std::string::String,
9026
9027 /// Sort results. Supported values are "name", "name desc" or "" (unsorted).
9028 pub order_by: std::string::String,
9029
9030 /// List filter.
9031 pub filter: std::string::String,
9032
9033 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9034}
9035
9036impl ListSnapshotsRequest {
9037 pub fn new() -> Self {
9038 std::default::Default::default()
9039 }
9040
9041 /// Sets the value of [parent][crate::model::ListSnapshotsRequest::parent].
9042 ///
9043 /// # Example
9044 /// ```ignore,no_run
9045 /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
9046 /// let x = ListSnapshotsRequest::new().set_parent("example");
9047 /// ```
9048 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9049 self.parent = v.into();
9050 self
9051 }
9052
9053 /// Sets the value of [page_size][crate::model::ListSnapshotsRequest::page_size].
9054 ///
9055 /// # Example
9056 /// ```ignore,no_run
9057 /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
9058 /// let x = ListSnapshotsRequest::new().set_page_size(42);
9059 /// ```
9060 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9061 self.page_size = v.into();
9062 self
9063 }
9064
9065 /// Sets the value of [page_token][crate::model::ListSnapshotsRequest::page_token].
9066 ///
9067 /// # Example
9068 /// ```ignore,no_run
9069 /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
9070 /// let x = ListSnapshotsRequest::new().set_page_token("example");
9071 /// ```
9072 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9073 self.page_token = v.into();
9074 self
9075 }
9076
9077 /// Sets the value of [order_by][crate::model::ListSnapshotsRequest::order_by].
9078 ///
9079 /// # Example
9080 /// ```ignore,no_run
9081 /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
9082 /// let x = ListSnapshotsRequest::new().set_order_by("example");
9083 /// ```
9084 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9085 self.order_by = v.into();
9086 self
9087 }
9088
9089 /// Sets the value of [filter][crate::model::ListSnapshotsRequest::filter].
9090 ///
9091 /// # Example
9092 /// ```ignore,no_run
9093 /// # use google_cloud_netapp_v1::model::ListSnapshotsRequest;
9094 /// let x = ListSnapshotsRequest::new().set_filter("example");
9095 /// ```
9096 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9097 self.filter = v.into();
9098 self
9099 }
9100}
9101
9102impl wkt::message::Message for ListSnapshotsRequest {
9103 fn typename() -> &'static str {
9104 "type.googleapis.com/google.cloud.netapp.v1.ListSnapshotsRequest"
9105 }
9106}
9107
9108/// ListSnapshotsResponse is the result of ListSnapshotsRequest.
9109#[derive(Clone, Default, PartialEq)]
9110#[non_exhaustive]
9111pub struct ListSnapshotsResponse {
9112 /// A list of snapshots in the project for the specified volume.
9113 pub snapshots: std::vec::Vec<crate::model::Snapshot>,
9114
9115 /// The token you can use to retrieve the next page of results. Not returned
9116 /// if there are no more results in the list.
9117 pub next_page_token: std::string::String,
9118
9119 /// Locations that could not be reached.
9120 pub unreachable: std::vec::Vec<std::string::String>,
9121
9122 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9123}
9124
9125impl ListSnapshotsResponse {
9126 pub fn new() -> Self {
9127 std::default::Default::default()
9128 }
9129
9130 /// Sets the value of [snapshots][crate::model::ListSnapshotsResponse::snapshots].
9131 ///
9132 /// # Example
9133 /// ```ignore,no_run
9134 /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
9135 /// use google_cloud_netapp_v1::model::Snapshot;
9136 /// let x = ListSnapshotsResponse::new()
9137 /// .set_snapshots([
9138 /// Snapshot::default()/* use setters */,
9139 /// Snapshot::default()/* use (different) setters */,
9140 /// ]);
9141 /// ```
9142 pub fn set_snapshots<T, V>(mut self, v: T) -> Self
9143 where
9144 T: std::iter::IntoIterator<Item = V>,
9145 V: std::convert::Into<crate::model::Snapshot>,
9146 {
9147 use std::iter::Iterator;
9148 self.snapshots = v.into_iter().map(|i| i.into()).collect();
9149 self
9150 }
9151
9152 /// Sets the value of [next_page_token][crate::model::ListSnapshotsResponse::next_page_token].
9153 ///
9154 /// # Example
9155 /// ```ignore,no_run
9156 /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
9157 /// let x = ListSnapshotsResponse::new().set_next_page_token("example");
9158 /// ```
9159 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9160 self.next_page_token = v.into();
9161 self
9162 }
9163
9164 /// Sets the value of [unreachable][crate::model::ListSnapshotsResponse::unreachable].
9165 ///
9166 /// # Example
9167 /// ```ignore,no_run
9168 /// # use google_cloud_netapp_v1::model::ListSnapshotsResponse;
9169 /// let x = ListSnapshotsResponse::new().set_unreachable(["a", "b", "c"]);
9170 /// ```
9171 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9172 where
9173 T: std::iter::IntoIterator<Item = V>,
9174 V: std::convert::Into<std::string::String>,
9175 {
9176 use std::iter::Iterator;
9177 self.unreachable = v.into_iter().map(|i| i.into()).collect();
9178 self
9179 }
9180}
9181
9182impl wkt::message::Message for ListSnapshotsResponse {
9183 fn typename() -> &'static str {
9184 "type.googleapis.com/google.cloud.netapp.v1.ListSnapshotsResponse"
9185 }
9186}
9187
9188#[doc(hidden)]
9189impl gax::paginator::internal::PageableResponse for ListSnapshotsResponse {
9190 type PageItem = crate::model::Snapshot;
9191
9192 fn items(self) -> std::vec::Vec<Self::PageItem> {
9193 self.snapshots
9194 }
9195
9196 fn next_page_token(&self) -> std::string::String {
9197 use std::clone::Clone;
9198 self.next_page_token.clone()
9199 }
9200}
9201
9202/// GetSnapshotRequest gets the state of a snapshot.
9203#[derive(Clone, Default, PartialEq)]
9204#[non_exhaustive]
9205pub struct GetSnapshotRequest {
9206 /// Required. The snapshot resource name, in the format
9207 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`
9208 pub name: std::string::String,
9209
9210 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9211}
9212
9213impl GetSnapshotRequest {
9214 pub fn new() -> Self {
9215 std::default::Default::default()
9216 }
9217
9218 /// Sets the value of [name][crate::model::GetSnapshotRequest::name].
9219 ///
9220 /// # Example
9221 /// ```ignore,no_run
9222 /// # use google_cloud_netapp_v1::model::GetSnapshotRequest;
9223 /// let x = GetSnapshotRequest::new().set_name("example");
9224 /// ```
9225 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9226 self.name = v.into();
9227 self
9228 }
9229}
9230
9231impl wkt::message::Message for GetSnapshotRequest {
9232 fn typename() -> &'static str {
9233 "type.googleapis.com/google.cloud.netapp.v1.GetSnapshotRequest"
9234 }
9235}
9236
9237/// CreateSnapshotRequest creates a snapshot.
9238#[derive(Clone, Default, PartialEq)]
9239#[non_exhaustive]
9240pub struct CreateSnapshotRequest {
9241 /// Required. The NetApp volume to create the snapshots of, in the format
9242 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}`
9243 pub parent: std::string::String,
9244
9245 /// Required. A snapshot resource
9246 pub snapshot: std::option::Option<crate::model::Snapshot>,
9247
9248 /// Required. ID of the snapshot to create. Must be unique within the parent
9249 /// resource. Must contain only letters, numbers and hyphen, with the first
9250 /// character a letter, the last a letter or a
9251 /// number, and a 63 character maximum.
9252 pub snapshot_id: std::string::String,
9253
9254 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9255}
9256
9257impl CreateSnapshotRequest {
9258 pub fn new() -> Self {
9259 std::default::Default::default()
9260 }
9261
9262 /// Sets the value of [parent][crate::model::CreateSnapshotRequest::parent].
9263 ///
9264 /// # Example
9265 /// ```ignore,no_run
9266 /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
9267 /// let x = CreateSnapshotRequest::new().set_parent("example");
9268 /// ```
9269 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9270 self.parent = v.into();
9271 self
9272 }
9273
9274 /// Sets the value of [snapshot][crate::model::CreateSnapshotRequest::snapshot].
9275 ///
9276 /// # Example
9277 /// ```ignore,no_run
9278 /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
9279 /// use google_cloud_netapp_v1::model::Snapshot;
9280 /// let x = CreateSnapshotRequest::new().set_snapshot(Snapshot::default()/* use setters */);
9281 /// ```
9282 pub fn set_snapshot<T>(mut self, v: T) -> Self
9283 where
9284 T: std::convert::Into<crate::model::Snapshot>,
9285 {
9286 self.snapshot = std::option::Option::Some(v.into());
9287 self
9288 }
9289
9290 /// Sets or clears the value of [snapshot][crate::model::CreateSnapshotRequest::snapshot].
9291 ///
9292 /// # Example
9293 /// ```ignore,no_run
9294 /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
9295 /// use google_cloud_netapp_v1::model::Snapshot;
9296 /// let x = CreateSnapshotRequest::new().set_or_clear_snapshot(Some(Snapshot::default()/* use setters */));
9297 /// let x = CreateSnapshotRequest::new().set_or_clear_snapshot(None::<Snapshot>);
9298 /// ```
9299 pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
9300 where
9301 T: std::convert::Into<crate::model::Snapshot>,
9302 {
9303 self.snapshot = v.map(|x| x.into());
9304 self
9305 }
9306
9307 /// Sets the value of [snapshot_id][crate::model::CreateSnapshotRequest::snapshot_id].
9308 ///
9309 /// # Example
9310 /// ```ignore,no_run
9311 /// # use google_cloud_netapp_v1::model::CreateSnapshotRequest;
9312 /// let x = CreateSnapshotRequest::new().set_snapshot_id("example");
9313 /// ```
9314 pub fn set_snapshot_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9315 self.snapshot_id = v.into();
9316 self
9317 }
9318}
9319
9320impl wkt::message::Message for CreateSnapshotRequest {
9321 fn typename() -> &'static str {
9322 "type.googleapis.com/google.cloud.netapp.v1.CreateSnapshotRequest"
9323 }
9324}
9325
9326/// DeleteSnapshotRequest deletes a snapshot.
9327#[derive(Clone, Default, PartialEq)]
9328#[non_exhaustive]
9329pub struct DeleteSnapshotRequest {
9330 /// Required. The snapshot resource name, in the format
9331 /// `projects/*/locations/*/volumes/*/snapshots/{snapshot_id}`
9332 pub name: std::string::String,
9333
9334 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9335}
9336
9337impl DeleteSnapshotRequest {
9338 pub fn new() -> Self {
9339 std::default::Default::default()
9340 }
9341
9342 /// Sets the value of [name][crate::model::DeleteSnapshotRequest::name].
9343 ///
9344 /// # Example
9345 /// ```ignore,no_run
9346 /// # use google_cloud_netapp_v1::model::DeleteSnapshotRequest;
9347 /// let x = DeleteSnapshotRequest::new().set_name("example");
9348 /// ```
9349 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9350 self.name = v.into();
9351 self
9352 }
9353}
9354
9355impl wkt::message::Message for DeleteSnapshotRequest {
9356 fn typename() -> &'static str {
9357 "type.googleapis.com/google.cloud.netapp.v1.DeleteSnapshotRequest"
9358 }
9359}
9360
9361/// UpdateSnapshotRequest updates description and/or labels for a snapshot.
9362#[derive(Clone, Default, PartialEq)]
9363#[non_exhaustive]
9364pub struct UpdateSnapshotRequest {
9365 /// Required. Mask of fields to update. At least one path must be supplied in
9366 /// this field.
9367 pub update_mask: std::option::Option<wkt::FieldMask>,
9368
9369 /// Required. A snapshot resource
9370 pub snapshot: std::option::Option<crate::model::Snapshot>,
9371
9372 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9373}
9374
9375impl UpdateSnapshotRequest {
9376 pub fn new() -> Self {
9377 std::default::Default::default()
9378 }
9379
9380 /// Sets the value of [update_mask][crate::model::UpdateSnapshotRequest::update_mask].
9381 ///
9382 /// # Example
9383 /// ```ignore,no_run
9384 /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
9385 /// use wkt::FieldMask;
9386 /// let x = UpdateSnapshotRequest::new().set_update_mask(FieldMask::default()/* use setters */);
9387 /// ```
9388 pub fn set_update_mask<T>(mut self, v: T) -> Self
9389 where
9390 T: std::convert::Into<wkt::FieldMask>,
9391 {
9392 self.update_mask = std::option::Option::Some(v.into());
9393 self
9394 }
9395
9396 /// Sets or clears the value of [update_mask][crate::model::UpdateSnapshotRequest::update_mask].
9397 ///
9398 /// # Example
9399 /// ```ignore,no_run
9400 /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
9401 /// use wkt::FieldMask;
9402 /// let x = UpdateSnapshotRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
9403 /// let x = UpdateSnapshotRequest::new().set_or_clear_update_mask(None::<FieldMask>);
9404 /// ```
9405 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9406 where
9407 T: std::convert::Into<wkt::FieldMask>,
9408 {
9409 self.update_mask = v.map(|x| x.into());
9410 self
9411 }
9412
9413 /// Sets the value of [snapshot][crate::model::UpdateSnapshotRequest::snapshot].
9414 ///
9415 /// # Example
9416 /// ```ignore,no_run
9417 /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
9418 /// use google_cloud_netapp_v1::model::Snapshot;
9419 /// let x = UpdateSnapshotRequest::new().set_snapshot(Snapshot::default()/* use setters */);
9420 /// ```
9421 pub fn set_snapshot<T>(mut self, v: T) -> Self
9422 where
9423 T: std::convert::Into<crate::model::Snapshot>,
9424 {
9425 self.snapshot = std::option::Option::Some(v.into());
9426 self
9427 }
9428
9429 /// Sets or clears the value of [snapshot][crate::model::UpdateSnapshotRequest::snapshot].
9430 ///
9431 /// # Example
9432 /// ```ignore,no_run
9433 /// # use google_cloud_netapp_v1::model::UpdateSnapshotRequest;
9434 /// use google_cloud_netapp_v1::model::Snapshot;
9435 /// let x = UpdateSnapshotRequest::new().set_or_clear_snapshot(Some(Snapshot::default()/* use setters */));
9436 /// let x = UpdateSnapshotRequest::new().set_or_clear_snapshot(None::<Snapshot>);
9437 /// ```
9438 pub fn set_or_clear_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
9439 where
9440 T: std::convert::Into<crate::model::Snapshot>,
9441 {
9442 self.snapshot = v.map(|x| x.into());
9443 self
9444 }
9445}
9446
9447impl wkt::message::Message for UpdateSnapshotRequest {
9448 fn typename() -> &'static str {
9449 "type.googleapis.com/google.cloud.netapp.v1.UpdateSnapshotRequest"
9450 }
9451}
9452
9453/// Snapshot is a point-in-time version of a Volume's content.
9454#[derive(Clone, Default, PartialEq)]
9455#[non_exhaustive]
9456pub struct Snapshot {
9457 /// Identifier. The resource name of the snapshot.
9458 /// Format:
9459 /// `projects/{project_id}/locations/{location}/volumes/{volume_id}/snapshots/{snapshot_id}`.
9460 pub name: std::string::String,
9461
9462 /// Output only. The snapshot state.
9463 pub state: crate::model::snapshot::State,
9464
9465 /// Output only. State details of the storage pool
9466 pub state_details: std::string::String,
9467
9468 /// A description of the snapshot with 2048 characters or less.
9469 /// Requests with longer descriptions will be rejected.
9470 pub description: std::string::String,
9471
9472 /// Output only. Current storage usage for the snapshot in bytes.
9473 pub used_bytes: f64,
9474
9475 /// Output only. The time when the snapshot was created.
9476 pub create_time: std::option::Option<wkt::Timestamp>,
9477
9478 /// Resource labels to represent user provided metadata.
9479 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
9480
9481 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9482}
9483
9484impl Snapshot {
9485 pub fn new() -> Self {
9486 std::default::Default::default()
9487 }
9488
9489 /// Sets the value of [name][crate::model::Snapshot::name].
9490 ///
9491 /// # Example
9492 /// ```ignore,no_run
9493 /// # use google_cloud_netapp_v1::model::Snapshot;
9494 /// let x = Snapshot::new().set_name("example");
9495 /// ```
9496 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9497 self.name = v.into();
9498 self
9499 }
9500
9501 /// Sets the value of [state][crate::model::Snapshot::state].
9502 ///
9503 /// # Example
9504 /// ```ignore,no_run
9505 /// # use google_cloud_netapp_v1::model::Snapshot;
9506 /// use google_cloud_netapp_v1::model::snapshot::State;
9507 /// let x0 = Snapshot::new().set_state(State::Ready);
9508 /// let x1 = Snapshot::new().set_state(State::Creating);
9509 /// let x2 = Snapshot::new().set_state(State::Deleting);
9510 /// ```
9511 pub fn set_state<T: std::convert::Into<crate::model::snapshot::State>>(mut self, v: T) -> Self {
9512 self.state = v.into();
9513 self
9514 }
9515
9516 /// Sets the value of [state_details][crate::model::Snapshot::state_details].
9517 ///
9518 /// # Example
9519 /// ```ignore,no_run
9520 /// # use google_cloud_netapp_v1::model::Snapshot;
9521 /// let x = Snapshot::new().set_state_details("example");
9522 /// ```
9523 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9524 self.state_details = v.into();
9525 self
9526 }
9527
9528 /// Sets the value of [description][crate::model::Snapshot::description].
9529 ///
9530 /// # Example
9531 /// ```ignore,no_run
9532 /// # use google_cloud_netapp_v1::model::Snapshot;
9533 /// let x = Snapshot::new().set_description("example");
9534 /// ```
9535 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9536 self.description = v.into();
9537 self
9538 }
9539
9540 /// Sets the value of [used_bytes][crate::model::Snapshot::used_bytes].
9541 ///
9542 /// # Example
9543 /// ```ignore,no_run
9544 /// # use google_cloud_netapp_v1::model::Snapshot;
9545 /// let x = Snapshot::new().set_used_bytes(42.0);
9546 /// ```
9547 pub fn set_used_bytes<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
9548 self.used_bytes = v.into();
9549 self
9550 }
9551
9552 /// Sets the value of [create_time][crate::model::Snapshot::create_time].
9553 ///
9554 /// # Example
9555 /// ```ignore,no_run
9556 /// # use google_cloud_netapp_v1::model::Snapshot;
9557 /// use wkt::Timestamp;
9558 /// let x = Snapshot::new().set_create_time(Timestamp::default()/* use setters */);
9559 /// ```
9560 pub fn set_create_time<T>(mut self, v: T) -> Self
9561 where
9562 T: std::convert::Into<wkt::Timestamp>,
9563 {
9564 self.create_time = std::option::Option::Some(v.into());
9565 self
9566 }
9567
9568 /// Sets or clears the value of [create_time][crate::model::Snapshot::create_time].
9569 ///
9570 /// # Example
9571 /// ```ignore,no_run
9572 /// # use google_cloud_netapp_v1::model::Snapshot;
9573 /// use wkt::Timestamp;
9574 /// let x = Snapshot::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
9575 /// let x = Snapshot::new().set_or_clear_create_time(None::<Timestamp>);
9576 /// ```
9577 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
9578 where
9579 T: std::convert::Into<wkt::Timestamp>,
9580 {
9581 self.create_time = v.map(|x| x.into());
9582 self
9583 }
9584
9585 /// Sets the value of [labels][crate::model::Snapshot::labels].
9586 ///
9587 /// # Example
9588 /// ```ignore,no_run
9589 /// # use google_cloud_netapp_v1::model::Snapshot;
9590 /// let x = Snapshot::new().set_labels([
9591 /// ("key0", "abc"),
9592 /// ("key1", "xyz"),
9593 /// ]);
9594 /// ```
9595 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
9596 where
9597 T: std::iter::IntoIterator<Item = (K, V)>,
9598 K: std::convert::Into<std::string::String>,
9599 V: std::convert::Into<std::string::String>,
9600 {
9601 use std::iter::Iterator;
9602 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
9603 self
9604 }
9605}
9606
9607impl wkt::message::Message for Snapshot {
9608 fn typename() -> &'static str {
9609 "type.googleapis.com/google.cloud.netapp.v1.Snapshot"
9610 }
9611}
9612
9613/// Defines additional types related to [Snapshot].
9614pub mod snapshot {
9615 #[allow(unused_imports)]
9616 use super::*;
9617
9618 /// The Snapshot States
9619 ///
9620 /// # Working with unknown values
9621 ///
9622 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9623 /// additional enum variants at any time. Adding new variants is not considered
9624 /// a breaking change. Applications should write their code in anticipation of:
9625 ///
9626 /// - New values appearing in future releases of the client library, **and**
9627 /// - New values received dynamically, without application changes.
9628 ///
9629 /// Please consult the [Working with enums] section in the user guide for some
9630 /// guidelines.
9631 ///
9632 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9633 #[derive(Clone, Debug, PartialEq)]
9634 #[non_exhaustive]
9635 pub enum State {
9636 /// Unspecified Snapshot State
9637 Unspecified,
9638 /// Snapshot State is Ready
9639 Ready,
9640 /// Snapshot State is Creating
9641 Creating,
9642 /// Snapshot State is Deleting
9643 Deleting,
9644 /// Snapshot State is Updating
9645 Updating,
9646 /// Snapshot State is Disabled
9647 Disabled,
9648 /// Snapshot State is Error
9649 Error,
9650 /// If set, the enum was initialized with an unknown value.
9651 ///
9652 /// Applications can examine the value using [State::value] or
9653 /// [State::name].
9654 UnknownValue(state::UnknownValue),
9655 }
9656
9657 #[doc(hidden)]
9658 pub mod state {
9659 #[allow(unused_imports)]
9660 use super::*;
9661 #[derive(Clone, Debug, PartialEq)]
9662 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9663 }
9664
9665 impl State {
9666 /// Gets the enum value.
9667 ///
9668 /// Returns `None` if the enum contains an unknown value deserialized from
9669 /// the string representation of enums.
9670 pub fn value(&self) -> std::option::Option<i32> {
9671 match self {
9672 Self::Unspecified => std::option::Option::Some(0),
9673 Self::Ready => std::option::Option::Some(1),
9674 Self::Creating => std::option::Option::Some(2),
9675 Self::Deleting => std::option::Option::Some(3),
9676 Self::Updating => std::option::Option::Some(4),
9677 Self::Disabled => std::option::Option::Some(5),
9678 Self::Error => std::option::Option::Some(6),
9679 Self::UnknownValue(u) => u.0.value(),
9680 }
9681 }
9682
9683 /// Gets the enum value as a string.
9684 ///
9685 /// Returns `None` if the enum contains an unknown value deserialized from
9686 /// the integer representation of enums.
9687 pub fn name(&self) -> std::option::Option<&str> {
9688 match self {
9689 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
9690 Self::Ready => std::option::Option::Some("READY"),
9691 Self::Creating => std::option::Option::Some("CREATING"),
9692 Self::Deleting => std::option::Option::Some("DELETING"),
9693 Self::Updating => std::option::Option::Some("UPDATING"),
9694 Self::Disabled => std::option::Option::Some("DISABLED"),
9695 Self::Error => std::option::Option::Some("ERROR"),
9696 Self::UnknownValue(u) => u.0.name(),
9697 }
9698 }
9699 }
9700
9701 impl std::default::Default for State {
9702 fn default() -> Self {
9703 use std::convert::From;
9704 Self::from(0)
9705 }
9706 }
9707
9708 impl std::fmt::Display for State {
9709 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9710 wkt::internal::display_enum(f, self.name(), self.value())
9711 }
9712 }
9713
9714 impl std::convert::From<i32> for State {
9715 fn from(value: i32) -> Self {
9716 match value {
9717 0 => Self::Unspecified,
9718 1 => Self::Ready,
9719 2 => Self::Creating,
9720 3 => Self::Deleting,
9721 4 => Self::Updating,
9722 5 => Self::Disabled,
9723 6 => Self::Error,
9724 _ => Self::UnknownValue(state::UnknownValue(
9725 wkt::internal::UnknownEnumValue::Integer(value),
9726 )),
9727 }
9728 }
9729 }
9730
9731 impl std::convert::From<&str> for State {
9732 fn from(value: &str) -> Self {
9733 use std::string::ToString;
9734 match value {
9735 "STATE_UNSPECIFIED" => Self::Unspecified,
9736 "READY" => Self::Ready,
9737 "CREATING" => Self::Creating,
9738 "DELETING" => Self::Deleting,
9739 "UPDATING" => Self::Updating,
9740 "DISABLED" => Self::Disabled,
9741 "ERROR" => Self::Error,
9742 _ => Self::UnknownValue(state::UnknownValue(
9743 wkt::internal::UnknownEnumValue::String(value.to_string()),
9744 )),
9745 }
9746 }
9747 }
9748
9749 impl serde::ser::Serialize for State {
9750 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9751 where
9752 S: serde::Serializer,
9753 {
9754 match self {
9755 Self::Unspecified => serializer.serialize_i32(0),
9756 Self::Ready => serializer.serialize_i32(1),
9757 Self::Creating => serializer.serialize_i32(2),
9758 Self::Deleting => serializer.serialize_i32(3),
9759 Self::Updating => serializer.serialize_i32(4),
9760 Self::Disabled => serializer.serialize_i32(5),
9761 Self::Error => serializer.serialize_i32(6),
9762 Self::UnknownValue(u) => u.0.serialize(serializer),
9763 }
9764 }
9765 }
9766
9767 impl<'de> serde::de::Deserialize<'de> for State {
9768 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9769 where
9770 D: serde::Deserializer<'de>,
9771 {
9772 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
9773 ".google.cloud.netapp.v1.Snapshot.State",
9774 ))
9775 }
9776 }
9777}
9778
9779/// GetStoragePoolRequest gets a Storage Pool.
9780#[derive(Clone, Default, PartialEq)]
9781#[non_exhaustive]
9782pub struct GetStoragePoolRequest {
9783 /// Required. Name of the storage pool
9784 pub name: std::string::String,
9785
9786 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9787}
9788
9789impl GetStoragePoolRequest {
9790 pub fn new() -> Self {
9791 std::default::Default::default()
9792 }
9793
9794 /// Sets the value of [name][crate::model::GetStoragePoolRequest::name].
9795 ///
9796 /// # Example
9797 /// ```ignore,no_run
9798 /// # use google_cloud_netapp_v1::model::GetStoragePoolRequest;
9799 /// let x = GetStoragePoolRequest::new().set_name("example");
9800 /// ```
9801 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9802 self.name = v.into();
9803 self
9804 }
9805}
9806
9807impl wkt::message::Message for GetStoragePoolRequest {
9808 fn typename() -> &'static str {
9809 "type.googleapis.com/google.cloud.netapp.v1.GetStoragePoolRequest"
9810 }
9811}
9812
9813/// ListStoragePoolsRequest lists Storage Pools.
9814#[derive(Clone, Default, PartialEq)]
9815#[non_exhaustive]
9816pub struct ListStoragePoolsRequest {
9817 /// Required. Parent value
9818 pub parent: std::string::String,
9819
9820 /// Optional. The maximum number of items to return.
9821 pub page_size: i32,
9822
9823 /// Optional. The next_page_token value to use if there are additional
9824 /// results to retrieve for this list request.
9825 pub page_token: std::string::String,
9826
9827 /// Optional. Sort results. Supported values are "name", "name desc" or ""
9828 /// (unsorted).
9829 pub order_by: std::string::String,
9830
9831 /// Optional. List filter.
9832 pub filter: std::string::String,
9833
9834 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9835}
9836
9837impl ListStoragePoolsRequest {
9838 pub fn new() -> Self {
9839 std::default::Default::default()
9840 }
9841
9842 /// Sets the value of [parent][crate::model::ListStoragePoolsRequest::parent].
9843 ///
9844 /// # Example
9845 /// ```ignore,no_run
9846 /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
9847 /// let x = ListStoragePoolsRequest::new().set_parent("example");
9848 /// ```
9849 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9850 self.parent = v.into();
9851 self
9852 }
9853
9854 /// Sets the value of [page_size][crate::model::ListStoragePoolsRequest::page_size].
9855 ///
9856 /// # Example
9857 /// ```ignore,no_run
9858 /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
9859 /// let x = ListStoragePoolsRequest::new().set_page_size(42);
9860 /// ```
9861 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
9862 self.page_size = v.into();
9863 self
9864 }
9865
9866 /// Sets the value of [page_token][crate::model::ListStoragePoolsRequest::page_token].
9867 ///
9868 /// # Example
9869 /// ```ignore,no_run
9870 /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
9871 /// let x = ListStoragePoolsRequest::new().set_page_token("example");
9872 /// ```
9873 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9874 self.page_token = v.into();
9875 self
9876 }
9877
9878 /// Sets the value of [order_by][crate::model::ListStoragePoolsRequest::order_by].
9879 ///
9880 /// # Example
9881 /// ```ignore,no_run
9882 /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
9883 /// let x = ListStoragePoolsRequest::new().set_order_by("example");
9884 /// ```
9885 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9886 self.order_by = v.into();
9887 self
9888 }
9889
9890 /// Sets the value of [filter][crate::model::ListStoragePoolsRequest::filter].
9891 ///
9892 /// # Example
9893 /// ```ignore,no_run
9894 /// # use google_cloud_netapp_v1::model::ListStoragePoolsRequest;
9895 /// let x = ListStoragePoolsRequest::new().set_filter("example");
9896 /// ```
9897 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9898 self.filter = v.into();
9899 self
9900 }
9901}
9902
9903impl wkt::message::Message for ListStoragePoolsRequest {
9904 fn typename() -> &'static str {
9905 "type.googleapis.com/google.cloud.netapp.v1.ListStoragePoolsRequest"
9906 }
9907}
9908
9909/// ListStoragePoolsResponse is the response to a ListStoragePoolsRequest.
9910#[derive(Clone, Default, PartialEq)]
9911#[non_exhaustive]
9912pub struct ListStoragePoolsResponse {
9913 /// The list of StoragePools
9914 pub storage_pools: std::vec::Vec<crate::model::StoragePool>,
9915
9916 /// A token identifying a page of results the server should return.
9917 pub next_page_token: std::string::String,
9918
9919 /// Locations that could not be reached.
9920 pub unreachable: std::vec::Vec<std::string::String>,
9921
9922 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9923}
9924
9925impl ListStoragePoolsResponse {
9926 pub fn new() -> Self {
9927 std::default::Default::default()
9928 }
9929
9930 /// Sets the value of [storage_pools][crate::model::ListStoragePoolsResponse::storage_pools].
9931 ///
9932 /// # Example
9933 /// ```ignore,no_run
9934 /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
9935 /// use google_cloud_netapp_v1::model::StoragePool;
9936 /// let x = ListStoragePoolsResponse::new()
9937 /// .set_storage_pools([
9938 /// StoragePool::default()/* use setters */,
9939 /// StoragePool::default()/* use (different) setters */,
9940 /// ]);
9941 /// ```
9942 pub fn set_storage_pools<T, V>(mut self, v: T) -> Self
9943 where
9944 T: std::iter::IntoIterator<Item = V>,
9945 V: std::convert::Into<crate::model::StoragePool>,
9946 {
9947 use std::iter::Iterator;
9948 self.storage_pools = v.into_iter().map(|i| i.into()).collect();
9949 self
9950 }
9951
9952 /// Sets the value of [next_page_token][crate::model::ListStoragePoolsResponse::next_page_token].
9953 ///
9954 /// # Example
9955 /// ```ignore,no_run
9956 /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
9957 /// let x = ListStoragePoolsResponse::new().set_next_page_token("example");
9958 /// ```
9959 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9960 self.next_page_token = v.into();
9961 self
9962 }
9963
9964 /// Sets the value of [unreachable][crate::model::ListStoragePoolsResponse::unreachable].
9965 ///
9966 /// # Example
9967 /// ```ignore,no_run
9968 /// # use google_cloud_netapp_v1::model::ListStoragePoolsResponse;
9969 /// let x = ListStoragePoolsResponse::new().set_unreachable(["a", "b", "c"]);
9970 /// ```
9971 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
9972 where
9973 T: std::iter::IntoIterator<Item = V>,
9974 V: std::convert::Into<std::string::String>,
9975 {
9976 use std::iter::Iterator;
9977 self.unreachable = v.into_iter().map(|i| i.into()).collect();
9978 self
9979 }
9980}
9981
9982impl wkt::message::Message for ListStoragePoolsResponse {
9983 fn typename() -> &'static str {
9984 "type.googleapis.com/google.cloud.netapp.v1.ListStoragePoolsResponse"
9985 }
9986}
9987
9988#[doc(hidden)]
9989impl gax::paginator::internal::PageableResponse for ListStoragePoolsResponse {
9990 type PageItem = crate::model::StoragePool;
9991
9992 fn items(self) -> std::vec::Vec<Self::PageItem> {
9993 self.storage_pools
9994 }
9995
9996 fn next_page_token(&self) -> std::string::String {
9997 use std::clone::Clone;
9998 self.next_page_token.clone()
9999 }
10000}
10001
10002/// CreateStoragePoolRequest creates a Storage Pool.
10003#[derive(Clone, Default, PartialEq)]
10004#[non_exhaustive]
10005pub struct CreateStoragePoolRequest {
10006 /// Required. Value for parent.
10007 pub parent: std::string::String,
10008
10009 /// Required. Id of the requesting storage pool. Must be unique within the
10010 /// parent resource. Must contain only letters, numbers and hyphen, with the
10011 /// first character a letter, the last a letter or a number, and a 63 character
10012 /// maximum.
10013 pub storage_pool_id: std::string::String,
10014
10015 /// Required. The required parameters to create a new storage pool.
10016 pub storage_pool: std::option::Option<crate::model::StoragePool>,
10017
10018 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10019}
10020
10021impl CreateStoragePoolRequest {
10022 pub fn new() -> Self {
10023 std::default::Default::default()
10024 }
10025
10026 /// Sets the value of [parent][crate::model::CreateStoragePoolRequest::parent].
10027 ///
10028 /// # Example
10029 /// ```ignore,no_run
10030 /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
10031 /// let x = CreateStoragePoolRequest::new().set_parent("example");
10032 /// ```
10033 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10034 self.parent = v.into();
10035 self
10036 }
10037
10038 /// Sets the value of [storage_pool_id][crate::model::CreateStoragePoolRequest::storage_pool_id].
10039 ///
10040 /// # Example
10041 /// ```ignore,no_run
10042 /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
10043 /// let x = CreateStoragePoolRequest::new().set_storage_pool_id("example");
10044 /// ```
10045 pub fn set_storage_pool_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10046 self.storage_pool_id = v.into();
10047 self
10048 }
10049
10050 /// Sets the value of [storage_pool][crate::model::CreateStoragePoolRequest::storage_pool].
10051 ///
10052 /// # Example
10053 /// ```ignore,no_run
10054 /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
10055 /// use google_cloud_netapp_v1::model::StoragePool;
10056 /// let x = CreateStoragePoolRequest::new().set_storage_pool(StoragePool::default()/* use setters */);
10057 /// ```
10058 pub fn set_storage_pool<T>(mut self, v: T) -> Self
10059 where
10060 T: std::convert::Into<crate::model::StoragePool>,
10061 {
10062 self.storage_pool = std::option::Option::Some(v.into());
10063 self
10064 }
10065
10066 /// Sets or clears the value of [storage_pool][crate::model::CreateStoragePoolRequest::storage_pool].
10067 ///
10068 /// # Example
10069 /// ```ignore,no_run
10070 /// # use google_cloud_netapp_v1::model::CreateStoragePoolRequest;
10071 /// use google_cloud_netapp_v1::model::StoragePool;
10072 /// let x = CreateStoragePoolRequest::new().set_or_clear_storage_pool(Some(StoragePool::default()/* use setters */));
10073 /// let x = CreateStoragePoolRequest::new().set_or_clear_storage_pool(None::<StoragePool>);
10074 /// ```
10075 pub fn set_or_clear_storage_pool<T>(mut self, v: std::option::Option<T>) -> Self
10076 where
10077 T: std::convert::Into<crate::model::StoragePool>,
10078 {
10079 self.storage_pool = v.map(|x| x.into());
10080 self
10081 }
10082}
10083
10084impl wkt::message::Message for CreateStoragePoolRequest {
10085 fn typename() -> &'static str {
10086 "type.googleapis.com/google.cloud.netapp.v1.CreateStoragePoolRequest"
10087 }
10088}
10089
10090/// UpdateStoragePoolRequest updates a Storage Pool.
10091#[derive(Clone, Default, PartialEq)]
10092#[non_exhaustive]
10093pub struct UpdateStoragePoolRequest {
10094 /// Required. Field mask is used to specify the fields to be overwritten in the
10095 /// StoragePool resource by the update.
10096 /// The fields specified in the update_mask are relative to the resource, not
10097 /// the full request. A field will be overwritten if it is in the mask. If the
10098 /// user does not provide a mask then all fields will be overwritten.
10099 pub update_mask: std::option::Option<wkt::FieldMask>,
10100
10101 /// Required. The pool being updated
10102 pub storage_pool: std::option::Option<crate::model::StoragePool>,
10103
10104 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10105}
10106
10107impl UpdateStoragePoolRequest {
10108 pub fn new() -> Self {
10109 std::default::Default::default()
10110 }
10111
10112 /// Sets the value of [update_mask][crate::model::UpdateStoragePoolRequest::update_mask].
10113 ///
10114 /// # Example
10115 /// ```ignore,no_run
10116 /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
10117 /// use wkt::FieldMask;
10118 /// let x = UpdateStoragePoolRequest::new().set_update_mask(FieldMask::default()/* use setters */);
10119 /// ```
10120 pub fn set_update_mask<T>(mut self, v: T) -> Self
10121 where
10122 T: std::convert::Into<wkt::FieldMask>,
10123 {
10124 self.update_mask = std::option::Option::Some(v.into());
10125 self
10126 }
10127
10128 /// Sets or clears the value of [update_mask][crate::model::UpdateStoragePoolRequest::update_mask].
10129 ///
10130 /// # Example
10131 /// ```ignore,no_run
10132 /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
10133 /// use wkt::FieldMask;
10134 /// let x = UpdateStoragePoolRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
10135 /// let x = UpdateStoragePoolRequest::new().set_or_clear_update_mask(None::<FieldMask>);
10136 /// ```
10137 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10138 where
10139 T: std::convert::Into<wkt::FieldMask>,
10140 {
10141 self.update_mask = v.map(|x| x.into());
10142 self
10143 }
10144
10145 /// Sets the value of [storage_pool][crate::model::UpdateStoragePoolRequest::storage_pool].
10146 ///
10147 /// # Example
10148 /// ```ignore,no_run
10149 /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
10150 /// use google_cloud_netapp_v1::model::StoragePool;
10151 /// let x = UpdateStoragePoolRequest::new().set_storage_pool(StoragePool::default()/* use setters */);
10152 /// ```
10153 pub fn set_storage_pool<T>(mut self, v: T) -> Self
10154 where
10155 T: std::convert::Into<crate::model::StoragePool>,
10156 {
10157 self.storage_pool = std::option::Option::Some(v.into());
10158 self
10159 }
10160
10161 /// Sets or clears the value of [storage_pool][crate::model::UpdateStoragePoolRequest::storage_pool].
10162 ///
10163 /// # Example
10164 /// ```ignore,no_run
10165 /// # use google_cloud_netapp_v1::model::UpdateStoragePoolRequest;
10166 /// use google_cloud_netapp_v1::model::StoragePool;
10167 /// let x = UpdateStoragePoolRequest::new().set_or_clear_storage_pool(Some(StoragePool::default()/* use setters */));
10168 /// let x = UpdateStoragePoolRequest::new().set_or_clear_storage_pool(None::<StoragePool>);
10169 /// ```
10170 pub fn set_or_clear_storage_pool<T>(mut self, v: std::option::Option<T>) -> Self
10171 where
10172 T: std::convert::Into<crate::model::StoragePool>,
10173 {
10174 self.storage_pool = v.map(|x| x.into());
10175 self
10176 }
10177}
10178
10179impl wkt::message::Message for UpdateStoragePoolRequest {
10180 fn typename() -> &'static str {
10181 "type.googleapis.com/google.cloud.netapp.v1.UpdateStoragePoolRequest"
10182 }
10183}
10184
10185/// DeleteStoragePoolRequest deletes a Storage Pool.
10186#[derive(Clone, Default, PartialEq)]
10187#[non_exhaustive]
10188pub struct DeleteStoragePoolRequest {
10189 /// Required. Name of the storage pool
10190 pub name: std::string::String,
10191
10192 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10193}
10194
10195impl DeleteStoragePoolRequest {
10196 pub fn new() -> Self {
10197 std::default::Default::default()
10198 }
10199
10200 /// Sets the value of [name][crate::model::DeleteStoragePoolRequest::name].
10201 ///
10202 /// # Example
10203 /// ```ignore,no_run
10204 /// # use google_cloud_netapp_v1::model::DeleteStoragePoolRequest;
10205 /// let x = DeleteStoragePoolRequest::new().set_name("example");
10206 /// ```
10207 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10208 self.name = v.into();
10209 self
10210 }
10211}
10212
10213impl wkt::message::Message for DeleteStoragePoolRequest {
10214 fn typename() -> &'static str {
10215 "type.googleapis.com/google.cloud.netapp.v1.DeleteStoragePoolRequest"
10216 }
10217}
10218
10219/// SwitchActiveReplicaZoneRequest switch the active/replica zone for a regional
10220/// storagePool.
10221#[derive(Clone, Default, PartialEq)]
10222#[non_exhaustive]
10223pub struct SwitchActiveReplicaZoneRequest {
10224 /// Required. Name of the storage pool
10225 pub name: std::string::String,
10226
10227 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10228}
10229
10230impl SwitchActiveReplicaZoneRequest {
10231 pub fn new() -> Self {
10232 std::default::Default::default()
10233 }
10234
10235 /// Sets the value of [name][crate::model::SwitchActiveReplicaZoneRequest::name].
10236 ///
10237 /// # Example
10238 /// ```ignore,no_run
10239 /// # use google_cloud_netapp_v1::model::SwitchActiveReplicaZoneRequest;
10240 /// let x = SwitchActiveReplicaZoneRequest::new().set_name("example");
10241 /// ```
10242 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10243 self.name = v.into();
10244 self
10245 }
10246}
10247
10248impl wkt::message::Message for SwitchActiveReplicaZoneRequest {
10249 fn typename() -> &'static str {
10250 "type.googleapis.com/google.cloud.netapp.v1.SwitchActiveReplicaZoneRequest"
10251 }
10252}
10253
10254/// StoragePool is a container for volumes with a service level and capacity.
10255/// Volumes can be created in a pool of sufficient available capacity.
10256/// StoragePool capacity is what you are billed for.
10257#[derive(Clone, Default, PartialEq)]
10258#[non_exhaustive]
10259pub struct StoragePool {
10260 /// Identifier. Name of the storage pool
10261 pub name: std::string::String,
10262
10263 /// Required. Service level of the storage pool
10264 pub service_level: crate::model::ServiceLevel,
10265
10266 /// Required. Capacity in GIB of the pool
10267 pub capacity_gib: i64,
10268
10269 /// Output only. Allocated size of all volumes in GIB in the storage pool
10270 pub volume_capacity_gib: i64,
10271
10272 /// Output only. Volume count of the storage pool
10273 pub volume_count: i32,
10274
10275 /// Output only. State of the storage pool
10276 pub state: crate::model::storage_pool::State,
10277
10278 /// Output only. State details of the storage pool
10279 pub state_details: std::string::String,
10280
10281 /// Output only. Create time of the storage pool
10282 pub create_time: std::option::Option<wkt::Timestamp>,
10283
10284 /// Optional. Description of the storage pool
10285 pub description: std::string::String,
10286
10287 /// Optional. Labels as key value pairs
10288 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
10289
10290 /// Required. VPC Network name.
10291 /// Format: projects/{project}/global/networks/{network}
10292 pub network: std::string::String,
10293
10294 /// Optional. Specifies the Active Directory to be used for creating a SMB
10295 /// volume.
10296 pub active_directory: std::string::String,
10297
10298 /// Optional. Specifies the KMS config to be used for volume encryption.
10299 pub kms_config: std::string::String,
10300
10301 /// Optional. Flag indicating if the pool is NFS LDAP enabled or not.
10302 pub ldap_enabled: bool,
10303
10304 /// Optional. This field is not implemented. The values provided in this field
10305 /// are ignored.
10306 pub psa_range: std::string::String,
10307
10308 /// Output only. Specifies the current pool encryption key source.
10309 pub encryption_type: crate::model::EncryptionType,
10310
10311 /// Deprecated. Used to allow SO pool to access AD or DNS server from other
10312 /// regions.
10313 #[deprecated]
10314 pub global_access_allowed: std::option::Option<bool>,
10315
10316 /// Optional. True if the storage pool supports Auto Tiering enabled volumes.
10317 /// Default is false. Auto-tiering can be enabled after storage pool creation
10318 /// but it can't be disabled once enabled.
10319 pub allow_auto_tiering: bool,
10320
10321 /// Optional. Specifies the replica zone for regional storagePool.
10322 pub replica_zone: std::string::String,
10323
10324 /// Optional. Specifies the active zone for regional storagePool.
10325 pub zone: std::string::String,
10326
10327 /// Output only. Reserved for future use
10328 pub satisfies_pzs: bool,
10329
10330 /// Output only. Reserved for future use
10331 pub satisfies_pzi: bool,
10332
10333 /// Optional. True if using Independent Scaling of capacity and performance
10334 /// (Hyperdisk) By default set to false
10335 pub custom_performance_enabled: bool,
10336
10337 /// Optional. Custom Performance Total Throughput of the pool (in MiBps)
10338 pub total_throughput_mibps: i64,
10339
10340 /// Optional. Custom Performance Total IOPS of the pool
10341 /// if not provided, it will be calculated based on the total_throughput_mibps
10342 pub total_iops: i64,
10343
10344 /// Optional. Total hot tier capacity for the Storage Pool. It is applicable
10345 /// only to Flex service level. It should be less than the minimum storage pool
10346 /// size and cannot be more than the current storage pool size. It cannot be
10347 /// decreased once set.
10348 pub hot_tier_size_gib: i64,
10349
10350 /// Optional. Flag indicating that the hot-tier threshold will be
10351 /// auto-increased by 10% of the hot-tier when it hits 100%. Default is true.
10352 /// The increment will kick in only if the new size after increment is
10353 /// still less than or equal to storage pool size.
10354 pub enable_hot_tier_auto_resize: std::option::Option<bool>,
10355
10356 /// Optional. QoS (Quality of Service) Type of the storage pool
10357 pub qos_type: crate::model::QosType,
10358
10359 /// Output only. Available throughput of the storage pool (in MiB/s).
10360 pub available_throughput_mibps: f64,
10361
10362 /// Output only. Total cold tier data rounded down to the nearest GiB used by
10363 /// the storage pool.
10364 pub cold_tier_size_used_gib: i64,
10365
10366 /// Output only. Total hot tier data rounded down to the nearest GiB used by
10367 /// the storage pool.
10368 pub hot_tier_size_used_gib: i64,
10369
10370 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10371}
10372
10373impl StoragePool {
10374 pub fn new() -> Self {
10375 std::default::Default::default()
10376 }
10377
10378 /// Sets the value of [name][crate::model::StoragePool::name].
10379 ///
10380 /// # Example
10381 /// ```ignore,no_run
10382 /// # use google_cloud_netapp_v1::model::StoragePool;
10383 /// let x = StoragePool::new().set_name("example");
10384 /// ```
10385 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10386 self.name = v.into();
10387 self
10388 }
10389
10390 /// Sets the value of [service_level][crate::model::StoragePool::service_level].
10391 ///
10392 /// # Example
10393 /// ```ignore,no_run
10394 /// # use google_cloud_netapp_v1::model::StoragePool;
10395 /// use google_cloud_netapp_v1::model::ServiceLevel;
10396 /// let x0 = StoragePool::new().set_service_level(ServiceLevel::Premium);
10397 /// let x1 = StoragePool::new().set_service_level(ServiceLevel::Extreme);
10398 /// let x2 = StoragePool::new().set_service_level(ServiceLevel::Standard);
10399 /// ```
10400 pub fn set_service_level<T: std::convert::Into<crate::model::ServiceLevel>>(
10401 mut self,
10402 v: T,
10403 ) -> Self {
10404 self.service_level = v.into();
10405 self
10406 }
10407
10408 /// Sets the value of [capacity_gib][crate::model::StoragePool::capacity_gib].
10409 ///
10410 /// # Example
10411 /// ```ignore,no_run
10412 /// # use google_cloud_netapp_v1::model::StoragePool;
10413 /// let x = StoragePool::new().set_capacity_gib(42);
10414 /// ```
10415 pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10416 self.capacity_gib = v.into();
10417 self
10418 }
10419
10420 /// Sets the value of [volume_capacity_gib][crate::model::StoragePool::volume_capacity_gib].
10421 ///
10422 /// # Example
10423 /// ```ignore,no_run
10424 /// # use google_cloud_netapp_v1::model::StoragePool;
10425 /// let x = StoragePool::new().set_volume_capacity_gib(42);
10426 /// ```
10427 pub fn set_volume_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10428 self.volume_capacity_gib = v.into();
10429 self
10430 }
10431
10432 /// Sets the value of [volume_count][crate::model::StoragePool::volume_count].
10433 ///
10434 /// # Example
10435 /// ```ignore,no_run
10436 /// # use google_cloud_netapp_v1::model::StoragePool;
10437 /// let x = StoragePool::new().set_volume_count(42);
10438 /// ```
10439 pub fn set_volume_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
10440 self.volume_count = v.into();
10441 self
10442 }
10443
10444 /// Sets the value of [state][crate::model::StoragePool::state].
10445 ///
10446 /// # Example
10447 /// ```ignore,no_run
10448 /// # use google_cloud_netapp_v1::model::StoragePool;
10449 /// use google_cloud_netapp_v1::model::storage_pool::State;
10450 /// let x0 = StoragePool::new().set_state(State::Ready);
10451 /// let x1 = StoragePool::new().set_state(State::Creating);
10452 /// let x2 = StoragePool::new().set_state(State::Deleting);
10453 /// ```
10454 pub fn set_state<T: std::convert::Into<crate::model::storage_pool::State>>(
10455 mut self,
10456 v: T,
10457 ) -> Self {
10458 self.state = v.into();
10459 self
10460 }
10461
10462 /// Sets the value of [state_details][crate::model::StoragePool::state_details].
10463 ///
10464 /// # Example
10465 /// ```ignore,no_run
10466 /// # use google_cloud_netapp_v1::model::StoragePool;
10467 /// let x = StoragePool::new().set_state_details("example");
10468 /// ```
10469 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10470 self.state_details = v.into();
10471 self
10472 }
10473
10474 /// Sets the value of [create_time][crate::model::StoragePool::create_time].
10475 ///
10476 /// # Example
10477 /// ```ignore,no_run
10478 /// # use google_cloud_netapp_v1::model::StoragePool;
10479 /// use wkt::Timestamp;
10480 /// let x = StoragePool::new().set_create_time(Timestamp::default()/* use setters */);
10481 /// ```
10482 pub fn set_create_time<T>(mut self, v: T) -> Self
10483 where
10484 T: std::convert::Into<wkt::Timestamp>,
10485 {
10486 self.create_time = std::option::Option::Some(v.into());
10487 self
10488 }
10489
10490 /// Sets or clears the value of [create_time][crate::model::StoragePool::create_time].
10491 ///
10492 /// # Example
10493 /// ```ignore,no_run
10494 /// # use google_cloud_netapp_v1::model::StoragePool;
10495 /// use wkt::Timestamp;
10496 /// let x = StoragePool::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
10497 /// let x = StoragePool::new().set_or_clear_create_time(None::<Timestamp>);
10498 /// ```
10499 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
10500 where
10501 T: std::convert::Into<wkt::Timestamp>,
10502 {
10503 self.create_time = v.map(|x| x.into());
10504 self
10505 }
10506
10507 /// Sets the value of [description][crate::model::StoragePool::description].
10508 ///
10509 /// # Example
10510 /// ```ignore,no_run
10511 /// # use google_cloud_netapp_v1::model::StoragePool;
10512 /// let x = StoragePool::new().set_description("example");
10513 /// ```
10514 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10515 self.description = v.into();
10516 self
10517 }
10518
10519 /// Sets the value of [labels][crate::model::StoragePool::labels].
10520 ///
10521 /// # Example
10522 /// ```ignore,no_run
10523 /// # use google_cloud_netapp_v1::model::StoragePool;
10524 /// let x = StoragePool::new().set_labels([
10525 /// ("key0", "abc"),
10526 /// ("key1", "xyz"),
10527 /// ]);
10528 /// ```
10529 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
10530 where
10531 T: std::iter::IntoIterator<Item = (K, V)>,
10532 K: std::convert::Into<std::string::String>,
10533 V: std::convert::Into<std::string::String>,
10534 {
10535 use std::iter::Iterator;
10536 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
10537 self
10538 }
10539
10540 /// Sets the value of [network][crate::model::StoragePool::network].
10541 ///
10542 /// # Example
10543 /// ```ignore,no_run
10544 /// # use google_cloud_netapp_v1::model::StoragePool;
10545 /// let x = StoragePool::new().set_network("example");
10546 /// ```
10547 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10548 self.network = v.into();
10549 self
10550 }
10551
10552 /// Sets the value of [active_directory][crate::model::StoragePool::active_directory].
10553 ///
10554 /// # Example
10555 /// ```ignore,no_run
10556 /// # use google_cloud_netapp_v1::model::StoragePool;
10557 /// let x = StoragePool::new().set_active_directory("example");
10558 /// ```
10559 pub fn set_active_directory<T: std::convert::Into<std::string::String>>(
10560 mut self,
10561 v: T,
10562 ) -> Self {
10563 self.active_directory = v.into();
10564 self
10565 }
10566
10567 /// Sets the value of [kms_config][crate::model::StoragePool::kms_config].
10568 ///
10569 /// # Example
10570 /// ```ignore,no_run
10571 /// # use google_cloud_netapp_v1::model::StoragePool;
10572 /// let x = StoragePool::new().set_kms_config("example");
10573 /// ```
10574 pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10575 self.kms_config = v.into();
10576 self
10577 }
10578
10579 /// Sets the value of [ldap_enabled][crate::model::StoragePool::ldap_enabled].
10580 ///
10581 /// # Example
10582 /// ```ignore,no_run
10583 /// # use google_cloud_netapp_v1::model::StoragePool;
10584 /// let x = StoragePool::new().set_ldap_enabled(true);
10585 /// ```
10586 pub fn set_ldap_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10587 self.ldap_enabled = v.into();
10588 self
10589 }
10590
10591 /// Sets the value of [psa_range][crate::model::StoragePool::psa_range].
10592 ///
10593 /// # Example
10594 /// ```ignore,no_run
10595 /// # use google_cloud_netapp_v1::model::StoragePool;
10596 /// let x = StoragePool::new().set_psa_range("example");
10597 /// ```
10598 pub fn set_psa_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10599 self.psa_range = v.into();
10600 self
10601 }
10602
10603 /// Sets the value of [encryption_type][crate::model::StoragePool::encryption_type].
10604 ///
10605 /// # Example
10606 /// ```ignore,no_run
10607 /// # use google_cloud_netapp_v1::model::StoragePool;
10608 /// use google_cloud_netapp_v1::model::EncryptionType;
10609 /// let x0 = StoragePool::new().set_encryption_type(EncryptionType::ServiceManaged);
10610 /// let x1 = StoragePool::new().set_encryption_type(EncryptionType::CloudKms);
10611 /// ```
10612 pub fn set_encryption_type<T: std::convert::Into<crate::model::EncryptionType>>(
10613 mut self,
10614 v: T,
10615 ) -> Self {
10616 self.encryption_type = v.into();
10617 self
10618 }
10619
10620 /// Sets the value of [global_access_allowed][crate::model::StoragePool::global_access_allowed].
10621 ///
10622 /// # Example
10623 /// ```ignore,no_run
10624 /// # use google_cloud_netapp_v1::model::StoragePool;
10625 /// let x = StoragePool::new().set_global_access_allowed(true);
10626 /// ```
10627 #[deprecated]
10628 pub fn set_global_access_allowed<T>(mut self, v: T) -> Self
10629 where
10630 T: std::convert::Into<bool>,
10631 {
10632 self.global_access_allowed = std::option::Option::Some(v.into());
10633 self
10634 }
10635
10636 /// Sets or clears the value of [global_access_allowed][crate::model::StoragePool::global_access_allowed].
10637 ///
10638 /// # Example
10639 /// ```ignore,no_run
10640 /// # use google_cloud_netapp_v1::model::StoragePool;
10641 /// let x = StoragePool::new().set_or_clear_global_access_allowed(Some(false));
10642 /// let x = StoragePool::new().set_or_clear_global_access_allowed(None::<bool>);
10643 /// ```
10644 #[deprecated]
10645 pub fn set_or_clear_global_access_allowed<T>(mut self, v: std::option::Option<T>) -> Self
10646 where
10647 T: std::convert::Into<bool>,
10648 {
10649 self.global_access_allowed = v.map(|x| x.into());
10650 self
10651 }
10652
10653 /// Sets the value of [allow_auto_tiering][crate::model::StoragePool::allow_auto_tiering].
10654 ///
10655 /// # Example
10656 /// ```ignore,no_run
10657 /// # use google_cloud_netapp_v1::model::StoragePool;
10658 /// let x = StoragePool::new().set_allow_auto_tiering(true);
10659 /// ```
10660 pub fn set_allow_auto_tiering<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10661 self.allow_auto_tiering = v.into();
10662 self
10663 }
10664
10665 /// Sets the value of [replica_zone][crate::model::StoragePool::replica_zone].
10666 ///
10667 /// # Example
10668 /// ```ignore,no_run
10669 /// # use google_cloud_netapp_v1::model::StoragePool;
10670 /// let x = StoragePool::new().set_replica_zone("example");
10671 /// ```
10672 pub fn set_replica_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10673 self.replica_zone = v.into();
10674 self
10675 }
10676
10677 /// Sets the value of [zone][crate::model::StoragePool::zone].
10678 ///
10679 /// # Example
10680 /// ```ignore,no_run
10681 /// # use google_cloud_netapp_v1::model::StoragePool;
10682 /// let x = StoragePool::new().set_zone("example");
10683 /// ```
10684 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10685 self.zone = v.into();
10686 self
10687 }
10688
10689 /// Sets the value of [satisfies_pzs][crate::model::StoragePool::satisfies_pzs].
10690 ///
10691 /// # Example
10692 /// ```ignore,no_run
10693 /// # use google_cloud_netapp_v1::model::StoragePool;
10694 /// let x = StoragePool::new().set_satisfies_pzs(true);
10695 /// ```
10696 pub fn set_satisfies_pzs<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10697 self.satisfies_pzs = v.into();
10698 self
10699 }
10700
10701 /// Sets the value of [satisfies_pzi][crate::model::StoragePool::satisfies_pzi].
10702 ///
10703 /// # Example
10704 /// ```ignore,no_run
10705 /// # use google_cloud_netapp_v1::model::StoragePool;
10706 /// let x = StoragePool::new().set_satisfies_pzi(true);
10707 /// ```
10708 pub fn set_satisfies_pzi<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10709 self.satisfies_pzi = v.into();
10710 self
10711 }
10712
10713 /// Sets the value of [custom_performance_enabled][crate::model::StoragePool::custom_performance_enabled].
10714 ///
10715 /// # Example
10716 /// ```ignore,no_run
10717 /// # use google_cloud_netapp_v1::model::StoragePool;
10718 /// let x = StoragePool::new().set_custom_performance_enabled(true);
10719 /// ```
10720 pub fn set_custom_performance_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10721 self.custom_performance_enabled = v.into();
10722 self
10723 }
10724
10725 /// Sets the value of [total_throughput_mibps][crate::model::StoragePool::total_throughput_mibps].
10726 ///
10727 /// # Example
10728 /// ```ignore,no_run
10729 /// # use google_cloud_netapp_v1::model::StoragePool;
10730 /// let x = StoragePool::new().set_total_throughput_mibps(42);
10731 /// ```
10732 pub fn set_total_throughput_mibps<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10733 self.total_throughput_mibps = v.into();
10734 self
10735 }
10736
10737 /// Sets the value of [total_iops][crate::model::StoragePool::total_iops].
10738 ///
10739 /// # Example
10740 /// ```ignore,no_run
10741 /// # use google_cloud_netapp_v1::model::StoragePool;
10742 /// let x = StoragePool::new().set_total_iops(42);
10743 /// ```
10744 pub fn set_total_iops<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10745 self.total_iops = v.into();
10746 self
10747 }
10748
10749 /// Sets the value of [hot_tier_size_gib][crate::model::StoragePool::hot_tier_size_gib].
10750 ///
10751 /// # Example
10752 /// ```ignore,no_run
10753 /// # use google_cloud_netapp_v1::model::StoragePool;
10754 /// let x = StoragePool::new().set_hot_tier_size_gib(42);
10755 /// ```
10756 pub fn set_hot_tier_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10757 self.hot_tier_size_gib = v.into();
10758 self
10759 }
10760
10761 /// Sets the value of [enable_hot_tier_auto_resize][crate::model::StoragePool::enable_hot_tier_auto_resize].
10762 ///
10763 /// # Example
10764 /// ```ignore,no_run
10765 /// # use google_cloud_netapp_v1::model::StoragePool;
10766 /// let x = StoragePool::new().set_enable_hot_tier_auto_resize(true);
10767 /// ```
10768 pub fn set_enable_hot_tier_auto_resize<T>(mut self, v: T) -> Self
10769 where
10770 T: std::convert::Into<bool>,
10771 {
10772 self.enable_hot_tier_auto_resize = std::option::Option::Some(v.into());
10773 self
10774 }
10775
10776 /// Sets or clears the value of [enable_hot_tier_auto_resize][crate::model::StoragePool::enable_hot_tier_auto_resize].
10777 ///
10778 /// # Example
10779 /// ```ignore,no_run
10780 /// # use google_cloud_netapp_v1::model::StoragePool;
10781 /// let x = StoragePool::new().set_or_clear_enable_hot_tier_auto_resize(Some(false));
10782 /// let x = StoragePool::new().set_or_clear_enable_hot_tier_auto_resize(None::<bool>);
10783 /// ```
10784 pub fn set_or_clear_enable_hot_tier_auto_resize<T>(mut self, v: std::option::Option<T>) -> Self
10785 where
10786 T: std::convert::Into<bool>,
10787 {
10788 self.enable_hot_tier_auto_resize = v.map(|x| x.into());
10789 self
10790 }
10791
10792 /// Sets the value of [qos_type][crate::model::StoragePool::qos_type].
10793 ///
10794 /// # Example
10795 /// ```ignore,no_run
10796 /// # use google_cloud_netapp_v1::model::StoragePool;
10797 /// use google_cloud_netapp_v1::model::QosType;
10798 /// let x0 = StoragePool::new().set_qos_type(QosType::Auto);
10799 /// let x1 = StoragePool::new().set_qos_type(QosType::Manual);
10800 /// ```
10801 pub fn set_qos_type<T: std::convert::Into<crate::model::QosType>>(mut self, v: T) -> Self {
10802 self.qos_type = v.into();
10803 self
10804 }
10805
10806 /// Sets the value of [available_throughput_mibps][crate::model::StoragePool::available_throughput_mibps].
10807 ///
10808 /// # Example
10809 /// ```ignore,no_run
10810 /// # use google_cloud_netapp_v1::model::StoragePool;
10811 /// let x = StoragePool::new().set_available_throughput_mibps(42.0);
10812 /// ```
10813 pub fn set_available_throughput_mibps<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
10814 self.available_throughput_mibps = v.into();
10815 self
10816 }
10817
10818 /// Sets the value of [cold_tier_size_used_gib][crate::model::StoragePool::cold_tier_size_used_gib].
10819 ///
10820 /// # Example
10821 /// ```ignore,no_run
10822 /// # use google_cloud_netapp_v1::model::StoragePool;
10823 /// let x = StoragePool::new().set_cold_tier_size_used_gib(42);
10824 /// ```
10825 pub fn set_cold_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10826 self.cold_tier_size_used_gib = v.into();
10827 self
10828 }
10829
10830 /// Sets the value of [hot_tier_size_used_gib][crate::model::StoragePool::hot_tier_size_used_gib].
10831 ///
10832 /// # Example
10833 /// ```ignore,no_run
10834 /// # use google_cloud_netapp_v1::model::StoragePool;
10835 /// let x = StoragePool::new().set_hot_tier_size_used_gib(42);
10836 /// ```
10837 pub fn set_hot_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
10838 self.hot_tier_size_used_gib = v.into();
10839 self
10840 }
10841}
10842
10843impl wkt::message::Message for StoragePool {
10844 fn typename() -> &'static str {
10845 "type.googleapis.com/google.cloud.netapp.v1.StoragePool"
10846 }
10847}
10848
10849/// Defines additional types related to [StoragePool].
10850pub mod storage_pool {
10851 #[allow(unused_imports)]
10852 use super::*;
10853
10854 /// The Storage Pool States
10855 ///
10856 /// # Working with unknown values
10857 ///
10858 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
10859 /// additional enum variants at any time. Adding new variants is not considered
10860 /// a breaking change. Applications should write their code in anticipation of:
10861 ///
10862 /// - New values appearing in future releases of the client library, **and**
10863 /// - New values received dynamically, without application changes.
10864 ///
10865 /// Please consult the [Working with enums] section in the user guide for some
10866 /// guidelines.
10867 ///
10868 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
10869 #[derive(Clone, Debug, PartialEq)]
10870 #[non_exhaustive]
10871 pub enum State {
10872 /// Unspecified Storage Pool State
10873 Unspecified,
10874 /// Storage Pool State is Ready
10875 Ready,
10876 /// Storage Pool State is Creating
10877 Creating,
10878 /// Storage Pool State is Deleting
10879 Deleting,
10880 /// Storage Pool State is Updating
10881 Updating,
10882 /// Storage Pool State is Restoring
10883 Restoring,
10884 /// Storage Pool State is Disabled
10885 Disabled,
10886 /// Storage Pool State is Error
10887 Error,
10888 /// If set, the enum was initialized with an unknown value.
10889 ///
10890 /// Applications can examine the value using [State::value] or
10891 /// [State::name].
10892 UnknownValue(state::UnknownValue),
10893 }
10894
10895 #[doc(hidden)]
10896 pub mod state {
10897 #[allow(unused_imports)]
10898 use super::*;
10899 #[derive(Clone, Debug, PartialEq)]
10900 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
10901 }
10902
10903 impl State {
10904 /// Gets the enum value.
10905 ///
10906 /// Returns `None` if the enum contains an unknown value deserialized from
10907 /// the string representation of enums.
10908 pub fn value(&self) -> std::option::Option<i32> {
10909 match self {
10910 Self::Unspecified => std::option::Option::Some(0),
10911 Self::Ready => std::option::Option::Some(1),
10912 Self::Creating => std::option::Option::Some(2),
10913 Self::Deleting => std::option::Option::Some(3),
10914 Self::Updating => std::option::Option::Some(4),
10915 Self::Restoring => std::option::Option::Some(5),
10916 Self::Disabled => std::option::Option::Some(6),
10917 Self::Error => std::option::Option::Some(7),
10918 Self::UnknownValue(u) => u.0.value(),
10919 }
10920 }
10921
10922 /// Gets the enum value as a string.
10923 ///
10924 /// Returns `None` if the enum contains an unknown value deserialized from
10925 /// the integer representation of enums.
10926 pub fn name(&self) -> std::option::Option<&str> {
10927 match self {
10928 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
10929 Self::Ready => std::option::Option::Some("READY"),
10930 Self::Creating => std::option::Option::Some("CREATING"),
10931 Self::Deleting => std::option::Option::Some("DELETING"),
10932 Self::Updating => std::option::Option::Some("UPDATING"),
10933 Self::Restoring => std::option::Option::Some("RESTORING"),
10934 Self::Disabled => std::option::Option::Some("DISABLED"),
10935 Self::Error => std::option::Option::Some("ERROR"),
10936 Self::UnknownValue(u) => u.0.name(),
10937 }
10938 }
10939 }
10940
10941 impl std::default::Default for State {
10942 fn default() -> Self {
10943 use std::convert::From;
10944 Self::from(0)
10945 }
10946 }
10947
10948 impl std::fmt::Display for State {
10949 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
10950 wkt::internal::display_enum(f, self.name(), self.value())
10951 }
10952 }
10953
10954 impl std::convert::From<i32> for State {
10955 fn from(value: i32) -> Self {
10956 match value {
10957 0 => Self::Unspecified,
10958 1 => Self::Ready,
10959 2 => Self::Creating,
10960 3 => Self::Deleting,
10961 4 => Self::Updating,
10962 5 => Self::Restoring,
10963 6 => Self::Disabled,
10964 7 => Self::Error,
10965 _ => Self::UnknownValue(state::UnknownValue(
10966 wkt::internal::UnknownEnumValue::Integer(value),
10967 )),
10968 }
10969 }
10970 }
10971
10972 impl std::convert::From<&str> for State {
10973 fn from(value: &str) -> Self {
10974 use std::string::ToString;
10975 match value {
10976 "STATE_UNSPECIFIED" => Self::Unspecified,
10977 "READY" => Self::Ready,
10978 "CREATING" => Self::Creating,
10979 "DELETING" => Self::Deleting,
10980 "UPDATING" => Self::Updating,
10981 "RESTORING" => Self::Restoring,
10982 "DISABLED" => Self::Disabled,
10983 "ERROR" => Self::Error,
10984 _ => Self::UnknownValue(state::UnknownValue(
10985 wkt::internal::UnknownEnumValue::String(value.to_string()),
10986 )),
10987 }
10988 }
10989 }
10990
10991 impl serde::ser::Serialize for State {
10992 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10993 where
10994 S: serde::Serializer,
10995 {
10996 match self {
10997 Self::Unspecified => serializer.serialize_i32(0),
10998 Self::Ready => serializer.serialize_i32(1),
10999 Self::Creating => serializer.serialize_i32(2),
11000 Self::Deleting => serializer.serialize_i32(3),
11001 Self::Updating => serializer.serialize_i32(4),
11002 Self::Restoring => serializer.serialize_i32(5),
11003 Self::Disabled => serializer.serialize_i32(6),
11004 Self::Error => serializer.serialize_i32(7),
11005 Self::UnknownValue(u) => u.0.serialize(serializer),
11006 }
11007 }
11008 }
11009
11010 impl<'de> serde::de::Deserialize<'de> for State {
11011 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
11012 where
11013 D: serde::Deserializer<'de>,
11014 {
11015 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
11016 ".google.cloud.netapp.v1.StoragePool.State",
11017 ))
11018 }
11019 }
11020}
11021
11022/// ValidateDirectoryServiceRequest validates the directory service policy
11023/// attached to the storage pool.
11024#[derive(Clone, Default, PartialEq)]
11025#[non_exhaustive]
11026pub struct ValidateDirectoryServiceRequest {
11027 /// Required. Name of the storage pool
11028 pub name: std::string::String,
11029
11030 /// Type of directory service policy attached to the storage pool.
11031 pub directory_service_type: crate::model::DirectoryServiceType,
11032
11033 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11034}
11035
11036impl ValidateDirectoryServiceRequest {
11037 pub fn new() -> Self {
11038 std::default::Default::default()
11039 }
11040
11041 /// Sets the value of [name][crate::model::ValidateDirectoryServiceRequest::name].
11042 ///
11043 /// # Example
11044 /// ```ignore,no_run
11045 /// # use google_cloud_netapp_v1::model::ValidateDirectoryServiceRequest;
11046 /// let x = ValidateDirectoryServiceRequest::new().set_name("example");
11047 /// ```
11048 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11049 self.name = v.into();
11050 self
11051 }
11052
11053 /// Sets the value of [directory_service_type][crate::model::ValidateDirectoryServiceRequest::directory_service_type].
11054 ///
11055 /// # Example
11056 /// ```ignore,no_run
11057 /// # use google_cloud_netapp_v1::model::ValidateDirectoryServiceRequest;
11058 /// use google_cloud_netapp_v1::model::DirectoryServiceType;
11059 /// let x0 = ValidateDirectoryServiceRequest::new().set_directory_service_type(DirectoryServiceType::ActiveDirectory);
11060 /// ```
11061 pub fn set_directory_service_type<T: std::convert::Into<crate::model::DirectoryServiceType>>(
11062 mut self,
11063 v: T,
11064 ) -> Self {
11065 self.directory_service_type = v.into();
11066 self
11067 }
11068}
11069
11070impl wkt::message::Message for ValidateDirectoryServiceRequest {
11071 fn typename() -> &'static str {
11072 "type.googleapis.com/google.cloud.netapp.v1.ValidateDirectoryServiceRequest"
11073 }
11074}
11075
11076/// Message for requesting list of Volumes
11077#[derive(Clone, Default, PartialEq)]
11078#[non_exhaustive]
11079pub struct ListVolumesRequest {
11080 /// Required. Parent value for ListVolumesRequest
11081 pub parent: std::string::String,
11082
11083 /// Requested page size. Server may return fewer items than requested.
11084 /// If unspecified, the server will pick an appropriate default.
11085 pub page_size: i32,
11086
11087 /// A token identifying a page of results the server should return.
11088 pub page_token: std::string::String,
11089
11090 /// Filtering results
11091 pub filter: std::string::String,
11092
11093 /// Hint for how to order the results
11094 pub order_by: std::string::String,
11095
11096 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11097}
11098
11099impl ListVolumesRequest {
11100 pub fn new() -> Self {
11101 std::default::Default::default()
11102 }
11103
11104 /// Sets the value of [parent][crate::model::ListVolumesRequest::parent].
11105 ///
11106 /// # Example
11107 /// ```ignore,no_run
11108 /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
11109 /// let x = ListVolumesRequest::new().set_parent("example");
11110 /// ```
11111 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11112 self.parent = v.into();
11113 self
11114 }
11115
11116 /// Sets the value of [page_size][crate::model::ListVolumesRequest::page_size].
11117 ///
11118 /// # Example
11119 /// ```ignore,no_run
11120 /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
11121 /// let x = ListVolumesRequest::new().set_page_size(42);
11122 /// ```
11123 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
11124 self.page_size = v.into();
11125 self
11126 }
11127
11128 /// Sets the value of [page_token][crate::model::ListVolumesRequest::page_token].
11129 ///
11130 /// # Example
11131 /// ```ignore,no_run
11132 /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
11133 /// let x = ListVolumesRequest::new().set_page_token("example");
11134 /// ```
11135 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11136 self.page_token = v.into();
11137 self
11138 }
11139
11140 /// Sets the value of [filter][crate::model::ListVolumesRequest::filter].
11141 ///
11142 /// # Example
11143 /// ```ignore,no_run
11144 /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
11145 /// let x = ListVolumesRequest::new().set_filter("example");
11146 /// ```
11147 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11148 self.filter = v.into();
11149 self
11150 }
11151
11152 /// Sets the value of [order_by][crate::model::ListVolumesRequest::order_by].
11153 ///
11154 /// # Example
11155 /// ```ignore,no_run
11156 /// # use google_cloud_netapp_v1::model::ListVolumesRequest;
11157 /// let x = ListVolumesRequest::new().set_order_by("example");
11158 /// ```
11159 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11160 self.order_by = v.into();
11161 self
11162 }
11163}
11164
11165impl wkt::message::Message for ListVolumesRequest {
11166 fn typename() -> &'static str {
11167 "type.googleapis.com/google.cloud.netapp.v1.ListVolumesRequest"
11168 }
11169}
11170
11171/// Message for response to listing Volumes
11172#[derive(Clone, Default, PartialEq)]
11173#[non_exhaustive]
11174pub struct ListVolumesResponse {
11175 /// The list of Volume
11176 pub volumes: std::vec::Vec<crate::model::Volume>,
11177
11178 /// A token identifying a page of results the server should return.
11179 pub next_page_token: std::string::String,
11180
11181 /// Locations that could not be reached.
11182 pub unreachable: std::vec::Vec<std::string::String>,
11183
11184 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11185}
11186
11187impl ListVolumesResponse {
11188 pub fn new() -> Self {
11189 std::default::Default::default()
11190 }
11191
11192 /// Sets the value of [volumes][crate::model::ListVolumesResponse::volumes].
11193 ///
11194 /// # Example
11195 /// ```ignore,no_run
11196 /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
11197 /// use google_cloud_netapp_v1::model::Volume;
11198 /// let x = ListVolumesResponse::new()
11199 /// .set_volumes([
11200 /// Volume::default()/* use setters */,
11201 /// Volume::default()/* use (different) setters */,
11202 /// ]);
11203 /// ```
11204 pub fn set_volumes<T, V>(mut self, v: T) -> Self
11205 where
11206 T: std::iter::IntoIterator<Item = V>,
11207 V: std::convert::Into<crate::model::Volume>,
11208 {
11209 use std::iter::Iterator;
11210 self.volumes = v.into_iter().map(|i| i.into()).collect();
11211 self
11212 }
11213
11214 /// Sets the value of [next_page_token][crate::model::ListVolumesResponse::next_page_token].
11215 ///
11216 /// # Example
11217 /// ```ignore,no_run
11218 /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
11219 /// let x = ListVolumesResponse::new().set_next_page_token("example");
11220 /// ```
11221 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11222 self.next_page_token = v.into();
11223 self
11224 }
11225
11226 /// Sets the value of [unreachable][crate::model::ListVolumesResponse::unreachable].
11227 ///
11228 /// # Example
11229 /// ```ignore,no_run
11230 /// # use google_cloud_netapp_v1::model::ListVolumesResponse;
11231 /// let x = ListVolumesResponse::new().set_unreachable(["a", "b", "c"]);
11232 /// ```
11233 pub fn set_unreachable<T, V>(mut self, v: T) -> Self
11234 where
11235 T: std::iter::IntoIterator<Item = V>,
11236 V: std::convert::Into<std::string::String>,
11237 {
11238 use std::iter::Iterator;
11239 self.unreachable = v.into_iter().map(|i| i.into()).collect();
11240 self
11241 }
11242}
11243
11244impl wkt::message::Message for ListVolumesResponse {
11245 fn typename() -> &'static str {
11246 "type.googleapis.com/google.cloud.netapp.v1.ListVolumesResponse"
11247 }
11248}
11249
11250#[doc(hidden)]
11251impl gax::paginator::internal::PageableResponse for ListVolumesResponse {
11252 type PageItem = crate::model::Volume;
11253
11254 fn items(self) -> std::vec::Vec<Self::PageItem> {
11255 self.volumes
11256 }
11257
11258 fn next_page_token(&self) -> std::string::String {
11259 use std::clone::Clone;
11260 self.next_page_token.clone()
11261 }
11262}
11263
11264/// Message for getting a Volume
11265#[derive(Clone, Default, PartialEq)]
11266#[non_exhaustive]
11267pub struct GetVolumeRequest {
11268 /// Required. Name of the volume
11269 pub name: std::string::String,
11270
11271 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11272}
11273
11274impl GetVolumeRequest {
11275 pub fn new() -> Self {
11276 std::default::Default::default()
11277 }
11278
11279 /// Sets the value of [name][crate::model::GetVolumeRequest::name].
11280 ///
11281 /// # Example
11282 /// ```ignore,no_run
11283 /// # use google_cloud_netapp_v1::model::GetVolumeRequest;
11284 /// let x = GetVolumeRequest::new().set_name("example");
11285 /// ```
11286 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11287 self.name = v.into();
11288 self
11289 }
11290}
11291
11292impl wkt::message::Message for GetVolumeRequest {
11293 fn typename() -> &'static str {
11294 "type.googleapis.com/google.cloud.netapp.v1.GetVolumeRequest"
11295 }
11296}
11297
11298/// Message for creating a Volume
11299#[derive(Clone, Default, PartialEq)]
11300#[non_exhaustive]
11301pub struct CreateVolumeRequest {
11302 /// Required. Value for parent.
11303 pub parent: std::string::String,
11304
11305 /// Required. Id of the requesting volume. Must be unique within the parent
11306 /// resource. Must contain only letters, numbers and hyphen, with the first
11307 /// character a letter, the last a letter or a number,
11308 /// and a 63 character maximum.
11309 pub volume_id: std::string::String,
11310
11311 /// Required. The volume being created.
11312 pub volume: std::option::Option<crate::model::Volume>,
11313
11314 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11315}
11316
11317impl CreateVolumeRequest {
11318 pub fn new() -> Self {
11319 std::default::Default::default()
11320 }
11321
11322 /// Sets the value of [parent][crate::model::CreateVolumeRequest::parent].
11323 ///
11324 /// # Example
11325 /// ```ignore,no_run
11326 /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
11327 /// let x = CreateVolumeRequest::new().set_parent("example");
11328 /// ```
11329 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11330 self.parent = v.into();
11331 self
11332 }
11333
11334 /// Sets the value of [volume_id][crate::model::CreateVolumeRequest::volume_id].
11335 ///
11336 /// # Example
11337 /// ```ignore,no_run
11338 /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
11339 /// let x = CreateVolumeRequest::new().set_volume_id("example");
11340 /// ```
11341 pub fn set_volume_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11342 self.volume_id = v.into();
11343 self
11344 }
11345
11346 /// Sets the value of [volume][crate::model::CreateVolumeRequest::volume].
11347 ///
11348 /// # Example
11349 /// ```ignore,no_run
11350 /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
11351 /// use google_cloud_netapp_v1::model::Volume;
11352 /// let x = CreateVolumeRequest::new().set_volume(Volume::default()/* use setters */);
11353 /// ```
11354 pub fn set_volume<T>(mut self, v: T) -> Self
11355 where
11356 T: std::convert::Into<crate::model::Volume>,
11357 {
11358 self.volume = std::option::Option::Some(v.into());
11359 self
11360 }
11361
11362 /// Sets or clears the value of [volume][crate::model::CreateVolumeRequest::volume].
11363 ///
11364 /// # Example
11365 /// ```ignore,no_run
11366 /// # use google_cloud_netapp_v1::model::CreateVolumeRequest;
11367 /// use google_cloud_netapp_v1::model::Volume;
11368 /// let x = CreateVolumeRequest::new().set_or_clear_volume(Some(Volume::default()/* use setters */));
11369 /// let x = CreateVolumeRequest::new().set_or_clear_volume(None::<Volume>);
11370 /// ```
11371 pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
11372 where
11373 T: std::convert::Into<crate::model::Volume>,
11374 {
11375 self.volume = v.map(|x| x.into());
11376 self
11377 }
11378}
11379
11380impl wkt::message::Message for CreateVolumeRequest {
11381 fn typename() -> &'static str {
11382 "type.googleapis.com/google.cloud.netapp.v1.CreateVolumeRequest"
11383 }
11384}
11385
11386/// Message for updating a Volume
11387#[derive(Clone, Default, PartialEq)]
11388#[non_exhaustive]
11389pub struct UpdateVolumeRequest {
11390 /// Required. Field mask is used to specify the fields to be overwritten in the
11391 /// Volume resource by the update.
11392 /// The fields specified in the update_mask are relative to the resource, not
11393 /// the full request. A field will be overwritten if it is in the mask. If the
11394 /// user does not provide a mask then all fields will be overwritten.
11395 pub update_mask: std::option::Option<wkt::FieldMask>,
11396
11397 /// Required. The volume being updated
11398 pub volume: std::option::Option<crate::model::Volume>,
11399
11400 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11401}
11402
11403impl UpdateVolumeRequest {
11404 pub fn new() -> Self {
11405 std::default::Default::default()
11406 }
11407
11408 /// Sets the value of [update_mask][crate::model::UpdateVolumeRequest::update_mask].
11409 ///
11410 /// # Example
11411 /// ```ignore,no_run
11412 /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
11413 /// use wkt::FieldMask;
11414 /// let x = UpdateVolumeRequest::new().set_update_mask(FieldMask::default()/* use setters */);
11415 /// ```
11416 pub fn set_update_mask<T>(mut self, v: T) -> Self
11417 where
11418 T: std::convert::Into<wkt::FieldMask>,
11419 {
11420 self.update_mask = std::option::Option::Some(v.into());
11421 self
11422 }
11423
11424 /// Sets or clears the value of [update_mask][crate::model::UpdateVolumeRequest::update_mask].
11425 ///
11426 /// # Example
11427 /// ```ignore,no_run
11428 /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
11429 /// use wkt::FieldMask;
11430 /// let x = UpdateVolumeRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
11431 /// let x = UpdateVolumeRequest::new().set_or_clear_update_mask(None::<FieldMask>);
11432 /// ```
11433 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11434 where
11435 T: std::convert::Into<wkt::FieldMask>,
11436 {
11437 self.update_mask = v.map(|x| x.into());
11438 self
11439 }
11440
11441 /// Sets the value of [volume][crate::model::UpdateVolumeRequest::volume].
11442 ///
11443 /// # Example
11444 /// ```ignore,no_run
11445 /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
11446 /// use google_cloud_netapp_v1::model::Volume;
11447 /// let x = UpdateVolumeRequest::new().set_volume(Volume::default()/* use setters */);
11448 /// ```
11449 pub fn set_volume<T>(mut self, v: T) -> Self
11450 where
11451 T: std::convert::Into<crate::model::Volume>,
11452 {
11453 self.volume = std::option::Option::Some(v.into());
11454 self
11455 }
11456
11457 /// Sets or clears the value of [volume][crate::model::UpdateVolumeRequest::volume].
11458 ///
11459 /// # Example
11460 /// ```ignore,no_run
11461 /// # use google_cloud_netapp_v1::model::UpdateVolumeRequest;
11462 /// use google_cloud_netapp_v1::model::Volume;
11463 /// let x = UpdateVolumeRequest::new().set_or_clear_volume(Some(Volume::default()/* use setters */));
11464 /// let x = UpdateVolumeRequest::new().set_or_clear_volume(None::<Volume>);
11465 /// ```
11466 pub fn set_or_clear_volume<T>(mut self, v: std::option::Option<T>) -> Self
11467 where
11468 T: std::convert::Into<crate::model::Volume>,
11469 {
11470 self.volume = v.map(|x| x.into());
11471 self
11472 }
11473}
11474
11475impl wkt::message::Message for UpdateVolumeRequest {
11476 fn typename() -> &'static str {
11477 "type.googleapis.com/google.cloud.netapp.v1.UpdateVolumeRequest"
11478 }
11479}
11480
11481/// Message for deleting a Volume
11482#[derive(Clone, Default, PartialEq)]
11483#[non_exhaustive]
11484pub struct DeleteVolumeRequest {
11485 /// Required. Name of the volume
11486 pub name: std::string::String,
11487
11488 /// If this field is set as true, CCFE will not block the volume resource
11489 /// deletion even if it has any snapshots resource. (Otherwise, the request
11490 /// will only work if the volume has no snapshots.)
11491 pub force: bool,
11492
11493 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11494}
11495
11496impl DeleteVolumeRequest {
11497 pub fn new() -> Self {
11498 std::default::Default::default()
11499 }
11500
11501 /// Sets the value of [name][crate::model::DeleteVolumeRequest::name].
11502 ///
11503 /// # Example
11504 /// ```ignore,no_run
11505 /// # use google_cloud_netapp_v1::model::DeleteVolumeRequest;
11506 /// let x = DeleteVolumeRequest::new().set_name("example");
11507 /// ```
11508 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11509 self.name = v.into();
11510 self
11511 }
11512
11513 /// Sets the value of [force][crate::model::DeleteVolumeRequest::force].
11514 ///
11515 /// # Example
11516 /// ```ignore,no_run
11517 /// # use google_cloud_netapp_v1::model::DeleteVolumeRequest;
11518 /// let x = DeleteVolumeRequest::new().set_force(true);
11519 /// ```
11520 pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
11521 self.force = v.into();
11522 self
11523 }
11524}
11525
11526impl wkt::message::Message for DeleteVolumeRequest {
11527 fn typename() -> &'static str {
11528 "type.googleapis.com/google.cloud.netapp.v1.DeleteVolumeRequest"
11529 }
11530}
11531
11532/// RevertVolumeRequest reverts the given volume to the specified snapshot.
11533#[derive(Clone, Default, PartialEq)]
11534#[non_exhaustive]
11535pub struct RevertVolumeRequest {
11536 /// Required. The resource name of the volume, in the format of
11537 /// projects/{project_id}/locations/{location}/volumes/{volume_id}.
11538 pub name: std::string::String,
11539
11540 /// Required. The snapshot resource ID, in the format 'my-snapshot', where the
11541 /// specified ID is the {snapshot_id} of the fully qualified name like
11542 /// projects/{project_id}/locations/{location_id}/volumes/{volume_id}/snapshots/{snapshot_id}
11543 pub snapshot_id: std::string::String,
11544
11545 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11546}
11547
11548impl RevertVolumeRequest {
11549 pub fn new() -> Self {
11550 std::default::Default::default()
11551 }
11552
11553 /// Sets the value of [name][crate::model::RevertVolumeRequest::name].
11554 ///
11555 /// # Example
11556 /// ```ignore,no_run
11557 /// # use google_cloud_netapp_v1::model::RevertVolumeRequest;
11558 /// let x = RevertVolumeRequest::new().set_name("example");
11559 /// ```
11560 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11561 self.name = v.into();
11562 self
11563 }
11564
11565 /// Sets the value of [snapshot_id][crate::model::RevertVolumeRequest::snapshot_id].
11566 ///
11567 /// # Example
11568 /// ```ignore,no_run
11569 /// # use google_cloud_netapp_v1::model::RevertVolumeRequest;
11570 /// let x = RevertVolumeRequest::new().set_snapshot_id("example");
11571 /// ```
11572 pub fn set_snapshot_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11573 self.snapshot_id = v.into();
11574 self
11575 }
11576}
11577
11578impl wkt::message::Message for RevertVolumeRequest {
11579 fn typename() -> &'static str {
11580 "type.googleapis.com/google.cloud.netapp.v1.RevertVolumeRequest"
11581 }
11582}
11583
11584/// Volume provides a filesystem that you can mount.
11585#[derive(Clone, Default, PartialEq)]
11586#[non_exhaustive]
11587pub struct Volume {
11588 /// Identifier. Name of the volume
11589 pub name: std::string::String,
11590
11591 /// Output only. State of the volume
11592 pub state: crate::model::volume::State,
11593
11594 /// Output only. State details of the volume
11595 pub state_details: std::string::String,
11596
11597 /// Output only. Create time of the volume
11598 pub create_time: std::option::Option<wkt::Timestamp>,
11599
11600 /// Required. Share name of the volume
11601 pub share_name: std::string::String,
11602
11603 /// Output only. This field is not implemented. The values provided in this
11604 /// field are ignored.
11605 pub psa_range: std::string::String,
11606
11607 /// Required. StoragePool name of the volume
11608 pub storage_pool: std::string::String,
11609
11610 /// Output only. VPC Network name.
11611 /// Format: projects/{project}/global/networks/{network}
11612 pub network: std::string::String,
11613
11614 /// Output only. Service level of the volume
11615 pub service_level: crate::model::ServiceLevel,
11616
11617 /// Required. Capacity in GIB of the volume
11618 pub capacity_gib: i64,
11619
11620 /// Optional. Export policy of the volume
11621 pub export_policy: std::option::Option<crate::model::ExportPolicy>,
11622
11623 /// Required. Protocols required for the volume
11624 pub protocols: std::vec::Vec<crate::model::Protocols>,
11625
11626 /// Optional. SMB share settings for the volume.
11627 pub smb_settings: std::vec::Vec<crate::model::SMBSettings>,
11628
11629 /// Output only. Mount options of this volume
11630 pub mount_options: std::vec::Vec<crate::model::MountOption>,
11631
11632 /// Optional. Default unix style permission (e.g. 777) the mount point will be
11633 /// created with. Applicable for NFS protocol types only.
11634 pub unix_permissions: std::string::String,
11635
11636 /// Optional. Labels as key value pairs
11637 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
11638
11639 /// Optional. Description of the volume
11640 pub description: std::string::String,
11641
11642 /// Optional. SnapshotPolicy for a volume.
11643 pub snapshot_policy: std::option::Option<crate::model::SnapshotPolicy>,
11644
11645 /// Optional. Snap_reserve specifies percentage of volume storage reserved for
11646 /// snapshot storage. Default is 0 percent.
11647 pub snap_reserve: f64,
11648
11649 /// Optional. Snapshot_directory if enabled (true) the volume will contain a
11650 /// read-only .snapshot directory which provides access to each of the volume's
11651 /// snapshots.
11652 pub snapshot_directory: bool,
11653
11654 /// Output only. Used capacity in GIB of the volume. This is computed
11655 /// periodically and it does not represent the realtime usage.
11656 pub used_gib: i64,
11657
11658 /// Optional. Security Style of the Volume
11659 pub security_style: crate::model::SecurityStyle,
11660
11661 /// Optional. Flag indicating if the volume is a kerberos volume or not, export
11662 /// policy rules control kerberos security modes (krb5, krb5i, krb5p).
11663 pub kerberos_enabled: bool,
11664
11665 /// Output only. Flag indicating if the volume is NFS LDAP enabled or not.
11666 pub ldap_enabled: bool,
11667
11668 /// Output only. Specifies the ActiveDirectory name of a SMB volume.
11669 pub active_directory: std::string::String,
11670
11671 /// Optional. Specifies the source of the volume to be created from.
11672 pub restore_parameters: std::option::Option<crate::model::RestoreParameters>,
11673
11674 /// Output only. Specifies the KMS config to be used for volume encryption.
11675 pub kms_config: std::string::String,
11676
11677 /// Output only. Specified the current volume encryption key source.
11678 pub encryption_type: crate::model::EncryptionType,
11679
11680 /// Output only. Indicates whether the volume is part of a replication
11681 /// relationship.
11682 pub has_replication: bool,
11683
11684 /// BackupConfig of the volume.
11685 pub backup_config: std::option::Option<crate::model::BackupConfig>,
11686
11687 /// Optional. List of actions that are restricted on this volume.
11688 pub restricted_actions: std::vec::Vec<crate::model::RestrictedAction>,
11689
11690 /// Optional. Flag indicating if the volume will be a large capacity volume or
11691 /// a regular volume.
11692 pub large_capacity: bool,
11693
11694 /// Optional. Flag indicating if the volume will have an IP address per node
11695 /// for volumes supporting multiple IP endpoints. Only the volume with
11696 /// large_capacity will be allowed to have multiple endpoints.
11697 pub multiple_endpoints: bool,
11698
11699 /// Tiering policy for the volume.
11700 pub tiering_policy: std::option::Option<crate::model::TieringPolicy>,
11701
11702 /// Output only. Specifies the replica zone for regional volume.
11703 pub replica_zone: std::string::String,
11704
11705 /// Output only. Specifies the active zone for regional volume.
11706 pub zone: std::string::String,
11707
11708 /// Output only. Size of the volume cold tier data rounded down to the nearest
11709 /// GiB.
11710 pub cold_tier_size_gib: i64,
11711
11712 /// Optional. The Hybrid Replication parameters for the volume.
11713 pub hybrid_replication_parameters:
11714 std::option::Option<crate::model::HybridReplicationParameters>,
11715
11716 /// Optional. Throughput of the volume (in MiB/s)
11717 pub throughput_mibps: f64,
11718
11719 /// Output only. Total hot tier data rounded down to the nearest GiB used by
11720 /// the Volume. This field is only used for flex Service Level
11721 pub hot_tier_size_used_gib: i64,
11722
11723 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
11724}
11725
11726impl Volume {
11727 pub fn new() -> Self {
11728 std::default::Default::default()
11729 }
11730
11731 /// Sets the value of [name][crate::model::Volume::name].
11732 ///
11733 /// # Example
11734 /// ```ignore,no_run
11735 /// # use google_cloud_netapp_v1::model::Volume;
11736 /// let x = Volume::new().set_name("example");
11737 /// ```
11738 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11739 self.name = v.into();
11740 self
11741 }
11742
11743 /// Sets the value of [state][crate::model::Volume::state].
11744 ///
11745 /// # Example
11746 /// ```ignore,no_run
11747 /// # use google_cloud_netapp_v1::model::Volume;
11748 /// use google_cloud_netapp_v1::model::volume::State;
11749 /// let x0 = Volume::new().set_state(State::Ready);
11750 /// let x1 = Volume::new().set_state(State::Creating);
11751 /// let x2 = Volume::new().set_state(State::Deleting);
11752 /// ```
11753 pub fn set_state<T: std::convert::Into<crate::model::volume::State>>(mut self, v: T) -> Self {
11754 self.state = v.into();
11755 self
11756 }
11757
11758 /// Sets the value of [state_details][crate::model::Volume::state_details].
11759 ///
11760 /// # Example
11761 /// ```ignore,no_run
11762 /// # use google_cloud_netapp_v1::model::Volume;
11763 /// let x = Volume::new().set_state_details("example");
11764 /// ```
11765 pub fn set_state_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11766 self.state_details = v.into();
11767 self
11768 }
11769
11770 /// Sets the value of [create_time][crate::model::Volume::create_time].
11771 ///
11772 /// # Example
11773 /// ```ignore,no_run
11774 /// # use google_cloud_netapp_v1::model::Volume;
11775 /// use wkt::Timestamp;
11776 /// let x = Volume::new().set_create_time(Timestamp::default()/* use setters */);
11777 /// ```
11778 pub fn set_create_time<T>(mut self, v: T) -> Self
11779 where
11780 T: std::convert::Into<wkt::Timestamp>,
11781 {
11782 self.create_time = std::option::Option::Some(v.into());
11783 self
11784 }
11785
11786 /// Sets or clears the value of [create_time][crate::model::Volume::create_time].
11787 ///
11788 /// # Example
11789 /// ```ignore,no_run
11790 /// # use google_cloud_netapp_v1::model::Volume;
11791 /// use wkt::Timestamp;
11792 /// let x = Volume::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
11793 /// let x = Volume::new().set_or_clear_create_time(None::<Timestamp>);
11794 /// ```
11795 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
11796 where
11797 T: std::convert::Into<wkt::Timestamp>,
11798 {
11799 self.create_time = v.map(|x| x.into());
11800 self
11801 }
11802
11803 /// Sets the value of [share_name][crate::model::Volume::share_name].
11804 ///
11805 /// # Example
11806 /// ```ignore,no_run
11807 /// # use google_cloud_netapp_v1::model::Volume;
11808 /// let x = Volume::new().set_share_name("example");
11809 /// ```
11810 pub fn set_share_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11811 self.share_name = v.into();
11812 self
11813 }
11814
11815 /// Sets the value of [psa_range][crate::model::Volume::psa_range].
11816 ///
11817 /// # Example
11818 /// ```ignore,no_run
11819 /// # use google_cloud_netapp_v1::model::Volume;
11820 /// let x = Volume::new().set_psa_range("example");
11821 /// ```
11822 pub fn set_psa_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11823 self.psa_range = v.into();
11824 self
11825 }
11826
11827 /// Sets the value of [storage_pool][crate::model::Volume::storage_pool].
11828 ///
11829 /// # Example
11830 /// ```ignore,no_run
11831 /// # use google_cloud_netapp_v1::model::Volume;
11832 /// let x = Volume::new().set_storage_pool("example");
11833 /// ```
11834 pub fn set_storage_pool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11835 self.storage_pool = v.into();
11836 self
11837 }
11838
11839 /// Sets the value of [network][crate::model::Volume::network].
11840 ///
11841 /// # Example
11842 /// ```ignore,no_run
11843 /// # use google_cloud_netapp_v1::model::Volume;
11844 /// let x = Volume::new().set_network("example");
11845 /// ```
11846 pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
11847 self.network = v.into();
11848 self
11849 }
11850
11851 /// Sets the value of [service_level][crate::model::Volume::service_level].
11852 ///
11853 /// # Example
11854 /// ```ignore,no_run
11855 /// # use google_cloud_netapp_v1::model::Volume;
11856 /// use google_cloud_netapp_v1::model::ServiceLevel;
11857 /// let x0 = Volume::new().set_service_level(ServiceLevel::Premium);
11858 /// let x1 = Volume::new().set_service_level(ServiceLevel::Extreme);
11859 /// let x2 = Volume::new().set_service_level(ServiceLevel::Standard);
11860 /// ```
11861 pub fn set_service_level<T: std::convert::Into<crate::model::ServiceLevel>>(
11862 mut self,
11863 v: T,
11864 ) -> Self {
11865 self.service_level = v.into();
11866 self
11867 }
11868
11869 /// Sets the value of [capacity_gib][crate::model::Volume::capacity_gib].
11870 ///
11871 /// # Example
11872 /// ```ignore,no_run
11873 /// # use google_cloud_netapp_v1::model::Volume;
11874 /// let x = Volume::new().set_capacity_gib(42);
11875 /// ```
11876 pub fn set_capacity_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
11877 self.capacity_gib = v.into();
11878 self
11879 }
11880
11881 /// Sets the value of [export_policy][crate::model::Volume::export_policy].
11882 ///
11883 /// # Example
11884 /// ```ignore,no_run
11885 /// # use google_cloud_netapp_v1::model::Volume;
11886 /// use google_cloud_netapp_v1::model::ExportPolicy;
11887 /// let x = Volume::new().set_export_policy(ExportPolicy::default()/* use setters */);
11888 /// ```
11889 pub fn set_export_policy<T>(mut self, v: T) -> Self
11890 where
11891 T: std::convert::Into<crate::model::ExportPolicy>,
11892 {
11893 self.export_policy = std::option::Option::Some(v.into());
11894 self
11895 }
11896
11897 /// Sets or clears the value of [export_policy][crate::model::Volume::export_policy].
11898 ///
11899 /// # Example
11900 /// ```ignore,no_run
11901 /// # use google_cloud_netapp_v1::model::Volume;
11902 /// use google_cloud_netapp_v1::model::ExportPolicy;
11903 /// let x = Volume::new().set_or_clear_export_policy(Some(ExportPolicy::default()/* use setters */));
11904 /// let x = Volume::new().set_or_clear_export_policy(None::<ExportPolicy>);
11905 /// ```
11906 pub fn set_or_clear_export_policy<T>(mut self, v: std::option::Option<T>) -> Self
11907 where
11908 T: std::convert::Into<crate::model::ExportPolicy>,
11909 {
11910 self.export_policy = v.map(|x| x.into());
11911 self
11912 }
11913
11914 /// Sets the value of [protocols][crate::model::Volume::protocols].
11915 ///
11916 /// # Example
11917 /// ```ignore,no_run
11918 /// # use google_cloud_netapp_v1::model::Volume;
11919 /// use google_cloud_netapp_v1::model::Protocols;
11920 /// let x = Volume::new().set_protocols([
11921 /// Protocols::Nfsv3,
11922 /// Protocols::Nfsv4,
11923 /// Protocols::Smb,
11924 /// ]);
11925 /// ```
11926 pub fn set_protocols<T, V>(mut self, v: T) -> Self
11927 where
11928 T: std::iter::IntoIterator<Item = V>,
11929 V: std::convert::Into<crate::model::Protocols>,
11930 {
11931 use std::iter::Iterator;
11932 self.protocols = v.into_iter().map(|i| i.into()).collect();
11933 self
11934 }
11935
11936 /// Sets the value of [smb_settings][crate::model::Volume::smb_settings].
11937 ///
11938 /// # Example
11939 /// ```ignore,no_run
11940 /// # use google_cloud_netapp_v1::model::Volume;
11941 /// use google_cloud_netapp_v1::model::SMBSettings;
11942 /// let x = Volume::new().set_smb_settings([
11943 /// SMBSettings::EncryptData,
11944 /// SMBSettings::Browsable,
11945 /// SMBSettings::ChangeNotify,
11946 /// ]);
11947 /// ```
11948 pub fn set_smb_settings<T, V>(mut self, v: T) -> Self
11949 where
11950 T: std::iter::IntoIterator<Item = V>,
11951 V: std::convert::Into<crate::model::SMBSettings>,
11952 {
11953 use std::iter::Iterator;
11954 self.smb_settings = v.into_iter().map(|i| i.into()).collect();
11955 self
11956 }
11957
11958 /// Sets the value of [mount_options][crate::model::Volume::mount_options].
11959 ///
11960 /// # Example
11961 /// ```ignore,no_run
11962 /// # use google_cloud_netapp_v1::model::Volume;
11963 /// use google_cloud_netapp_v1::model::MountOption;
11964 /// let x = Volume::new()
11965 /// .set_mount_options([
11966 /// MountOption::default()/* use setters */,
11967 /// MountOption::default()/* use (different) setters */,
11968 /// ]);
11969 /// ```
11970 pub fn set_mount_options<T, V>(mut self, v: T) -> Self
11971 where
11972 T: std::iter::IntoIterator<Item = V>,
11973 V: std::convert::Into<crate::model::MountOption>,
11974 {
11975 use std::iter::Iterator;
11976 self.mount_options = v.into_iter().map(|i| i.into()).collect();
11977 self
11978 }
11979
11980 /// Sets the value of [unix_permissions][crate::model::Volume::unix_permissions].
11981 ///
11982 /// # Example
11983 /// ```ignore,no_run
11984 /// # use google_cloud_netapp_v1::model::Volume;
11985 /// let x = Volume::new().set_unix_permissions("example");
11986 /// ```
11987 pub fn set_unix_permissions<T: std::convert::Into<std::string::String>>(
11988 mut self,
11989 v: T,
11990 ) -> Self {
11991 self.unix_permissions = v.into();
11992 self
11993 }
11994
11995 /// Sets the value of [labels][crate::model::Volume::labels].
11996 ///
11997 /// # Example
11998 /// ```ignore,no_run
11999 /// # use google_cloud_netapp_v1::model::Volume;
12000 /// let x = Volume::new().set_labels([
12001 /// ("key0", "abc"),
12002 /// ("key1", "xyz"),
12003 /// ]);
12004 /// ```
12005 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
12006 where
12007 T: std::iter::IntoIterator<Item = (K, V)>,
12008 K: std::convert::Into<std::string::String>,
12009 V: std::convert::Into<std::string::String>,
12010 {
12011 use std::iter::Iterator;
12012 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
12013 self
12014 }
12015
12016 /// Sets the value of [description][crate::model::Volume::description].
12017 ///
12018 /// # Example
12019 /// ```ignore,no_run
12020 /// # use google_cloud_netapp_v1::model::Volume;
12021 /// let x = Volume::new().set_description("example");
12022 /// ```
12023 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12024 self.description = v.into();
12025 self
12026 }
12027
12028 /// Sets the value of [snapshot_policy][crate::model::Volume::snapshot_policy].
12029 ///
12030 /// # Example
12031 /// ```ignore,no_run
12032 /// # use google_cloud_netapp_v1::model::Volume;
12033 /// use google_cloud_netapp_v1::model::SnapshotPolicy;
12034 /// let x = Volume::new().set_snapshot_policy(SnapshotPolicy::default()/* use setters */);
12035 /// ```
12036 pub fn set_snapshot_policy<T>(mut self, v: T) -> Self
12037 where
12038 T: std::convert::Into<crate::model::SnapshotPolicy>,
12039 {
12040 self.snapshot_policy = std::option::Option::Some(v.into());
12041 self
12042 }
12043
12044 /// Sets or clears the value of [snapshot_policy][crate::model::Volume::snapshot_policy].
12045 ///
12046 /// # Example
12047 /// ```ignore,no_run
12048 /// # use google_cloud_netapp_v1::model::Volume;
12049 /// use google_cloud_netapp_v1::model::SnapshotPolicy;
12050 /// let x = Volume::new().set_or_clear_snapshot_policy(Some(SnapshotPolicy::default()/* use setters */));
12051 /// let x = Volume::new().set_or_clear_snapshot_policy(None::<SnapshotPolicy>);
12052 /// ```
12053 pub fn set_or_clear_snapshot_policy<T>(mut self, v: std::option::Option<T>) -> Self
12054 where
12055 T: std::convert::Into<crate::model::SnapshotPolicy>,
12056 {
12057 self.snapshot_policy = v.map(|x| x.into());
12058 self
12059 }
12060
12061 /// Sets the value of [snap_reserve][crate::model::Volume::snap_reserve].
12062 ///
12063 /// # Example
12064 /// ```ignore,no_run
12065 /// # use google_cloud_netapp_v1::model::Volume;
12066 /// let x = Volume::new().set_snap_reserve(42.0);
12067 /// ```
12068 pub fn set_snap_reserve<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
12069 self.snap_reserve = v.into();
12070 self
12071 }
12072
12073 /// Sets the value of [snapshot_directory][crate::model::Volume::snapshot_directory].
12074 ///
12075 /// # Example
12076 /// ```ignore,no_run
12077 /// # use google_cloud_netapp_v1::model::Volume;
12078 /// let x = Volume::new().set_snapshot_directory(true);
12079 /// ```
12080 pub fn set_snapshot_directory<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12081 self.snapshot_directory = v.into();
12082 self
12083 }
12084
12085 /// Sets the value of [used_gib][crate::model::Volume::used_gib].
12086 ///
12087 /// # Example
12088 /// ```ignore,no_run
12089 /// # use google_cloud_netapp_v1::model::Volume;
12090 /// let x = Volume::new().set_used_gib(42);
12091 /// ```
12092 pub fn set_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12093 self.used_gib = v.into();
12094 self
12095 }
12096
12097 /// Sets the value of [security_style][crate::model::Volume::security_style].
12098 ///
12099 /// # Example
12100 /// ```ignore,no_run
12101 /// # use google_cloud_netapp_v1::model::Volume;
12102 /// use google_cloud_netapp_v1::model::SecurityStyle;
12103 /// let x0 = Volume::new().set_security_style(SecurityStyle::Ntfs);
12104 /// let x1 = Volume::new().set_security_style(SecurityStyle::Unix);
12105 /// ```
12106 pub fn set_security_style<T: std::convert::Into<crate::model::SecurityStyle>>(
12107 mut self,
12108 v: T,
12109 ) -> Self {
12110 self.security_style = v.into();
12111 self
12112 }
12113
12114 /// Sets the value of [kerberos_enabled][crate::model::Volume::kerberos_enabled].
12115 ///
12116 /// # Example
12117 /// ```ignore,no_run
12118 /// # use google_cloud_netapp_v1::model::Volume;
12119 /// let x = Volume::new().set_kerberos_enabled(true);
12120 /// ```
12121 pub fn set_kerberos_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12122 self.kerberos_enabled = v.into();
12123 self
12124 }
12125
12126 /// Sets the value of [ldap_enabled][crate::model::Volume::ldap_enabled].
12127 ///
12128 /// # Example
12129 /// ```ignore,no_run
12130 /// # use google_cloud_netapp_v1::model::Volume;
12131 /// let x = Volume::new().set_ldap_enabled(true);
12132 /// ```
12133 pub fn set_ldap_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12134 self.ldap_enabled = v.into();
12135 self
12136 }
12137
12138 /// Sets the value of [active_directory][crate::model::Volume::active_directory].
12139 ///
12140 /// # Example
12141 /// ```ignore,no_run
12142 /// # use google_cloud_netapp_v1::model::Volume;
12143 /// let x = Volume::new().set_active_directory("example");
12144 /// ```
12145 pub fn set_active_directory<T: std::convert::Into<std::string::String>>(
12146 mut self,
12147 v: T,
12148 ) -> Self {
12149 self.active_directory = v.into();
12150 self
12151 }
12152
12153 /// Sets the value of [restore_parameters][crate::model::Volume::restore_parameters].
12154 ///
12155 /// # Example
12156 /// ```ignore,no_run
12157 /// # use google_cloud_netapp_v1::model::Volume;
12158 /// use google_cloud_netapp_v1::model::RestoreParameters;
12159 /// let x = Volume::new().set_restore_parameters(RestoreParameters::default()/* use setters */);
12160 /// ```
12161 pub fn set_restore_parameters<T>(mut self, v: T) -> Self
12162 where
12163 T: std::convert::Into<crate::model::RestoreParameters>,
12164 {
12165 self.restore_parameters = std::option::Option::Some(v.into());
12166 self
12167 }
12168
12169 /// Sets or clears the value of [restore_parameters][crate::model::Volume::restore_parameters].
12170 ///
12171 /// # Example
12172 /// ```ignore,no_run
12173 /// # use google_cloud_netapp_v1::model::Volume;
12174 /// use google_cloud_netapp_v1::model::RestoreParameters;
12175 /// let x = Volume::new().set_or_clear_restore_parameters(Some(RestoreParameters::default()/* use setters */));
12176 /// let x = Volume::new().set_or_clear_restore_parameters(None::<RestoreParameters>);
12177 /// ```
12178 pub fn set_or_clear_restore_parameters<T>(mut self, v: std::option::Option<T>) -> Self
12179 where
12180 T: std::convert::Into<crate::model::RestoreParameters>,
12181 {
12182 self.restore_parameters = v.map(|x| x.into());
12183 self
12184 }
12185
12186 /// Sets the value of [kms_config][crate::model::Volume::kms_config].
12187 ///
12188 /// # Example
12189 /// ```ignore,no_run
12190 /// # use google_cloud_netapp_v1::model::Volume;
12191 /// let x = Volume::new().set_kms_config("example");
12192 /// ```
12193 pub fn set_kms_config<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12194 self.kms_config = v.into();
12195 self
12196 }
12197
12198 /// Sets the value of [encryption_type][crate::model::Volume::encryption_type].
12199 ///
12200 /// # Example
12201 /// ```ignore,no_run
12202 /// # use google_cloud_netapp_v1::model::Volume;
12203 /// use google_cloud_netapp_v1::model::EncryptionType;
12204 /// let x0 = Volume::new().set_encryption_type(EncryptionType::ServiceManaged);
12205 /// let x1 = Volume::new().set_encryption_type(EncryptionType::CloudKms);
12206 /// ```
12207 pub fn set_encryption_type<T: std::convert::Into<crate::model::EncryptionType>>(
12208 mut self,
12209 v: T,
12210 ) -> Self {
12211 self.encryption_type = v.into();
12212 self
12213 }
12214
12215 /// Sets the value of [has_replication][crate::model::Volume::has_replication].
12216 ///
12217 /// # Example
12218 /// ```ignore,no_run
12219 /// # use google_cloud_netapp_v1::model::Volume;
12220 /// let x = Volume::new().set_has_replication(true);
12221 /// ```
12222 pub fn set_has_replication<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12223 self.has_replication = v.into();
12224 self
12225 }
12226
12227 /// Sets the value of [backup_config][crate::model::Volume::backup_config].
12228 ///
12229 /// # Example
12230 /// ```ignore,no_run
12231 /// # use google_cloud_netapp_v1::model::Volume;
12232 /// use google_cloud_netapp_v1::model::BackupConfig;
12233 /// let x = Volume::new().set_backup_config(BackupConfig::default()/* use setters */);
12234 /// ```
12235 pub fn set_backup_config<T>(mut self, v: T) -> Self
12236 where
12237 T: std::convert::Into<crate::model::BackupConfig>,
12238 {
12239 self.backup_config = std::option::Option::Some(v.into());
12240 self
12241 }
12242
12243 /// Sets or clears the value of [backup_config][crate::model::Volume::backup_config].
12244 ///
12245 /// # Example
12246 /// ```ignore,no_run
12247 /// # use google_cloud_netapp_v1::model::Volume;
12248 /// use google_cloud_netapp_v1::model::BackupConfig;
12249 /// let x = Volume::new().set_or_clear_backup_config(Some(BackupConfig::default()/* use setters */));
12250 /// let x = Volume::new().set_or_clear_backup_config(None::<BackupConfig>);
12251 /// ```
12252 pub fn set_or_clear_backup_config<T>(mut self, v: std::option::Option<T>) -> Self
12253 where
12254 T: std::convert::Into<crate::model::BackupConfig>,
12255 {
12256 self.backup_config = v.map(|x| x.into());
12257 self
12258 }
12259
12260 /// Sets the value of [restricted_actions][crate::model::Volume::restricted_actions].
12261 ///
12262 /// # Example
12263 /// ```ignore,no_run
12264 /// # use google_cloud_netapp_v1::model::Volume;
12265 /// use google_cloud_netapp_v1::model::RestrictedAction;
12266 /// let x = Volume::new().set_restricted_actions([
12267 /// RestrictedAction::Delete,
12268 /// ]);
12269 /// ```
12270 pub fn set_restricted_actions<T, V>(mut self, v: T) -> Self
12271 where
12272 T: std::iter::IntoIterator<Item = V>,
12273 V: std::convert::Into<crate::model::RestrictedAction>,
12274 {
12275 use std::iter::Iterator;
12276 self.restricted_actions = v.into_iter().map(|i| i.into()).collect();
12277 self
12278 }
12279
12280 /// Sets the value of [large_capacity][crate::model::Volume::large_capacity].
12281 ///
12282 /// # Example
12283 /// ```ignore,no_run
12284 /// # use google_cloud_netapp_v1::model::Volume;
12285 /// let x = Volume::new().set_large_capacity(true);
12286 /// ```
12287 pub fn set_large_capacity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12288 self.large_capacity = v.into();
12289 self
12290 }
12291
12292 /// Sets the value of [multiple_endpoints][crate::model::Volume::multiple_endpoints].
12293 ///
12294 /// # Example
12295 /// ```ignore,no_run
12296 /// # use google_cloud_netapp_v1::model::Volume;
12297 /// let x = Volume::new().set_multiple_endpoints(true);
12298 /// ```
12299 pub fn set_multiple_endpoints<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
12300 self.multiple_endpoints = v.into();
12301 self
12302 }
12303
12304 /// Sets the value of [tiering_policy][crate::model::Volume::tiering_policy].
12305 ///
12306 /// # Example
12307 /// ```ignore,no_run
12308 /// # use google_cloud_netapp_v1::model::Volume;
12309 /// use google_cloud_netapp_v1::model::TieringPolicy;
12310 /// let x = Volume::new().set_tiering_policy(TieringPolicy::default()/* use setters */);
12311 /// ```
12312 pub fn set_tiering_policy<T>(mut self, v: T) -> Self
12313 where
12314 T: std::convert::Into<crate::model::TieringPolicy>,
12315 {
12316 self.tiering_policy = std::option::Option::Some(v.into());
12317 self
12318 }
12319
12320 /// Sets or clears the value of [tiering_policy][crate::model::Volume::tiering_policy].
12321 ///
12322 /// # Example
12323 /// ```ignore,no_run
12324 /// # use google_cloud_netapp_v1::model::Volume;
12325 /// use google_cloud_netapp_v1::model::TieringPolicy;
12326 /// let x = Volume::new().set_or_clear_tiering_policy(Some(TieringPolicy::default()/* use setters */));
12327 /// let x = Volume::new().set_or_clear_tiering_policy(None::<TieringPolicy>);
12328 /// ```
12329 pub fn set_or_clear_tiering_policy<T>(mut self, v: std::option::Option<T>) -> Self
12330 where
12331 T: std::convert::Into<crate::model::TieringPolicy>,
12332 {
12333 self.tiering_policy = v.map(|x| x.into());
12334 self
12335 }
12336
12337 /// Sets the value of [replica_zone][crate::model::Volume::replica_zone].
12338 ///
12339 /// # Example
12340 /// ```ignore,no_run
12341 /// # use google_cloud_netapp_v1::model::Volume;
12342 /// let x = Volume::new().set_replica_zone("example");
12343 /// ```
12344 pub fn set_replica_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12345 self.replica_zone = v.into();
12346 self
12347 }
12348
12349 /// Sets the value of [zone][crate::model::Volume::zone].
12350 ///
12351 /// # Example
12352 /// ```ignore,no_run
12353 /// # use google_cloud_netapp_v1::model::Volume;
12354 /// let x = Volume::new().set_zone("example");
12355 /// ```
12356 pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
12357 self.zone = v.into();
12358 self
12359 }
12360
12361 /// Sets the value of [cold_tier_size_gib][crate::model::Volume::cold_tier_size_gib].
12362 ///
12363 /// # Example
12364 /// ```ignore,no_run
12365 /// # use google_cloud_netapp_v1::model::Volume;
12366 /// let x = Volume::new().set_cold_tier_size_gib(42);
12367 /// ```
12368 pub fn set_cold_tier_size_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12369 self.cold_tier_size_gib = v.into();
12370 self
12371 }
12372
12373 /// Sets the value of [hybrid_replication_parameters][crate::model::Volume::hybrid_replication_parameters].
12374 ///
12375 /// # Example
12376 /// ```ignore,no_run
12377 /// # use google_cloud_netapp_v1::model::Volume;
12378 /// use google_cloud_netapp_v1::model::HybridReplicationParameters;
12379 /// let x = Volume::new().set_hybrid_replication_parameters(HybridReplicationParameters::default()/* use setters */);
12380 /// ```
12381 pub fn set_hybrid_replication_parameters<T>(mut self, v: T) -> Self
12382 where
12383 T: std::convert::Into<crate::model::HybridReplicationParameters>,
12384 {
12385 self.hybrid_replication_parameters = std::option::Option::Some(v.into());
12386 self
12387 }
12388
12389 /// Sets or clears the value of [hybrid_replication_parameters][crate::model::Volume::hybrid_replication_parameters].
12390 ///
12391 /// # Example
12392 /// ```ignore,no_run
12393 /// # use google_cloud_netapp_v1::model::Volume;
12394 /// use google_cloud_netapp_v1::model::HybridReplicationParameters;
12395 /// let x = Volume::new().set_or_clear_hybrid_replication_parameters(Some(HybridReplicationParameters::default()/* use setters */));
12396 /// let x = Volume::new().set_or_clear_hybrid_replication_parameters(None::<HybridReplicationParameters>);
12397 /// ```
12398 pub fn set_or_clear_hybrid_replication_parameters<T>(
12399 mut self,
12400 v: std::option::Option<T>,
12401 ) -> Self
12402 where
12403 T: std::convert::Into<crate::model::HybridReplicationParameters>,
12404 {
12405 self.hybrid_replication_parameters = v.map(|x| x.into());
12406 self
12407 }
12408
12409 /// Sets the value of [throughput_mibps][crate::model::Volume::throughput_mibps].
12410 ///
12411 /// # Example
12412 /// ```ignore,no_run
12413 /// # use google_cloud_netapp_v1::model::Volume;
12414 /// let x = Volume::new().set_throughput_mibps(42.0);
12415 /// ```
12416 pub fn set_throughput_mibps<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
12417 self.throughput_mibps = v.into();
12418 self
12419 }
12420
12421 /// Sets the value of [hot_tier_size_used_gib][crate::model::Volume::hot_tier_size_used_gib].
12422 ///
12423 /// # Example
12424 /// ```ignore,no_run
12425 /// # use google_cloud_netapp_v1::model::Volume;
12426 /// let x = Volume::new().set_hot_tier_size_used_gib(42);
12427 /// ```
12428 pub fn set_hot_tier_size_used_gib<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
12429 self.hot_tier_size_used_gib = v.into();
12430 self
12431 }
12432}
12433
12434impl wkt::message::Message for Volume {
12435 fn typename() -> &'static str {
12436 "type.googleapis.com/google.cloud.netapp.v1.Volume"
12437 }
12438}
12439
12440/// Defines additional types related to [Volume].
12441pub mod volume {
12442 #[allow(unused_imports)]
12443 use super::*;
12444
12445 /// The volume states
12446 ///
12447 /// # Working with unknown values
12448 ///
12449 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
12450 /// additional enum variants at any time. Adding new variants is not considered
12451 /// a breaking change. Applications should write their code in anticipation of:
12452 ///
12453 /// - New values appearing in future releases of the client library, **and**
12454 /// - New values received dynamically, without application changes.
12455 ///
12456 /// Please consult the [Working with enums] section in the user guide for some
12457 /// guidelines.
12458 ///
12459 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
12460 #[derive(Clone, Debug, PartialEq)]
12461 #[non_exhaustive]
12462 pub enum State {
12463 /// Unspecified Volume State
12464 Unspecified,
12465 /// Volume State is Ready
12466 Ready,
12467 /// Volume State is Creating
12468 Creating,
12469 /// Volume State is Deleting
12470 Deleting,
12471 /// Volume State is Updating
12472 Updating,
12473 /// Volume State is Restoring
12474 Restoring,
12475 /// Volume State is Disabled
12476 Disabled,
12477 /// Volume State is Error
12478 Error,
12479 /// Volume State is Preparing. Note that this is different from CREATING
12480 /// where CREATING means the volume is being created, while PREPARING means
12481 /// the volume is created and now being prepared for the replication.
12482 Preparing,
12483 /// Volume State is Read Only
12484 ReadOnly,
12485 /// If set, the enum was initialized with an unknown value.
12486 ///
12487 /// Applications can examine the value using [State::value] or
12488 /// [State::name].
12489 UnknownValue(state::UnknownValue),
12490 }
12491
12492 #[doc(hidden)]
12493 pub mod state {
12494 #[allow(unused_imports)]
12495 use super::*;
12496 #[derive(Clone, Debug, PartialEq)]
12497 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
12498 }
12499
12500 impl State {
12501 /// Gets the enum value.
12502 ///
12503 /// Returns `None` if the enum contains an unknown value deserialized from
12504 /// the string representation of enums.
12505 pub fn value(&self) -> std::option::Option<i32> {
12506 match self {
12507 Self::Unspecified => std::option::Option::Some(0),
12508 Self::Ready => std::option::Option::Some(1),
12509 Self::Creating => std::option::Option::Some(2),
12510 Self::Deleting => std::option::Option::Some(3),
12511 Self::Updating => std::option::Option::Some(4),
12512 Self::Restoring => std::option::Option::Some(5),
12513 Self::Disabled => std::option::Option::Some(6),
12514 Self::Error => std::option::Option::Some(7),
12515 Self::Preparing => std::option::Option::Some(8),
12516 Self::ReadOnly => std::option::Option::Some(9),
12517 Self::UnknownValue(u) => u.0.value(),
12518 }
12519 }
12520
12521 /// Gets the enum value as a string.
12522 ///
12523 /// Returns `None` if the enum contains an unknown value deserialized from
12524 /// the integer representation of enums.
12525 pub fn name(&self) -> std::option::Option<&str> {
12526 match self {
12527 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
12528 Self::Ready => std::option::Option::Some("READY"),
12529 Self::Creating => std::option::Option::Some("CREATING"),
12530 Self::Deleting => std::option::Option::Some("DELETING"),
12531 Self::Updating => std::option::Option::Some("UPDATING"),
12532 Self::Restoring => std::option::Option::Some("RESTORING"),
12533 Self::Disabled => std::option::Option::Some("DISABLED"),
12534 Self::Error => std::option::Option::Some("ERROR"),
12535 Self::Preparing => std::option::Option::Some("PREPARING"),
12536 Self::ReadOnly => std::option::Option::Some("READ_ONLY"),
12537 Self::UnknownValue(u) => u.0.name(),
12538 }
12539 }
12540 }
12541
12542 impl std::default::Default for State {
12543 fn default() -> Self {
12544 use std::convert::From;
12545 Self::from(0)
12546 }
12547 }
12548
12549 impl std::fmt::Display for State {
12550 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
12551 wkt::internal::display_enum(f, self.name(), self.value())
12552 }
12553 }
12554
12555 impl std::convert::From<i32> for State {
12556 fn from(value: i32) -> Self {
12557 match value {
12558 0 => Self::Unspecified,
12559 1 => Self::Ready,
12560 2 => Self::Creating,
12561 3 => Self::Deleting,
12562 4 => Self::Updating,
12563 5 => Self::Restoring,
12564 6 => Self::Disabled,
12565 7 => Self::Error,
12566 8 => Self::Preparing,
12567 9 => Self::ReadOnly,
12568 _ => Self::UnknownValue(state::UnknownValue(
12569 wkt::internal::UnknownEnumValue::Integer(value),
12570 )),
12571 }
12572 }
12573 }
12574
12575 impl std::convert::From<&str> for State {
12576 fn from(value: &str) -> Self {
12577 use std::string::ToString;
12578 match value {
12579 "STATE_UNSPECIFIED" => Self::Unspecified,
12580 "READY" => Self::Ready,
12581 "CREATING" => Self::Creating,
12582 "DELETING" => Self::Deleting,
12583 "UPDATING" => Self::Updating,
12584 "RESTORING" => Self::Restoring,
12585 "DISABLED" => Self::Disabled,
12586 "ERROR" => Self::Error,
12587 "PREPARING" => Self::Preparing,
12588 "READ_ONLY" => Self::ReadOnly,
12589 _ => Self::UnknownValue(state::UnknownValue(
12590 wkt::internal::UnknownEnumValue::String(value.to_string()),
12591 )),
12592 }
12593 }
12594 }
12595
12596 impl serde::ser::Serialize for State {
12597 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
12598 where
12599 S: serde::Serializer,
12600 {
12601 match self {
12602 Self::Unspecified => serializer.serialize_i32(0),
12603 Self::Ready => serializer.serialize_i32(1),
12604 Self::Creating => serializer.serialize_i32(2),
12605 Self::Deleting => serializer.serialize_i32(3),
12606 Self::Updating => serializer.serialize_i32(4),
12607 Self::Restoring => serializer.serialize_i32(5),
12608 Self::Disabled => serializer.serialize_i32(6),
12609 Self::Error => serializer.serialize_i32(7),
12610 Self::Preparing => serializer.serialize_i32(8),
12611 Self::ReadOnly => serializer.serialize_i32(9),
12612 Self::UnknownValue(u) => u.0.serialize(serializer),
12613 }
12614 }
12615 }
12616
12617 impl<'de> serde::de::Deserialize<'de> for State {
12618 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
12619 where
12620 D: serde::Deserializer<'de>,
12621 {
12622 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
12623 ".google.cloud.netapp.v1.Volume.State",
12624 ))
12625 }
12626 }
12627}
12628
12629/// Defines the export policy for the volume.
12630#[derive(Clone, Default, PartialEq)]
12631#[non_exhaustive]
12632pub struct ExportPolicy {
12633 /// Required. List of export policy rules
12634 pub rules: std::vec::Vec<crate::model::SimpleExportPolicyRule>,
12635
12636 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12637}
12638
12639impl ExportPolicy {
12640 pub fn new() -> Self {
12641 std::default::Default::default()
12642 }
12643
12644 /// Sets the value of [rules][crate::model::ExportPolicy::rules].
12645 ///
12646 /// # Example
12647 /// ```ignore,no_run
12648 /// # use google_cloud_netapp_v1::model::ExportPolicy;
12649 /// use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
12650 /// let x = ExportPolicy::new()
12651 /// .set_rules([
12652 /// SimpleExportPolicyRule::default()/* use setters */,
12653 /// SimpleExportPolicyRule::default()/* use (different) setters */,
12654 /// ]);
12655 /// ```
12656 pub fn set_rules<T, V>(mut self, v: T) -> Self
12657 where
12658 T: std::iter::IntoIterator<Item = V>,
12659 V: std::convert::Into<crate::model::SimpleExportPolicyRule>,
12660 {
12661 use std::iter::Iterator;
12662 self.rules = v.into_iter().map(|i| i.into()).collect();
12663 self
12664 }
12665}
12666
12667impl wkt::message::Message for ExportPolicy {
12668 fn typename() -> &'static str {
12669 "type.googleapis.com/google.cloud.netapp.v1.ExportPolicy"
12670 }
12671}
12672
12673/// An export policy rule describing various export options.
12674#[derive(Clone, Default, PartialEq)]
12675#[non_exhaustive]
12676pub struct SimpleExportPolicyRule {
12677 /// Comma separated list of allowed clients IP addresses
12678 pub allowed_clients: std::option::Option<std::string::String>,
12679
12680 /// Whether Unix root access will be granted.
12681 pub has_root_access: std::option::Option<std::string::String>,
12682
12683 /// Access type (ReadWrite, ReadOnly, None)
12684 pub access_type: std::option::Option<crate::model::AccessType>,
12685
12686 /// NFS V3 protocol.
12687 pub nfsv3: std::option::Option<bool>,
12688
12689 /// NFS V4 protocol.
12690 pub nfsv4: std::option::Option<bool>,
12691
12692 /// If enabled (true) the rule defines a read only access for clients matching
12693 /// the 'allowedClients' specification. It enables nfs clients to mount using
12694 /// 'authentication' kerberos security mode.
12695 pub kerberos_5_read_only: std::option::Option<bool>,
12696
12697 /// If enabled (true) the rule defines read and write access for clients
12698 /// matching the 'allowedClients' specification. It enables nfs clients to
12699 /// mount using 'authentication' kerberos security mode. The
12700 /// 'kerberos5ReadOnly' value be ignored if this is enabled.
12701 pub kerberos_5_read_write: std::option::Option<bool>,
12702
12703 /// If enabled (true) the rule defines a read only access for clients matching
12704 /// the 'allowedClients' specification. It enables nfs clients to mount using
12705 /// 'integrity' kerberos security mode.
12706 pub kerberos_5i_read_only: std::option::Option<bool>,
12707
12708 /// If enabled (true) the rule defines read and write access for clients
12709 /// matching the 'allowedClients' specification. It enables nfs clients to
12710 /// mount using 'integrity' kerberos security mode. The 'kerberos5iReadOnly'
12711 /// value be ignored if this is enabled.
12712 pub kerberos_5i_read_write: std::option::Option<bool>,
12713
12714 /// If enabled (true) the rule defines a read only access for clients matching
12715 /// the 'allowedClients' specification. It enables nfs clients to mount using
12716 /// 'privacy' kerberos security mode.
12717 pub kerberos_5p_read_only: std::option::Option<bool>,
12718
12719 /// If enabled (true) the rule defines read and write access for clients
12720 /// matching the 'allowedClients' specification. It enables nfs clients to
12721 /// mount using 'privacy' kerberos security mode. The 'kerberos5pReadOnly'
12722 /// value be ignored if this is enabled.
12723 pub kerberos_5p_read_write: std::option::Option<bool>,
12724
12725 /// Optional. Defines how user identity squashing is applied for this export
12726 /// rule. This field is the preferred way to configure squashing behavior and
12727 /// takes precedence over `has_root_access` if both are provided.
12728 pub squash_mode: std::option::Option<crate::model::simple_export_policy_rule::SquashMode>,
12729
12730 /// Optional. An integer representing the anonymous user ID. Range is 0 to
12731 /// 4294967295. Required when squash_mode is ROOT_SQUASH or ALL_SQUASH.
12732 pub anon_uid: std::option::Option<i64>,
12733
12734 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
12735}
12736
12737impl SimpleExportPolicyRule {
12738 pub fn new() -> Self {
12739 std::default::Default::default()
12740 }
12741
12742 /// Sets the value of [allowed_clients][crate::model::SimpleExportPolicyRule::allowed_clients].
12743 ///
12744 /// # Example
12745 /// ```ignore,no_run
12746 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
12747 /// let x = SimpleExportPolicyRule::new().set_allowed_clients("example");
12748 /// ```
12749 pub fn set_allowed_clients<T>(mut self, v: T) -> Self
12750 where
12751 T: std::convert::Into<std::string::String>,
12752 {
12753 self.allowed_clients = std::option::Option::Some(v.into());
12754 self
12755 }
12756
12757 /// Sets or clears the value of [allowed_clients][crate::model::SimpleExportPolicyRule::allowed_clients].
12758 ///
12759 /// # Example
12760 /// ```ignore,no_run
12761 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
12762 /// let x = SimpleExportPolicyRule::new().set_or_clear_allowed_clients(Some("example"));
12763 /// let x = SimpleExportPolicyRule::new().set_or_clear_allowed_clients(None::<String>);
12764 /// ```
12765 pub fn set_or_clear_allowed_clients<T>(mut self, v: std::option::Option<T>) -> Self
12766 where
12767 T: std::convert::Into<std::string::String>,
12768 {
12769 self.allowed_clients = v.map(|x| x.into());
12770 self
12771 }
12772
12773 /// Sets the value of [has_root_access][crate::model::SimpleExportPolicyRule::has_root_access].
12774 ///
12775 /// # Example
12776 /// ```ignore,no_run
12777 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
12778 /// let x = SimpleExportPolicyRule::new().set_has_root_access("example");
12779 /// ```
12780 pub fn set_has_root_access<T>(mut self, v: T) -> Self
12781 where
12782 T: std::convert::Into<std::string::String>,
12783 {
12784 self.has_root_access = std::option::Option::Some(v.into());
12785 self
12786 }
12787
12788 /// Sets or clears the value of [has_root_access][crate::model::SimpleExportPolicyRule::has_root_access].
12789 ///
12790 /// # Example
12791 /// ```ignore,no_run
12792 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
12793 /// let x = SimpleExportPolicyRule::new().set_or_clear_has_root_access(Some("example"));
12794 /// let x = SimpleExportPolicyRule::new().set_or_clear_has_root_access(None::<String>);
12795 /// ```
12796 pub fn set_or_clear_has_root_access<T>(mut self, v: std::option::Option<T>) -> Self
12797 where
12798 T: std::convert::Into<std::string::String>,
12799 {
12800 self.has_root_access = v.map(|x| x.into());
12801 self
12802 }
12803
12804 /// Sets the value of [access_type][crate::model::SimpleExportPolicyRule::access_type].
12805 ///
12806 /// # Example
12807 /// ```ignore,no_run
12808 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
12809 /// use google_cloud_netapp_v1::model::AccessType;
12810 /// let x0 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadOnly);
12811 /// let x1 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadWrite);
12812 /// let x2 = SimpleExportPolicyRule::new().set_access_type(AccessType::ReadNone);
12813 /// ```
12814 pub fn set_access_type<T>(mut self, v: T) -> Self
12815 where
12816 T: std::convert::Into<crate::model::AccessType>,
12817 {
12818 self.access_type = std::option::Option::Some(v.into());
12819 self
12820 }
12821
12822 /// Sets or clears the value of [access_type][crate::model::SimpleExportPolicyRule::access_type].
12823 ///
12824 /// # Example
12825 /// ```ignore,no_run
12826 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
12827 /// use google_cloud_netapp_v1::model::AccessType;
12828 /// let x0 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadOnly));
12829 /// let x1 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadWrite));
12830 /// let x2 = SimpleExportPolicyRule::new().set_or_clear_access_type(Some(AccessType::ReadNone));
12831 /// let x_none = SimpleExportPolicyRule::new().set_or_clear_access_type(None::<AccessType>);
12832 /// ```
12833 pub fn set_or_clear_access_type<T>(mut self, v: std::option::Option<T>) -> Self
12834 where
12835 T: std::convert::Into<crate::model::AccessType>,
12836 {
12837 self.access_type = v.map(|x| x.into());
12838 self
12839 }
12840
12841 /// Sets the value of [nfsv3][crate::model::SimpleExportPolicyRule::nfsv3].
12842 ///
12843 /// # Example
12844 /// ```ignore,no_run
12845 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
12846 /// let x = SimpleExportPolicyRule::new().set_nfsv3(true);
12847 /// ```
12848 pub fn set_nfsv3<T>(mut self, v: T) -> Self
12849 where
12850 T: std::convert::Into<bool>,
12851 {
12852 self.nfsv3 = std::option::Option::Some(v.into());
12853 self
12854 }
12855
12856 /// Sets or clears the value of [nfsv3][crate::model::SimpleExportPolicyRule::nfsv3].
12857 ///
12858 /// # Example
12859 /// ```ignore,no_run
12860 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
12861 /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv3(Some(false));
12862 /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv3(None::<bool>);
12863 /// ```
12864 pub fn set_or_clear_nfsv3<T>(mut self, v: std::option::Option<T>) -> Self
12865 where
12866 T: std::convert::Into<bool>,
12867 {
12868 self.nfsv3 = v.map(|x| x.into());
12869 self
12870 }
12871
12872 /// Sets the value of [nfsv4][crate::model::SimpleExportPolicyRule::nfsv4].
12873 ///
12874 /// # Example
12875 /// ```ignore,no_run
12876 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
12877 /// let x = SimpleExportPolicyRule::new().set_nfsv4(true);
12878 /// ```
12879 pub fn set_nfsv4<T>(mut self, v: T) -> Self
12880 where
12881 T: std::convert::Into<bool>,
12882 {
12883 self.nfsv4 = std::option::Option::Some(v.into());
12884 self
12885 }
12886
12887 /// Sets or clears the value of [nfsv4][crate::model::SimpleExportPolicyRule::nfsv4].
12888 ///
12889 /// # Example
12890 /// ```ignore,no_run
12891 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
12892 /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv4(Some(false));
12893 /// let x = SimpleExportPolicyRule::new().set_or_clear_nfsv4(None::<bool>);
12894 /// ```
12895 pub fn set_or_clear_nfsv4<T>(mut self, v: std::option::Option<T>) -> Self
12896 where
12897 T: std::convert::Into<bool>,
12898 {
12899 self.nfsv4 = v.map(|x| x.into());
12900 self
12901 }
12902
12903 /// Sets the value of [kerberos_5_read_only][crate::model::SimpleExportPolicyRule::kerberos_5_read_only].
12904 ///
12905 /// # Example
12906 /// ```ignore,no_run
12907 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
12908 /// let x = SimpleExportPolicyRule::new().set_kerberos_5_read_only(true);
12909 /// ```
12910 pub fn set_kerberos_5_read_only<T>(mut self, v: T) -> Self
12911 where
12912 T: std::convert::Into<bool>,
12913 {
12914 self.kerberos_5_read_only = std::option::Option::Some(v.into());
12915 self
12916 }
12917
12918 /// Sets or clears the value of [kerberos_5_read_only][crate::model::SimpleExportPolicyRule::kerberos_5_read_only].
12919 ///
12920 /// # Example
12921 /// ```ignore,no_run
12922 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
12923 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_only(Some(false));
12924 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_only(None::<bool>);
12925 /// ```
12926 pub fn set_or_clear_kerberos_5_read_only<T>(mut self, v: std::option::Option<T>) -> Self
12927 where
12928 T: std::convert::Into<bool>,
12929 {
12930 self.kerberos_5_read_only = v.map(|x| x.into());
12931 self
12932 }
12933
12934 /// Sets the value of [kerberos_5_read_write][crate::model::SimpleExportPolicyRule::kerberos_5_read_write].
12935 ///
12936 /// # Example
12937 /// ```ignore,no_run
12938 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
12939 /// let x = SimpleExportPolicyRule::new().set_kerberos_5_read_write(true);
12940 /// ```
12941 pub fn set_kerberos_5_read_write<T>(mut self, v: T) -> Self
12942 where
12943 T: std::convert::Into<bool>,
12944 {
12945 self.kerberos_5_read_write = std::option::Option::Some(v.into());
12946 self
12947 }
12948
12949 /// Sets or clears the value of [kerberos_5_read_write][crate::model::SimpleExportPolicyRule::kerberos_5_read_write].
12950 ///
12951 /// # Example
12952 /// ```ignore,no_run
12953 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
12954 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_write(Some(false));
12955 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5_read_write(None::<bool>);
12956 /// ```
12957 pub fn set_or_clear_kerberos_5_read_write<T>(mut self, v: std::option::Option<T>) -> Self
12958 where
12959 T: std::convert::Into<bool>,
12960 {
12961 self.kerberos_5_read_write = v.map(|x| x.into());
12962 self
12963 }
12964
12965 /// Sets the value of [kerberos_5i_read_only][crate::model::SimpleExportPolicyRule::kerberos_5i_read_only].
12966 ///
12967 /// # Example
12968 /// ```ignore,no_run
12969 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
12970 /// let x = SimpleExportPolicyRule::new().set_kerberos_5i_read_only(true);
12971 /// ```
12972 pub fn set_kerberos_5i_read_only<T>(mut self, v: T) -> Self
12973 where
12974 T: std::convert::Into<bool>,
12975 {
12976 self.kerberos_5i_read_only = std::option::Option::Some(v.into());
12977 self
12978 }
12979
12980 /// Sets or clears the value of [kerberos_5i_read_only][crate::model::SimpleExportPolicyRule::kerberos_5i_read_only].
12981 ///
12982 /// # Example
12983 /// ```ignore,no_run
12984 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
12985 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_only(Some(false));
12986 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_only(None::<bool>);
12987 /// ```
12988 pub fn set_or_clear_kerberos_5i_read_only<T>(mut self, v: std::option::Option<T>) -> Self
12989 where
12990 T: std::convert::Into<bool>,
12991 {
12992 self.kerberos_5i_read_only = v.map(|x| x.into());
12993 self
12994 }
12995
12996 /// Sets the value of [kerberos_5i_read_write][crate::model::SimpleExportPolicyRule::kerberos_5i_read_write].
12997 ///
12998 /// # Example
12999 /// ```ignore,no_run
13000 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
13001 /// let x = SimpleExportPolicyRule::new().set_kerberos_5i_read_write(true);
13002 /// ```
13003 pub fn set_kerberos_5i_read_write<T>(mut self, v: T) -> Self
13004 where
13005 T: std::convert::Into<bool>,
13006 {
13007 self.kerberos_5i_read_write = std::option::Option::Some(v.into());
13008 self
13009 }
13010
13011 /// Sets or clears the value of [kerberos_5i_read_write][crate::model::SimpleExportPolicyRule::kerberos_5i_read_write].
13012 ///
13013 /// # Example
13014 /// ```ignore,no_run
13015 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
13016 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_write(Some(false));
13017 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5i_read_write(None::<bool>);
13018 /// ```
13019 pub fn set_or_clear_kerberos_5i_read_write<T>(mut self, v: std::option::Option<T>) -> Self
13020 where
13021 T: std::convert::Into<bool>,
13022 {
13023 self.kerberos_5i_read_write = v.map(|x| x.into());
13024 self
13025 }
13026
13027 /// Sets the value of [kerberos_5p_read_only][crate::model::SimpleExportPolicyRule::kerberos_5p_read_only].
13028 ///
13029 /// # Example
13030 /// ```ignore,no_run
13031 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
13032 /// let x = SimpleExportPolicyRule::new().set_kerberos_5p_read_only(true);
13033 /// ```
13034 pub fn set_kerberos_5p_read_only<T>(mut self, v: T) -> Self
13035 where
13036 T: std::convert::Into<bool>,
13037 {
13038 self.kerberos_5p_read_only = std::option::Option::Some(v.into());
13039 self
13040 }
13041
13042 /// Sets or clears the value of [kerberos_5p_read_only][crate::model::SimpleExportPolicyRule::kerberos_5p_read_only].
13043 ///
13044 /// # Example
13045 /// ```ignore,no_run
13046 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
13047 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_only(Some(false));
13048 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_only(None::<bool>);
13049 /// ```
13050 pub fn set_or_clear_kerberos_5p_read_only<T>(mut self, v: std::option::Option<T>) -> Self
13051 where
13052 T: std::convert::Into<bool>,
13053 {
13054 self.kerberos_5p_read_only = v.map(|x| x.into());
13055 self
13056 }
13057
13058 /// Sets the value of [kerberos_5p_read_write][crate::model::SimpleExportPolicyRule::kerberos_5p_read_write].
13059 ///
13060 /// # Example
13061 /// ```ignore,no_run
13062 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
13063 /// let x = SimpleExportPolicyRule::new().set_kerberos_5p_read_write(true);
13064 /// ```
13065 pub fn set_kerberos_5p_read_write<T>(mut self, v: T) -> Self
13066 where
13067 T: std::convert::Into<bool>,
13068 {
13069 self.kerberos_5p_read_write = std::option::Option::Some(v.into());
13070 self
13071 }
13072
13073 /// Sets or clears the value of [kerberos_5p_read_write][crate::model::SimpleExportPolicyRule::kerberos_5p_read_write].
13074 ///
13075 /// # Example
13076 /// ```ignore,no_run
13077 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
13078 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_write(Some(false));
13079 /// let x = SimpleExportPolicyRule::new().set_or_clear_kerberos_5p_read_write(None::<bool>);
13080 /// ```
13081 pub fn set_or_clear_kerberos_5p_read_write<T>(mut self, v: std::option::Option<T>) -> Self
13082 where
13083 T: std::convert::Into<bool>,
13084 {
13085 self.kerberos_5p_read_write = v.map(|x| x.into());
13086 self
13087 }
13088
13089 /// Sets the value of [squash_mode][crate::model::SimpleExportPolicyRule::squash_mode].
13090 ///
13091 /// # Example
13092 /// ```ignore,no_run
13093 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
13094 /// use google_cloud_netapp_v1::model::simple_export_policy_rule::SquashMode;
13095 /// let x0 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::NoRootSquash);
13096 /// let x1 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::RootSquash);
13097 /// let x2 = SimpleExportPolicyRule::new().set_squash_mode(SquashMode::AllSquash);
13098 /// ```
13099 pub fn set_squash_mode<T>(mut self, v: T) -> Self
13100 where
13101 T: std::convert::Into<crate::model::simple_export_policy_rule::SquashMode>,
13102 {
13103 self.squash_mode = std::option::Option::Some(v.into());
13104 self
13105 }
13106
13107 /// Sets or clears the value of [squash_mode][crate::model::SimpleExportPolicyRule::squash_mode].
13108 ///
13109 /// # Example
13110 /// ```ignore,no_run
13111 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
13112 /// use google_cloud_netapp_v1::model::simple_export_policy_rule::SquashMode;
13113 /// let x0 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::NoRootSquash));
13114 /// let x1 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::RootSquash));
13115 /// let x2 = SimpleExportPolicyRule::new().set_or_clear_squash_mode(Some(SquashMode::AllSquash));
13116 /// let x_none = SimpleExportPolicyRule::new().set_or_clear_squash_mode(None::<SquashMode>);
13117 /// ```
13118 pub fn set_or_clear_squash_mode<T>(mut self, v: std::option::Option<T>) -> Self
13119 where
13120 T: std::convert::Into<crate::model::simple_export_policy_rule::SquashMode>,
13121 {
13122 self.squash_mode = v.map(|x| x.into());
13123 self
13124 }
13125
13126 /// Sets the value of [anon_uid][crate::model::SimpleExportPolicyRule::anon_uid].
13127 ///
13128 /// # Example
13129 /// ```ignore,no_run
13130 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
13131 /// let x = SimpleExportPolicyRule::new().set_anon_uid(42);
13132 /// ```
13133 pub fn set_anon_uid<T>(mut self, v: T) -> Self
13134 where
13135 T: std::convert::Into<i64>,
13136 {
13137 self.anon_uid = std::option::Option::Some(v.into());
13138 self
13139 }
13140
13141 /// Sets or clears the value of [anon_uid][crate::model::SimpleExportPolicyRule::anon_uid].
13142 ///
13143 /// # Example
13144 /// ```ignore,no_run
13145 /// # use google_cloud_netapp_v1::model::SimpleExportPolicyRule;
13146 /// let x = SimpleExportPolicyRule::new().set_or_clear_anon_uid(Some(42));
13147 /// let x = SimpleExportPolicyRule::new().set_or_clear_anon_uid(None::<i32>);
13148 /// ```
13149 pub fn set_or_clear_anon_uid<T>(mut self, v: std::option::Option<T>) -> Self
13150 where
13151 T: std::convert::Into<i64>,
13152 {
13153 self.anon_uid = v.map(|x| x.into());
13154 self
13155 }
13156}
13157
13158impl wkt::message::Message for SimpleExportPolicyRule {
13159 fn typename() -> &'static str {
13160 "type.googleapis.com/google.cloud.netapp.v1.SimpleExportPolicyRule"
13161 }
13162}
13163
13164/// Defines additional types related to [SimpleExportPolicyRule].
13165pub mod simple_export_policy_rule {
13166 #[allow(unused_imports)]
13167 use super::*;
13168
13169 /// SquashMode defines how remote user privileges are restricted when accessing
13170 /// an NFS export. It controls how user identities (like root) are mapped to
13171 /// anonymous users to limit access and enforce security.
13172 ///
13173 /// # Working with unknown values
13174 ///
13175 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
13176 /// additional enum variants at any time. Adding new variants is not considered
13177 /// a breaking change. Applications should write their code in anticipation of:
13178 ///
13179 /// - New values appearing in future releases of the client library, **and**
13180 /// - New values received dynamically, without application changes.
13181 ///
13182 /// Please consult the [Working with enums] section in the user guide for some
13183 /// guidelines.
13184 ///
13185 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
13186 #[derive(Clone, Debug, PartialEq)]
13187 #[non_exhaustive]
13188 pub enum SquashMode {
13189 /// Defaults to NO_ROOT_SQUASH.
13190 Unspecified,
13191 /// The root user (UID 0) retains full access. Other users are
13192 /// unaffected.
13193 NoRootSquash,
13194 /// The root user (UID 0) is squashed to anonymous user ID. Other users are
13195 /// unaffected.
13196 RootSquash,
13197 /// All users are squashed to anonymous user ID.
13198 AllSquash,
13199 /// If set, the enum was initialized with an unknown value.
13200 ///
13201 /// Applications can examine the value using [SquashMode::value] or
13202 /// [SquashMode::name].
13203 UnknownValue(squash_mode::UnknownValue),
13204 }
13205
13206 #[doc(hidden)]
13207 pub mod squash_mode {
13208 #[allow(unused_imports)]
13209 use super::*;
13210 #[derive(Clone, Debug, PartialEq)]
13211 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
13212 }
13213
13214 impl SquashMode {
13215 /// Gets the enum value.
13216 ///
13217 /// Returns `None` if the enum contains an unknown value deserialized from
13218 /// the string representation of enums.
13219 pub fn value(&self) -> std::option::Option<i32> {
13220 match self {
13221 Self::Unspecified => std::option::Option::Some(0),
13222 Self::NoRootSquash => std::option::Option::Some(1),
13223 Self::RootSquash => std::option::Option::Some(2),
13224 Self::AllSquash => std::option::Option::Some(3),
13225 Self::UnknownValue(u) => u.0.value(),
13226 }
13227 }
13228
13229 /// Gets the enum value as a string.
13230 ///
13231 /// Returns `None` if the enum contains an unknown value deserialized from
13232 /// the integer representation of enums.
13233 pub fn name(&self) -> std::option::Option<&str> {
13234 match self {
13235 Self::Unspecified => std::option::Option::Some("SQUASH_MODE_UNSPECIFIED"),
13236 Self::NoRootSquash => std::option::Option::Some("NO_ROOT_SQUASH"),
13237 Self::RootSquash => std::option::Option::Some("ROOT_SQUASH"),
13238 Self::AllSquash => std::option::Option::Some("ALL_SQUASH"),
13239 Self::UnknownValue(u) => u.0.name(),
13240 }
13241 }
13242 }
13243
13244 impl std::default::Default for SquashMode {
13245 fn default() -> Self {
13246 use std::convert::From;
13247 Self::from(0)
13248 }
13249 }
13250
13251 impl std::fmt::Display for SquashMode {
13252 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
13253 wkt::internal::display_enum(f, self.name(), self.value())
13254 }
13255 }
13256
13257 impl std::convert::From<i32> for SquashMode {
13258 fn from(value: i32) -> Self {
13259 match value {
13260 0 => Self::Unspecified,
13261 1 => Self::NoRootSquash,
13262 2 => Self::RootSquash,
13263 3 => Self::AllSquash,
13264 _ => Self::UnknownValue(squash_mode::UnknownValue(
13265 wkt::internal::UnknownEnumValue::Integer(value),
13266 )),
13267 }
13268 }
13269 }
13270
13271 impl std::convert::From<&str> for SquashMode {
13272 fn from(value: &str) -> Self {
13273 use std::string::ToString;
13274 match value {
13275 "SQUASH_MODE_UNSPECIFIED" => Self::Unspecified,
13276 "NO_ROOT_SQUASH" => Self::NoRootSquash,
13277 "ROOT_SQUASH" => Self::RootSquash,
13278 "ALL_SQUASH" => Self::AllSquash,
13279 _ => Self::UnknownValue(squash_mode::UnknownValue(
13280 wkt::internal::UnknownEnumValue::String(value.to_string()),
13281 )),
13282 }
13283 }
13284 }
13285
13286 impl serde::ser::Serialize for SquashMode {
13287 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
13288 where
13289 S: serde::Serializer,
13290 {
13291 match self {
13292 Self::Unspecified => serializer.serialize_i32(0),
13293 Self::NoRootSquash => serializer.serialize_i32(1),
13294 Self::RootSquash => serializer.serialize_i32(2),
13295 Self::AllSquash => serializer.serialize_i32(3),
13296 Self::UnknownValue(u) => u.0.serialize(serializer),
13297 }
13298 }
13299 }
13300
13301 impl<'de> serde::de::Deserialize<'de> for SquashMode {
13302 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
13303 where
13304 D: serde::Deserializer<'de>,
13305 {
13306 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SquashMode>::new(
13307 ".google.cloud.netapp.v1.SimpleExportPolicyRule.SquashMode",
13308 ))
13309 }
13310 }
13311}
13312
13313/// Snapshot Policy for a volume.
13314#[derive(Clone, Default, PartialEq)]
13315#[non_exhaustive]
13316pub struct SnapshotPolicy {
13317 /// If enabled, make snapshots automatically according to the schedules.
13318 /// Default is false.
13319 pub enabled: std::option::Option<bool>,
13320
13321 /// Hourly schedule policy.
13322 pub hourly_schedule: std::option::Option<crate::model::HourlySchedule>,
13323
13324 /// Daily schedule policy.
13325 pub daily_schedule: std::option::Option<crate::model::DailySchedule>,
13326
13327 /// Weekly schedule policy.
13328 pub weekly_schedule: std::option::Option<crate::model::WeeklySchedule>,
13329
13330 /// Monthly schedule policy.
13331 pub monthly_schedule: std::option::Option<crate::model::MonthlySchedule>,
13332
13333 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13334}
13335
13336impl SnapshotPolicy {
13337 pub fn new() -> Self {
13338 std::default::Default::default()
13339 }
13340
13341 /// Sets the value of [enabled][crate::model::SnapshotPolicy::enabled].
13342 ///
13343 /// # Example
13344 /// ```ignore,no_run
13345 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
13346 /// let x = SnapshotPolicy::new().set_enabled(true);
13347 /// ```
13348 pub fn set_enabled<T>(mut self, v: T) -> Self
13349 where
13350 T: std::convert::Into<bool>,
13351 {
13352 self.enabled = std::option::Option::Some(v.into());
13353 self
13354 }
13355
13356 /// Sets or clears the value of [enabled][crate::model::SnapshotPolicy::enabled].
13357 ///
13358 /// # Example
13359 /// ```ignore,no_run
13360 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
13361 /// let x = SnapshotPolicy::new().set_or_clear_enabled(Some(false));
13362 /// let x = SnapshotPolicy::new().set_or_clear_enabled(None::<bool>);
13363 /// ```
13364 pub fn set_or_clear_enabled<T>(mut self, v: std::option::Option<T>) -> Self
13365 where
13366 T: std::convert::Into<bool>,
13367 {
13368 self.enabled = v.map(|x| x.into());
13369 self
13370 }
13371
13372 /// Sets the value of [hourly_schedule][crate::model::SnapshotPolicy::hourly_schedule].
13373 ///
13374 /// # Example
13375 /// ```ignore,no_run
13376 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
13377 /// use google_cloud_netapp_v1::model::HourlySchedule;
13378 /// let x = SnapshotPolicy::new().set_hourly_schedule(HourlySchedule::default()/* use setters */);
13379 /// ```
13380 pub fn set_hourly_schedule<T>(mut self, v: T) -> Self
13381 where
13382 T: std::convert::Into<crate::model::HourlySchedule>,
13383 {
13384 self.hourly_schedule = std::option::Option::Some(v.into());
13385 self
13386 }
13387
13388 /// Sets or clears the value of [hourly_schedule][crate::model::SnapshotPolicy::hourly_schedule].
13389 ///
13390 /// # Example
13391 /// ```ignore,no_run
13392 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
13393 /// use google_cloud_netapp_v1::model::HourlySchedule;
13394 /// let x = SnapshotPolicy::new().set_or_clear_hourly_schedule(Some(HourlySchedule::default()/* use setters */));
13395 /// let x = SnapshotPolicy::new().set_or_clear_hourly_schedule(None::<HourlySchedule>);
13396 /// ```
13397 pub fn set_or_clear_hourly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
13398 where
13399 T: std::convert::Into<crate::model::HourlySchedule>,
13400 {
13401 self.hourly_schedule = v.map(|x| x.into());
13402 self
13403 }
13404
13405 /// Sets the value of [daily_schedule][crate::model::SnapshotPolicy::daily_schedule].
13406 ///
13407 /// # Example
13408 /// ```ignore,no_run
13409 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
13410 /// use google_cloud_netapp_v1::model::DailySchedule;
13411 /// let x = SnapshotPolicy::new().set_daily_schedule(DailySchedule::default()/* use setters */);
13412 /// ```
13413 pub fn set_daily_schedule<T>(mut self, v: T) -> Self
13414 where
13415 T: std::convert::Into<crate::model::DailySchedule>,
13416 {
13417 self.daily_schedule = std::option::Option::Some(v.into());
13418 self
13419 }
13420
13421 /// Sets or clears the value of [daily_schedule][crate::model::SnapshotPolicy::daily_schedule].
13422 ///
13423 /// # Example
13424 /// ```ignore,no_run
13425 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
13426 /// use google_cloud_netapp_v1::model::DailySchedule;
13427 /// let x = SnapshotPolicy::new().set_or_clear_daily_schedule(Some(DailySchedule::default()/* use setters */));
13428 /// let x = SnapshotPolicy::new().set_or_clear_daily_schedule(None::<DailySchedule>);
13429 /// ```
13430 pub fn set_or_clear_daily_schedule<T>(mut self, v: std::option::Option<T>) -> Self
13431 where
13432 T: std::convert::Into<crate::model::DailySchedule>,
13433 {
13434 self.daily_schedule = v.map(|x| x.into());
13435 self
13436 }
13437
13438 /// Sets the value of [weekly_schedule][crate::model::SnapshotPolicy::weekly_schedule].
13439 ///
13440 /// # Example
13441 /// ```ignore,no_run
13442 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
13443 /// use google_cloud_netapp_v1::model::WeeklySchedule;
13444 /// let x = SnapshotPolicy::new().set_weekly_schedule(WeeklySchedule::default()/* use setters */);
13445 /// ```
13446 pub fn set_weekly_schedule<T>(mut self, v: T) -> Self
13447 where
13448 T: std::convert::Into<crate::model::WeeklySchedule>,
13449 {
13450 self.weekly_schedule = std::option::Option::Some(v.into());
13451 self
13452 }
13453
13454 /// Sets or clears the value of [weekly_schedule][crate::model::SnapshotPolicy::weekly_schedule].
13455 ///
13456 /// # Example
13457 /// ```ignore,no_run
13458 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
13459 /// use google_cloud_netapp_v1::model::WeeklySchedule;
13460 /// let x = SnapshotPolicy::new().set_or_clear_weekly_schedule(Some(WeeklySchedule::default()/* use setters */));
13461 /// let x = SnapshotPolicy::new().set_or_clear_weekly_schedule(None::<WeeklySchedule>);
13462 /// ```
13463 pub fn set_or_clear_weekly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
13464 where
13465 T: std::convert::Into<crate::model::WeeklySchedule>,
13466 {
13467 self.weekly_schedule = v.map(|x| x.into());
13468 self
13469 }
13470
13471 /// Sets the value of [monthly_schedule][crate::model::SnapshotPolicy::monthly_schedule].
13472 ///
13473 /// # Example
13474 /// ```ignore,no_run
13475 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
13476 /// use google_cloud_netapp_v1::model::MonthlySchedule;
13477 /// let x = SnapshotPolicy::new().set_monthly_schedule(MonthlySchedule::default()/* use setters */);
13478 /// ```
13479 pub fn set_monthly_schedule<T>(mut self, v: T) -> Self
13480 where
13481 T: std::convert::Into<crate::model::MonthlySchedule>,
13482 {
13483 self.monthly_schedule = std::option::Option::Some(v.into());
13484 self
13485 }
13486
13487 /// Sets or clears the value of [monthly_schedule][crate::model::SnapshotPolicy::monthly_schedule].
13488 ///
13489 /// # Example
13490 /// ```ignore,no_run
13491 /// # use google_cloud_netapp_v1::model::SnapshotPolicy;
13492 /// use google_cloud_netapp_v1::model::MonthlySchedule;
13493 /// let x = SnapshotPolicy::new().set_or_clear_monthly_schedule(Some(MonthlySchedule::default()/* use setters */));
13494 /// let x = SnapshotPolicy::new().set_or_clear_monthly_schedule(None::<MonthlySchedule>);
13495 /// ```
13496 pub fn set_or_clear_monthly_schedule<T>(mut self, v: std::option::Option<T>) -> Self
13497 where
13498 T: std::convert::Into<crate::model::MonthlySchedule>,
13499 {
13500 self.monthly_schedule = v.map(|x| x.into());
13501 self
13502 }
13503}
13504
13505impl wkt::message::Message for SnapshotPolicy {
13506 fn typename() -> &'static str {
13507 "type.googleapis.com/google.cloud.netapp.v1.SnapshotPolicy"
13508 }
13509}
13510
13511/// Make a snapshot every hour e.g. at 04:00, 05:00, 06:00.
13512#[derive(Clone, Default, PartialEq)]
13513#[non_exhaustive]
13514pub struct HourlySchedule {
13515 /// The maximum number of Snapshots to keep for the hourly schedule
13516 pub snapshots_to_keep: std::option::Option<f64>,
13517
13518 /// Set the minute of the hour to start the snapshot (0-59), defaults to the
13519 /// top of the hour (0).
13520 pub minute: std::option::Option<f64>,
13521
13522 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13523}
13524
13525impl HourlySchedule {
13526 pub fn new() -> Self {
13527 std::default::Default::default()
13528 }
13529
13530 /// Sets the value of [snapshots_to_keep][crate::model::HourlySchedule::snapshots_to_keep].
13531 ///
13532 /// # Example
13533 /// ```ignore,no_run
13534 /// # use google_cloud_netapp_v1::model::HourlySchedule;
13535 /// let x = HourlySchedule::new().set_snapshots_to_keep(42.0);
13536 /// ```
13537 pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
13538 where
13539 T: std::convert::Into<f64>,
13540 {
13541 self.snapshots_to_keep = std::option::Option::Some(v.into());
13542 self
13543 }
13544
13545 /// Sets or clears the value of [snapshots_to_keep][crate::model::HourlySchedule::snapshots_to_keep].
13546 ///
13547 /// # Example
13548 /// ```ignore,no_run
13549 /// # use google_cloud_netapp_v1::model::HourlySchedule;
13550 /// let x = HourlySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
13551 /// let x = HourlySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
13552 /// ```
13553 pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
13554 where
13555 T: std::convert::Into<f64>,
13556 {
13557 self.snapshots_to_keep = v.map(|x| x.into());
13558 self
13559 }
13560
13561 /// Sets the value of [minute][crate::model::HourlySchedule::minute].
13562 ///
13563 /// # Example
13564 /// ```ignore,no_run
13565 /// # use google_cloud_netapp_v1::model::HourlySchedule;
13566 /// let x = HourlySchedule::new().set_minute(42.0);
13567 /// ```
13568 pub fn set_minute<T>(mut self, v: T) -> Self
13569 where
13570 T: std::convert::Into<f64>,
13571 {
13572 self.minute = std::option::Option::Some(v.into());
13573 self
13574 }
13575
13576 /// Sets or clears the value of [minute][crate::model::HourlySchedule::minute].
13577 ///
13578 /// # Example
13579 /// ```ignore,no_run
13580 /// # use google_cloud_netapp_v1::model::HourlySchedule;
13581 /// let x = HourlySchedule::new().set_or_clear_minute(Some(42.0));
13582 /// let x = HourlySchedule::new().set_or_clear_minute(None::<f32>);
13583 /// ```
13584 pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
13585 where
13586 T: std::convert::Into<f64>,
13587 {
13588 self.minute = v.map(|x| x.into());
13589 self
13590 }
13591}
13592
13593impl wkt::message::Message for HourlySchedule {
13594 fn typename() -> &'static str {
13595 "type.googleapis.com/google.cloud.netapp.v1.HourlySchedule"
13596 }
13597}
13598
13599/// Make a snapshot every day e.g. at 04:00, 05:20, 23:50
13600#[derive(Clone, Default, PartialEq)]
13601#[non_exhaustive]
13602pub struct DailySchedule {
13603 /// The maximum number of Snapshots to keep for the hourly schedule
13604 pub snapshots_to_keep: std::option::Option<f64>,
13605
13606 /// Set the minute of the hour to start the snapshot (0-59), defaults to the
13607 /// top of the hour (0).
13608 pub minute: std::option::Option<f64>,
13609
13610 /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
13611 pub hour: std::option::Option<f64>,
13612
13613 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13614}
13615
13616impl DailySchedule {
13617 pub fn new() -> Self {
13618 std::default::Default::default()
13619 }
13620
13621 /// Sets the value of [snapshots_to_keep][crate::model::DailySchedule::snapshots_to_keep].
13622 ///
13623 /// # Example
13624 /// ```ignore,no_run
13625 /// # use google_cloud_netapp_v1::model::DailySchedule;
13626 /// let x = DailySchedule::new().set_snapshots_to_keep(42.0);
13627 /// ```
13628 pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
13629 where
13630 T: std::convert::Into<f64>,
13631 {
13632 self.snapshots_to_keep = std::option::Option::Some(v.into());
13633 self
13634 }
13635
13636 /// Sets or clears the value of [snapshots_to_keep][crate::model::DailySchedule::snapshots_to_keep].
13637 ///
13638 /// # Example
13639 /// ```ignore,no_run
13640 /// # use google_cloud_netapp_v1::model::DailySchedule;
13641 /// let x = DailySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
13642 /// let x = DailySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
13643 /// ```
13644 pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
13645 where
13646 T: std::convert::Into<f64>,
13647 {
13648 self.snapshots_to_keep = v.map(|x| x.into());
13649 self
13650 }
13651
13652 /// Sets the value of [minute][crate::model::DailySchedule::minute].
13653 ///
13654 /// # Example
13655 /// ```ignore,no_run
13656 /// # use google_cloud_netapp_v1::model::DailySchedule;
13657 /// let x = DailySchedule::new().set_minute(42.0);
13658 /// ```
13659 pub fn set_minute<T>(mut self, v: T) -> Self
13660 where
13661 T: std::convert::Into<f64>,
13662 {
13663 self.minute = std::option::Option::Some(v.into());
13664 self
13665 }
13666
13667 /// Sets or clears the value of [minute][crate::model::DailySchedule::minute].
13668 ///
13669 /// # Example
13670 /// ```ignore,no_run
13671 /// # use google_cloud_netapp_v1::model::DailySchedule;
13672 /// let x = DailySchedule::new().set_or_clear_minute(Some(42.0));
13673 /// let x = DailySchedule::new().set_or_clear_minute(None::<f32>);
13674 /// ```
13675 pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
13676 where
13677 T: std::convert::Into<f64>,
13678 {
13679 self.minute = v.map(|x| x.into());
13680 self
13681 }
13682
13683 /// Sets the value of [hour][crate::model::DailySchedule::hour].
13684 ///
13685 /// # Example
13686 /// ```ignore,no_run
13687 /// # use google_cloud_netapp_v1::model::DailySchedule;
13688 /// let x = DailySchedule::new().set_hour(42.0);
13689 /// ```
13690 pub fn set_hour<T>(mut self, v: T) -> Self
13691 where
13692 T: std::convert::Into<f64>,
13693 {
13694 self.hour = std::option::Option::Some(v.into());
13695 self
13696 }
13697
13698 /// Sets or clears the value of [hour][crate::model::DailySchedule::hour].
13699 ///
13700 /// # Example
13701 /// ```ignore,no_run
13702 /// # use google_cloud_netapp_v1::model::DailySchedule;
13703 /// let x = DailySchedule::new().set_or_clear_hour(Some(42.0));
13704 /// let x = DailySchedule::new().set_or_clear_hour(None::<f32>);
13705 /// ```
13706 pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
13707 where
13708 T: std::convert::Into<f64>,
13709 {
13710 self.hour = v.map(|x| x.into());
13711 self
13712 }
13713}
13714
13715impl wkt::message::Message for DailySchedule {
13716 fn typename() -> &'static str {
13717 "type.googleapis.com/google.cloud.netapp.v1.DailySchedule"
13718 }
13719}
13720
13721/// Make a snapshot every week e.g. at Monday 04:00, Wednesday 05:20, Sunday
13722/// 23:50
13723#[derive(Clone, Default, PartialEq)]
13724#[non_exhaustive]
13725pub struct WeeklySchedule {
13726 /// The maximum number of Snapshots to keep for the hourly schedule
13727 pub snapshots_to_keep: std::option::Option<f64>,
13728
13729 /// Set the minute of the hour to start the snapshot (0-59), defaults to the
13730 /// top of the hour (0).
13731 pub minute: std::option::Option<f64>,
13732
13733 /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
13734 pub hour: std::option::Option<f64>,
13735
13736 /// Set the day or days of the week to make a snapshot. Accepts a comma
13737 /// separated days of the week. Defaults to 'Sunday'.
13738 pub day: std::option::Option<std::string::String>,
13739
13740 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13741}
13742
13743impl WeeklySchedule {
13744 pub fn new() -> Self {
13745 std::default::Default::default()
13746 }
13747
13748 /// Sets the value of [snapshots_to_keep][crate::model::WeeklySchedule::snapshots_to_keep].
13749 ///
13750 /// # Example
13751 /// ```ignore,no_run
13752 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
13753 /// let x = WeeklySchedule::new().set_snapshots_to_keep(42.0);
13754 /// ```
13755 pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
13756 where
13757 T: std::convert::Into<f64>,
13758 {
13759 self.snapshots_to_keep = std::option::Option::Some(v.into());
13760 self
13761 }
13762
13763 /// Sets or clears the value of [snapshots_to_keep][crate::model::WeeklySchedule::snapshots_to_keep].
13764 ///
13765 /// # Example
13766 /// ```ignore,no_run
13767 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
13768 /// let x = WeeklySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
13769 /// let x = WeeklySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
13770 /// ```
13771 pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
13772 where
13773 T: std::convert::Into<f64>,
13774 {
13775 self.snapshots_to_keep = v.map(|x| x.into());
13776 self
13777 }
13778
13779 /// Sets the value of [minute][crate::model::WeeklySchedule::minute].
13780 ///
13781 /// # Example
13782 /// ```ignore,no_run
13783 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
13784 /// let x = WeeklySchedule::new().set_minute(42.0);
13785 /// ```
13786 pub fn set_minute<T>(mut self, v: T) -> Self
13787 where
13788 T: std::convert::Into<f64>,
13789 {
13790 self.minute = std::option::Option::Some(v.into());
13791 self
13792 }
13793
13794 /// Sets or clears the value of [minute][crate::model::WeeklySchedule::minute].
13795 ///
13796 /// # Example
13797 /// ```ignore,no_run
13798 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
13799 /// let x = WeeklySchedule::new().set_or_clear_minute(Some(42.0));
13800 /// let x = WeeklySchedule::new().set_or_clear_minute(None::<f32>);
13801 /// ```
13802 pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
13803 where
13804 T: std::convert::Into<f64>,
13805 {
13806 self.minute = v.map(|x| x.into());
13807 self
13808 }
13809
13810 /// Sets the value of [hour][crate::model::WeeklySchedule::hour].
13811 ///
13812 /// # Example
13813 /// ```ignore,no_run
13814 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
13815 /// let x = WeeklySchedule::new().set_hour(42.0);
13816 /// ```
13817 pub fn set_hour<T>(mut self, v: T) -> Self
13818 where
13819 T: std::convert::Into<f64>,
13820 {
13821 self.hour = std::option::Option::Some(v.into());
13822 self
13823 }
13824
13825 /// Sets or clears the value of [hour][crate::model::WeeklySchedule::hour].
13826 ///
13827 /// # Example
13828 /// ```ignore,no_run
13829 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
13830 /// let x = WeeklySchedule::new().set_or_clear_hour(Some(42.0));
13831 /// let x = WeeklySchedule::new().set_or_clear_hour(None::<f32>);
13832 /// ```
13833 pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
13834 where
13835 T: std::convert::Into<f64>,
13836 {
13837 self.hour = v.map(|x| x.into());
13838 self
13839 }
13840
13841 /// Sets the value of [day][crate::model::WeeklySchedule::day].
13842 ///
13843 /// # Example
13844 /// ```ignore,no_run
13845 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
13846 /// let x = WeeklySchedule::new().set_day("example");
13847 /// ```
13848 pub fn set_day<T>(mut self, v: T) -> Self
13849 where
13850 T: std::convert::Into<std::string::String>,
13851 {
13852 self.day = std::option::Option::Some(v.into());
13853 self
13854 }
13855
13856 /// Sets or clears the value of [day][crate::model::WeeklySchedule::day].
13857 ///
13858 /// # Example
13859 /// ```ignore,no_run
13860 /// # use google_cloud_netapp_v1::model::WeeklySchedule;
13861 /// let x = WeeklySchedule::new().set_or_clear_day(Some("example"));
13862 /// let x = WeeklySchedule::new().set_or_clear_day(None::<String>);
13863 /// ```
13864 pub fn set_or_clear_day<T>(mut self, v: std::option::Option<T>) -> Self
13865 where
13866 T: std::convert::Into<std::string::String>,
13867 {
13868 self.day = v.map(|x| x.into());
13869 self
13870 }
13871}
13872
13873impl wkt::message::Message for WeeklySchedule {
13874 fn typename() -> &'static str {
13875 "type.googleapis.com/google.cloud.netapp.v1.WeeklySchedule"
13876 }
13877}
13878
13879/// Make a snapshot once a month e.g. at 2nd 04:00, 7th 05:20, 24th 23:50
13880#[derive(Clone, Default, PartialEq)]
13881#[non_exhaustive]
13882pub struct MonthlySchedule {
13883 /// The maximum number of Snapshots to keep for the hourly schedule
13884 pub snapshots_to_keep: std::option::Option<f64>,
13885
13886 /// Set the minute of the hour to start the snapshot (0-59), defaults to the
13887 /// top of the hour (0).
13888 pub minute: std::option::Option<f64>,
13889
13890 /// Set the hour to start the snapshot (0-23), defaults to midnight (0).
13891 pub hour: std::option::Option<f64>,
13892
13893 /// Set the day or days of the month to make a snapshot (1-31). Accepts a
13894 /// comma separated number of days. Defaults to '1'.
13895 pub days_of_month: std::option::Option<std::string::String>,
13896
13897 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
13898}
13899
13900impl MonthlySchedule {
13901 pub fn new() -> Self {
13902 std::default::Default::default()
13903 }
13904
13905 /// Sets the value of [snapshots_to_keep][crate::model::MonthlySchedule::snapshots_to_keep].
13906 ///
13907 /// # Example
13908 /// ```ignore,no_run
13909 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
13910 /// let x = MonthlySchedule::new().set_snapshots_to_keep(42.0);
13911 /// ```
13912 pub fn set_snapshots_to_keep<T>(mut self, v: T) -> Self
13913 where
13914 T: std::convert::Into<f64>,
13915 {
13916 self.snapshots_to_keep = std::option::Option::Some(v.into());
13917 self
13918 }
13919
13920 /// Sets or clears the value of [snapshots_to_keep][crate::model::MonthlySchedule::snapshots_to_keep].
13921 ///
13922 /// # Example
13923 /// ```ignore,no_run
13924 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
13925 /// let x = MonthlySchedule::new().set_or_clear_snapshots_to_keep(Some(42.0));
13926 /// let x = MonthlySchedule::new().set_or_clear_snapshots_to_keep(None::<f32>);
13927 /// ```
13928 pub fn set_or_clear_snapshots_to_keep<T>(mut self, v: std::option::Option<T>) -> Self
13929 where
13930 T: std::convert::Into<f64>,
13931 {
13932 self.snapshots_to_keep = v.map(|x| x.into());
13933 self
13934 }
13935
13936 /// Sets the value of [minute][crate::model::MonthlySchedule::minute].
13937 ///
13938 /// # Example
13939 /// ```ignore,no_run
13940 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
13941 /// let x = MonthlySchedule::new().set_minute(42.0);
13942 /// ```
13943 pub fn set_minute<T>(mut self, v: T) -> Self
13944 where
13945 T: std::convert::Into<f64>,
13946 {
13947 self.minute = std::option::Option::Some(v.into());
13948 self
13949 }
13950
13951 /// Sets or clears the value of [minute][crate::model::MonthlySchedule::minute].
13952 ///
13953 /// # Example
13954 /// ```ignore,no_run
13955 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
13956 /// let x = MonthlySchedule::new().set_or_clear_minute(Some(42.0));
13957 /// let x = MonthlySchedule::new().set_or_clear_minute(None::<f32>);
13958 /// ```
13959 pub fn set_or_clear_minute<T>(mut self, v: std::option::Option<T>) -> Self
13960 where
13961 T: std::convert::Into<f64>,
13962 {
13963 self.minute = v.map(|x| x.into());
13964 self
13965 }
13966
13967 /// Sets the value of [hour][crate::model::MonthlySchedule::hour].
13968 ///
13969 /// # Example
13970 /// ```ignore,no_run
13971 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
13972 /// let x = MonthlySchedule::new().set_hour(42.0);
13973 /// ```
13974 pub fn set_hour<T>(mut self, v: T) -> Self
13975 where
13976 T: std::convert::Into<f64>,
13977 {
13978 self.hour = std::option::Option::Some(v.into());
13979 self
13980 }
13981
13982 /// Sets or clears the value of [hour][crate::model::MonthlySchedule::hour].
13983 ///
13984 /// # Example
13985 /// ```ignore,no_run
13986 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
13987 /// let x = MonthlySchedule::new().set_or_clear_hour(Some(42.0));
13988 /// let x = MonthlySchedule::new().set_or_clear_hour(None::<f32>);
13989 /// ```
13990 pub fn set_or_clear_hour<T>(mut self, v: std::option::Option<T>) -> Self
13991 where
13992 T: std::convert::Into<f64>,
13993 {
13994 self.hour = v.map(|x| x.into());
13995 self
13996 }
13997
13998 /// Sets the value of [days_of_month][crate::model::MonthlySchedule::days_of_month].
13999 ///
14000 /// # Example
14001 /// ```ignore,no_run
14002 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
14003 /// let x = MonthlySchedule::new().set_days_of_month("example");
14004 /// ```
14005 pub fn set_days_of_month<T>(mut self, v: T) -> Self
14006 where
14007 T: std::convert::Into<std::string::String>,
14008 {
14009 self.days_of_month = std::option::Option::Some(v.into());
14010 self
14011 }
14012
14013 /// Sets or clears the value of [days_of_month][crate::model::MonthlySchedule::days_of_month].
14014 ///
14015 /// # Example
14016 /// ```ignore,no_run
14017 /// # use google_cloud_netapp_v1::model::MonthlySchedule;
14018 /// let x = MonthlySchedule::new().set_or_clear_days_of_month(Some("example"));
14019 /// let x = MonthlySchedule::new().set_or_clear_days_of_month(None::<String>);
14020 /// ```
14021 pub fn set_or_clear_days_of_month<T>(mut self, v: std::option::Option<T>) -> Self
14022 where
14023 T: std::convert::Into<std::string::String>,
14024 {
14025 self.days_of_month = v.map(|x| x.into());
14026 self
14027 }
14028}
14029
14030impl wkt::message::Message for MonthlySchedule {
14031 fn typename() -> &'static str {
14032 "type.googleapis.com/google.cloud.netapp.v1.MonthlySchedule"
14033 }
14034}
14035
14036/// View only mount options for a volume.
14037#[derive(Clone, Default, PartialEq)]
14038#[non_exhaustive]
14039pub struct MountOption {
14040 /// Export string
14041 pub export: std::string::String,
14042
14043 /// Full export string
14044 pub export_full: std::string::String,
14045
14046 /// Protocol to mount with.
14047 pub protocol: crate::model::Protocols,
14048
14049 /// Instructions for mounting
14050 pub instructions: std::string::String,
14051
14052 /// Output only. IP Address.
14053 pub ip_address: std::string::String,
14054
14055 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14056}
14057
14058impl MountOption {
14059 pub fn new() -> Self {
14060 std::default::Default::default()
14061 }
14062
14063 /// Sets the value of [export][crate::model::MountOption::export].
14064 ///
14065 /// # Example
14066 /// ```ignore,no_run
14067 /// # use google_cloud_netapp_v1::model::MountOption;
14068 /// let x = MountOption::new().set_export("example");
14069 /// ```
14070 pub fn set_export<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14071 self.export = v.into();
14072 self
14073 }
14074
14075 /// Sets the value of [export_full][crate::model::MountOption::export_full].
14076 ///
14077 /// # Example
14078 /// ```ignore,no_run
14079 /// # use google_cloud_netapp_v1::model::MountOption;
14080 /// let x = MountOption::new().set_export_full("example");
14081 /// ```
14082 pub fn set_export_full<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14083 self.export_full = v.into();
14084 self
14085 }
14086
14087 /// Sets the value of [protocol][crate::model::MountOption::protocol].
14088 ///
14089 /// # Example
14090 /// ```ignore,no_run
14091 /// # use google_cloud_netapp_v1::model::MountOption;
14092 /// use google_cloud_netapp_v1::model::Protocols;
14093 /// let x0 = MountOption::new().set_protocol(Protocols::Nfsv3);
14094 /// let x1 = MountOption::new().set_protocol(Protocols::Nfsv4);
14095 /// let x2 = MountOption::new().set_protocol(Protocols::Smb);
14096 /// ```
14097 pub fn set_protocol<T: std::convert::Into<crate::model::Protocols>>(mut self, v: T) -> Self {
14098 self.protocol = v.into();
14099 self
14100 }
14101
14102 /// Sets the value of [instructions][crate::model::MountOption::instructions].
14103 ///
14104 /// # Example
14105 /// ```ignore,no_run
14106 /// # use google_cloud_netapp_v1::model::MountOption;
14107 /// let x = MountOption::new().set_instructions("example");
14108 /// ```
14109 pub fn set_instructions<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14110 self.instructions = v.into();
14111 self
14112 }
14113
14114 /// Sets the value of [ip_address][crate::model::MountOption::ip_address].
14115 ///
14116 /// # Example
14117 /// ```ignore,no_run
14118 /// # use google_cloud_netapp_v1::model::MountOption;
14119 /// let x = MountOption::new().set_ip_address("example");
14120 /// ```
14121 pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14122 self.ip_address = v.into();
14123 self
14124 }
14125}
14126
14127impl wkt::message::Message for MountOption {
14128 fn typename() -> &'static str {
14129 "type.googleapis.com/google.cloud.netapp.v1.MountOption"
14130 }
14131}
14132
14133/// The RestoreParameters if volume is created from a snapshot or backup.
14134#[derive(Clone, Default, PartialEq)]
14135#[non_exhaustive]
14136pub struct RestoreParameters {
14137 /// The source that the volume is created from.
14138 pub source: std::option::Option<crate::model::restore_parameters::Source>,
14139
14140 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14141}
14142
14143impl RestoreParameters {
14144 pub fn new() -> Self {
14145 std::default::Default::default()
14146 }
14147
14148 /// Sets the value of [source][crate::model::RestoreParameters::source].
14149 ///
14150 /// Note that all the setters affecting `source` are mutually
14151 /// exclusive.
14152 ///
14153 /// # Example
14154 /// ```ignore,no_run
14155 /// # use google_cloud_netapp_v1::model::RestoreParameters;
14156 /// use google_cloud_netapp_v1::model::restore_parameters::Source;
14157 /// let x = RestoreParameters::new().set_source(Some(Source::SourceSnapshot("example".to_string())));
14158 /// ```
14159 pub fn set_source<
14160 T: std::convert::Into<std::option::Option<crate::model::restore_parameters::Source>>,
14161 >(
14162 mut self,
14163 v: T,
14164 ) -> Self {
14165 self.source = v.into();
14166 self
14167 }
14168
14169 /// The value of [source][crate::model::RestoreParameters::source]
14170 /// if it holds a `SourceSnapshot`, `None` if the field is not set or
14171 /// holds a different branch.
14172 pub fn source_snapshot(&self) -> std::option::Option<&std::string::String> {
14173 #[allow(unreachable_patterns)]
14174 self.source.as_ref().and_then(|v| match v {
14175 crate::model::restore_parameters::Source::SourceSnapshot(v) => {
14176 std::option::Option::Some(v)
14177 }
14178 _ => std::option::Option::None,
14179 })
14180 }
14181
14182 /// Sets the value of [source][crate::model::RestoreParameters::source]
14183 /// to hold a `SourceSnapshot`.
14184 ///
14185 /// Note that all the setters affecting `source` are
14186 /// mutually exclusive.
14187 ///
14188 /// # Example
14189 /// ```ignore,no_run
14190 /// # use google_cloud_netapp_v1::model::RestoreParameters;
14191 /// let x = RestoreParameters::new().set_source_snapshot("example");
14192 /// assert!(x.source_snapshot().is_some());
14193 /// assert!(x.source_backup().is_none());
14194 /// ```
14195 pub fn set_source_snapshot<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14196 self.source = std::option::Option::Some(
14197 crate::model::restore_parameters::Source::SourceSnapshot(v.into()),
14198 );
14199 self
14200 }
14201
14202 /// The value of [source][crate::model::RestoreParameters::source]
14203 /// if it holds a `SourceBackup`, `None` if the field is not set or
14204 /// holds a different branch.
14205 pub fn source_backup(&self) -> std::option::Option<&std::string::String> {
14206 #[allow(unreachable_patterns)]
14207 self.source.as_ref().and_then(|v| match v {
14208 crate::model::restore_parameters::Source::SourceBackup(v) => {
14209 std::option::Option::Some(v)
14210 }
14211 _ => std::option::Option::None,
14212 })
14213 }
14214
14215 /// Sets the value of [source][crate::model::RestoreParameters::source]
14216 /// to hold a `SourceBackup`.
14217 ///
14218 /// Note that all the setters affecting `source` are
14219 /// mutually exclusive.
14220 ///
14221 /// # Example
14222 /// ```ignore,no_run
14223 /// # use google_cloud_netapp_v1::model::RestoreParameters;
14224 /// let x = RestoreParameters::new().set_source_backup("example");
14225 /// assert!(x.source_backup().is_some());
14226 /// assert!(x.source_snapshot().is_none());
14227 /// ```
14228 pub fn set_source_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14229 self.source = std::option::Option::Some(
14230 crate::model::restore_parameters::Source::SourceBackup(v.into()),
14231 );
14232 self
14233 }
14234}
14235
14236impl wkt::message::Message for RestoreParameters {
14237 fn typename() -> &'static str {
14238 "type.googleapis.com/google.cloud.netapp.v1.RestoreParameters"
14239 }
14240}
14241
14242/// Defines additional types related to [RestoreParameters].
14243pub mod restore_parameters {
14244 #[allow(unused_imports)]
14245 use super::*;
14246
14247 /// The source that the volume is created from.
14248 #[derive(Clone, Debug, PartialEq)]
14249 #[non_exhaustive]
14250 pub enum Source {
14251 /// Full name of the snapshot resource.
14252 /// Format:
14253 /// projects/{project}/locations/{location}/volumes/{volume}/snapshots/{snapshot}
14254 SourceSnapshot(std::string::String),
14255 /// Full name of the backup resource.
14256 /// Format:
14257 /// projects/{project}/locations/{location}/backupVaults/{backup_vault_id}/backups/{backup_id}
14258 SourceBackup(std::string::String),
14259 }
14260}
14261
14262/// BackupConfig contains backup related config on a volume.
14263#[derive(Clone, Default, PartialEq)]
14264#[non_exhaustive]
14265pub struct BackupConfig {
14266 /// Optional. When specified, schedule backups will be created based on the
14267 /// policy configuration.
14268 pub backup_policies: std::vec::Vec<std::string::String>,
14269
14270 /// Optional. Name of backup vault.
14271 /// Format:
14272 /// projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}
14273 pub backup_vault: std::string::String,
14274
14275 /// Optional. When set to true, scheduled backup is enabled on the volume.
14276 /// This field should be nil when there's no backup policy attached.
14277 pub scheduled_backup_enabled: std::option::Option<bool>,
14278
14279 /// Output only. Total size of all backups in a chain in bytes = baseline
14280 /// backup size + sum(incremental backup size).
14281 pub backup_chain_bytes: std::option::Option<i64>,
14282
14283 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14284}
14285
14286impl BackupConfig {
14287 pub fn new() -> Self {
14288 std::default::Default::default()
14289 }
14290
14291 /// Sets the value of [backup_policies][crate::model::BackupConfig::backup_policies].
14292 ///
14293 /// # Example
14294 /// ```ignore,no_run
14295 /// # use google_cloud_netapp_v1::model::BackupConfig;
14296 /// let x = BackupConfig::new().set_backup_policies(["a", "b", "c"]);
14297 /// ```
14298 pub fn set_backup_policies<T, V>(mut self, v: T) -> Self
14299 where
14300 T: std::iter::IntoIterator<Item = V>,
14301 V: std::convert::Into<std::string::String>,
14302 {
14303 use std::iter::Iterator;
14304 self.backup_policies = v.into_iter().map(|i| i.into()).collect();
14305 self
14306 }
14307
14308 /// Sets the value of [backup_vault][crate::model::BackupConfig::backup_vault].
14309 ///
14310 /// # Example
14311 /// ```ignore,no_run
14312 /// # use google_cloud_netapp_v1::model::BackupConfig;
14313 /// let x = BackupConfig::new().set_backup_vault("example");
14314 /// ```
14315 pub fn set_backup_vault<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14316 self.backup_vault = v.into();
14317 self
14318 }
14319
14320 /// Sets the value of [scheduled_backup_enabled][crate::model::BackupConfig::scheduled_backup_enabled].
14321 ///
14322 /// # Example
14323 /// ```ignore,no_run
14324 /// # use google_cloud_netapp_v1::model::BackupConfig;
14325 /// let x = BackupConfig::new().set_scheduled_backup_enabled(true);
14326 /// ```
14327 pub fn set_scheduled_backup_enabled<T>(mut self, v: T) -> Self
14328 where
14329 T: std::convert::Into<bool>,
14330 {
14331 self.scheduled_backup_enabled = std::option::Option::Some(v.into());
14332 self
14333 }
14334
14335 /// Sets or clears the value of [scheduled_backup_enabled][crate::model::BackupConfig::scheduled_backup_enabled].
14336 ///
14337 /// # Example
14338 /// ```ignore,no_run
14339 /// # use google_cloud_netapp_v1::model::BackupConfig;
14340 /// let x = BackupConfig::new().set_or_clear_scheduled_backup_enabled(Some(false));
14341 /// let x = BackupConfig::new().set_or_clear_scheduled_backup_enabled(None::<bool>);
14342 /// ```
14343 pub fn set_or_clear_scheduled_backup_enabled<T>(mut self, v: std::option::Option<T>) -> Self
14344 where
14345 T: std::convert::Into<bool>,
14346 {
14347 self.scheduled_backup_enabled = v.map(|x| x.into());
14348 self
14349 }
14350
14351 /// Sets the value of [backup_chain_bytes][crate::model::BackupConfig::backup_chain_bytes].
14352 ///
14353 /// # Example
14354 /// ```ignore,no_run
14355 /// # use google_cloud_netapp_v1::model::BackupConfig;
14356 /// let x = BackupConfig::new().set_backup_chain_bytes(42);
14357 /// ```
14358 pub fn set_backup_chain_bytes<T>(mut self, v: T) -> Self
14359 where
14360 T: std::convert::Into<i64>,
14361 {
14362 self.backup_chain_bytes = std::option::Option::Some(v.into());
14363 self
14364 }
14365
14366 /// Sets or clears the value of [backup_chain_bytes][crate::model::BackupConfig::backup_chain_bytes].
14367 ///
14368 /// # Example
14369 /// ```ignore,no_run
14370 /// # use google_cloud_netapp_v1::model::BackupConfig;
14371 /// let x = BackupConfig::new().set_or_clear_backup_chain_bytes(Some(42));
14372 /// let x = BackupConfig::new().set_or_clear_backup_chain_bytes(None::<i32>);
14373 /// ```
14374 pub fn set_or_clear_backup_chain_bytes<T>(mut self, v: std::option::Option<T>) -> Self
14375 where
14376 T: std::convert::Into<i64>,
14377 {
14378 self.backup_chain_bytes = v.map(|x| x.into());
14379 self
14380 }
14381}
14382
14383impl wkt::message::Message for BackupConfig {
14384 fn typename() -> &'static str {
14385 "type.googleapis.com/google.cloud.netapp.v1.BackupConfig"
14386 }
14387}
14388
14389/// Defines tiering policy for the volume.
14390#[derive(Clone, Default, PartialEq)]
14391#[non_exhaustive]
14392pub struct TieringPolicy {
14393 /// Optional. Flag indicating if the volume has tiering policy enable/pause.
14394 /// Default is PAUSED.
14395 pub tier_action: std::option::Option<crate::model::tiering_policy::TierAction>,
14396
14397 /// Optional. Time in days to mark the volume's data block as cold and make it
14398 /// eligible for tiering, can be range from 2-183. Default is 31.
14399 pub cooling_threshold_days: std::option::Option<i32>,
14400
14401 /// Optional. Flag indicating that the hot tier bypass mode is enabled. Default
14402 /// is false. This is only applicable to Flex service level.
14403 pub hot_tier_bypass_mode_enabled: std::option::Option<bool>,
14404
14405 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14406}
14407
14408impl TieringPolicy {
14409 pub fn new() -> Self {
14410 std::default::Default::default()
14411 }
14412
14413 /// Sets the value of [tier_action][crate::model::TieringPolicy::tier_action].
14414 ///
14415 /// # Example
14416 /// ```ignore,no_run
14417 /// # use google_cloud_netapp_v1::model::TieringPolicy;
14418 /// use google_cloud_netapp_v1::model::tiering_policy::TierAction;
14419 /// let x0 = TieringPolicy::new().set_tier_action(TierAction::Enabled);
14420 /// let x1 = TieringPolicy::new().set_tier_action(TierAction::Paused);
14421 /// ```
14422 pub fn set_tier_action<T>(mut self, v: T) -> Self
14423 where
14424 T: std::convert::Into<crate::model::tiering_policy::TierAction>,
14425 {
14426 self.tier_action = std::option::Option::Some(v.into());
14427 self
14428 }
14429
14430 /// Sets or clears the value of [tier_action][crate::model::TieringPolicy::tier_action].
14431 ///
14432 /// # Example
14433 /// ```ignore,no_run
14434 /// # use google_cloud_netapp_v1::model::TieringPolicy;
14435 /// use google_cloud_netapp_v1::model::tiering_policy::TierAction;
14436 /// let x0 = TieringPolicy::new().set_or_clear_tier_action(Some(TierAction::Enabled));
14437 /// let x1 = TieringPolicy::new().set_or_clear_tier_action(Some(TierAction::Paused));
14438 /// let x_none = TieringPolicy::new().set_or_clear_tier_action(None::<TierAction>);
14439 /// ```
14440 pub fn set_or_clear_tier_action<T>(mut self, v: std::option::Option<T>) -> Self
14441 where
14442 T: std::convert::Into<crate::model::tiering_policy::TierAction>,
14443 {
14444 self.tier_action = v.map(|x| x.into());
14445 self
14446 }
14447
14448 /// Sets the value of [cooling_threshold_days][crate::model::TieringPolicy::cooling_threshold_days].
14449 ///
14450 /// # Example
14451 /// ```ignore,no_run
14452 /// # use google_cloud_netapp_v1::model::TieringPolicy;
14453 /// let x = TieringPolicy::new().set_cooling_threshold_days(42);
14454 /// ```
14455 pub fn set_cooling_threshold_days<T>(mut self, v: T) -> Self
14456 where
14457 T: std::convert::Into<i32>,
14458 {
14459 self.cooling_threshold_days = std::option::Option::Some(v.into());
14460 self
14461 }
14462
14463 /// Sets or clears the value of [cooling_threshold_days][crate::model::TieringPolicy::cooling_threshold_days].
14464 ///
14465 /// # Example
14466 /// ```ignore,no_run
14467 /// # use google_cloud_netapp_v1::model::TieringPolicy;
14468 /// let x = TieringPolicy::new().set_or_clear_cooling_threshold_days(Some(42));
14469 /// let x = TieringPolicy::new().set_or_clear_cooling_threshold_days(None::<i32>);
14470 /// ```
14471 pub fn set_or_clear_cooling_threshold_days<T>(mut self, v: std::option::Option<T>) -> Self
14472 where
14473 T: std::convert::Into<i32>,
14474 {
14475 self.cooling_threshold_days = v.map(|x| x.into());
14476 self
14477 }
14478
14479 /// Sets the value of [hot_tier_bypass_mode_enabled][crate::model::TieringPolicy::hot_tier_bypass_mode_enabled].
14480 ///
14481 /// # Example
14482 /// ```ignore,no_run
14483 /// # use google_cloud_netapp_v1::model::TieringPolicy;
14484 /// let x = TieringPolicy::new().set_hot_tier_bypass_mode_enabled(true);
14485 /// ```
14486 pub fn set_hot_tier_bypass_mode_enabled<T>(mut self, v: T) -> Self
14487 where
14488 T: std::convert::Into<bool>,
14489 {
14490 self.hot_tier_bypass_mode_enabled = std::option::Option::Some(v.into());
14491 self
14492 }
14493
14494 /// Sets or clears the value of [hot_tier_bypass_mode_enabled][crate::model::TieringPolicy::hot_tier_bypass_mode_enabled].
14495 ///
14496 /// # Example
14497 /// ```ignore,no_run
14498 /// # use google_cloud_netapp_v1::model::TieringPolicy;
14499 /// let x = TieringPolicy::new().set_or_clear_hot_tier_bypass_mode_enabled(Some(false));
14500 /// let x = TieringPolicy::new().set_or_clear_hot_tier_bypass_mode_enabled(None::<bool>);
14501 /// ```
14502 pub fn set_or_clear_hot_tier_bypass_mode_enabled<T>(mut self, v: std::option::Option<T>) -> Self
14503 where
14504 T: std::convert::Into<bool>,
14505 {
14506 self.hot_tier_bypass_mode_enabled = v.map(|x| x.into());
14507 self
14508 }
14509}
14510
14511impl wkt::message::Message for TieringPolicy {
14512 fn typename() -> &'static str {
14513 "type.googleapis.com/google.cloud.netapp.v1.TieringPolicy"
14514 }
14515}
14516
14517/// Defines additional types related to [TieringPolicy].
14518pub mod tiering_policy {
14519 #[allow(unused_imports)]
14520 use super::*;
14521
14522 /// Tier action for the volume.
14523 ///
14524 /// # Working with unknown values
14525 ///
14526 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14527 /// additional enum variants at any time. Adding new variants is not considered
14528 /// a breaking change. Applications should write their code in anticipation of:
14529 ///
14530 /// - New values appearing in future releases of the client library, **and**
14531 /// - New values received dynamically, without application changes.
14532 ///
14533 /// Please consult the [Working with enums] section in the user guide for some
14534 /// guidelines.
14535 ///
14536 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14537 #[derive(Clone, Debug, PartialEq)]
14538 #[non_exhaustive]
14539 pub enum TierAction {
14540 /// Unspecified.
14541 Unspecified,
14542 /// When tiering is enabled, new cold data will be tiered.
14543 Enabled,
14544 /// When paused, tiering won't be performed on new data. Existing data stays
14545 /// tiered until accessed.
14546 Paused,
14547 /// If set, the enum was initialized with an unknown value.
14548 ///
14549 /// Applications can examine the value using [TierAction::value] or
14550 /// [TierAction::name].
14551 UnknownValue(tier_action::UnknownValue),
14552 }
14553
14554 #[doc(hidden)]
14555 pub mod tier_action {
14556 #[allow(unused_imports)]
14557 use super::*;
14558 #[derive(Clone, Debug, PartialEq)]
14559 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14560 }
14561
14562 impl TierAction {
14563 /// Gets the enum value.
14564 ///
14565 /// Returns `None` if the enum contains an unknown value deserialized from
14566 /// the string representation of enums.
14567 pub fn value(&self) -> std::option::Option<i32> {
14568 match self {
14569 Self::Unspecified => std::option::Option::Some(0),
14570 Self::Enabled => std::option::Option::Some(1),
14571 Self::Paused => std::option::Option::Some(2),
14572 Self::UnknownValue(u) => u.0.value(),
14573 }
14574 }
14575
14576 /// Gets the enum value as a string.
14577 ///
14578 /// Returns `None` if the enum contains an unknown value deserialized from
14579 /// the integer representation of enums.
14580 pub fn name(&self) -> std::option::Option<&str> {
14581 match self {
14582 Self::Unspecified => std::option::Option::Some("TIER_ACTION_UNSPECIFIED"),
14583 Self::Enabled => std::option::Option::Some("ENABLED"),
14584 Self::Paused => std::option::Option::Some("PAUSED"),
14585 Self::UnknownValue(u) => u.0.name(),
14586 }
14587 }
14588 }
14589
14590 impl std::default::Default for TierAction {
14591 fn default() -> Self {
14592 use std::convert::From;
14593 Self::from(0)
14594 }
14595 }
14596
14597 impl std::fmt::Display for TierAction {
14598 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14599 wkt::internal::display_enum(f, self.name(), self.value())
14600 }
14601 }
14602
14603 impl std::convert::From<i32> for TierAction {
14604 fn from(value: i32) -> Self {
14605 match value {
14606 0 => Self::Unspecified,
14607 1 => Self::Enabled,
14608 2 => Self::Paused,
14609 _ => Self::UnknownValue(tier_action::UnknownValue(
14610 wkt::internal::UnknownEnumValue::Integer(value),
14611 )),
14612 }
14613 }
14614 }
14615
14616 impl std::convert::From<&str> for TierAction {
14617 fn from(value: &str) -> Self {
14618 use std::string::ToString;
14619 match value {
14620 "TIER_ACTION_UNSPECIFIED" => Self::Unspecified,
14621 "ENABLED" => Self::Enabled,
14622 "PAUSED" => Self::Paused,
14623 _ => Self::UnknownValue(tier_action::UnknownValue(
14624 wkt::internal::UnknownEnumValue::String(value.to_string()),
14625 )),
14626 }
14627 }
14628 }
14629
14630 impl serde::ser::Serialize for TierAction {
14631 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
14632 where
14633 S: serde::Serializer,
14634 {
14635 match self {
14636 Self::Unspecified => serializer.serialize_i32(0),
14637 Self::Enabled => serializer.serialize_i32(1),
14638 Self::Paused => serializer.serialize_i32(2),
14639 Self::UnknownValue(u) => u.0.serialize(serializer),
14640 }
14641 }
14642 }
14643
14644 impl<'de> serde::de::Deserialize<'de> for TierAction {
14645 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
14646 where
14647 D: serde::Deserializer<'de>,
14648 {
14649 deserializer.deserialize_any(wkt::internal::EnumVisitor::<TierAction>::new(
14650 ".google.cloud.netapp.v1.TieringPolicy.TierAction",
14651 ))
14652 }
14653 }
14654}
14655
14656/// The Hybrid Replication parameters for the volume.
14657#[derive(Clone, Default, PartialEq)]
14658#[non_exhaustive]
14659pub struct HybridReplicationParameters {
14660 /// Required. Desired name for the replication of this volume.
14661 pub replication: std::string::String,
14662
14663 /// Required. Name of the user's local source volume to be peered with the
14664 /// destination volume.
14665 pub peer_volume_name: std::string::String,
14666
14667 /// Required. Name of the user's local source cluster to be peered with the
14668 /// destination cluster.
14669 pub peer_cluster_name: std::string::String,
14670
14671 /// Required. Name of the user's local source vserver svm to be peered with the
14672 /// destination vserver svm.
14673 pub peer_svm_name: std::string::String,
14674
14675 /// Required. List of node ip addresses to be peered with.
14676 pub peer_ip_addresses: std::vec::Vec<std::string::String>,
14677
14678 /// Optional. Name of source cluster location associated with the Hybrid
14679 /// replication. This is a free-form field for the display purpose only.
14680 pub cluster_location: std::string::String,
14681
14682 /// Optional. Description of the replication.
14683 pub description: std::string::String,
14684
14685 /// Optional. Labels to be added to the replication as the key value pairs.
14686 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
14687
14688 /// Optional. Replication Schedule for the replication created.
14689 pub replication_schedule: crate::model::HybridReplicationSchedule,
14690
14691 /// Optional. Type of the hybrid replication.
14692 pub hybrid_replication_type:
14693 crate::model::hybrid_replication_parameters::VolumeHybridReplicationType,
14694
14695 /// Optional. Constituent volume count for large volume.
14696 pub large_volume_constituent_count: i32,
14697
14698 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
14699}
14700
14701impl HybridReplicationParameters {
14702 pub fn new() -> Self {
14703 std::default::Default::default()
14704 }
14705
14706 /// Sets the value of [replication][crate::model::HybridReplicationParameters::replication].
14707 ///
14708 /// # Example
14709 /// ```ignore,no_run
14710 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
14711 /// let x = HybridReplicationParameters::new().set_replication("example");
14712 /// ```
14713 pub fn set_replication<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14714 self.replication = v.into();
14715 self
14716 }
14717
14718 /// Sets the value of [peer_volume_name][crate::model::HybridReplicationParameters::peer_volume_name].
14719 ///
14720 /// # Example
14721 /// ```ignore,no_run
14722 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
14723 /// let x = HybridReplicationParameters::new().set_peer_volume_name("example");
14724 /// ```
14725 pub fn set_peer_volume_name<T: std::convert::Into<std::string::String>>(
14726 mut self,
14727 v: T,
14728 ) -> Self {
14729 self.peer_volume_name = v.into();
14730 self
14731 }
14732
14733 /// Sets the value of [peer_cluster_name][crate::model::HybridReplicationParameters::peer_cluster_name].
14734 ///
14735 /// # Example
14736 /// ```ignore,no_run
14737 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
14738 /// let x = HybridReplicationParameters::new().set_peer_cluster_name("example");
14739 /// ```
14740 pub fn set_peer_cluster_name<T: std::convert::Into<std::string::String>>(
14741 mut self,
14742 v: T,
14743 ) -> Self {
14744 self.peer_cluster_name = v.into();
14745 self
14746 }
14747
14748 /// Sets the value of [peer_svm_name][crate::model::HybridReplicationParameters::peer_svm_name].
14749 ///
14750 /// # Example
14751 /// ```ignore,no_run
14752 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
14753 /// let x = HybridReplicationParameters::new().set_peer_svm_name("example");
14754 /// ```
14755 pub fn set_peer_svm_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14756 self.peer_svm_name = v.into();
14757 self
14758 }
14759
14760 /// Sets the value of [peer_ip_addresses][crate::model::HybridReplicationParameters::peer_ip_addresses].
14761 ///
14762 /// # Example
14763 /// ```ignore,no_run
14764 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
14765 /// let x = HybridReplicationParameters::new().set_peer_ip_addresses(["a", "b", "c"]);
14766 /// ```
14767 pub fn set_peer_ip_addresses<T, V>(mut self, v: T) -> Self
14768 where
14769 T: std::iter::IntoIterator<Item = V>,
14770 V: std::convert::Into<std::string::String>,
14771 {
14772 use std::iter::Iterator;
14773 self.peer_ip_addresses = v.into_iter().map(|i| i.into()).collect();
14774 self
14775 }
14776
14777 /// Sets the value of [cluster_location][crate::model::HybridReplicationParameters::cluster_location].
14778 ///
14779 /// # Example
14780 /// ```ignore,no_run
14781 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
14782 /// let x = HybridReplicationParameters::new().set_cluster_location("example");
14783 /// ```
14784 pub fn set_cluster_location<T: std::convert::Into<std::string::String>>(
14785 mut self,
14786 v: T,
14787 ) -> Self {
14788 self.cluster_location = v.into();
14789 self
14790 }
14791
14792 /// Sets the value of [description][crate::model::HybridReplicationParameters::description].
14793 ///
14794 /// # Example
14795 /// ```ignore,no_run
14796 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
14797 /// let x = HybridReplicationParameters::new().set_description("example");
14798 /// ```
14799 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
14800 self.description = v.into();
14801 self
14802 }
14803
14804 /// Sets the value of [labels][crate::model::HybridReplicationParameters::labels].
14805 ///
14806 /// # Example
14807 /// ```ignore,no_run
14808 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
14809 /// let x = HybridReplicationParameters::new().set_labels([
14810 /// ("key0", "abc"),
14811 /// ("key1", "xyz"),
14812 /// ]);
14813 /// ```
14814 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
14815 where
14816 T: std::iter::IntoIterator<Item = (K, V)>,
14817 K: std::convert::Into<std::string::String>,
14818 V: std::convert::Into<std::string::String>,
14819 {
14820 use std::iter::Iterator;
14821 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
14822 self
14823 }
14824
14825 /// Sets the value of [replication_schedule][crate::model::HybridReplicationParameters::replication_schedule].
14826 ///
14827 /// # Example
14828 /// ```ignore,no_run
14829 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
14830 /// use google_cloud_netapp_v1::model::HybridReplicationSchedule;
14831 /// let x0 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Every10Minutes);
14832 /// let x1 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Hourly);
14833 /// let x2 = HybridReplicationParameters::new().set_replication_schedule(HybridReplicationSchedule::Daily);
14834 /// ```
14835 pub fn set_replication_schedule<
14836 T: std::convert::Into<crate::model::HybridReplicationSchedule>,
14837 >(
14838 mut self,
14839 v: T,
14840 ) -> Self {
14841 self.replication_schedule = v.into();
14842 self
14843 }
14844
14845 /// Sets the value of [hybrid_replication_type][crate::model::HybridReplicationParameters::hybrid_replication_type].
14846 ///
14847 /// # Example
14848 /// ```ignore,no_run
14849 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
14850 /// use google_cloud_netapp_v1::model::hybrid_replication_parameters::VolumeHybridReplicationType;
14851 /// let x0 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::Migration);
14852 /// let x1 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::ContinuousReplication);
14853 /// let x2 = HybridReplicationParameters::new().set_hybrid_replication_type(VolumeHybridReplicationType::OnpremReplication);
14854 /// ```
14855 pub fn set_hybrid_replication_type<
14856 T: std::convert::Into<
14857 crate::model::hybrid_replication_parameters::VolumeHybridReplicationType,
14858 >,
14859 >(
14860 mut self,
14861 v: T,
14862 ) -> Self {
14863 self.hybrid_replication_type = v.into();
14864 self
14865 }
14866
14867 /// Sets the value of [large_volume_constituent_count][crate::model::HybridReplicationParameters::large_volume_constituent_count].
14868 ///
14869 /// # Example
14870 /// ```ignore,no_run
14871 /// # use google_cloud_netapp_v1::model::HybridReplicationParameters;
14872 /// let x = HybridReplicationParameters::new().set_large_volume_constituent_count(42);
14873 /// ```
14874 pub fn set_large_volume_constituent_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
14875 self.large_volume_constituent_count = v.into();
14876 self
14877 }
14878}
14879
14880impl wkt::message::Message for HybridReplicationParameters {
14881 fn typename() -> &'static str {
14882 "type.googleapis.com/google.cloud.netapp.v1.HybridReplicationParameters"
14883 }
14884}
14885
14886/// Defines additional types related to [HybridReplicationParameters].
14887pub mod hybrid_replication_parameters {
14888 #[allow(unused_imports)]
14889 use super::*;
14890
14891 /// Type of the volume's hybrid replication.
14892 ///
14893 /// # Working with unknown values
14894 ///
14895 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
14896 /// additional enum variants at any time. Adding new variants is not considered
14897 /// a breaking change. Applications should write their code in anticipation of:
14898 ///
14899 /// - New values appearing in future releases of the client library, **and**
14900 /// - New values received dynamically, without application changes.
14901 ///
14902 /// Please consult the [Working with enums] section in the user guide for some
14903 /// guidelines.
14904 ///
14905 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
14906 #[derive(Clone, Debug, PartialEq)]
14907 #[non_exhaustive]
14908 pub enum VolumeHybridReplicationType {
14909 /// Unspecified hybrid replication type.
14910 Unspecified,
14911 /// Hybrid replication type for migration.
14912 Migration,
14913 /// Hybrid replication type for continuous replication.
14914 ContinuousReplication,
14915 /// New field for reversible OnPrem replication, to be used for data
14916 /// protection.
14917 OnpremReplication,
14918 /// New field for reversible OnPrem replication, to be used for data
14919 /// protection.
14920 ReverseOnpremReplication,
14921 /// If set, the enum was initialized with an unknown value.
14922 ///
14923 /// Applications can examine the value using [VolumeHybridReplicationType::value] or
14924 /// [VolumeHybridReplicationType::name].
14925 UnknownValue(volume_hybrid_replication_type::UnknownValue),
14926 }
14927
14928 #[doc(hidden)]
14929 pub mod volume_hybrid_replication_type {
14930 #[allow(unused_imports)]
14931 use super::*;
14932 #[derive(Clone, Debug, PartialEq)]
14933 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
14934 }
14935
14936 impl VolumeHybridReplicationType {
14937 /// Gets the enum value.
14938 ///
14939 /// Returns `None` if the enum contains an unknown value deserialized from
14940 /// the string representation of enums.
14941 pub fn value(&self) -> std::option::Option<i32> {
14942 match self {
14943 Self::Unspecified => std::option::Option::Some(0),
14944 Self::Migration => std::option::Option::Some(1),
14945 Self::ContinuousReplication => std::option::Option::Some(2),
14946 Self::OnpremReplication => std::option::Option::Some(3),
14947 Self::ReverseOnpremReplication => std::option::Option::Some(4),
14948 Self::UnknownValue(u) => u.0.value(),
14949 }
14950 }
14951
14952 /// Gets the enum value as a string.
14953 ///
14954 /// Returns `None` if the enum contains an unknown value deserialized from
14955 /// the integer representation of enums.
14956 pub fn name(&self) -> std::option::Option<&str> {
14957 match self {
14958 Self::Unspecified => {
14959 std::option::Option::Some("VOLUME_HYBRID_REPLICATION_TYPE_UNSPECIFIED")
14960 }
14961 Self::Migration => std::option::Option::Some("MIGRATION"),
14962 Self::ContinuousReplication => std::option::Option::Some("CONTINUOUS_REPLICATION"),
14963 Self::OnpremReplication => std::option::Option::Some("ONPREM_REPLICATION"),
14964 Self::ReverseOnpremReplication => {
14965 std::option::Option::Some("REVERSE_ONPREM_REPLICATION")
14966 }
14967 Self::UnknownValue(u) => u.0.name(),
14968 }
14969 }
14970 }
14971
14972 impl std::default::Default for VolumeHybridReplicationType {
14973 fn default() -> Self {
14974 use std::convert::From;
14975 Self::from(0)
14976 }
14977 }
14978
14979 impl std::fmt::Display for VolumeHybridReplicationType {
14980 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
14981 wkt::internal::display_enum(f, self.name(), self.value())
14982 }
14983 }
14984
14985 impl std::convert::From<i32> for VolumeHybridReplicationType {
14986 fn from(value: i32) -> Self {
14987 match value {
14988 0 => Self::Unspecified,
14989 1 => Self::Migration,
14990 2 => Self::ContinuousReplication,
14991 3 => Self::OnpremReplication,
14992 4 => Self::ReverseOnpremReplication,
14993 _ => Self::UnknownValue(volume_hybrid_replication_type::UnknownValue(
14994 wkt::internal::UnknownEnumValue::Integer(value),
14995 )),
14996 }
14997 }
14998 }
14999
15000 impl std::convert::From<&str> for VolumeHybridReplicationType {
15001 fn from(value: &str) -> Self {
15002 use std::string::ToString;
15003 match value {
15004 "VOLUME_HYBRID_REPLICATION_TYPE_UNSPECIFIED" => Self::Unspecified,
15005 "MIGRATION" => Self::Migration,
15006 "CONTINUOUS_REPLICATION" => Self::ContinuousReplication,
15007 "ONPREM_REPLICATION" => Self::OnpremReplication,
15008 "REVERSE_ONPREM_REPLICATION" => Self::ReverseOnpremReplication,
15009 _ => Self::UnknownValue(volume_hybrid_replication_type::UnknownValue(
15010 wkt::internal::UnknownEnumValue::String(value.to_string()),
15011 )),
15012 }
15013 }
15014 }
15015
15016 impl serde::ser::Serialize for VolumeHybridReplicationType {
15017 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15018 where
15019 S: serde::Serializer,
15020 {
15021 match self {
15022 Self::Unspecified => serializer.serialize_i32(0),
15023 Self::Migration => serializer.serialize_i32(1),
15024 Self::ContinuousReplication => serializer.serialize_i32(2),
15025 Self::OnpremReplication => serializer.serialize_i32(3),
15026 Self::ReverseOnpremReplication => serializer.serialize_i32(4),
15027 Self::UnknownValue(u) => u.0.serialize(serializer),
15028 }
15029 }
15030 }
15031
15032 impl<'de> serde::de::Deserialize<'de> for VolumeHybridReplicationType {
15033 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15034 where
15035 D: serde::Deserializer<'de>,
15036 {
15037 deserializer.deserialize_any(wkt::internal::EnumVisitor::<VolumeHybridReplicationType>::new(
15038 ".google.cloud.netapp.v1.HybridReplicationParameters.VolumeHybridReplicationType"))
15039 }
15040 }
15041}
15042
15043/// The service level of a storage pool and its volumes.
15044///
15045/// # Working with unknown values
15046///
15047/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15048/// additional enum variants at any time. Adding new variants is not considered
15049/// a breaking change. Applications should write their code in anticipation of:
15050///
15051/// - New values appearing in future releases of the client library, **and**
15052/// - New values received dynamically, without application changes.
15053///
15054/// Please consult the [Working with enums] section in the user guide for some
15055/// guidelines.
15056///
15057/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15058#[derive(Clone, Debug, PartialEq)]
15059#[non_exhaustive]
15060pub enum ServiceLevel {
15061 /// Unspecified service level.
15062 Unspecified,
15063 /// Premium service level.
15064 Premium,
15065 /// Extreme service level.
15066 Extreme,
15067 /// Standard service level.
15068 Standard,
15069 /// Flex service level.
15070 Flex,
15071 /// If set, the enum was initialized with an unknown value.
15072 ///
15073 /// Applications can examine the value using [ServiceLevel::value] or
15074 /// [ServiceLevel::name].
15075 UnknownValue(service_level::UnknownValue),
15076}
15077
15078#[doc(hidden)]
15079pub mod service_level {
15080 #[allow(unused_imports)]
15081 use super::*;
15082 #[derive(Clone, Debug, PartialEq)]
15083 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15084}
15085
15086impl ServiceLevel {
15087 /// Gets the enum value.
15088 ///
15089 /// Returns `None` if the enum contains an unknown value deserialized from
15090 /// the string representation of enums.
15091 pub fn value(&self) -> std::option::Option<i32> {
15092 match self {
15093 Self::Unspecified => std::option::Option::Some(0),
15094 Self::Premium => std::option::Option::Some(1),
15095 Self::Extreme => std::option::Option::Some(2),
15096 Self::Standard => std::option::Option::Some(3),
15097 Self::Flex => std::option::Option::Some(4),
15098 Self::UnknownValue(u) => u.0.value(),
15099 }
15100 }
15101
15102 /// Gets the enum value as a string.
15103 ///
15104 /// Returns `None` if the enum contains an unknown value deserialized from
15105 /// the integer representation of enums.
15106 pub fn name(&self) -> std::option::Option<&str> {
15107 match self {
15108 Self::Unspecified => std::option::Option::Some("SERVICE_LEVEL_UNSPECIFIED"),
15109 Self::Premium => std::option::Option::Some("PREMIUM"),
15110 Self::Extreme => std::option::Option::Some("EXTREME"),
15111 Self::Standard => std::option::Option::Some("STANDARD"),
15112 Self::Flex => std::option::Option::Some("FLEX"),
15113 Self::UnknownValue(u) => u.0.name(),
15114 }
15115 }
15116}
15117
15118impl std::default::Default for ServiceLevel {
15119 fn default() -> Self {
15120 use std::convert::From;
15121 Self::from(0)
15122 }
15123}
15124
15125impl std::fmt::Display for ServiceLevel {
15126 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15127 wkt::internal::display_enum(f, self.name(), self.value())
15128 }
15129}
15130
15131impl std::convert::From<i32> for ServiceLevel {
15132 fn from(value: i32) -> Self {
15133 match value {
15134 0 => Self::Unspecified,
15135 1 => Self::Premium,
15136 2 => Self::Extreme,
15137 3 => Self::Standard,
15138 4 => Self::Flex,
15139 _ => Self::UnknownValue(service_level::UnknownValue(
15140 wkt::internal::UnknownEnumValue::Integer(value),
15141 )),
15142 }
15143 }
15144}
15145
15146impl std::convert::From<&str> for ServiceLevel {
15147 fn from(value: &str) -> Self {
15148 use std::string::ToString;
15149 match value {
15150 "SERVICE_LEVEL_UNSPECIFIED" => Self::Unspecified,
15151 "PREMIUM" => Self::Premium,
15152 "EXTREME" => Self::Extreme,
15153 "STANDARD" => Self::Standard,
15154 "FLEX" => Self::Flex,
15155 _ => Self::UnknownValue(service_level::UnknownValue(
15156 wkt::internal::UnknownEnumValue::String(value.to_string()),
15157 )),
15158 }
15159 }
15160}
15161
15162impl serde::ser::Serialize for ServiceLevel {
15163 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15164 where
15165 S: serde::Serializer,
15166 {
15167 match self {
15168 Self::Unspecified => serializer.serialize_i32(0),
15169 Self::Premium => serializer.serialize_i32(1),
15170 Self::Extreme => serializer.serialize_i32(2),
15171 Self::Standard => serializer.serialize_i32(3),
15172 Self::Flex => serializer.serialize_i32(4),
15173 Self::UnknownValue(u) => u.0.serialize(serializer),
15174 }
15175 }
15176}
15177
15178impl<'de> serde::de::Deserialize<'de> for ServiceLevel {
15179 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15180 where
15181 D: serde::Deserializer<'de>,
15182 {
15183 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ServiceLevel>::new(
15184 ".google.cloud.netapp.v1.ServiceLevel",
15185 ))
15186 }
15187}
15188
15189/// Flex Storage Pool performance.
15190///
15191/// # Working with unknown values
15192///
15193/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15194/// additional enum variants at any time. Adding new variants is not considered
15195/// a breaking change. Applications should write their code in anticipation of:
15196///
15197/// - New values appearing in future releases of the client library, **and**
15198/// - New values received dynamically, without application changes.
15199///
15200/// Please consult the [Working with enums] section in the user guide for some
15201/// guidelines.
15202///
15203/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15204#[derive(Clone, Debug, PartialEq)]
15205#[non_exhaustive]
15206pub enum FlexPerformance {
15207 /// Unspecified flex performance.
15208 Unspecified,
15209 /// Flex Storage Pool with default performance.
15210 Default,
15211 /// Flex Storage Pool with custom performance.
15212 Custom,
15213 /// If set, the enum was initialized with an unknown value.
15214 ///
15215 /// Applications can examine the value using [FlexPerformance::value] or
15216 /// [FlexPerformance::name].
15217 UnknownValue(flex_performance::UnknownValue),
15218}
15219
15220#[doc(hidden)]
15221pub mod flex_performance {
15222 #[allow(unused_imports)]
15223 use super::*;
15224 #[derive(Clone, Debug, PartialEq)]
15225 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15226}
15227
15228impl FlexPerformance {
15229 /// Gets the enum value.
15230 ///
15231 /// Returns `None` if the enum contains an unknown value deserialized from
15232 /// the string representation of enums.
15233 pub fn value(&self) -> std::option::Option<i32> {
15234 match self {
15235 Self::Unspecified => std::option::Option::Some(0),
15236 Self::Default => std::option::Option::Some(1),
15237 Self::Custom => std::option::Option::Some(2),
15238 Self::UnknownValue(u) => u.0.value(),
15239 }
15240 }
15241
15242 /// Gets the enum value as a string.
15243 ///
15244 /// Returns `None` if the enum contains an unknown value deserialized from
15245 /// the integer representation of enums.
15246 pub fn name(&self) -> std::option::Option<&str> {
15247 match self {
15248 Self::Unspecified => std::option::Option::Some("FLEX_PERFORMANCE_UNSPECIFIED"),
15249 Self::Default => std::option::Option::Some("FLEX_PERFORMANCE_DEFAULT"),
15250 Self::Custom => std::option::Option::Some("FLEX_PERFORMANCE_CUSTOM"),
15251 Self::UnknownValue(u) => u.0.name(),
15252 }
15253 }
15254}
15255
15256impl std::default::Default for FlexPerformance {
15257 fn default() -> Self {
15258 use std::convert::From;
15259 Self::from(0)
15260 }
15261}
15262
15263impl std::fmt::Display for FlexPerformance {
15264 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15265 wkt::internal::display_enum(f, self.name(), self.value())
15266 }
15267}
15268
15269impl std::convert::From<i32> for FlexPerformance {
15270 fn from(value: i32) -> Self {
15271 match value {
15272 0 => Self::Unspecified,
15273 1 => Self::Default,
15274 2 => Self::Custom,
15275 _ => Self::UnknownValue(flex_performance::UnknownValue(
15276 wkt::internal::UnknownEnumValue::Integer(value),
15277 )),
15278 }
15279 }
15280}
15281
15282impl std::convert::From<&str> for FlexPerformance {
15283 fn from(value: &str) -> Self {
15284 use std::string::ToString;
15285 match value {
15286 "FLEX_PERFORMANCE_UNSPECIFIED" => Self::Unspecified,
15287 "FLEX_PERFORMANCE_DEFAULT" => Self::Default,
15288 "FLEX_PERFORMANCE_CUSTOM" => Self::Custom,
15289 _ => Self::UnknownValue(flex_performance::UnknownValue(
15290 wkt::internal::UnknownEnumValue::String(value.to_string()),
15291 )),
15292 }
15293 }
15294}
15295
15296impl serde::ser::Serialize for FlexPerformance {
15297 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15298 where
15299 S: serde::Serializer,
15300 {
15301 match self {
15302 Self::Unspecified => serializer.serialize_i32(0),
15303 Self::Default => serializer.serialize_i32(1),
15304 Self::Custom => serializer.serialize_i32(2),
15305 Self::UnknownValue(u) => u.0.serialize(serializer),
15306 }
15307 }
15308}
15309
15310impl<'de> serde::de::Deserialize<'de> for FlexPerformance {
15311 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15312 where
15313 D: serde::Deserializer<'de>,
15314 {
15315 deserializer.deserialize_any(wkt::internal::EnumVisitor::<FlexPerformance>::new(
15316 ".google.cloud.netapp.v1.FlexPerformance",
15317 ))
15318 }
15319}
15320
15321/// The volume encryption key source.
15322///
15323/// # Working with unknown values
15324///
15325/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15326/// additional enum variants at any time. Adding new variants is not considered
15327/// a breaking change. Applications should write their code in anticipation of:
15328///
15329/// - New values appearing in future releases of the client library, **and**
15330/// - New values received dynamically, without application changes.
15331///
15332/// Please consult the [Working with enums] section in the user guide for some
15333/// guidelines.
15334///
15335/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15336#[derive(Clone, Debug, PartialEq)]
15337#[non_exhaustive]
15338pub enum EncryptionType {
15339 /// The source of the encryption key is not specified.
15340 Unspecified,
15341 /// Google managed encryption key.
15342 ServiceManaged,
15343 /// Customer managed encryption key, which is stored in KMS.
15344 CloudKms,
15345 /// If set, the enum was initialized with an unknown value.
15346 ///
15347 /// Applications can examine the value using [EncryptionType::value] or
15348 /// [EncryptionType::name].
15349 UnknownValue(encryption_type::UnknownValue),
15350}
15351
15352#[doc(hidden)]
15353pub mod encryption_type {
15354 #[allow(unused_imports)]
15355 use super::*;
15356 #[derive(Clone, Debug, PartialEq)]
15357 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15358}
15359
15360impl EncryptionType {
15361 /// Gets the enum value.
15362 ///
15363 /// Returns `None` if the enum contains an unknown value deserialized from
15364 /// the string representation of enums.
15365 pub fn value(&self) -> std::option::Option<i32> {
15366 match self {
15367 Self::Unspecified => std::option::Option::Some(0),
15368 Self::ServiceManaged => std::option::Option::Some(1),
15369 Self::CloudKms => std::option::Option::Some(2),
15370 Self::UnknownValue(u) => u.0.value(),
15371 }
15372 }
15373
15374 /// Gets the enum value as a string.
15375 ///
15376 /// Returns `None` if the enum contains an unknown value deserialized from
15377 /// the integer representation of enums.
15378 pub fn name(&self) -> std::option::Option<&str> {
15379 match self {
15380 Self::Unspecified => std::option::Option::Some("ENCRYPTION_TYPE_UNSPECIFIED"),
15381 Self::ServiceManaged => std::option::Option::Some("SERVICE_MANAGED"),
15382 Self::CloudKms => std::option::Option::Some("CLOUD_KMS"),
15383 Self::UnknownValue(u) => u.0.name(),
15384 }
15385 }
15386}
15387
15388impl std::default::Default for EncryptionType {
15389 fn default() -> Self {
15390 use std::convert::From;
15391 Self::from(0)
15392 }
15393}
15394
15395impl std::fmt::Display for EncryptionType {
15396 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15397 wkt::internal::display_enum(f, self.name(), self.value())
15398 }
15399}
15400
15401impl std::convert::From<i32> for EncryptionType {
15402 fn from(value: i32) -> Self {
15403 match value {
15404 0 => Self::Unspecified,
15405 1 => Self::ServiceManaged,
15406 2 => Self::CloudKms,
15407 _ => Self::UnknownValue(encryption_type::UnknownValue(
15408 wkt::internal::UnknownEnumValue::Integer(value),
15409 )),
15410 }
15411 }
15412}
15413
15414impl std::convert::From<&str> for EncryptionType {
15415 fn from(value: &str) -> Self {
15416 use std::string::ToString;
15417 match value {
15418 "ENCRYPTION_TYPE_UNSPECIFIED" => Self::Unspecified,
15419 "SERVICE_MANAGED" => Self::ServiceManaged,
15420 "CLOUD_KMS" => Self::CloudKms,
15421 _ => Self::UnknownValue(encryption_type::UnknownValue(
15422 wkt::internal::UnknownEnumValue::String(value.to_string()),
15423 )),
15424 }
15425 }
15426}
15427
15428impl serde::ser::Serialize for EncryptionType {
15429 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15430 where
15431 S: serde::Serializer,
15432 {
15433 match self {
15434 Self::Unspecified => serializer.serialize_i32(0),
15435 Self::ServiceManaged => serializer.serialize_i32(1),
15436 Self::CloudKms => serializer.serialize_i32(2),
15437 Self::UnknownValue(u) => u.0.serialize(serializer),
15438 }
15439 }
15440}
15441
15442impl<'de> serde::de::Deserialize<'de> for EncryptionType {
15443 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15444 where
15445 D: serde::Deserializer<'de>,
15446 {
15447 deserializer.deserialize_any(wkt::internal::EnumVisitor::<EncryptionType>::new(
15448 ".google.cloud.netapp.v1.EncryptionType",
15449 ))
15450 }
15451}
15452
15453/// Type of directory service
15454///
15455/// # Working with unknown values
15456///
15457/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15458/// additional enum variants at any time. Adding new variants is not considered
15459/// a breaking change. Applications should write their code in anticipation of:
15460///
15461/// - New values appearing in future releases of the client library, **and**
15462/// - New values received dynamically, without application changes.
15463///
15464/// Please consult the [Working with enums] section in the user guide for some
15465/// guidelines.
15466///
15467/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15468#[derive(Clone, Debug, PartialEq)]
15469#[non_exhaustive]
15470pub enum DirectoryServiceType {
15471 /// Directory service type is not specified.
15472 Unspecified,
15473 /// Active directory policy attached to the storage pool.
15474 ActiveDirectory,
15475 /// If set, the enum was initialized with an unknown value.
15476 ///
15477 /// Applications can examine the value using [DirectoryServiceType::value] or
15478 /// [DirectoryServiceType::name].
15479 UnknownValue(directory_service_type::UnknownValue),
15480}
15481
15482#[doc(hidden)]
15483pub mod directory_service_type {
15484 #[allow(unused_imports)]
15485 use super::*;
15486 #[derive(Clone, Debug, PartialEq)]
15487 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15488}
15489
15490impl DirectoryServiceType {
15491 /// Gets the enum value.
15492 ///
15493 /// Returns `None` if the enum contains an unknown value deserialized from
15494 /// the string representation of enums.
15495 pub fn value(&self) -> std::option::Option<i32> {
15496 match self {
15497 Self::Unspecified => std::option::Option::Some(0),
15498 Self::ActiveDirectory => std::option::Option::Some(1),
15499 Self::UnknownValue(u) => u.0.value(),
15500 }
15501 }
15502
15503 /// Gets the enum value as a string.
15504 ///
15505 /// Returns `None` if the enum contains an unknown value deserialized from
15506 /// the integer representation of enums.
15507 pub fn name(&self) -> std::option::Option<&str> {
15508 match self {
15509 Self::Unspecified => std::option::Option::Some("DIRECTORY_SERVICE_TYPE_UNSPECIFIED"),
15510 Self::ActiveDirectory => std::option::Option::Some("ACTIVE_DIRECTORY"),
15511 Self::UnknownValue(u) => u.0.name(),
15512 }
15513 }
15514}
15515
15516impl std::default::Default for DirectoryServiceType {
15517 fn default() -> Self {
15518 use std::convert::From;
15519 Self::from(0)
15520 }
15521}
15522
15523impl std::fmt::Display for DirectoryServiceType {
15524 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15525 wkt::internal::display_enum(f, self.name(), self.value())
15526 }
15527}
15528
15529impl std::convert::From<i32> for DirectoryServiceType {
15530 fn from(value: i32) -> Self {
15531 match value {
15532 0 => Self::Unspecified,
15533 1 => Self::ActiveDirectory,
15534 _ => Self::UnknownValue(directory_service_type::UnknownValue(
15535 wkt::internal::UnknownEnumValue::Integer(value),
15536 )),
15537 }
15538 }
15539}
15540
15541impl std::convert::From<&str> for DirectoryServiceType {
15542 fn from(value: &str) -> Self {
15543 use std::string::ToString;
15544 match value {
15545 "DIRECTORY_SERVICE_TYPE_UNSPECIFIED" => Self::Unspecified,
15546 "ACTIVE_DIRECTORY" => Self::ActiveDirectory,
15547 _ => Self::UnknownValue(directory_service_type::UnknownValue(
15548 wkt::internal::UnknownEnumValue::String(value.to_string()),
15549 )),
15550 }
15551 }
15552}
15553
15554impl serde::ser::Serialize for DirectoryServiceType {
15555 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15556 where
15557 S: serde::Serializer,
15558 {
15559 match self {
15560 Self::Unspecified => serializer.serialize_i32(0),
15561 Self::ActiveDirectory => serializer.serialize_i32(1),
15562 Self::UnknownValue(u) => u.0.serialize(serializer),
15563 }
15564 }
15565}
15566
15567impl<'de> serde::de::Deserialize<'de> for DirectoryServiceType {
15568 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15569 where
15570 D: serde::Deserializer<'de>,
15571 {
15572 deserializer.deserialize_any(wkt::internal::EnumVisitor::<DirectoryServiceType>::new(
15573 ".google.cloud.netapp.v1.DirectoryServiceType",
15574 ))
15575 }
15576}
15577
15578/// Schedule for Hybrid Replication.
15579/// New enum values may be added in future to support different frequency of
15580/// replication.
15581///
15582/// # Working with unknown values
15583///
15584/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15585/// additional enum variants at any time. Adding new variants is not considered
15586/// a breaking change. Applications should write their code in anticipation of:
15587///
15588/// - New values appearing in future releases of the client library, **and**
15589/// - New values received dynamically, without application changes.
15590///
15591/// Please consult the [Working with enums] section in the user guide for some
15592/// guidelines.
15593///
15594/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15595#[derive(Clone, Debug, PartialEq)]
15596#[non_exhaustive]
15597pub enum HybridReplicationSchedule {
15598 /// Unspecified HybridReplicationSchedule
15599 Unspecified,
15600 /// Replication happens once every 10 minutes.
15601 Every10Minutes,
15602 /// Replication happens once every hour.
15603 Hourly,
15604 /// Replication happens once every day.
15605 Daily,
15606 /// If set, the enum was initialized with an unknown value.
15607 ///
15608 /// Applications can examine the value using [HybridReplicationSchedule::value] or
15609 /// [HybridReplicationSchedule::name].
15610 UnknownValue(hybrid_replication_schedule::UnknownValue),
15611}
15612
15613#[doc(hidden)]
15614pub mod hybrid_replication_schedule {
15615 #[allow(unused_imports)]
15616 use super::*;
15617 #[derive(Clone, Debug, PartialEq)]
15618 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15619}
15620
15621impl HybridReplicationSchedule {
15622 /// Gets the enum value.
15623 ///
15624 /// Returns `None` if the enum contains an unknown value deserialized from
15625 /// the string representation of enums.
15626 pub fn value(&self) -> std::option::Option<i32> {
15627 match self {
15628 Self::Unspecified => std::option::Option::Some(0),
15629 Self::Every10Minutes => std::option::Option::Some(1),
15630 Self::Hourly => std::option::Option::Some(2),
15631 Self::Daily => std::option::Option::Some(3),
15632 Self::UnknownValue(u) => u.0.value(),
15633 }
15634 }
15635
15636 /// Gets the enum value as a string.
15637 ///
15638 /// Returns `None` if the enum contains an unknown value deserialized from
15639 /// the integer representation of enums.
15640 pub fn name(&self) -> std::option::Option<&str> {
15641 match self {
15642 Self::Unspecified => {
15643 std::option::Option::Some("HYBRID_REPLICATION_SCHEDULE_UNSPECIFIED")
15644 }
15645 Self::Every10Minutes => std::option::Option::Some("EVERY_10_MINUTES"),
15646 Self::Hourly => std::option::Option::Some("HOURLY"),
15647 Self::Daily => std::option::Option::Some("DAILY"),
15648 Self::UnknownValue(u) => u.0.name(),
15649 }
15650 }
15651}
15652
15653impl std::default::Default for HybridReplicationSchedule {
15654 fn default() -> Self {
15655 use std::convert::From;
15656 Self::from(0)
15657 }
15658}
15659
15660impl std::fmt::Display for HybridReplicationSchedule {
15661 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15662 wkt::internal::display_enum(f, self.name(), self.value())
15663 }
15664}
15665
15666impl std::convert::From<i32> for HybridReplicationSchedule {
15667 fn from(value: i32) -> Self {
15668 match value {
15669 0 => Self::Unspecified,
15670 1 => Self::Every10Minutes,
15671 2 => Self::Hourly,
15672 3 => Self::Daily,
15673 _ => Self::UnknownValue(hybrid_replication_schedule::UnknownValue(
15674 wkt::internal::UnknownEnumValue::Integer(value),
15675 )),
15676 }
15677 }
15678}
15679
15680impl std::convert::From<&str> for HybridReplicationSchedule {
15681 fn from(value: &str) -> Self {
15682 use std::string::ToString;
15683 match value {
15684 "HYBRID_REPLICATION_SCHEDULE_UNSPECIFIED" => Self::Unspecified,
15685 "EVERY_10_MINUTES" => Self::Every10Minutes,
15686 "HOURLY" => Self::Hourly,
15687 "DAILY" => Self::Daily,
15688 _ => Self::UnknownValue(hybrid_replication_schedule::UnknownValue(
15689 wkt::internal::UnknownEnumValue::String(value.to_string()),
15690 )),
15691 }
15692 }
15693}
15694
15695impl serde::ser::Serialize for HybridReplicationSchedule {
15696 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15697 where
15698 S: serde::Serializer,
15699 {
15700 match self {
15701 Self::Unspecified => serializer.serialize_i32(0),
15702 Self::Every10Minutes => serializer.serialize_i32(1),
15703 Self::Hourly => serializer.serialize_i32(2),
15704 Self::Daily => serializer.serialize_i32(3),
15705 Self::UnknownValue(u) => u.0.serialize(serializer),
15706 }
15707 }
15708}
15709
15710impl<'de> serde::de::Deserialize<'de> for HybridReplicationSchedule {
15711 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15712 where
15713 D: serde::Deserializer<'de>,
15714 {
15715 deserializer.deserialize_any(
15716 wkt::internal::EnumVisitor::<HybridReplicationSchedule>::new(
15717 ".google.cloud.netapp.v1.HybridReplicationSchedule",
15718 ),
15719 )
15720 }
15721}
15722
15723/// QoS (Quality of Service) Types of the storage pool
15724///
15725/// # Working with unknown values
15726///
15727/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15728/// additional enum variants at any time. Adding new variants is not considered
15729/// a breaking change. Applications should write their code in anticipation of:
15730///
15731/// - New values appearing in future releases of the client library, **and**
15732/// - New values received dynamically, without application changes.
15733///
15734/// Please consult the [Working with enums] section in the user guide for some
15735/// guidelines.
15736///
15737/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15738#[derive(Clone, Debug, PartialEq)]
15739#[non_exhaustive]
15740pub enum QosType {
15741 /// Unspecified QoS Type
15742 Unspecified,
15743 /// QoS Type is Auto
15744 Auto,
15745 /// QoS Type is Manual
15746 Manual,
15747 /// If set, the enum was initialized with an unknown value.
15748 ///
15749 /// Applications can examine the value using [QosType::value] or
15750 /// [QosType::name].
15751 UnknownValue(qos_type::UnknownValue),
15752}
15753
15754#[doc(hidden)]
15755pub mod qos_type {
15756 #[allow(unused_imports)]
15757 use super::*;
15758 #[derive(Clone, Debug, PartialEq)]
15759 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15760}
15761
15762impl QosType {
15763 /// Gets the enum value.
15764 ///
15765 /// Returns `None` if the enum contains an unknown value deserialized from
15766 /// the string representation of enums.
15767 pub fn value(&self) -> std::option::Option<i32> {
15768 match self {
15769 Self::Unspecified => std::option::Option::Some(0),
15770 Self::Auto => std::option::Option::Some(1),
15771 Self::Manual => std::option::Option::Some(2),
15772 Self::UnknownValue(u) => u.0.value(),
15773 }
15774 }
15775
15776 /// Gets the enum value as a string.
15777 ///
15778 /// Returns `None` if the enum contains an unknown value deserialized from
15779 /// the integer representation of enums.
15780 pub fn name(&self) -> std::option::Option<&str> {
15781 match self {
15782 Self::Unspecified => std::option::Option::Some("QOS_TYPE_UNSPECIFIED"),
15783 Self::Auto => std::option::Option::Some("AUTO"),
15784 Self::Manual => std::option::Option::Some("MANUAL"),
15785 Self::UnknownValue(u) => u.0.name(),
15786 }
15787 }
15788}
15789
15790impl std::default::Default for QosType {
15791 fn default() -> Self {
15792 use std::convert::From;
15793 Self::from(0)
15794 }
15795}
15796
15797impl std::fmt::Display for QosType {
15798 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15799 wkt::internal::display_enum(f, self.name(), self.value())
15800 }
15801}
15802
15803impl std::convert::From<i32> for QosType {
15804 fn from(value: i32) -> Self {
15805 match value {
15806 0 => Self::Unspecified,
15807 1 => Self::Auto,
15808 2 => Self::Manual,
15809 _ => Self::UnknownValue(qos_type::UnknownValue(
15810 wkt::internal::UnknownEnumValue::Integer(value),
15811 )),
15812 }
15813 }
15814}
15815
15816impl std::convert::From<&str> for QosType {
15817 fn from(value: &str) -> Self {
15818 use std::string::ToString;
15819 match value {
15820 "QOS_TYPE_UNSPECIFIED" => Self::Unspecified,
15821 "AUTO" => Self::Auto,
15822 "MANUAL" => Self::Manual,
15823 _ => Self::UnknownValue(qos_type::UnknownValue(
15824 wkt::internal::UnknownEnumValue::String(value.to_string()),
15825 )),
15826 }
15827 }
15828}
15829
15830impl serde::ser::Serialize for QosType {
15831 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15832 where
15833 S: serde::Serializer,
15834 {
15835 match self {
15836 Self::Unspecified => serializer.serialize_i32(0),
15837 Self::Auto => serializer.serialize_i32(1),
15838 Self::Manual => serializer.serialize_i32(2),
15839 Self::UnknownValue(u) => u.0.serialize(serializer),
15840 }
15841 }
15842}
15843
15844impl<'de> serde::de::Deserialize<'de> for QosType {
15845 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15846 where
15847 D: serde::Deserializer<'de>,
15848 {
15849 deserializer.deserialize_any(wkt::internal::EnumVisitor::<QosType>::new(
15850 ".google.cloud.netapp.v1.QosType",
15851 ))
15852 }
15853}
15854
15855/// Protocols is an enum of all the supported network protocols for a volume.
15856///
15857/// # Working with unknown values
15858///
15859/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15860/// additional enum variants at any time. Adding new variants is not considered
15861/// a breaking change. Applications should write their code in anticipation of:
15862///
15863/// - New values appearing in future releases of the client library, **and**
15864/// - New values received dynamically, without application changes.
15865///
15866/// Please consult the [Working with enums] section in the user guide for some
15867/// guidelines.
15868///
15869/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
15870#[derive(Clone, Debug, PartialEq)]
15871#[non_exhaustive]
15872pub enum Protocols {
15873 /// Unspecified protocol
15874 Unspecified,
15875 /// NFS V3 protocol
15876 Nfsv3,
15877 /// NFS V4 protocol
15878 Nfsv4,
15879 /// SMB protocol
15880 Smb,
15881 /// If set, the enum was initialized with an unknown value.
15882 ///
15883 /// Applications can examine the value using [Protocols::value] or
15884 /// [Protocols::name].
15885 UnknownValue(protocols::UnknownValue),
15886}
15887
15888#[doc(hidden)]
15889pub mod protocols {
15890 #[allow(unused_imports)]
15891 use super::*;
15892 #[derive(Clone, Debug, PartialEq)]
15893 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
15894}
15895
15896impl Protocols {
15897 /// Gets the enum value.
15898 ///
15899 /// Returns `None` if the enum contains an unknown value deserialized from
15900 /// the string representation of enums.
15901 pub fn value(&self) -> std::option::Option<i32> {
15902 match self {
15903 Self::Unspecified => std::option::Option::Some(0),
15904 Self::Nfsv3 => std::option::Option::Some(1),
15905 Self::Nfsv4 => std::option::Option::Some(2),
15906 Self::Smb => std::option::Option::Some(3),
15907 Self::UnknownValue(u) => u.0.value(),
15908 }
15909 }
15910
15911 /// Gets the enum value as a string.
15912 ///
15913 /// Returns `None` if the enum contains an unknown value deserialized from
15914 /// the integer representation of enums.
15915 pub fn name(&self) -> std::option::Option<&str> {
15916 match self {
15917 Self::Unspecified => std::option::Option::Some("PROTOCOLS_UNSPECIFIED"),
15918 Self::Nfsv3 => std::option::Option::Some("NFSV3"),
15919 Self::Nfsv4 => std::option::Option::Some("NFSV4"),
15920 Self::Smb => std::option::Option::Some("SMB"),
15921 Self::UnknownValue(u) => u.0.name(),
15922 }
15923 }
15924}
15925
15926impl std::default::Default for Protocols {
15927 fn default() -> Self {
15928 use std::convert::From;
15929 Self::from(0)
15930 }
15931}
15932
15933impl std::fmt::Display for Protocols {
15934 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
15935 wkt::internal::display_enum(f, self.name(), self.value())
15936 }
15937}
15938
15939impl std::convert::From<i32> for Protocols {
15940 fn from(value: i32) -> Self {
15941 match value {
15942 0 => Self::Unspecified,
15943 1 => Self::Nfsv3,
15944 2 => Self::Nfsv4,
15945 3 => Self::Smb,
15946 _ => Self::UnknownValue(protocols::UnknownValue(
15947 wkt::internal::UnknownEnumValue::Integer(value),
15948 )),
15949 }
15950 }
15951}
15952
15953impl std::convert::From<&str> for Protocols {
15954 fn from(value: &str) -> Self {
15955 use std::string::ToString;
15956 match value {
15957 "PROTOCOLS_UNSPECIFIED" => Self::Unspecified,
15958 "NFSV3" => Self::Nfsv3,
15959 "NFSV4" => Self::Nfsv4,
15960 "SMB" => Self::Smb,
15961 _ => Self::UnknownValue(protocols::UnknownValue(
15962 wkt::internal::UnknownEnumValue::String(value.to_string()),
15963 )),
15964 }
15965 }
15966}
15967
15968impl serde::ser::Serialize for Protocols {
15969 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
15970 where
15971 S: serde::Serializer,
15972 {
15973 match self {
15974 Self::Unspecified => serializer.serialize_i32(0),
15975 Self::Nfsv3 => serializer.serialize_i32(1),
15976 Self::Nfsv4 => serializer.serialize_i32(2),
15977 Self::Smb => serializer.serialize_i32(3),
15978 Self::UnknownValue(u) => u.0.serialize(serializer),
15979 }
15980 }
15981}
15982
15983impl<'de> serde::de::Deserialize<'de> for Protocols {
15984 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
15985 where
15986 D: serde::Deserializer<'de>,
15987 {
15988 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Protocols>::new(
15989 ".google.cloud.netapp.v1.Protocols",
15990 ))
15991 }
15992}
15993
15994/// AccessType is an enum of all the supported access types for a volume.
15995///
15996/// # Working with unknown values
15997///
15998/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
15999/// additional enum variants at any time. Adding new variants is not considered
16000/// a breaking change. Applications should write their code in anticipation of:
16001///
16002/// - New values appearing in future releases of the client library, **and**
16003/// - New values received dynamically, without application changes.
16004///
16005/// Please consult the [Working with enums] section in the user guide for some
16006/// guidelines.
16007///
16008/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16009#[derive(Clone, Debug, PartialEq)]
16010#[non_exhaustive]
16011pub enum AccessType {
16012 /// Unspecified Access Type
16013 Unspecified,
16014 /// Read Only
16015 ReadOnly,
16016 /// Read Write
16017 ReadWrite,
16018 /// None
16019 ReadNone,
16020 /// If set, the enum was initialized with an unknown value.
16021 ///
16022 /// Applications can examine the value using [AccessType::value] or
16023 /// [AccessType::name].
16024 UnknownValue(access_type::UnknownValue),
16025}
16026
16027#[doc(hidden)]
16028pub mod access_type {
16029 #[allow(unused_imports)]
16030 use super::*;
16031 #[derive(Clone, Debug, PartialEq)]
16032 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16033}
16034
16035impl AccessType {
16036 /// Gets the enum value.
16037 ///
16038 /// Returns `None` if the enum contains an unknown value deserialized from
16039 /// the string representation of enums.
16040 pub fn value(&self) -> std::option::Option<i32> {
16041 match self {
16042 Self::Unspecified => std::option::Option::Some(0),
16043 Self::ReadOnly => std::option::Option::Some(1),
16044 Self::ReadWrite => std::option::Option::Some(2),
16045 Self::ReadNone => std::option::Option::Some(3),
16046 Self::UnknownValue(u) => u.0.value(),
16047 }
16048 }
16049
16050 /// Gets the enum value as a string.
16051 ///
16052 /// Returns `None` if the enum contains an unknown value deserialized from
16053 /// the integer representation of enums.
16054 pub fn name(&self) -> std::option::Option<&str> {
16055 match self {
16056 Self::Unspecified => std::option::Option::Some("ACCESS_TYPE_UNSPECIFIED"),
16057 Self::ReadOnly => std::option::Option::Some("READ_ONLY"),
16058 Self::ReadWrite => std::option::Option::Some("READ_WRITE"),
16059 Self::ReadNone => std::option::Option::Some("READ_NONE"),
16060 Self::UnknownValue(u) => u.0.name(),
16061 }
16062 }
16063}
16064
16065impl std::default::Default for AccessType {
16066 fn default() -> Self {
16067 use std::convert::From;
16068 Self::from(0)
16069 }
16070}
16071
16072impl std::fmt::Display for AccessType {
16073 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16074 wkt::internal::display_enum(f, self.name(), self.value())
16075 }
16076}
16077
16078impl std::convert::From<i32> for AccessType {
16079 fn from(value: i32) -> Self {
16080 match value {
16081 0 => Self::Unspecified,
16082 1 => Self::ReadOnly,
16083 2 => Self::ReadWrite,
16084 3 => Self::ReadNone,
16085 _ => Self::UnknownValue(access_type::UnknownValue(
16086 wkt::internal::UnknownEnumValue::Integer(value),
16087 )),
16088 }
16089 }
16090}
16091
16092impl std::convert::From<&str> for AccessType {
16093 fn from(value: &str) -> Self {
16094 use std::string::ToString;
16095 match value {
16096 "ACCESS_TYPE_UNSPECIFIED" => Self::Unspecified,
16097 "READ_ONLY" => Self::ReadOnly,
16098 "READ_WRITE" => Self::ReadWrite,
16099 "READ_NONE" => Self::ReadNone,
16100 _ => Self::UnknownValue(access_type::UnknownValue(
16101 wkt::internal::UnknownEnumValue::String(value.to_string()),
16102 )),
16103 }
16104 }
16105}
16106
16107impl serde::ser::Serialize for AccessType {
16108 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16109 where
16110 S: serde::Serializer,
16111 {
16112 match self {
16113 Self::Unspecified => serializer.serialize_i32(0),
16114 Self::ReadOnly => serializer.serialize_i32(1),
16115 Self::ReadWrite => serializer.serialize_i32(2),
16116 Self::ReadNone => serializer.serialize_i32(3),
16117 Self::UnknownValue(u) => u.0.serialize(serializer),
16118 }
16119 }
16120}
16121
16122impl<'de> serde::de::Deserialize<'de> for AccessType {
16123 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16124 where
16125 D: serde::Deserializer<'de>,
16126 {
16127 deserializer.deserialize_any(wkt::internal::EnumVisitor::<AccessType>::new(
16128 ".google.cloud.netapp.v1.AccessType",
16129 ))
16130 }
16131}
16132
16133/// SMBSettings
16134/// Modifies the behaviour of a SMB volume.
16135///
16136/// # Working with unknown values
16137///
16138/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16139/// additional enum variants at any time. Adding new variants is not considered
16140/// a breaking change. Applications should write their code in anticipation of:
16141///
16142/// - New values appearing in future releases of the client library, **and**
16143/// - New values received dynamically, without application changes.
16144///
16145/// Please consult the [Working with enums] section in the user guide for some
16146/// guidelines.
16147///
16148/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16149#[derive(Clone, Debug, PartialEq)]
16150#[non_exhaustive]
16151pub enum SMBSettings {
16152 /// Unspecified default option
16153 Unspecified,
16154 /// SMB setting encrypt data
16155 EncryptData,
16156 /// SMB setting browsable
16157 Browsable,
16158 /// SMB setting notify change
16159 ChangeNotify,
16160 /// SMB setting not to notify change
16161 NonBrowsable,
16162 /// SMB setting oplocks
16163 Oplocks,
16164 /// SMB setting to show snapshots
16165 ShowSnapshot,
16166 /// SMB setting to show previous versions
16167 ShowPreviousVersions,
16168 /// SMB setting to access volume based on enumerartion
16169 AccessBasedEnumeration,
16170 /// Continuously available enumeration
16171 ContinuouslyAvailable,
16172 /// If set, the enum was initialized with an unknown value.
16173 ///
16174 /// Applications can examine the value using [SMBSettings::value] or
16175 /// [SMBSettings::name].
16176 UnknownValue(smb_settings::UnknownValue),
16177}
16178
16179#[doc(hidden)]
16180pub mod smb_settings {
16181 #[allow(unused_imports)]
16182 use super::*;
16183 #[derive(Clone, Debug, PartialEq)]
16184 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16185}
16186
16187impl SMBSettings {
16188 /// Gets the enum value.
16189 ///
16190 /// Returns `None` if the enum contains an unknown value deserialized from
16191 /// the string representation of enums.
16192 pub fn value(&self) -> std::option::Option<i32> {
16193 match self {
16194 Self::Unspecified => std::option::Option::Some(0),
16195 Self::EncryptData => std::option::Option::Some(1),
16196 Self::Browsable => std::option::Option::Some(2),
16197 Self::ChangeNotify => std::option::Option::Some(3),
16198 Self::NonBrowsable => std::option::Option::Some(4),
16199 Self::Oplocks => std::option::Option::Some(5),
16200 Self::ShowSnapshot => std::option::Option::Some(6),
16201 Self::ShowPreviousVersions => std::option::Option::Some(7),
16202 Self::AccessBasedEnumeration => std::option::Option::Some(8),
16203 Self::ContinuouslyAvailable => std::option::Option::Some(9),
16204 Self::UnknownValue(u) => u.0.value(),
16205 }
16206 }
16207
16208 /// Gets the enum value as a string.
16209 ///
16210 /// Returns `None` if the enum contains an unknown value deserialized from
16211 /// the integer representation of enums.
16212 pub fn name(&self) -> std::option::Option<&str> {
16213 match self {
16214 Self::Unspecified => std::option::Option::Some("SMB_SETTINGS_UNSPECIFIED"),
16215 Self::EncryptData => std::option::Option::Some("ENCRYPT_DATA"),
16216 Self::Browsable => std::option::Option::Some("BROWSABLE"),
16217 Self::ChangeNotify => std::option::Option::Some("CHANGE_NOTIFY"),
16218 Self::NonBrowsable => std::option::Option::Some("NON_BROWSABLE"),
16219 Self::Oplocks => std::option::Option::Some("OPLOCKS"),
16220 Self::ShowSnapshot => std::option::Option::Some("SHOW_SNAPSHOT"),
16221 Self::ShowPreviousVersions => std::option::Option::Some("SHOW_PREVIOUS_VERSIONS"),
16222 Self::AccessBasedEnumeration => std::option::Option::Some("ACCESS_BASED_ENUMERATION"),
16223 Self::ContinuouslyAvailable => std::option::Option::Some("CONTINUOUSLY_AVAILABLE"),
16224 Self::UnknownValue(u) => u.0.name(),
16225 }
16226 }
16227}
16228
16229impl std::default::Default for SMBSettings {
16230 fn default() -> Self {
16231 use std::convert::From;
16232 Self::from(0)
16233 }
16234}
16235
16236impl std::fmt::Display for SMBSettings {
16237 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16238 wkt::internal::display_enum(f, self.name(), self.value())
16239 }
16240}
16241
16242impl std::convert::From<i32> for SMBSettings {
16243 fn from(value: i32) -> Self {
16244 match value {
16245 0 => Self::Unspecified,
16246 1 => Self::EncryptData,
16247 2 => Self::Browsable,
16248 3 => Self::ChangeNotify,
16249 4 => Self::NonBrowsable,
16250 5 => Self::Oplocks,
16251 6 => Self::ShowSnapshot,
16252 7 => Self::ShowPreviousVersions,
16253 8 => Self::AccessBasedEnumeration,
16254 9 => Self::ContinuouslyAvailable,
16255 _ => Self::UnknownValue(smb_settings::UnknownValue(
16256 wkt::internal::UnknownEnumValue::Integer(value),
16257 )),
16258 }
16259 }
16260}
16261
16262impl std::convert::From<&str> for SMBSettings {
16263 fn from(value: &str) -> Self {
16264 use std::string::ToString;
16265 match value {
16266 "SMB_SETTINGS_UNSPECIFIED" => Self::Unspecified,
16267 "ENCRYPT_DATA" => Self::EncryptData,
16268 "BROWSABLE" => Self::Browsable,
16269 "CHANGE_NOTIFY" => Self::ChangeNotify,
16270 "NON_BROWSABLE" => Self::NonBrowsable,
16271 "OPLOCKS" => Self::Oplocks,
16272 "SHOW_SNAPSHOT" => Self::ShowSnapshot,
16273 "SHOW_PREVIOUS_VERSIONS" => Self::ShowPreviousVersions,
16274 "ACCESS_BASED_ENUMERATION" => Self::AccessBasedEnumeration,
16275 "CONTINUOUSLY_AVAILABLE" => Self::ContinuouslyAvailable,
16276 _ => Self::UnknownValue(smb_settings::UnknownValue(
16277 wkt::internal::UnknownEnumValue::String(value.to_string()),
16278 )),
16279 }
16280 }
16281}
16282
16283impl serde::ser::Serialize for SMBSettings {
16284 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16285 where
16286 S: serde::Serializer,
16287 {
16288 match self {
16289 Self::Unspecified => serializer.serialize_i32(0),
16290 Self::EncryptData => serializer.serialize_i32(1),
16291 Self::Browsable => serializer.serialize_i32(2),
16292 Self::ChangeNotify => serializer.serialize_i32(3),
16293 Self::NonBrowsable => serializer.serialize_i32(4),
16294 Self::Oplocks => serializer.serialize_i32(5),
16295 Self::ShowSnapshot => serializer.serialize_i32(6),
16296 Self::ShowPreviousVersions => serializer.serialize_i32(7),
16297 Self::AccessBasedEnumeration => serializer.serialize_i32(8),
16298 Self::ContinuouslyAvailable => serializer.serialize_i32(9),
16299 Self::UnknownValue(u) => u.0.serialize(serializer),
16300 }
16301 }
16302}
16303
16304impl<'de> serde::de::Deserialize<'de> for SMBSettings {
16305 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16306 where
16307 D: serde::Deserializer<'de>,
16308 {
16309 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SMBSettings>::new(
16310 ".google.cloud.netapp.v1.SMBSettings",
16311 ))
16312 }
16313}
16314
16315/// The security style of the volume, can be either UNIX or NTFS.
16316///
16317/// # Working with unknown values
16318///
16319/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16320/// additional enum variants at any time. Adding new variants is not considered
16321/// a breaking change. Applications should write their code in anticipation of:
16322///
16323/// - New values appearing in future releases of the client library, **and**
16324/// - New values received dynamically, without application changes.
16325///
16326/// Please consult the [Working with enums] section in the user guide for some
16327/// guidelines.
16328///
16329/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16330#[derive(Clone, Debug, PartialEq)]
16331#[non_exhaustive]
16332pub enum SecurityStyle {
16333 /// SecurityStyle is unspecified
16334 Unspecified,
16335 /// SecurityStyle uses NTFS
16336 Ntfs,
16337 /// SecurityStyle uses UNIX
16338 Unix,
16339 /// If set, the enum was initialized with an unknown value.
16340 ///
16341 /// Applications can examine the value using [SecurityStyle::value] or
16342 /// [SecurityStyle::name].
16343 UnknownValue(security_style::UnknownValue),
16344}
16345
16346#[doc(hidden)]
16347pub mod security_style {
16348 #[allow(unused_imports)]
16349 use super::*;
16350 #[derive(Clone, Debug, PartialEq)]
16351 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16352}
16353
16354impl SecurityStyle {
16355 /// Gets the enum value.
16356 ///
16357 /// Returns `None` if the enum contains an unknown value deserialized from
16358 /// the string representation of enums.
16359 pub fn value(&self) -> std::option::Option<i32> {
16360 match self {
16361 Self::Unspecified => std::option::Option::Some(0),
16362 Self::Ntfs => std::option::Option::Some(1),
16363 Self::Unix => std::option::Option::Some(2),
16364 Self::UnknownValue(u) => u.0.value(),
16365 }
16366 }
16367
16368 /// Gets the enum value as a string.
16369 ///
16370 /// Returns `None` if the enum contains an unknown value deserialized from
16371 /// the integer representation of enums.
16372 pub fn name(&self) -> std::option::Option<&str> {
16373 match self {
16374 Self::Unspecified => std::option::Option::Some("SECURITY_STYLE_UNSPECIFIED"),
16375 Self::Ntfs => std::option::Option::Some("NTFS"),
16376 Self::Unix => std::option::Option::Some("UNIX"),
16377 Self::UnknownValue(u) => u.0.name(),
16378 }
16379 }
16380}
16381
16382impl std::default::Default for SecurityStyle {
16383 fn default() -> Self {
16384 use std::convert::From;
16385 Self::from(0)
16386 }
16387}
16388
16389impl std::fmt::Display for SecurityStyle {
16390 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16391 wkt::internal::display_enum(f, self.name(), self.value())
16392 }
16393}
16394
16395impl std::convert::From<i32> for SecurityStyle {
16396 fn from(value: i32) -> Self {
16397 match value {
16398 0 => Self::Unspecified,
16399 1 => Self::Ntfs,
16400 2 => Self::Unix,
16401 _ => Self::UnknownValue(security_style::UnknownValue(
16402 wkt::internal::UnknownEnumValue::Integer(value),
16403 )),
16404 }
16405 }
16406}
16407
16408impl std::convert::From<&str> for SecurityStyle {
16409 fn from(value: &str) -> Self {
16410 use std::string::ToString;
16411 match value {
16412 "SECURITY_STYLE_UNSPECIFIED" => Self::Unspecified,
16413 "NTFS" => Self::Ntfs,
16414 "UNIX" => Self::Unix,
16415 _ => Self::UnknownValue(security_style::UnknownValue(
16416 wkt::internal::UnknownEnumValue::String(value.to_string()),
16417 )),
16418 }
16419 }
16420}
16421
16422impl serde::ser::Serialize for SecurityStyle {
16423 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16424 where
16425 S: serde::Serializer,
16426 {
16427 match self {
16428 Self::Unspecified => serializer.serialize_i32(0),
16429 Self::Ntfs => serializer.serialize_i32(1),
16430 Self::Unix => serializer.serialize_i32(2),
16431 Self::UnknownValue(u) => u.0.serialize(serializer),
16432 }
16433 }
16434}
16435
16436impl<'de> serde::de::Deserialize<'de> for SecurityStyle {
16437 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16438 where
16439 D: serde::Deserializer<'de>,
16440 {
16441 deserializer.deserialize_any(wkt::internal::EnumVisitor::<SecurityStyle>::new(
16442 ".google.cloud.netapp.v1.SecurityStyle",
16443 ))
16444 }
16445}
16446
16447/// Actions to be restricted for a volume.
16448///
16449/// # Working with unknown values
16450///
16451/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
16452/// additional enum variants at any time. Adding new variants is not considered
16453/// a breaking change. Applications should write their code in anticipation of:
16454///
16455/// - New values appearing in future releases of the client library, **and**
16456/// - New values received dynamically, without application changes.
16457///
16458/// Please consult the [Working with enums] section in the user guide for some
16459/// guidelines.
16460///
16461/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
16462#[derive(Clone, Debug, PartialEq)]
16463#[non_exhaustive]
16464pub enum RestrictedAction {
16465 /// Unspecified restricted action
16466 Unspecified,
16467 /// Prevent volume from being deleted when mounted.
16468 Delete,
16469 /// If set, the enum was initialized with an unknown value.
16470 ///
16471 /// Applications can examine the value using [RestrictedAction::value] or
16472 /// [RestrictedAction::name].
16473 UnknownValue(restricted_action::UnknownValue),
16474}
16475
16476#[doc(hidden)]
16477pub mod restricted_action {
16478 #[allow(unused_imports)]
16479 use super::*;
16480 #[derive(Clone, Debug, PartialEq)]
16481 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
16482}
16483
16484impl RestrictedAction {
16485 /// Gets the enum value.
16486 ///
16487 /// Returns `None` if the enum contains an unknown value deserialized from
16488 /// the string representation of enums.
16489 pub fn value(&self) -> std::option::Option<i32> {
16490 match self {
16491 Self::Unspecified => std::option::Option::Some(0),
16492 Self::Delete => std::option::Option::Some(1),
16493 Self::UnknownValue(u) => u.0.value(),
16494 }
16495 }
16496
16497 /// Gets the enum value as a string.
16498 ///
16499 /// Returns `None` if the enum contains an unknown value deserialized from
16500 /// the integer representation of enums.
16501 pub fn name(&self) -> std::option::Option<&str> {
16502 match self {
16503 Self::Unspecified => std::option::Option::Some("RESTRICTED_ACTION_UNSPECIFIED"),
16504 Self::Delete => std::option::Option::Some("DELETE"),
16505 Self::UnknownValue(u) => u.0.name(),
16506 }
16507 }
16508}
16509
16510impl std::default::Default for RestrictedAction {
16511 fn default() -> Self {
16512 use std::convert::From;
16513 Self::from(0)
16514 }
16515}
16516
16517impl std::fmt::Display for RestrictedAction {
16518 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
16519 wkt::internal::display_enum(f, self.name(), self.value())
16520 }
16521}
16522
16523impl std::convert::From<i32> for RestrictedAction {
16524 fn from(value: i32) -> Self {
16525 match value {
16526 0 => Self::Unspecified,
16527 1 => Self::Delete,
16528 _ => Self::UnknownValue(restricted_action::UnknownValue(
16529 wkt::internal::UnknownEnumValue::Integer(value),
16530 )),
16531 }
16532 }
16533}
16534
16535impl std::convert::From<&str> for RestrictedAction {
16536 fn from(value: &str) -> Self {
16537 use std::string::ToString;
16538 match value {
16539 "RESTRICTED_ACTION_UNSPECIFIED" => Self::Unspecified,
16540 "DELETE" => Self::Delete,
16541 _ => Self::UnknownValue(restricted_action::UnknownValue(
16542 wkt::internal::UnknownEnumValue::String(value.to_string()),
16543 )),
16544 }
16545 }
16546}
16547
16548impl serde::ser::Serialize for RestrictedAction {
16549 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
16550 where
16551 S: serde::Serializer,
16552 {
16553 match self {
16554 Self::Unspecified => serializer.serialize_i32(0),
16555 Self::Delete => serializer.serialize_i32(1),
16556 Self::UnknownValue(u) => u.0.serialize(serializer),
16557 }
16558 }
16559}
16560
16561impl<'de> serde::de::Deserialize<'de> for RestrictedAction {
16562 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
16563 where
16564 D: serde::Deserializer<'de>,
16565 {
16566 deserializer.deserialize_any(wkt::internal::EnumVisitor::<RestrictedAction>::new(
16567 ".google.cloud.netapp.v1.RestrictedAction",
16568 ))
16569 }
16570}